diff --git a/src/commands/asset-registry/asset-registry.interfaces.ts b/src/commands/asset-registry/asset-registry.interfaces.ts index 6fbea62..aa0ba8b 100644 --- a/src/commands/asset-registry/asset-registry.interfaces.ts +++ b/src/commands/asset-registry/asset-registry.interfaces.ts @@ -25,6 +25,7 @@ export interface AssetEndpoints { schema: string; validate: string; examples?: string; + skills?: string; } export interface AssetContributions { diff --git a/src/commands/asset-registry/asset-registry.service.ts b/src/commands/asset-registry/asset-registry.service.ts index 59bdae7..70c93cf 100644 --- a/src/commands/asset-registry/asset-registry.service.ts +++ b/src/commands/asset-registry/asset-registry.service.ts @@ -176,5 +176,8 @@ export class AssetRegistryService { if (descriptor.endpoints.examples) { logger.info(` examples: ${descriptor.endpoints.examples}`); } + if (descriptor.endpoints.skills) { + logger.info(` skills: ${descriptor.endpoints.skills}`); + } } } diff --git a/tests/commands/asset-registry/asset-registry-get.spec.ts b/tests/commands/asset-registry/asset-registry-get.spec.ts index c1366b1..6d863d3 100644 --- a/tests/commands/asset-registry/asset-registry-get.spec.ts +++ b/tests/commands/asset-registry/asset-registry-get.spec.ts @@ -38,6 +38,7 @@ describe("Asset registry get", () => { expect.stringContaining("/validate/board_v2"), ]) ); + expect(messages.join("\n")).not.toContain("skills:"); }); it("Should get a specific asset type as JSON", async () => { @@ -71,6 +72,26 @@ describe("Asset registry get", () => { ); }); + it("Should include the skills endpoint when present", async () => { + const descriptorWithSkillsEndpoint: AssetRegistryDescriptor = { + ...boardDescriptor, + endpoints: { + ...boardDescriptor.endpoints, + skills: "/skills/board_v2", + }, + }; + mockAxiosGet("https://myTeam.celonis.cloud/pacman/api/core/asset-registry/types/BOARD_V2", descriptorWithSkillsEndpoint); + + await new AssetRegistryService(testContext).getType("BOARD_V2", false); + + const messages = loggingTestTransport.logMessages.map((m) => m.message); + expect(messages).toEqual( + expect.arrayContaining([ + expect.stringContaining("/skills/board_v2"), + ]) + ); + }); + it("Should omit optional endpoints when absent", async () => { const descriptorWithoutOptionals: AssetRegistryDescriptor = { ...boardDescriptor,