@backstage/plugin-catalog-backend-module-azure 0.1.4-next.1 → 0.1.5-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +157 -0
- package/config.d.ts +59 -0
- package/dist/index.cjs.js +126 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +31 -2
- package/package.json +13 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,162 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-backend-module-azure
|
|
2
2
|
|
|
3
|
+
## 0.1.5-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/backend-common@0.14.1-next.0
|
|
9
|
+
- @backstage/catalog-model@1.1.0-next.0
|
|
10
|
+
- @backstage/integration@1.2.2-next.0
|
|
11
|
+
- @backstage/backend-tasks@0.3.3-next.0
|
|
12
|
+
- @backstage/plugin-catalog-backend@1.2.1-next.0
|
|
13
|
+
|
|
14
|
+
## 0.1.4
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- b8884fd579: Add a new provider `AzureDevOpsEntityProvider` as replacement for `AzureDevOpsDiscoveryProcessor`.
|
|
19
|
+
|
|
20
|
+
In order to migrate from the `AzureDevOpsDiscoveryProcessor` you need to apply
|
|
21
|
+
the following changes:
|
|
22
|
+
|
|
23
|
+
**Before:**
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
# app-config.yaml
|
|
27
|
+
|
|
28
|
+
catalog:
|
|
29
|
+
locations:
|
|
30
|
+
- type: azure-discovery
|
|
31
|
+
target: https://dev.azure.com/myorg/myproject/_git/service-*?path=/catalog-info.yaml
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
/* packages/backend/src/plugins/catalog.ts */
|
|
36
|
+
|
|
37
|
+
import { AzureDevOpsDiscoveryProcessor } from '@backstage/plugin-catalog-backend-module-azure';
|
|
38
|
+
|
|
39
|
+
const builder = await CatalogBuilder.create(env);
|
|
40
|
+
/** ... other processors ... */
|
|
41
|
+
builder.addProcessor(new AzureDevOpsDiscoveryProcessor(env.reader));
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**After:**
|
|
45
|
+
|
|
46
|
+
```yaml
|
|
47
|
+
# app-config.yaml
|
|
48
|
+
|
|
49
|
+
catalog:
|
|
50
|
+
providers:
|
|
51
|
+
azureDevOps:
|
|
52
|
+
anyProviderId:
|
|
53
|
+
host: selfhostedazure.yourcompany.com # This is only really needed for on-premise user, defaults to dev.azure.com
|
|
54
|
+
organization: myorg # For on-premise this would be your Collection
|
|
55
|
+
project: myproject
|
|
56
|
+
repository: service-*
|
|
57
|
+
path: /catalog-info.yaml
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
/* packages/backend/src/plugins/catalog.ts */
|
|
62
|
+
|
|
63
|
+
import { AzureDevOpsEntityProvider } from '@backstage/plugin-catalog-backend-module-azure';
|
|
64
|
+
|
|
65
|
+
const builder = await CatalogBuilder.create(env);
|
|
66
|
+
/** ... other processors and/or providers ... */
|
|
67
|
+
builder.addEntityProvider(
|
|
68
|
+
AzureDevOpsEntityProvider.fromConfig(env.config, {
|
|
69
|
+
logger: env.logger,
|
|
70
|
+
schedule: env.scheduler.createScheduledTaskRunner({
|
|
71
|
+
frequency: { minutes: 30 },
|
|
72
|
+
timeout: { minutes: 3 },
|
|
73
|
+
}),
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Visit [https://backstage.io/docs/integrations/azure/discovery](https://backstage.io/docs/integrations/azure/discovery) for more details and options on configuration.
|
|
79
|
+
|
|
80
|
+
- 8f7b1835df: Updated dependency `msw` to `^0.41.0`.
|
|
81
|
+
- Updated dependencies
|
|
82
|
+
- @backstage/plugin-catalog-backend@1.2.0
|
|
83
|
+
- @backstage/backend-tasks@0.3.2
|
|
84
|
+
- @backstage/backend-common@0.14.0
|
|
85
|
+
- @backstage/integration@1.2.1
|
|
86
|
+
- @backstage/catalog-model@1.0.3
|
|
87
|
+
|
|
88
|
+
## 0.1.4-next.2
|
|
89
|
+
|
|
90
|
+
### Patch Changes
|
|
91
|
+
|
|
92
|
+
- b8884fd579: Add a new provider `AzureDevOpsEntityProvider` as replacement for `AzureDevOpsDiscoveryProcessor`.
|
|
93
|
+
|
|
94
|
+
In order to migrate from the `AzureDevOpsDiscoveryProcessor` you need to apply
|
|
95
|
+
the following changes:
|
|
96
|
+
|
|
97
|
+
**Before:**
|
|
98
|
+
|
|
99
|
+
```yaml
|
|
100
|
+
# app-config.yaml
|
|
101
|
+
|
|
102
|
+
catalog:
|
|
103
|
+
locations:
|
|
104
|
+
- type: azure-discovery
|
|
105
|
+
target: https://dev.azure.com/myorg/myproject/_git/service-*?path=/catalog-info.yaml
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
/* packages/backend/src/plugins/catalog.ts */
|
|
110
|
+
|
|
111
|
+
import { AzureDevOpsDiscoveryProcessor } from '@backstage/plugin-catalog-backend-module-azure';
|
|
112
|
+
|
|
113
|
+
const builder = await CatalogBuilder.create(env);
|
|
114
|
+
/** ... other processors ... */
|
|
115
|
+
builder.addProcessor(new AzureDevOpsDiscoveryProcessor(env.reader));
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**After:**
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
# app-config.yaml
|
|
122
|
+
|
|
123
|
+
catalog:
|
|
124
|
+
providers:
|
|
125
|
+
azureDevOps:
|
|
126
|
+
anyProviderId:
|
|
127
|
+
host: selfhostedazure.yourcompany.com # This is only really needed for on-premise user, defaults to dev.azure.com
|
|
128
|
+
organization: myorg # For on-premise this would be your Collection
|
|
129
|
+
project: myproject
|
|
130
|
+
repository: service-*
|
|
131
|
+
path: /catalog-info.yaml
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
/* packages/backend/src/plugins/catalog.ts */
|
|
136
|
+
|
|
137
|
+
import { AzureDevOpsEntityProvider } from '@backstage/plugin-catalog-backend-module-azure';
|
|
138
|
+
|
|
139
|
+
const builder = await CatalogBuilder.create(env);
|
|
140
|
+
/** ... other processors and/or providers ... */
|
|
141
|
+
builder.addEntityProvider(
|
|
142
|
+
AzureDevOpsEntityProvider.fromConfig(env.config, {
|
|
143
|
+
logger: env.logger,
|
|
144
|
+
schedule: env.scheduler.createScheduledTaskRunner({
|
|
145
|
+
frequency: { minutes: 30 },
|
|
146
|
+
timeout: { minutes: 3 },
|
|
147
|
+
}),
|
|
148
|
+
}),
|
|
149
|
+
);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Visit [https://backstage.io/docs/integrations/azure/discovery](https://backstage.io/docs/integrations/azure/discovery) for more details and options on configuration.
|
|
153
|
+
|
|
154
|
+
- Updated dependencies
|
|
155
|
+
- @backstage/backend-common@0.14.0-next.2
|
|
156
|
+
- @backstage/integration@1.2.1-next.2
|
|
157
|
+
- @backstage/backend-tasks@0.3.2-next.2
|
|
158
|
+
- @backstage/plugin-catalog-backend@1.2.0-next.2
|
|
159
|
+
|
|
3
160
|
## 0.1.4-next.1
|
|
4
161
|
|
|
5
162
|
### Patch Changes
|
package/config.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020 The Backstage Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface AzureDevOpsConfig {
|
|
18
|
+
/**
|
|
19
|
+
* (Optional) The DevOps host; leave empty for `dev.azure.com`, otherwise set to your self-hosted instance host.
|
|
20
|
+
* @visibility backend
|
|
21
|
+
*/
|
|
22
|
+
host: string;
|
|
23
|
+
/**
|
|
24
|
+
* (Required) Your organization slug.
|
|
25
|
+
* @visibility backend
|
|
26
|
+
*/
|
|
27
|
+
organization: string;
|
|
28
|
+
/**
|
|
29
|
+
* (Required) Your project slug.
|
|
30
|
+
* @visibility backend
|
|
31
|
+
*/
|
|
32
|
+
project: string;
|
|
33
|
+
/**
|
|
34
|
+
* (Optional) The repository name. Wildcards are supported as show on the examples above.
|
|
35
|
+
* If not set, all repositories will be searched.
|
|
36
|
+
* @visibility backend
|
|
37
|
+
*/
|
|
38
|
+
repository?: string;
|
|
39
|
+
/**
|
|
40
|
+
* (Optional) Where to find catalog-info.yaml files. Wildcards are supported.
|
|
41
|
+
* If not set, defaults to /catalog-info.yaml.
|
|
42
|
+
* @visibility backend
|
|
43
|
+
*/
|
|
44
|
+
path?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface Config {
|
|
48
|
+
catalog?: {
|
|
49
|
+
/**
|
|
50
|
+
* List of provider-specific options and attributes
|
|
51
|
+
*/
|
|
52
|
+
providers?: {
|
|
53
|
+
/**
|
|
54
|
+
* AzureDevopsEntityProvider configuration
|
|
55
|
+
*/
|
|
56
|
+
azureDevOps?: Record<string, AzureDevOpsConfig>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -5,10 +5,30 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var integration = require('@backstage/integration');
|
|
6
6
|
var pluginCatalogBackend = require('@backstage/plugin-catalog-backend');
|
|
7
7
|
var fetch = require('node-fetch');
|
|
8
|
+
var uuid = require('uuid');
|
|
8
9
|
|
|
9
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
11
|
|
|
12
|
+
function _interopNamespace(e) {
|
|
13
|
+
if (e && e.__esModule) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n["default"] = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
11
30
|
var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch);
|
|
31
|
+
var uuid__namespace = /*#__PURE__*/_interopNamespace(uuid);
|
|
12
32
|
|
|
13
33
|
const isCloud = (host) => host === "dev.azure.com";
|
|
14
34
|
const PAGE_SIZE = 1e3;
|
|
@@ -101,5 +121,111 @@ function parseUrl(urlString) {
|
|
|
101
121
|
throw new Error(`Failed to parse ${urlString}`);
|
|
102
122
|
}
|
|
103
123
|
|
|
124
|
+
function readAzureDevOpsConfigs(config) {
|
|
125
|
+
const configs = [];
|
|
126
|
+
const providerConfigs = config.getOptionalConfig("catalog.providers.azureDevOps");
|
|
127
|
+
if (!providerConfigs) {
|
|
128
|
+
return configs;
|
|
129
|
+
}
|
|
130
|
+
for (const id of providerConfigs.keys()) {
|
|
131
|
+
configs.push(readAzureDevOpsConfig(id, providerConfigs.getConfig(id)));
|
|
132
|
+
}
|
|
133
|
+
return configs;
|
|
134
|
+
}
|
|
135
|
+
function readAzureDevOpsConfig(id, config) {
|
|
136
|
+
const organization = config.getString("organization");
|
|
137
|
+
const project = config.getString("project");
|
|
138
|
+
const host = config.getOptionalString("host") || "dev.azure.com";
|
|
139
|
+
const repository = config.getOptionalString("repository") || "*";
|
|
140
|
+
const path = config.getOptionalString("path") || "/catalog-info.yaml";
|
|
141
|
+
return {
|
|
142
|
+
id,
|
|
143
|
+
host,
|
|
144
|
+
organization,
|
|
145
|
+
project,
|
|
146
|
+
repository,
|
|
147
|
+
path
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
class AzureDevOpsEntityProvider {
|
|
152
|
+
constructor(config, integration, logger, schedule) {
|
|
153
|
+
this.config = config;
|
|
154
|
+
this.integration = integration;
|
|
155
|
+
this.logger = logger.child({
|
|
156
|
+
target: this.getProviderName()
|
|
157
|
+
});
|
|
158
|
+
this.scheduleFn = this.createScheduleFn(schedule);
|
|
159
|
+
}
|
|
160
|
+
static fromConfig(configRoot, options) {
|
|
161
|
+
const providerConfigs = readAzureDevOpsConfigs(configRoot);
|
|
162
|
+
return providerConfigs.map((providerConfig) => {
|
|
163
|
+
const integration$1 = integration.ScmIntegrations.fromConfig(configRoot).azure.byHost(providerConfig.host);
|
|
164
|
+
if (!integration$1) {
|
|
165
|
+
throw new Error(`There is no Azure integration for host ${providerConfig.host}. Please add a configuration entry for it under integrations.azure`);
|
|
166
|
+
}
|
|
167
|
+
return new AzureDevOpsEntityProvider(providerConfig, integration$1, options.logger, options.schedule);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
createScheduleFn(schedule) {
|
|
171
|
+
return async () => {
|
|
172
|
+
const taskId = `${this.getProviderName()}:refresh`;
|
|
173
|
+
return schedule.run({
|
|
174
|
+
id: taskId,
|
|
175
|
+
fn: async () => {
|
|
176
|
+
const logger = this.logger.child({
|
|
177
|
+
class: AzureDevOpsEntityProvider.prototype.constructor.name,
|
|
178
|
+
taskId,
|
|
179
|
+
taskInstanceId: uuid__namespace.v4()
|
|
180
|
+
});
|
|
181
|
+
try {
|
|
182
|
+
await this.refresh(logger);
|
|
183
|
+
} catch (error) {
|
|
184
|
+
logger.error(error);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
getProviderName() {
|
|
191
|
+
return `AzureDevOpsEntityProvider:${this.config.id}`;
|
|
192
|
+
}
|
|
193
|
+
async connect(connection) {
|
|
194
|
+
this.connection = connection;
|
|
195
|
+
await this.scheduleFn();
|
|
196
|
+
}
|
|
197
|
+
async refresh(logger) {
|
|
198
|
+
if (!this.connection) {
|
|
199
|
+
throw new Error("Not initialized");
|
|
200
|
+
}
|
|
201
|
+
logger.info("Discovering Azure DevOps catalog files");
|
|
202
|
+
const files = await codeSearch(this.integration.config, this.config.organization, this.config.project, this.config.repository, this.config.path);
|
|
203
|
+
logger.info(`Discovered ${files.length} catalog files`);
|
|
204
|
+
const locations = files.map((key) => this.createLocationSpec(key));
|
|
205
|
+
await this.connection.applyMutation({
|
|
206
|
+
type: "full",
|
|
207
|
+
entities: locations.map((location) => {
|
|
208
|
+
return {
|
|
209
|
+
locationKey: this.getProviderName(),
|
|
210
|
+
entity: pluginCatalogBackend.locationSpecToLocationEntity({ location })
|
|
211
|
+
};
|
|
212
|
+
})
|
|
213
|
+
});
|
|
214
|
+
logger.info(`Committed ${locations.length} locations for AzureDevOps catalog files`);
|
|
215
|
+
}
|
|
216
|
+
createLocationSpec(file) {
|
|
217
|
+
return {
|
|
218
|
+
type: "url",
|
|
219
|
+
target: this.createObjectUrl(file),
|
|
220
|
+
presence: "required"
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
createObjectUrl(file) {
|
|
224
|
+
const baseUrl = `https://${this.config.host}/${this.config.organization}/${this.config.project}`;
|
|
225
|
+
return encodeURI(`${baseUrl}/_git/${file.repository.name}?path=${file.path}`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
104
229
|
exports.AzureDevOpsDiscoveryProcessor = AzureDevOpsDiscoveryProcessor;
|
|
230
|
+
exports.AzureDevOpsEntityProvider = AzureDevOpsEntityProvider;
|
|
105
231
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/lib/azure.ts","../src/AzureDevOpsDiscoveryProcessor.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 fetch from 'node-fetch';\nimport {\n AzureIntegrationConfig,\n getAzureRequestOptions,\n} from '@backstage/integration';\n\nexport interface CodeSearchResponse {\n count: number;\n results: CodeSearchResultItem[];\n}\n\nexport interface CodeSearchResultItem {\n fileName: string;\n path: string;\n repository: {\n name: string;\n };\n}\n\nconst isCloud = (host: string) => host === 'dev.azure.com';\nconst PAGE_SIZE = 1000;\n\n// codeSearch returns all files that matches the given search path.\nexport async function codeSearch(\n azureConfig: AzureIntegrationConfig,\n org: string,\n project: string,\n repo: string,\n path: string,\n): Promise<CodeSearchResultItem[]> {\n const searchBaseUrl = isCloud(azureConfig.host)\n ? 'https://almsearch.dev.azure.com'\n : `https://${azureConfig.host}`;\n const searchUrl = `${searchBaseUrl}/${org}/${project}/_apis/search/codesearchresults?api-version=6.0-preview.1`;\n\n let items: CodeSearchResultItem[] = [];\n let hasMorePages = true;\n\n do {\n const response = await fetch(searchUrl, {\n ...getAzureRequestOptions(azureConfig, {\n 'Content-Type': 'application/json',\n }),\n method: 'POST',\n body: JSON.stringify({\n searchText: `path:${path} repo:${repo || '*'}`,\n $skip: items.length,\n $top: PAGE_SIZE,\n }),\n });\n\n if (response.status !== 200) {\n throw new Error(\n `Azure DevOps search failed with response status ${response.status}`,\n );\n }\n\n const body: CodeSearchResponse = await response.json();\n items = [...items, ...body.results];\n hasMorePages = body.count > items.length;\n } while (hasMorePages);\n\n return items;\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 { Config } from '@backstage/config';\nimport {\n ScmIntegrationRegistry,\n ScmIntegrations,\n} from '@backstage/integration';\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n LocationSpec,\n processingResult,\n} from '@backstage/plugin-catalog-backend';\nimport { Logger } from 'winston';\nimport { codeSearch } from './lib';\n\n/**\n * Extracts repositories out of an Azure DevOps org.\n *\n * The following will create locations for all projects which have a catalog-info.yaml\n * on the default branch. The first is shorthand for the second.\n *\n * target: \"https://dev.azure.com/org/project\"\n * or\n * target: https://dev.azure.com/org/project?path=/catalog-info.yaml\n *\n * You may also explicitly specify a single repo:\n *\n * target: https://dev.azure.com/org/project/_git/repo\n *\n * @public\n **/\nexport class AzureDevOpsDiscoveryProcessor implements CatalogProcessor {\n private readonly integrations: ScmIntegrationRegistry;\n private readonly logger: Logger;\n\n static fromConfig(config: Config, options: { logger: Logger }) {\n const integrations = ScmIntegrations.fromConfig(config);\n\n return new AzureDevOpsDiscoveryProcessor({\n ...options,\n integrations,\n });\n }\n\n constructor(options: {\n integrations: ScmIntegrationRegistry;\n logger: Logger;\n }) {\n this.integrations = options.integrations;\n this.logger = options.logger;\n }\n\n getProcessorName(): string {\n return 'AzureDevOpsDiscoveryProcessor';\n }\n\n async readLocation(\n location: LocationSpec,\n _optional: boolean,\n emit: CatalogProcessorEmit,\n ): Promise<boolean> {\n if (location.type !== 'azure-discovery') {\n return false;\n }\n\n const azureConfig = this.integrations.azure.byUrl(location.target)?.config;\n if (!azureConfig) {\n throw new Error(\n `There is no Azure integration that matches ${location.target}. Please add a configuration entry for it under integrations.azure`,\n );\n }\n\n const { baseUrl, org, project, repo, catalogPath } = parseUrl(\n location.target,\n );\n this.logger.info(\n `Reading Azure DevOps repositories from ${location.target}`,\n );\n\n const files = await codeSearch(\n azureConfig,\n org,\n project,\n repo,\n catalogPath,\n );\n\n this.logger.debug(\n `Found ${files.length} files in Azure DevOps from ${location.target}.`,\n );\n\n for (const file of files) {\n emit(\n processingResult.location({\n type: 'url',\n target: `${baseUrl}/${org}/${project}/_git/${file.repository.name}?path=${file.path}`,\n // Not all locations may actually exist, since the user defined them as a wildcard pattern.\n // Thus, we emit them as optional and let the downstream processor find them while not outputting\n // an error if it couldn't.\n presence: 'optional',\n }),\n );\n }\n\n return true;\n }\n}\n\n/**\n * parseUrl extracts segments from the Azure DevOps URL.\n **/\nexport function parseUrl(urlString: string): {\n baseUrl: string;\n org: string;\n project: string;\n repo: string;\n catalogPath: string;\n} {\n const url = new URL(urlString);\n const path = url.pathname.substr(1).split('/');\n\n const catalogPath = url.searchParams.get('path') || '/catalog-info.yaml';\n\n if (path.length === 2 && path[0].length && path[1].length) {\n return {\n baseUrl: url.origin,\n org: decodeURIComponent(path[0]),\n project: decodeURIComponent(path[1]),\n repo: '',\n catalogPath,\n };\n } else if (\n path.length === 4 &&\n path[0].length &&\n path[1].length &&\n path[2].length &&\n path[3].length\n ) {\n return {\n baseUrl: url.origin,\n org: decodeURIComponent(path[0]),\n project: decodeURIComponent(path[1]),\n repo: decodeURIComponent(path[3]),\n catalogPath,\n };\n }\n\n throw new Error(`Failed to parse ${urlString}`);\n}\n"],"names":["fetch","getAzureRequestOptions","ScmIntegrations","processingResult"],"mappings":";;;;;;;;;;;;AAIA,MAAM,OAAO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AM,WAAW,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,oBAAoB,CAAC;AAC3E,EAAE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;AAC7D,IAAI,OAAO;AACX,MAAM,OAAO,EAAE,GAAG,CAAC,MAAM;AACzB,MAAM,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,OAAO,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1C,MAAM,IAAI,EAAE,EAAE;AACd,MAAM,WAAW;AACjB,KAAK,CAAC;AACN,GAAG,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;AACxG,IAAI,OAAO;AACX,MAAM,OAAO,EAAE,GAAG,CAAC,MAAM;AACzB,MAAM,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,OAAO,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1C,MAAM,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACvC,MAAM,WAAW;AACjB,KAAK,CAAC;AACN,GAAG;AACH,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAClD;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/lib/azure.ts","../src/processors/AzureDevOpsDiscoveryProcessor.ts","../src/providers/config.ts","../src/providers/AzureDevOpsEntityProvider.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 fetch from 'node-fetch';\nimport {\n AzureIntegrationConfig,\n getAzureRequestOptions,\n} from '@backstage/integration';\n\nexport interface CodeSearchResponse {\n count: number;\n results: CodeSearchResultItem[];\n}\n\nexport interface CodeSearchResultItem {\n fileName: string;\n path: string;\n repository: {\n name: string;\n };\n}\n\nconst isCloud = (host: string) => host === 'dev.azure.com';\nconst PAGE_SIZE = 1000;\n\n// codeSearch returns all files that matches the given search path.\nexport async function codeSearch(\n azureConfig: AzureIntegrationConfig,\n org: string,\n project: string,\n repo: string,\n path: string,\n): Promise<CodeSearchResultItem[]> {\n const searchBaseUrl = isCloud(azureConfig.host)\n ? 'https://almsearch.dev.azure.com'\n : `https://${azureConfig.host}`;\n const searchUrl = `${searchBaseUrl}/${org}/${project}/_apis/search/codesearchresults?api-version=6.0-preview.1`;\n\n let items: CodeSearchResultItem[] = [];\n let hasMorePages = true;\n\n do {\n const response = await fetch(searchUrl, {\n ...getAzureRequestOptions(azureConfig, {\n 'Content-Type': 'application/json',\n }),\n method: 'POST',\n body: JSON.stringify({\n searchText: `path:${path} repo:${repo || '*'}`,\n $skip: items.length,\n $top: PAGE_SIZE,\n }),\n });\n\n if (response.status !== 200) {\n throw new Error(\n `Azure DevOps search failed with response status ${response.status}`,\n );\n }\n\n const body: CodeSearchResponse = await response.json();\n items = [...items, ...body.results];\n hasMorePages = body.count > items.length;\n } while (hasMorePages);\n\n return items;\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 { Config } from '@backstage/config';\nimport {\n ScmIntegrationRegistry,\n ScmIntegrations,\n} from '@backstage/integration';\nimport {\n CatalogProcessor,\n CatalogProcessorEmit,\n LocationSpec,\n processingResult,\n} from '@backstage/plugin-catalog-backend';\nimport { Logger } from 'winston';\nimport { codeSearch } from '../lib';\n\n/**\n * Extracts repositories out of an Azure DevOps org.\n *\n * The following will create locations for all projects which have a catalog-info.yaml\n * on the default branch. The first is shorthand for the second.\n *\n * target: \"https://dev.azure.com/org/project\"\n * or\n * target: https://dev.azure.com/org/project?path=/catalog-info.yaml\n *\n * You may also explicitly specify a single repo:\n *\n * target: https://dev.azure.com/org/project/_git/repo\n *\n * @public\n **/\nexport class AzureDevOpsDiscoveryProcessor implements CatalogProcessor {\n private readonly integrations: ScmIntegrationRegistry;\n private readonly logger: Logger;\n\n static fromConfig(config: Config, options: { logger: Logger }) {\n const integrations = ScmIntegrations.fromConfig(config);\n\n return new AzureDevOpsDiscoveryProcessor({\n ...options,\n integrations,\n });\n }\n\n constructor(options: {\n integrations: ScmIntegrationRegistry;\n logger: Logger;\n }) {\n this.integrations = options.integrations;\n this.logger = options.logger;\n }\n\n getProcessorName(): string {\n return 'AzureDevOpsDiscoveryProcessor';\n }\n\n async readLocation(\n location: LocationSpec,\n _optional: boolean,\n emit: CatalogProcessorEmit,\n ): Promise<boolean> {\n if (location.type !== 'azure-discovery') {\n return false;\n }\n\n const azureConfig = this.integrations.azure.byUrl(location.target)?.config;\n if (!azureConfig) {\n throw new Error(\n `There is no Azure integration that matches ${location.target}. Please add a configuration entry for it under integrations.azure`,\n );\n }\n\n const { baseUrl, org, project, repo, catalogPath } = parseUrl(\n location.target,\n );\n this.logger.info(\n `Reading Azure DevOps repositories from ${location.target}`,\n );\n\n const files = await codeSearch(\n azureConfig,\n org,\n project,\n repo,\n catalogPath,\n );\n\n this.logger.debug(\n `Found ${files.length} files in Azure DevOps from ${location.target}.`,\n );\n\n for (const file of files) {\n emit(\n processingResult.location({\n type: 'url',\n target: `${baseUrl}/${org}/${project}/_git/${file.repository.name}?path=${file.path}`,\n // Not all locations may actually exist, since the user defined them as a wildcard pattern.\n // Thus, we emit them as optional and let the downstream processor find them while not outputting\n // an error if it couldn't.\n presence: 'optional',\n }),\n );\n }\n\n return true;\n }\n}\n\n/**\n * parseUrl extracts segments from the Azure DevOps URL.\n **/\nexport function parseUrl(urlString: string): {\n baseUrl: string;\n org: string;\n project: string;\n repo: string;\n catalogPath: string;\n} {\n const url = new URL(urlString);\n const path = url.pathname.substr(1).split('/');\n\n const catalogPath = url.searchParams.get('path') || '/catalog-info.yaml';\n\n if (path.length === 2 && path[0].length && path[1].length) {\n return {\n baseUrl: url.origin,\n org: decodeURIComponent(path[0]),\n project: decodeURIComponent(path[1]),\n repo: '',\n catalogPath,\n };\n } else if (\n path.length === 4 &&\n path[0].length &&\n path[1].length &&\n path[2].length &&\n path[3].length\n ) {\n return {\n baseUrl: url.origin,\n org: decodeURIComponent(path[0]),\n project: decodeURIComponent(path[1]),\n repo: decodeURIComponent(path[3]),\n catalogPath,\n };\n }\n\n throw new Error(`Failed to parse ${urlString}`);\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 { Config } from '@backstage/config';\nimport { AzureDevOpsConfig } from './types';\n\nexport function readAzureDevOpsConfigs(config: Config): AzureDevOpsConfig[] {\n const configs: AzureDevOpsConfig[] = [];\n\n const providerConfigs = config.getOptionalConfig(\n 'catalog.providers.azureDevOps',\n );\n\n if (!providerConfigs) {\n return configs;\n }\n\n for (const id of providerConfigs.keys()) {\n configs.push(readAzureDevOpsConfig(id, providerConfigs.getConfig(id)));\n }\n\n return configs;\n}\n\nfunction readAzureDevOpsConfig(id: string, config: Config): AzureDevOpsConfig {\n const organization = config.getString('organization');\n const project = config.getString('project');\n const host = config.getOptionalString('host') || 'dev.azure.com';\n const repository = config.getOptionalString('repository') || '*';\n const path = config.getOptionalString('path') || '/catalog-info.yaml';\n\n return {\n id,\n host,\n organization,\n project,\n repository,\n path,\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 */\n\nimport { TaskRunner } from '@backstage/backend-tasks';\nimport { Config } from '@backstage/config';\nimport { AzureIntegration, ScmIntegrations } from '@backstage/integration';\nimport {\n EntityProvider,\n EntityProviderConnection,\n LocationSpec,\n locationSpecToLocationEntity,\n} from '@backstage/plugin-catalog-backend';\nimport { readAzureDevOpsConfigs } from './config';\nimport { Logger } from 'winston';\nimport { AzureDevOpsConfig } from './types';\nimport * as uuid from 'uuid';\nimport { codeSearch, CodeSearchResultItem } from '../lib';\n\n/**\n * Provider which discovers catalog files within an Azure DevOps repositories.\n *\n * Use `AzureDevOpsEntityProvider.fromConfig(...)` to create instances.\n *\n * @public\n */\nexport class AzureDevOpsEntityProvider implements EntityProvider {\n private readonly logger: Logger;\n private readonly scheduleFn: () => Promise<void>;\n private connection?: EntityProviderConnection;\n\n static fromConfig(\n configRoot: Config,\n options: {\n logger: Logger;\n schedule: TaskRunner;\n },\n ): AzureDevOpsEntityProvider[] {\n const providerConfigs = readAzureDevOpsConfigs(configRoot);\n\n return providerConfigs.map(providerConfig => {\n const integration = ScmIntegrations.fromConfig(configRoot).azure.byHost(\n providerConfig.host,\n );\n\n if (!integration) {\n throw new Error(\n `There is no Azure integration for host ${providerConfig.host}. Please add a configuration entry for it under integrations.azure`,\n );\n }\n\n return new AzureDevOpsEntityProvider(\n providerConfig,\n integration,\n options.logger,\n options.schedule,\n );\n });\n }\n\n private constructor(\n private readonly config: AzureDevOpsConfig,\n private readonly integration: AzureIntegration,\n logger: Logger,\n schedule: TaskRunner,\n ) {\n this.logger = logger.child({\n target: this.getProviderName(),\n });\n\n this.scheduleFn = this.createScheduleFn(schedule);\n }\n\n private createScheduleFn(schedule: TaskRunner): () => Promise<void> {\n return async () => {\n const taskId = `${this.getProviderName()}:refresh`;\n return schedule.run({\n id: taskId,\n fn: async () => {\n const logger = this.logger.child({\n class: AzureDevOpsEntityProvider.prototype.constructor.name,\n taskId,\n taskInstanceId: uuid.v4(),\n });\n\n try {\n await this.refresh(logger);\n } catch (error) {\n logger.error(error);\n }\n },\n });\n };\n }\n\n /** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.getProviderName} */\n getProviderName(): string {\n return `AzureDevOpsEntityProvider:${this.config.id}`;\n }\n\n /** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.connect} */\n async connect(connection: EntityProviderConnection): Promise<void> {\n this.connection = connection;\n await this.scheduleFn();\n }\n\n async refresh(logger: Logger) {\n if (!this.connection) {\n throw new Error('Not initialized');\n }\n\n logger.info('Discovering Azure DevOps catalog files');\n\n const files = await codeSearch(\n this.integration.config,\n this.config.organization,\n this.config.project,\n this.config.repository,\n this.config.path,\n );\n\n logger.info(`Discovered ${files.length} catalog files`);\n\n const locations = files.map(key => this.createLocationSpec(key));\n\n await this.connection.applyMutation({\n type: 'full',\n entities: locations.map(location => {\n return {\n locationKey: this.getProviderName(),\n entity: locationSpecToLocationEntity({ location }),\n };\n }),\n });\n\n logger.info(\n `Committed ${locations.length} locations for AzureDevOps catalog files`,\n );\n }\n\n private createLocationSpec(file: CodeSearchResultItem): LocationSpec {\n return {\n type: 'url',\n target: this.createObjectUrl(file),\n presence: 'required',\n };\n }\n\n private createObjectUrl(file: CodeSearchResultItem): string {\n const baseUrl = `https://${this.config.host}/${this.config.organization}/${this.config.project}`;\n return encodeURI(\n `${baseUrl}/_git/${file.repository.name}?path=${file.path}`,\n );\n }\n}\n"],"names":["fetch","getAzureRequestOptions","ScmIntegrations","processingResult","integration","uuid","locationSpecToLocationEntity"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,OAAO,GAAG,CAAC,IAAI,KAAK,IAAI,KAAK,eAAe,CAAC;AACnD,MAAM,SAAS,GAAG,GAAG,CAAC;AACf,eAAe,UAAU,CAAC,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;AACxE,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,iCAAiC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACtH,EAAE,MAAM,SAAS,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,yDAAyD,CAAC,CAAC;AAClH,EAAE,IAAI,KAAK,GAAG,EAAE,CAAC;AACjB,EAAE,IAAI,YAAY,GAAG,IAAI,CAAC;AAC1B,EAAE,GAAG;AACL,IAAI,MAAM,QAAQ,GAAG,MAAMA,yBAAK,CAAC,SAAS,EAAE;AAC5C,MAAM,GAAGC,kCAAsB,CAAC,WAAW,EAAE;AAC7C,QAAQ,cAAc,EAAE,kB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,CAAC,IAAI,EAAE;AACxB,IAAI,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AACrG,IAAI,OAAO,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClF,GAAG;AACH;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Config } from '@backstage/config';
|
|
2
2
|
import { ScmIntegrationRegistry } from '@backstage/integration';
|
|
3
|
-
import { CatalogProcessor, LocationSpec, CatalogProcessorEmit } from '@backstage/plugin-catalog-backend';
|
|
3
|
+
import { CatalogProcessor, LocationSpec, CatalogProcessorEmit, EntityProvider, EntityProviderConnection } from '@backstage/plugin-catalog-backend';
|
|
4
4
|
import { Logger } from 'winston';
|
|
5
|
+
import { TaskRunner } from '@backstage/backend-tasks';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Extracts repositories out of an Azure DevOps org.
|
|
@@ -33,4 +34,32 @@ declare class AzureDevOpsDiscoveryProcessor implements CatalogProcessor {
|
|
|
33
34
|
readLocation(location: LocationSpec, _optional: boolean, emit: CatalogProcessorEmit): Promise<boolean>;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Provider which discovers catalog files within an Azure DevOps repositories.
|
|
39
|
+
*
|
|
40
|
+
* Use `AzureDevOpsEntityProvider.fromConfig(...)` to create instances.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
declare class AzureDevOpsEntityProvider implements EntityProvider {
|
|
45
|
+
private readonly config;
|
|
46
|
+
private readonly integration;
|
|
47
|
+
private readonly logger;
|
|
48
|
+
private readonly scheduleFn;
|
|
49
|
+
private connection?;
|
|
50
|
+
static fromConfig(configRoot: Config, options: {
|
|
51
|
+
logger: Logger;
|
|
52
|
+
schedule: TaskRunner;
|
|
53
|
+
}): AzureDevOpsEntityProvider[];
|
|
54
|
+
private constructor();
|
|
55
|
+
private createScheduleFn;
|
|
56
|
+
/** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.getProviderName} */
|
|
57
|
+
getProviderName(): string;
|
|
58
|
+
/** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.connect} */
|
|
59
|
+
connect(connection: EntityProviderConnection): Promise<void>;
|
|
60
|
+
refresh(logger: Logger): Promise<void>;
|
|
61
|
+
private createLocationSpec;
|
|
62
|
+
private createObjectUrl;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { AzureDevOpsDiscoveryProcessor, AzureDevOpsEntityProvider };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-backend-module-azure",
|
|
3
3
|
"description": "A Backstage catalog backend module that helps integrate towards Azure",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5-next.0",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -33,25 +33,29 @@
|
|
|
33
33
|
"start": "backstage-cli package start"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@backstage/backend-common": "^0.
|
|
37
|
-
"@backstage/
|
|
36
|
+
"@backstage/backend-common": "^0.14.1-next.0",
|
|
37
|
+
"@backstage/backend-tasks": "^0.3.3-next.0",
|
|
38
|
+
"@backstage/catalog-model": "^1.1.0-next.0",
|
|
38
39
|
"@backstage/config": "^1.0.1",
|
|
39
40
|
"@backstage/errors": "^1.0.0",
|
|
40
|
-
"@backstage/integration": "^1.2.
|
|
41
|
-
"@backstage/plugin-catalog-backend": "^1.2.
|
|
41
|
+
"@backstage/integration": "^1.2.2-next.0",
|
|
42
|
+
"@backstage/plugin-catalog-backend": "^1.2.1-next.0",
|
|
42
43
|
"@backstage/types": "^1.0.0",
|
|
43
44
|
"lodash": "^4.17.21",
|
|
44
45
|
"msw": "^0.42.0",
|
|
45
46
|
"node-fetch": "^2.6.7",
|
|
47
|
+
"uuid": "^8.0.0",
|
|
46
48
|
"winston": "^3.2.1"
|
|
47
49
|
},
|
|
48
50
|
"devDependencies": {
|
|
49
|
-
"@backstage/backend-test-utils": "^0.1.
|
|
50
|
-
"@backstage/cli": "^0.17.
|
|
51
|
+
"@backstage/backend-test-utils": "^0.1.26-next.0",
|
|
52
|
+
"@backstage/cli": "^0.17.3-next.0",
|
|
51
53
|
"@types/lodash": "^4.14.151"
|
|
52
54
|
},
|
|
53
55
|
"files": [
|
|
54
|
-
"dist"
|
|
56
|
+
"dist",
|
|
57
|
+
"config.d.ts"
|
|
55
58
|
],
|
|
56
|
-
"
|
|
59
|
+
"configSchema": "config.d.ts",
|
|
60
|
+
"gitHead": "6d8bf5b9cf494815c0916e18daa226fb8186ba5f"
|
|
57
61
|
}
|