@backstage/plugin-search-backend-module-techdocs 0.4.5-next.0 → 0.4.5
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 +11 -0
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/collators/DefaultTechDocsCollatorFactory.cjs.js.map +1 -1
- package/dist/collators/defaultTechDocsCollatorDocumentTransformer.cjs.js.map +1 -1
- package/dist/collators/defaultTechDocsCollatorEntityTransformer.cjs.js.map +1 -1
- package/dist/module.cjs.js +4 -4
- package/dist/module.cjs.js.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @backstage/plugin-search-backend-module-techdocs
|
|
2
2
|
|
|
3
|
+
## 0.4.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/catalog-client@1.11.0
|
|
9
|
+
- @backstage/plugin-catalog-node@1.18.0
|
|
10
|
+
- @backstage/plugin-search-backend-node@1.3.14
|
|
11
|
+
- @backstage/backend-plugin-api@1.4.2
|
|
12
|
+
- @backstage/plugin-techdocs-node@1.13.6
|
|
13
|
+
|
|
3
14
|
## 0.4.5-next.0
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/alpha.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.cjs.js","sources":["../src/alpha.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 { default as feature } from './module';\n\n/** @alpha */\nconst _feature = feature;\nexport default _feature;\n"],"names":["feature"],"mappings":";;;;;;AAmBA,MAAM,
|
|
1
|
+
{"version":3,"file":"alpha.cjs.js","sources":["../src/alpha.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 { default as feature } from './module';\n\n/** @alpha */\nconst _feature = feature;\nexport default _feature;\n"],"names":["feature"],"mappings":";;;;;;AAmBA,MAAM,QAAA,GAAWA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultTechDocsCollatorFactory.cjs.js","sources":["../../src/collators/DefaultTechDocsCollatorFactory.ts"],"sourcesContent":["/*\n * Copyright 2023 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 CATALOG_FILTER_EXISTS,\n CatalogApi,\n CatalogClient,\n EntityFilterQuery,\n} from '@backstage/catalog-client';\nimport {\n Entity,\n parseEntityRef,\n RELATION_OWNED_BY,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport { catalogEntityReadPermission } from '@backstage/plugin-catalog-common/alpha';\nimport { Permission } from '@backstage/plugin-permission-common';\nimport { DocumentCollatorFactory } from '@backstage/plugin-search-common';\nimport { TechDocsDocument } from '@backstage/plugin-techdocs-node';\nimport pLimit from 'p-limit';\nimport { Readable } from 'stream';\nimport { TechDocsCollatorEntityTransformer } from './TechDocsCollatorEntityTransformer';\nimport {\n MkSearchIndexDoc,\n TechDocsCollatorDocumentTransformer,\n} from './TechDocsCollatorDocumentTransformer';\nimport { defaultTechDocsCollatorEntityTransformer } from './defaultTechDocsCollatorEntityTransformer';\nimport { defaultTechDocsCollatorDocumentTransformer } from './defaultTechDocsCollatorDocumentTransformer';\nimport {\n AuthService,\n DiscoveryService,\n LoggerService,\n} from '@backstage/backend-plugin-api';\n\n/**\n * Options to configure the TechDocs collator factory\n *\n * @internal\n */\nexport type TechDocsCollatorFactoryOptions = {\n discovery: DiscoveryService;\n logger: LoggerService;\n auth: AuthService;\n locationTemplate?: string;\n catalogClient?: CatalogApi;\n parallelismLimit?: number;\n legacyPathCasing?: boolean;\n entityTransformer?: TechDocsCollatorEntityTransformer;\n documentTransformer?: TechDocsCollatorDocumentTransformer;\n entityFilterFunction?: (entity: Entity[]) => Entity[];\n customCatalogApiFilters?: EntityFilterQuery;\n};\n\ntype EntityInfo = {\n name: string;\n namespace: string;\n kind: string;\n};\n\n/**\n * A search collator factory responsible for gathering and transforming\n * TechDocs documents.\n *\n * @internal\n */\nexport class DefaultTechDocsCollatorFactory implements DocumentCollatorFactory {\n public readonly type: string = 'techdocs';\n public readonly visibilityPermission: Permission =\n catalogEntityReadPermission;\n\n private discovery: DiscoveryService;\n private locationTemplate: string;\n private readonly logger: LoggerService;\n private readonly auth: AuthService;\n private readonly catalogClient: CatalogApi;\n private readonly parallelismLimit: number;\n private readonly legacyPathCasing: boolean;\n private entityTransformer: TechDocsCollatorEntityTransformer;\n private documentTransformer: TechDocsCollatorDocumentTransformer;\n private entityFilterFunction: Function | undefined;\n private customCatalogApiFilters: EntityFilterQuery | undefined;\n\n private constructor(options: TechDocsCollatorFactoryOptions) {\n this.discovery = options.discovery;\n this.locationTemplate =\n options.locationTemplate || '/docs/:namespace/:kind/:name/:path';\n this.logger = options.logger.child({ documentType: this.type });\n this.catalogClient =\n options.catalogClient ||\n new CatalogClient({ discoveryApi: options.discovery });\n this.parallelismLimit = options.parallelismLimit ?? 10;\n this.legacyPathCasing = options.legacyPathCasing ?? false;\n this.entityTransformer = options.entityTransformer ?? (() => ({}));\n this.documentTransformer = options.documentTransformer ?? (() => ({}));\n this.entityFilterFunction = options.entityFilterFunction;\n this.customCatalogApiFilters = options.customCatalogApiFilters;\n this.auth = options.auth;\n }\n\n static fromConfig(config: Config, options: TechDocsCollatorFactoryOptions) {\n const legacyPathCasing =\n config.getOptionalBoolean(\n 'techdocs.legacyUseCaseSensitiveTripletPaths',\n ) || false;\n const locationTemplate = config.getOptionalString(\n 'search.collators.techdocs.locationTemplate',\n );\n const parallelismLimit = config.getOptionalNumber(\n 'search.collators.techdocs.parallelismLimit',\n );\n return new DefaultTechDocsCollatorFactory({\n ...options,\n locationTemplate,\n parallelismLimit,\n legacyPathCasing,\n });\n }\n\n async getCollator(): Promise<Readable> {\n return Readable.from(this.execute());\n }\n\n private async *execute(): AsyncGenerator<TechDocsDocument, void, undefined> {\n const limit = pLimit(this.parallelismLimit);\n const techDocsBaseUrl = await this.discovery.getBaseUrl('techdocs');\n\n let entitiesRetrieved = 0;\n let moreEntitiesToGet = true;\n\n // Offset/limit pagination is used on the Catalog Client in order to\n // limit (and allow some control over) memory used by the search backend\n // at index-time. The batchSize is calculated as a factor of the given\n // parallelism limit to simplify configuration.\n const batchSize = this.parallelismLimit * 50;\n while (moreEntitiesToGet) {\n const { token: catalogToken } = await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'catalog',\n });\n\n const entities = (\n await this.catalogClient.getEntities(\n {\n filter: {\n 'metadata.annotations.backstage.io/techdocs-ref':\n CATALOG_FILTER_EXISTS,\n ...this.customCatalogApiFilters,\n },\n limit: batchSize,\n offset: entitiesRetrieved,\n },\n { token: catalogToken },\n )\n ).items;\n\n // Control looping through entity batches.\n moreEntitiesToGet = entities.length === batchSize;\n entitiesRetrieved += entities.length;\n\n const filteredEntities = this.entityFilterFunction\n ? this.entityFilterFunction(entities)\n : this.defaultFilteringFunction(entities);\n\n const docPromises = filteredEntities.map((entity: Entity) =>\n limit(async (): Promise<TechDocsDocument[]> => {\n const entityInfo =\n DefaultTechDocsCollatorFactory.handleEntityInfoCasing(\n this.legacyPathCasing,\n {\n kind: entity.kind,\n namespace: entity.metadata.namespace || 'default',\n name: entity.metadata.name,\n },\n );\n\n try {\n const { token: techdocsToken } =\n await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'techdocs',\n });\n\n const searchIndex = await fetch(\n DefaultTechDocsCollatorFactory.constructDocsIndexUrl(\n techDocsBaseUrl,\n entityInfo,\n ),\n {\n headers: {\n Authorization: `Bearer ${techdocsToken}`,\n },\n },\n ).then(res => res.json());\n\n return searchIndex.docs.map((doc: MkSearchIndexDoc) => ({\n ...defaultTechDocsCollatorEntityTransformer(entity),\n ...defaultTechDocsCollatorDocumentTransformer(doc),\n ...this.entityTransformer(entity),\n ...this.documentTransformer(doc),\n location: this.applyArgsToFormat(\n this.locationTemplate || '/docs/:namespace/:kind/:name/:path',\n {\n ...entityInfo,\n path: doc.location,\n },\n ),\n ...entityInfo,\n entityTitle: entity.metadata.title,\n componentType: entity.spec?.type?.toString() || 'other',\n lifecycle: (entity.spec?.lifecycle as string) || '',\n owner: getSimpleEntityOwnerString(entity),\n authorization: {\n resourceRef: stringifyEntityRef(entity),\n },\n }));\n } catch (e) {\n this.logger.debug(\n `Failed to retrieve tech docs search index for entity ${entityInfo.namespace}/${entityInfo.kind}/${entityInfo.name}`,\n e,\n );\n return [];\n }\n }),\n );\n yield* (await Promise.all(docPromises)).flat();\n }\n }\n\n private applyArgsToFormat(\n format: string,\n args: Record<string, string>,\n ): string {\n let formatted = format;\n for (const [key, value] of Object.entries(args)) {\n formatted = formatted.replace(`:${key}`, value);\n }\n return formatted;\n }\n\n private defaultFilteringFunction(entities: Entity[]): Entity[] {\n return entities.filter(\n entity => entity.metadata?.annotations?.['backstage.io/techdocs-ref'],\n );\n }\n\n private static constructDocsIndexUrl(\n techDocsBaseUrl: string,\n entityInfo: { kind: string; namespace: string; name: string },\n ) {\n return `${techDocsBaseUrl}/static/docs/${entityInfo.namespace}/${entityInfo.kind}/${entityInfo.name}/search/search_index.json`;\n }\n\n private static handleEntityInfoCasing(\n legacyPaths: boolean,\n entityInfo: EntityInfo,\n ): EntityInfo {\n return legacyPaths\n ? entityInfo\n : Object.entries(entityInfo).reduce((acc, [key, value]) => {\n return { ...acc, [key]: value.toLocaleLowerCase('en-US') };\n }, {} as EntityInfo);\n }\n}\n\nfunction getSimpleEntityOwnerString(entity: Entity): string {\n if (entity.relations) {\n const owner = entity.relations.find(r => r.type === RELATION_OWNED_BY);\n if (owner) {\n const { name } = parseEntityRef(owner.targetRef);\n return name;\n }\n }\n return '';\n}\n"],"names":["catalogEntityReadPermission","CatalogClient","Readable","pLimit","CATALOG_FILTER_EXISTS","defaultTechDocsCollatorEntityTransformer","defaultTechDocsCollatorDocumentTransformer","stringifyEntityRef","RELATION_OWNED_BY","parseEntityRef"],"mappings":";;;;;;;;;;;;;;AA+EO,MAAM,8BAAkE,CAAA;AAAA,EAC7D,IAAe,GAAA,UAAA;AAAA,EACf,oBACd,GAAAA,iCAAA;AAAA,EAEM,SAAA;AAAA,EACA,gBAAA;AAAA,EACS,MAAA;AAAA,EACA,IAAA;AAAA,EACA,aAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACT,iBAAA;AAAA,EACA,mBAAA;AAAA,EACA,oBAAA;AAAA,EACA,uBAAA;AAAA,EAEA,YAAY,OAAyC,EAAA;AAC3D,IAAA,IAAA,CAAK,YAAY,OAAQ,CAAA,SAAA;AACzB,IAAK,IAAA,CAAA,gBAAA,G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I,CAAA,yBAAA,CAAA;AAAA;AACrG,EAEA,OAAe,sBACb,CAAA,WAAA,EACA,UACY,EAAA;AACZ,IAAA,OAAO,WACH,GAAA,UAAA,GACA,MAAO,CAAA,OAAA,CAAQ,UAAU,CAAA,CAAE,MAAO,CAAA,CAAC,GAAK,EAAA,CAAC,GAAK,EAAA,KAAK,CAAM,KAAA;AACvD,MAAO,OAAA,EAAE,GAAG,GAAK,EAAA,CAAC,GAAG,GAAG,KAAA,CAAM,iBAAkB,CAAA,OAAO,CAAE,EAAA;AAAA,KAC3D,EAAG,EAAgB,CAAA;AAAA;AAE3B;AAEA,SAAS,2BAA2B,MAAwB,EAAA;AAC1D,EAAA,IAAI,OAAO,SAAW,EAAA;AACpB,IAAA,MAAM,QAAQ,MAAO,CAAA,SAAA,CAAU,KAAK,CAAK,CAAA,KAAA,CAAA,CAAE,SAASC,8BAAiB,CAAA;AACrE,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,MAAM,EAAE,IAAA,EAAS,GAAAC,2BAAA,CAAe,MAAM,SAAS,CAAA;AAC/C,MAAO,OAAA,IAAA;AAAA;AACT;AAEF,EAAO,OAAA,EAAA;AACT;;;;"}
|
|
1
|
+
{"version":3,"file":"DefaultTechDocsCollatorFactory.cjs.js","sources":["../../src/collators/DefaultTechDocsCollatorFactory.ts"],"sourcesContent":["/*\n * Copyright 2023 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 CATALOG_FILTER_EXISTS,\n CatalogApi,\n CatalogClient,\n EntityFilterQuery,\n} from '@backstage/catalog-client';\nimport {\n Entity,\n parseEntityRef,\n RELATION_OWNED_BY,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport { catalogEntityReadPermission } from '@backstage/plugin-catalog-common/alpha';\nimport { Permission } from '@backstage/plugin-permission-common';\nimport { DocumentCollatorFactory } from '@backstage/plugin-search-common';\nimport { TechDocsDocument } from '@backstage/plugin-techdocs-node';\nimport pLimit from 'p-limit';\nimport { Readable } from 'stream';\nimport { TechDocsCollatorEntityTransformer } from './TechDocsCollatorEntityTransformer';\nimport {\n MkSearchIndexDoc,\n TechDocsCollatorDocumentTransformer,\n} from './TechDocsCollatorDocumentTransformer';\nimport { defaultTechDocsCollatorEntityTransformer } from './defaultTechDocsCollatorEntityTransformer';\nimport { defaultTechDocsCollatorDocumentTransformer } from './defaultTechDocsCollatorDocumentTransformer';\nimport {\n AuthService,\n DiscoveryService,\n LoggerService,\n} from '@backstage/backend-plugin-api';\n\n/**\n * Options to configure the TechDocs collator factory\n *\n * @internal\n */\nexport type TechDocsCollatorFactoryOptions = {\n discovery: DiscoveryService;\n logger: LoggerService;\n auth: AuthService;\n locationTemplate?: string;\n catalogClient?: CatalogApi;\n parallelismLimit?: number;\n legacyPathCasing?: boolean;\n entityTransformer?: TechDocsCollatorEntityTransformer;\n documentTransformer?: TechDocsCollatorDocumentTransformer;\n entityFilterFunction?: (entity: Entity[]) => Entity[];\n customCatalogApiFilters?: EntityFilterQuery;\n};\n\ntype EntityInfo = {\n name: string;\n namespace: string;\n kind: string;\n};\n\n/**\n * A search collator factory responsible for gathering and transforming\n * TechDocs documents.\n *\n * @internal\n */\nexport class DefaultTechDocsCollatorFactory implements DocumentCollatorFactory {\n public readonly type: string = 'techdocs';\n public readonly visibilityPermission: Permission =\n catalogEntityReadPermission;\n\n private discovery: DiscoveryService;\n private locationTemplate: string;\n private readonly logger: LoggerService;\n private readonly auth: AuthService;\n private readonly catalogClient: CatalogApi;\n private readonly parallelismLimit: number;\n private readonly legacyPathCasing: boolean;\n private entityTransformer: TechDocsCollatorEntityTransformer;\n private documentTransformer: TechDocsCollatorDocumentTransformer;\n private entityFilterFunction: Function | undefined;\n private customCatalogApiFilters: EntityFilterQuery | undefined;\n\n private constructor(options: TechDocsCollatorFactoryOptions) {\n this.discovery = options.discovery;\n this.locationTemplate =\n options.locationTemplate || '/docs/:namespace/:kind/:name/:path';\n this.logger = options.logger.child({ documentType: this.type });\n this.catalogClient =\n options.catalogClient ||\n new CatalogClient({ discoveryApi: options.discovery });\n this.parallelismLimit = options.parallelismLimit ?? 10;\n this.legacyPathCasing = options.legacyPathCasing ?? false;\n this.entityTransformer = options.entityTransformer ?? (() => ({}));\n this.documentTransformer = options.documentTransformer ?? (() => ({}));\n this.entityFilterFunction = options.entityFilterFunction;\n this.customCatalogApiFilters = options.customCatalogApiFilters;\n this.auth = options.auth;\n }\n\n static fromConfig(config: Config, options: TechDocsCollatorFactoryOptions) {\n const legacyPathCasing =\n config.getOptionalBoolean(\n 'techdocs.legacyUseCaseSensitiveTripletPaths',\n ) || false;\n const locationTemplate = config.getOptionalString(\n 'search.collators.techdocs.locationTemplate',\n );\n const parallelismLimit = config.getOptionalNumber(\n 'search.collators.techdocs.parallelismLimit',\n );\n return new DefaultTechDocsCollatorFactory({\n ...options,\n locationTemplate,\n parallelismLimit,\n legacyPathCasing,\n });\n }\n\n async getCollator(): Promise<Readable> {\n return Readable.from(this.execute());\n }\n\n private async *execute(): AsyncGenerator<TechDocsDocument, void, undefined> {\n const limit = pLimit(this.parallelismLimit);\n const techDocsBaseUrl = await this.discovery.getBaseUrl('techdocs');\n\n let entitiesRetrieved = 0;\n let moreEntitiesToGet = true;\n\n // Offset/limit pagination is used on the Catalog Client in order to\n // limit (and allow some control over) memory used by the search backend\n // at index-time. The batchSize is calculated as a factor of the given\n // parallelism limit to simplify configuration.\n const batchSize = this.parallelismLimit * 50;\n while (moreEntitiesToGet) {\n const { token: catalogToken } = await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'catalog',\n });\n\n const entities = (\n await this.catalogClient.getEntities(\n {\n filter: {\n 'metadata.annotations.backstage.io/techdocs-ref':\n CATALOG_FILTER_EXISTS,\n ...this.customCatalogApiFilters,\n },\n limit: batchSize,\n offset: entitiesRetrieved,\n },\n { token: catalogToken },\n )\n ).items;\n\n // Control looping through entity batches.\n moreEntitiesToGet = entities.length === batchSize;\n entitiesRetrieved += entities.length;\n\n const filteredEntities = this.entityFilterFunction\n ? this.entityFilterFunction(entities)\n : this.defaultFilteringFunction(entities);\n\n const docPromises = filteredEntities.map((entity: Entity) =>\n limit(async (): Promise<TechDocsDocument[]> => {\n const entityInfo =\n DefaultTechDocsCollatorFactory.handleEntityInfoCasing(\n this.legacyPathCasing,\n {\n kind: entity.kind,\n namespace: entity.metadata.namespace || 'default',\n name: entity.metadata.name,\n },\n );\n\n try {\n const { token: techdocsToken } =\n await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'techdocs',\n });\n\n const searchIndex = await fetch(\n DefaultTechDocsCollatorFactory.constructDocsIndexUrl(\n techDocsBaseUrl,\n entityInfo,\n ),\n {\n headers: {\n Authorization: `Bearer ${techdocsToken}`,\n },\n },\n ).then(res => res.json());\n\n return searchIndex.docs.map((doc: MkSearchIndexDoc) => ({\n ...defaultTechDocsCollatorEntityTransformer(entity),\n ...defaultTechDocsCollatorDocumentTransformer(doc),\n ...this.entityTransformer(entity),\n ...this.documentTransformer(doc),\n location: this.applyArgsToFormat(\n this.locationTemplate || '/docs/:namespace/:kind/:name/:path',\n {\n ...entityInfo,\n path: doc.location,\n },\n ),\n ...entityInfo,\n entityTitle: entity.metadata.title,\n componentType: entity.spec?.type?.toString() || 'other',\n lifecycle: (entity.spec?.lifecycle as string) || '',\n owner: getSimpleEntityOwnerString(entity),\n authorization: {\n resourceRef: stringifyEntityRef(entity),\n },\n }));\n } catch (e) {\n this.logger.debug(\n `Failed to retrieve tech docs search index for entity ${entityInfo.namespace}/${entityInfo.kind}/${entityInfo.name}`,\n e,\n );\n return [];\n }\n }),\n );\n yield* (await Promise.all(docPromises)).flat();\n }\n }\n\n private applyArgsToFormat(\n format: string,\n args: Record<string, string>,\n ): string {\n let formatted = format;\n for (const [key, value] of Object.entries(args)) {\n formatted = formatted.replace(`:${key}`, value);\n }\n return formatted;\n }\n\n private defaultFilteringFunction(entities: Entity[]): Entity[] {\n return entities.filter(\n entity => entity.metadata?.annotations?.['backstage.io/techdocs-ref'],\n );\n }\n\n private static constructDocsIndexUrl(\n techDocsBaseUrl: string,\n entityInfo: { kind: string; namespace: string; name: string },\n ) {\n return `${techDocsBaseUrl}/static/docs/${entityInfo.namespace}/${entityInfo.kind}/${entityInfo.name}/search/search_index.json`;\n }\n\n private static handleEntityInfoCasing(\n legacyPaths: boolean,\n entityInfo: EntityInfo,\n ): EntityInfo {\n return legacyPaths\n ? entityInfo\n : Object.entries(entityInfo).reduce((acc, [key, value]) => {\n return { ...acc, [key]: value.toLocaleLowerCase('en-US') };\n }, {} as EntityInfo);\n }\n}\n\nfunction getSimpleEntityOwnerString(entity: Entity): string {\n if (entity.relations) {\n const owner = entity.relations.find(r => r.type === RELATION_OWNED_BY);\n if (owner) {\n const { name } = parseEntityRef(owner.targetRef);\n return name;\n }\n }\n return '';\n}\n"],"names":["catalogEntityReadPermission","CatalogClient","Readable","pLimit","CATALOG_FILTER_EXISTS","defaultTechDocsCollatorEntityTransformer","defaultTechDocsCollatorDocumentTransformer","stringifyEntityRef","RELATION_OWNED_BY","parseEntityRef"],"mappings":";;;;;;;;;;;;;;AA+EO,MAAM,8BAAA,CAAkE;AAAA,EAC7D,IAAA,GAAe,UAAA;AAAA,EACf,oBAAA,GACdA,iCAAA;AAAA,EAEM,SAAA;AAAA,EACA,gBAAA;AAAA,EACS,MAAA;AAAA,EACA,IAAA;AAAA,EACA,aAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACT,iBAAA;AAAA,EACA,mBAAA;AAAA,EACA,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AA,KACtE;AAAA,EACF;AAAA,EAEA,OAAe,qBAAA,CACb,eAAA,EACA,UAAA,EACA;AACA,IAAA,OAAO,CAAA,EAAG,eAAe,CAAA,aAAA,EAAgB,UAAA,CAAW,SAAS,IAAI,UAAA,CAAW,IAAI,CAAA,CAAA,EAAI,UAAA,CAAW,IAAI,CAAA,yBAAA,CAAA;AAAA,EACrG;AAAA,EAEA,OAAe,sBAAA,CACb,WAAA,EACA,UAAA,EACY;AACZ,IAAA,OAAO,WAAA,GACH,UAAA,GACA,MAAA,CAAO,OAAA,CAAQ,UAAU,CAAA,CAAE,MAAA,CAAO,CAAC,GAAA,EAAK,CAAC,GAAA,EAAK,KAAK,CAAA,KAAM;AACvD,MAAA,OAAO,EAAE,GAAG,GAAA,EAAK,CAAC,GAAG,GAAG,KAAA,CAAM,iBAAA,CAAkB,OAAO,CAAA,EAAE;AAAA,IAC3D,CAAA,EAAG,EAAgB,CAAA;AAAA,EACzB;AACF;AAEA,SAAS,2BAA2B,MAAA,EAAwB;AAC1D,EAAA,IAAI,OAAO,SAAA,EAAW;AACpB,IAAA,MAAM,QAAQ,MAAA,CAAO,SAAA,CAAU,KAAK,CAAA,CAAA,KAAK,CAAA,CAAE,SAASC,8BAAiB,CAAA;AACrE,IAAA,IAAI,KAAA,EAAO;AACT,MAAA,MAAM,EAAE,IAAA,EAAK,GAAIC,2BAAA,CAAe,MAAM,SAAS,CAAA;AAC/C,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF;AACA,EAAA,OAAO,EAAA;AACT;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultTechDocsCollatorDocumentTransformer.cjs.js","sources":["../../src/collators/defaultTechDocsCollatorDocumentTransformer.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 */\nimport unescape from 'lodash/unescape';\nimport {\n TechDocsCollatorDocumentTransformer,\n MkSearchIndexDoc,\n} from './TechDocsCollatorDocumentTransformer';\n\n/** @public */\nexport const defaultTechDocsCollatorDocumentTransformer: TechDocsCollatorDocumentTransformer =\n (doc: MkSearchIndexDoc) => {\n return {\n title: unescape(doc.title),\n text: unescape(doc.text || ''),\n path: doc.location,\n };\n };\n"],"names":["unescape"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"defaultTechDocsCollatorDocumentTransformer.cjs.js","sources":["../../src/collators/defaultTechDocsCollatorDocumentTransformer.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 */\nimport unescape from 'lodash/unescape';\nimport {\n TechDocsCollatorDocumentTransformer,\n MkSearchIndexDoc,\n} from './TechDocsCollatorDocumentTransformer';\n\n/** @public */\nexport const defaultTechDocsCollatorDocumentTransformer: TechDocsCollatorDocumentTransformer =\n (doc: MkSearchIndexDoc) => {\n return {\n title: unescape(doc.title),\n text: unescape(doc.text || ''),\n path: doc.location,\n };\n };\n"],"names":["unescape"],"mappings":";;;;;;;;AAsBO,MAAM,0CAAA,GACX,CAAC,GAAA,KAA0B;AACzB,EAAA,OAAO;AAAA,IACL,KAAA,EAAOA,yBAAA,CAAS,GAAA,CAAI,KAAK,CAAA;AAAA,IACzB,IAAA,EAAMA,yBAAA,CAAS,GAAA,CAAI,IAAA,IAAQ,EAAE,CAAA;AAAA,IAC7B,MAAM,GAAA,CAAI;AAAA,GACZ;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultTechDocsCollatorEntityTransformer.cjs.js","sources":["../../src/collators/defaultTechDocsCollatorEntityTransformer.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { Entity, isGroupEntity, isUserEntity } from '@backstage/catalog-model';\nimport { TechDocsCollatorEntityTransformer } from './TechDocsCollatorEntityTransformer';\n\nconst getDocumentText = (entity: Entity): string => {\n const documentTexts: string[] = [];\n documentTexts.push(entity.metadata.description || '');\n\n if (isUserEntity(entity) || isGroupEntity(entity)) {\n if (entity.spec?.profile?.displayName) {\n documentTexts.push(entity.spec.profile.displayName);\n }\n }\n\n if (isUserEntity(entity)) {\n if (entity.spec?.profile?.email) {\n documentTexts.push(entity.spec.profile.email);\n }\n }\n\n return documentTexts.join(' : ');\n};\n\n/** @public */\nexport const defaultTechDocsCollatorEntityTransformer: TechDocsCollatorEntityTransformer =\n (entity: Entity) => {\n return {\n kind: entity.kind,\n namespace: entity.metadata.namespace || 'default',\n annotations: entity.metadata.annotations || '',\n name: entity.metadata.name || '',\n title: entity.metadata.title || '',\n text: getDocumentText(entity),\n componentType: entity.spec?.type?.toString() || 'other',\n type: entity.spec?.type?.toString() || 'other',\n lifecycle: (entity.spec?.lifecycle as string) || '',\n owner: (entity.spec?.owner as string) || '',\n path: '',\n };\n };\n"],"names":["isUserEntity","isGroupEntity"],"mappings":";;;;AAmBA,MAAM,eAAA,GAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"defaultTechDocsCollatorEntityTransformer.cjs.js","sources":["../../src/collators/defaultTechDocsCollatorEntityTransformer.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { Entity, isGroupEntity, isUserEntity } from '@backstage/catalog-model';\nimport { TechDocsCollatorEntityTransformer } from './TechDocsCollatorEntityTransformer';\n\nconst getDocumentText = (entity: Entity): string => {\n const documentTexts: string[] = [];\n documentTexts.push(entity.metadata.description || '');\n\n if (isUserEntity(entity) || isGroupEntity(entity)) {\n if (entity.spec?.profile?.displayName) {\n documentTexts.push(entity.spec.profile.displayName);\n }\n }\n\n if (isUserEntity(entity)) {\n if (entity.spec?.profile?.email) {\n documentTexts.push(entity.spec.profile.email);\n }\n }\n\n return documentTexts.join(' : ');\n};\n\n/** @public */\nexport const defaultTechDocsCollatorEntityTransformer: TechDocsCollatorEntityTransformer =\n (entity: Entity) => {\n return {\n kind: entity.kind,\n namespace: entity.metadata.namespace || 'default',\n annotations: entity.metadata.annotations || '',\n name: entity.metadata.name || '',\n title: entity.metadata.title || '',\n text: getDocumentText(entity),\n componentType: entity.spec?.type?.toString() || 'other',\n type: entity.spec?.type?.toString() || 'other',\n lifecycle: (entity.spec?.lifecycle as string) || '',\n owner: (entity.spec?.owner as string) || '',\n path: '',\n };\n };\n"],"names":["isUserEntity","isGroupEntity"],"mappings":";;;;AAmBA,MAAM,eAAA,GAAkB,CAAC,MAAA,KAA2B;AAClD,EAAA,MAAM,g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MAAA,CAAO,IAAA,EAAM,SAAA,IAAwB,EAAA;AAAA,IACjD,KAAA,EAAQ,MAAA,CAAO,IAAA,EAAM,KAAA,IAAoB,EAAA;AAAA,IACzC,IAAA,EAAM;AAAA,GACR;AACF;;;;"}
|
package/dist/module.cjs.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
6
|
-
var alpha = require('@backstage/plugin-catalog-node/alpha');
|
|
7
|
-
var alpha
|
|
6
|
+
var alpha$1 = require('@backstage/plugin-catalog-node/alpha');
|
|
7
|
+
var alpha = require('@backstage/plugin-search-backend-node/alpha');
|
|
8
8
|
var DefaultTechDocsCollatorFactory = require('./collators/DefaultTechDocsCollatorFactory.cjs.js');
|
|
9
9
|
|
|
10
10
|
const techdocsCollatorEntityTransformerExtensionPoint = backendPluginApi.createExtensionPoint({
|
|
@@ -67,8 +67,8 @@ var feature = backendPluginApi.createBackendModule({
|
|
|
67
67
|
auth: backendPluginApi.coreServices.auth,
|
|
68
68
|
discovery: backendPluginApi.coreServices.discovery,
|
|
69
69
|
scheduler: backendPluginApi.coreServices.scheduler,
|
|
70
|
-
catalog: alpha.catalogServiceRef,
|
|
71
|
-
indexRegistry: alpha
|
|
70
|
+
catalog: alpha$1.catalogServiceRef,
|
|
71
|
+
indexRegistry: alpha.searchIndexRegistryExtensionPoint
|
|
72
72
|
},
|
|
73
73
|
async init({
|
|
74
74
|
config,
|
package/dist/module.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2023 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 * @packageDocumentation\n * A module for the search backend that exports TechDocs modules.\n */\n\nimport {\n coreServices,\n createBackendModule,\n createExtensionPoint,\n readSchedulerServiceTaskScheduleDefinitionFromConfig,\n} from '@backstage/backend-plugin-api';\nimport { EntityFilterQuery } from '@backstage/catalog-client';\nimport { Entity } from '@backstage/catalog-model';\nimport { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha';\nimport { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha';\nimport { DefaultTechDocsCollatorFactory } from './collators/DefaultTechDocsCollatorFactory';\nimport {\n TechDocsCollatorDocumentTransformer,\n TechDocsCollatorEntityTransformer,\n} from './collators';\n\n/** @public */\nexport interface TechDocsCollatorEntityTransformerExtensionPoint {\n setTransformer(transformer: TechDocsCollatorEntityTransformer): void;\n setDocumentTransformer(\n transformer: TechDocsCollatorDocumentTransformer,\n ): void;\n}\n\n/**\n * Extension point used to customize the TechDocs collator entity transformer.\n *\n * @public\n */\nexport const techdocsCollatorEntityTransformerExtensionPoint =\n createExtensionPoint<TechDocsCollatorEntityTransformerExtensionPoint>({\n id: 'search.techdocsCollator.transformer',\n });\n\n/** @public */\nexport interface TechDocsCollatorEntityFilterExtensionPoint {\n setEntityFilterFunction(\n filterFunction: (entities: Entity[]) => Entity[],\n ): void;\n setCustomCatalogApiFilters(apiFilters: EntityFilterQuery): void;\n}\n\n/**\n * Extension point used to filter the entities that the collator will use.\n *\n * @public\n */\nexport const techDocsCollatorEntityFilterExtensionPoint =\n createExtensionPoint<TechDocsCollatorEntityFilterExtensionPoint>({\n id: 'search.techdocsCollator.entityFilter',\n });\n\n/**\n * @public\n * Search backend module for the TechDocs index.\n */\nexport default createBackendModule({\n pluginId: 'search',\n moduleId: 'techdocs-collator',\n register(env) {\n let entityTransformer: TechDocsCollatorEntityTransformer | undefined;\n let documentTransformer: TechDocsCollatorDocumentTransformer | undefined;\n let entityFilterFunction: ((e: Entity[]) => Entity[]) | undefined;\n let customCatalogApiFilters: EntityFilterQuery | undefined;\n\n env.registerExtensionPoint(\n techdocsCollatorEntityTransformerExtensionPoint,\n {\n setTransformer(newTransformer) {\n if (entityTransformer) {\n throw new Error(\n 'TechDocs collator entity transformer may only be set once',\n );\n }\n entityTransformer = newTransformer;\n },\n setDocumentTransformer(newTransformer) {\n if (documentTransformer) {\n throw new Error(\n 'TechDocs collator document transformer may only be set once',\n );\n }\n documentTransformer = newTransformer;\n },\n },\n );\n\n env.registerExtensionPoint(techDocsCollatorEntityFilterExtensionPoint, {\n setEntityFilterFunction(newEntityFilterFunction) {\n if (entityFilterFunction) {\n throw new Error(\n 'TechDocs entity filter functions may only be set once',\n );\n }\n entityFilterFunction = newEntityFilterFunction;\n },\n setCustomCatalogApiFilters(newCatalogApiFilters) {\n if (customCatalogApiFilters) {\n throw new Error(\n 'TechDocs catalog entity filters may only be set once',\n );\n }\n customCatalogApiFilters = newCatalogApiFilters;\n },\n });\n\n env.registerInit({\n deps: {\n config: coreServices.rootConfig,\n logger: coreServices.logger,\n auth: coreServices.auth,\n discovery: coreServices.discovery,\n scheduler: coreServices.scheduler,\n catalog: catalogServiceRef,\n indexRegistry: searchIndexRegistryExtensionPoint,\n },\n async init({\n config,\n logger,\n auth,\n discovery,\n scheduler,\n catalog,\n indexRegistry,\n }) {\n const defaultSchedule = {\n frequency: { minutes: 10 },\n timeout: { minutes: 15 },\n initialDelay: { seconds: 3 },\n };\n\n const schedule = config.has('search.collators.techdocs.schedule')\n ? readSchedulerServiceTaskScheduleDefinitionFromConfig(\n config.getConfig('search.collators.techdocs.schedule'),\n )\n : defaultSchedule;\n\n indexRegistry.addCollator({\n schedule: scheduler.createScheduledTaskRunner(schedule),\n factory: DefaultTechDocsCollatorFactory.fromConfig(config, {\n discovery,\n auth,\n logger,\n catalogClient: catalog,\n entityTransformer,\n documentTransformer,\n customCatalogApiFilters,\n entityFilterFunction,\n }),\n });\n },\n });\n },\n});\n"],"names":["createExtensionPoint","createBackendModule","coreServices","catalogServiceRef","searchIndexRegistryExtensionPoint","readSchedulerServiceTaskScheduleDefinitionFromConfig","DefaultTechDocsCollatorFactory"],"mappings":";;;;;;;;;AAkDO,MAAM,kDACXA,
|
|
1
|
+
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2023 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 * @packageDocumentation\n * A module for the search backend that exports TechDocs modules.\n */\n\nimport {\n coreServices,\n createBackendModule,\n createExtensionPoint,\n readSchedulerServiceTaskScheduleDefinitionFromConfig,\n} from '@backstage/backend-plugin-api';\nimport { EntityFilterQuery } from '@backstage/catalog-client';\nimport { Entity } from '@backstage/catalog-model';\nimport { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha';\nimport { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha';\nimport { DefaultTechDocsCollatorFactory } from './collators/DefaultTechDocsCollatorFactory';\nimport {\n TechDocsCollatorDocumentTransformer,\n TechDocsCollatorEntityTransformer,\n} from './collators';\n\n/** @public */\nexport interface TechDocsCollatorEntityTransformerExtensionPoint {\n setTransformer(transformer: TechDocsCollatorEntityTransformer): void;\n setDocumentTransformer(\n transformer: TechDocsCollatorDocumentTransformer,\n ): void;\n}\n\n/**\n * Extension point used to customize the TechDocs collator entity transformer.\n *\n * @public\n */\nexport const techdocsCollatorEntityTransformerExtensionPoint =\n createExtensionPoint<TechDocsCollatorEntityTransformerExtensionPoint>({\n id: 'search.techdocsCollator.transformer',\n });\n\n/** @public */\nexport interface TechDocsCollatorEntityFilterExtensionPoint {\n setEntityFilterFunction(\n filterFunction: (entities: Entity[]) => Entity[],\n ): void;\n setCustomCatalogApiFilters(apiFilters: EntityFilterQuery): void;\n}\n\n/**\n * Extension point used to filter the entities that the collator will use.\n *\n * @public\n */\nexport const techDocsCollatorEntityFilterExtensionPoint =\n createExtensionPoint<TechDocsCollatorEntityFilterExtensionPoint>({\n id: 'search.techdocsCollator.entityFilter',\n });\n\n/**\n * @public\n * Search backend module for the TechDocs index.\n */\nexport default createBackendModule({\n pluginId: 'search',\n moduleId: 'techdocs-collator',\n register(env) {\n let entityTransformer: TechDocsCollatorEntityTransformer | undefined;\n let documentTransformer: TechDocsCollatorDocumentTransformer | undefined;\n let entityFilterFunction: ((e: Entity[]) => Entity[]) | undefined;\n let customCatalogApiFilters: EntityFilterQuery | undefined;\n\n env.registerExtensionPoint(\n techdocsCollatorEntityTransformerExtensionPoint,\n {\n setTransformer(newTransformer) {\n if (entityTransformer) {\n throw new Error(\n 'TechDocs collator entity transformer may only be set once',\n );\n }\n entityTransformer = newTransformer;\n },\n setDocumentTransformer(newTransformer) {\n if (documentTransformer) {\n throw new Error(\n 'TechDocs collator document transformer may only be set once',\n );\n }\n documentTransformer = newTransformer;\n },\n },\n );\n\n env.registerExtensionPoint(techDocsCollatorEntityFilterExtensionPoint, {\n setEntityFilterFunction(newEntityFilterFunction) {\n if (entityFilterFunction) {\n throw new Error(\n 'TechDocs entity filter functions may only be set once',\n );\n }\n entityFilterFunction = newEntityFilterFunction;\n },\n setCustomCatalogApiFilters(newCatalogApiFilters) {\n if (customCatalogApiFilters) {\n throw new Error(\n 'TechDocs catalog entity filters may only be set once',\n );\n }\n customCatalogApiFilters = newCatalogApiFilters;\n },\n });\n\n env.registerInit({\n deps: {\n config: coreServices.rootConfig,\n logger: coreServices.logger,\n auth: coreServices.auth,\n discovery: coreServices.discovery,\n scheduler: coreServices.scheduler,\n catalog: catalogServiceRef,\n indexRegistry: searchIndexRegistryExtensionPoint,\n },\n async init({\n config,\n logger,\n auth,\n discovery,\n scheduler,\n catalog,\n indexRegistry,\n }) {\n const defaultSchedule = {\n frequency: { minutes: 10 },\n timeout: { minutes: 15 },\n initialDelay: { seconds: 3 },\n };\n\n const schedule = config.has('search.collators.techdocs.schedule')\n ? readSchedulerServiceTaskScheduleDefinitionFromConfig(\n config.getConfig('search.collators.techdocs.schedule'),\n )\n : defaultSchedule;\n\n indexRegistry.addCollator({\n schedule: scheduler.createScheduledTaskRunner(schedule),\n factory: DefaultTechDocsCollatorFactory.fromConfig(config, {\n discovery,\n auth,\n logger,\n catalogClient: catalog,\n entityTransformer,\n documentTransformer,\n customCatalogApiFilters,\n entityFilterFunction,\n }),\n });\n },\n });\n },\n});\n"],"names":["createExtensionPoint","createBackendModule","coreServices","catalogServiceRef","searchIndexRegistryExtensionPoint","readSchedulerServiceTaskScheduleDefinitionFromConfig","DefaultTechDocsCollatorFactory"],"mappings":";;;;;;;;;AAkDO,MAAM,kDACXA,qCAAA,CAAsE;AAAA,EACpE,EAAA,EAAI;AACN,CAAC;AAeI,MAAM,6CACXA,qCAAA,CAAiE;AAAA,EAC/D,EAAA,EAAI;AACN,CAAC;AAMH,cAAeC,oCAAA,CAAoB;AAAA,EACjC,QAAA,EAAU,QAAA;AAAA,EACV,QAAA,EAAU,mBAAA;AAAA,EACV,SAAS,GAAA,EAAK;AACZ,IAAA,IAAI,iBAAA;AACJ,IAAA,IAAI,mBAAA;AACJ,IAAA,IAAI,oBAAA;AACJ,IAAA,IAAI,uBAAA;AAEJ,IAAA,GAAA,CAAI,sBAAA;AAAA,MACF,+CAAA;AAAA,MACA;AAAA,QACE,eAAe,cAAA,EAAgB;AAC7B,UAAA,IAAI,iBAAA,EAAmB;AACrB,YAAA,MAAM,IAAI,KAAA;AAAA,cACR;AAAA,aACF;AAAA,UACF;AACA,UAAA,iBAAA,GAAoB,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S,EAAA,EAAG;AAAA,UACvB,YAAA,EAAc,EAAE,OAAA,EAAS,CAAA;AAAE,SAC7B;AAEA,QAAA,MAAM,QAAA,GAAW,MAAA,CAAO,GAAA,CAAI,oCAAoC,CAAA,GAC5DC,qEAAA;AAAA,UACE,MAAA,CAAO,UAAU,oCAAoC;AAAA,SACvD,GACA,eAAA;AAEJ,QAAA,aAAA,CAAc,WAAA,CAAY;AAAA,UACxB,QAAA,EAAU,SAAA,CAAU,yBAAA,CAA0B,QAAQ,CAAA;AAAA,UACtD,OAAA,EAASC,6DAAA,CAA+B,UAAA,CAAW,MAAA,EAAQ;AAAA,YACzD,SAAA;AAAA,YACA,IAAA;AAAA,YACA,MAAA;AAAA,YACA,aAAA,EAAe,OAAA;AAAA,YACf,iBAAA;AAAA,YACA,mBAAA;AAAA,YACA,uBAAA;AAAA,YACA;AAAA,WACD;AAAA,SACF,CAAA;AAAA,MACH;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC,CAAA;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-search-backend-module-techdocs",
|
|
3
|
-
"version": "0.4.5
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "A module for the search backend that exports techdocs modules",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -62,22 +62,22 @@
|
|
|
62
62
|
"test": "backstage-cli package test"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@backstage/backend-plugin-api": "1.4.2
|
|
66
|
-
"@backstage/catalog-client": "1.11.0
|
|
67
|
-
"@backstage/catalog-model": "1.7.5",
|
|
68
|
-
"@backstage/config": "1.3.3",
|
|
69
|
-
"@backstage/plugin-catalog-common": "1.1.5",
|
|
70
|
-
"@backstage/plugin-catalog-node": "1.18.0
|
|
71
|
-
"@backstage/plugin-permission-common": "0.9.1",
|
|
72
|
-
"@backstage/plugin-search-backend-node": "1.3.14
|
|
73
|
-
"@backstage/plugin-search-common": "1.2.19",
|
|
74
|
-
"@backstage/plugin-techdocs-node": "1.13.6
|
|
65
|
+
"@backstage/backend-plugin-api": "^1.4.2",
|
|
66
|
+
"@backstage/catalog-client": "^1.11.0",
|
|
67
|
+
"@backstage/catalog-model": "^1.7.5",
|
|
68
|
+
"@backstage/config": "^1.3.3",
|
|
69
|
+
"@backstage/plugin-catalog-common": "^1.1.5",
|
|
70
|
+
"@backstage/plugin-catalog-node": "^1.18.0",
|
|
71
|
+
"@backstage/plugin-permission-common": "^0.9.1",
|
|
72
|
+
"@backstage/plugin-search-backend-node": "^1.3.14",
|
|
73
|
+
"@backstage/plugin-search-common": "^1.2.19",
|
|
74
|
+
"@backstage/plugin-techdocs-node": "^1.13.6",
|
|
75
75
|
"lodash": "^4.17.21",
|
|
76
76
|
"p-limit": "^3.1.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@backstage/backend-test-utils": "1.
|
|
80
|
-
"@backstage/cli": "0.
|
|
79
|
+
"@backstage/backend-test-utils": "^1.8.0",
|
|
80
|
+
"@backstage/cli": "^0.34.0",
|
|
81
81
|
"msw": "^1.0.0"
|
|
82
82
|
},
|
|
83
83
|
"configSchema": "config.d.ts"
|