@backstage-community/plugin-tech-insights-backend 2.1.1 → 2.2.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,31 @@
1
1
  # @backstage-community/plugin-tech-insights-backend
2
2
 
3
+ ## 2.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e919e53: Backstage version bump to v1.35.1
8
+
9
+ ### Patch Changes
10
+
11
+ - f015469: Introducing a new tech insights react plugin for reusuable frontend utilities. All migrated components and APIs have been marked as deprecated. Please update your imports to come from `@backstage-community/plugin-tech-insights-react`
12
+
13
+ Package json files for each plugin have been updated to reflect the new plugin in the Backstage `pluginPackages` metadata.
14
+
15
+ - c107e0f: Deprecates `TechInsightCheck` from the `tech-insights-node` library in favor of `Check` coming from the `tech-insights-common` library.
16
+
17
+ With this change comes a refactor of `Check` from a type to an interface.
18
+
19
+ The `TechInsightCheck` interface will be removed from the `tech-insights-node` plugin in it's next major release.
20
+
21
+ Importing `Check` from `@backstage-community/plugin-tech-insights-common/client` has been deprecated in favor of importing directly from `@backstage-community/plugin-tech-insights-common`.
22
+
23
+ - Updated dependencies [f015469]
24
+ - Updated dependencies [e919e53]
25
+ - Updated dependencies [c107e0f]
26
+ - @backstage-community/plugin-tech-insights-common@0.5.0
27
+ - @backstage-community/plugin-tech-insights-node@2.3.0
28
+
3
29
  ## 2.1.1
4
30
 
5
31
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
2
  import { LoggerService, DatabaseService, DiscoveryService, SchedulerService, AuthService, UrlReaderService } from '@backstage/backend-plugin-api';
3
- import { FactRetrieverRegistry as FactRetrieverRegistry$1, PersistenceContext as PersistenceContext$1, FactRetriever, FactLifecycle, FactRetrieverRegistration, TechInsightCheck, FactChecker, FactCheckerFactory } from '@backstage-community/plugin-tech-insights-node';
3
+ import { FactRetrieverRegistry as FactRetrieverRegistry$1, PersistenceContext as PersistenceContext$1, FactRetriever, FactLifecycle, FactRetrieverRegistration, FactChecker, FactCheckerFactory } from '@backstage-community/plugin-tech-insights-node';
4
4
  import { HumanDuration } from '@backstage/types';
5
5
  import { Duration } from 'luxon';
6
6
  import express from 'express';
7
7
  import { Config } from '@backstage/config';
8
- import { CheckResult } from '@backstage-community/plugin-tech-insights-common';
8
+ import { Check, CheckResult } from '@backstage-community/plugin-tech-insights-common';
9
9
 
10
10
  /**
11
11
  * The tech-insights backend plugin.
@@ -148,7 +148,7 @@ declare const initializePersistenceContext: (database: DatabaseService, options:
148
148
  * @typeParam CheckType - Type of the check for the fact checker this builder returns
149
149
  * @typeParam CheckResultType - Type of the check result for the fact checker this builder returns
150
150
  */
