@backstage/plugin-catalog-backend-module-scaffolder-entity-model 0.2.11-next.0 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @backstage/plugin-catalog-backend-module-scaffolder-entity-model
2
2
 
3
+ ## 0.2.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/plugin-scaffolder-common@1.7.0
9
+ - @backstage/plugin-catalog-node@1.18.0
10
+ - @backstage/backend-plugin-api@1.4.2
11
+
3
12
  ## 0.2.11-next.0
4
13
 
5
14
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\nimport { ScaffolderEntitiesProcessor } from './processor';\n\n/**\n * Registers support for the scaffolder specific entity model (e.g. the Template\n * kind) to the catalog backend plugin.\n *\n * @public\n */\nexport const catalogModuleScaffolderEntityModel = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'scaffolder-entity-model',\n register(env) {\n env.registerInit({\n deps: {\n catalog: catalogProcessingExtensionPoint,\n },\n async init({ catalog }) {\n catalog.addProcessor(new ScaffolderEntitiesProcessor());\n },\n });\n },\n});\n"],"names":["createBackendModule","catalogProcessingExtensionPoint","ScaffolderEntitiesProcessor"],"mappings":";;;;;;AA0BO,MAAM,qCAAqCA,oCAAoB,CAAA;AAAA,EACpE,QAAU,EAAA,SAAA;AAAA,EACV,QAAU,EAAA,yBAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,OAAS,EAAAC;AAAA,OACX;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,OAAA,EAAW,EAAA;AACtB,QAAQ,OAAA,CAAA,YAAA,CAAa,IAAIC,uDAAA,EAA6B,CAAA;AAAA;AACxD,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
1
+ {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\nimport { ScaffolderEntitiesProcessor } from './processor';\n\n/**\n * Registers support for the scaffolder specific entity model (e.g. the Template\n * kind) to the catalog backend plugin.\n *\n * @public\n */\nexport const catalogModuleScaffolderEntityModel = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'scaffolder-entity-model',\n register(env) {\n env.registerInit({\n deps: {\n catalog: catalogProcessingExtensionPoint,\n },\n async init({ catalog }) {\n catalog.addProcessor(new ScaffolderEntitiesProcessor());\n },\n });\n },\n});\n"],"names":["createBackendModule","catalogProcessingExtensionPoint","ScaffolderEntitiesProcessor"],"mappings":";;;;;;AA0BO,MAAM,qCAAqCA,oCAAA,CAAoB;AAAA,EACpE,QAAA,EAAU,SAAA;AAAA,EACV,QAAA,EAAU,yBAAA;AAAA,EACV,SAAS,GAAA,EAAK;AACZ,IAAA,GAAA,CAAI,YAAA,CAAa;AAAA,MACf,IAAA,EAAM;AAAA,QACJ,OAAA,EAASC;AAAA,OACX;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,OAAA,EAAQ,EAAG;AACtB,QAAA,OAAA,CAAQ,YAAA,CAAa,IAAIC,uDAAA,EAA6B,CAAA;AAAA,MACxD;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScaffolderEntitiesProcessor.cjs.js","sources":["../../src/processor/ScaffolderEntitiesProcessor.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n getCompoundEntityRef,\n parseEntityRef,\n RELATION_OWNED_BY,\n RELATION_OWNER_OF,\n} from '@backstage/catalog-model';\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n processingResult,\n} from '@backstage/plugin-catalog-node';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport {\n TemplateEntityV1beta3,\n templateEntityV1beta3Validator,\n} from '@backstage/plugin-scaffolder-common';\n\n/**\n * Adds support for scaffolder specific entity kinds to the catalog.\n *\n * @public\n */\nexport class ScaffolderEntitiesProcessor implements CatalogProcessor {\n getProcessorName(): string {\n return 'ScaffolderEntitiesProcessor';\n }\n\n private readonly validators = [templateEntityV1beta3Validator];\n\n async validateEntityKind(entity: Entity): Promise<boolean> {\n for (const validator of this.validators) {\n if (await validator.check(entity)) {\n return true;\n }\n }\n\n return false;\n }\n\n async postProcessEntity(\n entity: Entity,\n _location: LocationSpec,\n emit: CatalogProcessorEmit,\n ): Promise<Entity> {\n const selfRef = getCompoundEntityRef(entity);\n\n if (\n entity.apiVersion === 'scaffolder.backstage.io/v1beta3' &&\n entity.kind === 'Template'\n ) {\n const template = entity as TemplateEntityV1beta3;\n\n const target = template.spec.owner;\n if (target) {\n const targetRef = parseEntityRef(target, {\n defaultKind: 'Group',\n defaultNamespace: selfRef.namespace,\n });\n emit(\n processingResult.relation({\n source: selfRef,\n type: RELATION_OWNED_BY,\n target: {\n kind: targetRef.kind,\n namespace: targetRef.namespace,\n name: targetRef.name,\n },\n }),\n );\n emit(\n processingResult.relation({\n source: {\n kind: targetRef.kind,\n namespace: targetRef.namespace,\n name: targetRef.name,\n },\n type: RELATION_OWNER_OF,\n target: selfRef,\n }),\n );\n }\n }\n\n return entity;\n }\n}\n"],"names":["templateEntityV1beta3Validator","getCompoundEntityRef","parseEntityRef","processingResult","RELATION_OWNED_BY","RELATION_OWNER_OF"],"mappings":";;;;;;AAuCO,MAAM,2BAAwD,CAAA;AAAA,EACnE,gBAA2B,GAAA;AACzB,IAAO,OAAA,6BAAA;AAAA;AACT,EAEiB,UAAA,GAAa,CAACA,qDAA8B,CAAA;AAAA,EAE7D,MAAM,mBAAmB,MAAkC,EAAA;AACzD,IAAW,KAAA,MAAA,SAAA,IAAa,KAAK,UAAY,EAAA;AACvC,MAAA,IAAI,MAAM,SAAA,CAAU,KAAM,CAAA,MAAM,CAAG,EAAA;AACjC,QAAO,OAAA,IAAA;AAAA;AACT;AAGF,IAAO,OAAA,KAAA;AAAA;AACT,EAEA,MAAM,iBAAA,CACJ,MACA,EAAA,SAAA,EACA,IACiB,EAAA;AACjB,IAAM,MAAA,OAAA,GAAUC,kCAAqB,MAAM,CAAA;AAE3C,IAAA,IACE,MAAO,CAAA,UAAA,KAAe,iCACtB,IAAA,MAAA,CAAO,SAAS,UAChB,EAAA;AACA,MAAA,MAAM,QAAW,GAAA,MAAA;AAEjB,MAAM,MAAA,MAAA,GAAS,SAAS,IAAK,CAAA,KAAA;AAC7B,MAAA,IAAI,MAAQ,EAAA;AACV,QAAM,MAAA,SAAA,GAAYC,4BAAe,MAAQ,EAAA;AAAA,UACvC,WAAa,EAAA,OAAA;AAAA,UACb,kBAAkB,OAAQ,CAAA;AAAA,SAC3B,CAAA;AACD,QAAA,IAAA;AAAA,UACEC,mCAAiB,QAAS,CAAA;AAAA,YACxB,MAAQ,EAAA,OAAA;AAAA,YACR,IAAM,EAAAC,8BAAA;AAAA,YACN,MAAQ,EAAA;AAAA,cACN,MAAM,SAAU,CAAA,IAAA;AAAA,cAChB,WAAW,SAAU,CAAA,SAAA;AAAA,cACrB,MAAM,SAAU,CAAA;AAAA;AAClB,WACD;AAAA,SACH;AACA,QAAA,IAAA;AAAA,UACED,mCAAiB,QAAS,CAAA;AAAA,YACxB,MAAQ,EAAA;AAAA,cACN,MAAM,SAAU,CAAA,IAAA;AAAA,cAChB,WAAW,SAAU,CAAA,SAAA;AAAA,cACrB,MAAM,SAAU,CAAA;AAAA,aAClB;AAAA,YACA,IAAM,EAAAE,8BAAA;AAAA,YACN,MAAQ,EAAA;AAAA,WACT;AAAA,SACH;AAAA;AACF;AAGF,IAAO,OAAA,MAAA;AAAA;AAEX;;;;"}
1
+ {"version":3,"file":"ScaffolderEntitiesProcessor.cjs.js","sources":["../../src/processor/ScaffolderEntitiesProcessor.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n getCompoundEntityRef,\n parseEntityRef,\n RELATION_OWNED_BY,\n RELATION_OWNER_OF,\n} from '@backstage/catalog-model';\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n processingResult,\n} from '@backstage/plugin-catalog-node';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport {\n TemplateEntityV1beta3,\n templateEntityV1beta3Validator,\n} from '@backstage/plugin-scaffolder-common';\n\n/**\n * Adds support for scaffolder specific entity kinds to the catalog.\n *\n * @public\n */\nexport class ScaffolderEntitiesProcessor implements CatalogProcessor {\n getProcessorName(): string {\n return 'ScaffolderEntitiesProcessor';\n }\n\n private readonly validators = [templateEntityV1beta3Validator];\n\n async validateEntityKind(entity: Entity): Promise<boolean> {\n for (const validator of this.validators) {\n if (await validator.check(entity)) {\n return true;\n }\n }\n\n return false;\n }\n\n async postProcessEntity(\n entity: Entity,\n _location: LocationSpec,\n emit: CatalogProcessorEmit,\n ): Promise<Entity> {\n const selfRef = getCompoundEntityRef(entity);\n\n if (\n entity.apiVersion === 'scaffolder.backstage.io/v1beta3' &&\n entity.kind === 'Template'\n ) {\n const template = entity as TemplateEntityV1beta3;\n\n const target = template.spec.owner;\n if (target) {\n const targetRef = parseEntityRef(target, {\n defaultKind: 'Group',\n defaultNamespace: selfRef.namespace,\n });\n emit(\n processingResult.relation({\n source: selfRef,\n type: RELATION_OWNED_BY,\n target: {\n kind: targetRef.kind,\n namespace: targetRef.namespace,\n name: targetRef.name,\n },\n }),\n );\n emit(\n processingResult.relation({\n source: {\n kind: targetRef.kind,\n namespace: targetRef.namespace,\n name: targetRef.name,\n },\n type: RELATION_OWNER_OF,\n target: selfRef,\n }),\n );\n }\n }\n\n return entity;\n }\n}\n"],"names":["templateEntityV1beta3Validator","getCompoundEntityRef","parseEntityRef","processingResult","RELATION_OWNED_BY","RELATION_OWNER_OF"],"mappings":";;;;;;AAuCO,MAAM,2BAAA,CAAwD;AAAA,EACnE,gBAAA,GAA2B;AACzB,IAAA,OAAO,6BAAA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BAAA;AAAA,YACN,MAAA,EAAQ;AAAA,WACT;AAAA,SACH;AAAA,MACF;AAAA,IACF;AAEA,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-backend-module-scaffolder-entity-model",
3
- "version": "0.2.11-next.0",
3
+ "version": "0.2.11",
4
4
  "description": "Adds support for the scaffolder specific entity model (e.g. the Template kind) to the catalog backend plugin.",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -50,14 +50,14 @@
50
50
  "test": "backstage-cli package test"
51
51
  },
52
52
  "dependencies": {
53
- "@backstage/backend-plugin-api": "1.4.2-next.0",
54
- "@backstage/catalog-model": "1.7.5",
55
- "@backstage/plugin-catalog-common": "1.1.5",
56
- "@backstage/plugin-catalog-node": "1.18.0-next.0",
57
- "@backstage/plugin-scaffolder-common": "1.7.0-next.0"
53
+ "@backstage/backend-plugin-api": "^1.4.2",
54
+ "@backstage/catalog-model": "^1.7.5",
55
+ "@backstage/plugin-catalog-common": "^1.1.5",
56
+ "@backstage/plugin-catalog-node": "^1.18.0",
57
+ "@backstage/plugin-scaffolder-common": "^1.7.0"
58
58
  },
59
59
  "devDependencies": {
60
- "@backstage/backend-test-utils": "1.7.1-next.0",
61
- "@backstage/cli": "0.33.2-next.0"
60
+ "@backstage/backend-test-utils": "^1.8.0",
61
+ "@backstage/cli": "^0.34.0"
62
62
  }
63
63
  }