@backstage/plugin-search-backend-module-catalog 0.1.18-next.2 → 0.1.19

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/plugin-search-backend-module-catalog
2
2
 
3
+ ## 0.1.19
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/plugin-catalog-node@1.9.0
9
+
10
+ ## 0.1.18
11
+
12
+ ### Patch Changes
13
+
14
+ - bb368a5: Migrated to support new auth services.
15
+ - Updated dependencies
16
+ - @backstage/backend-common@0.21.4
17
+ - @backstage/config@1.2.0
18
+ - @backstage/errors@1.2.4
19
+ - @backstage/backend-plugin-api@0.6.14
20
+ - @backstage/plugin-permission-common@0.7.13
21
+ - @backstage/plugin-search-common@1.2.11
22
+ - @backstage/plugin-catalog-node@1.8.0
23
+ - @backstage/catalog-client@1.6.1
24
+ - @backstage/backend-tasks@0.5.19
25
+ - @backstage/plugin-search-backend-node@1.2.18
26
+ - @backstage/catalog-model@1.4.5
27
+ - @backstage/plugin-catalog-common@1.0.22
28
+
3
29
  ## 0.1.18-next.2
4
30
 
5
31
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-search-backend-module-catalog",
3
- "version": "0.1.18-next.2",
3
+ "version": "0.1.19",
4
4
  "main": "../dist/alpha.cjs.js",
5
5
  "types": "../dist/alpha.d.ts"
6
6
  }
package/dist/alpha.cjs.js CHANGED
@@ -6,7 +6,7 @@ var backendPluginApi = require('@backstage/backend-plugin-api');
6
6
  var alpha$2 = require('@backstage/plugin-catalog-node/alpha');
7
7
  var pluginSearchBackendModuleCatalog = require('@backstage/plugin-search-backend-module-catalog');
8
8
  var alpha$1 = require('@backstage/plugin-search-backend-node/alpha');
9
- var config = require('./cjs/config-6c7298b0.cjs.js');
9
+ var config = require('./cjs/config-MJ2duTVN.cjs.js');
10
10
  require('@backstage/backend-tasks');
11
11
  require('@backstage/errors');
12
12
 
@@ -60,5 +60,5 @@ var alpha = backendPluginApi.createBackendModule({
60
60
  });
61
61
 
62
62
  exports.catalogCollatorExtensionPoint = catalogCollatorExtensionPoint;
63
- exports["default"] = alpha;
63
+ exports.default = alpha;
64
64
  //# sourceMappingURL=alpha.cjs.js.map
package/dist/alpha.d.ts CHANGED
@@ -26,4 +26,4 @@ declare const catalogCollatorExtensionPoint: _backstage_backend_plugin_api.Exten
26
26
  */
27
27
  declare const _default: () => _backstage_backend_plugin_api.BackendFeature;
28
28
 
