diff --git a/plugins/catalog-backend-module-ai-resource-entity-model/src/AIResourceEntityV1alpha1.ts b/plugins/catalog-backend-module-ai-resource-entity-model/src/AIResourceEntityV1alpha1.ts index 2cd3907dc7..3623c75d43 100644 --- a/plugins/catalog-backend-module-ai-resource-entity-model/src/AIResourceEntityV1alpha1.ts +++ b/plugins/catalog-backend-module-ai-resource-entity-model/src/AIResourceEntityV1alpha1.ts @@ -117,24 +117,19 @@ export const isSkillAIResourceEntity = ( ): entity is SkillAIResourceEntityV1alpha1 => isAIResourceEntity(entity) && entity.spec?.type === 'skill'; -/** - * Extends the catalog model with the AIResource kind. - * - * @alpha - */ const baseRelationFields = [ { selector: { path: 'spec.owner' }, relation: 'ownedBy', defaultKind: 'Group', - defaultNamespace: 'inherit' as const, + defaultNamespace: 'inherit', allowedKinds: ['Group', 'User'], }, { selector: { path: 'spec.system' }, relation: 'partOf', defaultKind: 'System', - defaultNamespace: 'inherit' as const, + defaultNamespace: 'inherit', }, ]; @@ -172,7 +167,7 @@ export const aiResourceEntityModel = createCatalogModelLayer({ selector: { path: 'spec.dependsOn' }, relation: 'dependsOn', defaultKind: 'AIResource', - defaultNamespace: 'inherit' as const, + defaultNamespace: 'inherit', }, ], schema: { diff --git a/plugins/catalog-backend-module-ai-resource-entity-model/src/module.ts b/plugins/catalog-backend-module-ai-resource-entity-model/src/module.ts index d0c00d810d..6ccab581df 100644 --- a/plugins/catalog-backend-module-ai-resource-entity-model/src/module.ts +++ b/plugins/catalog-backend-module-ai-resource-entity-model/src/module.ts @@ -15,6 +15,7 @@ */ import { createBackendModule } from '@backstage/backend-plugin-api'; +import { CatalogModelSources } from '@backstage/catalog-model/alpha'; import { catalogModelExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; import { aiResourceEntityModel } from './AIResourceEntityV1alpha1'; @@ -32,11 +33,9 @@ export const catalogModuleAIResourceEntityModel = createBackendModule({ model: catalogModelExtensionPoint, }, async init({ model }) { - model.addModelSource({ - async *read() { - yield { data: [{ layer: aiResourceEntityModel }] }; - }, - }); + model.addModelSource( + CatalogModelSources.static([aiResourceEntityModel]), + ); }, }); },