151
- interface RouterOptions<CheckType extends TechInsightCheck, CheckResultType extends CheckResult> {
151
+ interface RouterOptions<CheckType extends Check, CheckResultType extends CheckResult> {
152
152
  /**
153
153
  * Optional FactChecker implementation. If omitted, endpoints are not constructed
154
154
  */
@@ -176,7 +176,7 @@ interface RouterOptions<CheckType extends TechInsightCheck, CheckResultType exte
176
176
  *
177
177
  * @param options - RouterOptions object
178
178
  */
179
- declare function createRouter<CheckType extends TechInsightCheck, CheckResultType extends CheckResult>(options: RouterOptions<CheckType, CheckResultType>): Promise<express.Router>;
179
+ declare function createRouter<CheckType extends Check, CheckResultType extends CheckResult>(options: RouterOptions<CheckType, CheckResultType>): Promise<express.Router>;
180
180
 
181
181
  /**
182
182
  * @public
@@ -186,7 +186,7 @@ declare function createRouter<CheckType extends TechInsightCheck, CheckResultTyp
186
186
  * Configuration options to initialize TechInsightsBuilder. Generic types params are needed if FactCheckerFactory
187
187
  * is included for FactChecker creation.
188
188
  */
189
- interface TechInsightsOptions<CheckType extends TechInsightCheck, CheckResultType extends CheckResult> {
189
+ interface TechInsightsOptions<CheckType extends Check, CheckResultType extends CheckResult> {
190
190
  /**
191
191
  * Optional collection of FactRetrieverRegistrations (required if no factRetrieverRegistry passed in).
192
192
  * Used to register FactRetrievers and their schemas and schedule an execution loop for them.
@@ -225,7 +225,7 @@ interface TechInsightsOptions<CheckType extends TechInsightCheck, CheckResultTyp
225
225
  * A container for exported implementations related to TechInsights.
226
226
  * FactChecker is present if an optional FactCheckerFactory is included in the build stage.
227
227
  */
228
- type TechInsightsContext<CheckType extends TechInsightCheck, CheckResultType extends CheckResult> = {
228
+ type TechInsightsContext<CheckType extends Check, CheckResultType extends CheckResult> = {
229
229
  factChecker?: FactChecker<CheckType, CheckResultType>;
230
230
  persistenceContext: PersistenceContext$1;
231
231
  factRetrieverEngine: FactRetrieverEngine;
@@ -239,6 +239,6 @@ type TechInsightsContext<CheckType extends TechInsightCheck, CheckResultType ext
239
239
  * @param options - Needed options to construct TechInsightsContext
240
240
  * @returns TechInsightsContext with persistence implementations and optionally an implementation of a FactChecker
241
241
  */
242
- declare const buildTechInsightsContext: <CheckType extends TechInsightCheck, CheckResultType extends CheckResult>(options: TechInsightsOptions<CheckType, CheckResultType>) => Promise<TechInsightsContext<CheckType, CheckResultType>>;
242
+ declare const buildTechInsightsContext: <CheckType extends Check, CheckResultType extends CheckResult>(options: TechInsightsOptions<CheckType, CheckResultType>) => Promise<TechInsightsContext<CheckType, CheckResultType>>;
243
243
 
244
244
  export { FactRetrieverEngine, type FactRetrieverRegistrationOptions, type FactRetrieverRegistry, type PersistenceContext, type PersistenceContextOptions, type RouterOptions, type TechInsightsContext, type TechInsightsOptions, buildTechInsightsContext, createFactRetrieverRegistration, createRouter, techInsightsPlugin as default, entityMetadataFactRetriever, entityOwnershipFactRetriever, initializePersistenceContext, techdocsFactRetriever };
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["../../src/plugin/plugin.ts"],"sourcesContent":["/*\n * Copyright 2024 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 createBackendPlugin,\n} from '@backstage/backend-plugin-api';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport {\n FactCheckerFactory,\n FactRetriever,\n FactRetrieverRegistration,\n FactRetrieverRegistry,\n PersistenceContext,\n TechInsightCheck,\n techInsightsFactCheckerFactoryExtensionPoint,\n techInsightsFactRetrieverRegistryExtensionPoint,\n techInsightsFactRetrieversExtensionPoint,\n techInsightsPersistenceContextExtensionPoint,\n} from '@backstage-community/plugin-tech-insights-node';\nimport {\n buildTechInsightsContext,\n createRouter,\n entityMetadataFactRetriever,\n entityOwnershipFactRetriever,\n techdocsFactRetriever,\n} from '../service';\nimport { createFactRetrieverRegistrationFromConfig } from './config';\n\n/**\n * The tech-insights backend plugin.\n *\n * @public\n */\nexport const techInsightsPlugin = createBackendPlugin({\n pluginId: 'tech-insights',\n register(env) {\n let factCheckerFactory:\n | FactCheckerFactory<TechInsightCheck, CheckResult>\n | undefined = undefined;\n env.registerExtensionPoint(techInsightsFactCheckerFactoryExtensionPoint, {\n setFactCheckerFactory<\n CheckType extends TechInsightCheck,\n CheckResultType extends CheckResult,\n >(factory: FactCheckerFactory<CheckType, CheckResultType>): void {\n factCheckerFactory = factory;\n },\n });\n\n let factRetrieverRegistry: FactRetrieverRegistry | undefined = undefined;\n env.registerExtensionPoint(\n techInsightsFactRetrieverRegistryExtensionPoint,\n {\n setFactRetrieverRegistry(registry: FactRetrieverRegistry): void {\n factRetrieverRegistry = registry;\n },\n },\n );\n\n // initialized with built-in fact retrievers\n // only added as registration if there is config for them\n const addedFactRetrievers: Record<string, FactRetriever> = {\n entityMetadataFactRetriever,\n entityOwnershipFactRetriever,\n techdocsFactRetriever,\n };\n env.registerExtensionPoint(techInsightsFactRetrieversExtensionPoint, {\n addFactRetrievers(factRetrievers: Record<string, FactRetriever>): void {\n Object.entries(factRetrievers).forEach(([key, value]) => {\n addedFactRetrievers[key] = value;\n });\n },\n });\n\n let persistenceContext: PersistenceContext | undefined = undefined;\n env.registerExtensionPoint(techInsightsPersistenceContextExtensionPoint, {\n setPersistenceContext(context: PersistenceContext): void {\n persistenceContext = context;\n },\n });\n\n env.registerInit({\n deps: {\n config: coreServices.rootConfig,\n database: coreServices.database,\n discovery: coreServices.discovery,\n httpRouter: coreServices.httpRouter,\n logger: coreServices.logger,\n scheduler: coreServices.scheduler,\n auth: coreServices.auth,\n urlReader: coreServices.urlReader,\n },\n async init({\n config,\n database,\n discovery,\n httpRouter,\n logger,\n scheduler,\n auth,\n urlReader,\n }) {\n const factRetrievers: FactRetrieverRegistration[] = Object.entries(\n addedFactRetrievers,\n )\n .map(([name, factRetriever]) =>\n createFactRetrieverRegistrationFromConfig(\n config,\n name,\n factRetriever,\n ),\n )\n .filter(registration => registration) as FactRetrieverRegistration[];\n\n const context = await buildTechInsightsContext({\n config,\n database,\n discovery,\n factCheckerFactory,\n factRetrieverRegistry,\n factRetrievers,\n logger,\n persistenceContext,\n scheduler,\n auth,\n urlReader,\n });\n\n httpRouter.use(\n await createRouter({\n ...context,\n config,\n logger,\n }),\n );\n },\n });\n },\n});\n"],"names":["createBackendPlugin","techInsightsFactCheckerFactoryExtensionPoint","techInsightsFactRetrieverRegistryExtensionPoint","entityMetadataFactRetriever","entityOwnershipFactRetriever","techdocsFactRetriever","techInsightsFactRetrieversExtensionPoint","techInsightsPersistenceContextExtensionPoint","coreServices","config","createFactRetrieverRegistrationFromConfig","buildTechInsightsContext","createRouter"],"mappings":";;;;;;;;;;;;AA+CO,MAAM,qBAAqBA,oCAAoB,CAAA;AAAA,EACpD,QAAU,EAAA,eAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,IAAI,kBAEY,GAAA,KAAA,CAAA;AAChB,IAAA,GAAA,C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A;AAAA,OAC1B;AAAA,MACA,MAAM,IAAK,CAAA;AAAA,gBACTC,QAAA;AAAA,QACA,QAAA;AAAA,QACA,SAAA;AAAA,QACA,UAAA;AAAA,QACA,MAAA;AAAA,QACA,SAAA;AAAA,QACA,IAAA;AAAA,QACA;AAAA,OACC,EAAA;AACD,QAAA,MAAM,iBAA8C,MAAO,CAAA,OAAA;AAAA,UACzD;AAAA,SAEC,CAAA,GAAA;AAAA,UAAI,CAAC,CAAC,IAAM,EAAA,aAAa,CACxB,KAAAC,gDAAA;AAAA,YACED,QAAA;AAAA,YACA,IAAA;AAAA,YACA;AAAA;AACF,SACF,CACC,MAAO,CAAA,CAAA,YAAA,KAAgB,YAAY,CAAA;AAEtC,QAAM,MAAA,OAAA,GAAU,MAAME,mDAAyB,CAAA;AAAA,kBAC7CF,QAAA;AAAA,UACA,QAAA;AAAA,UACA,SAAA;AAAA,UACA,kBAAA;AAAA,UACA,qBAAA;AAAA,UACA,cAAA;AAAA,UACA,MAAA;AAAA,UACA,kBAAA;AAAA,UACA,SAAA;AAAA,UACA,IAAA;AAAA,UACA;AAAA,SACD,CAAA;AAED,QAAW,UAAA,CAAA,GAAA;AAAA,UACT,MAAMG,mBAAa,CAAA;AAAA,YACjB,GAAG,OAAA;AAAA,oBACHH,QAAA;AAAA,YACA;AAAA,WACD;AAAA,SACH;AAAA;AACF,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["../../src/plugin/plugin.ts"],"sourcesContent":["/*\n * Copyright 2024 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 createBackendPlugin,\n} from '@backstage/backend-plugin-api';\nimport {\n CheckResult,\n Check,\n} from '@backstage-community/plugin-tech-insights-common';\nimport {\n FactCheckerFactory,\n FactRetriever,\n FactRetrieverRegistration,\n FactRetrieverRegistry,\n PersistenceContext,\n techInsightsFactCheckerFactoryExtensionPoint,\n techInsightsFactRetrieverRegistryExtensionPoint,\n techInsightsFactRetrieversExtensionPoint,\n techInsightsPersistenceContextExtensionPoint,\n} from '@backstage-community/plugin-tech-insights-node';\nimport {\n buildTechInsightsContext,\n createRouter,\n entityMetadataFactRetriever,\n entityOwnershipFactRetriever,\n techdocsFactRetriever,\n} from '../service';\nimport { createFactRetrieverRegistrationFromConfig } from './config';\n\n/**\n * The tech-insights backend plugin.\n *\n * @public\n */\nexport const techInsightsPlugin = createBackendPlugin({\n pluginId: 'tech-insights',\n register(env) {\n let factCheckerFactory: FactCheckerFactory<Check, CheckResult> | undefined =\n undefined;\n env.registerExtensionPoint(techInsightsFactCheckerFactoryExtensionPoint, {\n setFactCheckerFactory<\n CheckType extends Check,\n CheckResultType extends CheckResult,\n >(factory: FactCheckerFactory<CheckType, CheckResultType>): void {\n factCheckerFactory = factory;\n },\n });\n\n let factRetrieverRegistry: FactRetrieverRegistry | undefined = undefined;\n env.registerExtensionPoint(\n techInsightsFactRetrieverRegistryExtensionPoint,\n {\n setFactRetrieverRegistry(registry: FactRetrieverRegistry): void {\n factRetrieverRegistry = registry;\n },\n },\n );\n\n // initialized with built-in fact retrievers\n // only added as registration if there is config for them\n const addedFactRetrievers: Record<string, FactRetriever> = {\n entityMetadataFactRetriever,\n entityOwnershipFactRetriever,\n techdocsFactRetriever,\n };\n env.registerExtensionPoint(techInsightsFactRetrieversExtensionPoint, {\n addFactRetrievers(factRetrievers: Record<string, FactRetriever>): void {\n Object.entries(factRetrievers).forEach(([key, value]) => {\n addedFactRetrievers[key] = value;\n });\n },\n });\n\n let persistenceContext: PersistenceContext | undefined = undefined;\n env.registerExtensionPoint(techInsightsPersistenceContextExtensionPoint, {\n setPersistenceContext(context: PersistenceContext): void {\n persistenceContext = context;\n },\n });\n\n env.registerInit({\n deps: {\n config: coreServices.rootConfig,\n database: coreServices.database,\n discovery: coreServices.discovery,\n httpRouter: coreServices.httpRouter,\n logger: coreServices.logger,\n scheduler: coreServices.scheduler,\n auth: coreServices.auth,\n urlReader: coreServices.urlReader,\n },\n async init({\n config,\n database,\n discovery,\n httpRouter,\n logger,\n scheduler,\n auth,\n urlReader,\n }) {\n const factRetrievers: FactRetrieverRegistration[] = Object.entries(\n addedFactRetrievers,\n )\n .map(([name, factRetriever]) =>\n createFactRetrieverRegistrationFromConfig(\n config,\n name,\n factRetriever,\n ),\n )\n .filter(registration => registration) as FactRetrieverRegistration[];\n\n const context = await buildTechInsightsContext({\n config,\n database,\n discovery,\n factCheckerFactory,\n factRetrieverRegistry,\n factRetrievers,\n logger,\n persistenceContext,\n scheduler,\n auth,\n urlReader,\n });\n\n httpRouter.use(\n await createRouter({\n ...context,\n config,\n logger,\n }),\n );\n },\n });\n },\n});\n"],"names":["createBackendPlugin","techInsightsFactCheckerFactoryExtensionPoint","techInsightsFactRetrieverRegistryExtensionPoint","entityMetadataFactRetriever","entityOwnershipFactRetriever","techdocsFactRetriever","techInsightsFactRetrieversExtensionPoint","techInsightsPersistenceContextExtensionPoint","coreServices","config","createFactRetrieverRegistrationFromConfig","buildTechInsightsContext","createRouter"],"mappings":";;;;;;;;;;;;AAiDO,MAAM,qBAAqBA,oCAAoB,CAAA;AAAA,EACpD,QAAU,EAAA,eAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,IAAI,kBACF,GAAA,KAAA,CAAA;AACF,IAAA,GAAA,CAAI,uBAAuBC,mEAA8C,EAAA;AAAA,MACvE,sBAGE,OAA+D,EAAA;AAC/D,QAAqB,kBAAA,GAAA,OAAA;AAAA;AACvB,KACD,CAAA;AAED,IAAA,IAAI,qBAA2D,GAAA,KAAA,CAAA;AAC/D,IAAI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A;AAAA,OACC,EAAA;AACD,QAAA,MAAM,iBAA8C,MAAO,CAAA,OAAA;AAAA,UACzD;AAAA,SAEC,CAAA,GAAA;AAAA,UAAI,CAAC,CAAC,IAAM,EAAA,aAAa,CACxB,KAAAC,gDAAA;AAAA,YACED,QAAA;AAAA,YACA,IAAA;AAAA,YACA;AAAA;AACF,SACF,CACC,MAAO,CAAA,CAAA,YAAA,KAAgB,YAAY,CAAA;AAEtC,QAAM,MAAA,OAAA,GAAU,MAAME,mDAAyB,CAAA;AAAA,kBAC7CF,QAAA;AAAA,UACA,QAAA;AAAA,UACA,SAAA;AAAA,UACA,kBAAA;AAAA,UACA,qBAAA;AAAA,UACA,cAAA;AAAA,UACA,MAAA;AAAA,UACA,kBAAA;AAAA,UACA,SAAA;AAAA,UACA,IAAA;AAAA,UACA;AAAA,SACD,CAAA;AAED,QAAW,UAAA,CAAA,GAAA;AAAA,UACT,MAAMG,mBAAa,CAAA;AAAA,YACjB,GAAG,OAAA;AAAA,oBACHH,QAAA;AAAA,YACA;AAAA,WACD;AAAA,SACH;AAAA;AACF,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"router.cjs.js","sources":["../../src/service/router.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 express from 'express';\nimport Router from 'express-promise-router';\nimport { Config } from '@backstage/config';\nimport {\n FactChecker,\n PersistenceContext,\n TechInsightCheck,\n} from '@backstage-community/plugin-tech-insights-node';\n\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport { DateTime } from 'luxon';\nimport {\n CompoundEntityRef,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { serializeError } from '@backstage/errors';\nimport { LoggerService } from '@backstage/backend-plugin-api';\nimport { MiddlewareFactory } from '@backstage/backend-defaults/rootHttpRouter';\nimport pLimit from 'p-limit';\n\n/**\n * @public\n *\n * RouterOptions to construct TechInsights endpoints\n * @typeParam CheckType - Type of the check for the fact checker this builder returns\n * @typeParam CheckResultType - Type of the check result for the fact checker this builder returns\n */\nexport interface RouterOptions<\n CheckType extends TechInsightCheck,\n CheckResultType extends CheckResult,\n> {\n /**\n * Optional FactChecker implementation. If omitted, endpoints are not constructed\n */\n factChecker?: FactChecker<CheckType, CheckResultType>;\n\n /**\n * TechInsights PersistenceContext. Should contain an implementation of TechInsightsStore\n */\n persistenceContext: PersistenceContext;\n\n /**\n * Backstage config object\n */\n config: Config;\n\n /**\n * Implementation of Winston logger\n */\n logger: LoggerService;\n}\n\n/**\n * @public\n *\n * Constructs a tech-insights router.\n *\n * Exposes endpoints to handle facts\n * Exposes optional endpoints to handle checks if a FactChecker implementation is passed in\n *\n * @param options - RouterOptions object\n */\nexport async function createRouter<\n CheckType extends TechInsightCheck,\n CheckResultType extends CheckResult,\n>(options: RouterOptions<CheckType, CheckResultType>): Promise<express.Router> {\n const router = Router();\n router.use(express.json());\n const { persistenceContext, factChecker, logger, config } = options;\n const { techInsightsStore } = persistenceContext;\n\n const factory = MiddlewareFactory.create({ logger, config });\n\n if (factChecker) {\n logger.info('Fact checker configured. Enabling fact checking endpoints.');\n router.get('/checks', async (_req, res) => {\n return res.json(await factChecker.getChecks());\n });\n\n router.post('/checks/run/:namespace/:kind/:name', async (req, res) => {\n const { namespace, kind, name } = req.params;\n const { checks }: { checks: string[] } = req.body;\n const entityTriplet = stringifyEntityRef({ namespace, kind, name });\n const checkResult = await factChecker.runChecks(entityTriplet, checks);\n return res.json(checkResult);\n });\n\n const checksRunConcurrency =\n config.getOptionalNumber('techInsights.checksRunConcurrency') || 100;\n router.post('/checks/run', async (req, res) => {\n const checks: string[] = req.body.checks;\n let entities: CompoundEntityRef[] = req.body.entities;\n if (entities.length === 0) {\n entities = await techInsightsStore.getEntities();\n }\n const limit = pLimit(checksRunConcurrency);\n const tasks = entities.map(async entity =>\n limit(async () => {\n const entityTriplet =\n typeof entity === 'string' ? entity : stringifyEntityRef(entity);\n try {\n const results = await factChecker.runChecks(entityTriplet, checks);\n return {\n entity: entityTriplet,\n results,\n };\n } catch (e: any) {\n const error = serializeError(e);\n logger.error(`${error.name}: ${error.message}`);\n return {\n entity: entityTriplet,\n error: error,\n results: [],\n };\n }\n }),\n );\n const results = await Promise.all(tasks);\n return res.json(results);\n });\n } else {\n logger.info(\n 'Starting tech insights module without fact checking endpoints.',\n );\n }\n\n router.get('/fact-schemas', async (req, res) => {\n const ids = req.query.ids as string[];\n return res.json(await techInsightsStore.getLatestSchemas(ids));\n });\n\n /**\n * /facts/latest?entity=component:default/mycomponent&ids[]=factRetrieverId1&ids[]=factRetrieverId2\n */\n router.get('/facts/latest', async (req, res) => {\n const { entity } = req.query;\n const { namespace, kind, name } = parseEntityRef(entity as string);\n\n if (!req.query.ids) {\n return res\n .status(422)\n .json({ error: 'Failed to parse ids from request' });\n }\n const ids = [req.query.ids].flat() as string[];\n return res.json(\n await techInsightsStore.getLatestFactsByIds(\n ids,\n stringifyEntityRef({ namespace, kind, name }),\n ),\n );\n });\n\n /**\n * /facts/range?entity=component:default/mycomponent&startDateTime=2021-12-24T01:23:45&endDateTime=2021-12-31T23:59:59&ids[]=factRetrieverId1&ids[]=factRetrieverId2\n */\n router.get('/facts/range', async (req, res) => {\n const { entity } = req.query;\n const { namespace, kind, name } = parseEntityRef(entity as string);\n\n if (!req.query.ids) {\n return res\n .status(422)\n .json({ error: 'Failed to parse ids from request' });\n }\n const ids = [req.query.ids].flat() as string[];\n const startDatetime = DateTime.fromISO(req.query.startDatetime as string);\n const endDatetime = DateTime.fromISO(req.query.endDatetime as string);\n if (!startDatetime.isValid || !endDatetime.isValid) {\n return res.status(422).json({\n message: 'Failed to parse datetime from request',\n field: !startDatetime.isValid ? 'startDateTime' : 'endDateTime',\n value: !startDatetime.isValid ? startDatetime : endDatetime,\n });\n }\n const entityTriplet = stringifyEntityRef({ namespace, kind, name });\n return res.json(\n await techInsightsStore.getFactsBetweenTimestampsByIds(\n ids,\n entityTriplet,\n startDatetime,\n endDatetime,\n ),\n );\n });\n\n router.use(factory.error());\n return router;\n}\n"],"names":["Router","express","MiddlewareFactory","stringifyEntityRef","pLimit","results","serializeError","parseEntityRef","DateTime"],"mappings":";;;;;;;;;;;;;;;;AA+EA,eAAsB,aAGpB,OAA6E,EAAA;AAC7E,EAAA,MAAM,SAASA,uBAAO,EAAA;AACtB,EAAO,MAAA,CAAA,GAAA,CAAIC,wBAAQ,CAAA,IAAA,EAAM,CAAA;AACzB,EAAA,MAAM,EAAE,kBAAA,EAAoB,WAAa,EAAA,MAAA,EAAQ,QAAW,GAAA,OAAA;AAC5D,EAAM,MAAA,EAAE,mBAAsB,GAAA,kBAAA;AAE9B,EAAA,MAAM,UAAUC,gCAAkB,CAAA,MAAA,CAAO,EAAE,MAAA,EAAQ,QAAQ,CAAA;AAE3D,EAAA,IAAI,WAAa,EAAA;AACf,IAAA,MAAA,CAAO,KAAK,4DAA4D,CAAA;AACxE,IAAA,MAAA,CAAO,GAAI,CAAA,SAAA,EAAW,OAAO,IAAA,EAAM,GAAQ,KAAA;AACzC,MAAA,OAAO,GAAI,CAAA,IAAA,CAAK,MAAM,WAAA,CAAY,WAAW,CAAA;AAAA,KAC9C,CAAA;AAED,IAAA,MAAA,CAAO,IAAK,CAAA,oCAAA,EAAsC,OAAO,GAAA,EAAK,GAAQ,KAAA;AACpE,MAAA,MAAM,EAAE,SAAA,EAAW,IAAM,EAAA,IAAA,KAAS,GAAI,CAAA,MAAA;AACtC,MAAM,MAAA,EAAE,MAAO,EAAA,GAA0B,GAAI,CAAA,IAAA;AAC7C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AAA,CAAA,GAAA,CAAI,OAAQ,CAAA,KAAA,EAAO,CAAA;AAC1B,EAAO,OAAA,MAAA;AACT;;;;"}
1
+ {"version":3,"file":"router.cjs.js","sources":["../../src/service/router.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 express from 'express';\nimport Router from 'express-promise-router';\nimport { Config } from '@backstage/config';\nimport {\n FactChecker,\n PersistenceContext,\n} from '@backstage-community/plugin-tech-insights-node';\n\nimport {\n CheckResult,\n Check,\n} from '@backstage-community/plugin-tech-insights-common';\nimport { DateTime } from 'luxon';\nimport {\n CompoundEntityRef,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { serializeError } from '@backstage/errors';\nimport { LoggerService } from '@backstage/backend-plugin-api';\nimport { MiddlewareFactory } from '@backstage/backend-defaults/rootHttpRouter';\nimport pLimit from 'p-limit';\n\n/**\n * @public\n *\n * RouterOptions to construct TechInsights endpoints\n * @typeParam CheckType - Type of the check for the fact checker this builder returns\n * @typeParam CheckResultType - Type of the check result for the fact checker this builder returns\n */\nexport interface RouterOptions<\n CheckType extends Check,\n CheckResultType extends CheckResult,\n> {\n /**\n * Optional FactChecker implementation. If omitted, endpoints are not constructed\n */\n factChecker?: FactChecker<CheckType, CheckResultType>;\n\n /**\n * TechInsights PersistenceContext. Should contain an implementation of TechInsightsStore\n */\n persistenceContext: PersistenceContext;\n\n /**\n * Backstage config object\n */\n config: Config;\n\n /**\n * Implementation of Winston logger\n */\n logger: LoggerService;\n}\n\n/**\n * @public\n *\n * Constructs a tech-insights router.\n *\n * Exposes endpoints to handle facts\n * Exposes optional endpoints to handle checks if a FactChecker implementation is passed in\n *\n * @param options - RouterOptions object\n */\nexport async function createRouter<\n CheckType extends Check,\n CheckResultType extends CheckResult,\n>(options: RouterOptions<CheckType, CheckResultType>): Promise<express.Router> {\n const router = Router();\n router.use(express.json());\n const { persistenceContext, factChecker, logger, config } = options;\n const { techInsightsStore } = persistenceContext;\n\n const factory = MiddlewareFactory.create({ logger, config });\n\n if (factChecker) {\n logger.info('Fact checker configured. Enabling fact checking endpoints.');\n router.get('/checks', async (_req, res) => {\n return res.json(await factChecker.getChecks());\n });\n\n router.post('/checks/run/:namespace/:kind/:name', async (req, res) => {\n const { namespace, kind, name } = req.params;\n const { checks }: { checks: string[] } = req.body;\n const entityTriplet = stringifyEntityRef({ namespace, kind, name });\n const checkResult = await factChecker.runChecks(entityTriplet, checks);\n return res.json(checkResult);\n });\n\n const checksRunConcurrency =\n config.getOptionalNumber('techInsights.checksRunConcurrency') || 100;\n router.post('/checks/run', async (req, res) => {\n const checks: string[] = req.body.checks;\n let entities: CompoundEntityRef[] = req.body.entities;\n if (entities.length === 0) {\n entities = await techInsightsStore.getEntities();\n }\n const limit = pLimit(checksRunConcurrency);\n const tasks = entities.map(async entity =>\n limit(async () => {\n const entityTriplet =\n typeof entity === 'string' ? entity : stringifyEntityRef(entity);\n try {\n const results = await factChecker.runChecks(entityTriplet, checks);\n return {\n entity: entityTriplet,\n results,\n };\n } catch (e: any) {\n const error = serializeError(e);\n logger.error(`${error.name}: ${error.message}`);\n return {\n entity: entityTriplet,\n error: error,\n results: [],\n };\n }\n }),\n );\n const results = await Promise.all(tasks);\n return res.json(results);\n });\n } else {\n logger.info(\n 'Starting tech insights module without fact checking endpoints.',\n );\n }\n\n router.get('/fact-schemas', async (req, res) => {\n const ids = req.query.ids as string[];\n return res.json(await techInsightsStore.getLatestSchemas(ids));\n });\n\n /**\n * /facts/latest?entity=component:default/mycomponent&ids[]=factRetrieverId1&ids[]=factRetrieverId2\n */\n router.get('/facts/latest', async (req, res) => {\n const { entity } = req.query;\n const { namespace, kind, name } = parseEntityRef(entity as string);\n\n if (!req.query.ids) {\n return res\n .status(422)\n .json({ error: 'Failed to parse ids from request' });\n }\n const ids = [req.query.ids].flat() as string[];\n return res.json(\n await techInsightsStore.getLatestFactsByIds(\n ids,\n stringifyEntityRef({ namespace, kind, name }),\n ),\n );\n });\n\n /**\n * /facts/range?entity=component:default/mycomponent&startDateTime=2021-12-24T01:23:45&endDateTime=2021-12-31T23:59:59&ids[]=factRetrieverId1&ids[]=factRetrieverId2\n */\n router.get('/facts/range', async (req, res) => {\n const { entity } = req.query;\n const { namespace, kind, name } = parseEntityRef(entity as string);\n\n if (!req.query.ids) {\n return res\n .status(422)\n .json({ error: 'Failed to parse ids from request' });\n }\n const ids = [req.query.ids].flat() as string[];\n const startDatetime = DateTime.fromISO(req.query.startDatetime as string);\n const endDatetime = DateTime.fromISO(req.query.endDatetime as string);\n if (!startDatetime.isValid || !endDatetime.isValid) {\n return res.status(422).json({\n message: 'Failed to parse datetime from request',\n field: !startDatetime.isValid ? 'startDateTime' : 'endDateTime',\n value: !startDatetime.isValid ? startDatetime : endDatetime,\n });\n }\n const entityTriplet = stringifyEntityRef({ namespace, kind, name });\n return res.json(\n await techInsightsStore.getFactsBetweenTimestampsByIds(\n ids,\n entityTriplet,\n startDatetime,\n endDatetime,\n ),\n );\n });\n\n router.use(factory.error());\n return router;\n}\n"],"names":["Router","express","MiddlewareFactory","stringifyEntityRef","pLimit","results","serializeError","parseEntityRef","DateTime"],"mappings":";;;;;;;;;;;;;;;;AAiFA,eAAsB,aAGpB,OAA6E,EAAA;AAC7E,EAAA,MAAM,SAASA,uBAAO,EAAA;AACtB,EAAO,MAAA,CAAA,GAAA,CAAIC,wBAAQ,CAAA,IAAA,EAAM,CAAA;AACzB,EAAA,MAAM,EAAE,kBAAA,EAAoB,WAAa,EAAA,MAAA,EAAQ,QAAW,GAAA,OAAA;AAC5D,EAAM,MAAA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AC,aAAA,CAAc,OAAW,IAAA,CAAC,YAAY,OAAS,EAAA;AAClD,MAAA,OAAO,GAAI,CAAA,MAAA,CAAO,GAAG,CAAA,CAAE,IAAK,CAAA;AAAA,QAC1B,OAAS,EAAA,uCAAA;AAAA,QACT,KAAO,EAAA,CAAC,aAAc,CAAA,OAAA,GAAU,eAAkB,GAAA,aAAA;AAAA,QAClD,KAAO,EAAA,CAAC,aAAc,CAAA,OAAA,GAAU,aAAgB,GAAA;AAAA,OACjD,CAAA;AAAA;AAEH,IAAA,MAAM,gBAAgBL,+BAAmB,CAAA,EAAE,SAAW,EAAA,IAAA,EAAM,MAAM,CAAA;AAClE,IAAA,OAAO,GAAI,CAAA,IAAA;AAAA,MACT,MAAM,iBAAkB,CAAA,8BAAA;AAAA,QACtB,GAAA;AAAA,QACA,aAAA;AAAA,QACA,aAAA;AAAA,QACA;AAAA;AACF,KACF;AAAA,GACD,CAAA;AAED,EAAO,MAAA,CAAA,GAAA,CAAI,OAAQ,CAAA,KAAA,EAAO,CAAA;AAC1B,EAAO,OAAA,MAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"techInsightsContextBuilder.cjs.js","sources":["../../src/service/techInsightsContextBuilder.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 DefaultFactRetrieverEngine,\n FactRetrieverEngine,\n} from './fact/FactRetrieverEngine';\nimport { DefaultFactRetrieverRegistry } from './fact/FactRetrieverRegistry';\nimport { Config } from '@backstage/config';\nimport {\n FactChecker,\n FactCheckerFactory,\n FactRetrieverRegistration,\n FactRetrieverRegistry,\n PersistenceContext,\n TechInsightCheck,\n} from '@backstage-community/plugin-tech-insights-node';\nimport { initializePersistenceContext } from './persistence';\nimport { CheckResult } from '@backstage-community/plugin-tech-insights-common';\nimport {\n AuthService,\n DatabaseService,\n DiscoveryService,\n LoggerService,\n SchedulerService,\n UrlReaderService,\n} from '@backstage/backend-plugin-api';\n\n/**\n * @public\n * @typeParam CheckType - Type of the check for the fact checker this builder returns\n * @typeParam CheckResultType - Type of the check result for the fact checker this builder returns\n *\n * Configuration options to initialize TechInsightsBuilder. Generic types params are needed if FactCheckerFactory\n * is included for FactChecker creation.\n */\nexport interface TechInsightsOptions<\n CheckType extends TechInsightCheck,\n CheckResultType extends CheckResult,\n> {\n /**\n * Optional collection of FactRetrieverRegistrations (required if no factRetrieverRegistry passed in).\n * Used to register FactRetrievers and their schemas and schedule an execution loop for them.\n *\n * Not needed if passing in your own FactRetrieverRegistry implementation. Required otherwise.\n */\n factRetrievers?: FactRetrieverRegistration[];\n\n /**\n * Optional factory exposing a `construct` method to initialize a FactChecker implementation\n */\n factCheckerFactory?: FactCheckerFactory<CheckType, CheckResultType>;\n\n /**\n * Optional FactRetrieverRegistry implementation that replaces the default one.\n *\n * If passing this in you don't need to pass in factRetrievers also.\n */\n factRetrieverRegistry?: FactRetrieverRegistry;\n\n /**\n * Optional persistenceContext implementation that replaces the default one.\n * This can be used to replace underlying database with a more suitable implementation if needed\n */\n persistenceContext?: PersistenceContext;\n\n logger: LoggerService;\n config: Config;\n discovery: DiscoveryService;\n database: DatabaseService;\n scheduler: SchedulerService;\n auth: AuthService;\n urlReader: UrlReaderService;\n}\n\n/**\n * @public\n * @typeParam CheckType - Type of the check for the fact checker this builder returns\n * @typeParam CheckResultType - Type of the check result for the fact checker this builder returns\n *\n * A container for exported implementations related to TechInsights.\n * FactChecker is present if an optional FactCheckerFactory is included in the build stage.\n */\nexport type TechInsightsContext<\n CheckType extends TechInsightCheck,\n CheckResultType extends CheckResult,\n> = {\n factChecker?: FactChecker<CheckType, CheckResultType>;\n persistenceContext: PersistenceContext;\n factRetrieverEngine: FactRetrieverEngine;\n};\n\n/**\n * @public\n *\n * Constructs needed persistence context, fact retriever engine\n * and optionally fact checker implementations to be used in the tech insights module.\n *\n * @param options - Needed options to construct TechInsightsContext\n * @returns TechInsightsContext with persistence implementations and optionally an implementation of a FactChecker\n */\nexport const buildTechInsightsContext = async <\n CheckType extends TechInsightCheck,\n CheckResultType extends CheckResult,\n>(\n options: TechInsightsOptions<CheckType, CheckResultType>,\n): Promise<TechInsightsContext<CheckType, CheckResultType>> => {\n const {\n factRetrievers,\n factCheckerFactory,\n config,\n discovery,\n database,\n logger,\n scheduler,\n auth,\n urlReader,\n } = options;\n\n const buildFactRetrieverRegistry = (): FactRetrieverRegistry => {\n if (!options.factRetrieverRegistry) {\n if (!factRetrievers) {\n throw new Error(\n 'Failed to build FactRetrieverRegistry because no factRetrievers found',\n );\n }\n return new DefaultFactRetrieverRegistry(factRetrievers);\n }\n return options.factRetrieverRegistry;\n };\n\n const factRetrieverRegistry = buildFactRetrieverRegistry();\n\n const persistenceContext =\n options.persistenceContext ??\n (await initializePersistenceContext(database, {\n logger,\n }));\n\n const factRetrieverEngine = await DefaultFactRetrieverEngine.create({\n scheduler,\n repository: persistenceContext.techInsightsStore,\n factRetrieverRegistry,\n factRetrieverContext: {\n config,\n discovery,\n logger,\n auth,\n urlReader,\n },\n });\n\n await factRetrieverEngine.schedule();\n\n if (factCheckerFactory) {\n const factChecker = factCheckerFactory.construct(\n persistenceContext.techInsightsStore,\n );\n return {\n persistenceContext,\n factChecker,\n factRetrieverEngine,\n };\n }\n\n return {\n persistenceContext,\n factRetrieverEngine,\n };\n};\n"],"names":["DefaultFactRetrieverRegistry","persistenceContext","initializePersistenceContext","DefaultFactRetrieverEngine"],"mappings":";;;;;;AAkHa,MAAA,wBAAA,GAA2B,OAItC,OAC6D,KAAA;AAC7D,EAAM,MAAA;AAAA,IACJ,cAAA;AAAA,IACA,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cesContent":["/*\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 DefaultFactRetrieverEngine,\n FactRetrieverEngine,\n} from './fact/FactRetrieverEngine';\nimport { DefaultFactRetrieverRegistry } from './fact/FactRetrieverRegistry';\nimport { Config } from '@backstage/config';\nimport {\n FactChecker,\n FactCheckerFactory,\n FactRetrieverRegistration,\n FactRetrieverRegistry,\n PersistenceContext,\n} from '@backstage-community/plugin-tech-insights-node';\nimport { initializePersistenceContext } from './persistence';\nimport {\n CheckResult,\n Check,\n} from '@backstage-community/plugin-tech-insights-common';\nimport {\n AuthService,\n DatabaseService,\n DiscoveryService,\n LoggerService,\n SchedulerService,\n UrlReaderService,\n} from '@backstage/backend-plugin-api';\n\n/**\n * @public\n * @typeParam CheckType - Type of the check for the fact checker this builder returns\n * @typeParam CheckResultType - Type of the check result for the fact checker this builder returns\n *\n * Configuration options to initialize TechInsightsBuilder. Generic types params are needed if FactCheckerFactory\n * is included for FactChecker creation.\n */\nexport interface TechInsightsOptions<\n CheckType extends Check,\n CheckResultType extends CheckResult,\n> {\n /**\n * Optional collection of FactRetrieverRegistrations (required if no factRetrieverRegistry passed in).\n * Used to register FactRetrievers and their schemas and schedule an execution loop for them.\n *\n * Not needed if passing in your own FactRetrieverRegistry implementation. Required otherwise.\n */\n factRetrievers?: FactRetrieverRegistration[];\n\n /**\n * Optional factory exposing a `construct` method to initialize a FactChecker implementation\n */\n factCheckerFactory?: FactCheckerFactory<CheckType, CheckResultType>;\n\n /**\n * Optional FactRetrieverRegistry implementation that replaces the default one.\n *\n * If passing this in you don't need to pass in factRetrievers also.\n */\n factRetrieverRegistry?: FactRetrieverRegistry;\n\n /**\n * Optional persistenceContext implementation that replaces the default one.\n * This can be used to replace underlying database with a more suitable implementation if needed\n */\n persistenceContext?: PersistenceContext;\n\n logger: LoggerService;\n config: Config;\n discovery: DiscoveryService;\n database: DatabaseService;\n scheduler: SchedulerService;\n auth: AuthService;\n urlReader: UrlReaderService;\n}\n\n/**\n * @public\n * @typeParam CheckType - Type of the check for the fact checker this builder returns\n * @typeParam CheckResultType - Type of the check result for the fact checker this builder returns\n *\n * A container for exported implementations related to TechInsights.\n * FactChecker is present if an optional FactCheckerFactory is included in the build stage.\n */\nexport type TechInsightsContext<\n CheckType extends Check,\n CheckResultType extends CheckResult,\n> = {\n factChecker?: FactChecker<CheckType, CheckResultType>;\n persistenceContext: PersistenceContext;\n factRetrieverEngine: FactRetrieverEngine;\n};\n\n/**\n * @public\n *\n * Constructs needed persistence context, fact retriever engine\n * and optionally fact checker implementations to be used in the tech insights module.\n *\n * @param options - Needed options to construct TechInsightsContext\n * @returns TechInsightsContext with persistence implementations and optionally an implementation of a FactChecker\n */\nexport const buildTechInsightsContext = async <\n CheckType extends Check,\n CheckResultType extends CheckResult,\n>(\n options: TechInsightsOptions<CheckType, CheckResultType>,\n): Promise<TechInsightsContext<CheckType, CheckResultType>> => {\n const {\n factRetrievers,\n factCheckerFactory,\n config,\n discovery,\n database,\n logger,\n scheduler,\n auth,\n urlReader,\n } = options;\n\n const buildFactRetrieverRegistry = (): FactRetrieverRegistry => {\n if (!options.factRetrieverRegistry) {\n if (!factRetrievers) {\n throw new Error(\n 'Failed to build FactRetrieverRegistry because no factRetrievers found',\n );\n }\n return new DefaultFactRetrieverRegistry(factRetrievers);\n }\n return options.factRetrieverRegistry;\n };\n\n const factRetrieverRegistry = buildFactRetrieverRegistry();\n\n const persistenceContext =\n options.persistenceContext ??\n (await initializePersistenceContext(database, {\n logger,\n }));\n\n const factRetrieverEngine = await DefaultFactRetrieverEngine.create({\n scheduler,\n repository: persistenceContext.techInsightsStore,\n factRetrieverRegistry,\n factRetrieverContext: {\n config,\n discovery,\n logger,\n auth,\n urlReader,\n },\n });\n\n await factRetrieverEngine.schedule();\n\n if (factCheckerFactory) {\n const factChecker = factCheckerFactory.construct(\n persistenceContext.techInsightsStore,\n );\n return {\n persistenceContext,\n factChecker,\n factRetrieverEngine,\n };\n }\n\n return {\n persistenceContext,\n factRetrieverEngine,\n };\n};\n"],"names":["DefaultFactRetrieverRegistry","persistenceContext","initializePersistenceContext","DefaultFactRetrieverEngine"],"mappings":";;;;;;AAoHa,MAAA,wBAAA,GAA2B,OAItC,OAC6D,KAAA;AAC7D,EAAM,MAAA;AAAA,IACJ,cAAA;AAAA,IACA,kBAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,IAAA;AAAA,IACA;AAAA,GACE,GAAA,OAAA;AAEJ,EAAA,MAAM,6BAA6B,MAA6B;AAC9D,IAAI,IAAA,CAAC,QAAQ,qBAAuB,EAAA;AAClC,MAAA,IAAI,CAAC,cAAgB,EAAA;AACnB,QAAA,MAAM,IAAI,KAAA;AAAA,UACR;AAAA,SACF;AAAA;AAEF,MAAO,OAAA,IAAIA,mDAA6B,cAAc,CAAA;AAAA;AAExD,IAAA,OAAO,OAAQ,CAAA,qBAAA;AAAA,GACjB;AAEA,EAAA,MAAM,wBAAwB,0BAA2B,EAAA;AAEzD,EAAA,MAAMC,oBACJ,GAAA,OAAA,CAAQ,kBACP,IAAA,MAAMC,gDAA6B,QAAU,EAAA;AAAA,IAC5C;AAAA,GACD,CAAA;AAEH,EAAM,MAAA,mBAAA,GAAsB,MAAMC,8CAAA,CAA2B,MAAO,CAAA;AAAA,IAClE,SAAA;AAAA,IACA,YAAYF,oBAAmB,CAAA,iBAAA;AAAA,IAC/B,qBAAA;AAAA,IACA,oBAAsB,EAAA;AAAA,MACpB,MAAA;AAAA,MACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,IAAA;AAAA,MACA;AAAA;AACF,GACD,CAAA;AAED,EAAA,MAAM,oBAAoB,QAAS,EAAA;AAEnC,EAAA,IAAI,kBAAoB,EAAA;AACtB,IAAA,MAAM,cAAc,kBAAmB,CAAA,SAAA;AAAA,MACrCA,oBAAmB,CAAA;AAAA,KACrB;AACA,IAAO,OAAA;AAAA,0BACLA,oBAAA;AAAA,MACA,WAAA;AAAA,MACA;AAAA,KACF;AAAA;AAGF,EAAO,OAAA;AAAA,wBACLA,oBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-tech-insights-backend",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "backstage": {
5
5
  "role": "backend-plugin",
6
6
  "pluginId": "tech-insights",
@@ -8,7 +8,10 @@
8
8
  "@backstage-community/plugin-tech-insights",
9
9
  "@backstage-community/plugin-tech-insights-backend",
10
10
  "@backstage-community/plugin-tech-insights-common",
11
- "@backstage-community/plugin-tech-insights-node"
11
+ "@backstage-community/plugin-tech-insights-maturity",
12
+ "@backstage-community/plugin-tech-insights-maturity-common",
13
+ "@backstage-community/plugin-tech-insights-node",
14
+ "@backstage-community/plugin-tech-insights-react"
12
15
  ]
13
16
  },
14
17
  "publishConfig": {
@@ -45,16 +48,16 @@
45
48
  "test": "backstage-cli package test"
46
49
  },
47
50
  "dependencies": {
48
- "@backstage-community/plugin-tech-insights-common": "^0.4.0",
49
- "@backstage-community/plugin-tech-insights-node": "^2.2.0",
50
- "@backstage/backend-defaults": "^0.6.2",
51
- "@backstage/backend-plugin-api": "^1.1.0",
52
- "@backstage/backend-test-utils": "^1.2.0",
53
- "@backstage/catalog-client": "^1.9.0",
54
- "@backstage/catalog-model": "^1.7.2",
55
- "@backstage/config": "^1.3.1",
56
- "@backstage/errors": "^1.2.6",
57
- "@backstage/types": "^1.2.0",
51
+ "@backstage-community/plugin-tech-insights-common": "^0.5.0",
52
+ "@backstage-community/plugin-tech-insights-node": "^2.3.0",
53
+ "@backstage/backend-defaults": "^0.7.0",
54
+ "@backstage/backend-plugin-api": "^1.1.1",
55
+ "@backstage/backend-test-utils": "^1.2.1",
56
+ "@backstage/catalog-client": "^1.9.1",
57
+ "@backstage/catalog-model": "^1.7.3",
58
+ "@backstage/config": "^1.3.2",
59
+ "@backstage/errors": "^1.2.7",
60
+ "@backstage/types": "^1.2.1",
58
61
  "@types/express": "^4.17.6",
59
62
  "@types/luxon": "^3.0.0",
60
63
  "express": "^4.17.1",
@@ -68,7 +71,7 @@
68
71
  "yn": "^4.0.0"
69
72
  },
70
73
  "devDependencies": {
71
- "@backstage/cli": "^0.29.4",
74
+ "@backstage/cli": "^0.29.6",
72
75
  "@types/lodash": "^4.14.151",
73
76
  "@types/semver": "^7.3.8",
74
77
  "@types/supertest": "^6.0.0",