29
- export { CatalogCollatorExtensionPoint, catalogCollatorExtensionPoint, _default as default };
29
+ export { type CatalogCollatorExtensionPoint, catalogCollatorExtensionPoint, _default as default };
@@ -46,4 +46,4 @@ function readCollatorConfigOptions(configRoot) {
46
46
 
47
47
  exports.readCollatorConfigOptions = readCollatorConfigOptions;
48
48
  exports.readScheduleConfigOptions = readScheduleConfigOptions;
49
- //# sourceMappingURL=config-6c7298b0.cjs.js.map
49
+ //# sourceMappingURL=config-MJ2duTVN.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-6c7298b0.cjs.js","sources":["../../src/collators/config.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 readTaskScheduleDefinitionFromConfig,\n TaskScheduleDefinition,\n} from '@backstage/backend-tasks';\nimport { EntityFilterQuery } from '@backstage/catalog-client';\nimport { Config } from '@backstage/config';\nimport { InputError } from '@backstage/errors';\n\nconst configKey = 'search.collators.catalog';\n\nexport const defaults = {\n schedule: {\n frequency: { minutes: 10 },\n timeout: { minutes: 15 },\n initialDelay: { seconds: 3 },\n },\n collatorOptions: {\n locationTemplate: '/catalog/:namespace/:kind/:name',\n filter: undefined,\n batchSize: 500,\n },\n};\n\nexport function readScheduleConfigOptions(\n configRoot: Config,\n): TaskScheduleDefinition {\n let schedule: TaskScheduleDefinition | undefined = undefined;\n\n const config = configRoot.getOptionalConfig(configKey);\n if (config) {\n const scheduleConfig = config.getOptionalConfig('schedule');\n if (scheduleConfig) {\n try {\n schedule = readTaskScheduleDefinitionFromConfig(scheduleConfig);\n } catch (error) {\n throw new InputError(`Invalid schedule at ${configKey}, ${error}`);\n }\n }\n }\n\n return schedule ?? defaults.schedule;\n}\n\nexport function readCollatorConfigOptions(configRoot: Config): {\n locationTemplate: string;\n filter: EntityFilterQuery | undefined;\n batchSize: number;\n} {\n const config = configRoot.getOptionalConfig(configKey);\n if (!config) {\n return defaults.collatorOptions;\n }\n\n return {\n locationTemplate:\n config.getOptionalString('locationTemplate') ??\n defaults.collatorOptions.locationTemplate,\n filter:\n config.getOptionalConfig('filter')?.get<EntityFilterQuery>() ??\n defaults.collatorOptions.filter,\n batchSize:\n config.getOptionalNumber('batchSize') ??\n defaults.collatorOptions.batchSize,\n };\n}\n"],"names":["readTaskScheduleDefinitionFromConfig","InputError"],"mappings":";;;;;AAwBA,MAAM,SAAY,GAAA,0BAAA,CAAA;AAEX,MAAM,QAAW,GAAA;AAAA,EACtB,QAAU,EAAA;AAAA,IACR,SAAA,EAAW,EAAE,OAAA,EAAS,EAAG,EAAA;AAAA,IACzB,OAAA,EAAS,EAAE,OAAA,EAAS,EAAG,EAAA;AAAA,IACvB,YAAA,EAAc,EAAE,OAAA,EAAS,CAAE,EAAA;AAAA,GAC7B;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,gBAAkB,EAAA,iCAAA;AAAA,IAClB,MAAQ,EAAA,KAAA,CAAA;AAAA,IACR,SAAW,EAAA,GAAA;AAAA,GACb;AACF,CAAA,CA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,iBAAA,CAAkB,WAAW,CAApC,KAAA,IAAA,GAAA,EAAA,GACA,SAAS,eAAgB,CAAA,SAAA;AAAA,GAC7B,CAAA;AACF;;;;;"}
1
+ {"version":3,"file":"config-MJ2duTVN.cjs.js","sources":["../../src/collators/config.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 readTaskScheduleDefinitionFromConfig,\n TaskScheduleDefinition,\n} from '@backstage/backend-tasks';\nimport { EntityFilterQuery } from '@backstage/catalog-client';\nimport { Config } from '@backstage/config';\nimport { InputError } from '@backstage/errors';\n\nconst configKey = 'search.collators.catalog';\n\nexport const defaults = {\n schedule: {\n frequency: { minutes: 10 },\n timeout: { minutes: 15 },\n initialDelay: { seconds: 3 },\n },\n collatorOptions: {\n locationTemplate: '/catalog/:namespace/:kind/:name',\n filter: undefined,\n batchSize: 500,\n },\n};\n\nexport function readScheduleConfigOptions(\n configRoot: Config,\n): TaskScheduleDefinition {\n let schedule: TaskScheduleDefinition | undefined = undefined;\n\n const config = configRoot.getOptionalConfig(configKey);\n if (config) {\n const scheduleConfig = config.getOptionalConfig('schedule');\n if (scheduleConfig) {\n try {\n schedule = readTaskScheduleDefinitionFromConfig(scheduleConfig);\n } catch (error) {\n throw new InputError(`Invalid schedule at ${configKey}, ${error}`);\n }\n }\n }\n\n return schedule ?? defaults.schedule;\n}\n\nexport function readCollatorConfigOptions(configRoot: Config): {\n locationTemplate: string;\n filter: EntityFilterQuery | undefined;\n batchSize: number;\n} {\n const config = configRoot.getOptionalConfig(configKey);\n if (!config) {\n return defaults.collatorOptions;\n }\n\n return {\n locationTemplate:\n config.getOptionalString('locationTemplate') ??\n defaults.collatorOptions.locationTemplate,\n filter:\n config.getOptionalConfig('filter')?.get<EntityFilterQuery>() ??\n defaults.collatorOptions.filter,\n batchSize:\n config.getOptionalNumber('batchSize') ??\n defaults.collatorOptions.batchSize,\n };\n}\n"],"names":["readTaskScheduleDefinitionFromConfig","InputError"],"mappings":";;;;;AAwBA,MAAM,SAAY,GAAA,0BAAA,CAAA;AAEX,MAAM,QAAW,GAAA;AAAA,EACtB,QAAU,EAAA;AAAA,IACR,SAAA,EAAW,EAAE,OAAA,EAAS,EAAG,EAAA;AAAA,IACzB,OAAA,EAAS,EAAE,OAAA,EAAS,EAAG,EAAA;AAAA,IACvB,YAAA,EAAc,EAAE,OAAA,EAAS,CAAE,EAAA;AAAA,GAC7B;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,gBAAkB,EAAA,iCAAA;AAAA,IAClB,MAAQ,EAAA,KAAA,CAAA;AAAA,IACR,SAAW,EAAA,GAAA;AAAA,GACb;AACF,CAAA,CAAA;AAEO,SAAS,0BACd,UACwB,EAAA;AACxB,EAAA,IAAI,QAA+C,GAAA,KAAA,CAAA,CAAA;AAEnD,EAAM,MAAA,MAAA,GAAS,UAAW,CAAA,iBAAA,CAAkB,SAAS,CAAA,CAAA;AACrD,EAAA,IAAI,MAAQ,EAAA;AACV,IAAM,MAAA,cAAA,GAAiB,MAAO,CAAA,iBAAA,CAAkB,UAAU,CAAA,CAAA;AAC1D,IAAA,IAAI,cAAgB,EAAA;AAClB,MAAI,IAAA;AACF,QAAA,QAAA,GAAWA,kDAAqC,cAAc,CAAA,CAAA;AAAA,eACvD,KAAO,EAAA;AACd,QAAA,MAAM,IAAIC,iBAAW,CAAA,CAAA,oBAAA,EAAuB,SAAS,CAAA,EAAA,EAAK,KAAK,CAAE,CAAA,CAAA,CAAA;AAAA,OACnE;AAAA,KACF;AAAA,GACF;AAEA,EAAA,OAAO,8BAAY,QAAS,CAAA,QAAA,CAAA;AAC9B,CAAA;AAEO,SAAS,0BAA0B,UAIxC,EAAA;AA/DF,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAgEE,EAAM,MAAA,MAAA,GAAS,UAAW,CAAA,iBAAA,CAAkB,SAAS,CAAA,CAAA;AACrD,EAAA,IAAI,CAAC,MAAQ,EAAA;AACX,IAAA,OAAO,QAAS,CAAA,eAAA,CAAA;AAAA,GAClB;AAEA,EAAO,OAAA;AAAA,IACL,mBACE,EAAO,GAAA,MAAA,CAAA,iBAAA,CAAkB,kBAAkB,CAA3C,KAAA,IAAA,GAAA,EAAA,GACA,SAAS,eAAgB,CAAA,gBAAA;AAAA,IAC3B,MAAA,EAAA,CACE,kBAAO,iBAAkB,CAAA,QAAQ,MAAjC,IAAoC,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,GAAA,EAAA,KAApC,IACA,GAAA,EAAA,GAAA,QAAA,CAAS,eAAgB,CAAA,MAAA;AAAA,IAC3B,YACE,EAAO,GAAA,MAAA,CAAA,iBAAA,CAAkB,WAAW,CAApC,KAAA,IAAA,GAAA,EAAA,GACA,SAAS,eAAgB,CAAA,SAAA;AAAA,GAC7B,CAAA;AACF;;;;;"}
package/dist/index.cjs.js CHANGED
@@ -1,13 +1,11 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var backendCommon = require('@backstage/backend-common');
6
4
  var catalogClient = require('@backstage/catalog-client');
7
5
  var catalogModel = require('@backstage/catalog-model');
8
6
  var alpha = require('@backstage/plugin-catalog-common/alpha');
9
7
  var stream = require('stream');
10
- var config = require('./cjs/config-6c7298b0.cjs.js');
8
+ var config = require('./cjs/config-MJ2duTVN.cjs.js');
11
9
  require('@backstage/backend-tasks');
12
10
  require('@backstage/errors');
13
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/collators/defaultCatalogCollatorEntityTransformer.ts","../src/collators/DefaultCatalogCollatorFactory.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity, isGroupEntity, isUserEntity } from '@backstage/catalog-model';\nimport { CatalogCollatorEntityTransformer } from './CatalogCollatorEntityTransformer';\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 defaultCatalogCollatorEntityTransformer: CatalogCollatorEntityTransformer =\n (entity: Entity) => {\n return {\n title: entity.metadata.title ?? entity.metadata.name,\n text: getDocumentText(entity),\n componentType: entity.spec?.type?.toString() || 'other',\n type: entity.spec?.type?.toString() || 'other',\n namespace: entity.metadata.namespace || 'default',\n kind: entity.kind,\n lifecycle: (entity.spec?.lifecycle as string) || '',\n owner: (entity.spec?.owner as string) || '',\n };\n };\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n PluginEndpointDiscovery,\n TokenManager,\n createLegacyAuthAdapters,\n} from '@backstage/backend-common';\nimport {\n CatalogApi,\n CatalogClient,\n GetEntitiesRequest,\n} from '@backstage/catalog-client';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport { CatalogEntityDocument } from '@backstage/plugin-catalog-common';\nimport { catalogEntityReadPermission } from '@backstage/plugin-catalog-common/alpha';\nimport { Permission } from '@backstage/plugin-permission-common';\nimport { DocumentCollatorFactory } from '@backstage/plugin-search-common';\nimport { Readable } from 'stream';\nimport { CatalogCollatorEntityTransformer } from './CatalogCollatorEntityTransformer';\nimport { readCollatorConfigOptions } from './config';\nimport { defaultCatalogCollatorEntityTransformer } from './defaultCatalogCollatorEntityTransformer';\nimport { AuthService } from '@backstage/backend-plugin-api';\n\n/** @public */\nexport type DefaultCatalogCollatorFactoryOptions = {\n auth?: AuthService;\n discovery: PluginEndpointDiscovery;\n tokenManager: TokenManager;\n /**\n * @deprecated Use the config key `search.collators.catalog.locationTemplate` instead.\n */\n locationTemplate?: string;\n /**\n * @deprecated Use the config key `search.collators.catalog.filter` instead.\n */\n filter?: GetEntitiesRequest['filter'];\n /**\n * @deprecated Use the config key `search.collators.catalog.batchSize` instead.\n */\n batchSize?: number;\n catalogClient?: CatalogApi;\n /**\n * Allows you to customize how entities are shaped into documents.\n */\n entityTransformer?: CatalogCollatorEntityTransformer;\n};\n\n/**\n * Collates entities from the Catalog into documents for the search backend.\n *\n * @public\n */\nexport class DefaultCatalogCollatorFactory implements DocumentCollatorFactory {\n public readonly type = 'software-catalog';\n public readonly visibilityPermission: Permission =\n catalogEntityReadPermission;\n\n private locationTemplate: string;\n private filter?: GetEntitiesRequest['filter'];\n private batchSize: number;\n private readonly catalogClient: CatalogApi;\n private entityTransformer: CatalogCollatorEntityTransformer;\n private auth: AuthService;\n\n static fromConfig(\n configRoot: Config,\n options: DefaultCatalogCollatorFactoryOptions,\n ) {\n const configOptions = readCollatorConfigOptions(configRoot);\n const { auth: adaptedAuth } = createLegacyAuthAdapters({\n auth: options.auth,\n discovery: options.discovery,\n tokenManager: options.tokenManager,\n });\n return new DefaultCatalogCollatorFactory({\n locationTemplate:\n options.locationTemplate ?? configOptions.locationTemplate,\n filter: options.filter ?? configOptions.filter,\n batchSize: options.batchSize ?? configOptions.batchSize,\n entityTransformer: options.entityTransformer,\n auth: adaptedAuth,\n discovery: options.discovery,\n tokenManager: options.tokenManager,\n catalogClient: options.catalogClient,\n });\n }\n\n private constructor(options: {\n locationTemplate: string;\n filter: GetEntitiesRequest['filter'];\n batchSize: number;\n entityTransformer?: CatalogCollatorEntityTransformer;\n auth: AuthService;\n discovery: PluginEndpointDiscovery;\n tokenManager: TokenManager;\n catalogClient?: CatalogApi;\n }) {\n const {\n auth,\n batchSize,\n discovery,\n locationTemplate,\n filter,\n catalogClient,\n entityTransformer,\n } = options;\n\n this.locationTemplate = locationTemplate;\n this.filter = filter;\n this.batchSize = batchSize;\n this.catalogClient =\n catalogClient || new CatalogClient({ discoveryApi: discovery });\n this.entityTransformer =\n entityTransformer ?? defaultCatalogCollatorEntityTransformer;\n this.auth = auth;\n }\n\n async getCollator(): Promise<Readable> {\n return Readable.from(this.execute());\n }\n\n private async *execute(): AsyncGenerator<CatalogEntityDocument> {\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.\n while (moreEntitiesToGet) {\n const { token } = await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'catalog',\n });\n const entities = (\n await this.catalogClient.getEntities(\n {\n filter: this.filter,\n limit: this.batchSize,\n offset: entitiesRetrieved,\n },\n { token },\n )\n ).items;\n\n // Control looping through entity batches.\n moreEntitiesToGet = entities.length === this.batchSize;\n entitiesRetrieved += entities.length;\n\n for (const entity of entities) {\n yield {\n ...this.entityTransformer(entity),\n authorization: {\n resourceRef: stringifyEntityRef(entity),\n },\n location: this.applyArgsToFormat(this.locationTemplate, {\n namespace: entity.metadata.namespace || 'default',\n kind: entity.kind,\n name: entity.metadata.name,\n }),\n };\n }\n }\n }\n\n private applyArgsToFormat(\n format: string,\n args: Record<string, string>,\n ): string {\n let formatted = format;\n\n for (const [key, value] of Object.entries(args)) {\n formatted = formatted.replace(`:${key}`, value);\n }\n\n return formatted.toLowerCase();\n }\n}\n"],"names":["isUserEntity","isGroupEntity","catalogEntityReadPermission","catalogClient","CatalogClient","readCollatorConfigOptions","createLegacyAuthAdapters","Readable","stringifyEntityRef"],"mappings":";;;;;;;;;;;;;AAmBA,MAAM,eAAA,GAAkB,CAAC,MAA2B,KAAA;AAnBpD,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAoBE,EAAA,MAAM,gBAA0B,EAAC,CAAA;AACjC,EAAA,aAAA,CAAc,IAAK,CAAA,MAAA,CAAO,QAAS,CAAA,WAAA,IAAe,EAAE,CAAA,CAAA;AAEpD,EAAA,IAAIA,yBAAa,CAAA,MAAM,CAAK,IAAAC,0BAAA,CAAc,MAAM,CAAG,EAAA;AACjD,IAAA,IAAA,CAAI,EAAO,GAAA,CAAA,EAAA,GAAA,MAAA,CAAA,IAAA,KAAP,IAAa,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAA,KAAb,mBAAsB,WAAa,EAAA;AACrC,MAAA,aAAA,CAAc,IAAK,CAAA,MAAA,CAAO,IAAK,CAAA,OAAA,CAAQ,WAAW,CAAA,CAAA;AAAA,KACpD;AAAA,GACF;AAEA,EAAI,IAAAD,yBAAA,CAAa,MAAM,CAAG,EAAA;AACxB,IAAA,IAAA,CAAI,EAAO,GAAA,CAAA,EAAA,GAAA,MAAA,CAAA,IAAA,KAAP,IAAa,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAA,KAAb,mBAAsB,KAAO,EAAA;AAC/B,MAA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EA,IAAA,OAAO,UAAU,WAAY,EAAA,CAAA;AAAA,GAC/B;AACF;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/collators/defaultCatalogCollatorEntityTransformer.ts","../src/collators/DefaultCatalogCollatorFactory.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity, isGroupEntity, isUserEntity } from '@backstage/catalog-model';\nimport { CatalogCollatorEntityTransformer } from './CatalogCollatorEntityTransformer';\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 defaultCatalogCollatorEntityTransformer: CatalogCollatorEntityTransformer =\n (entity: Entity) => {\n return {\n title: entity.metadata.title ?? entity.metadata.name,\n text: getDocumentText(entity),\n componentType: entity.spec?.type?.toString() || 'other',\n type: entity.spec?.type?.toString() || 'other',\n namespace: entity.metadata.namespace || 'default',\n kind: entity.kind,\n lifecycle: (entity.spec?.lifecycle as string) || '',\n owner: (entity.spec?.owner as string) || '',\n };\n };\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n PluginEndpointDiscovery,\n TokenManager,\n createLegacyAuthAdapters,\n} from '@backstage/backend-common';\nimport {\n CatalogApi,\n CatalogClient,\n GetEntitiesRequest,\n} from '@backstage/catalog-client';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport { CatalogEntityDocument } from '@backstage/plugin-catalog-common';\nimport { catalogEntityReadPermission } from '@backstage/plugin-catalog-common/alpha';\nimport { Permission } from '@backstage/plugin-permission-common';\nimport { DocumentCollatorFactory } from '@backstage/plugin-search-common';\nimport { Readable } from 'stream';\nimport { CatalogCollatorEntityTransformer } from './CatalogCollatorEntityTransformer';\nimport { readCollatorConfigOptions } from './config';\nimport { defaultCatalogCollatorEntityTransformer } from './defaultCatalogCollatorEntityTransformer';\nimport { AuthService } from '@backstage/backend-plugin-api';\n\n/** @public */\nexport type DefaultCatalogCollatorFactoryOptions = {\n auth?: AuthService;\n discovery: PluginEndpointDiscovery;\n tokenManager: TokenManager;\n /**\n * @deprecated Use the config key `search.collators.catalog.locationTemplate` instead.\n */\n locationTemplate?: string;\n /**\n * @deprecated Use the config key `search.collators.catalog.filter` instead.\n */\n filter?: GetEntitiesRequest['filter'];\n /**\n * @deprecated Use the config key `search.collators.catalog.batchSize` instead.\n */\n batchSize?: number;\n catalogClient?: CatalogApi;\n /**\n * Allows you to customize how entities are shaped into documents.\n */\n entityTransformer?: CatalogCollatorEntityTransformer;\n};\n\n/**\n * Collates entities from the Catalog into documents for the search backend.\n *\n * @public\n */\nexport class DefaultCatalogCollatorFactory implements DocumentCollatorFactory {\n public readonly type = 'software-catalog';\n public readonly visibilityPermission: Permission =\n catalogEntityReadPermission;\n\n private locationTemplate: string;\n private filter?: GetEntitiesRequest['filter'];\n private batchSize: number;\n private readonly catalogClient: CatalogApi;\n private entityTransformer: CatalogCollatorEntityTransformer;\n private auth: AuthService;\n\n static fromConfig(\n configRoot: Config,\n options: DefaultCatalogCollatorFactoryOptions,\n ) {\n const configOptions = readCollatorConfigOptions(configRoot);\n const { auth: adaptedAuth } = createLegacyAuthAdapters({\n auth: options.auth,\n discovery: options.discovery,\n tokenManager: options.tokenManager,\n });\n return new DefaultCatalogCollatorFactory({\n locationTemplate:\n options.locationTemplate ?? configOptions.locationTemplate,\n filter: options.filter ?? configOptions.filter,\n batchSize: options.batchSize ?? configOptions.batchSize,\n entityTransformer: options.entityTransformer,\n auth: adaptedAuth,\n discovery: options.discovery,\n tokenManager: options.tokenManager,\n catalogClient: options.catalogClient,\n });\n }\n\n private constructor(options: {\n locationTemplate: string;\n filter: GetEntitiesRequest['filter'];\n batchSize: number;\n entityTransformer?: CatalogCollatorEntityTransformer;\n auth: AuthService;\n discovery: PluginEndpointDiscovery;\n tokenManager: TokenManager;\n catalogClient?: CatalogApi;\n }) {\n const {\n auth,\n batchSize,\n discovery,\n locationTemplate,\n filter,\n catalogClient,\n entityTransformer,\n } = options;\n\n this.locationTemplate = locationTemplate;\n this.filter = filter;\n this.batchSize = batchSize;\n this.catalogClient =\n catalogClient || new CatalogClient({ discoveryApi: discovery });\n this.entityTransformer =\n entityTransformer ?? defaultCatalogCollatorEntityTransformer;\n this.auth = auth;\n }\n\n async getCollator(): Promise<Readable> {\n return Readable.from(this.execute());\n }\n\n private async *execute(): AsyncGenerator<CatalogEntityDocument> {\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.\n while (moreEntitiesToGet) {\n const { token } = await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'catalog',\n });\n const entities = (\n await this.catalogClient.getEntities(\n {\n filter: this.filter,\n limit: this.batchSize,\n offset: entitiesRetrieved,\n },\n { token },\n )\n ).items;\n\n // Control looping through entity batches.\n moreEntitiesToGet = entities.length === this.batchSize;\n entitiesRetrieved += entities.length;\n\n for (const entity of entities) {\n yield {\n ...this.entityTransformer(entity),\n authorization: {\n resourceRef: stringifyEntityRef(entity),\n },\n location: this.applyArgsToFormat(this.locationTemplate, {\n namespace: entity.metadata.namespace || 'default',\n kind: entity.kind,\n name: entity.metadata.name,\n }),\n };\n }\n }\n }\n\n private applyArgsToFormat(\n format: string,\n args: Record<string, string>,\n ): string {\n let formatted = format;\n\n for (const [key, value] of Object.entries(args)) {\n formatted = formatted.replace(`:${key}`, value);\n }\n\n return formatted.toLowerCase();\n }\n}\n"],"names":["isUserEntity","isGroupEntity","catalogEntityReadPermission","catalogClient","CatalogClient","readCollatorConfigOptions","createLegacyAuthAdapters","Readable","stringifyEntityRef"],"mappings":";;;;;;;;;;;AAmBA,MAAM,eAAA,GAAkB,CAAC,MAA2B,KAAA;AAnBpD,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAoBE,EAAA,MAAM,gBAA0B,EAAC,CAAA;AACjC,EAAA,aAAA,CAAc,IAAK,CAAA,MAAA,CAAO,QAAS,CAAA,WAAA,IAAe,EAAE,CAAA,CAAA;AAEpD,EAAA,IAAIA,yBAAa,CAAA,MAAM,CAAK,IAAAC,0BAAA,CAAc,MAAM,CAAG,EAAA;AACjD,IAAA,IAAA,CAAI,EAAO,GAAA,CAAA,EAAA,GAAA,MAAA,CAAA,IAAA,KAAP,IAAa,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAA,KAAb,mBAAsB,WAAa,EAAA;AACrC,MAAA,aAAA,CAAc,IAAK,CAAA,MAAA,CAAO,IAAK,CAAA,OAAA,CAAQ,WAAW,CAAA,CAAA;AAAA,KACpD;AAAA,GACF;AAEA,EAAI,IAAAD,yBAAA,CAAa,MAAM,CAAG,EAAA;AACxB,IAAA,IAAA,CAAI,EAA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AQ,IAAI,CAAG,EAAA;AAC/C,MAAA,SAAA,GAAY,SAAU,CAAA,OAAA,CAAQ,CAAI,CAAA,EAAA,GAAG,IAAI,KAAK,CAAA,CAAA;AAAA,KAChD;AAEA,IAAA,OAAO,UAAU,WAAY,EAAA,CAAA;AAAA,GAC/B;AACF;;;;;"}
package/dist/index.d.ts CHANGED
@@ -59,4 +59,4 @@ declare class DefaultCatalogCollatorFactory implements DocumentCollatorFactory {
59
59
  /** @public */
60
60
  declare const defaultCatalogCollatorEntityTransformer: CatalogCollatorEntityTransformer;
61
61
 
62
- export { CatalogCollatorEntityTransformer, DefaultCatalogCollatorFactory, DefaultCatalogCollatorFactoryOptions, defaultCatalogCollatorEntityTransformer };
62
+ export { type CatalogCollatorEntityTransformer, DefaultCatalogCollatorFactory, type DefaultCatalogCollatorFactoryOptions, defaultCatalogCollatorEntityTransformer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-search-backend-module-catalog",
3
- "version": "0.1.18-next.2",
3
+ "version": "0.1.19",
4
4
  "description": "A module for the search backend that exports catalog modules",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module"
@@ -45,23 +45,23 @@
45
45
  "test": "backstage-cli package test"
46
46
  },
47
47
  "dependencies": {
48
- "@backstage/backend-common": "^0.21.4-next.2",
49
- "@backstage/backend-plugin-api": "^0.6.14-next.2",
50
- "@backstage/backend-tasks": "^0.5.19-next.2",
51
- "@backstage/catalog-client": "^1.6.1-next.1",
52
- "@backstage/catalog-model": "^1.4.5-next.0",
53
- "@backstage/config": "^1.2.0-next.1",
54
- "@backstage/errors": "^1.2.4-next.0",
55
- "@backstage/plugin-catalog-common": "^1.0.22-next.1",
56
- "@backstage/plugin-catalog-node": "^1.8.0-next.2",
57
- "@backstage/plugin-permission-common": "^0.7.13-next.1",
58
- "@backstage/plugin-search-backend-node": "^1.2.18-next.2",
59
- "@backstage/plugin-search-common": "^1.2.11-next.1"
48
+ "@backstage/backend-common": "^0.21.4",
49
+ "@backstage/backend-plugin-api": "^0.6.14",
50
+ "@backstage/backend-tasks": "^0.5.19",
51
+ "@backstage/catalog-client": "^1.6.1",
52
+ "@backstage/catalog-model": "^1.4.5",
53
+ "@backstage/config": "^1.2.0",
54
+ "@backstage/errors": "^1.2.4",
55
+ "@backstage/plugin-catalog-common": "^1.0.22",
56
+ "@backstage/plugin-catalog-node": "^1.9.0",
57
+ "@backstage/plugin-permission-common": "^0.7.13",
58
+ "@backstage/plugin-search-backend-node": "^1.2.18",
59
+ "@backstage/plugin-search-common": "^1.2.11"
60
60
  },
61
61
  "devDependencies": {
62
- "@backstage/backend-common": "^0.21.4-next.2",
63
- "@backstage/backend-test-utils": "^0.3.4-next.2",
64
- "@backstage/cli": "^0.25.3-next.2",
62
+ "@backstage/backend-common": "^0.21.4",
63
+ "@backstage/backend-test-utils": "^0.3.4",
64
+ "@backstage/cli": "^0.26.0",
65
65
  "msw": "^1.0.0"
66
66
  },
67
67
  "configSchema": "config.d.ts"