@backstage/plugin-catalog-node 1.5.1-next.0 → 1.6.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,36 @@
1
1
  # @backstage/plugin-catalog-node
2
2
 
3
+ ## 1.6.0-next.2
4
+
5
+ ### Minor Changes
6
+
7
+ - a168507: Added `EntitiesSearchFilter` and `EntityFilter` from `@backstage/plugin-catalog-backend`, for reuse
8
+ - 7804597: Permission rules can now be added for the Catalog plugin through the `CatalogPermissionExtensionPoint` interface.
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+ - @backstage/catalog-client@1.5.0-next.1
14
+ - @backstage/backend-plugin-api@0.6.8-next.2
15
+ - @backstage/catalog-model@1.4.3
16
+ - @backstage/errors@1.2.3
17
+ - @backstage/types@1.1.1
18
+ - @backstage/plugin-catalog-common@1.0.18
19
+ - @backstage/plugin-permission-common@0.7.10
20
+ - @backstage/plugin-permission-node@0.7.19-next.2
21
+
22
+ ## 1.5.1-next.1
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+ - @backstage/catalog-client@1.5.0-next.0
28
+ - @backstage/backend-plugin-api@0.6.8-next.1
29
+ - @backstage/catalog-model@1.4.3
30
+ - @backstage/errors@1.2.3
31
+ - @backstage/types@1.1.1
32
+ - @backstage/plugin-catalog-common@1.0.18
33
+
3
34
  ## 1.5.1-next.0
4
35
 
5
36
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-node",
3
- "version": "1.5.1-next.0",
3
+ "version": "1.6.0-next.2",
4
4
  "main": "../dist/alpha.cjs.js",
5
5
  "types": "../dist/alpha.d.ts"
6
6
  }
