@backstage/plugin-catalog-node 2.1.1-next.0 → 2.2.0-next.2

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,38 @@
1
1
  # @backstage/plugin-catalog-node
2
2
 
3
+ ## 2.2.0-next.2
4
+
5
+ ### Minor Changes
6
+
7
+ - 056e18e: **BREAKING ALPHA**: Removed the deprecated `CatalogPermissionRuleInput`, `CatalogPermissionExtensionPoint`, and `catalogPermissionExtensionPoint` exports. Use `coreServices.permissionsRegistry` directly to register catalog entity permission rules and permissions.
8
+ - 7a03196: **BREAKING ALPHA**: Removed the following deprecated exports from `@backstage/plugin-catalog-node/alpha`:
9
+
10
+ - `catalogServiceRef` — use `catalogServiceRef` from `@backstage/plugin-catalog-node` instead
11
+ - `CatalogLocationsExtensionPoint` / `catalogLocationsExtensionPoint` — use the non-alpha equivalents from `@backstage/plugin-catalog-node` instead
12
+ - `CatalogProcessingExtensionPoint` / `catalogProcessingExtensionPoint` — use the non-alpha equivalents from `@backstage/plugin-catalog-node` instead
13
+ - `CatalogAnalysisExtensionPoint` / `catalogAnalysisExtensionPoint` — use the non-alpha equivalents from `@backstage/plugin-catalog-node` instead
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+ - @backstage/errors@1.3.0-next.0
19
+ - @backstage/backend-plugin-api@1.9.0-next.2
20
+ - @backstage/backend-test-utils@1.11.2-next.2
21
+ - @backstage/catalog-client@1.14.1-next.0
22
+ - @backstage/catalog-model@1.7.8-next.0
23
+ - @backstage/plugin-permission-common@0.9.8-next.0
24
+ - @backstage/plugin-permission-node@0.10.12-next.2
25
+ - @backstage/plugin-catalog-common@1.1.9-next.0
26
+
27
+ ## 2.1.1-next.1
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies
32
+ - @backstage/backend-plugin-api@1.9.0-next.1
33
+ - @backstage/backend-test-utils@1.11.2-next.1
34
+ - @backstage/plugin-permission-node@0.10.12-next.1
35
+
3
36
  ## 2.1.1-next.0
4
37
 
5
38
  ### Patch Changes
package/dist/alpha.cjs.js CHANGED
@@ -1,10 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var backendPluginApi = require('@backstage/backend-plugin-api');
4
- var catalogClient = require('@backstage/catalog-client');
5
3
  var alpha = require('@backstage/plugin-catalog-common/alpha');
6
4
  var pluginPermissionNode = require('@backstage/plugin-permission-node');
7
- var pluginCatalogNode = require('@backstage/plugin-catalog-node');
8
5
  var extensions = require('./extensions.cjs.js');
9
6
  var catalogScmEventsServiceRef = require('./scmEvents/catalogScmEventsServiceRef.cjs.js');
10
7
 
@@ -12,28 +9,8 @@ const catalogEntityPermissionResourceRef = pluginPermissionNode.createPermission
12
9
  pluginId: "catalog",
13
10
  resourceType: alpha.RESOURCE_TYPE_CATALOG_ENTITY
14
11
  });
15
- const catalogServiceRef = backendPluginApi.createServiceRef({
16
- id: "catalog-client-legacy",
17
- defaultFactory: async (service) => backendPluginApi.createServiceFactory({
18
- service,
19
- deps: {
20
- discoveryApi: backendPluginApi.coreServices.discovery
21
- },
22
- async factory({ discoveryApi }) {
23
- return new catalogClient.CatalogClient({ discoveryApi });
24
- }
25
- })
26
- });
27
- const catalogLocationsExtensionPoint = pluginCatalogNode.catalogLocationsExtensionPoint;
28
- const catalogProcessingExtensionPoint = pluginCatalogNode.catalogProcessingExtensionPoint;
29
- const catalogAnalysisExtensionPoint = pluginCatalogNode.catalogAnalysisExtensionPoint;
30
12
 
31
13
  exports.catalogModelExtensionPoint = extensions.catalogModelExtensionPoint;
32
- exports.catalogPermissionExtensionPoint = extensions.catalogPermissionExtensionPoint;
33
14
  exports.catalogScmEventsServiceRef = catalogScmEventsServiceRef.catalogScmEventsServiceRef;
