@backstage/plugin-search-backend-module-catalog 0.2.6 → 0.3.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @backstage/plugin-search-backend-module-catalog
2
2
 
3
+ ## 0.3.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - dd515e3: **BREAKING**: Removed support for the old backend system. Please [migrate to the new backend system](https://backstage.io/docs/backend-system/) and enable [the catalog collator](https://backstage.io/docs/features/search/collators#catalog) there.
8
+
9
+ As part of this, the `/alpha` export path is gone too. Just import the module from the root of the package as usual instead.
10
+
11
+ ### Patch Changes
12
+
13
+ - 1e09b06: Internal refactor to use cursor based pagination
14
+ - Updated dependencies
15
+ - @backstage/backend-plugin-api@1.1.1-next.0
16
+ - @backstage/catalog-client@1.9.0
17
+ - @backstage/catalog-model@1.7.2
18
+ - @backstage/config@1.3.1
19
+ - @backstage/errors@1.2.6
20
+ - @backstage/plugin-catalog-common@1.1.2
21
+ - @backstage/plugin-catalog-node@1.15.1-next.0
22
+ - @backstage/plugin-permission-common@0.8.3
23
+ - @backstage/plugin-search-backend-node@1.3.7-next.0
24
+ - @backstage/plugin-search-common@1.2.16
25
+
3
26
  ## 0.2.6
4
27
 
5
28
  ### Patch Changes
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var backendCommon = require('@backstage/backend-common');
4
- var catalogClient = require('@backstage/catalog-client');
5
3
  var catalogModel = require('@backstage/catalog-model');
6
4
  var alpha = require('@backstage/plugin-catalog-common/alpha');
7
5
  var stream = require('stream');