package/dist/alpha.cjs.js CHANGED
@@ -24,8 +24,12 @@ const catalogProcessingExtensionPoint = backendPluginApi.createExtensionPoint({
24
24
  const catalogAnalysisExtensionPoint = backendPluginApi.createExtensionPoint({
25
25
  id: "catalog.analysis"
26
26
  });
27
+ const catalogPermissionExtensionPoint = backendPluginApi.createExtensionPoint({
28
+ id: "catalog.permission"
29
+ });
27
30
 
28
31
  exports.catalogAnalysisExtensionPoint = catalogAnalysisExtensionPoint;
32
+ exports.catalogPermissionExtensionPoint = catalogPermissionExtensionPoint;
29
33
  exports.catalogProcessingExtensionPoint = catalogProcessingExtensionPoint;
30
34
  exports.catalogServiceRef = catalogServiceRef;
31
35
  //# sourceMappingURL=alpha.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.cjs.js","sources":["../src/catalogService.ts","../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 {\n createServiceFactory,\n createServiceRef,\n coreServices,\n} from '@backstage/backend-plugin-api';\nimport { CatalogApi, CatalogClient } from '@backstage/catalog-client';\n\n/**\n * The catalogService provides the catalog API.\n * @alpha\n */\nexport const catalogServiceRef = createServiceRef<CatalogApi>({\n id: 'catalog-client',\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","/*\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 */\nimport { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport {\n EntityProvider,\n CatalogProcessor,\n PlaceholderResolver,\n ScmLocationAnalyzer,\n} from '@backstage/plugin-catalog-node';\n\n/**\n * @alpha\n */\nexport interface CatalogProcessingExtensionPoint {\n addProcessor(\n ...processors: Array<CatalogProcessor | Array<CatalogProcessor>>\n ): void;\n addEntityProvider(\n ...providers: Array<EntityProvider | Array<EntityProvider>>\n ): void;\n addPlaceholderResolver(key: string, resolver: PlaceholderResolver): void;\n}\n\n/**\n * @alpha\n */\nexport const catalogProcessingExtensionPoint =\n createExtensionPoint<CatalogProcessingExtensionPoint>({\n id: 'catalog.processing',\n });\n\n/**\n * @alpha\n */\nexport interface CatalogAnalysisExtensionPoint {\n addLocationAnalyzer(analyzer: ScmLocationAnalyzer): void;\n}\n\n/**\n * @alpha\n */\nexport const catalogAnalysisExtensionPoint =\n createExtensionPoint<CatalogAnalysisExtensionPoint>({\n id: 'catalog.analysis',\n });\n"],"names":["createServiceRef","createServiceFactory","coreServices","CatalogClient","createExtensionPoint"],"mappings":";;;;;;;AA2BO,MAAM,oBAAoBA,iCAA6B,CAAA;AAAA,EAC5D,EAAI,EAAA,gBAAA;AAAA,EACJ,cAAA,EAAgB,OAAM,OAAA,KACpBC,qCAAqB,CAAA;AAAA,IACnB,OAAA;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,cAAcC,6BAAa,CAAA,SAAA;AAAA,KAC7B;AAAA,IACA,MAAM,OAAA,CAAQ,EAAE,YAAA,EAAgB,EAAA;AAC9B,MAAA,OAAO,IAAIC,2BAAA,CAAc,EAAE,YAAA,EAAc,CAAA,CAAA;AAAA,KAC3C;AAAA,GACD,CAAA;AACL,CAAC;;ACAM,MAAM,kCACXC,qCAAsD,CAAA;AAAA,EACpD,EAAI,EAAA,oBAAA;AACN,CAAC,EAAA;AAYI,MAAM,gCACXA,qCAAoD,CAAA;AAAA,EAClD,EAAI,EAAA,kBAAA;AACN,CAAC;;;;;;"}
1
+ {"version":3,"file":"alpha.cjs.js","sources":["../src/catalogService.ts","../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 {\n createServiceFactory,\n createServiceRef,\n coreServices,\n} from '@backstage/backend-plugin-api';\nimport { CatalogApi, CatalogClient } from '@backstage/catalog-client';\n\n/**\n * The catalogService provides the catalog API.\n * @alpha\n */\nexport const catalogServiceRef = createServiceRef<CatalogApi>({\n id: 'catalog-client',\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","/*\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 } from '@backstage/catalog-model';\nimport {\n CatalogProcessor,\n EntitiesSearchFilter,\n EntityProvider,\n PlaceholderResolver,\n ScmLocationAnalyzer,\n} from '@backstage/plugin-catalog-node';\nimport { PermissionRuleParams } from '@backstage/plugin-permission-common';\nimport { PermissionRule } from '@backstage/plugin-permission-node';\n\n/**\n * @alpha\n */\nexport interface CatalogProcessingExtensionPoint {\n addProcessor(\n ...processors: Array<CatalogProcessor | Array<CatalogProcessor>>\n ): void;\n addEntityProvider(\n ...providers: Array<EntityProvider | Array<EntityProvider>>\n ): void;\n addPlaceholderResolver(key: string, resolver: PlaceholderResolver): void;\n}\n\n/**\n * @alpha\n */\nexport const catalogProcessingExtensionPoint =\n createExtensionPoint<CatalogProcessingExtensionPoint>({\n id: 'catalog.processing',\n });\n\n/**\n * @alpha\n */\nexport interface CatalogAnalysisExtensionPoint {\n addLocationAnalyzer(analyzer: ScmLocationAnalyzer): void;\n}\n\n/**\n * @alpha\n */\nexport const catalogAnalysisExtensionPoint =\n createExtensionPoint<CatalogAnalysisExtensionPoint>({\n id: 'catalog.analysis',\n });\n\n/**\n * @alpha\n */\nexport type CatalogPermissionRuleInput<\n TParams extends PermissionRuleParams = PermissionRuleParams,\n> = PermissionRule<Entity, EntitiesSearchFilter, 'catalog-entity', TParams>;\n\n/**\n * @alpha\n */\nexport interface CatalogPermissionExtensionPoint {\n addPermissionRules(\n ...rules: Array<\n CatalogPermissionRuleInput | Array<CatalogPermissionRuleInput>\n >\n ): void;\n}\n\n/**\n * @alpha\n */\nexport const catalogPermissionExtensionPoint =\n createExtensionPoint<CatalogPermissionExtensionPoint>({\n id: 'catalog.permission',\n });\n"],"names":["createServiceRef","createServiceFactory","coreServices","CatalogClient","createExtensionPoint"],"mappings":";;;;;;;AA2BO,MAAM,oBAAoBA,iCAA6B,CAAA;AAAA,EAC5D,EAAI,EAAA,gBAAA;AAAA,EACJ,cAAA,EAAgB,OAAM,OAAA,KACpBC,qCAAqB,CAAA;AAAA,IACnB,OAAA;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,cAAcC,6BAAa,CAAA,SAAA;AAAA,KAC7B;AAAA,IACA,MAAM,OAAA,CAAQ,EAAE,YAAA,EAAgB,EAAA;AAC9B,MAAA,OAAO,IAAIC,2BAAA,CAAc,EAAE,YAAA,EAAc,CAAA,CAAA;AAAA,KAC3C;AAAA,GACD,CAAA;AACL,CAAC;;ACKM,MAAM,kCACXC,qCAAsD,CAAA;AAAA,EACpD,EAAI,EAAA,oBAAA;AACN,CAAC,EAAA;AAYI,MAAM,gCACXA,qCAAoD,CAAA;AAAA,EAClD,EAAI,EAAA,kBAAA;AACN,CAAC,EAAA;AAuBI,MAAM,kCACXA,qCAAsD,CAAA;AAAA,EACpD,EAAI,EAAA,oBAAA;AACN,CAAC;;;;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
2
  import { CatalogApi } from '@backstage/catalog-client';
3
- import { CatalogProcessor, EntityProvider, PlaceholderResolver, ScmLocationAnalyzer } from '@backstage/plugin-catalog-node';
3
+ import { Entity } from '@backstage/catalog-model';
4
+ import { CatalogProcessor, EntityProvider, PlaceholderResolver, ScmLocationAnalyzer, EntitiesSearchFilter } from '@backstage/plugin-catalog-node';
5
+ import { PermissionRuleParams } from '@backstage/plugin-permission-common';
6
+ import { PermissionRule } from '@backstage/plugin-permission-node';
4
7
 
5
8
  /**
6
9
  * The catalogService provides the catalog API.
@@ -30,5 +33,19 @@ interface CatalogAnalysisExtensionPoint {
30
33
  * @alpha
31
34
  */
32
35
  declare const catalogAnalysisExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<CatalogAnalysisExtensionPoint>;
36
+ /**
37
+ * @alpha
38
+ */
39
+ type CatalogPermissionRuleInput<TParams extends PermissionRuleParams = PermissionRuleParams> = PermissionRule<Entity, EntitiesSearchFilter, 'catalog-entity', TParams>;
40
+ /**
41
+ * @alpha
42
+ */
43
+ interface CatalogPermissionExtensionPoint {
44
+ addPermissionRules(...rules: Array<CatalogPermissionRuleInput | Array<CatalogPermissionRuleInput>>): void;
45
+ }
46
+ /**
47
+ * @alpha
48
+ */
49
+ declare const catalogPermissionExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<CatalogPermissionExtensionPoint>;
33
50
 
34
- export { CatalogAnalysisExtensionPoint, CatalogProcessingExtensionPoint, catalogAnalysisExtensionPoint, catalogProcessingExtensionPoint, catalogServiceRef };
51
+ export { CatalogAnalysisExtensionPoint, CatalogPermissionExtensionPoint, CatalogPermissionRuleInput, CatalogProcessingExtensionPoint, catalogAnalysisExtensionPoint, catalogPermissionExtensionPoint, catalogProcessingExtensionPoint, catalogServiceRef };
package/dist/index.d.ts CHANGED
@@ -35,6 +35,38 @@ type EntityRelationSpec = {
35
35
  */
36
36
  target: CompoundEntityRef;
37
37
  };
38
+ /**
39
+ * A filter expression for entities.
40
+ *
41
+ * @public
42
+ */
43
+ type EntityFilter = {
44
+ allOf: EntityFilter[];
45
+ } | {
46
+ anyOf: EntityFilter[];
47
+ } | {
48
+ not: EntityFilter;
49
+ } | EntitiesSearchFilter;
50
+ /**
51
+ * Matches rows in the search table.
52
+ *
53
+ * @public
54
+ */
55
+ type EntitiesSearchFilter = {
56
+ /**
57
+ * The key to match on.
58
+ *
59
+ * Matches are always case insensitive.
60
+ */
61
+ key: string;
62
+ /**
63
+ * Match on plain equality of values.
64
+ *
65
+ * Match on values that are equal to any of the given array items. Matches are
66
+ * always case insensitive.
67
+ */
68
+ values?: string[];
69
+ };
38
70
 
39
71
  /**
40
72
  * @public
@@ -324,4 +356,4 @@ declare function locationSpecToLocationEntity(opts: {
324
356
  parentEntity?: Entity;
325
357
  }): LocationEntityV1alpha1;
326
358
 
327
- export { AnalyzeOptions, CatalogProcessor, CatalogProcessorCache, CatalogProcessorEmit, CatalogProcessorEntityResult, CatalogProcessorErrorResult, CatalogProcessorLocationResult, CatalogProcessorParser, CatalogProcessorRefreshKeysResult, CatalogProcessorRelationResult, CatalogProcessorResult, DeferredEntity, EntityProvider, EntityProviderConnection, EntityProviderMutation, EntityProviderRefreshOptions, EntityRelationSpec, LocationSpec, PlaceholderResolver, PlaceholderResolverParams, PlaceholderResolverRead, PlaceholderResolverResolveUrl, ScmLocationAnalyzer, locationSpecToLocationEntity, locationSpecToMetadataName, processingResult };
359
+ export { AnalyzeOptions, CatalogProcessor, CatalogProcessorCache, CatalogProcessorEmit, CatalogProcessorEntityResult, CatalogProcessorErrorResult, CatalogProcessorLocationResult, CatalogProcessorParser, CatalogProcessorRefreshKeysResult, CatalogProcessorRelationResult, CatalogProcessorResult, DeferredEntity, EntitiesSearchFilter, EntityFilter, EntityProvider, EntityProviderConnection, EntityProviderMutation, EntityProviderRefreshOptions, EntityRelationSpec, LocationSpec, PlaceholderResolver, PlaceholderResolverParams, PlaceholderResolverRead, PlaceholderResolverResolveUrl, ScmLocationAnalyzer, locationSpecToLocationEntity, locationSpecToMetadataName, processingResult };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-node",
3
3
  "description": "The plugin-catalog-node module for @backstage/plugin-catalog-backend",
4
- "version": "1.5.1-next.0",
4
+ "version": "1.6.0-next.2",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -40,17 +40,19 @@
40
40
  "postpack": "backstage-cli package postpack"
41
41
  },
42
42
  "dependencies": {
43
- "@backstage/backend-plugin-api": "^0.6.8-next.0",
44
- "@backstage/catalog-client": "^1.4.6",
43
+ "@backstage/backend-plugin-api": "^0.6.8-next.2",
44
+ "@backstage/catalog-client": "^1.5.0-next.1",
45
45
  "@backstage/catalog-model": "^1.4.3",
46
46
  "@backstage/errors": "^1.2.3",
47
47
  "@backstage/plugin-catalog-common": "^1.0.18",
48
+ "@backstage/plugin-permission-common": "^0.7.10",
49
+ "@backstage/plugin-permission-node": "^0.7.19-next.2",
48
50
  "@backstage/types": "^1.1.1"
49
51
  },
50
52
  "devDependencies": {
51
- "@backstage/backend-common": "^0.20.0-next.0",
52
- "@backstage/backend-test-utils": "^0.2.9-next.0",
53
- "@backstage/cli": "^0.24.1-next.0"
53
+ "@backstage/backend-common": "^0.20.0-next.2",
54
+ "@backstage/backend-test-utils": "^0.2.9-next.2",
55
+ "@backstage/cli": "^0.25.0-next.2"
54
56
  },
55
57
  "files": [
56
58
  "dist",