34
- exports.catalogAnalysisExtensionPoint = catalogAnalysisExtensionPoint;
35
15
  exports.catalogEntityPermissionResourceRef = catalogEntityPermissionResourceRef;
36
- exports.catalogLocationsExtensionPoint = catalogLocationsExtensionPoint;
37
- exports.catalogProcessingExtensionPoint = catalogProcessingExtensionPoint;
38
- exports.catalogServiceRef = catalogServiceRef;
39
16
  //# sourceMappingURL=alpha.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.cjs.js","sources":["../src/alpha.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 coreServices,\n createServiceFactory,\n createServiceRef,\n} from '@backstage/backend-plugin-api';\nimport { catalogServiceRef as _catalogServiceRef } from './catalogService';\nimport { CatalogApi, CatalogClient } from '@backstage/catalog-client';\nimport { RESOURCE_TYPE_CATALOG_ENTITY } from '@backstage/plugin-catalog-common/alpha';\nimport { createPermissionResourceRef } from '@backstage/plugin-permission-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { EntitiesSearchFilter } from '@backstage/plugin-catalog-node';\n\n/** @alpha */\nexport const catalogEntityPermissionResourceRef = createPermissionResourceRef<\n Entity,\n EntitiesSearchFilter\n>().with({\n pluginId: 'catalog',\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * @alpha\n * @deprecated Use {@link @backstage/plugin-catalog-node#catalogServiceRef} instead\n */\nexport const catalogServiceRef = createServiceRef<CatalogApi>({\n id: 'catalog-client-legacy',\n defaultFactory: async service =>\n createServiceFactory({\n service,\n deps: {\n discoveryApi: coreServices.discovery,\n },\n async factory({ discoveryApi }) {\n return new CatalogClient({ discoveryApi });\n },\n }),\n});\n\nimport {\n CatalogLocationsExtensionPoint as _CatalogLocationsExtensionPoint,\n CatalogProcessingExtensionPoint as _CatalogProcessingExtensionPoint,\n CatalogAnalysisExtensionPoint as _CatalogAnalysisExtensionPoint,\n catalogLocationsExtensionPoint as _catalogLocationsExtensionPoint,\n catalogProcessingExtensionPoint as _catalogProcessingExtensionPoint,\n catalogAnalysisExtensionPoint as _catalogAnalysisExtensionPoint,\n} from '@backstage/plugin-catalog-node';\n\n/**\n * @alpha\n * @deprecated Use {@link @backstage/plugin-catalog-node#CatalogLocationsExtensionPoint} instead\n */\nexport type CatalogLocationsExtensionPoint = _CatalogLocationsExtensionPoint;\n\n/**\n * @alpha\n * @deprecated Use {@link @backstage/plugin-catalog-node#catalogLocationsExtensionPoint} instead\n */\nexport const catalogLocationsExtensionPoint = _catalogLocationsExtensionPoint;\n\n/**\n * @alpha\n * @deprecated Use {@link @backstage/plugin-catalog-node#CatalogProcessingExtensionPoint} instead\n */\nexport type CatalogProcessingExtensionPoint = _CatalogProcessingExtensionPoint;\n\n/**\n * @alpha\n * @deprecated Use {@link @backstage/plugin-catalog-node#catalogProcessingExtensionPoint} instead\n */\nexport const catalogProcessingExtensionPoint = _catalogProcessingExtensionPoint;\n\n/**\n * @alpha\n * @deprecated Use {@link @backstage/plugin-catalog-node#CatalogAnalysisExtensionPoint} instead\n */\nexport type CatalogAnalysisExtensionPoint = _CatalogAnalysisExtensionPoint;\n\n/**\n * @alpha\n * @deprecated Use {@link @backstage/plugin-catalog-node#catalogAnalysisExtensionPoint} instead\n */\nexport const catalogAnalysisExtensionPoint = _catalogAnalysisExtensionPoint;\n\nexport type { CatalogModelExtensionPoint } from './extensions';\nexport { catalogModelExtensionPoint } from './extensions';\nexport type { CatalogPermissionRuleInput } from './extensions';\nexport type { CatalogPermissionExtensionPoint } from './extensions';\nexport { catalogPermissionExtensionPoint } from './extensions';\n\nexport * from './scmEvents';\n"],"names":["createPermissionResourceRef","RESOURCE_TYPE_CATALOG_ENTITY","createServiceRef","createServiceFactory","coreServices","CatalogClient","_catalogLocationsExtensionPoint","_catalogProcessingExtensionPoint","_catalogAnalysisExtensionPoint"],"mappings":";;;;;;;;;;AA6BO,MAAM,kCAAA,GAAqCA,gDAAA,EAGhD,CAAE,IAAA,CAAK;AAAA,EACP,QAAA,EAAU,SAAA;AAAA,EACV,YAAA,EAAcC;AAChB,CAAC;AAMM,MAAM,oBAAoBC,iCAAA,CAA6B;AAAA,EAC5D,EAAA,EAAI,uBAAA;AAAA,EACJ,cAAA,EAAgB,OAAM,OAAA,KACpBC,qCAAA,CAAqB;AAAA,IACnB,OAAA;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,cAAcC,6BAAA,CAAa;AAAA,KAC7B;AAAA,IACA,MAAM,OAAA,CAAQ,EAAE,YAAA,EAAa,EAAG;AAC9B,MAAA,OAAO,IAAIC,2BAAA,CAAc,EAAE,YAAA,EAAc,CAAA;AAAA,IAC3C;AAAA,GACD;AACL,CAAC;AAqBM,MAAM,8BAAA,GAAiCC;AAYvC,MAAM,+BAAA,GAAkCC;AAYxC,MAAM,6BAAA,GAAgCC;;;;;;;;;;;"}
