@backstage/plugin-catalog-backend-module-github 0.8.0 → 0.9.0-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 +34 -0
- package/dist/analyzers/GithubLocationAnalyzer.cjs.js +3 -13
- package/dist/analyzers/GithubLocationAnalyzer.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -8
- package/dist/module/githubCatalogModule.cjs.js +2 -4
- package/dist/module/githubCatalogModule.cjs.js.map +1 -1
- package/package.json +12 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-backend-module-github
|
|
2
2
|
|
|
3
|
+
## 0.9.0-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/plugin-catalog-backend@2.0.0-next.1
|
|
9
|
+
- @backstage/plugin-catalog-node@1.17.0-next.1
|
|
10
|
+
- @backstage/backend-plugin-api@1.3.1-next.1
|
|
11
|
+
- @backstage/integration@1.16.4-next.1
|
|
12
|
+
- @backstage/catalog-client@1.10.0-next.0
|
|
13
|
+
- @backstage/catalog-model@1.7.3
|
|
14
|
+
- @backstage/config@1.3.2
|
|
15
|
+
- @backstage/plugin-catalog-common@1.1.4-next.0
|
|
16
|
+
- @backstage/plugin-events-node@0.4.11-next.1
|
|
17
|
+
|
|
18
|
+
## 0.9.0-next.0
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- ff335e5: **BREAKING** The `GithubLocationAnalyzer` now requires the `AuthService` and the `CatalogService` when being constructed and the `TokenManger` has been removed.
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- @backstage/integration@1.16.4-next.0
|
|
28
|
+
- @backstage/catalog-client@1.10.0-next.0
|
|
29
|
+
- @backstage/plugin-catalog-node@1.17.0-next.0
|
|
30
|
+
- @backstage/plugin-catalog-backend@1.32.2-next.0
|
|
31
|
+
- @backstage/backend-plugin-api@1.3.1-next.0
|
|
32
|
+
- @backstage/plugin-events-node@0.4.11-next.0
|
|
33
|
+
- @backstage/catalog-model@1.7.3
|
|
34
|
+
- @backstage/config@1.3.2
|
|
35
|
+
- @backstage/plugin-catalog-common@1.1.3
|
|
36
|
+
|
|
3
37
|
## 0.8.0
|
|
4
38
|
|
|
5
39
|
### Minor Changes
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var catalogClient = require('@backstage/catalog-client');
|
|
4
3
|
var integration = require('@backstage/integration');
|
|
5
4
|
var rest = require('@octokit/rest');
|
|
6
5
|
var lodash = require('lodash');
|
|
7
6
|
var parseGitUrl = require('git-url-parse');
|
|
8
|
-
var backendCommon = require('@backstage/backend-common');
|
|
9
7
|
var path = require('path');
|
|
10
8
|
|
|
11
9
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -18,14 +16,10 @@ class GithubLocationAnalyzer {
|
|
|
18
16
|
integrations;
|
|
19
17
|
auth;
|
|
20
18
|
constructor(options) {
|
|
21
|
-
this.catalogClient = options.catalog
|
|
19
|
+
this.catalogClient = options.catalog;
|
|
22
20
|
this.integrations = integration.ScmIntegrations.fromConfig(options.config);
|
|
23
21
|
this.githubCredentialsProvider = options.githubCredentialsProvider || integration.DefaultGithubCredentialsProvider.fromIntegrations(this.integrations);
|
|
24
|
-
this.auth =
|
|
25
|
-
auth: options.auth,
|
|
26
|
-
discovery: options.discovery,
|
|
27
|
-
tokenManager: options.tokenManager
|
|
28
|
-
}).auth;
|
|
22
|
+
this.auth = options.auth;
|
|
29
23
|
}
|
|
30
24
|
supports(url) {
|
|
31
25
|
const integration = this.integrations.byUrl(url);
|
|
@@ -58,10 +52,6 @@ class GithubLocationAnalyzer {
|
|
|
58
52
|
throw new Error(`Couldn't fetch repo data, ${e}`);
|
|
59
53
|
});
|
|
60
54
|
const defaultBranch = repoInformation.data.default_branch;
|
|
61
|
-
const { token: serviceToken } = await this.auth.getPluginRequestToken({
|
|
62
|
-
onBehalfOf: await this.auth.getOwnServiceCredentials(),
|
|
63
|
-
targetPluginId: "catalog"
|
|
64
|
-
});
|
|
65
55
|
const result = await Promise.all(
|
|
66
56
|
searchResult.data.items.map((i) => `${lodash.trimEnd(url, "/")}/blob/${defaultBranch}/${i.path}`).map(async (target) => {
|
|
67
57
|
const addLocationResult = await this.catalogClient.addLocation(
|
|
@@ -70,7 +60,7 @@ class GithubLocationAnalyzer {
|
|
|
70
60
|
target,
|
|
71
61
|
dryRun: true
|
|
72
62
|
},
|
|
73
|
-
{
|
|
63
|
+
{ credentials: await this.auth.getOwnServiceCredentials() }
|
|
74
64
|
);
|
|
75
65
|
return addLocationResult.entities.map((e) => ({
|
|
76
66
|
location: { type: "url", target },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GithubLocationAnalyzer.cjs.js","sources":["../../src/analyzers/GithubLocationAnalyzer.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 {
|
|
1
|
+
{"version":3,"file":"GithubLocationAnalyzer.cjs.js","sources":["../../src/analyzers/GithubLocationAnalyzer.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 DefaultGithubCredentialsProvider,\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n ScmIntegrations,\n} from '@backstage/integration';\nimport { Octokit } from '@octokit/rest';\nimport { isEmpty, trimEnd } from 'lodash';\nimport parseGitUrl from 'git-url-parse';\nimport {\n AnalyzeOptions,\n CatalogService,\n ScmLocationAnalyzer,\n} from '@backstage/plugin-catalog-node';\nimport { Config } from '@backstage/config';\nimport { AuthService } from '@backstage/backend-plugin-api';\nimport { extname } from 'path';\n\n/** @public */\nexport type GithubLocationAnalyzerOptions = {\n config: Config;\n auth: AuthService;\n githubCredentialsProvider?: GithubCredentialsProvider;\n catalog: CatalogService;\n};\n\n/** @public */\nexport class GithubLocationAnalyzer implements ScmLocationAnalyzer {\n private readonly catalogClient: CatalogService;\n private readonly githubCredentialsProvider: GithubCredentialsProvider;\n private readonly integrations: ScmIntegrationRegistry;\n private readonly auth: AuthService;\n\n constructor(options: GithubLocationAnalyzerOptions) {\n this.catalogClient = options.catalog;\n this.integrations = ScmIntegrations.fromConfig(options.config);\n this.githubCredentialsProvider =\n options.githubCredentialsProvider ||\n DefaultGithubCredentialsProvider.fromIntegrations(this.integrations);\n\n this.auth = options.auth;\n }\n\n supports(url: string) {\n const integration = this.integrations.byUrl(url);\n return integration?.type === 'github';\n }\n\n async analyze(options: AnalyzeOptions) {\n const { url, catalogFilename } = options;\n const { owner, name: repo } = parseGitUrl(url);\n\n const catalogFile = catalogFilename || 'catalog-info.yaml';\n const extension = extname(catalogFile);\n const extensionQuery = !isEmpty(extension)\n ? `extension:${extension.replace('.', '')}`\n : '';\n\n const query = `filename:${catalogFile} ${extensionQuery} repo:${owner}/${repo}`;\n\n const integration = this.integrations.github.byUrl(url);\n if (!integration) {\n throw new Error('Make sure you have a GitHub integration configured');\n }\n\n const { token: githubToken } =\n await this.githubCredentialsProvider.getCredentials({\n url,\n });\n\n const octokitClient = new Octokit({\n auth: githubToken,\n baseUrl: integration.config.apiBaseUrl,\n });\n\n const searchResult = await octokitClient.search\n .code({ q: query })\n .catch(e => {\n throw new Error(`Couldn't search repository for metadata file, ${e}`);\n });\n\n const exists = searchResult.data.total_count > 0;\n if (exists) {\n const repoInformation = await octokitClient.repos\n .get({ owner, repo })\n .catch(e => {\n throw new Error(`Couldn't fetch repo data, ${e}`);\n });\n const defaultBranch = repoInformation.data.default_branch;\n\n const result = await Promise.all(\n searchResult.data.items\n .map(i => `${trimEnd(url, '/')}/blob/${defaultBranch}/${i.path}`)\n .map(async target => {\n const addLocationResult = await this.catalogClient.addLocation(\n {\n type: 'url',\n target,\n dryRun: true,\n },\n { credentials: await this.auth.getOwnServiceCredentials() },\n );\n return addLocationResult.entities.map(e => ({\n location: { type: 'url', target },\n isRegistered: !!addLocationResult.exists,\n entity: e,\n }));\n }),\n );\n\n return { existing: result.flat() };\n }\n return { existing: [] };\n }\n}\n"],"names":["ScmIntegrations","DefaultGithubCredentialsProvider","parseGitUrl","extname","isEmpty","Octokit","trimEnd"],"mappings":";;;;;;;;;;;;AA2CO,MAAM,sBAAsD,CAAA;AAAA,EAChD,aAAA;AAAA,EACA,yBAAA;AAAA,EACA,YAAA;AAAA,EACA,IAAA;AAAA,EAEjB,YAAY,OAAwC,EAAA;AAClD,IAAA,IAAA,CAAK,gBAAgB,OAAQ,CAAA,OAAA;AAC7B,IAAA,IAAA,CAAK,YAAe,GAAAA,2BAAA,CAAgB,UAAW,CAAA,OAAA,CAAQ,MAAM,CAAA;AAC7D,IAAA,IAAA,CAAK,4BACH,OAAQ,CAAA,yBAAA,IACRC,4CAAiC,CAAA,gBAAA,CAAiB,KAAK,YAAY,CAAA;AAErE,IAAA,IAAA,CAAK,OAAO,OAAQ,CAAA,IAAA;AAAA;AACtB,EAEA,SAAS,GAAa,EAAA;AACp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AA,YAClC,MAAQ,EAAA;AAAA,WACR,CAAA,CAAA;AAAA,SACH;AAAA,OACL;AAEA,MAAA,OAAO,EAAE,QAAA,EAAU,MAAO,CAAA,IAAA,EAAO,EAAA;AAAA;AAEnC,IAAO,OAAA,EAAE,QAAU,EAAA,EAAG,EAAA;AAAA;AAE1B;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
2
|
-
import {
|
|
2
|
+
import { AuthService, LoggerService, SchedulerServiceTaskRunner, SchedulerService } from '@backstage/backend-plugin-api';
|
|
3
3
|
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
4
4
|
import { Entity, UserEntity } from '@backstage/catalog-model';
|
|
5
|
-
import { CatalogApi } from '@backstage/catalog-client';
|
|
6
5
|
import { GithubCredentialsProvider, ScmIntegrationRegistry, GithubIntegrationConfig } from '@backstage/integration';
|
|
7
|
-
import { ScmLocationAnalyzer, AnalyzeOptions, CatalogProcessor, LocationSpec, CatalogProcessorEmit, EntityProvider, EntityProviderConnection } from '@backstage/plugin-catalog-node';
|
|
8
|
-
import { TokenManager } from '@backstage/backend-common';
|
|
6
|
+
import { CatalogService, ScmLocationAnalyzer, AnalyzeOptions, CatalogProcessor, LocationSpec, CatalogProcessorEmit, EntityProvider, EntityProviderConnection } from '@backstage/plugin-catalog-node';
|
|
9
7
|
import { Config } from '@backstage/config';
|
|
10
8
|
import { graphql } from '@octokit/graphql';
|
|
11
9
|
import { EventSubscriber, EventsService, EventParams } from '@backstage/plugin-events-node';
|
|
@@ -20,11 +18,9 @@ declare const githubCatalogModule: _backstage_backend_plugin_api.BackendFeature;
|
|
|
20
18
|
/** @public */
|
|
21
19
|
type GithubLocationAnalyzerOptions = {
|
|
22
20
|
config: Config;
|
|
23
|
-
|
|
24
|
-
tokenManager?: TokenManager;
|
|
25
|
-
auth?: AuthService;
|
|
21
|
+
auth: AuthService;
|
|
26
22
|
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
27
|
-
catalog
|
|
23
|
+
catalog: CatalogService;
|
|
28
24
|
};
|
|
29
25
|
/** @public */
|
|
30
26
|
declare class GithubLocationAnalyzer implements ScmLocationAnalyzer {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
4
4
|
var alpha = require('@backstage/plugin-catalog-node/alpha');
|
|
5
|
+
var pluginCatalogNode = require('@backstage/plugin-catalog-node');
|
|
5
6
|
var pluginEventsNode = require('@backstage/plugin-events-node');
|
|
6
7
|
var GithubEntityProvider = require('../providers/GithubEntityProvider.cjs.js');
|
|
7
8
|
var GithubLocationAnalyzer = require('../analyzers/GithubLocationAnalyzer.cjs.js');
|
|
@@ -16,11 +17,10 @@ const githubCatalogModule = backendPluginApi.createBackendModule({
|
|
|
16
17
|
auth: backendPluginApi.coreServices.auth,
|
|
17
18
|
catalogProcessing: alpha.catalogProcessingExtensionPoint,
|
|
18
19
|
config: backendPluginApi.coreServices.rootConfig,
|
|
19
|
-
discovery: backendPluginApi.coreServices.discovery,
|
|
20
20
|
events: pluginEventsNode.eventsServiceRef,
|
|
21
21
|
logger: backendPluginApi.coreServices.logger,
|
|
22
22
|
scheduler: backendPluginApi.coreServices.scheduler,
|
|
23
|
-
catalog:
|
|
23
|
+
catalog: pluginCatalogNode.catalogServiceRef
|
|
24
24
|
},
|
|
25
25
|
async init({
|
|
26
26
|
catalogProcessing,
|
|
@@ -29,13 +29,11 @@ const githubCatalogModule = backendPluginApi.createBackendModule({
|
|
|
29
29
|
logger,
|
|
30
30
|
scheduler,
|
|
31
31
|
catalogAnalyzers,
|
|
32
|
-
discovery,
|
|
33
32
|
auth,
|
|
34
33
|
catalog
|
|
35
34
|
}) {
|
|
36
35
|
catalogAnalyzers.addScmLocationAnalyzer(
|
|
37
36
|
new GithubLocationAnalyzer.GithubLocationAnalyzer({
|
|
38
|
-
discovery,
|
|
39
37
|
config,
|
|
40
38
|
auth,
|
|
41
39
|
catalog
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubCatalogModule.cjs.js","sources":["../../src/module/githubCatalogModule.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 coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport {\n catalogAnalysisExtensionPoint,\n catalogProcessingExtensionPoint,\n
|
|
1
|
+
{"version":3,"file":"githubCatalogModule.cjs.js","sources":["../../src/module/githubCatalogModule.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 coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport {\n catalogAnalysisExtensionPoint,\n catalogProcessingExtensionPoint,\n} from '@backstage/plugin-catalog-node/alpha';\nimport { catalogServiceRef } from '@backstage/plugin-catalog-node';\nimport { eventsServiceRef } from '@backstage/plugin-events-node';\nimport { GithubEntityProvider } from '../providers/GithubEntityProvider';\nimport { GithubLocationAnalyzer } from '../analyzers/GithubLocationAnalyzer';\n\n/**\n * Registers the `GithubEntityProvider` with the catalog processing extension point.\n *\n * @public\n */\nexport const githubCatalogModule = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'github',\n register(env) {\n env.registerInit({\n deps: {\n catalogAnalyzers: catalogAnalysisExtensionPoint,\n auth: coreServices.auth,\n catalogProcessing: catalogProcessingExtensionPoint,\n config: coreServices.rootConfig,\n events: eventsServiceRef,\n logger: coreServices.logger,\n scheduler: coreServices.scheduler,\n catalog: catalogServiceRef,\n },\n async init({\n catalogProcessing,\n config,\n events,\n logger,\n scheduler,\n catalogAnalyzers,\n auth,\n catalog,\n }) {\n catalogAnalyzers.addScmLocationAnalyzer(\n new GithubLocationAnalyzer({\n config,\n auth,\n catalog,\n }),\n );\n\n catalogProcessing.addEntityProvider(\n GithubEntityProvider.fromConfig(config, {\n events,\n logger,\n scheduler,\n }),\n );\n },\n });\n },\n});\n"],"names":["createBackendModule","catalogAnalysisExtensionPoint","coreServices","catalogProcessingExtensionPoint","eventsServiceRef","catalogServiceRef","GithubLocationAnalyzer","GithubEntityProvider"],"mappings":";;;;;;;;;AAkCO,MAAM,sBAAsBA,oCAAoB,CAAA;AAAA,EACrD,QAAU,EAAA,SAAA;AAAA,EACV,QAAU,EAAA,QAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,gBAAkB,EAAAC,mCAAA;AAAA,QAClB,MAAMC,6BAAa,CAAA,IAAA;AAAA,QACnB,iBAAmB,EAAAC,qCAAA;AAAA,QACnB,QAAQD,6BAAa,CAAA,UAAA;AAAA,QACrB,MAAQ,EAAAE,iCAAA;AAAA,QACR,QAAQF,6BAAa,CAAA,MAAA;AAAA,QACrB,WAAWA,6BAAa,CAAA,SAAA;AAAA,QACxB,OAAS,EAAAG;AAAA,OACX;AAAA,MACA,MAAM,IAAK,CAAA;AAAA,QACT,iBAAA;AAAA,QACA,MAAA;AAAA,QACA,MAAA;AAAA,QACA,MAAA;AAAA,QACA,SAAA;AAAA,QACA,gBAAA;AAAA,QACA,IAAA;AAAA,QACA;AAAA,OACC,EAAA;AACD,QAAiB,gBAAA,CAAA,sBAAA;AAAA,UACf,IAAIC,6CAAuB,CAAA;AAAA,YACzB,MAAA;AAAA,YACA,IAAA;AAAA,YACA;AAAA,WACD;AAAA,SACH;AAEA,QAAkB,iBAAA,CAAA,iBAAA;AAAA,UAChBC,yCAAA,CAAqB,WAAW,MAAQ,EAAA;AAAA,YACtC,MAAA;AAAA,YACA,MAAA;AAAA,YACA;AAAA,WACD;AAAA,SACH;AAAA;AACF,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-backend-module-github",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-next.1",
|
|
4
4
|
"description": "A Backstage catalog backend module that helps integrate towards GitHub",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -65,16 +65,15 @@
|
|
|
65
65
|
"test": "backstage-cli package test"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@backstage/backend-
|
|
69
|
-
"@backstage/
|
|
70
|
-
"@backstage/catalog-
|
|
71
|
-
"@backstage/
|
|
72
|
-
"@backstage/
|
|
73
|
-
"@backstage/
|
|
74
|
-
"@backstage/plugin-catalog-
|
|
75
|
-
"@backstage/plugin-catalog-
|
|
76
|
-
"@backstage/plugin-
|
|
77
|
-
"@backstage/plugin-events-node": "^0.4.10",
|
|
68
|
+
"@backstage/backend-plugin-api": "1.3.1-next.1",
|
|
69
|
+
"@backstage/catalog-client": "1.10.0-next.0",
|
|
70
|
+
"@backstage/catalog-model": "1.7.3",
|
|
71
|
+
"@backstage/config": "1.3.2",
|
|
72
|
+
"@backstage/integration": "1.16.4-next.1",
|
|
73
|
+
"@backstage/plugin-catalog-backend": "2.0.0-next.1",
|
|
74
|
+
"@backstage/plugin-catalog-common": "1.1.4-next.0",
|
|
75
|
+
"@backstage/plugin-catalog-node": "1.17.0-next.1",
|
|
76
|
+
"@backstage/plugin-events-node": "0.4.11-next.1",
|
|
78
77
|
"@octokit/core": "^5.2.0",
|
|
79
78
|
"@octokit/graphql": "^7.0.2",
|
|
80
79
|
"@octokit/plugin-throttling": "^8.1.3",
|
|
@@ -85,8 +84,8 @@
|
|
|
85
84
|
"uuid": "^11.0.0"
|
|
86
85
|
},
|
|
87
86
|
"devDependencies": {
|
|
88
|
-
"@backstage/backend-test-utils": "
|
|
89
|
-
"@backstage/cli": "
|
|
87
|
+
"@backstage/backend-test-utils": "1.5.0-next.1",
|
|
88
|
+
"@backstage/cli": "0.32.1-next.1",
|
|
90
89
|
"@types/lodash": "^4.14.151",
|
|
91
90
|
"luxon": "^3.0.0",
|
|
92
91
|
"msw": "^2.0.0"
|