@backstage/plugin-catalog-node 1.3.7 → 1.4.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,21 @@
1
1
  # @backstage/plugin-catalog-node
2
2
 
3
+ ## 1.4.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f06f0e46ba88: Support placeholder resolvers in the CatalogPlugin, also moves `PlaceholderResolver` and related types from `@backstage/plugin-catalog-backend` to `@backstage/plugin-catalog-node`.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @backstage/errors@1.2.1-next.0
13
+ - @backstage/backend-plugin-api@0.5.4-next.0
14
+ - @backstage/catalog-client@1.4.3-next.0
15
+ - @backstage/catalog-model@1.4.1-next.0
16
+ - @backstage/types@1.1.0
17
+ - @backstage/plugin-catalog-common@1.0.15-next.0
18
+
3
19
  ## 1.3.7
4
20
 
5
21
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-node",
3
- "version": "1.3.7",
3
+ "version": "1.4.0-next.0",
4
4
  "main": "../dist/alpha.cjs.js",
5
5
  "types": "../dist/alpha.d.ts"
6
6
  }
@@ -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} 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}\n\n/**\n * @alpha\n */\nexport const catalogProcessingExtensionPoint =\n createExtensionPoint<CatalogProcessingExtensionPoint>({\n id: 'catalog.processing',\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;;ACHM,MAAM,kCACXC,qCAAsD,CAAA;AAAA,EACpD,EAAI,EAAA,oBAAA;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 */\nimport { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport {\n EntityProvider,\n CatalogProcessor,\n PlaceholderResolver,\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"],"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;;ACDM,MAAM,kCACXC,qCAAsD,CAAA;AAAA,EACpD,EAAI,EAAA,oBAAA;AACN,CAAC;;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -1,6 +1,6 @@
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 } from '@backstage/plugin-catalog-node';
3
+ import { CatalogProcessor, EntityProvider, PlaceholderResolver } from '@backstage/plugin-catalog-node';
4
4
 
5
5
  /**
6
6
  * The catalogService provides the catalog API.
@@ -14,6 +14,7 @@ declare const catalogServiceRef: _backstage_backend_plugin_api.ServiceRef<Catalo
14
14
  interface CatalogProcessingExtensionPoint {
15
15
  addProcessor(...processors: Array<CatalogProcessor | Array<CatalogProcessor>>): void;
16
16
  addEntityProvider(...providers: Array<EntityProvider | Array<EntityProvider>>): void;
17
+ addPlaceholderResolver(key: string, resolver: PlaceholderResolver): void;
17
18
  }
18
19
  /**
19
20
  * @alpha
package/dist/index.d.ts CHANGED
@@ -188,6 +188,21 @@ type DeferredEntity = {
188
188
  entity: Entity;
189
189
  locationKey?: string;
190
190
  };
191
+ /** @public */
192
+ type PlaceholderResolverRead = (url: string) => Promise<Buffer>;
193
+ /** @public */
194
+ type PlaceholderResolverResolveUrl = (url: string, base: string) => string;
195
+ /** @public */
196
+ type PlaceholderResolverParams = {
197
+ key: string;
198
+ value: JsonValue;
199
+ baseUrl: string;
200
+ read: PlaceholderResolverRead;
201
+ resolveUrl: PlaceholderResolverResolveUrl;
202
+ emit: CatalogProcessorEmit;
203
+ };
204
+ /** @public */
205
+ type PlaceholderResolver = (params: PlaceholderResolverParams) => Promise<JsonValue>;
191
206
 
192
207
  /**
193
208
  * A 'full' mutation replaces all existing entities created by this entity provider with new ones.
@@ -267,4 +282,4 @@ declare function locationSpecToLocationEntity(opts: {
267
282
  parentEntity?: Entity;
268
283
  }): LocationEntityV1alpha1;
269
284
 
270
- export { CatalogProcessor, CatalogProcessorCache, CatalogProcessorEmit, CatalogProcessorEntityResult, CatalogProcessorErrorResult, CatalogProcessorLocationResult, CatalogProcessorParser, CatalogProcessorRefreshKeysResult, CatalogProcessorRelationResult, CatalogProcessorResult, DeferredEntity, EntityProvider, EntityProviderConnection, EntityProviderMutation, EntityProviderRefreshOptions, EntityRelationSpec, LocationSpec, locationSpecToLocationEntity, locationSpecToMetadataName, processingResult };
285
+ export { CatalogProcessor, CatalogProcessorCache, CatalogProcessorEmit, CatalogProcessorEntityResult, CatalogProcessorErrorResult, CatalogProcessorLocationResult, CatalogProcessorParser, CatalogProcessorRefreshKeysResult, CatalogProcessorRelationResult, CatalogProcessorResult, DeferredEntity, EntityProvider, EntityProviderConnection, EntityProviderMutation, EntityProviderRefreshOptions, EntityRelationSpec, LocationSpec, PlaceholderResolver, PlaceholderResolverParams, PlaceholderResolverRead, PlaceholderResolverResolveUrl, 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.3.7",
4
+ "version": "1.4.0-next.0",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -34,17 +34,17 @@
34
34
  "postpack": "backstage-cli package postpack"
35
35
  },
36
36
  "dependencies": {
37
- "@backstage/backend-plugin-api": "^0.5.3",
38
- "@backstage/catalog-client": "^1.4.2",
39
- "@backstage/catalog-model": "^1.4.0",
40
- "@backstage/errors": "^1.2.0",
41
- "@backstage/plugin-catalog-common": "^1.0.14",
37
+ "@backstage/backend-plugin-api": "^0.5.4-next.0",
38
+ "@backstage/catalog-client": "^1.4.3-next.0",
39
+ "@backstage/catalog-model": "^1.4.1-next.0",
40
+ "@backstage/errors": "^1.2.1-next.0",
41
+ "@backstage/plugin-catalog-common": "^1.0.15-next.0",
42
42
  "@backstage/types": "^1.1.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@backstage/backend-common": "^0.19.0",
46
- "@backstage/backend-test-utils": "^0.1.38",
47
- "@backstage/cli": "^0.22.8"
45
+ "@backstage/backend-common": "^0.19.1-next.0",
46
+ "@backstage/backend-test-utils": "^0.1.39-next.0",
47
+ "@backstage/cli": "^0.22.9-next.0"
48
48
  },
49
49
  "files": [
50
50
  "dist",