1
+ {"version":3,"file":"alpha.cjs.js","sources":["../src/alpha.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 { RESOURCE_TYPE_CATALOG_ENTITY } from '@backstage/plugin-catalog-common/alpha';\nimport { createPermissionResourceRef } from '@backstage/plugin-permission-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { EntitiesSearchFilter } from '@backstage/plugin-catalog-node';\n\n/** @alpha */\nexport const catalogEntityPermissionResourceRef = createPermissionResourceRef<\n Entity,\n EntitiesSearchFilter\n>().with({\n pluginId: 'catalog',\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\nexport type { CatalogModelExtensionPoint } from './extensions';\nexport { catalogModelExtensionPoint } from './extensions';\n\nexport * from './scmEvents';\n"],"names":["createPermissionResourceRef","RESOURCE_TYPE_CATALOG_ENTITY"],"mappings":";;;;;;;AAsBO,MAAM,kCAAA,GAAqCA,gDAAA,EAGhD,CAAE,IAAA,CAAK;AAAA,EACP,QAAA,EAAU,SAAA;AAAA,EACV,YAAA,EAAcC;AAChB,CAAC;;;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
1
  import * as _backstage_plugin_permission_node from '@backstage/plugin-permission-node';
3
- import { CatalogApi } from '@backstage/catalog-client';
4
2
  import { Entity } from '@backstage/catalog-model';
5
- import { EntitiesSearchFilter, CatalogLocationsExtensionPoint as CatalogLocationsExtensionPoint$1, CatalogProcessingExtensionPoint as CatalogProcessingExtensionPoint$1, CatalogAnalysisExtensionPoint as CatalogAnalysisExtensionPoint$1 } from '@backstage/plugin-catalog-node';
6
- export { f as CatalogModelExtensionPoint, i as CatalogPermissionExtensionPoint, h as CatalogPermissionRuleInput, g as catalogModelExtensionPoint, j as catalogPermissionExtensionPoint } from './types/extensions.d-Cvnx6_V0.js';
7
- import '@backstage/plugin-permission-common';
3
+ import { EntitiesSearchFilter } from '@backstage/plugin-catalog-node';
4
+ export { f as CatalogModelExtensionPoint, g as catalogModelExtensionPoint } from './types/extensions.d-ojRdpmUf.js';
5
+ import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
8
6
 
9
7
  /**
10
8
  * A subscriber of the {@link CatalogScmEventsService}.
@@ -194,42 +192,6 @@ declare const catalogScmEventsServiceRef: _backstage_backend_plugin_api.ServiceR
194
192
 
195
193
  /** @alpha */
196
194
  declare const catalogEntityPermissionResourceRef: _backstage_plugin_permission_node.PermissionResourceRef<Entity, EntitiesSearchFilter, "catalog-entity", "catalog">;
197
- /**
198
- * @alpha
199
- * @deprecated Use {@link @backstage/plugin-catalog-node#catalogServiceRef} instead
200
- */
201
- declare const catalogServiceRef: _backstage_backend_plugin_api.ServiceRef<CatalogApi, "plugin", "singleton">;
202
-
203
- /**
204
- * @alpha
205
- * @deprecated Use {@link @backstage/plugin-catalog-node#CatalogLocationsExtensionPoint} instead
206
- */
207
- type CatalogLocationsExtensionPoint = CatalogLocationsExtensionPoint$1;
208
- /**
209
- * @alpha
210
- * @deprecated Use {@link @backstage/plugin-catalog-node#catalogLocationsExtensionPoint} instead
211
- */
212
- declare const catalogLocationsExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<CatalogLocationsExtensionPoint$1>;
213
- /**
214
- * @alpha
215
- * @deprecated Use {@link @backstage/plugin-catalog-node#CatalogProcessingExtensionPoint} instead
216
- */
217
- type CatalogProcessingExtensionPoint = CatalogProcessingExtensionPoint$1;
218
- /**
219
- * @alpha
220
- * @deprecated Use {@link @backstage/plugin-catalog-node#catalogProcessingExtensionPoint} instead
221
- */
222
- declare const catalogProcessingExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<CatalogProcessingExtensionPoint$1>;
223
- /**
224
- * @alpha
225
- * @deprecated Use {@link @backstage/plugin-catalog-node#CatalogAnalysisExtensionPoint} instead
226
- */
227
- type CatalogAnalysisExtensionPoint = CatalogAnalysisExtensionPoint$1;
228
- /**
229
- * @alpha
230
- * @deprecated Use {@link @backstage/plugin-catalog-node#catalogAnalysisExtensionPoint} instead
231
- */
232
- declare const catalogAnalysisExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<CatalogAnalysisExtensionPoint$1>;
233
195
 
234
- export { catalogAnalysisExtensionPoint, catalogEntityPermissionResourceRef, catalogLocationsExtensionPoint, catalogProcessingExtensionPoint, catalogScmEventsServiceRef, catalogServiceRef };
235
- export type { CatalogAnalysisExtensionPoint, CatalogLocationsExtensionPoint, CatalogProcessingExtensionPoint, CatalogScmEvent, CatalogScmEventContext, CatalogScmEventsService, CatalogScmEventsServiceSubscriber };
196
+ export { catalogEntityPermissionResourceRef, catalogScmEventsServiceRef };
197
+ export type { CatalogScmEvent, CatalogScmEventContext, CatalogScmEventsService, CatalogScmEventsServiceSubscriber };
@@ -14,13 +14,9 @@ const catalogAnalysisExtensionPoint = backendPluginApi.createExtensionPoint({
14
14
  const catalogModelExtensionPoint = backendPluginApi.createExtensionPoint({
15
15
  id: "catalog.model"
16
16
  });
17
- const catalogPermissionExtensionPoint = backendPluginApi.createExtensionPoint({
18
- id: "catalog.permission"
19
- });
20
17
 
21
18
  exports.catalogAnalysisExtensionPoint = catalogAnalysisExtensionPoint;
22
19
  exports.catalogLocationsExtensionPoint = catalogLocationsExtensionPoint;
23
20
  exports.catalogModelExtensionPoint = catalogModelExtensionPoint;
24
- exports.catalogPermissionExtensionPoint = catalogPermissionExtensionPoint;
25
21
  exports.catalogProcessingExtensionPoint = catalogProcessingExtensionPoint;
26
22
  //# sourceMappingURL=extensions.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.cjs.js","sources":["../src/extensions.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 { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { Entity, Validators } from '@backstage/catalog-model';\nimport {\n CatalogProcessor,\n CatalogProcessorParser,\n EntitiesSearchFilter,\n EntityProvider,\n PlaceholderResolver,\n LocationAnalyzer,\n ScmLocationAnalyzer,\n} from '@backstage/plugin-catalog-node';\nimport {\n Permission,\n PermissionRuleParams,\n} from '@backstage/plugin-permission-common';\nimport { PermissionRule } from '@backstage/plugin-permission-node';\n\n/**\n * @public\n */\nexport interface CatalogLocationsExtensionPoint {\n /**\n * Allows setting custom location types, such as showcased in: https://backstage.io/docs/features/software-catalog/external-integrations/#creating-a-catalog-data-reader-processor\n * @param locationTypes - List of location types to allow, default is \"url\" and \"file\"\n */\n setAllowedLocationTypes(locationTypes: Array<string>): void;\n}\n\n/**\n * @public\n */\nexport const catalogLocationsExtensionPoint =\n createExtensionPoint<CatalogLocationsExtensionPoint>({\n id: 'catalog.locations',\n });\n\n/**\n * @public\n */\nexport interface CatalogProcessingExtensionPoint {\n /**\n * Adds entity processors. These are responsible for reading, parsing, and\n * processing entities before they are persisted in the catalog.\n *\n * This function also can replace a Default processor if the provided processor\n * matches the processor name.\n *\n * @param processors - One or more processors\n */\n addProcessor(\n ...processors: Array<CatalogProcessor | Array<CatalogProcessor>>\n ): void;\n\n /**\n * Adds or replaces entity providers. These are responsible for bootstrapping\n * the list of entities out of original data sources. For example, there is\n * one entity source for the config locations, and one for the database\n * stored locations. If you ingest entities out of a third party system, you\n * may want to implement that in terms of an entity provider as well.\n *\n * @param providers - One or more entity providers\n */\n addEntityProvider(\n ...providers: Array<EntityProvider | Array<EntityProvider>>\n ): void;\n\n /**\n * Adds, or overwrites, a handler for placeholders (e.g. $file) in entity\n * definition files.\n *\n * @param key - The key that identifies the placeholder, e.g. \"file\"\n * @param resolver - The resolver that gets values for this placeholder\n */\n addPlaceholderResolver(key: string, resolver: PlaceholderResolver): void;\n\n setOnProcessingErrorHandler(\n handler: (event: {\n unprocessedEntity: Entity;\n errors: Error[];\n }) => Promise<void> | void,\n ): void;\n}\n\n/** @alpha */\nexport interface CatalogModelExtensionPoint {\n /**\n * Sets the validator function to use for one or more special fields of an\n * entity. This is useful if the default rules for formatting of fields are\n * not sufficient.\n *\n * @param validators - The (subset of) validators to set\n */\n setFieldValidators(validators: Partial<Validators>): void;\n\n /**\n * Sets the entity data parser which is used to read raw data from locations\n * @param parser - Parser which will used to extract entities from raw data\n */\n setEntityDataParser(parser: CatalogProcessorParser): void;\n}\n\n/**\n * @public\n */\nexport const catalogProcessingExtensionPoint =\n createExtensionPoint<CatalogProcessingExtensionPoint>({\n id: 'catalog.processing',\n });\n\n/**\n * @public\n */\nexport interface CatalogAnalysisExtensionPoint {\n /**\n * Replaces the entire location analyzer with a new one.\n *\n * @remarks\n *\n * By providing a factory function you can access all the SCM analyzers that\n * have been added through `addScmLocationAnalyzer`. If you provide a\n * `LocationAnalyzer` directly, the SCM analyzers will be ignored.\n */\n setLocationAnalyzer(\n analyzerOrFactory:\n | LocationAnalyzer\n | ((options: {\n scmLocationAnalyzers: ScmLocationAnalyzer[];\n }) => Promise<{ locationAnalyzer: LocationAnalyzer }>),\n ): void;\n\n /**\n * Adds an analyzer for a specific SCM type to the default location analyzer.\n */\n addScmLocationAnalyzer(analyzer: ScmLocationAnalyzer): void;\n}\n\n/**\n * @public\n */\nexport const catalogAnalysisExtensionPoint =\n createExtensionPoint<CatalogAnalysisExtensionPoint>({\n id: 'catalog.analysis',\n });\n\n/** @alpha */\nexport const catalogModelExtensionPoint =\n createExtensionPoint<CatalogModelExtensionPoint>({\n id: 'catalog.model',\n });\n\n/**\n * @alpha\n * @deprecated Use the `coreServices.permissionsRegistry` instead.\n */\nexport type CatalogPermissionRuleInput<\n TParams extends PermissionRuleParams = PermissionRuleParams,\n> = PermissionRule<Entity, EntitiesSearchFilter, 'catalog-entity', TParams>;\n\n/**\n * @alpha\n * @deprecated Use the `coreServices.permissionsRegistry` instead.\n */\nexport interface CatalogPermissionExtensionPoint {\n addPermissions(...permissions: Array<Permission | Array<Permission>>): void;\n addPermissionRules(\n ...rules: Array<\n CatalogPermissionRuleInput | Array<CatalogPermissionRuleInput>\n >\n ): void;\n}\n\n/**\n * @alpha\n * @deprecated Use the `coreServices.permissionsRegistry` instead.\n */\nexport const catalogPermissionExtensionPoint =\n createExtensionPoint<CatalogPermissionExtensionPoint>({\n id: 'catalog.permission',\n });\n"],"names":["createExtensionPoint"],"mappings":";;;;AA+CO,MAAM,iCACXA,qCAAA,CAAqD;AAAA,EACnD,EAAA,EAAI;AACN,CAAC;AAsEI,MAAM,kCACXA,qCAAA,CAAsD;AAAA,EACpD,EAAA,EAAI;AACN,CAAC;AAgCI,MAAM,gCACXA,qCAAA,CAAoD;AAAA,EAClD,EAAA,EAAI;AACN,CAAC;AAGI,MAAM,6BACXA,qCAAA,CAAiD;AAAA,EAC/C,EAAA,EAAI;AACN,CAAC;AA2BI,MAAM,kCACXA,qCAAA,CAAsD;AAAA,EACpD,EAAA,EAAI;AACN,CAAC;;;;;;;;"}
1
+ {"version":3,"file":"extensions.cjs.js","sources":["../src/extensions.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 { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { Entity, Validators } from '@backstage/catalog-model';\nimport {\n CatalogProcessor,\n CatalogProcessorParser,\n EntityProvider,\n PlaceholderResolver,\n LocationAnalyzer,\n ScmLocationAnalyzer,\n} from '@backstage/plugin-catalog-node';\n\n/**\n * @public\n */\nexport interface CatalogLocationsExtensionPoint {\n /**\n * Allows setting custom location types, such as showcased in: https://backstage.io/docs/features/software-catalog/external-integrations/#creating-a-catalog-data-reader-processor\n * @param locationTypes - List of location types to allow, default is \"url\" and \"file\"\n */\n setAllowedLocationTypes(locationTypes: Array<string>): void;\n}\n\n/**\n * @public\n */\nexport const catalogLocationsExtensionPoint =\n createExtensionPoint<CatalogLocationsExtensionPoint>({\n id: 'catalog.locations',\n });\n\n/**\n * @public\n */\nexport interface CatalogProcessingExtensionPoint {\n /**\n * Adds entity processors. These are responsible for reading, parsing, and\n * processing entities before they are persisted in the catalog.\n *\n * This function also can replace a Default processor if the provided processor\n * matches the processor name.\n *\n * @param processors - One or more processors\n */\n addProcessor(\n ...processors: Array<CatalogProcessor | Array<CatalogProcessor>>\n ): void;\n\n /**\n * Adds or replaces entity providers. These are responsible for bootstrapping\n * the list of entities out of original data sources. For example, there is\n * one entity source for the config locations, and one for the database\n * stored locations. If you ingest entities out of a third party system, you\n * may want to implement that in terms of an entity provider as well.\n *\n * @param providers - One or more entity providers\n */\n addEntityProvider(\n ...providers: Array<EntityProvider | Array<EntityProvider>>\n ): void;\n\n /**\n * Adds, or overwrites, a handler for placeholders (e.g. $file) in entity\n * definition files.\n *\n * @param key - The key that identifies the placeholder, e.g. \"file\"\n * @param resolver - The resolver that gets values for this placeholder\n */\n addPlaceholderResolver(key: string, resolver: PlaceholderResolver): void;\n\n setOnProcessingErrorHandler(\n handler: (event: {\n unprocessedEntity: Entity;\n errors: Error[];\n }) => Promise<void> | void,\n ): void;\n}\n\n/** @alpha */\nexport interface CatalogModelExtensionPoint {\n /**\n * Sets the validator function to use for one or more special fields of an\n * entity. This is useful if the default rules for formatting of fields are\n * not sufficient.\n *\n * @param validators - The (subset of) validators to set\n */\n setFieldValidators(validators: Partial<Validators>): void;\n\n /**\n * Sets the entity data parser which is used to read raw data from locations\n * @param parser - Parser which will used to extract entities from raw data\n */\n setEntityDataParser(parser: CatalogProcessorParser): void;\n}\n\n/**\n * @public\n */\nexport const catalogProcessingExtensionPoint =\n createExtensionPoint<CatalogProcessingExtensionPoint>({\n id: 'catalog.processing',\n });\n\n/**\n * @public\n */\nexport interface CatalogAnalysisExtensionPoint {\n /**\n * Replaces the entire location analyzer with a new one.\n *\n * @remarks\n *\n * By providing a factory function you can access all the SCM analyzers that\n * have been added through `addScmLocationAnalyzer`. If you provide a\n * `LocationAnalyzer` directly, the SCM analyzers will be ignored.\n */\n setLocationAnalyzer(\n analyzerOrFactory:\n | LocationAnalyzer\n | ((options: {\n scmLocationAnalyzers: ScmLocationAnalyzer[];\n }) => Promise<{ locationAnalyzer: LocationAnalyzer }>),\n ): void;\n\n /**\n * Adds an analyzer for a specific SCM type to the default location analyzer.\n */\n addScmLocationAnalyzer(analyzer: ScmLocationAnalyzer): void;\n}\n\n/**\n * @public\n */\nexport const catalogAnalysisExtensionPoint =\n createExtensionPoint<CatalogAnalysisExtensionPoint>({\n id: 'catalog.analysis',\n });\n\n/** @alpha */\nexport const catalogModelExtensionPoint =\n createExtensionPoint<CatalogModelExtensionPoint>({\n id: 'catalog.model',\n });\n"],"names":["createExtensionPoint"],"mappings":";;;;AAyCO,MAAM,iCACXA,qCAAA,CAAqD;AAAA,EACnD,EAAA,EAAI;AACN,CAAC;AAsEI,MAAM,kCACXA,qCAAA,CAAsD;AAAA,EACpD,EAAA,EAAI;AACN,CAAC;AAgCI,MAAM,gCACXA,qCAAA,CAAoD;AAAA,EAClD,EAAA,EAAI;AACN,CAAC;AAGI,MAAM,6BACXA,qCAAA,CAAiD;AAAA,EAC/C,EAAA,EAAI;AACN,CAAC;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -4,10 +4,8 @@ import { LocationSpec as LocationSpec$1, AnalyzeLocationRequest, AnalyzeLocation
4
4
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
5
5
  import { BackstageCredentials } from '@backstage/backend-plugin-api';
6
6
  import { GetEntitiesRequest, GetEntitiesResponse, GetEntitiesByRefsRequest, GetEntitiesByRefsResponse, QueryEntitiesRequest, QueryEntitiesResponse, GetEntityAncestorsRequest, GetEntityAncestorsResponse, GetEntityFacetsRequest, GetEntityFacetsResponse, GetLocationsResponse, QueryLocationsRequest, QueryLocationsResponse, QueryLocationsInitialRequest, Location, AddLocationRequest, AddLocationResponse, ValidateEntityResponse, StreamEntitiesRequest } from '@backstage/catalog-client';
7
- export { b as CatalogAnalysisExtensionPoint, C as CatalogLocationsExtensionPoint, a as CatalogProcessingExtensionPoint, e as catalogAnalysisExtensionPoint, c as catalogLocationsExtensionPoint, d as catalogProcessingExtensionPoint } from './types/extensions.d-Cvnx6_V0.js';
7
+ export { C as CatalogAnalysisExtensionPoint, a as CatalogLocationsExtensionPoint, b as CatalogProcessingExtensionPoint, c as catalogAnalysisExtensionPoint, d as catalogLocationsExtensionPoint, e as catalogProcessingExtensionPoint } from './types/extensions.d-ojRdpmUf.js';
8
8
  import '@backstage/plugin-catalog-node';
9
- import '@backstage/plugin-permission-common';
10
- import '@backstage/plugin-permission-node';
11
9
 
12
10
  /**
13
11
  * Holds the entity location information.
@@ -1,8 +1,6 @@
1
1
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
2
  import { Entity, Validators } from '@backstage/catalog-model';
3
- import { CatalogProcessor, EntityProvider, PlaceholderResolver, LocationAnalyzer, ScmLocationAnalyzer, CatalogProcessorParser, EntitiesSearchFilter } from '@backstage/plugin-catalog-node';
4
- import { PermissionRuleParams, Permission } from '@backstage/plugin-permission-common';
5
- import { PermissionRule } from '@backstage/plugin-permission-node';
3
+ import { LocationAnalyzer, ScmLocationAnalyzer, CatalogProcessor, EntityProvider, PlaceholderResolver, CatalogProcessorParser } from '@backstage/plugin-catalog-node';
6
4
 
7
5
  /**
8
6
  * @public
@@ -104,24 +102,6 @@ interface CatalogAnalysisExtensionPoint {
104
102
  declare const catalogAnalysisExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<CatalogAnalysisExtensionPoint>;
105
103
  /** @alpha */
106
104
  declare const catalogModelExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<CatalogModelExtensionPoint>;
107
- /**
108
- * @alpha
109
- * @deprecated Use the `coreServices.permissionsRegistry` instead.
110
- */
111
- type CatalogPermissionRuleInput<TParams extends PermissionRuleParams = PermissionRuleParams> = PermissionRule<Entity, EntitiesSearchFilter, 'catalog-entity', TParams>;
112
- /**
113
- * @alpha
114
- * @deprecated Use the `coreServices.permissionsRegistry` instead.
115
- */
116
- interface CatalogPermissionExtensionPoint {
117
- addPermissions(...permissions: Array<Permission | Array<Permission>>): void;
118
- addPermissionRules(...rules: Array<CatalogPermissionRuleInput | Array<CatalogPermissionRuleInput>>): void;
119
- }
120
- /**
121
- * @alpha
122
- * @deprecated Use the `coreServices.permissionsRegistry` instead.
123
- */
124
- declare const catalogPermissionExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<CatalogPermissionExtensionPoint>;
125
105
 
126
- export { catalogLocationsExtensionPoint as c, catalogProcessingExtensionPoint as d, catalogAnalysisExtensionPoint as e, catalogModelExtensionPoint as g, catalogPermissionExtensionPoint as j };
127
- export type { CatalogLocationsExtensionPoint as C, CatalogProcessingExtensionPoint as a, CatalogAnalysisExtensionPoint as b, CatalogModelExtensionPoint as f, CatalogPermissionRuleInput as h, CatalogPermissionExtensionPoint as i };
106
+ export { catalogAnalysisExtensionPoint as c, catalogLocationsExtensionPoint as d, catalogProcessingExtensionPoint as e, catalogModelExtensionPoint as g };
107
+ export type { CatalogAnalysisExtensionPoint as C, CatalogLocationsExtensionPoint as a, CatalogProcessingExtensionPoint as b, CatalogModelExtensionPoint as f };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-node",
3
- "version": "2.1.1-next.0",
3
+ "version": "2.2.0-next.2",
4
4
  "description": "The plugin-catalog-node module for @backstage/plugin-catalog-backend",
5
5
  "backstage": {
6
6
  "role": "node-library",
@@ -72,25 +72,25 @@
72
72
  "test": "backstage-cli package test"
73
73
  },
74
74
  "dependencies": {
75
- "@backstage/backend-plugin-api": "1.8.1-next.0",
76
- "@backstage/catalog-client": "1.14.0",
77
- "@backstage/catalog-model": "1.7.7",
78
- "@backstage/errors": "1.2.7",
79
- "@backstage/plugin-catalog-common": "1.1.8",
80
- "@backstage/plugin-permission-common": "0.9.7",
81
- "@backstage/plugin-permission-node": "0.10.12-next.0",
75
+ "@backstage/backend-plugin-api": "1.9.0-next.2",
76
+ "@backstage/catalog-client": "1.14.1-next.0",
77
+ "@backstage/catalog-model": "1.7.8-next.0",
78
+ "@backstage/errors": "1.3.0-next.0",
79
+ "@backstage/plugin-catalog-common": "1.1.9-next.0",
80
+ "@backstage/plugin-permission-common": "0.9.8-next.0",
81
+ "@backstage/plugin-permission-node": "0.10.12-next.2",
82
82
  "@backstage/types": "1.2.2",
83
83
  "@opentelemetry/api": "^1.9.0",
84
84
  "lodash": "^4.17.21",
85
85
  "yaml": "^2.0.0"
86
86
  },
87
87
  "devDependencies": {
88
- "@backstage/backend-test-utils": "1.11.2-next.0",
89
- "@backstage/cli": "0.36.1-next.0",
88
+ "@backstage/backend-test-utils": "1.11.2-next.2",
89
+ "@backstage/cli": "0.36.1-next.2",
90
90
  "msw": "^1.0.0"
91
91
  },
92
92
  "peerDependencies": {
93
- "@backstage/backend-test-utils": "1.11.2-next.0"
93
+ "@backstage/backend-test-utils": "1.11.2-next.2"
94
94
  },
95
95
  "peerDependenciesMeta": {
96
96
  "@backstage/backend-test-utils": {