@backstage/plugin-catalog-backend 1.12.0-next.1 → 1.12.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 +51 -0
- package/alpha/package.json +1 -1
- package/dist/index.cjs.js +9 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-backend
|
|
2
2
|
|
|
3
|
+
## 1.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b8cccd8ee858: Support configuring applicable kinds for `AnnotateScmSlugEntityProcessor`
|
|
8
|
+
- f32252cdf631: Added OpenTelemetry spans for catalog processing
|
|
9
|
+
- ebeb77586975: Now performs request validation based on OpenAPI schema through `@backstage/backend-openapi-utils`. Error responses for invalid input, like `"a"` instead of a number, may have changed.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 629cbd194a87: Use `coreServices.rootConfig` instead of `coreService.config`
|
|
14
|
+
- b8d6b22acd57: Internal refactor for load test
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- @backstage/plugin-search-backend-module-catalog@0.1.4
|
|
17
|
+
- @backstage/backend-common@0.19.2
|
|
18
|
+
- @backstage/backend-plugin-api@0.6.0
|
|
19
|
+
- @backstage/backend-openapi-utils@0.0.3
|
|
20
|
+
- @backstage/plugin-catalog-node@1.4.1
|
|
21
|
+
- @backstage/plugin-events-node@0.2.9
|
|
22
|
+
- @backstage/plugin-auth-node@0.2.17
|
|
23
|
+
- @backstage/integration@1.6.0
|
|
24
|
+
- @backstage/backend-tasks@0.5.5
|
|
25
|
+
- @backstage/plugin-scaffolder-common@1.4.0
|
|
26
|
+
- @backstage/plugin-permission-node@0.7.11
|
|
27
|
+
- @backstage/catalog-client@1.4.3
|
|
28
|
+
- @backstage/catalog-model@1.4.1
|
|
29
|
+
- @backstage/config@1.0.8
|
|
30
|
+
- @backstage/errors@1.2.1
|
|
31
|
+
- @backstage/types@1.1.0
|
|
32
|
+
- @backstage/plugin-catalog-common@1.0.15
|
|
33
|
+
- @backstage/plugin-permission-common@0.7.7
|
|
34
|
+
- @backstage/plugin-search-common@1.2.5
|
|
35
|
+
|
|
36
|
+
## 1.12.0-next.2
|
|
37
|
+
|
|
38
|
+
### Minor Changes
|
|
39
|
+
|
|
40
|
+
- b8cccd8ee858: Support configuring applicable kinds for `AnnotateScmSlugEntityProcessor`
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- Updated dependencies
|
|
45
|
+
- @backstage/plugin-search-backend-module-catalog@0.1.4-next.2
|
|
46
|
+
- @backstage/backend-plugin-api@0.6.0-next.2
|
|
47
|
+
- @backstage/backend-tasks@0.5.5-next.2
|
|
48
|
+
- @backstage/backend-common@0.19.2-next.2
|
|
49
|
+
- @backstage/plugin-catalog-node@1.4.1-next.2
|
|
50
|
+
- @backstage/plugin-events-node@0.2.9-next.2
|
|
51
|
+
- @backstage/plugin-permission-node@0.7.11-next.2
|
|
52
|
+
- @backstage/plugin-auth-node@0.2.17-next.2
|
|
53
|
+
|
|
3
54
|
## 1.12.0-next.1
|
|
4
55
|
|
|
5
56
|
### Minor Changes
|
package/alpha/package.json
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -50,14 +50,18 @@ class AnnotateScmSlugEntityProcessor {
|
|
|
50
50
|
getProcessorName() {
|
|
51
51
|
return "AnnotateScmSlugEntityProcessor";
|
|
52
52
|
}
|
|
53
|
-
static fromConfig(config) {
|
|
53
|
+
static fromConfig(config, options) {
|
|
54
54
|
return new AnnotateScmSlugEntityProcessor({
|
|
55
|
-
scmIntegrationRegistry: integration.ScmIntegrations.fromConfig(config)
|
|
55
|
+
scmIntegrationRegistry: integration.ScmIntegrations.fromConfig(config),
|
|
56
|
+
kinds: options == null ? void 0 : options.kinds
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
59
|
async preProcessEntity(entity, location) {
|
|
59
|
-
var _a;
|
|
60
|
-
|
|
60
|
+
var _a, _b;
|
|
61
|
+
const applicableKinds = ((_a = this.opts.kinds) != null ? _a : ["Component"]).map(
|
|
62
|
+
(k) => k.toLocaleLowerCase("en-US")
|
|
63
|
+
);
|
|
64
|
+
if (!applicableKinds.includes(entity.kind.toLocaleLowerCase("en-US")) || location.type !== "url") {
|
|
61
65
|
return entity;
|
|
62
66
|
}
|
|
63
67
|
const scmIntegration = this.opts.scmIntegrationRegistry.byUrl(
|
|
@@ -77,7 +81,7 @@ class AnnotateScmSlugEntityProcessor {
|
|
|
77
81
|
default:
|
|
78
82
|
return entity;
|
|
79
83
|
}
|
|
80
|
-
let projectSlug = (
|
|
84
|
+
let projectSlug = (_b = entity.metadata.annotations) == null ? void 0 : _b[annotation];
|
|
81
85
|
if (!projectSlug) {
|
|
82
86
|
const gitUrl = parseGitUrl__default["default"](location.target);
|
|
83
87
|
projectSlug = `${gitUrl.owner}/${gitUrl.name}`;
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/modules/core/AnnotateScmSlugEntityProcessor.ts","../src/modules/core/LocationEntityProcessor.ts","../src/search/DefaultCatalogCollator.ts","../src/deprecated.ts","../src/index.ts"],"sourcesContent":["/*\n * Copyright 2021 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 { Entity } from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport {\n ScmIntegrationRegistry,\n ScmIntegrations,\n} from '@backstage/integration';\nimport parseGitUrl from 'git-url-parse';\nimport { identity, merge, pickBy } from 'lodash';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport { CatalogProcessor } from '@backstage/plugin-catalog-node';\n\nconst GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug';\nconst GITLAB_ACTIONS_ANNOTATION = 'gitlab.com/project-slug';\n\n/** @public */\nexport class AnnotateScmSlugEntityProcessor implements CatalogProcessor {\n constructor(\n private readonly opts: { scmIntegrationRegistry: ScmIntegrationRegistry },\n ) {}\n\n getProcessorName(): string {\n return 'AnnotateScmSlugEntityProcessor';\n }\n\n static fromConfig(config: Config): AnnotateScmSlugEntityProcessor {\n return new AnnotateScmSlugEntityProcessor({\n scmIntegrationRegistry: ScmIntegrations.fromConfig(config),\n });\n }\n\n async preProcessEntity(\n entity: Entity,\n location: LocationSpec,\n ): Promise<Entity> {\n if (entity.kind !== 'Component' || location.type !== 'url') {\n return entity;\n }\n\n const scmIntegration = this.opts.scmIntegrationRegistry.byUrl(\n location.target,\n );\n\n if (!scmIntegration) {\n return entity;\n }\n\n let annotation;\n switch (scmIntegration.type) {\n case 'github':\n annotation = GITHUB_ACTIONS_ANNOTATION;\n break;\n case 'gitlab':\n annotation = GITLAB_ACTIONS_ANNOTATION;\n break;\n default:\n return entity;\n }\n\n let projectSlug = entity.metadata.annotations?.[annotation];\n if (!projectSlug) {\n const gitUrl = parseGitUrl(location.target);\n projectSlug = `${gitUrl.owner}/${gitUrl.name}`;\n }\n\n return merge(\n {\n metadata: {\n annotations: pickBy(\n {\n [annotation]: projectSlug,\n },\n identity,\n ),\n },\n },\n entity,\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 { Entity, LocationEntity } from '@backstage/catalog-model';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport path from 'path';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport {\n processingResult,\n CatalogProcessor,\n CatalogProcessorEmit,\n} from '@backstage/plugin-catalog-node';\n\nexport function toAbsoluteUrl(\n integrations: ScmIntegrationRegistry,\n base: LocationSpec,\n target: string,\n): string {\n try {\n if (base.type === 'file') {\n if (target.startsWith('.')) {\n return path.join(path.dirname(base.target), target);\n }\n return target;\n }\n return integrations.resolveUrl({ url: target, base: base.target });\n } catch (e) {\n return target;\n }\n}\n\n/** @public */\nexport type LocationEntityProcessorOptions = {\n integrations: ScmIntegrationRegistry;\n};\n\n/** @public */\nexport class LocationEntityProcessor implements CatalogProcessor {\n constructor(private readonly options: LocationEntityProcessorOptions) {}\n\n getProcessorName(): string {\n return 'LocationEntityProcessor';\n }\n\n async postProcessEntity(\n entity: Entity,\n location: LocationSpec,\n emit: CatalogProcessorEmit,\n ): Promise<Entity> {\n if (entity.kind === 'Location') {\n const locationEntity = entity as LocationEntity;\n\n const type = locationEntity.spec.type || location.type;\n if (type === 'file' && location.target.endsWith(path.sep)) {\n emit(\n processingResult.inputError(\n location,\n `LocationEntityProcessor cannot handle ${type} type location with target ${location.target} that ends with a path separator`,\n ),\n );\n }\n\n const targets = new Array<string>();\n if (locationEntity.spec.target) {\n targets.push(locationEntity.spec.target);\n }\n if (locationEntity.spec.targets) {\n targets.push(...locationEntity.spec.targets);\n }\n\n for (const maybeRelativeTarget of targets) {\n const target = toAbsoluteUrl(\n this.options.integrations,\n location,\n maybeRelativeTarget,\n );\n emit(processingResult.location({ type, target }));\n }\n }\n\n return entity;\n }\n}\n","/*\n * Copyright 2021 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 PluginEndpointDiscovery,\n TokenManager,\n} from '@backstage/backend-common';\nimport {\n Entity,\n isUserEntity,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport {\n CatalogApi,\n CatalogClient,\n GetEntitiesRequest,\n} from '@backstage/catalog-client';\nimport { catalogEntityReadPermission } from '@backstage/plugin-catalog-common/alpha';\nimport { CatalogEntityDocument } from '@backstage/plugin-catalog-common';\nimport { Permission } from '@backstage/plugin-permission-common';\n\n/**\n * @public\n * @deprecated Upgrade to a more recent `@backstage/plugin-search-backend-node` and\n * use `DefaultCatalogCollatorFactory` instead.\n */\nexport class DefaultCatalogCollator {\n protected discovery: PluginEndpointDiscovery;\n protected locationTemplate: string;\n protected filter?: GetEntitiesRequest['filter'];\n protected readonly catalogClient: CatalogApi;\n public readonly type: string = 'software-catalog';\n public readonly visibilityPermission: Permission =\n catalogEntityReadPermission;\n protected tokenManager: TokenManager;\n\n static fromConfig(\n _config: Config,\n options: {\n discovery: PluginEndpointDiscovery;\n tokenManager: TokenManager;\n filter?: GetEntitiesRequest['filter'];\n },\n ) {\n return new DefaultCatalogCollator({\n ...options,\n });\n }\n\n constructor(options: {\n discovery: PluginEndpointDiscovery;\n tokenManager: TokenManager;\n locationTemplate?: string;\n filter?: GetEntitiesRequest['filter'];\n catalogClient?: CatalogApi;\n }) {\n const { discovery, locationTemplate, filter, catalogClient, tokenManager } =\n options;\n\n this.discovery = discovery;\n this.locationTemplate =\n locationTemplate || '/catalog/:namespace/:kind/:name';\n this.filter = filter;\n this.catalogClient =\n catalogClient || new CatalogClient({ discoveryApi: discovery });\n this.tokenManager = tokenManager;\n }\n\n protected applyArgsToFormat(\n format: string,\n args: Record<string, string>,\n ): string {\n let formatted = format;\n for (const [key, value] of Object.entries(args)) {\n formatted = formatted.replace(`:${key}`, value);\n }\n return formatted.toLowerCase();\n }\n\n private getDocumentText(entity: Entity): string {\n let documentText = entity.metadata.description || '';\n if (isUserEntity(entity)) {\n if (entity.spec?.profile?.displayName && documentText) {\n // combine displayName and description\n const displayName = entity.spec?.profile?.displayName;\n documentText = displayName.concat(' : ', documentText);\n } else {\n documentText = entity.spec?.profile?.displayName || documentText;\n }\n }\n return documentText;\n }\n\n async execute() {\n const { token } = await this.tokenManager.getToken();\n const response = await this.catalogClient.getEntities(\n {\n filter: this.filter,\n },\n { token },\n );\n return response.items.map((entity: Entity): CatalogEntityDocument => {\n return {\n title: entity.metadata.title ?? entity.metadata.name,\n location: this.applyArgsToFormat(this.locationTemplate, {\n namespace: entity.metadata.namespace || 'default',\n kind: entity.kind,\n name: entity.metadata.name,\n }),\n text: this.getDocumentText(entity),\n componentType: entity.spec?.type?.toString() || 'other',\n type: entity.spec?.type?.toString() || 'other',\n namespace: entity.metadata.namespace || 'default',\n kind: entity.kind,\n lifecycle: (entity.spec?.lifecycle as string) || '',\n owner: (entity.spec?.owner as string) || '',\n authorization: {\n resourceRef: stringifyEntityRef(entity),\n },\n };\n });\n }\n}\n","/*\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 locationSpecToMetadataName as _locationSpecToMetadataName,\n locationSpecToLocationEntity as _locationSpecToLocationEntity,\n processingResult as _processingResult,\n type DeferredEntity as _DeferredEntity,\n type EntityRelationSpec as _EntityRelationSpec,\n type CatalogProcessor as _CatalogProcessor,\n type CatalogProcessorParser as _CatalogProcessorParser,\n type CatalogProcessorCache as _CatalogProcessorCache,\n type CatalogProcessorEmit as _CatalogProcessorEmit,\n type CatalogProcessorLocationResult as _CatalogProcessorLocationResult,\n type CatalogProcessorEntityResult as _CatalogProcessorEntityResult,\n type CatalogProcessorRelationResult as _CatalogProcessorRelationResult,\n type CatalogProcessorErrorResult as _CatalogProcessorErrorResult,\n type CatalogProcessorRefreshKeysResult as _CatalogProcessorRefreshKeysResult,\n type CatalogProcessorResult as _CatalogProcessorResult,\n type EntityProvider as _EntityProvider,\n type EntityProviderConnection as _EntityProviderConnection,\n type EntityProviderMutation as _EntityProviderMutation,\n} from '@backstage/plugin-catalog-node';\nimport { type LocationSpec as _LocationSpec } from '@backstage/plugin-catalog-common';\n\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport const locationSpecToMetadataName = _locationSpecToMetadataName;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport const locationSpecToLocationEntity = _locationSpecToLocationEntity;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport const processingResult = _processingResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type DeferredEntity = _DeferredEntity;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type EntityRelationSpec = _EntityRelationSpec;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessor = _CatalogProcessor;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorParser = _CatalogProcessorParser;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorCache = _CatalogProcessorCache;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorEmit = _CatalogProcessorEmit;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorLocationResult = _CatalogProcessorLocationResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorEntityResult = _CatalogProcessorEntityResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorRelationResult = _CatalogProcessorRelationResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorErrorResult = _CatalogProcessorErrorResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorRefreshKeysResult =\n _CatalogProcessorRefreshKeysResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorResult = _CatalogProcessorResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type EntityProvider = _EntityProvider;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type EntityProviderConnection = _EntityProviderConnection;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type EntityProviderMutation = _EntityProviderMutation;\n\n/**\n * Holds the entity location information.\n *\n * @remarks\n *\n * `presence` flag: when using repo importer plugin, location is being created before the component yaml file is merged to the main branch.\n * This flag is then set to indicate that the file can be not present.\n * default value: 'required'.\n *\n * @public\n * @deprecated use the same type from `@backstage/plugin-catalog-common` instead\n */\nexport type LocationSpec = _LocationSpec;\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\n/**\n * The Backstage backend plugin that provides the Backstage catalog\n *\n * @packageDocumentation\n */\n\nexport * from './catalog';\nexport * from './ingestion';\nexport * from './modules';\nexport * from './processing';\nexport * from './search';\nexport * from './service';\nexport * from './deprecated';\nexport * from './constants';\n\nimport {\n DefaultCatalogCollatorFactory as _DefaultCatalogCollatorFactory,\n defaultCatalogCollatorEntityTransformer as _defaultCatalogCollatorEntityTransformer,\n} from '@backstage/plugin-search-backend-module-catalog';\n\n/**\n * @public\n * @deprecated import from `@backstage/search-backend-module-catalog` instead\n */\nexport const DefaultCatalogCollatorFactory = _DefaultCatalogCollatorFactory;\n\n/**\n * @public\n * @deprecated import from `@backstage/search-backend-module-catalog` instead\n */\nexport const defaultCatalogCollatorEntityTransformer =\n _defaultCatalogCollatorEntityTransformer;\n\nimport type {\n DefaultCatalogCollatorFactoryOptions as _DefaultCatalogCollatorFactoryOptions,\n CatalogCollatorEntityTransformer as _CatalogCollatorEntityTransformer,\n} from '@backstage/plugin-search-backend-module-catalog';\n\n/**\n * @public\n * @deprecated import from `@backstage/search-backend-module-catalog` instead\n */\nexport type DefaultCatalogCollatorFactoryOptions =\n _DefaultCatalogCollatorFactoryOptions;\n\n/**\n * @public\n * @deprecated import from `@backstage/search-backend-module-catalog` instead\n */\nexport type CatalogCollatorEntityTransformer =\n _CatalogCollatorEntityTransformer;\n"],"names":["ScmIntegrations","parseGitUrl","merge","pickBy","identity","path","processingResult","catalogEntityReadPermission","catalogClient","CatalogClient","isUserEntity","stringifyEntityRef","_locationSpecToMetadataName","_locationSpecToLocationEntity","_processingResult","_DefaultCatalogCollatorFactory","_defaultCatalogCollatorEntityTransformer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,yBAA4B,GAAA,yBAAA,CAAA;AAClC,MAAM,yBAA4B,GAAA,yBAAA,CAAA;AAG3B,MAAM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D,KAAQ,EAAA,CAAA,CAAA,EAAA,GAAA,MAAA,CAAO,IAAP,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAa,KAAoB,KAAA,EAAA;AAAA,QACzC,aAAe,EAAA;AAAA,UACb,WAAA,EAAaC,gCAAmB,MAAM,CAAA;AAAA,SACxC;AAAA,OACF,CAAA;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF;;AC9FO,MAAM,0BAA6B,GAAAC,6CAAA;AAKnC,MAAM,4BAA+B,GAAAC,+CAAA;AAKrC,MAAM,gBAAmB,GAAAC;;ACZzB,MAAM,6BAAgC,GAAAC,+DAAA;AAMtC,MAAM,uCACX,GAAAC;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/modules/core/AnnotateScmSlugEntityProcessor.ts","../src/modules/core/LocationEntityProcessor.ts","../src/search/DefaultCatalogCollator.ts","../src/deprecated.ts","../src/index.ts"],"sourcesContent":["/*\n * Copyright 2021 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 { Entity } from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport {\n ScmIntegrationRegistry,\n ScmIntegrations,\n} from '@backstage/integration';\nimport parseGitUrl from 'git-url-parse';\nimport { identity, merge, pickBy } from 'lodash';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport { CatalogProcessor } from '@backstage/plugin-catalog-node';\n\nconst GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug';\nconst GITLAB_ACTIONS_ANNOTATION = 'gitlab.com/project-slug';\n\n/** @public */\nexport class AnnotateScmSlugEntityProcessor implements CatalogProcessor {\n constructor(\n private readonly opts: {\n scmIntegrationRegistry: ScmIntegrationRegistry;\n kinds?: string[];\n },\n ) {}\n\n getProcessorName(): string {\n return 'AnnotateScmSlugEntityProcessor';\n }\n\n static fromConfig(\n config: Config,\n options?: { kinds?: string[] },\n ): AnnotateScmSlugEntityProcessor {\n return new AnnotateScmSlugEntityProcessor({\n scmIntegrationRegistry: ScmIntegrations.fromConfig(config),\n kinds: options?.kinds,\n });\n }\n\n async preProcessEntity(\n entity: Entity,\n location: LocationSpec,\n ): Promise<Entity> {\n const applicableKinds = (this.opts.kinds ?? ['Component']).map(k =>\n k.toLocaleLowerCase('en-US'),\n );\n if (\n !applicableKinds.includes(entity.kind.toLocaleLowerCase('en-US')) ||\n location.type !== 'url'\n ) {\n return entity;\n }\n\n const scmIntegration = this.opts.scmIntegrationRegistry.byUrl(\n location.target,\n );\n\n if (!scmIntegration) {\n return entity;\n }\n\n let annotation;\n switch (scmIntegration.type) {\n case 'github':\n annotation = GITHUB_ACTIONS_ANNOTATION;\n break;\n case 'gitlab':\n annotation = GITLAB_ACTIONS_ANNOTATION;\n break;\n default:\n return entity;\n }\n\n let projectSlug = entity.metadata.annotations?.[annotation];\n if (!projectSlug) {\n const gitUrl = parseGitUrl(location.target);\n projectSlug = `${gitUrl.owner}/${gitUrl.name}`;\n }\n\n return merge(\n {\n metadata: {\n annotations: pickBy(\n {\n [annotation]: projectSlug,\n },\n identity,\n ),\n },\n },\n entity,\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 { Entity, LocationEntity } from '@backstage/catalog-model';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport path from 'path';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport {\n processingResult,\n CatalogProcessor,\n CatalogProcessorEmit,\n} from '@backstage/plugin-catalog-node';\n\nexport function toAbsoluteUrl(\n integrations: ScmIntegrationRegistry,\n base: LocationSpec,\n target: string,\n): string {\n try {\n if (base.type === 'file') {\n if (target.startsWith('.')) {\n return path.join(path.dirname(base.target), target);\n }\n return target;\n }\n return integrations.resolveUrl({ url: target, base: base.target });\n } catch (e) {\n return target;\n }\n}\n\n/** @public */\nexport type LocationEntityProcessorOptions = {\n integrations: ScmIntegrationRegistry;\n};\n\n/** @public */\nexport class LocationEntityProcessor implements CatalogProcessor {\n constructor(private readonly options: LocationEntityProcessorOptions) {}\n\n getProcessorName(): string {\n return 'LocationEntityProcessor';\n }\n\n async postProcessEntity(\n entity: Entity,\n location: LocationSpec,\n emit: CatalogProcessorEmit,\n ): Promise<Entity> {\n if (entity.kind === 'Location') {\n const locationEntity = entity as LocationEntity;\n\n const type = locationEntity.spec.type || location.type;\n if (type === 'file' && location.target.endsWith(path.sep)) {\n emit(\n processingResult.inputError(\n location,\n `LocationEntityProcessor cannot handle ${type} type location with target ${location.target} that ends with a path separator`,\n ),\n );\n }\n\n const targets = new Array<string>();\n if (locationEntity.spec.target) {\n targets.push(locationEntity.spec.target);\n }\n if (locationEntity.spec.targets) {\n targets.push(...locationEntity.spec.targets);\n }\n\n for (const maybeRelativeTarget of targets) {\n const target = toAbsoluteUrl(\n this.options.integrations,\n location,\n maybeRelativeTarget,\n );\n emit(processingResult.location({ type, target }));\n }\n }\n\n return entity;\n }\n}\n","/*\n * Copyright 2021 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 PluginEndpointDiscovery,\n TokenManager,\n} from '@backstage/backend-common';\nimport {\n Entity,\n isUserEntity,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport {\n CatalogApi,\n CatalogClient,\n GetEntitiesRequest,\n} from '@backstage/catalog-client';\nimport { catalogEntityReadPermission } from '@backstage/plugin-catalog-common/alpha';\nimport { CatalogEntityDocument } from '@backstage/plugin-catalog-common';\nimport { Permission } from '@backstage/plugin-permission-common';\n\n/**\n * @public\n * @deprecated Upgrade to a more recent `@backstage/plugin-search-backend-node` and\n * use `DefaultCatalogCollatorFactory` instead.\n */\nexport class DefaultCatalogCollator {\n protected discovery: PluginEndpointDiscovery;\n protected locationTemplate: string;\n protected filter?: GetEntitiesRequest['filter'];\n protected readonly catalogClient: CatalogApi;\n public readonly type: string = 'software-catalog';\n public readonly visibilityPermission: Permission =\n catalogEntityReadPermission;\n protected tokenManager: TokenManager;\n\n static fromConfig(\n _config: Config,\n options: {\n discovery: PluginEndpointDiscovery;\n tokenManager: TokenManager;\n filter?: GetEntitiesRequest['filter'];\n },\n ) {\n return new DefaultCatalogCollator({\n ...options,\n });\n }\n\n constructor(options: {\n discovery: PluginEndpointDiscovery;\n tokenManager: TokenManager;\n locationTemplate?: string;\n filter?: GetEntitiesRequest['filter'];\n catalogClient?: CatalogApi;\n }) {\n const { discovery, locationTemplate, filter, catalogClient, tokenManager } =\n options;\n\n this.discovery = discovery;\n this.locationTemplate =\n locationTemplate || '/catalog/:namespace/:kind/:name';\n this.filter = filter;\n this.catalogClient =\n catalogClient || new CatalogClient({ discoveryApi: discovery });\n this.tokenManager = tokenManager;\n }\n\n protected applyArgsToFormat(\n format: string,\n args: Record<string, string>,\n ): string {\n let formatted = format;\n for (const [key, value] of Object.entries(args)) {\n formatted = formatted.replace(`:${key}`, value);\n }\n return formatted.toLowerCase();\n }\n\n private getDocumentText(entity: Entity): string {\n let documentText = entity.metadata.description || '';\n if (isUserEntity(entity)) {\n if (entity.spec?.profile?.displayName && documentText) {\n // combine displayName and description\n const displayName = entity.spec?.profile?.displayName;\n documentText = displayName.concat(' : ', documentText);\n } else {\n documentText = entity.spec?.profile?.displayName || documentText;\n }\n }\n return documentText;\n }\n\n async execute() {\n const { token } = await this.tokenManager.getToken();\n const response = await this.catalogClient.getEntities(\n {\n filter: this.filter,\n },\n { token },\n );\n return response.items.map((entity: Entity): CatalogEntityDocument => {\n return {\n title: entity.metadata.title ?? entity.metadata.name,\n location: this.applyArgsToFormat(this.locationTemplate, {\n namespace: entity.metadata.namespace || 'default',\n kind: entity.kind,\n name: entity.metadata.name,\n }),\n text: this.getDocumentText(entity),\n componentType: entity.spec?.type?.toString() || 'other',\n type: entity.spec?.type?.toString() || 'other',\n namespace: entity.metadata.namespace || 'default',\n kind: entity.kind,\n lifecycle: (entity.spec?.lifecycle as string) || '',\n owner: (entity.spec?.owner as string) || '',\n authorization: {\n resourceRef: stringifyEntityRef(entity),\n },\n };\n });\n }\n}\n","/*\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 locationSpecToMetadataName as _locationSpecToMetadataName,\n locationSpecToLocationEntity as _locationSpecToLocationEntity,\n processingResult as _processingResult,\n type DeferredEntity as _DeferredEntity,\n type EntityRelationSpec as _EntityRelationSpec,\n type CatalogProcessor as _CatalogProcessor,\n type CatalogProcessorParser as _CatalogProcessorParser,\n type CatalogProcessorCache as _CatalogProcessorCache,\n type CatalogProcessorEmit as _CatalogProcessorEmit,\n type CatalogProcessorLocationResult as _CatalogProcessorLocationResult,\n type CatalogProcessorEntityResult as _CatalogProcessorEntityResult,\n type CatalogProcessorRelationResult as _CatalogProcessorRelationResult,\n type CatalogProcessorErrorResult as _CatalogProcessorErrorResult,\n type CatalogProcessorRefreshKeysResult as _CatalogProcessorRefreshKeysResult,\n type CatalogProcessorResult as _CatalogProcessorResult,\n type EntityProvider as _EntityProvider,\n type EntityProviderConnection as _EntityProviderConnection,\n type EntityProviderMutation as _EntityProviderMutation,\n} from '@backstage/plugin-catalog-node';\nimport { type LocationSpec as _LocationSpec } from '@backstage/plugin-catalog-common';\n\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport const locationSpecToMetadataName = _locationSpecToMetadataName;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport const locationSpecToLocationEntity = _locationSpecToLocationEntity;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport const processingResult = _processingResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type DeferredEntity = _DeferredEntity;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type EntityRelationSpec = _EntityRelationSpec;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessor = _CatalogProcessor;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorParser = _CatalogProcessorParser;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorCache = _CatalogProcessorCache;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorEmit = _CatalogProcessorEmit;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorLocationResult = _CatalogProcessorLocationResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorEntityResult = _CatalogProcessorEntityResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorRelationResult = _CatalogProcessorRelationResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorErrorResult = _CatalogProcessorErrorResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorRefreshKeysResult =\n _CatalogProcessorRefreshKeysResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type CatalogProcessorResult = _CatalogProcessorResult;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type EntityProvider = _EntityProvider;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type EntityProviderConnection = _EntityProviderConnection;\n/**\n * @public\n * @deprecated import from `@backstage/plugin-catalog-node` instead\n */\nexport type EntityProviderMutation = _EntityProviderMutation;\n\n/**\n * Holds the entity location information.\n *\n * @remarks\n *\n * `presence` flag: when using repo importer plugin, location is being created before the component yaml file is merged to the main branch.\n * This flag is then set to indicate that the file can be not present.\n * default value: 'required'.\n *\n * @public\n * @deprecated use the same type from `@backstage/plugin-catalog-common` instead\n */\nexport type LocationSpec = _LocationSpec;\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\n/**\n * The Backstage backend plugin that provides the Backstage catalog\n *\n * @packageDocumentation\n */\n\nexport * from './catalog';\nexport * from './ingestion';\nexport * from './modules';\nexport * from './processing';\nexport * from './search';\nexport * from './service';\nexport * from './deprecated';\nexport * from './constants';\n\nimport {\n DefaultCatalogCollatorFactory as _DefaultCatalogCollatorFactory,\n defaultCatalogCollatorEntityTransformer as _defaultCatalogCollatorEntityTransformer,\n} from '@backstage/plugin-search-backend-module-catalog';\n\n/**\n * @public\n * @deprecated import from `@backstage/plugin-search-backend-module-catalog` instead\n */\nexport const DefaultCatalogCollatorFactory = _DefaultCatalogCollatorFactory;\n\n/**\n * @public\n * @deprecated import from `@backstage/plugin-search-backend-module-catalog` instead\n */\nexport const defaultCatalogCollatorEntityTransformer =\n _defaultCatalogCollatorEntityTransformer;\n\nimport type {\n DefaultCatalogCollatorFactoryOptions as _DefaultCatalogCollatorFactoryOptions,\n CatalogCollatorEntityTransformer as _CatalogCollatorEntityTransformer,\n} from '@backstage/plugin-search-backend-module-catalog';\n\n/**\n * @public\n * @deprecated import from `@backstage/plugin-search-backend-module-catalog` instead\n */\nexport type DefaultCatalogCollatorFactoryOptions =\n _DefaultCatalogCollatorFactoryOptions;\n\n/**\n * @public\n * @deprecated import from `@backstage/plugin-search-backend-module-catalog` instead\n */\nexport type CatalogCollatorEntityTransformer =\n _CatalogCollatorEntityTransformer;\n"],"names":["ScmIntegrations","parseGitUrl","merge","pickBy","identity","path","processingResult","catalogEntityReadPermission","catalogClient","CatalogClient","isUserEntity","stringifyEntityRef","_locationSpecToMetadataName","_locationSpecToLocationEntity","_processingResult","_DefaultCatalogCollatorFactory","_defaultCatalogCollatorEntityTransformer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,yBAA4B,GAAA,yBAAA,CAAA;AAClC,MAAM,yBAA4B,GAAA,yBAAA,CAAA;AAG3B,MAAM,8BAA2D,CAAA;AAAA,EACtE,YACmB,IAIjB,EAAA;AAJiB,IAAA,IAAA,CAAA,IAAA,GAAA,IAA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A,IAAA,KAAb,mBAAmB,QAAc,EAAA,KAAA,OAAA;AAAA,QACvC,SAAA,EAAW,MAAO,CAAA,QAAA,CAAS,SAAa,IAAA,SAAA;AAAA,QACxC,MAAM,MAAO,CAAA,IAAA;AAAA,QACb,SAAY,EAAA,CAAA,CAAA,EAAA,GAAA,MAAA,CAAO,IAAP,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAa,SAAwB,KAAA,EAAA;AAAA,QACjD,KAAQ,EAAA,CAAA,CAAA,EAAA,GAAA,MAAA,CAAO,IAAP,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAa,KAAoB,KAAA,EAAA;AAAA,QACzC,aAAe,EAAA;AAAA,UACb,WAAA,EAAaC,gCAAmB,MAAM,CAAA;AAAA,SACxC;AAAA,OACF,CAAA;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF;;AC9FO,MAAM,0BAA6B,GAAAC,6CAAA;AAKnC,MAAM,4BAA+B,GAAAC,+CAAA;AAKrC,MAAM,gBAAmB,GAAAC;;ACZzB,MAAM,6BAAgC,GAAAC,+DAAA;AAMtC,MAAM,uCACX,GAAAC;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -115,9 +115,12 @@ declare class AnnotateScmSlugEntityProcessor implements CatalogProcessor$1 {
|
|
|
115
115
|
private readonly opts;
|
|
116
116
|
constructor(opts: {
|
|
117
117
|
scmIntegrationRegistry: ScmIntegrationRegistry;
|
|
118
|
+
kinds?: string[];
|
|
118
119
|
});
|
|
119
120
|
getProcessorName(): string;
|
|
120
|
-
static fromConfig(config: Config
|
|
121
|
+
static fromConfig(config: Config, options?: {
|
|
122
|
+
kinds?: string[];
|
|
123
|
+
}): AnnotateScmSlugEntityProcessor;
|
|
121
124
|
preProcessEntity(entity: Entity, location: LocationSpec$1): Promise<Entity>;
|
|
122
125
|
}
|
|
123
126
|
|
|
@@ -608,23 +611,23 @@ declare const CATALOG_CONFLICTS_TOPIC = "experimental.catalog.conflict";
|
|
|
608
611
|
|
|
609
612
|
/**
|
|
610
613
|
* @public
|
|
611
|
-
* @deprecated import from `@backstage/search-backend-module-catalog` instead
|
|
614
|
+
* @deprecated import from `@backstage/plugin-search-backend-module-catalog` instead
|
|
612
615
|
*/
|
|
613
616
|
declare const DefaultCatalogCollatorFactory: typeof DefaultCatalogCollatorFactory$1;
|
|
614
617
|
/**
|
|
615
618
|
* @public
|
|
616
|
-
* @deprecated import from `@backstage/search-backend-module-catalog` instead
|
|
619
|
+
* @deprecated import from `@backstage/plugin-search-backend-module-catalog` instead
|
|
617
620
|
*/
|
|
618
621
|
declare const defaultCatalogCollatorEntityTransformer: CatalogCollatorEntityTransformer$1;
|
|
619
622
|
|
|
620
623
|
/**
|
|
621
624
|
* @public
|
|
622
|
-
* @deprecated import from `@backstage/search-backend-module-catalog` instead
|
|
625
|
+
* @deprecated import from `@backstage/plugin-search-backend-module-catalog` instead
|
|
623
626
|
*/
|
|
624
627
|
type DefaultCatalogCollatorFactoryOptions = DefaultCatalogCollatorFactoryOptions$1;
|
|
625
628
|
/**
|
|
626
629
|
* @public
|
|
627
|
-
* @deprecated import from `@backstage/search-backend-module-catalog` instead
|
|
630
|
+
* @deprecated import from `@backstage/plugin-search-backend-module-catalog` instead
|
|
628
631
|
*/
|
|
629
632
|
type CatalogCollatorEntityTransformer = CatalogCollatorEntityTransformer$1;
|
|
630
633
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-backend",
|
|
3
3
|
"description": "The Backstage backend plugin that provides the Backstage catalog",
|
|
4
|
-
"version": "1.12.0
|
|
4
|
+
"version": "1.12.0",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -43,23 +43,23 @@
|
|
|
43
43
|
"clean": "backstage-cli package clean"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@backstage/backend-common": "^0.19.2
|
|
47
|
-
"@backstage/backend-openapi-utils": "^0.0.3
|
|
48
|
-
"@backstage/backend-plugin-api": "^0.6.0
|
|
49
|
-
"@backstage/backend-tasks": "^0.5.5
|
|
46
|
+
"@backstage/backend-common": "^0.19.2",
|
|
47
|
+
"@backstage/backend-openapi-utils": "^0.0.3",
|
|
48
|
+
"@backstage/backend-plugin-api": "^0.6.0",
|
|
49
|
+
"@backstage/backend-tasks": "^0.5.5",
|
|
50
50
|
"@backstage/catalog-client": "^1.4.3",
|
|
51
51
|
"@backstage/catalog-model": "^1.4.1",
|
|
52
52
|
"@backstage/config": "^1.0.8",
|
|
53
53
|
"@backstage/errors": "^1.2.1",
|
|
54
|
-
"@backstage/integration": "^1.
|
|
55
|
-
"@backstage/plugin-auth-node": "^0.2.17
|
|
54
|
+
"@backstage/integration": "^1.6.0",
|
|
55
|
+
"@backstage/plugin-auth-node": "^0.2.17",
|
|
56
56
|
"@backstage/plugin-catalog-common": "^1.0.15",
|
|
57
|
-
"@backstage/plugin-catalog-node": "^1.4.1
|
|
58
|
-
"@backstage/plugin-events-node": "^0.2.9
|
|
57
|
+
"@backstage/plugin-catalog-node": "^1.4.1",
|
|
58
|
+
"@backstage/plugin-events-node": "^0.2.9",
|
|
59
59
|
"@backstage/plugin-permission-common": "^0.7.7",
|
|
60
|
-
"@backstage/plugin-permission-node": "^0.7.11
|
|
61
|
-
"@backstage/plugin-scaffolder-common": "^1.
|
|
62
|
-
"@backstage/plugin-search-backend-module-catalog": "^0.1.4
|
|
60
|
+
"@backstage/plugin-permission-node": "^0.7.11",
|
|
61
|
+
"@backstage/plugin-scaffolder-common": "^1.4.0",
|
|
62
|
+
"@backstage/plugin-search-backend-module-catalog": "^0.1.4",
|
|
63
63
|
"@backstage/plugin-search-common": "^1.2.5",
|
|
64
64
|
"@backstage/types": "^1.1.0",
|
|
65
65
|
"@opentelemetry/api": "^1.3.0",
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
"zod": "^3.21.4"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@backstage/backend-test-utils": "^0.2.0
|
|
90
|
-
"@backstage/cli": "^0.22.10
|
|
89
|
+
"@backstage/backend-test-utils": "^0.2.0",
|
|
90
|
+
"@backstage/cli": "^0.22.10",
|
|
91
91
|
"@backstage/plugin-permission-common": "^0.7.7",
|
|
92
|
-
"@backstage/plugin-search-backend-node": "^1.2.4
|
|
92
|
+
"@backstage/plugin-search-backend-node": "^1.2.4",
|
|
93
93
|
"@types/core-js": "^2.5.4",
|
|
94
94
|
"@types/git-url-parse": "^9.0.0",
|
|
95
95
|
"@types/lodash": "^4.14.151",
|