@backstage/plugin-catalog-node 1.0.2-next.0 → 1.0.2-next.1
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 +9 -0
- package/alpha/package.json +1 -1
- package/dist/index.alpha.d.ts +8 -0
- package/dist/index.beta.d.ts +4 -0
- package/dist/index.cjs.js +19 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-node
|
|
2
2
|
|
|
3
|
+
## 1.0.2-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7d7d947352: Adds experimental `catalogServiceRef` for obtaining a `CatalogClient` in the new backend system.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/backend-plugin-api@0.1.2-next.1
|
|
10
|
+
- @backstage/catalog-client@1.0.5-next.1
|
|
11
|
+
|
|
3
12
|
## 1.0.2-next.0
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/index.alpha.d.ts
CHANGED
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
/// <reference types="node" />
|
|
8
8
|
|
|
9
|
+
import { CatalogApi } from '@backstage/catalog-client';
|
|
9
10
|
import { CompoundEntityRef } from '@backstage/catalog-model';
|
|
10
11
|
import { Entity } from '@backstage/catalog-model';
|
|
11
12
|
import { ExtensionPoint } from '@backstage/backend-plugin-api';
|
|
12
13
|
import { JsonValue } from '@backstage/types';
|
|
14
|
+
import { ServiceRef } from '@backstage/backend-plugin-api';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* @alpha
|
|
@@ -162,6 +164,12 @@ export declare type CatalogProcessorRelationResult = {
|
|
|
162
164
|
/** @public */
|
|
163
165
|
export declare type CatalogProcessorResult = CatalogProcessorLocationResult | CatalogProcessorEntityResult | CatalogProcessorRelationResult | CatalogProcessorErrorResult | CatalogProcessorRefreshKeysResult;
|
|
164
166
|
|
|
167
|
+
/**
|
|
168
|
+
* The catalogService provides the catalog API.
|
|
169
|
+
* @alpha
|
|
170
|
+
*/
|
|
171
|
+
export declare const catalogServiceRef: ServiceRef<CatalogApi>;
|
|
172
|
+
|
|
165
173
|
/**
|
|
166
174
|
* Entities that are not yet processed.
|
|
167
175
|
* @public
|
package/dist/index.beta.d.ts
CHANGED
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
/// <reference types="node" />
|
|
8
8
|
|
|
9
|
+
import { CatalogApi } from '@backstage/catalog-client';
|
|
9
10
|
import { CompoundEntityRef } from '@backstage/catalog-model';
|
|
10
11
|
import { Entity } from '@backstage/catalog-model';
|
|
11
12
|
import { ExtensionPoint } from '@backstage/backend-plugin-api';
|
|
12
13
|
import { JsonValue } from '@backstage/types';
|
|
14
|
+
import { ServiceRef } from '@backstage/backend-plugin-api';
|
|
13
15
|
|
|
14
16
|
/* Excluded from this release type: CatalogProcessingExtensionPoint */
|
|
15
17
|
|
|
@@ -153,6 +155,8 @@ export declare type CatalogProcessorRelationResult = {
|
|
|
153
155
|
/** @public */
|
|
154
156
|
export declare type CatalogProcessorResult = CatalogProcessorLocationResult | CatalogProcessorEntityResult | CatalogProcessorRelationResult | CatalogProcessorErrorResult | CatalogProcessorRefreshKeysResult;
|
|
155
157
|
|
|
158
|
+
/* Excluded from this release type: catalogServiceRef */
|
|
159
|
+
|
|
156
160
|
/**
|
|
157
161
|
* Entities that are not yet processed.
|
|
158
162
|
* @public
|
package/dist/index.cjs.js
CHANGED
|
@@ -3,12 +3,30 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
6
|
+
var catalogClient = require('@backstage/catalog-client');
|
|
6
7
|
var errors = require('@backstage/errors');
|
|
7
8
|
|
|
8
9
|
const catalogProcessingExtensionPoint = backendPluginApi.createExtensionPoint({
|
|
9
10
|
id: "catalog.processing"
|
|
10
11
|
});
|
|
11
12
|
|
|
13
|
+
const catalogServiceRef = backendPluginApi.createServiceRef({
|
|
14
|
+
id: "catalog-client",
|
|
15
|
+
defaultFactory: async (service) => backendPluginApi.createServiceFactory({
|
|
16
|
+
service,
|
|
17
|
+
deps: {
|
|
18
|
+
discoveryFactory: backendPluginApi.discoveryServiceRef
|
|
19
|
+
},
|
|
20
|
+
factory: async ({ discoveryFactory }) => {
|
|
21
|
+
const discoveryApi = await discoveryFactory("root");
|
|
22
|
+
const catalogClient$1 = new catalogClient.CatalogClient({ discoveryApi });
|
|
23
|
+
return async (_pluginId) => {
|
|
24
|
+
return catalogClient$1;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
|
|
12
30
|
const processingResult = Object.freeze({
|
|
13
31
|
notFoundError(atLocation, message) {
|
|
14
32
|
return {
|
|
@@ -42,5 +60,6 @@ const processingResult = Object.freeze({
|
|
|
42
60
|
});
|
|
43
61
|
|
|
44
62
|
exports.catalogProcessingExtensionPoint = catalogProcessingExtensionPoint;
|
|
63
|
+
exports.catalogServiceRef = catalogServiceRef;
|
|
45
64
|
exports.processingResult = processingResult;
|
|
46
65
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/extensions.ts","../src/api/processingResult.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 */\nimport { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { EntityProvider } from './api';\nimport { CatalogProcessor } from './api/processor';\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","/*\n * Copyright 2020 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 { InputError, NotFoundError } from '@backstage/errors';\nimport { Entity } from '@backstage/catalog-model';\nimport { CatalogProcessorResult } from './processor';\nimport { EntityRelationSpec, LocationSpec } from './common';\n\n/**\n * Factory functions for the standard processing result types.\n *\n * @public\n */\nexport const processingResult = Object.freeze({\n notFoundError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return {\n type: 'error',\n location: atLocation,\n error: new NotFoundError(message),\n };\n },\n\n inputError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return {\n type: 'error',\n location: atLocation,\n error: new InputError(message),\n };\n },\n\n generalError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return { type: 'error', location: atLocation, error: new Error(message) };\n },\n\n location(newLocation: LocationSpec): CatalogProcessorResult {\n return { type: 'location', location: newLocation };\n },\n\n entity(atLocation: LocationSpec, newEntity: Entity): CatalogProcessorResult {\n return { type: 'entity', location: atLocation, entity: newEntity };\n },\n\n relation(spec: EntityRelationSpec): CatalogProcessorResult {\n return { type: 'relation', relation: spec };\n },\n\n refresh(key: string): CatalogProcessorResult {\n return { type: 'refresh', key };\n },\n} as const);\n"],"names":["createExtensionPoint","NotFoundError","InputError"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/extensions.ts","../src/catalogService.ts","../src/api/processingResult.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 */\nimport { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { EntityProvider } from './api';\nimport { CatalogProcessor } from './api/processor';\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","/*\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 discoveryServiceRef,\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 discoveryFactory: discoveryServiceRef,\n },\n factory: async ({ discoveryFactory }) => {\n const discoveryApi = await discoveryFactory('root');\n const catalogClient = new CatalogClient({ discoveryApi });\n return async _pluginId => {\n return catalogClient;\n };\n },\n }),\n});\n","/*\n * Copyright 2020 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 { InputError, NotFoundError } from '@backstage/errors';\nimport { Entity } from '@backstage/catalog-model';\nimport { CatalogProcessorResult } from './processor';\nimport { EntityRelationSpec, LocationSpec } from './common';\n\n/**\n * Factory functions for the standard processing result types.\n *\n * @public\n */\nexport const processingResult = Object.freeze({\n notFoundError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return {\n type: 'error',\n location: atLocation,\n error: new NotFoundError(message),\n };\n },\n\n inputError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return {\n type: 'error',\n location: atLocation,\n error: new InputError(message),\n };\n },\n\n generalError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return { type: 'error', location: atLocation, error: new Error(message) };\n },\n\n location(newLocation: LocationSpec): CatalogProcessorResult {\n return { type: 'location', location: newLocation };\n },\n\n entity(atLocation: LocationSpec, newEntity: Entity): CatalogProcessorResult {\n return { type: 'entity', location: atLocation, entity: newEntity };\n },\n\n relation(spec: EntityRelationSpec): CatalogProcessorResult {\n return { type: 'relation', relation: spec };\n },\n\n refresh(key: string): CatalogProcessorResult {\n return { type: 'refresh', key };\n },\n} as const);\n"],"names":["createExtensionPoint","createServiceRef","createServiceFactory","discoveryServiceRef","catalogClient","CatalogClient","NotFoundError","InputError"],"mappings":";;;;;;;;AAkCO,MAAM,kCACXA,qCAAsD,CAAA;AAAA,EACpD,EAAI,EAAA,oBAAA;AACN,CAAC;;ACVI,MAAM,oBAAoBC,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,gBAAkB,EAAAC,oCAAA;AAAA,KACpB;AAAA,IACA,OAAS,EAAA,OAAO,EAAE,gBAAA,EAAuB,KAAA;AACvC,MAAM,MAAA,YAAA,GAAe,MAAM,gBAAA,CAAiB,MAAM,CAAA,CAAA;AAClD,MAAA,MAAMC,eAAgB,GAAA,IAAIC,2BAAc,CAAA,EAAE,cAAc,CAAA,CAAA;AACxD,MAAA,OAAO,OAAM,SAAa,KAAA;AACxB,QAAO,OAAAD,eAAA,CAAA;AAAA,OACT,CAAA;AAAA,KACF;AAAA,GACD,CAAA;AACL,CAAC;;ACjBY,MAAA,gBAAA,GAAmB,OAAO,MAAO,CAAA;AAAA,EAC5C,aAAA,CACE,YACA,OACwB,EAAA;AACxB,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,OAAA;AAAA,MACN,QAAU,EAAA,UAAA;AAAA,MACV,KAAA,EAAO,IAAIE,oBAAA,CAAc,OAAO,CAAA;AAAA,KAClC,CAAA;AAAA,GACF;AAAA,EAEA,UAAA,CACE,YACA,OACwB,EAAA;AACxB,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,OAAA;AAAA,MACN,QAAU,EAAA,UAAA;AAAA,MACV,KAAA,EAAO,IAAIC,iBAAA,CAAW,OAAO,CAAA;AAAA,KAC/B,CAAA;AAAA,GACF;AAAA,EAEA,YAAA,CACE,YACA,OACwB,EAAA;AACxB,IAAO,OAAA,EAAE,MAAM,OAAS,EAAA,QAAA,EAAU,YAAY,KAAO,EAAA,IAAI,KAAM,CAAA,OAAO,CAAE,EAAA,CAAA;AAAA,GAC1E;AAAA,EAEA,SAAS,WAAmD,EAAA;AAC1D,IAAA,OAAO,EAAE,IAAA,EAAM,UAAY,EAAA,QAAA,EAAU,WAAY,EAAA,CAAA;AAAA,GACnD;AAAA,EAEA,MAAA,CAAO,YAA0B,SAA2C,EAAA;AAC1E,IAAA,OAAO,EAAE,IAAM,EAAA,QAAA,EAAU,QAAU,EAAA,UAAA,EAAY,QAAQ,SAAU,EAAA,CAAA;AAAA,GACnE;AAAA,EAEA,SAAS,IAAkD,EAAA;AACzD,IAAA,OAAO,EAAE,IAAA,EAAM,UAAY,EAAA,QAAA,EAAU,IAAK,EAAA,CAAA;AAAA,GAC5C;AAAA,EAEA,QAAQ,GAAqC,EAAA;AAC3C,IAAO,OAAA,EAAE,IAAM,EAAA,SAAA,EAAW,GAAI,EAAA,CAAA;AAAA,GAChC;AACF,CAAU;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
/// <reference types="node" />
|
|
8
8
|
|
|
9
|
+
import { CatalogApi } from '@backstage/catalog-client';
|
|
9
10
|
import { CompoundEntityRef } from '@backstage/catalog-model';
|
|
10
11
|
import { Entity } from '@backstage/catalog-model';
|
|
11
12
|
import { ExtensionPoint } from '@backstage/backend-plugin-api';
|
|
12
13
|
import { JsonValue } from '@backstage/types';
|
|
14
|
+
import { ServiceRef } from '@backstage/backend-plugin-api';
|
|
13
15
|
|
|
14
16
|
/* Excluded from this release type: CatalogProcessingExtensionPoint */
|
|
15
17
|
|
|
@@ -153,6 +155,8 @@ export declare type CatalogProcessorRelationResult = {
|
|
|
153
155
|
/** @public */
|
|
154
156
|
export declare type CatalogProcessorResult = CatalogProcessorLocationResult | CatalogProcessorEntityResult | CatalogProcessorRelationResult | CatalogProcessorErrorResult | CatalogProcessorRefreshKeysResult;
|
|
155
157
|
|
|
158
|
+
/* Excluded from this release type: catalogServiceRef */
|
|
159
|
+
|
|
156
160
|
/**
|
|
157
161
|
* Entities that are not yet processed.
|
|
158
162
|
* @public
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
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.0.2-next.
|
|
4
|
+
"version": "1.0.2-next.1",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
|
-
"private": false,
|
|
9
8
|
"publishConfig": {
|
|
10
9
|
"access": "public",
|
|
11
10
|
"main": "dist/index.cjs.js",
|
|
@@ -25,18 +24,20 @@
|
|
|
25
24
|
"postpack": "backstage-cli package postpack"
|
|
26
25
|
},
|
|
27
26
|
"dependencies": {
|
|
28
|
-
"@backstage/backend-plugin-api": "^0.1.2-next.
|
|
27
|
+
"@backstage/backend-plugin-api": "^0.1.2-next.1",
|
|
28
|
+
"@backstage/catalog-client": "^1.0.5-next.1",
|
|
29
29
|
"@backstage/catalog-model": "^1.1.0",
|
|
30
30
|
"@backstage/errors": "1.1.0",
|
|
31
31
|
"@backstage/types": "^1.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@backstage/backend-common": "^0.15.1-next.
|
|
35
|
-
"@backstage/
|
|
34
|
+
"@backstage/backend-common": "^0.15.1-next.2",
|
|
35
|
+
"@backstage/backend-test-utils": "^0.1.28-next.2",
|
|
36
|
+
"@backstage/cli": "^0.19.0-next.2"
|
|
36
37
|
},
|
|
37
38
|
"files": [
|
|
38
39
|
"dist",
|
|
39
40
|
"alpha"
|
|
40
41
|
],
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "24f889f173370f060725fcf9404081e40769beb4"
|
|
42
43
|
}
|