@backstage/plugin-catalog-backend-module-puppetdb 0.2.13-next.0 → 0.2.14-next.0

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,21 @@
1
1
  # @backstage/plugin-catalog-backend-module-puppetdb
2
2
 
3
+ ## 0.2.14-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/backend-plugin-api@1.4.3-next.0
9
+ - @backstage/plugin-catalog-node@1.18.1-next.0
10
+
11
+ ## 0.2.13
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+ - @backstage/plugin-catalog-node@1.18.0
17
+ - @backstage/backend-plugin-api@1.4.2
18
+
3
19
  ## 0.2.13-next.0
4
20
 
5
21
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"catalogModulePuppetDbEntityProvider.cjs.js","sources":["../../src/module/catalogModulePuppetDbEntityProvider.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 {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\nimport { PuppetDbEntityProvider } from '../providers/PuppetDbEntityProvider';\n\n/**\n * Registers the `PuppetDbEntityProvider` with the catalog processing extension point.\n *\n * @alpha\n */\nexport const catalogModulePuppetDbEntityProvider = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'puppetdb-entity-provider',\n register(env) {\n env.registerInit({\n deps: {\n catalog: catalogProcessingExtensionPoint,\n config: coreServices.rootConfig,\n logger: coreServices.logger,\n scheduler: coreServices.scheduler,\n },\n async init({ catalog, config, logger, scheduler }) {\n catalog.addEntityProvider(\n PuppetDbEntityProvider.fromConfig(config, {\n logger,\n scheduler,\n }),\n );\n },\n });\n },\n});\n"],"names":["createBackendModule","catalogProcessingExtensionPoint","coreServices","PuppetDbEntityProvider"],"mappings":";;;;;;AA4BO,MAAM,sCAAsCA,oCAAoB,CAAA;AAAA,EACrE,QAAU,EAAA,SAAA;AAAA,EACV,QAAU,EAAA,0BAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,OAAS,EAAAC,qCAAA;AAAA,QACT,QAAQC,6BAAa,CAAA,UAAA;AAAA,QACrB,QAAQA,6BAAa,CAAA,MAAA;AAAA,QACrB,WAAWA,6BAAa,CAAA;AAAA,OAC1B;AAAA,MACA,MAAM,IAAK,CAAA,EAAE,SAAS,MAAQ,EAAA,MAAA,EAAQ,WAAa,EAAA;AACjD,QAAQ,OAAA,CAAA,iBAAA;AAAA,UACNC,6CAAA,CAAuB,WAAW,MAAQ,EAAA;AAAA,YACxC,MAAA;AAAA,YACA;AAAA,WACD;AAAA,SACH;AAAA;AACF,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
1
+ {"version":3,"file":"catalogModulePuppetDbEntityProvider.cjs.js","sources":["../../src/module/catalogModulePuppetDbEntityProvider.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 {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\nimport { PuppetDbEntityProvider } from '../providers/PuppetDbEntityProvider';\n\n/**\n * Registers the `PuppetDbEntityProvider` with the catalog processing extension point.\n *\n * @alpha\n */\nexport const catalogModulePuppetDbEntityProvider = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'puppetdb-entity-provider',\n register(env) {\n env.registerInit({\n deps: {\n catalog: catalogProcessingExtensionPoint,\n config: coreServices.rootConfig,\n logger: coreServices.logger,\n scheduler: coreServices.scheduler,\n },\n async init({ catalog, config, logger, scheduler }) {\n catalog.addEntityProvider(\n PuppetDbEntityProvider.fromConfig(config, {\n logger,\n scheduler,\n }),\n );\n },\n });\n },\n});\n"],"names":["createBackendModule","catalogProcessingExtensionPoint","coreServices","PuppetDbEntityProvider"],"mappings":";;;;;;AA4BO,MAAM,sCAAsCA,oCAAA,CAAoB;AAAA,EACrE,QAAA,EAAU,SAAA;AAAA,EACV,QAAA,EAAU,0BAAA;AAAA,EACV,SAAS,GAAA,EAAK;AACZ,IAAA,GAAA,CAAI,YAAA,CAAa;AAAA,MACf,IAAA,EAAM;AAAA,QACJ,OAAA,EAASC,qCAAA;AAAA,QACT,QAAQC,6BAAA,CAAa,UAAA;AAAA,QACrB,QAAQA,6BAAA,CAAa,MAAA;AAAA,QACrB,WAAWA,6BAAA,CAAa;AAAA,OAC1B;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,SAAS,MAAA,EAAQ,MAAA,EAAQ,WAAU,EAAG;AACjD,QAAA,OAAA,CAAQ,iBAAA;AAAA,UACNC,6CAAA,CAAuB,WAAW,MAAA,EAAQ;AAAA,YACxC,MAAA;AAAA,YACA;AAAA,WACD;AAAA,SACH;AAAA,MACF;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PuppetDbEntityProvider.cjs.js","sources":["../../src/providers/PuppetDbEntityProvider.ts"],"sourcesContent":["/*\n * Copyright 2021 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 EntityProvider,\n EntityProviderConnection,\n} from '@backstage/plugin-catalog-node';\nimport {\n PuppetDbEntityProviderConfig,\n readProviderConfigs,\n} from './PuppetDbEntityProviderConfig';\nimport { Config } from '@backstage/config';\nimport * as uuid from 'uuid';\nimport { defaultResourceTransformer, ResourceTransformer } from '../puppet';\nimport {\n ANNOTATION_LOCATION,\n ANNOTATION_ORIGIN_LOCATION,\n Entity,\n} from '@backstage/catalog-model';\nimport { merge } from 'lodash';\nimport { readPuppetNodes } from '../puppet/read';\nimport { ENDPOINT_NODES } from '../puppet/constants';\nimport {\n SchedulerService,\n SchedulerServiceTaskRunner,\n LoggerService,\n} from '@backstage/backend-plugin-api';\n\n/**\n * Reads nodes from [PuppetDB](https://www.puppet.com/docs/puppet/6/puppetdb_overview.html)\n * based on the provided query and registers them as Resource entities in the catalog.\n *\n * @public\n */\nexport class PuppetDbEntityProvider implements EntityProvider {\n private readonly config: PuppetDbEntityProviderConfig;\n private readonly logger: LoggerService;\n private readonly scheduleFn: () => Promise<void>;\n private readonly transformer: ResourceTransformer;\n private connection?: EntityProviderConnection;\n\n /**\n * Creates instances of {@link PuppetDbEntityProvider} from a configuration.\n *\n * @param config - The configuration to read provider information from.\n * @param deps - The dependencies for {@link PuppetDbEntityProvider}.\n *\n * @returns A list of {@link PuppetDbEntityProvider} instances.\n */\n static fromConfig(\n config: Config,\n deps: {\n logger: LoggerService;\n schedule?: SchedulerServiceTaskRunner;\n scheduler?: SchedulerService;\n transformer?: ResourceTransformer;\n },\n ): PuppetDbEntityProvider[] {\n if (!deps.schedule && !deps.scheduler) {\n throw new Error('Either schedule or scheduler must be provided.');\n }\n\n return readProviderConfigs(config).map(providerConfig => {\n if (!deps.schedule && !providerConfig.schedule) {\n throw new Error(\n `No schedule provided neither via code nor config for puppet-provider:${providerConfig.id}.`,\n );\n }\n\n const taskRunner =\n deps.schedule ??\n deps.scheduler!.createScheduledTaskRunner(providerConfig.schedule!);\n\n const transformer = deps.transformer ?? defaultResourceTransformer;\n\n return new PuppetDbEntityProvider(\n providerConfig,\n deps.logger,\n taskRunner,\n transformer,\n );\n });\n }\n\n /**\n * Creates an instance of {@link PuppetDbEntityProvider}.\n *\n * @param config - Configuration of the provider.\n * @param logger - The instance of a {@link @backstage/backend-plugin-api#LoggerService}.\n * @param taskRunner - The instance of {@link @backstage/backend-plugin-api#SchedulerServiceTaskRunner}.\n * @param transformer - A {@link ResourceTransformer} function.\n *\n */\n private constructor(\n config: PuppetDbEntityProviderConfig,\n logger: LoggerService,\n taskRunner: SchedulerServiceTaskRunner,\n transformer: ResourceTransformer,\n ) {\n this.config = config;\n this.logger = logger.child({\n target: this.getProviderName(),\n });\n this.scheduleFn = this.createScheduleFn(taskRunner);\n this.transformer = transformer;\n }\n\n /** {@inheritdoc @backstage/plugin-catalog-node#EntityProvider.connect} */\n async connect(connection: EntityProviderConnection): Promise<void> {\n this.connection = connection;\n await this.scheduleFn();\n }\n\n /** {@inheritdoc @backstage/plugin-catalog-node#EntityProvider.getProviderName} */\n getProviderName(): string {\n return `puppetdb-provider:${this.config.id}`;\n }\n\n /**\n * Creates a function that can be used to schedule a refresh of the catalog.\n *\n * @param taskRunner - The instance of {@link @backstage/backend-plugin-api#SchedulerServiceTaskRunner}.\n */\n private createScheduleFn(\n taskRunner: SchedulerServiceTaskRunner,\n ): () => Promise<void> {\n return async () => {\n const taskId = `${this.getProviderName()}:refresh`;\n return taskRunner.run({\n id: taskId,\n fn: async () => {\n const logger = this.logger.child({\n class: PuppetDbEntityProvider.prototype.constructor.name,\n taskId,\n taskInstanceId: uuid.v4(),\n });\n try {\n await this.refresh(logger);\n } catch (error) {\n logger.error(\n `${this.getProviderName()} refresh failed, ${error}`,\n error,\n );\n }\n },\n });\n };\n }\n\n /**\n * Refreshes the catalog by reading nodes from PuppetDB and registering them as Resource Entities.\n *\n * @param logger - The instance of a Logger.\n */\n async refresh(logger: LoggerService) {\n if (!this.connection) {\n throw new Error('Not initialized');\n }\n\n const { markReadComplete } = trackProgress(logger);\n const entities = await readPuppetNodes(this.config, {\n logger,\n transformer: this.transformer,\n });\n const { markCommitComplete } = markReadComplete(entities);\n\n await this.connection.applyMutation({\n type: 'full',\n entities: [...entities].map(entity => ({\n locationKey: this.getProviderName(),\n entity: withLocations(this.config.baseUrl, entity),\n })),\n });\n markCommitComplete(entities);\n }\n}\n\n/**\n * Ensures the entities have required annotation data.\n *\n * @param baseUrl - The base URL of the PuppetDB instance.\n * @param entity - The entity to add the annotations to.\n *\n * @returns Entity with @{@link ANNOTATION_LOCATION} and @{@link ANNOTATION_ORIGIN_LOCATION} annotations.\n */\nfunction withLocations(baseUrl: string, entity: Entity): Entity {\n const location = `${baseUrl}/${ENDPOINT_NODES}/${entity.metadata?.name}`;\n\n return merge(\n {\n metadata: {\n annotations: {\n [ANNOTATION_LOCATION]: `url:${location}`,\n [ANNOTATION_ORIGIN_LOCATION]: `url:${location}`,\n },\n },\n },\n entity,\n ) as Entity;\n}\n\n/**\n * Tracks the progress of the PuppetDB read and commit operations.\n *\n * @param logger - The instance of a {@link @backstage/backend-plugin-api#LoggerService}.\n */\nfunction trackProgress(logger: LoggerService) {\n let timestamp = Date.now();\n\n function markReadComplete(entities: Entity[]) {\n const readDuration = ((Date.now() - timestamp) / 1000).toFixed(1);\n timestamp = Date.now();\n logger.info(\n `Read ${entities?.length ?? 0} in ${readDuration} seconds. Committing...`,\n );\n return { markCommitComplete };\n }\n\n function markCommitComplete(entities: Entity[]) {\n const commitDuration = ((Date.now() - timestamp) / 1000).toFixed(1);\n logger.info(\n `Committed ${entities?.length ?? 0} in ${commitDuration} seconds.`,\n );\n }\n\n return { markReadComplete };\n}\n"],"names":["readProviderConfigs","defaultResourceTransformer","uuid","readPuppetNodes","ENDPOINT_NODES","merge","ANNOTATION_LOCATION","ANNOTATION_ORIGIN_LOCATION"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CO,MAAM,sBAAiD,CAAA;AAAA,EAC3C,MAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACT,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUR,OAAO,UACL,CAAA,MAAA,EACA,IAM0B,EAAA;AAC1B,IAAA,IAAI,CAAC,IAAA,CAAK,QAAY,IAAA,CAAC,KAAK,SAAW,EAAA;AACrC,MAAM,MAAA,IAAI,MAAM,gDAAgD,CAAA;AAAA;AAGlE,IAAA,OAAOA,gDAAoB,CAAA,MAAM,CAAE,CAAA,GAAA,CAAI,CAAkB,cAAA,KAAA;AACvD,MAAA,IAAI,CAAC,IAAA,CAAK,QAAY,IAAA,CAAC,eAAe,QAAU,EAAA;AAC9C,QAAA,MAAM,IAAI,KAAA;AAAA,UACR,CAAA,qEAAA,EAAwE,eAAe,EAAE,CAAA,CAAA;AAAA,SAC3F;AAAA;AAGF,MAAA,MAAM,aACJ,IAAK,CAAA,QAAA,IACL,KAAK,SAAW,CAAA,yBAAA,CAA0B,eAAe,QAAS,CAAA;AAEpE,MAAM,MAAA,WAAA,GAAc,KAAK,WAAe,IAAAC,uCAAA;AAExC,MAAA,OAAO,IAAI,sBAAA;AAAA,QACT,cAAA;AAAA,QACA,IAAK,CAAA,MAAA;AAAA,QACL,UAAA;AAAA,QACA;AAAA,OACF;AAAA,KACD,CAAA;AAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW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IAAA,EAAO,QAAQ,CAAA;AAAA;AAC/C;AACF,KACF;AAAA,IACA;AAAA,GACF;AACF;AAOA,SAAS,cAAc,MAAuB,EAAA;AAC5C,EAAI,IAAA,SAAA,GAAY,KAAK,GAAI,EAAA;AAEzB,EAAA,SAAS,iBAAiB,QAAoB,EAAA;AAC5C,IAAA,MAAM,iBAAiB,IAAK,CAAA,GAAA,KAAQ,SAAa,IAAA,GAAA,EAAM,QAAQ,CAAC,CAAA;AAChE,IAAA,SAAA,GAAY,KAAK,GAAI,EAAA;AACrB,IAAO,MAAA,CAAA,IAAA;AAAA,MACL,CAAQ,KAAA,EAAA,QAAA,EAAU,MAAU,IAAA,CAAC,OAAO,YAAY,CAAA,uBAAA;AAAA,KAClD;AACA,IAAA,OAAO,EAAE,kBAAmB,EAAA;AAAA;AAG9B,EAAA,SAAS,mBAAmB,QAAoB,EAAA;AAC9C,IAAA,MAAM,mBAAmB,IAAK,CAAA,GAAA,KAAQ,SAAa,IAAA,GAAA,EAAM,QAAQ,CAAC,CAAA;AAClE,IAAO,MAAA,CAAA,IAAA;AAAA,MACL,CAAa,UAAA,EAAA,QAAA,EAAU,MAAU,IAAA,CAAC,OAAO,cAAc,CAAA,SAAA;AAAA,KACzD;AAAA;AAGF,EAAA,OAAO,EAAE,gBAAiB,EAAA;AAC5B;;;;"}
1
+ {"version":3,"file":"PuppetDbEntityProvider.cjs.js","sources":["../../src/providers/PuppetDbEntityProvider.ts"],"sourcesContent":["/*\n * Copyright 2021 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 EntityProvider,\n EntityProviderConnection,\n} from '@backstage/plugin-catalog-node';\nimport {\n PuppetDbEntityProviderConfig,\n readProviderConfigs,\n} from './PuppetDbEntityProviderConfig';\nimport { Config } from '@backstage/config';\nimport * as uuid from 'uuid';\nimport { defaultResourceTransformer, ResourceTransformer } from '../puppet';\nimport {\n ANNOTATION_LOCATION,\n ANNOTATION_ORIGIN_LOCATION,\n Entity,\n} from '@backstage/catalog-model';\nimport { merge } from 'lodash';\nimport { readPuppetNodes } from '../puppet/read';\nimport { ENDPOINT_NODES } from '../puppet/constants';\nimport {\n SchedulerService,\n SchedulerServiceTaskRunner,\n LoggerService,\n} from '@backstage/backend-plugin-api';\n\n/**\n * Reads nodes from [PuppetDB](https://www.puppet.com/docs/puppet/6/puppetdb_overview.html)\n * based on the provided query and registers them as Resource entities in the catalog.\n *\n * @public\n */\nexport class PuppetDbEntityProvider implements EntityProvider {\n private readonly config: PuppetDbEntityProviderConfig;\n private readonly logger: LoggerService;\n private readonly scheduleFn: () => Promise<void>;\n private readonly transformer: ResourceTransformer;\n private connection?: EntityProviderConnection;\n\n /**\n * Creates instances of {@link PuppetDbEntityProvider} from a configuration.\n *\n * @param config - The configuration to read provider information from.\n * @param deps - The dependencies for {@link PuppetDbEntityProvider}.\n *\n * @returns A list of {@link PuppetDbEntityProvider} instances.\n */\n static fromConfig(\n config: Config,\n deps: {\n logger: LoggerService;\n schedule?: SchedulerServiceTaskRunner;\n scheduler?: SchedulerService;\n transformer?: ResourceTransformer;\n },\n ): PuppetDbEntityProvider[] {\n if (!deps.schedule && !deps.scheduler) {\n throw new Error('Either schedule or scheduler must be provided.');\n }\n\n return readProviderConfigs(config).map(providerConfig => {\n if (!deps.schedule && !providerConfig.schedule) {\n throw new Error(\n `No schedule provided neither via code nor config for puppet-provider:${providerConfig.id}.`,\n );\n }\n\n const taskRunner =\n deps.schedule ??\n deps.scheduler!.createScheduledTaskRunner(providerConfig.schedule!);\n\n const transformer = deps.transformer ?? defaultResourceTransformer;\n\n return new PuppetDbEntityProvider(\n providerConfig,\n deps.logger,\n taskRunner,\n transformer,\n );\n });\n }\n\n /**\n * Creates an instance of {@link PuppetDbEntityProvider}.\n *\n * @param config - Configuration of the provider.\n * @param logger - The instance of a {@link @backstage/backend-plugin-api#LoggerService}.\n * @param taskRunner - The instance of {@link @backstage/backend-plugin-api#SchedulerServiceTaskRunner}.\n * @param transformer - A {@link ResourceTransformer} function.\n *\n */\n private constructor(\n config: PuppetDbEntityProviderConfig,\n logger: LoggerService,\n taskRunner: SchedulerServiceTaskRunner,\n transformer: ResourceTransformer,\n ) {\n this.config = config;\n this.logger = logger.child({\n target: this.getProviderName(),\n });\n this.scheduleFn = this.createScheduleFn(taskRunner);\n this.transformer = transformer;\n }\n\n /** {@inheritdoc @backstage/plugin-catalog-node#EntityProvider.connect} */\n async connect(connection: EntityProviderConnection): Promise<void> {\n this.connection = connection;\n await this.scheduleFn();\n }\n\n /** {@inheritdoc @backstage/plugin-catalog-node#EntityProvider.getProviderName} */\n getProviderName(): string {\n return `puppetdb-provider:${this.config.id}`;\n }\n\n /**\n * Creates a function that can be used to schedule a refresh of the catalog.\n *\n * @param taskRunner - The instance of {@link @backstage/backend-plugin-api#SchedulerServiceTaskRunner}.\n */\n private createScheduleFn(\n taskRunner: SchedulerServiceTaskRunner,\n ): () => Promise<void> {\n return async () => {\n const taskId = `${this.getProviderName()}:refresh`;\n return taskRunner.run({\n id: taskId,\n fn: async () => {\n const logger = this.logger.child({\n class: PuppetDbEntityProvider.prototype.constructor.name,\n taskId,\n taskInstanceId: uuid.v4(),\n });\n try {\n await this.refresh(logger);\n } catch (error) {\n logger.error(\n `${this.getProviderName()} refresh failed, ${error}`,\n error,\n );\n }\n },\n });\n };\n }\n\n /**\n * Refreshes the catalog by reading nodes from PuppetDB and registering them as Resource Entities.\n *\n * @param logger - The instance of a Logger.\n */\n async refresh(logger: LoggerService) {\n if (!this.connection) {\n throw new Error('Not initialized');\n }\n\n const { markReadComplete } = trackProgress(logger);\n const entities = await readPuppetNodes(this.config, {\n logger,\n transformer: this.transformer,\n });\n const { markCommitComplete } = markReadComplete(entities);\n\n await this.connection.applyMutation({\n type: 'full',\n entities: [...entities].map(entity => ({\n locationKey: this.getProviderName(),\n entity: withLocations(this.config.baseUrl, entity),\n })),\n });\n markCommitComplete(entities);\n }\n}\n\n/**\n * Ensures the entities have required annotation data.\n *\n * @param baseUrl - The base URL of the PuppetDB instance.\n * @param entity - The entity to add the annotations to.\n *\n * @returns Entity with @{@link ANNOTATION_LOCATION} and @{@link ANNOTATION_ORIGIN_LOCATION} annotations.\n */\nfunction withLocations(baseUrl: string, entity: Entity): Entity {\n const location = `${baseUrl}/${ENDPOINT_NODES}/${entity.metadata?.name}`;\n\n return merge(\n {\n metadata: {\n annotations: {\n [ANNOTATION_LOCATION]: `url:${location}`,\n [ANNOTATION_ORIGIN_LOCATION]: `url:${location}`,\n },\n },\n },\n entity,\n ) as Entity;\n}\n\n/**\n * Tracks the progress of the PuppetDB read and commit operations.\n *\n * @param logger - The instance of a {@link @backstage/backend-plugin-api#LoggerService}.\n */\nfunction trackProgress(logger: LoggerService) {\n let timestamp = Date.now();\n\n function markReadComplete(entities: Entity[]) {\n const readDuration = ((Date.now() - timestamp) / 1000).toFixed(1);\n timestamp = Date.now();\n logger.info(\n `Read ${entities?.length ?? 0} in ${readDuration} seconds. Committing...`,\n );\n return { markCommitComplete };\n }\n\n function markCommitComplete(entities: Entity[]) {\n const commitDuration = ((Date.now() - timestamp) / 1000).toFixed(1);\n logger.info(\n `Committed ${entities?.length ?? 0} in ${commitDuration} seconds.`,\n );\n }\n\n return { markReadComplete };\n}\n"],"names":["readProviderConfigs","defaultResourceTransformer","uuid","readPuppetNodes","ENDPOINT_NODES","merge","ANNOTATION_LOCATION","ANNOTATION_ORIGIN_LOCATION"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CO,MAAM,sBAAA,CAAiD;AAAA,EAC3C,MAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,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CAAA;AAChE,IAAA,SAAA,GAAY,KAAK,GAAA,EAAI;AACrB,IAAA,MAAA,CAAO,IAAA;AAAA,MACL,CAAA,KAAA,EAAQ,QAAA,EAAU,MAAA,IAAU,CAAC,OAAO,YAAY,CAAA,uBAAA;AAAA,KAClD;AACA,IAAA,OAAO,EAAE,kBAAA,EAAmB;AAAA,EAC9B;AAEA,EAAA,SAAS,mBAAmB,QAAA,EAAoB;AAC9C,IAAA,MAAM,mBAAmB,IAAA,CAAK,GAAA,KAAQ,SAAA,IAAa,GAAA,EAAM,QAAQ,CAAC,CAAA;AAClE,IAAA,MAAA,CAAO,IAAA;AAAA,MACL,CAAA,UAAA,EAAa,QAAA,EAAU,MAAA,IAAU,CAAC,OAAO,cAAc,CAAA,SAAA;AAAA,KACzD;AAAA,EACF;AAEA,EAAA,OAAO,EAAE,gBAAA,EAAiB;AAC5B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PuppetDbEntityProviderConfig.cjs.js","sources":["../../src/providers/PuppetDbEntityProviderConfig.ts"],"sourcesContent":["/*\n * Copyright 2021 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 SchedulerServiceTaskScheduleDefinition,\n readSchedulerServiceTaskScheduleDefinitionFromConfig,\n} from '@backstage/backend-plugin-api';\nimport { Config } from '@backstage/config';\nimport { DEFAULT_PROVIDER_ID } from './constants';\n\n/**\n * Configuration of {@link PuppetDbEntityProvider}.\n *\n * @public\n */\nexport type PuppetDbEntityProviderConfig = {\n /**\n * ID of the provider.\n */\n id: string;\n /**\n * (Required) The base URL of PuppetDB API instance.\n */\n baseUrl: string;\n /**\n * (Optional) PQL query to filter PuppetDB nodes.\n */\n query?: string;\n /**\n * (Optional) Task schedule definition for the refresh.\n */\n schedule?: SchedulerServiceTaskScheduleDefinition;\n};\n\n/**\n * Reads the configuration of the PuppetDB Entity Providers.\n *\n * @param config - The application configuration.\n *\n * @returns PuppetDB Entity Provider configurations list.\n */\nexport function readProviderConfigs(\n config: Config,\n): PuppetDbEntityProviderConfig[] {\n const providersConfig = config.getOptionalConfig(\n 'catalog.providers.puppetdb',\n );\n if (!providersConfig) {\n return [];\n }\n\n if (providersConfig.has('baseUrl')) {\n return [readProviderConfig(DEFAULT_PROVIDER_ID, providersConfig)];\n }\n\n return providersConfig.keys().map(id => {\n return readProviderConfig(id, providersConfig.getConfig(id));\n });\n}\n\n/**\n * Reads the configuration for the PuppetDB Entity Provider.\n *\n * @param id - ID of the provider.\n * @param config - The application configuration.\n *\n * @returns The PuppetDB Entity Provider configuration.\n */\nfunction readProviderConfig(\n id: string,\n config: Config,\n): PuppetDbEntityProviderConfig {\n const baseUrl = config.getString('baseUrl').replace(/\\/+$/, '');\n const query = config.getOptionalString('query');\n\n const schedule = config.has('schedule')\n ? readSchedulerServiceTaskScheduleDefinitionFromConfig(\n config.getConfig('schedule'),\n )\n : undefined;\n\n return {\n id,\n baseUrl,\n query,\n schedule,\n };\n}\n"],"names":["DEFAULT_PROVIDER_ID","readSchedulerServiceTaskScheduleDefinitionFromConfig"],"mappings":";;;;;AAsDO,SAAS,oBACd,MACgC,EAAA;AAChC,EAAA,MAAM,kBAAkB,MAAO,CAAA,iBAAA;AAAA,IAC7B;AAAA,GACF;AACA,EAAA,IAAI,CAAC,eAAiB,EAAA;AACpB,IAAA,OAAO,EAAC;AAAA;AAGV,EAAI,IAAA,eAAA,CAAgB,GAAI,CAAA,SAAS,CAAG,EAAA;AAClC,IAAA,OAAO,CAAC,kBAAA,CAAmBA,6BAAqB,EAAA,eAAe,CAAC,CAAA;AAAA;AAGlE,EAAA,OAAO,eAAgB,CAAA,IAAA,EAAO,CAAA,GAAA,CAAI,CAAM,EAAA,KAAA;AACtC,IAAA,OAAO,kBAAmB,CAAA,EAAA,EAAI,eAAgB,CAAA,SAAA,CAAU,EAAE,CAAC,CAAA;AAAA,GAC5D,CAAA;AACH;AAUA,SAAS,kBAAA,CACP,IACA,MAC8B,EAAA;AAC9B,EAAA,MAAM,UAAU,MAAO,CAAA,SAAA,CAAU,SAAS,CAAE,CAAA,OAAA,CAAQ,QAAQ,EAAE,CAAA;AAC9D,EAAM,MAAA,KAAA,GAAQ,MAAO,CAAA,iBAAA,CAAkB,OAAO,CAAA;AAE9C,EAAA,MAAM,QAAW,GAAA,MAAA,CAAO,GAAI,CAAA,UAAU,CAClC,GAAAC,qEAAA;AAAA,IACE,MAAA,CAAO,UAAU,UAAU;AAAA,GAE7B,GAAA,KAAA,CAAA;AAEJ,EAAO,OAAA;AAAA,IACL,EAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"PuppetDbEntityProviderConfig.cjs.js","sources":["../../src/providers/PuppetDbEntityProviderConfig.ts"],"sourcesContent":["/*\n * Copyright 2021 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 SchedulerServiceTaskScheduleDefinition,\n readSchedulerServiceTaskScheduleDefinitionFromConfig,\n} from '@backstage/backend-plugin-api';\nimport { Config } from '@backstage/config';\nimport { DEFAULT_PROVIDER_ID } from './constants';\n\n/**\n * Configuration of {@link PuppetDbEntityProvider}.\n *\n * @public\n */\nexport type PuppetDbEntityProviderConfig = {\n /**\n * ID of the provider.\n */\n id: string;\n /**\n * (Required) The base URL of PuppetDB API instance.\n */\n baseUrl: string;\n /**\n * (Optional) PQL query to filter PuppetDB nodes.\n */\n query?: string;\n /**\n * (Optional) Task schedule definition for the refresh.\n */\n schedule?: SchedulerServiceTaskScheduleDefinition;\n};\n\n/**\n * Reads the configuration of the PuppetDB Entity Providers.\n *\n * @param config - The application configuration.\n *\n * @returns PuppetDB Entity Provider configurations list.\n */\nexport function readProviderConfigs(\n config: Config,\n): PuppetDbEntityProviderConfig[] {\n const providersConfig = config.getOptionalConfig(\n 'catalog.providers.puppetdb',\n );\n if (!providersConfig) {\n return [];\n }\n\n if (providersConfig.has('baseUrl')) {\n return [readProviderConfig(DEFAULT_PROVIDER_ID, providersConfig)];\n }\n\n return providersConfig.keys().map(id => {\n return readProviderConfig(id, providersConfig.getConfig(id));\n });\n}\n\n/**\n * Reads the configuration for the PuppetDB Entity Provider.\n *\n * @param id - ID of the provider.\n * @param config - The application configuration.\n *\n * @returns The PuppetDB Entity Provider configuration.\n */\nfunction readProviderConfig(\n id: string,\n config: Config,\n): PuppetDbEntityProviderConfig {\n const baseUrl = config.getString('baseUrl').replace(/\\/+$/, '');\n const query = config.getOptionalString('query');\n\n const schedule = config.has('schedule')\n ? readSchedulerServiceTaskScheduleDefinitionFromConfig(\n config.getConfig('schedule'),\n )\n : undefined;\n\n return {\n id,\n baseUrl,\n query,\n schedule,\n };\n}\n"],"names":["DEFAULT_PROVIDER_ID","readSchedulerServiceTaskScheduleDefinitionFromConfig"],"mappings":";;;;;AAsDO,SAAS,oBACd,MAAA,EACgC;AAChC,EAAA,MAAM,kBAAkB,MAAA,CAAO,iBAAA;AAAA,IAC7B;AAAA,GACF;AACA,EAAA,IAAI,CAAC,eAAA,EAAiB;AACpB,IAAA,OAAO,EAAC;AAAA,EACV;AAEA,EAAA,IAAI,eAAA,CAAgB,GAAA,CAAI,SAAS,CAAA,EAAG;AAClC,IAAA,OAAO,CAAC,kBAAA,CAAmBA,6BAAA,EAAqB,eAAe,CAAC,CAAA;AAAA,EAClE;AAEA,EAAA,OAAO,eAAA,CAAgB,IAAA,EAAK,CAAE,GAAA,CAAI,CAAA,EAAA,KAAM;AACtC,IAAA,OAAO,kBAAA,CAAmB,EAAA,EAAI,eAAA,CAAgB,SAAA,CAAU,EAAE,CAAC,CAAA;AAAA,EAC7D,CAAC,CAAA;AACH;AAUA,SAAS,kBAAA,CACP,IACA,MAAA,EAC8B;AAC9B,EAAA,MAAM,UAAU,MAAA,CAAO,SAAA,CAAU,SAAS,CAAA,CAAE,OAAA,CAAQ,QAAQ,EAAE,CAAA;AAC9D,EAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,iBAAA,CAAkB,OAAO,CAAA;AAE9C,EAAA,MAAM,QAAA,GAAW,MAAA,CAAO,GAAA,CAAI,UAAU,CAAA,GAClCC,qEAAA;AAAA,IACE,MAAA,CAAO,UAAU,UAAU;AAAA,GAC7B,GACA,MAAA;AAEJ,EAAA,OAAO;AAAA,IACL,EAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs.js","sources":["../../src/providers/constants.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\n/**\n * Name of the default provider when a using a simple configuration.\n *\n * @public\n */\nexport const DEFAULT_PROVIDER_ID = 'default';\n"],"names":[],"mappings":";;AAqBO,MAAM,mBAAsB,GAAA;;;;"}
1
+ {"version":3,"file":"constants.cjs.js","sources":["../../src/providers/constants.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\n/**\n * Name of the default provider when a using a simple configuration.\n *\n * @public\n */\nexport const DEFAULT_PROVIDER_ID = 'default';\n"],"names":[],"mappings":";;AAqBO,MAAM,mBAAA,GAAsB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs.js","sources":["../../src/puppet/constants.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\n/**\n * Annotation for specifying the certificate name of a node in PuppetDB.\n *\n * @public\n */\nexport const ANNOTATION_PUPPET_CERTNAME = 'puppet.com/certname';\n\n/**\n * Path of PuppetDB FactSets endpoint.\n */\nexport const ENDPOINT_FACTSETS = 'pdb/query/v4/factsets';\n\n/**\n * Path of PuppetDB Nodes endpoint.\n */\nexport const ENDPOINT_NODES = 'pdb/query/v4/nodes';\n\n/**\n * Default owner for entities created by the PuppetDB provider.\n *\n * @public\n */\nexport const DEFAULT_ENTITY_OWNER = 'unknown';\n"],"names":[],"mappings":";;AAqBO,MAAM,0BAA6B,GAAA;AAKnC,MAAM,iBAAoB,GAAA;AAK1B,MAAM,cAAiB,GAAA;AAOvB,MAAM,oBAAuB,GAAA;;;;;;;"}
1
+ {"version":3,"file":"constants.cjs.js","sources":["../../src/puppet/constants.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\n/**\n * Annotation for specifying the certificate name of a node in PuppetDB.\n *\n * @public\n */\nexport const ANNOTATION_PUPPET_CERTNAME = 'puppet.com/certname';\n\n/**\n * Path of PuppetDB FactSets endpoint.\n */\nexport const ENDPOINT_FACTSETS = 'pdb/query/v4/factsets';\n\n/**\n * Path of PuppetDB Nodes endpoint.\n */\nexport const ENDPOINT_NODES = 'pdb/query/v4/nodes';\n\n/**\n * Default owner for entities created by the PuppetDB provider.\n *\n * @public\n */\nexport const DEFAULT_ENTITY_OWNER = 'unknown';\n"],"names":[],"mappings":";;AAqBO,MAAM,0BAAA,GAA6B;AAKnC,MAAM,iBAAA,GAAoB;AAK1B,MAAM,cAAA,GAAiB;AAOvB,MAAM,oBAAA,GAAuB;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"read.cjs.js","sources":["../../src/puppet/read.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 { PuppetDbEntityProviderConfig } from '../providers/PuppetDbEntityProviderConfig';\nimport { PuppetNode, ResourceTransformer } from './types';\nimport { ResourceEntity } from '@backstage/catalog-model';\nimport { defaultResourceTransformer } from './transformers';\nimport { ResponseError } from '@backstage/errors';\nimport { ENDPOINT_FACTSETS } from './constants';\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\n/**\n * Reads nodes and their facts from PuppetDB.\n *\n * @param config - The provider configuration.\n * @param opts - Additional options.\n */\nexport async function readPuppetNodes(\n config: PuppetDbEntityProviderConfig,\n opts?: {\n transformer?: ResourceTransformer;\n logger?: LoggerService;\n },\n): Promise<ResourceEntity[]> {\n const transformFn = opts?.transformer ?? defaultResourceTransformer;\n const url = new URL(ENDPOINT_FACTSETS, config.baseUrl);\n\n if (config.query) {\n url.searchParams.set('query', config.query);\n }\n\n if (opts?.logger) {\n opts.logger.debug('Reading nodes from PuppetDB', { url: url.toString() });\n }\n\n const response = await fetch(url.toString(), {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n },\n });\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n const nodes = (await response.json()) as PuppetNode[];\n const entities: ResourceEntity[] = [];\n\n for (const node of nodes) {\n const entity = await transformFn(node, config);\n if (entity) {\n entities.push(entity);\n }\n }\n\n return entities;\n}\n"],"names":["defaultResourceTransformer","ENDPOINT_FACTSETS","ResponseError"],"mappings":";;;;;;AA8BsB,eAAA,eAAA,CACpB,QACA,IAI2B,EAAA;AAC3B,EAAM,MAAA,WAAA,GAAc,MAAM,WAAe,IAAAA,uCAAA;AACzC,EAAA,MAAM,GAAM,GAAA,IAAI,GAAI,CAAAC,2BAAA,EAAmB,OAAO,OAAO,CAAA;AAErD,EAAA,IAAI,OAAO,KAAO,EAAA;AAChB,IAAA,GAAA,CAAI,YAAa,CAAA,GAAA,CAAI,OAAS,EAAA,MAAA,CAAO,KAAK,CAAA;AAAA;AAG5C,EAAA,IAAI,MAAM,MAAQ,EAAA;AAChB,IAAK,IAAA,CAAA,MAAA,CAAO,MAAM,6BAA+B,EAAA,EAAE,KAAK,GAAI,CAAA,QAAA,IAAY,CAAA;AAAA;AAG1E,EAAA,MAAM,QAAW,GAAA,MAAM,KAAM,CAAA,GAAA,CAAI,UAAY,EAAA;AAAA,IAC3C,MAAQ,EAAA,KAAA;AAAA,IACR,OAAS,EAAA;AAAA,MACP,cAAgB,EAAA,kBAAA;AAAA,MAChB,MAAQ,EAAA;AAAA;AACV,GACD,CAAA;AAED,EAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,IAAM,MAAA,MAAMC,oBAAc,CAAA,YAAA,CAAa,QAAQ,CAAA;AAAA;AAGjD,EAAM,MAAA,KAAA,GAAS,MAAM,QAAA,CAAS,IAAK,EAAA;AACnC,EAAA,MAAM,WAA6B,EAAC;AAEpC,EAAA,KAAA,MAAW,QAAQ,KAAO,EAAA;AACxB,IAAA,MAAM,MAAS,GAAA,MAAM,WAAY,CAAA,IAAA,EAAM,MAAM,CAAA;AAC7C,IAAA,IAAI,MAAQ,EAAA;AACV,MAAA,QAAA,CAAS,KAAK,MAAM,CAAA;AAAA;AACtB;AAGF,EAAO,OAAA,QAAA;AACT;;;;"}
1
+ {"version":3,"file":"read.cjs.js","sources":["../../src/puppet/read.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 { PuppetDbEntityProviderConfig } from '../providers/PuppetDbEntityProviderConfig';\nimport { PuppetNode, ResourceTransformer } from './types';\nimport { ResourceEntity } from '@backstage/catalog-model';\nimport { defaultResourceTransformer } from './transformers';\nimport { ResponseError } from '@backstage/errors';\nimport { ENDPOINT_FACTSETS } from './constants';\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\n/**\n * Reads nodes and their facts from PuppetDB.\n *\n * @param config - The provider configuration.\n * @param opts - Additional options.\n */\nexport async function readPuppetNodes(\n config: PuppetDbEntityProviderConfig,\n opts?: {\n transformer?: ResourceTransformer;\n logger?: LoggerService;\n },\n): Promise<ResourceEntity[]> {\n const transformFn = opts?.transformer ?? defaultResourceTransformer;\n const url = new URL(ENDPOINT_FACTSETS, config.baseUrl);\n\n if (config.query) {\n url.searchParams.set('query', config.query);\n }\n\n if (opts?.logger) {\n opts.logger.debug('Reading nodes from PuppetDB', { url: url.toString() });\n }\n\n const response = await fetch(url.toString(), {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n },\n });\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n const nodes = (await response.json()) as PuppetNode[];\n const entities: ResourceEntity[] = [];\n\n for (const node of nodes) {\n const entity = await transformFn(node, config);\n if (entity) {\n entities.push(entity);\n }\n }\n\n return entities;\n}\n"],"names":["defaultResourceTransformer","ENDPOINT_FACTSETS","ResponseError"],"mappings":";;;;;;AA8BA,eAAsB,eAAA,CACpB,QACA,IAAA,EAI2B;AAC3B,EAAA,MAAM,WAAA,GAAc,MAAM,WAAA,IAAeA,uCAAA;AACzC,EAAA,MAAM,GAAA,GAAM,IAAI,GAAA,CAAIC,2BAAA,EAAmB,OAAO,OAAO,CAAA;AAErD,EAAA,IAAI,OAAO,KAAA,EAAO;AAChB,IAAA,GAAA,CAAI,YAAA,CAAa,GAAA,CAAI,OAAA,EAAS,MAAA,CAAO,KAAK,CAAA;AAAA,EAC5C;AAEA,EAAA,IAAI,MAAM,MAAA,EAAQ;AAChB,IAAA,IAAA,CAAK,MAAA,CAAO,MAAM,6BAAA,EAA+B,EAAE,KAAK,GAAA,CAAI,QAAA,IAAY,CAAA;AAAA,EAC1E;AAEA,EAAA,MAAM,QAAA,GAAW,MAAM,KAAA,CAAM,GAAA,CAAI,UAAS,EAAG;AAAA,IAC3C,MAAA,EAAQ,KAAA;AAAA,IACR,OAAA,EAAS;AAAA,MACP,cAAA,EAAgB,kBAAA;AAAA,MAChB,MAAA,EAAQ;AAAA;AACV,GACD,CAAA;AAED,EAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,IAAA,MAAM,MAAMC,oBAAA,CAAc,YAAA,CAAa,QAAQ,CAAA;AAAA,EACjD;AAEA,EAAA,MAAM,KAAA,GAAS,MAAM,QAAA,CAAS,IAAA,EAAK;AACnC,EAAA,MAAM,WAA6B,EAAC;AAEpC,EAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACxB,IAAA,MAAM,MAAA,GAAS,MAAM,WAAA,CAAY,IAAA,EAAM,MAAM,CAAA;AAC7C,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,QAAA,CAAS,KAAK,MAAM,CAAA;AAAA,IACtB;AAAA,EACF;AAEA,EAAA,OAAO,QAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"transformers.cjs.js","sources":["../../src/puppet/transformers.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 { ResourceTransformer } from './types';\nimport { DEFAULT_NAMESPACE, ResourceEntity } from '@backstage/catalog-model';\nimport { ANNOTATION_PUPPET_CERTNAME, DEFAULT_ENTITY_OWNER } from './constants';\n\n/**\n * A default implementation of the {@link ResourceTransformer}.\n *\n * @param node - The found PuppetDB node entry in its source format. This is the entry that you want to transform.\n * @param _config - The configuration for the entity provider.\n *\n * @returns A `ResourceEntity`.\n *\n * @public\n */\nexport const defaultResourceTransformer: ResourceTransformer = async (\n node,\n _config,\n): Promise<ResourceEntity | undefined> => {\n const certName = node.certname.toLocaleLowerCase('en-US');\n const type = node.facts?.data?.find(e => e.name === 'is_virtual')?.value\n ? 'virtual-machine'\n : 'physical-server';\n const kernel = node.facts?.data?.find(e => e.name === 'kernel')?.value;\n const latest_report_status = node.latest_report_status;\n\n return {\n apiVersion: 'backstage.io/v1beta1',\n kind: 'Resource',\n metadata: {\n name: certName,\n annotations: {\n [ANNOTATION_PUPPET_CERTNAME]: certName,\n },\n namespace: DEFAULT_NAMESPACE,\n description: node.facts?.data\n ?.find(e => e.name === 'ipaddress')\n ?.value?.toString(),\n tags: kernel\n ? [\n kernel.toString().toLocaleLowerCase('en-US'),\n latest_report_status.toString().toLocaleLowerCase('en-US'),\n ]\n : [],\n },\n spec: {\n type: type,\n owner: DEFAULT_ENTITY_OWNER,\n dependsOn: [],\n dependencyOf: [],\n },\n };\n};\n"],"names":["ANNOTATION_PUPPET_CERTNAME","DEFAULT_NAMESPACE","DEFAULT_ENTITY_OWNER"],"mappings":";;;;;AA8Ba,MAAA,0BAAA,GAAkD,OAC7D,IAAA,EACA,OACwC,KAAA;AACxC,EAAA,MAAM,QAAW,GAAA,IAAA,CAAK,QAAS,CAAA,iBAAA,CAAkB,OAAO,CAAA;AACxD,EAAM,MAAA,IAAA,GAAO,IAAK,CAAA,KAAA,EAAO,IAAM,EAAA,IAAA,CAAK,CAAK,CAAA,KAAA,CAAA,CAAE,IAAS,KAAA,YAAY,CAAG,EAAA,KAAA,GAC/D,iBACA,GAAA,iBAAA;AACJ,EAAM,MAAA,MAAA,GAAS,KAAK,KAAO,EAAA,IAAA,EAAM,KAAK,CAAK,CAAA,KAAA,CAAA,CAAE,IAAS,KAAA,QAAQ,CAAG,EAAA,KAAA;AACjE,EAAA,MAAM,uBAAuB,IAAK,CAAA,oBAAA;AAElC,EAAO,OAAA;AAAA,IACL,UAAY,EAAA,sBAAA;AAAA,IACZ,IAAM,EAAA,UAAA;AAAA,IACN,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,QAAA;AAAA,MACN,WAAa,EAAA;AAAA,QACX,CAACA,oCAA0B,GAAG;AAAA,OAChC;AAAA,MACA,SAAW,EAAAC,8BAAA;AAAA,MACX,WAAA,EAAa,IAAK,CAAA,KAAA,EAAO,IACrB,EAAA,IAAA,CAAK,CAAK,CAAA,KAAA,CAAA,CAAE,IAAS,KAAA,WAAW,CAChC,EAAA,KAAA,EAAO,QAAS,EAAA;AAAA,MACpB,MAAM,MACF,GAAA;AAAA,QACE,MAAO,CAAA,QAAA,EAAW,CAAA,iBAAA,CAAkB,OAAO,CAAA;AAAA,QAC3C,oBAAqB,CAAA,QAAA,EAAW,CAAA,iBAAA,CAAkB,OAAO;AAAA,UAE3D;AAAC,KACP;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,IAAA;AAAA,MACA,KAAO,EAAAC,8BAAA;AAAA,MACP,WAAW,EAAC;AAAA,MACZ,cAAc;AAAC;AACjB,GACF;AACF;;;;"}
1
+ {"version":3,"file":"transformers.cjs.js","sources":["../../src/puppet/transformers.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 { ResourceTransformer } from './types';\nimport { DEFAULT_NAMESPACE, ResourceEntity } from '@backstage/catalog-model';\nimport { ANNOTATION_PUPPET_CERTNAME, DEFAULT_ENTITY_OWNER } from './constants';\n\n/**\n * A default implementation of the {@link ResourceTransformer}.\n *\n * @param node - The found PuppetDB node entry in its source format. This is the entry that you want to transform.\n * @param _config - The configuration for the entity provider.\n *\n * @returns A `ResourceEntity`.\n *\n * @public\n */\nexport const defaultResourceTransformer: ResourceTransformer = async (\n node,\n _config,\n): Promise<ResourceEntity | undefined> => {\n const certName = node.certname.toLocaleLowerCase('en-US');\n const type = node.facts?.data?.find(e => e.name === 'is_virtual')?.value\n ? 'virtual-machine'\n : 'physical-server';\n const kernel = node.facts?.data?.find(e => e.name === 'kernel')?.value;\n const latest_report_status = node.latest_report_status;\n\n return {\n apiVersion: 'backstage.io/v1beta1',\n kind: 'Resource',\n metadata: {\n name: certName,\n annotations: {\n [ANNOTATION_PUPPET_CERTNAME]: certName,\n },\n namespace: DEFAULT_NAMESPACE,\n description: node.facts?.data\n ?.find(e => e.name === 'ipaddress')\n ?.value?.toString(),\n tags: kernel\n ? [\n kernel.toString().toLocaleLowerCase('en-US'),\n latest_report_status.toString().toLocaleLowerCase('en-US'),\n ]\n : [],\n },\n spec: {\n type: type,\n owner: DEFAULT_ENTITY_OWNER,\n dependsOn: [],\n dependencyOf: [],\n },\n };\n};\n"],"names":["ANNOTATION_PUPPET_CERTNAME","DEFAULT_NAMESPACE","DEFAULT_ENTITY_OWNER"],"mappings":";;;;;AA8BO,MAAM,0BAAA,GAAkD,OAC7D,IAAA,EACA,OAAA,KACwC;AACxC,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,QAAA,CAAS,iBAAA,CAAkB,OAAO,CAAA;AACxD,EAAA,MAAM,IAAA,GAAO,IAAA,CAAK,KAAA,EAAO,IAAA,EAAM,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,KAAS,YAAY,CAAA,EAAG,KAAA,GAC/D,iBAAA,GACA,iBAAA;AACJ,EAAA,MAAM,MAAA,GAAS,KAAK,KAAA,EAAO,IAAA,EAAM,KAAK,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,KAAS,QAAQ,CAAA,EAAG,KAAA;AACjE,EAAA,MAAM,uBAAuB,IAAA,CAAK,oBAAA;AAElC,EAAA,OAAO;AAAA,IACL,UAAA,EAAY,sBAAA;AAAA,IACZ,IAAA,EAAM,UAAA;AAAA,IACN,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EAAa;AAAA,QACX,CAACA,oCAA0B,GAAG;AAAA,OAChC;AAAA,MACA,SAAA,EAAWC,8BAAA;AAAA,MACX,WAAA,EAAa,IAAA,CAAK,KAAA,EAAO,IAAA,EACrB,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,KAAS,WAAW,CAAA,EAChC,KAAA,EAAO,QAAA,EAAS;AAAA,MACpB,MAAM,MAAA,GACF;AAAA,QACE,MAAA,CAAO,QAAA,EAAS,CAAE,iBAAA,CAAkB,OAAO,CAAA;AAAA,QAC3C,oBAAA,CAAqB,QAAA,EAAS,CAAE,iBAAA,CAAkB,OAAO;AAAA,UAE3D;AAAC,KACP;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,IAAA;AAAA,MACA,KAAA,EAAOC,8BAAA;AAAA,MACP,WAAW,EAAC;AAAA,MACZ,cAAc;AAAC;AACjB,GACF;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-backend-module-puppetdb",
3
- "version": "0.2.13-next.0",
3
+ "version": "0.2.14-next.0",
4
4
  "description": "A Backstage catalog backend module that helps integrate towards PuppetDB",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -65,19 +65,19 @@
65
65
  "test": "backstage-cli package test"
66
66
  },
67
67
  "dependencies": {
68
- "@backstage/backend-plugin-api": "1.4.2-next.0",
68
+ "@backstage/backend-plugin-api": "1.4.3-next.0",
69
69
  "@backstage/catalog-model": "1.7.5",
70
70
  "@backstage/config": "1.3.3",
71
71
  "@backstage/errors": "1.2.7",
72
- "@backstage/plugin-catalog-node": "1.18.0-next.0",
72
+ "@backstage/plugin-catalog-node": "1.18.1-next.0",
73
73
  "@backstage/types": "1.2.1",
74
74
  "lodash": "^4.17.21",
75
75
  "luxon": "^3.0.0",
76
76
  "uuid": "^11.0.0"
77
77
  },
78
78
  "devDependencies": {
79
- "@backstage/backend-test-utils": "1.7.1-next.0",
80
- "@backstage/cli": "0.33.2-next.0",
79
+ "@backstage/backend-test-utils": "1.9.0-next.1",
80
+ "@backstage/cli": "0.34.2-next.1",
81
81
  "@types/lodash": "^4.14.151",
82
82
  "msw": "^1.0.0"
83
83
  },