@@ -14,40 +12,33 @@ class DefaultCatalogCollatorFactory {
14
12
  locationTemplate;
15
13
  filter;
16
14
  batchSize;
17
- catalogClient;
15
+ catalog;
18
16
  entityTransformer;
19
17
  auth;
20
18
  static fromConfig(configRoot, options) {
21
19
  const configOptions = config.readCollatorConfigOptions(configRoot);
22
- const { auth: adaptedAuth } = backendCommon.createLegacyAuthAdapters({
23
- auth: options.auth,
24
- discovery: options.discovery,
25
- tokenManager: options.tokenManager
26
- });
27
20
  return new DefaultCatalogCollatorFactory({
28
- locationTemplate: options.locationTemplate ?? configOptions.locationTemplate,
29
- filter: options.filter ?? configOptions.filter,
30
- batchSize: options.batchSize ?? configOptions.batchSize,
21
+ locationTemplate: configOptions.locationTemplate,
22
+ filter: configOptions.filter,
23
+ batchSize: configOptions.batchSize,
31
24
  entityTransformer: options.entityTransformer,
32
- auth: adaptedAuth,
33
- discovery: options.discovery,
34
- catalogClient: options.catalogClient
25
+ auth: options.auth,
26
+ catalog: options.catalog
35
27
  });
36
28
  }
37
29
  constructor(options) {
38
30
  const {
39
31
  auth,
40
32
  batchSize,
41
- discovery,
42
33
  locationTemplate,
43
34
  filter,
44
- catalogClient: catalogClient$1,
35
+ catalog,
45
36
  entityTransformer
46
37
  } = options;
47
38
  this.locationTemplate = locationTemplate;
48
39
  this.filter = filter;
49
40
  this.batchSize = batchSize;
50
- this.catalogClient = catalogClient$1 || new catalogClient.CatalogClient({ discoveryApi: discovery });
41
+ this.catalog = catalog;
51
42
  this.entityTransformer = entityTransformer ?? defaultCatalogCollatorEntityTransformer.defaultCatalogCollatorEntityTransformer;
52
43
  this.auth = auth;
53
44
  }
@@ -56,23 +47,19 @@ class DefaultCatalogCollatorFactory {
56
47
  }
57
48
  async *execute() {
58
49
  let entitiesRetrieved = 0;
59
- let moreEntitiesToGet = true;
60
- while (moreEntitiesToGet) {
61
- const { token } = await this.auth.getPluginRequestToken({
62
- onBehalfOf: await this.auth.getOwnServiceCredentials(),
63
- targetPluginId: "catalog"
64
- });
65
- const entities = (await this.catalogClient.getEntities(
50
+ let cursor = void 0;
51
+ do {
52
+ const response = await this.catalog.queryEntities(
66
53
  {
67
54
  filter: this.filter,
68
55
  limit: this.batchSize,
69
- offset: entitiesRetrieved
56
+ ...cursor ? { cursor } : {}
70
57
  },
71
- { token }
72
- )).items;
73
- moreEntitiesToGet = entities.length === this.batchSize;
74
- entitiesRetrieved += entities.length;
75
- for (const entity of entities) {
58
+ { credentials: await this.auth.getOwnServiceCredentials() }
59
+ );
60
+ cursor = response.pageInfo.nextCursor;
61
+ entitiesRetrieved += response.items.length;
62
+ for (const entity of response.items) {
76
63
  yield {
77
64
  ...this.entityTransformer(entity),
78
65
  authorization: {
@@ -85,7 +72,7 @@ class DefaultCatalogCollatorFactory {
85
72
  })
86
73
  };
87
74
  }
88
- }
75
+ } while (cursor);
89
76
  }
90
77
  applyArgsToFormat(format, args) {
91
78
  let formatted = format;
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultCatalogCollatorFactory.cjs.js","sources":["../../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 {\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, DiscoveryService } from '@backstage/backend-plugin-api';\n\n/**\n * @public\n * @deprecated This type is deprecated along with the {@link DefaultCatalogCollatorFactory}.\n */\nexport type DefaultCatalogCollatorFactoryOptions = {\n auth?: AuthService;\n discovery: DiscoveryService;\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 * @deprecated Migrate to the {@link https://backstage.io/docs/backend-system/building-backends/migrating | new backend system} and install this collator via module instead (see {@link https://github.com/backstage/backstage/blob/nbs10/search-deprecate-create-router/plugins/search-backend-module-catalog/README.md#installation | here} for more installation details).\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 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: DiscoveryService;\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":["catalogEntityReadPermission","readCollatorConfigOptions","createLegacyAuthAdapters","catalogClient","Cat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UACA,QAAU,EAAA,IAAA,CAAK,iBAAkB,CAAA,IAAA,CAAK,gBAAkB,EAAA;AAAA,YACtD,SAAA,EAAW,MAAO,CAAA,QAAA,CAAS,SAAa,IAAA,SAAA;AAAA,YACxC,MAAM,MAAO,CAAA,IAAA;AAAA,YACb,IAAA,EAAM,OAAO,QAAS,CAAA;AAAA,WACvB;AAAA,SACH;AAAA;AACF;AACF;AACF,EAEQ,iBAAA,CACN,QACA,IACQ,EAAA;AACR,IAAA,IAAI,SAAY,GAAA,MAAA;AAEhB,IAAA,KAAA,MAAW,CAAC,GAAK,EAAA,KAAK,KAAK,MAAO,CAAA,OAAA,CAAQ,IAAI,CAAG,EAAA;AAC/C,MAAA,SAAA,GAAY,SAAU,CAAA,OAAA,CAAQ,CAAI,CAAA,EAAA,GAAG,IAAI,KAAK,CAAA;AAAA;AAGhD,IAAA,OAAO,UAAU,WAAY,EAAA;AAAA;AAEjC;;;;"}
1
+ {"version":3,"file":"DefaultCatalogCollatorFactory.cjs.js","sources":["../../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 { AuthService } from '@backstage/backend-plugin-api';\nimport { QueryEntitiesInitialRequest } 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 { CatalogService } from '@backstage/plugin-catalog-node';\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';\n\nexport type DefaultCatalogCollatorFactoryOptions = {\n auth: AuthService;\n catalog: CatalogService;\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 */\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?: QueryEntitiesInitialRequest['filter'];\n private batchSize: number;\n private readonly catalog: CatalogService;\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 return new DefaultCatalogCollatorFactory({\n locationTemplate: configOptions.locationTemplate,\n filter: configOptions.filter,\n batchSize: configOptions.batchSize,\n entityTransformer: options.entityTransformer,\n auth: options.auth,\n catalog: options.catalog,\n });\n }\n\n private constructor(options: {\n locationTemplate: string;\n filter: QueryEntitiesInitialRequest['filter'];\n batchSize: number;\n entityTransformer?: CatalogCollatorEntityTransformer;\n auth: AuthService;\n catalog: CatalogService;\n }) {\n const {\n auth,\n batchSize,\n locationTemplate,\n filter,\n catalog,\n entityTransformer,\n } = options;\n\n this.locationTemplate = locationTemplate;\n this.filter = filter;\n this.batchSize = batchSize;\n this.catalog = catalog;\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 cursor: string | undefined = undefined;\n\n do {\n const response = await this.catalog.queryEntities(\n {\n filter: this.filter,\n limit: this.batchSize,\n ...(cursor ? { cursor } : {}),\n },\n { credentials: await this.auth.getOwnServiceCredentials() },\n );\n cursor = response.pageInfo.nextCursor;\n entitiesRetrieved += response.items.length;\n\n for (const entity of response.items) {\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 } while (cursor);\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":["catalogEntityReadPermission","readCollatorConfigOptions","defaultCatalogCollatorEntityTransformer","Readable","stringifyEntityRef"],"mappings":";;;;;;;;AA0CO,MAAM,6BAAiE,CAAA;AAAA,EAC5D,IAAO,GAAA,kBAAA;AAAA,EACP,oBACd,GAAAA,iCAAA;AAAA,EAEM,gBAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACS,OAAA;AAAA,EACT,iBAAA;AAAA,EACA,IAAA;AAAA,EAER,OAAO,UACL,CAAA,UAAA,EACA,OACA,EAAA;AACA,IAAM,MAAA,aAAA,GAAgBC,iCAA0B,UAAU,CAAA;AAC1D,IAAA,OAAO,IAAI,6BAA8B,CAAA;AAAA,MACvC,kBAAkB,aAAc,CAAA,gBAAA;AAAA,MAChC,QAAQ,aAAc,CAAA,MAAA;AAAA,MACtB,WAAW,aAAc,CAAA,SAAA;AAAA,MACzB,mBAAmB,OAAQ,CAAA,iBAAA;AAAA,MAC3B,MAAM,OAAQ,CAAA,IAAA;AAAA,MACd,SAAS,OAAQ,CAAA;AAAA,KAClB,CAAA;AAAA;AACH,EAEQ,YAAY,OAOjB,EAAA;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M;AAAA,WACxC;AAAA,UACA,QAAU,EAAA,IAAA,CAAK,iBAAkB,CAAA,IAAA,CAAK,gBAAkB,EAAA;AAAA,YACtD,SAAA,EAAW,MAAO,CAAA,QAAA,CAAS,SAAa,IAAA,SAAA;AAAA,YACxC,MAAM,MAAO,CAAA,IAAA;AAAA,YACb,IAAA,EAAM,OAAO,QAAS,CAAA;AAAA,WACvB;AAAA,SACH;AAAA;AACF,KACO,QAAA,MAAA;AAAA;AACX,EAEQ,iBAAA,CACN,QACA,IACQ,EAAA;AACR,IAAA,IAAI,SAAY,GAAA,MAAA;AAEhB,IAAA,KAAA,MAAW,CAAC,GAAK,EAAA,KAAK,KAAK,MAAO,CAAA,OAAA,CAAQ,IAAI,CAAG,EAAA;AAC/C,MAAA,SAAA,GAAY,SAAU,CAAA,OAAA,CAAQ,CAAI,CAAA,EAAA,GAAG,IAAI,KAAK,CAAA;AAAA;AAGhD,IAAA,OAAO,UAAU,WAAY,EAAA;AAAA;AAEjC;;;;"}
package/dist/index.cjs.js CHANGED
@@ -3,13 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var module$1 = require('./module.cjs.js');
6
- var DefaultCatalogCollatorFactory = require('./collators/DefaultCatalogCollatorFactory.cjs.js');
7
6
  var defaultCatalogCollatorEntityTransformer = require('./collators/defaultCatalogCollatorEntityTransformer.cjs.js');
8
7
 
9
8
 
10
9
 
11
10
  exports.catalogCollatorExtensionPoint = module$1.catalogCollatorExtensionPoint;
12
- exports.default = module$1.default;
13
- exports.DefaultCatalogCollatorFactory = DefaultCatalogCollatorFactory.DefaultCatalogCollatorFactory;
11
+ exports.default = module$1.searchModuleCatalogCollator;
14
12
  exports.defaultCatalogCollatorEntityTransformer = defaultCatalogCollatorEntityTransformer.defaultCatalogCollatorEntityTransformer;
15
13
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,16 +1,13 @@
1
- /// <reference types="node" />
2
1
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
3
- import { AuthService, DiscoveryService } from '@backstage/backend-plugin-api';
4
- import { CatalogCollatorEntityTransformer as CatalogCollatorEntityTransformer$1 } from '@backstage/plugin-search-backend-module-catalog';
5
- import { TokenManager } from '@backstage/backend-common';
6
- import { GetEntitiesRequest, CatalogApi } from '@backstage/catalog-client';
7
- import { Config } from '@backstage/config';
8
- import { Permission } from '@backstage/plugin-permission-common';
9
- import { DocumentCollatorFactory } from '@backstage/plugin-search-common';
10
- import { Readable } from 'stream';
11
2
  import { Entity } from '@backstage/catalog-model';
12
3
  import { CatalogEntityDocument } from '@backstage/plugin-catalog-common';
13
4
 
5
+ /** @public */
6
+ type CatalogCollatorEntityTransformer = (entity: Entity) => Omit<CatalogEntityDocument, 'location' | 'authorization'>;
7
+
8
+ /** @public */
9
+ declare const defaultCatalogCollatorEntityTransformer: CatalogCollatorEntityTransformer;
10
+
14
11
  /**
15
12
  * Options for {@link catalogCollatorExtensionPoint}.
16
13
  *
@@ -20,7 +17,7 @@ type CatalogCollatorExtensionPoint = {
20
17
  /**
21
18
  * Allows you to customize how entities are shaped into documents.
22
19
  */
23
- setEntityTransformer(transformer: CatalogCollatorEntityTransformer$1): void;
20
+ setEntityTransformer(transformer: CatalogCollatorEntityTransformer): void;
24
21
  };
25
22
  /**
26
23
  * Extension point for customizing how catalog entities are shaped into
@@ -34,60 +31,6 @@ declare const catalogCollatorExtensionPoint: _backstage_backend_plugin_api.Exten
34
31
  *
35
32
  * @public
36
33
  */
37
- declare const _default: _backstage_backend_plugin_api.BackendFeature;
38
-
39
- /** @public */
40
- type CatalogCollatorEntityTransformer = (entity: Entity) => Omit<CatalogEntityDocument, 'location' | 'authorization'>;
41
-
42
- /**
43
- * @public
44
- * @deprecated This type is deprecated along with the {@link DefaultCatalogCollatorFactory}.
45
- */
46
- type DefaultCatalogCollatorFactoryOptions = {
47
- auth?: AuthService;
48
- discovery: DiscoveryService;
49
- tokenManager?: TokenManager;
50
- /**
51
- * @deprecated Use the config key `search.collators.catalog.locationTemplate` instead.
52
- */
53
- locationTemplate?: string;
54
- /**
55
- * @deprecated Use the config key `search.collators.catalog.filter` instead.
56
- */
57
- filter?: GetEntitiesRequest['filter'];
58
- /**
59
- * @deprecated Use the config key `search.collators.catalog.batchSize` instead.
60
- */
61
- batchSize?: number;
62
- catalogClient?: CatalogApi;
63
- /**
64
- * Allows you to customize how entities are shaped into documents.
65
- */
66
- entityTransformer?: CatalogCollatorEntityTransformer;
67
- };
68
- /**
69
- * Collates entities from the Catalog into documents for the search backend.
70
- *
71
- * @public
72
- * @deprecated Migrate to the {@link https://backstage.io/docs/backend-system/building-backends/migrating | new backend system} and install this collator via module instead (see {@link https://github.com/backstage/backstage/blob/nbs10/search-deprecate-create-router/plugins/search-backend-module-catalog/README.md#installation | here} for more installation details).
73
- */
74
- declare class DefaultCatalogCollatorFactory implements DocumentCollatorFactory {
75
- readonly type = "software-catalog";
76
- readonly visibilityPermission: Permission;
77
- private locationTemplate;
78
- private filter?;
79
- private batchSize;
80
- private readonly catalogClient;
81
- private entityTransformer;
82
- private auth;
83
- static fromConfig(configRoot: Config, options: DefaultCatalogCollatorFactoryOptions): DefaultCatalogCollatorFactory;
84
- private constructor();
85
- getCollator(): Promise<Readable>;
86
- private execute;
87
- private applyArgsToFormat;
88
- }
89
-
90
- /** @public */
91
- declare const defaultCatalogCollatorEntityTransformer: CatalogCollatorEntityTransformer;
34
+ declare const searchModuleCatalogCollator: _backstage_backend_plugin_api.BackendFeature;
92
35
 
93
- export { type CatalogCollatorEntityTransformer, type CatalogCollatorExtensionPoint, DefaultCatalogCollatorFactory, type DefaultCatalogCollatorFactoryOptions, catalogCollatorExtensionPoint, _default as default, defaultCatalogCollatorEntityTransformer };
36
+ export { type CatalogCollatorEntityTransformer, type CatalogCollatorExtensionPoint, catalogCollatorExtensionPoint, searchModuleCatalogCollator as default, defaultCatalogCollatorEntityTransformer };
@@ -1,17 +1,15 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var backendPluginApi = require('@backstage/backend-plugin-api');
6
- var alpha$1 = require('@backstage/plugin-catalog-node/alpha');
7
- var pluginSearchBackendModuleCatalog = require('@backstage/plugin-search-backend-module-catalog');
4
+ var pluginCatalogNode = require('@backstage/plugin-catalog-node');
8
5
  var alpha = require('@backstage/plugin-search-backend-node/alpha');
9
6
  var config = require('./collators/config.cjs.js');
7
+ var DefaultCatalogCollatorFactory = require('./collators/DefaultCatalogCollatorFactory.cjs.js');
10
8
 
11
9
  const catalogCollatorExtensionPoint = backendPluginApi.createExtensionPoint({
12
10
  id: "search.catalogCollator.extension"
13
11
  });
14
- var feature = backendPluginApi.createBackendModule({
12
+ const searchModuleCatalogCollator = backendPluginApi.createBackendModule({
15
13
  pluginId: "search",
16
14
  moduleId: "catalog-collator",
17
15
  register(env) {
@@ -28,28 +26,19 @@ var feature = backendPluginApi.createBackendModule({
28
26
  deps: {
29
27
  auth: backendPluginApi.coreServices.auth,
30
28
  config: backendPluginApi.coreServices.rootConfig,
31
- discovery: backendPluginApi.coreServices.discovery,
32
29
  scheduler: backendPluginApi.coreServices.scheduler,
33
30
  indexRegistry: alpha.searchIndexRegistryExtensionPoint,
34
- catalog: alpha$1.catalogServiceRef
31
+ catalog: pluginCatalogNode.catalogServiceRef
35
32
  },
36
- async init({
37
- auth,
38
- config: config$1,
39
- discovery,
40
- scheduler,
41
- indexRegistry,
42
- catalog
43
- }) {
33
+ async init({ auth, config: config$1, scheduler, indexRegistry, catalog }) {
44
34
  indexRegistry.addCollator({
45
35
  schedule: scheduler.createScheduledTaskRunner(
46
36
  config.readScheduleConfigOptions(config$1)
47
37
  ),
48
- factory: pluginSearchBackendModuleCatalog.DefaultCatalogCollatorFactory.fromConfig(config$1, {
38
+ factory: DefaultCatalogCollatorFactory.DefaultCatalogCollatorFactory.fromConfig(config$1, {
49
39
  auth,
50
- entityTransformer,
51
- discovery,
52
- catalogClient: catalog
40
+ catalog,
41
+ entityTransformer
53
42
  })
54
43
  });
55
44
  }
@@ -58,5 +47,5 @@ var feature = backendPluginApi.createBackendModule({
58
47
  });
59
48
 
60
49
  exports.catalogCollatorExtensionPoint = catalogCollatorExtensionPoint;
61
- exports.default = feature;
50
+ exports.searchModuleCatalogCollator = searchModuleCatalogCollator;
62
51
  //# sourceMappingURL=module.cjs.js.map
@@ -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 Catalog modules.\n */\n\nimport {\n coreServices,\n createBackendModule,\n createExtensionPoint,\n} from '@backstage/backend-plugin-api';\nimport { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha';\nimport {\n CatalogCollatorEntityTransformer,\n DefaultCatalogCollatorFactory,\n} from '@backstage/plugin-search-backend-module-catalog';\nimport { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha';\nimport { readScheduleConfigOptions } from './collators/config';\n\n/**\n * Options for {@link catalogCollatorExtensionPoint}.\n *\n * @public\n */\nexport type CatalogCollatorExtensionPoint = {\n /**\n * Allows you to customize how entities are shaped into documents.\n */\n setEntityTransformer(transformer: CatalogCollatorEntityTransformer): void;\n};\n\n/**\n * Extension point for customizing how catalog entities are shaped into\n * documents for the search backend.\n *\n * @public\n */\nexport const catalogCollatorExtensionPoint =\n createExtensionPoint<CatalogCollatorExtensionPoint>({\n id: 'search.catalogCollator.extension',\n });\n\n/**\n * Search backend module for the Catalog index.\n *\n * @public\n */\nexport default createBackendModule({\n pluginId: 'search',\n moduleId: 'catalog-collator',\n register(env) {\n let entityTransformer: CatalogCollatorEntityTransformer | undefined;\n\n env.registerExtensionPoint(catalogCollatorExtensionPoint, {\n setEntityTransformer(transformer) {\n if (entityTransformer) {\n throw new Error('setEntityTransformer can only be called once');\n }\n entityTransformer = transformer;\n },\n });\n\n env.registerInit({\n deps: {\n auth: coreServices.auth,\n config: coreServices.rootConfig,\n discovery: coreServices.discovery,\n scheduler: coreServices.scheduler,\n indexRegistry: searchIndexRegistryExtensionPoint,\n catalog: catalogServiceRef,\n },\n async init({\n auth,\n config,\n discovery,\n scheduler,\n indexRegistry,\n catalog,\n }) {\n indexRegistry.addCollator({\n schedule: scheduler.createScheduledTaskRunner(\n readScheduleConfigOptions(config),\n ),\n factory: DefaultCatalogCollatorFactory.fromConfig(config, {\n auth,\n entityTransformer,\n discovery,\n catalogClient: catalog,\n }),\n });\n },\n });\n },\n});\n"],"names":["createExtensionPoint","createBackendModule","coreServices","searchIndexRegistryExtensionPoint","catalogServiceRef","config","readScheduleConfigOptions","DefaultCatalogCollatorFactory"],"mappings":";;;;;;;;;;AAoDO,MAAM,gCACXA,qCAAoD,CAAA;AAAA,EAClD,EAAI,EAAA;AACN,CAAC;AAOH,cAAeC,oCAAoB,CAAA;AAAA,EACjC,QAAU,EAAA,QAAA;AAAA,EACV,QAAU,EAAA,kBAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAI,IAAA,iBAAA;AAEJ,IAAA,GAAA,CAAI,uBAAuB,6BAA+B,EAAA;AAAA,MACxD,qBAAqB,WAAa,EAAA;AAChC,QAAA,IAAI,iBAAmB,EAAA;AACrB,UAAM,MAAA,IAAI,MAAM,8CAA8C,CAAA;AAAA;AAEhE,QAAoB,iBAAA,GAAA,WAAA;AAAA;AACtB,KACD,CAAA;AAED,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,MAAMC,6BAAa,CAAA,IAAA;AAAA,QACnB,QAAQA,6BAAa,CAAA,UAAA;AAAA,QACrB,WAAWA,6BAAa,CAAA,SAAA;AAAA,QACxB,WAAWA,6BAAa,CAAA,SAAA;AAAA,QACxB,aAAe,EAAAC,uCAAA;AAAA,QACf,OAAS,EAAAC;AAAA,OACX;AAAA,MACA,MAAM,IAAK,CAAA;AAAA,QACT,IAAA;AAAA,gBACAC,QAAA;AAAA,QACA,SAAA;AAAA,QACA,SAAA;AAAA,QACA,aAAA;AAAA,QACA;AAAA,OACC,EAAA;AACD,QAAA,aAAA,CAAc,WAAY,CAAA;AAAA,UACxB,UAAU,SAAU,CAAA,yBAAA;AAAA,YAClBC,iCAA0BD,QAAM;AAAA,WAClC;AAAA,UACA,OAAA,EAASE,8DAA8B,CAAA,UAAA,CAAWF,QAAQ,EAAA;AAAA,YACxD,IAAA;AAAA,YACA,iBAAA;AAAA,YACA,SAAA;AAAA,YACA,aAAe,EAAA;AAAA,WAChB;AAAA,SACF,CAAA;AAAA;AACH,KACD,CAAA;AAAA;AAEL,CAAC,CAAA;;;;;"}
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 *\n * A collator module for the search backend that indexes your software catalog.\n */\n\nimport {\n coreServices,\n createBackendModule,\n createExtensionPoint,\n} from '@backstage/backend-plugin-api';\nimport { catalogServiceRef } from '@backstage/plugin-catalog-node';\nimport { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha';\nimport { readScheduleConfigOptions } from './collators/config';\nimport { CatalogCollatorEntityTransformer } from './collators';\nimport { DefaultCatalogCollatorFactory } from './collators/DefaultCatalogCollatorFactory';\n\n/**\n * Options for {@link catalogCollatorExtensionPoint}.\n *\n * @public\n */\nexport type CatalogCollatorExtensionPoint = {\n /**\n * Allows you to customize how entities are shaped into documents.\n */\n setEntityTransformer(transformer: CatalogCollatorEntityTransformer): void;\n};\n\n/**\n * Extension point for customizing how catalog entities are shaped into\n * documents for the search backend.\n *\n * @public\n */\nexport const catalogCollatorExtensionPoint =\n createExtensionPoint<CatalogCollatorExtensionPoint>({\n id: 'search.catalogCollator.extension',\n });\n\n/**\n * Search backend module for the Catalog index.\n *\n * @public\n */\nexport const searchModuleCatalogCollator = createBackendModule({\n pluginId: 'search',\n moduleId: 'catalog-collator',\n register(env) {\n let entityTransformer: CatalogCollatorEntityTransformer | undefined;\n\n env.registerExtensionPoint(catalogCollatorExtensionPoint, {\n setEntityTransformer(transformer) {\n if (entityTransformer) {\n throw new Error('setEntityTransformer can only be called once');\n }\n entityTransformer = transformer;\n },\n });\n\n env.registerInit({\n deps: {\n auth: coreServices.auth,\n config: coreServices.rootConfig,\n scheduler: coreServices.scheduler,\n indexRegistry: searchIndexRegistryExtensionPoint,\n catalog: catalogServiceRef,\n },\n async init({ auth, config, scheduler, indexRegistry, catalog }) {\n indexRegistry.addCollator({\n schedule: scheduler.createScheduledTaskRunner(\n readScheduleConfigOptions(config),\n ),\n factory: DefaultCatalogCollatorFactory.fromConfig(config, {\n auth,\n catalog,\n entityTransformer,\n }),\n });\n },\n });\n },\n});\n"],"names":["createExtensionPoint","createBackendModule","coreServices","searchIndexRegistryExtensionPoint","catalogServiceRef","config","readScheduleConfigOptions","DefaultCatalogCollatorFactory"],"mappings":";;;;;;;;AAmDO,MAAM,gCACXA,qCAAoD,CAAA;AAAA,EAClD,EAAI,EAAA;AACN,CAAC;AAOI,MAAM,8BAA8BC,oCAAoB,CAAA;AAAA,EAC7D,QAAU,EAAA,QAAA;AAAA,EACV,QAAU,EAAA,kBAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAI,IAAA,iBAAA;AAEJ,IAAA,GAAA,CAAI,uBAAuB,6BAA+B,EAAA;AAAA,MACxD,qBAAqB,WAAa,EAAA;AAChC,QAAA,IAAI,iBAAmB,EAAA;AACrB,UAAM,MAAA,IAAI,MAAM,8CAA8C,CAAA;AAAA;AAEhE,QAAoB,iBAAA,GAAA,WAAA;AAAA;AACtB,KACD,CAAA;AAED,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,MAAMC,6BAAa,CAAA,IAAA;AAAA,QACnB,QAAQA,6BAAa,CAAA,UAAA;AAAA,QACrB,WAAWA,6BAAa,CAAA,SAAA;AAAA,QACxB,aAAe,EAAAC,uCAAA;AAAA,QACf,OAAS,EAAAC;AAAA,OACX;AAAA,MACA,MAAM,KAAK,EAAE,IAAA,UAAMC,UAAQ,SAAW,EAAA,aAAA,EAAe,SAAW,EAAA;AAC9D,QAAA,aAAA,CAAc,WAAY,CAAA;AAAA,UACxB,UAAU,SAAU,CAAA,yBAAA;AAAA,YAClBC,iCAA0BD,QAAM;AAAA,WAClC;AAAA,UACA,OAAA,EAASE,2DAA8B,CAAA,UAAA,CAAWF,QAAQ,EAAA;AAAA,YACxD,IAAA;AAAA,YACA,OAAA;AAAA,YACA;AAAA,WACD;AAAA,SACF,CAAA;AAAA;AACH,KACD,CAAA;AAAA;AAEL,CAAC;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-search-backend-module-catalog",
3
- "version": "0.2.6",
3
+ "version": "0.3.0-next.0",
4
4
  "description": "A module for the search backend that exports catalog modules",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -8,7 +8,9 @@
8
8
  "pluginPackage": "@backstage/plugin-search-backend"
9
9
  },
10
10
  "publishConfig": {
11
- "access": "public"
11
+ "access": "public",
12
+ "main": "dist/index.cjs.js",
13
+ "types": "dist/index.d.ts"
12
14
  },
13
15
  "homepage": "https://backstage.io",
14
16
  "repository": {
@@ -17,33 +19,8 @@
17
19
  "directory": "plugins/search-backend-module-catalog"
18
20
  },
19
21
  "license": "Apache-2.0",
20
- "exports": {
21
- ".": {
22
- "backstage": "@backstage/BackendFeature",
23
- "require": "./dist/index.cjs.js",
24
- "types": "./dist/index.d.ts",
25
- "default": "./dist/index.cjs.js"
26
- },
27
- "./alpha": {
28
- "backstage": "@backstage/BackendFeature",
29
- "require": "./dist/alpha.cjs.js",
30
- "types": "./dist/alpha.d.ts",
31
- "default": "./dist/alpha.cjs.js"
32
- },
33
- "./package.json": "./package.json"
34
- },
35
- "main": "./dist/index.cjs.js",
36
- "types": "./dist/index.d.ts",
37
- "typesVersions": {
38
- "*": {
39
- "index": [
40
- "dist/index.d.ts"
41
- ],
42
- "alpha": [
43
- "dist/alpha.d.ts"
44
- ]
45
- }
46
- },
22
+ "main": "dist/index.cjs.js",
23
+ "types": "dist/index.d.ts",
47
24
  "files": [
48
25
  "dist",
49
26
  "config.d.ts"
@@ -58,23 +35,29 @@
58
35
  "test": "backstage-cli package test"
59
36
  },
60
37
  "dependencies": {
61
- "@backstage/backend-common": "^0.25.0",
62
- "@backstage/backend-plugin-api": "^1.1.0",
63
- "@backstage/catalog-client": "^1.9.0",
64
- "@backstage/catalog-model": "^1.7.2",
65
- "@backstage/config": "^1.3.1",
66
- "@backstage/errors": "^1.2.6",
67
- "@backstage/plugin-catalog-common": "^1.1.2",
68
- "@backstage/plugin-catalog-node": "^1.15.0",
69
- "@backstage/plugin-permission-common": "^0.8.3",
70
- "@backstage/plugin-search-backend-node": "^1.3.6",
71
- "@backstage/plugin-search-common": "^1.2.16"
38
+ "@backstage/backend-plugin-api": "1.1.1-next.0",
39
+ "@backstage/catalog-client": "1.9.0",
40
+ "@backstage/catalog-model": "1.7.2",
41
+ "@backstage/config": "1.3.1",
42
+ "@backstage/errors": "1.2.6",
43
+ "@backstage/plugin-catalog-common": "1.1.2",
44
+ "@backstage/plugin-catalog-node": "1.15.1-next.0",
45
+ "@backstage/plugin-permission-common": "0.8.3",
46
+ "@backstage/plugin-search-backend-node": "1.3.7-next.0",
47
+ "@backstage/plugin-search-common": "1.2.16"
72
48
  },
73
49
  "devDependencies": {
74
50
  "@backstage/backend-common": "^0.25.0",
75
- "@backstage/backend-test-utils": "^1.2.0",
76
- "@backstage/cli": "^0.29.4",
51
+ "@backstage/backend-test-utils": "1.2.1-next.0",
52
+ "@backstage/cli": "0.29.5-next.0",
77
53
  "msw": "^1.0.0"
78
54
  },
79
- "configSchema": "config.d.ts"
55
+ "configSchema": "config.d.ts",
56
+ "typesVersions": {
57
+ "*": {
58
+ "index": [
59
+ "dist/index.d.ts"
60
+ ]
61
+ }
62
+ }
80
63
  }
package/dist/alpha.cjs.js DELETED
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var module$1 = require('./module.cjs.js');
6
-
7
- const _feature = module$1.default;
8
-
9
- exports.default = _feature;
10
- //# sourceMappingURL=alpha.cjs.js.map
@@ -1 +0,0 @@
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,QAAW,GAAAA;;;;"}
package/dist/alpha.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
-
3
- /** @alpha */
4
- declare const _feature: _backstage_backend_plugin_api.BackendFeature;
5
-
6
- export { _feature as default };