@backstage/plugin-catalog-node 1.4.8-next.0 → 1.5.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 +23 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.cjs.js +4 -0
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/alpha.d.ts +12 -2
- package/dist/index.d.ts +17 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-node
|
|
2
2
|
|
|
3
|
+
## 1.5.0-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/backend-plugin-api@0.6.7-next.2
|
|
9
|
+
|
|
10
|
+
## 1.5.0-next.1
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- e5bf3749ad: Support adding location analyzers in new catalog analysis extension point and move `AnalyzeOptions` and `ScmLocationAnalyzer` types to `@backstage/plugin-catalog-node`
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @backstage/backend-plugin-api@0.6.7-next.1
|
|
20
|
+
- @backstage/catalog-client@1.4.5
|
|
21
|
+
- @backstage/catalog-model@1.4.3
|
|
22
|
+
- @backstage/errors@1.2.3
|
|
23
|
+
- @backstage/types@1.1.1
|
|
24
|
+
- @backstage/plugin-catalog-common@1.0.17
|
|
25
|
+
|
|
3
26
|
## 1.4.8-next.0
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/alpha.cjs.js
CHANGED
|
@@ -21,7 +21,11 @@ const catalogServiceRef = backendPluginApi.createServiceRef({
|
|
|
21
21
|
const catalogProcessingExtensionPoint = backendPluginApi.createExtensionPoint({
|
|
22
22
|
id: "catalog.processing"
|
|
23
23
|
});
|
|
24
|
+
const catalogAnalysisExtensionPoint = backendPluginApi.createExtensionPoint({
|
|
25
|
+
id: "catalog.analysis"
|
|
26
|
+
});
|
|
24
27
|
|
|
28
|
+
exports.catalogAnalysisExtensionPoint = catalogAnalysisExtensionPoint;
|
|
25
29
|
exports.catalogProcessingExtensionPoint = catalogProcessingExtensionPoint;
|
|
26
30
|
exports.catalogServiceRef = catalogServiceRef;
|
|
27
31
|
//# sourceMappingURL=alpha.cjs.js.map
|
package/dist/alpha.cjs.js.map
CHANGED
|
@@ -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} 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;;
|
|
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;;;;;;"}
|
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, PlaceholderResolver } from '@backstage/plugin-catalog-node';
|
|
3
|
+
import { CatalogProcessor, EntityProvider, PlaceholderResolver, ScmLocationAnalyzer } from '@backstage/plugin-catalog-node';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The catalogService provides the catalog API.
|
|
@@ -20,5 +20,15 @@ interface CatalogProcessingExtensionPoint {
|
|
|
20
20
|
* @alpha
|
|
21
21
|
*/
|
|
22
22
|
declare const catalogProcessingExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<CatalogProcessingExtensionPoint>;
|
|
23
|
+
/**
|
|
24
|
+
* @alpha
|
|
25
|
+
*/
|
|
26
|
+
interface CatalogAnalysisExtensionPoint {
|
|
27
|
+
addLocationAnalyzer(analyzer: ScmLocationAnalyzer): void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @alpha
|
|
31
|
+
*/
|
|
32
|
+
declare const catalogAnalysisExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<CatalogAnalysisExtensionPoint>;
|
|
23
33
|
|
|
24
|
-
export { CatalogProcessingExtensionPoint, catalogProcessingExtensionPoint, catalogServiceRef };
|
|
34
|
+
export { CatalogAnalysisExtensionPoint, CatalogProcessingExtensionPoint, catalogAnalysisExtensionPoint, catalogProcessingExtensionPoint, catalogServiceRef };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { CompoundEntityRef, Entity, LocationEntityV1alpha1 } from '@backstage/catalog-model';
|
|
3
3
|
import { JsonValue } from '@backstage/types';
|
|
4
|
-
import { LocationSpec as LocationSpec$1 } from '@backstage/plugin-catalog-common';
|
|
4
|
+
import { LocationSpec as LocationSpec$1, AnalyzeLocationExistingEntity } from '@backstage/plugin-catalog-common';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Holds the entity location information.
|
|
@@ -230,6 +230,21 @@ type PlaceholderResolverParams = {
|
|
|
230
230
|
};
|
|
231
231
|
/** @public */
|
|
232
232
|
type PlaceholderResolver = (params: PlaceholderResolverParams) => Promise<JsonValue>;
|
|
233
|
+
/** @public */
|
|
234
|
+
type AnalyzeOptions = {
|
|
235
|
+
url: string;
|
|
236
|
+
catalogFilename?: string;
|
|
237
|
+
};
|
|
238
|
+
/** @public */
|
|
239
|
+
type ScmLocationAnalyzer = {
|
|
240
|
+
/** The method that decides if this analyzer can work with the provided url */
|
|
241
|
+
supports(url: string): boolean;
|
|
242
|
+
/** This function can return an array of already existing entities */
|
|
243
|
+
analyze(options: AnalyzeOptions): Promise<{
|
|
244
|
+
/** Existing entities in the analyzed location */
|
|
245
|
+
existing: AnalyzeLocationExistingEntity[];
|
|
246
|
+
}>;
|
|
247
|
+
};
|
|
233
248
|
|
|
234
249
|
/**
|
|
235
250
|
* A 'full' mutation replaces all existing entities created by this entity provider with new ones.
|
|
@@ -309,4 +324,4 @@ declare function locationSpecToLocationEntity(opts: {
|
|
|
309
324
|
parentEntity?: Entity;
|
|
310
325
|
}): LocationEntityV1alpha1;
|
|
311
326
|
|
|
312
|
-
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 };
|
|
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 };
|
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.
|
|
4
|
+
"version": "1.5.0-next.2",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"postpack": "backstage-cli package postpack"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@backstage/backend-plugin-api": "^0.6.7-next.
|
|
43
|
+
"@backstage/backend-plugin-api": "^0.6.7-next.2",
|
|
44
44
|
"@backstage/catalog-client": "^1.4.5",
|
|
45
45
|
"@backstage/catalog-model": "^1.4.3",
|
|
46
46
|
"@backstage/errors": "^1.2.3",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@backstage/types": "^1.1.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@backstage/backend-common": "^0.19.9-next.
|
|
52
|
-
"@backstage/backend-test-utils": "^0.2.8-next.
|
|
53
|
-
"@backstage/cli": "^0.24.0-next.
|
|
51
|
+
"@backstage/backend-common": "^0.19.9-next.2",
|
|
52
|
+
"@backstage/backend-test-utils": "^0.2.8-next.2",
|
|
53
|
+
"@backstage/cli": "^0.24.0-next.1"
|
|
54
54
|
},
|
|
55
55
|
"files": [
|
|
56
56
|
"dist",
|