@backstage/backend-defaults 0.13.1-next.1 → 0.14.0-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 +55 -0
- package/dist/CreateBackend.cjs.js +3 -1
- package/dist/CreateBackend.cjs.js.map +1 -1
- package/dist/alpha/entrypoints/instanceMetadata/instanceMetadataServiceFactory.cjs.js +5 -2
- package/dist/alpha/entrypoints/instanceMetadata/instanceMetadataServiceFactory.cjs.js.map +1 -1
- package/dist/alpha.cjs.js +0 -2
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/alpha.d.ts +1 -8
- package/dist/entrypoints/urlReader/lib/BitbucketCloudUrlReader.cjs.js +5 -5
- package/dist/entrypoints/urlReader/lib/BitbucketCloudUrlReader.cjs.js.map +1 -1
- package/dist/package.json.cjs.js +1 -1
- package/package.json +20 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# @backstage/backend-defaults
|
|
2
2
|
|
|
3
|
+
## 0.14.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fa43826: Move `better-sqlite3` from dependencies to peer dependencies
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- d9759a1: **BREAKING ALPHA**: The old `instanceMetadataService` has been removed from alpha. Please switch over to using the stable `coreServices.rootInstanceMetadata` and related types instead, available from `@backstage/backend-plugin-api`.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/plugin-auth-node@0.6.10-next.0
|
|
14
|
+
- @backstage/backend-app-api@1.4.0-next.0
|
|
15
|
+
- @backstage/backend-plugin-api@1.5.1-next.0
|
|
16
|
+
- @backstage/integration@1.18.3-next.0
|
|
17
|
+
- @backstage/plugin-permission-node@0.10.7-next.0
|
|
18
|
+
- @backstage/plugin-events-node@0.4.18-next.0
|
|
19
|
+
- @backstage/cli-node@0.2.16-next.0
|
|
20
|
+
- @backstage/config@1.3.6
|
|
21
|
+
- @backstage/integration-aws-node@0.1.19
|
|
22
|
+
- @backstage/config-loader@1.10.7-next.0
|
|
23
|
+
- @backstage/backend-dev-utils@0.1.5
|
|
24
|
+
- @backstage/errors@1.2.7
|
|
25
|
+
- @backstage/types@1.2.2
|
|
26
|
+
|
|
27
|
+
## 0.13.1
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 9bcfa77: Adjusted the log line wording of task worker starting
|
|
32
|
+
- 91ab2eb: Fix a bug in the Gitlab URL reader where `search` did not handle multiple globs
|
|
33
|
+
- fa255f5: Support for Bitbucket Cloud's API token was added as `appPassword` is deprecated (no new creation from September 9, 2025) and will be removed on June 9, 2026.
|
|
34
|
+
|
|
35
|
+
API token usage example:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
integrations:
|
|
39
|
+
bitbucketCloud:
|
|
40
|
+
- username: user@domain.com
|
|
41
|
+
token: my-token
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- 05f60e1: Refactored constructor parameter properties to explicit property declarations for compatibility with TypeScript's `erasableSyntaxOnly` setting. This internal refactoring maintains all existing functionality while ensuring TypeScript compilation compatibility.
|
|
45
|
+
- b2f6a5a: Fix #31348 issue where BitbucketUrlReader ignored provided token and instead always used integration credentials
|
|
46
|
+
- Updated dependencies
|
|
47
|
+
- @backstage/integration@1.18.2
|
|
48
|
+
- @backstage/backend-plugin-api@1.5.0
|
|
49
|
+
- @backstage/backend-app-api@1.3.0
|
|
50
|
+
- @backstage/plugin-events-node@0.4.17
|
|
51
|
+
- @backstage/plugin-auth-node@0.6.9
|
|
52
|
+
- @backstage/config-loader@1.10.6
|
|
53
|
+
- @backstage/config@1.3.6
|
|
54
|
+
- @backstage/cli-node@0.2.15
|
|
55
|
+
- @backstage/integration-aws-node@0.1.19
|
|
56
|
+
- @backstage/plugin-permission-node@0.10.6
|
|
57
|
+
|
|
3
58
|
## 0.13.1-next.1
|
|
4
59
|
|
|
5
60
|
### Patch Changes
|
|
@@ -22,6 +22,7 @@ var urlReader = require('@backstage/backend-defaults/urlReader');
|
|
|
22
22
|
var userInfo = require('@backstage/backend-defaults/userInfo');
|
|
23
23
|
var pluginEventsNode = require('@backstage/plugin-events-node');
|
|
24
24
|
var alpha = require('@backstage/backend-defaults/alpha');
|
|
25
|
+
var instanceMetadataServiceFactory = require('./alpha/entrypoints/instanceMetadata/instanceMetadataServiceFactory.cjs.js');
|
|
25
26
|
|
|
26
27
|
const defaultServiceFactories = [
|
|
27
28
|
auditor.auditorServiceFactory,
|
|
@@ -47,7 +48,8 @@ const defaultServiceFactories = [
|
|
|
47
48
|
// alpha services
|
|
48
49
|
alpha.actionsRegistryServiceFactory,
|
|
49
50
|
alpha.actionsServiceFactory,
|
|
50
|
-
alpha
|
|
51
|
+
// Unexported alpha services kept around for compatibility reasons
|
|
52
|
+
instanceMetadataServiceFactory.instanceMetadataServiceFactory
|
|
51
53
|
];
|
|
52
54
|
function createBackend() {
|
|
53
55
|
return backendAppApi.createSpecializedBackend({ defaultServiceFactories });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateBackend.cjs.js","sources":["../src/CreateBackend.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 { Backend, createSpecializedBackend } from '@backstage/backend-app-api';\nimport { auditorServiceFactory } from '@backstage/backend-defaults/auditor';\nimport { authServiceFactory } from '@backstage/backend-defaults/auth';\nimport { cacheServiceFactory } from '@backstage/backend-defaults/cache';\nimport { databaseServiceFactory } from '@backstage/backend-defaults/database';\nimport { discoveryServiceFactory } from '@backstage/backend-defaults/discovery';\nimport { httpAuthServiceFactory } from '@backstage/backend-defaults/httpAuth';\nimport { httpRouterServiceFactory } from '@backstage/backend-defaults/httpRouter';\nimport { lifecycleServiceFactory } from '@backstage/backend-defaults/lifecycle';\nimport { loggerServiceFactory } from '@backstage/backend-defaults/logger';\nimport { permissionsServiceFactory } from '@backstage/backend-defaults/permissions';\nimport { permissionsRegistryServiceFactory } from '@backstage/backend-defaults/permissionsRegistry';\nimport { rootConfigServiceFactory } from '@backstage/backend-defaults/rootConfig';\nimport { rootHealthServiceFactory } from '@backstage/backend-defaults/rootHealth';\nimport { rootHttpRouterServiceFactory } from '@backstage/backend-defaults/rootHttpRouter';\nimport { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle';\nimport { rootLoggerServiceFactory } from '@backstage/backend-defaults/rootLogger';\nimport { schedulerServiceFactory } from '@backstage/backend-defaults/scheduler';\nimport { urlReaderServiceFactory } from '@backstage/backend-defaults/urlReader';\nimport { userInfoServiceFactory } from '@backstage/backend-defaults/userInfo';\nimport { eventsServiceFactory } from '@backstage/plugin-events-node';\nimport {\n actionsRegistryServiceFactory,\n actionsServiceFactory,\n
|
|
1
|
+
{"version":3,"file":"CreateBackend.cjs.js","sources":["../src/CreateBackend.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 { Backend, createSpecializedBackend } from '@backstage/backend-app-api';\nimport { auditorServiceFactory } from '@backstage/backend-defaults/auditor';\nimport { authServiceFactory } from '@backstage/backend-defaults/auth';\nimport { cacheServiceFactory } from '@backstage/backend-defaults/cache';\nimport { databaseServiceFactory } from '@backstage/backend-defaults/database';\nimport { discoveryServiceFactory } from '@backstage/backend-defaults/discovery';\nimport { httpAuthServiceFactory } from '@backstage/backend-defaults/httpAuth';\nimport { httpRouterServiceFactory } from '@backstage/backend-defaults/httpRouter';\nimport { lifecycleServiceFactory } from '@backstage/backend-defaults/lifecycle';\nimport { loggerServiceFactory } from '@backstage/backend-defaults/logger';\nimport { permissionsServiceFactory } from '@backstage/backend-defaults/permissions';\nimport { permissionsRegistryServiceFactory } from '@backstage/backend-defaults/permissionsRegistry';\nimport { rootConfigServiceFactory } from '@backstage/backend-defaults/rootConfig';\nimport { rootHealthServiceFactory } from '@backstage/backend-defaults/rootHealth';\nimport { rootHttpRouterServiceFactory } from '@backstage/backend-defaults/rootHttpRouter';\nimport { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle';\nimport { rootLoggerServiceFactory } from '@backstage/backend-defaults/rootLogger';\nimport { schedulerServiceFactory } from '@backstage/backend-defaults/scheduler';\nimport { urlReaderServiceFactory } from '@backstage/backend-defaults/urlReader';\nimport { userInfoServiceFactory } from '@backstage/backend-defaults/userInfo';\nimport { eventsServiceFactory } from '@backstage/plugin-events-node';\nimport {\n actionsRegistryServiceFactory,\n actionsServiceFactory,\n} from '@backstage/backend-defaults/alpha';\nimport { instanceMetadataServiceFactory } from './alpha/entrypoints/instanceMetadata/instanceMetadataServiceFactory';\n\nexport const defaultServiceFactories = [\n auditorServiceFactory,\n authServiceFactory,\n cacheServiceFactory,\n rootConfigServiceFactory,\n databaseServiceFactory,\n discoveryServiceFactory,\n httpAuthServiceFactory,\n httpRouterServiceFactory,\n lifecycleServiceFactory,\n loggerServiceFactory,\n permissionsServiceFactory,\n permissionsRegistryServiceFactory,\n rootHealthServiceFactory,\n rootHttpRouterServiceFactory,\n rootLifecycleServiceFactory,\n rootLoggerServiceFactory,\n schedulerServiceFactory,\n userInfoServiceFactory,\n urlReaderServiceFactory,\n eventsServiceFactory,\n\n // alpha services\n actionsRegistryServiceFactory,\n actionsServiceFactory,\n\n // Unexported alpha services kept around for compatibility reasons\n instanceMetadataServiceFactory,\n];\n\n/**\n * @public\n */\nexport function createBackend(): Backend {\n return createSpecializedBackend({ defaultServiceFactories });\n}\n"],"names":["auditorServiceFactory","authServiceFactory","cacheServiceFactory","rootConfigServiceFactory","databaseServiceFactory","discoveryServiceFactory","httpAuthServiceFactory","httpRouterServiceFactory","lifecycleServiceFactory","loggerServiceFactory","permissionsServiceFactory","permissionsRegistryServiceFactory","rootHealthServiceFactory","rootHttpRouterServiceFactory","rootLifecycleServiceFactory","rootLoggerServiceFactory","schedulerServiceFactory","userInfoServiceFactory","urlReaderServiceFactory","eventsServiceFactory","actionsRegistryServiceFactory","actionsServiceFactory","instanceMetadataServiceFactory","createSpecializedBackend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2CO,MAAM,uBAAA,GAA0B;AAAA,EACrCA,6BAAA;AAAA,EACAC,uBAAA;AAAA,EACAC,yBAAA;AAAA,EACAC,mCAAA;AAAA,EACAC,+BAAA;AAAA,EACAC,iCAAA;AAAA,EACAC,+BAAA;AAAA,EACAC,mCAAA;AAAA,EACAC,iCAAA;AAAA,EACAC,2BAAA;AAAA,EACAC,qCAAA;AAAA,EACAC,qDAAA;AAAA,EACAC,mCAAA;AAAA,EACAC,2CAAA;AAAA,EACAC,yCAAA;AAAA,EACAC,mCAAA;AAAA,EACAC,iCAAA;AAAA,EACAC,+BAAA;AAAA,EACAC,iCAAA;AAAA,EACAC,qCAAA;AAAA;AAAA,EAGAC,mCAAA;AAAA,EACAC,2BAAA;AAAA;AAAA,EAGAC;AACF;AAKO,SAAS,aAAA,GAAyB;AACvC,EAAA,OAAOC,sCAAA,CAAyB,EAAE,uBAAA,EAAyB,CAAA;AAC7D;;;;;"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
4
|
-
var alpha = require('@backstage/backend-plugin-api/alpha');
|
|
5
4
|
|
|
5
|
+
const instanceMetadataServiceRef = backendPluginApi.createServiceRef({
|
|
6
|
+
id: "core.instanceMetadata"
|
|
7
|
+
});
|
|
6
8
|
const instanceMetadataServiceFactory = backendPluginApi.createServiceFactory({
|
|
7
|
-
service:
|
|
9
|
+
service: instanceMetadataServiceRef,
|
|
8
10
|
deps: {
|
|
9
11
|
instanceMetadata: backendPluginApi.coreServices.rootInstanceMetadata
|
|
10
12
|
},
|
|
@@ -32,4 +34,5 @@ const instanceMetadataServiceFactory = backendPluginApi.createServiceFactory({
|
|
|
32
34
|
});
|
|
33
35
|
|
|
34
36
|
exports.instanceMetadataServiceFactory = instanceMetadataServiceFactory;
|
|
37
|
+
exports.instanceMetadataServiceRef = instanceMetadataServiceRef;
|
|
35
38
|
//# sourceMappingURL=instanceMetadataServiceFactory.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instanceMetadataServiceFactory.cjs.js","sources":["../../../../src/alpha/entrypoints/instanceMetadata/instanceMetadataServiceFactory.ts"],"sourcesContent":["/*\n * Copyright 2025 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 createServiceFactory,\n} from '@backstage/backend-plugin-api';\
|
|
1
|
+
{"version":3,"file":"instanceMetadataServiceFactory.cjs.js","sources":["../../../../src/alpha/entrypoints/instanceMetadata/instanceMetadataServiceFactory.ts"],"sourcesContent":["/*\n * Copyright 2025 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 createServiceFactory,\n createServiceRef,\n} from '@backstage/backend-plugin-api';\n\n/*\n * NOTE(freben): We have moved over to coreServices.rootInstanceMetadata. This\n * old alpha implementation is kept around for a little longer for backward\n * compatibility reasons.\n */\n\n/**\n * @internal\n */\nexport type BackendFeatureMeta =\n | {\n type: 'plugin';\n pluginId: string;\n }\n | {\n type: 'module';\n pluginId: string;\n moduleId: string;\n };\n\n/**\n * @internal\n */\nexport interface InstanceMetadataService {\n getInstalledFeatures: () => BackendFeatureMeta[];\n}\n\n/**\n * @internal\n */\nexport const instanceMetadataServiceRef =\n createServiceRef<InstanceMetadataService>({\n id: 'core.instanceMetadata',\n });\n\n/**\n * @internal\n */\nexport const instanceMetadataServiceFactory = createServiceFactory({\n service: instanceMetadataServiceRef,\n deps: {\n instanceMetadata: coreServices.rootInstanceMetadata,\n },\n factory: async ({ instanceMetadata }) => {\n const plugins = await instanceMetadata.getInstalledPlugins();\n const features: BackendFeatureMeta[] = [];\n for (const plugin of plugins) {\n features.push({\n type: 'plugin' as const,\n pluginId: plugin.pluginId,\n });\n for (const module of plugin.modules) {\n features.push({\n type: 'module' as const,\n pluginId: plugin.pluginId,\n moduleId: module.moduleId,\n });\n }\n }\n const service: InstanceMetadataService = {\n getInstalledFeatures: () => features,\n };\n\n return service;\n },\n});\n"],"names":["createServiceRef","createServiceFactory","coreServices"],"mappings":";;;;AAoDO,MAAM,6BACXA,iCAAA,CAA0C;AAAA,EACxC,EAAA,EAAI;AACN,CAAC;AAKI,MAAM,iCAAiCC,qCAAA,CAAqB;AAAA,EACjE,OAAA,EAAS,0BAAA;AAAA,EACT,IAAA,EAAM;AAAA,IACJ,kBAAkBC,6BAAA,CAAa;AAAA,GACjC;AAAA,EACA,OAAA,EAAS,OAAO,EAAE,gBAAA,EAAiB,KAAM;AACvC,IAAA,MAAM,OAAA,GAAU,MAAM,gBAAA,CAAiB,mBAAA,EAAoB;AAC3D,IAAA,MAAM,WAAiC,EAAC;AACxC,IAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,MAAA,QAAA,CAAS,IAAA,CAAK;AAAA,QACZ,IAAA,EAAM,QAAA;AAAA,QACN,UAAU,MAAA,CAAO;AAAA,OAClB,CAAA;AACD,MAAA,KAAA,MAAW,MAAA,IAAU,OAAO,OAAA,EAAS;AACnC,QAAA,QAAA,CAAS,IAAA,CAAK;AAAA,UACZ,IAAA,EAAM,QAAA;AAAA,UACN,UAAU,MAAA,CAAO,QAAA;AAAA,UACjB,UAAU,MAAA,CAAO;AAAA,SAClB,CAAA;AAAA,MACH;AAAA,IACF;AACA,IAAA,MAAM,OAAA,GAAmC;AAAA,MACvC,sBAAsB,MAAM;AAAA,KAC9B;AAEA,IAAA,OAAO,OAAA;AAAA,EACT;AACF,CAAC;;;;;"}
|
package/dist/alpha.cjs.js
CHANGED
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var actionsRegistryServiceFactory = require('./alpha/entrypoints/actionsRegistry/actionsRegistryServiceFactory.cjs.js');
|
|
4
4
|
var actionsServiceFactory = require('./alpha/entrypoints/actions/actionsServiceFactory.cjs.js');
|
|
5
|
-
var instanceMetadataServiceFactory = require('./alpha/entrypoints/instanceMetadata/instanceMetadataServiceFactory.cjs.js');
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
exports.actionsRegistryServiceFactory = actionsRegistryServiceFactory.actionsRegistryServiceFactory;
|
|
10
9
|
exports.actionsServiceFactory = actionsServiceFactory.actionsServiceFactory;
|
|
11
|
-
exports.instanceMetadataServiceFactory = instanceMetadataServiceFactory.instanceMetadataServiceFactory;
|
|
12
10
|
//# sourceMappingURL=alpha.cjs.js.map
|
package/dist/alpha.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alpha.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
2
2
|
import * as _backstage_backend_plugin_api_alpha from '@backstage/backend-plugin-api/alpha';
|
|
3
|
-
import { InstanceMetadataService } from '@backstage/backend-plugin-api/alpha';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @public
|
|
@@ -12,10 +11,4 @@ declare const actionsRegistryServiceFactory: _backstage_backend_plugin_api.Servi
|
|
|
12
11
|
*/
|
|
13
12
|
declare const actionsServiceFactory: _backstage_backend_plugin_api.ServiceFactory<_backstage_backend_plugin_api_alpha.ActionsService, "plugin", "singleton">;
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
* @alpha
|
|
17
|
-
* @deprecated use {@link @backstage/backend-plugin-api#coreServices.rootInstanceMetadata} instead
|
|
18
|
-
*/
|
|
19
|
-
declare const instanceMetadataServiceFactory: _backstage_backend_plugin_api.ServiceFactory<InstanceMetadataService, "plugin", "singleton">;
|
|
20
|
-
|
|
21
|
-
export { actionsRegistryServiceFactory, actionsServiceFactory, instanceMetadataServiceFactory };
|
|
14
|
+
export { actionsRegistryServiceFactory, actionsServiceFactory };
|
|
@@ -27,10 +27,10 @@ class BitbucketCloudUrlReader {
|
|
|
27
27
|
constructor(integration, deps) {
|
|
28
28
|
this.integration = integration;
|
|
29
29
|
this.deps = deps;
|
|
30
|
-
const { host, username, appPassword } = integration.config;
|
|
31
|
-
if (username && !appPassword) {
|
|
30
|
+
const { host, username, appPassword, token } = integration.config;
|
|
31
|
+
if (username && !token && !appPassword) {
|
|
32
32
|
throw new Error(
|
|
33
|
-
`Bitbucket Cloud integration for '${host}' has configured a username but is missing a required appPassword.`
|
|
33
|
+
`Bitbucket Cloud integration for '${host}' has configured a username but is missing a required token or appPassword.`
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -154,8 +154,8 @@ class BitbucketCloudUrlReader {
|
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
156
|
toString() {
|
|
157
|
-
const { host, username, appPassword } = this.integration.config;
|
|
158
|
-
const authed = Boolean(username && appPassword);
|
|
157
|
+
const { host, username, appPassword, token } = this.integration.config;
|
|
158
|
+
const authed = Boolean(username && (token ?? appPassword));
|
|
159
159
|
return `bitbucketCloud{host=${host},authed=${authed}}`;
|
|
160
160
|
}
|
|
161
161
|
async getLastCommitShortHash(url) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitbucketCloudUrlReader.cjs.js","sources":["../../../../src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.ts"],"sourcesContent":["/*\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 {\n UrlReaderService,\n UrlReaderServiceReadTreeOptions,\n UrlReaderServiceReadTreeResponse,\n UrlReaderServiceReadUrlOptions,\n UrlReaderServiceReadUrlResponse,\n UrlReaderServiceSearchOptions,\n UrlReaderServiceSearchResponse,\n} from '@backstage/backend-plugin-api';\nimport {\n assertError,\n NotFoundError,\n NotModifiedError,\n} from '@backstage/errors';\nimport {\n BitbucketCloudIntegration,\n getBitbucketCloudDefaultBranch,\n getBitbucketCloudDownloadUrl,\n getBitbucketCloudFileFetchUrl,\n getBitbucketCloudRequestOptions,\n ScmIntegrations,\n} from '@backstage/integration';\nimport parseGitUrl from 'git-url-parse';\nimport { trimEnd } from 'lodash';\nimport { Minimatch } from 'minimatch';\nimport { ReaderFactory, ReadTreeResponseFactory } from './types';\nimport { ReadUrlResponseFactory } from './ReadUrlResponseFactory';\n\n/**\n * Implements a {@link @backstage/backend-plugin-api#UrlReaderService} for files from Bitbucket Cloud.\n *\n * @public\n */\nexport class BitbucketCloudUrlReader implements UrlReaderService {\n static factory: ReaderFactory = ({ config, treeResponseFactory }) => {\n const integrations = ScmIntegrations.fromConfig(config);\n return integrations.bitbucketCloud.list().map(integration => {\n const reader = new BitbucketCloudUrlReader(integration, {\n treeResponseFactory,\n });\n const predicate = (url: URL) => url.host === integration.config.host;\n return { reader, predicate };\n });\n };\n\n private readonly integration: BitbucketCloudIntegration;\n private readonly deps: { treeResponseFactory: ReadTreeResponseFactory };\n\n constructor(\n integration: BitbucketCloudIntegration,\n deps: { treeResponseFactory: ReadTreeResponseFactory },\n ) {\n this.integration = integration;\n this.deps = deps;\n const { host, username, appPassword } = integration.config;\n\n if (username && !appPassword) {\n throw new Error(\n `Bitbucket Cloud integration for '${host}' has configured a username but is missing a required appPassword.`,\n );\n }\n }\n\n async read(url: string): Promise<Buffer> {\n const response = await this.readUrl(url);\n return response.buffer();\n }\n\n async readUrl(\n url: string,\n options?: UrlReaderServiceReadUrlOptions,\n ): Promise<UrlReaderServiceReadUrlResponse> {\n const { etag, lastModifiedAfter, signal } = options ?? {};\n const bitbucketUrl = getBitbucketCloudFileFetchUrl(\n url,\n this.integration.config,\n );\n const requestOptions = getBitbucketCloudRequestOptions(\n this.integration.config,\n );\n\n let response: Response;\n try {\n response = await fetch(bitbucketUrl.toString(), {\n headers: {\n ...requestOptions.headers,\n ...(etag && { 'If-None-Match': etag }),\n ...(lastModifiedAfter && {\n 'If-Modified-Since': lastModifiedAfter.toUTCString(),\n }),\n },\n // TODO(freben): The signal cast is there because pre-3.x versions of\n // node-fetch have a very slightly deviating AbortSignal type signature.\n // The difference does not affect us in practice however. The cast can be\n // removed after we support ESM for CLI dependencies and migrate to\n // version 3 of node-fetch.\n // https://github.com/backstage/backstage/issues/8242\n ...(signal && { signal: signal as any }),\n });\n } catch (e) {\n throw new Error(`Unable to read ${url}, ${e}`);\n }\n\n if (response.status === 304) {\n throw new NotModifiedError();\n }\n\n if (response.ok) {\n return ReadUrlResponseFactory.fromResponse(response);\n }\n\n const message = `${url} could not be read as ${bitbucketUrl}, ${response.status} ${response.statusText}`;\n if (response.status === 404) {\n throw new NotFoundError(message);\n }\n throw new Error(message);\n }\n\n async readTree(\n url: string,\n options?: UrlReaderServiceReadTreeOptions,\n ): Promise<UrlReaderServiceReadTreeResponse> {\n const { filepath } = parseGitUrl(url);\n\n const lastCommitShortHash = await this.getLastCommitShortHash(url);\n if (options?.etag && options.etag === lastCommitShortHash) {\n throw new NotModifiedError();\n }\n\n const downloadUrl = await getBitbucketCloudDownloadUrl(\n url,\n this.integration.config,\n );\n const archiveResponse = await fetch(\n downloadUrl,\n getBitbucketCloudRequestOptions(this.integration.config),\n );\n if (!archiveResponse.ok) {\n const message = `Failed to read tree from ${url}, ${archiveResponse.status} ${archiveResponse.statusText}`;\n if (archiveResponse.status === 404) {\n throw new NotFoundError(message);\n }\n throw new Error(message);\n }\n\n return await this.deps.treeResponseFactory.fromTarArchive({\n response: archiveResponse,\n subpath: filepath,\n etag: lastCommitShortHash,\n filter: options?.filter,\n });\n }\n\n async search(\n url: string,\n options?: UrlReaderServiceSearchOptions,\n ): Promise<UrlReaderServiceSearchResponse> {\n const { filepath } = parseGitUrl(url);\n\n // If it's a direct URL we use readUrl instead\n if (!filepath?.match(/[*?]/)) {\n try {\n const data = await this.readUrl(url, options);\n\n return {\n files: [\n {\n url: url,\n content: data.buffer,\n lastModifiedAt: data.lastModifiedAt,\n },\n ],\n etag: data.etag ?? '',\n };\n } catch (error) {\n assertError(error);\n if (error.name === 'NotFoundError') {\n return {\n files: [],\n etag: '',\n };\n }\n throw error;\n }\n }\n\n const matcher = new Minimatch(filepath);\n\n // TODO(freben): For now, read the entire repo and filter through that. In\n // a future improvement, we could be smart and try to deduce that non-glob\n // prefixes (like for filepaths such as some-prefix/**/a.yaml) can be used\n // to get just that part of the repo.\n const treeUrl = trimEnd(url.replace(filepath, ''), '/');\n\n const tree = await this.readTree(treeUrl, {\n etag: options?.etag,\n filter: path => matcher.match(path),\n });\n const files = await tree.files();\n\n return {\n etag: tree.etag,\n files: files.map(file => ({\n url: this.integration.resolveUrl({\n url: `/${file.path}`,\n base: url,\n }),\n content: file.content,\n lastModifiedAt: file.lastModifiedAt,\n })),\n };\n }\n\n toString() {\n const { host, username, appPassword } = this.integration.config;\n const authed = Boolean(username && appPassword);\n return `bitbucketCloud{host=${host},authed=${authed}}`;\n }\n\n private async getLastCommitShortHash(url: string): Promise<string> {\n const { name: repoName, owner: project, ref } = parseGitUrl(url);\n\n let branch = ref;\n if (!branch) {\n branch = await getBitbucketCloudDefaultBranch(\n url,\n this.integration.config,\n );\n }\n\n const commitsApiUrl = `${this.integration.config.apiBaseUrl}/repositories/${project}/${repoName}/commits/${branch}`;\n\n const commitsResponse = await fetch(\n commitsApiUrl,\n getBitbucketCloudRequestOptions(this.integration.config),\n );\n if (!commitsResponse.ok) {\n const message = `Failed to retrieve commits from ${commitsApiUrl}, ${commitsResponse.status} ${commitsResponse.statusText}`;\n if (commitsResponse.status === 404) {\n throw new NotFoundError(message);\n }\n throw new Error(message);\n }\n\n const commits = await commitsResponse.json();\n if (\n commits &&\n commits.values &&\n commits.values.length > 0 &&\n commits.values[0].hash\n ) {\n return commits.values[0].hash.substring(0, 12);\n }\n\n throw new Error(`Failed to read response from ${commitsApiUrl}`);\n }\n}\n"],"names":["ScmIntegrations","getBitbucketCloudFileFetchUrl","getBitbucketCloudRequestOptions","NotModifiedError","ReadUrlResponseFact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B,EAAA,EAAI;AACvB,MAAA,MAAM,OAAA,GAAU,mCAAmC,aAAa,CAAA,EAAA,EAAK,gBAAgB,MAAM,CAAA,CAAA,EAAI,gBAAgB,UAAU,CAAA,CAAA;AACzH,MAAA,IAAI,eAAA,CAAgB,WAAW,GAAA,EAAK;AAClC,QAAA,MAAM,IAAIG,qBAAc,OAAO,CAAA;AAAA,MACjC;AACA,MAAA,MAAM,IAAI,MAAM,OAAO,CAAA;AAAA,IACzB;AAEA,IAAA,MAAM,OAAA,GAAU,MAAM,eAAA,CAAgB,IAAA,EAAK;AAC3C,IAAA,IACE,OAAA,IACA,OAAA,CAAQ,MAAA,IACR,OAAA,CAAQ,MAAA,CAAO,MAAA,GAAS,CAAA,IACxB,OAAA,CAAQ,MAAA,CAAO,CAAC,CAAA,CAAE,IAAA,EAClB;AACA,MAAA,OAAO,QAAQ,MAAA,CAAO,CAAC,EAAE,IAAA,CAAK,SAAA,CAAU,GAAG,EAAE,CAAA;AAAA,IAC/C;AAEA,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,6BAAA,EAAgC,aAAa,CAAA,CAAE,CAAA;AAAA,EACjE;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"BitbucketCloudUrlReader.cjs.js","sources":["../../../../src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.ts"],"sourcesContent":["/*\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 {\n UrlReaderService,\n UrlReaderServiceReadTreeOptions,\n UrlReaderServiceReadTreeResponse,\n UrlReaderServiceReadUrlOptions,\n UrlReaderServiceReadUrlResponse,\n UrlReaderServiceSearchOptions,\n UrlReaderServiceSearchResponse,\n} from '@backstage/backend-plugin-api';\nimport {\n assertError,\n NotFoundError,\n NotModifiedError,\n} from '@backstage/errors';\nimport {\n BitbucketCloudIntegration,\n getBitbucketCloudDefaultBranch,\n getBitbucketCloudDownloadUrl,\n getBitbucketCloudFileFetchUrl,\n getBitbucketCloudRequestOptions,\n ScmIntegrations,\n} from '@backstage/integration';\nimport parseGitUrl from 'git-url-parse';\nimport { trimEnd } from 'lodash';\nimport { Minimatch } from 'minimatch';\nimport { ReaderFactory, ReadTreeResponseFactory } from './types';\nimport { ReadUrlResponseFactory } from './ReadUrlResponseFactory';\n\n/**\n * Implements a {@link @backstage/backend-plugin-api#UrlReaderService} for files from Bitbucket Cloud.\n *\n * @public\n */\nexport class BitbucketCloudUrlReader implements UrlReaderService {\n static factory: ReaderFactory = ({ config, treeResponseFactory }) => {\n const integrations = ScmIntegrations.fromConfig(config);\n return integrations.bitbucketCloud.list().map(integration => {\n const reader = new BitbucketCloudUrlReader(integration, {\n treeResponseFactory,\n });\n const predicate = (url: URL) => url.host === integration.config.host;\n return { reader, predicate };\n });\n };\n\n private readonly integration: BitbucketCloudIntegration;\n private readonly deps: { treeResponseFactory: ReadTreeResponseFactory };\n\n constructor(\n integration: BitbucketCloudIntegration,\n deps: { treeResponseFactory: ReadTreeResponseFactory },\n ) {\n this.integration = integration;\n this.deps = deps;\n const { host, username, appPassword, token } = integration.config;\n\n if (username && !token && !appPassword) {\n throw new Error(\n `Bitbucket Cloud integration for '${host}' has configured a username but is missing a required token or appPassword.`,\n );\n }\n }\n\n async read(url: string): Promise<Buffer> {\n const response = await this.readUrl(url);\n return response.buffer();\n }\n\n async readUrl(\n url: string,\n options?: UrlReaderServiceReadUrlOptions,\n ): Promise<UrlReaderServiceReadUrlResponse> {\n const { etag, lastModifiedAfter, signal } = options ?? {};\n const bitbucketUrl = getBitbucketCloudFileFetchUrl(\n url,\n this.integration.config,\n );\n const requestOptions = getBitbucketCloudRequestOptions(\n this.integration.config,\n );\n\n let response: Response;\n try {\n response = await fetch(bitbucketUrl.toString(), {\n headers: {\n ...requestOptions.headers,\n ...(etag && { 'If-None-Match': etag }),\n ...(lastModifiedAfter && {\n 'If-Modified-Since': lastModifiedAfter.toUTCString(),\n }),\n },\n // TODO(freben): The signal cast is there because pre-3.x versions of\n // node-fetch have a very slightly deviating AbortSignal type signature.\n // The difference does not affect us in practice however. The cast can be\n // removed after we support ESM for CLI dependencies and migrate to\n // version 3 of node-fetch.\n // https://github.com/backstage/backstage/issues/8242\n ...(signal && { signal: signal as any }),\n });\n } catch (e) {\n throw new Error(`Unable to read ${url}, ${e}`);\n }\n\n if (response.status === 304) {\n throw new NotModifiedError();\n }\n\n if (response.ok) {\n return ReadUrlResponseFactory.fromResponse(response);\n }\n\n const message = `${url} could not be read as ${bitbucketUrl}, ${response.status} ${response.statusText}`;\n if (response.status === 404) {\n throw new NotFoundError(message);\n }\n throw new Error(message);\n }\n\n async readTree(\n url: string,\n options?: UrlReaderServiceReadTreeOptions,\n ): Promise<UrlReaderServiceReadTreeResponse> {\n const { filepath } = parseGitUrl(url);\n\n const lastCommitShortHash = await this.getLastCommitShortHash(url);\n if (options?.etag && options.etag === lastCommitShortHash) {\n throw new NotModifiedError();\n }\n\n const downloadUrl = await getBitbucketCloudDownloadUrl(\n url,\n this.integration.config,\n );\n const archiveResponse = await fetch(\n downloadUrl,\n getBitbucketCloudRequestOptions(this.integration.config),\n );\n if (!archiveResponse.ok) {\n const message = `Failed to read tree from ${url}, ${archiveResponse.status} ${archiveResponse.statusText}`;\n if (archiveResponse.status === 404) {\n throw new NotFoundError(message);\n }\n throw new Error(message);\n }\n\n return await this.deps.treeResponseFactory.fromTarArchive({\n response: archiveResponse,\n subpath: filepath,\n etag: lastCommitShortHash,\n filter: options?.filter,\n });\n }\n\n async search(\n url: string,\n options?: UrlReaderServiceSearchOptions,\n ): Promise<UrlReaderServiceSearchResponse> {\n const { filepath } = parseGitUrl(url);\n\n // If it's a direct URL we use readUrl instead\n if (!filepath?.match(/[*?]/)) {\n try {\n const data = await this.readUrl(url, options);\n\n return {\n files: [\n {\n url: url,\n content: data.buffer,\n lastModifiedAt: data.lastModifiedAt,\n },\n ],\n etag: data.etag ?? '',\n };\n } catch (error) {\n assertError(error);\n if (error.name === 'NotFoundError') {\n return {\n files: [],\n etag: '',\n };\n }\n throw error;\n }\n }\n\n const matcher = new Minimatch(filepath);\n\n // TODO(freben): For now, read the entire repo and filter through that. In\n // a future improvement, we could be smart and try to deduce that non-glob\n // prefixes (like for filepaths such as some-prefix/**/a.yaml) can be used\n // to get just that part of the repo.\n const treeUrl = trimEnd(url.replace(filepath, ''), '/');\n\n const tree = await this.readTree(treeUrl, {\n etag: options?.etag,\n filter: path => matcher.match(path),\n });\n const files = await tree.files();\n\n return {\n etag: tree.etag,\n files: files.map(file => ({\n url: this.integration.resolveUrl({\n url: `/${file.path}`,\n base: url,\n }),\n content: file.content,\n lastModifiedAt: file.lastModifiedAt,\n })),\n };\n }\n\n toString() {\n // TODO: appPassword can be removed once fully\n // deprecated by BitBucket on 9th June 2026.\n const { host, username, appPassword, token } = this.integration.config;\n const authed = Boolean(username && (token ?? appPassword));\n return `bitbucketCloud{host=${host},authed=${authed}}`;\n }\n\n private async getLastCommitShortHash(url: string): Promise<string> {\n const { name: repoName, owner: project, ref } = parseGitUrl(url);\n\n let branch = ref;\n if (!branch) {\n branch = await getBitbucketCloudDefaultBranch(\n url,\n this.integration.config,\n );\n }\n\n const commitsApiUrl = `${this.integration.config.apiBaseUrl}/repositories/${project}/${repoName}/commits/${branch}`;\n\n const commitsResponse = await fetch(\n commitsApiUrl,\n getBitbucketCloudRequestOptions(this.integration.config),\n );\n if (!commitsResponse.ok) {\n const message = `Failed to retrieve commits from ${commitsApiUrl}, ${commitsResponse.status} ${commitsResponse.statusText}`;\n if (commitsResponse.status === 404) {\n throw new NotFoundError(message);\n }\n throw new Error(message);\n }\n\n const commits = await commitsResponse.json();\n if (\n commits &&\n commits.values &&\n commits.values.length > 0 &&\n commits.values[0].hash\n ) {\n return commits.values[0].hash.substring(0, 12);\n }\n\n throw new Error(`Failed to read response from ${commitsApiUrl}`);\n }\n}\n"],"names":["ScmIntegrations","getBitbucketCloudFileFetchUrl","getBitbucketCloudRequestOptions","NotModifiedError","ReadUrlResponseFactory","NotFoundError","parseGitUrl","getBitbucketCloudDownloadUrl","assertError","Minimatch","trimEnd","getBitbucketCloudDefaultBranch"],"mappings":";;;;;;;;;;;;;AAiDO,MAAM,uBAAA,CAAoD;AAAA,EAC/D,OAAO,OAAA,GAAyB,CAAC,EAAE,MAAA,EAAQ,qBAAoB,KAAM;AACnE,IAAA,MAAM,YAAA,GAAeA,2BAAA,CAAgB,UAAA,CAAW,MAAM,CAAA;AACtD,IAAA,OAAO,YAAA,CAAa,cAAA,CAAe,IAAA,EAAK,CAAE,IAAI,CAAA,WAAA,KAAe;AAC3D,MAAA,MAAM,MAAA,GAAS,IAAI,uBAAA,CAAwB,WAAA,EAAa;AAAA,QACtD;AAAA,OACD,CAAA;AACD,MAAA,MAAM,YAAY,CAAC,GAAA,KAAa,GAAA,CAAI,IAAA,KAAS,YAAY,MAAA,CAAO,IAAA;AAChE,MAAA,OAAO,EAAE,QAAQ,SAAA,EAAU;AAAA,IAC7B,CAAC,CAAA;AAAA,EACH,CAAA;AAAA,EAEiB,WAAA;AAAA,EACA,IAAA;AAAA,EAEjB,WAAA,CACE,aACA,IAAA,EACA;AACA,IAAA,IAAA,CAAK,WAAA,GAAc,WAAA;AACnB,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,MAAM,EAAE,IAAA,EAAM,QAAA,EAAU,WAAA,EAAa,KAAA,KAAU,WAAA,CAAY,MAAA;AAE3D,IAAA,IAAI,QAAA,IAAY,CAAC,KAAA,IAAS,CAAC,WAAA,EAAa;AACtC,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,oCAAoC,IAAI,CAAA,2EAAA;AAAA,OAC1C;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MAAA,CAAO,UAAU,CAAA,cAAA,EAAiB,OAAO,CAAA,CAAA,EAAI,QAAQ,CAAA,SAAA,EAAY,MAAM,CAAA,CAAA;AAEjH,IAAA,MAAM,kBAAkB,MAAM,KAAA;AAAA,MAC5B,aAAA;AAAA,MACAT,2CAAA,CAAgC,IAAA,CAAK,WAAA,CAAY,MAAM;AAAA,KACzD;AACA,IAAA,IAAI,CAAC,gBAAgB,EAAA,EAAI;AACvB,MAAA,MAAM,OAAA,GAAU,mCAAmC,aAAa,CAAA,EAAA,EAAK,gBAAgB,MAAM,CAAA,CAAA,EAAI,gBAAgB,UAAU,CAAA,CAAA;AACzH,MAAA,IAAI,eAAA,CAAgB,WAAW,GAAA,EAAK;AAClC,QAAA,MAAM,IAAIG,qBAAc,OAAO,CAAA;AAAA,MACjC;AACA,MAAA,MAAM,IAAI,MAAM,OAAO,CAAA;AAAA,IACzB;AAEA,IAAA,MAAM,OAAA,GAAU,MAAM,eAAA,CAAgB,IAAA,EAAK;AAC3C,IAAA,IACE,OAAA,IACA,OAAA,CAAQ,MAAA,IACR,OAAA,CAAQ,MAAA,CAAO,MAAA,GAAS,CAAA,IACxB,OAAA,CAAQ,MAAA,CAAO,CAAC,CAAA,CAAE,IAAA,EAClB;AACA,MAAA,OAAO,QAAQ,MAAA,CAAO,CAAC,EAAE,IAAA,CAAK,SAAA,CAAU,GAAG,EAAE,CAAA;AAAA,IAC/C;AAEA,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,6BAAA,EAAgC,aAAa,CAAA,CAAE,CAAA;AAAA,EACjE;AACF;;;;"}
|
package/dist/package.json.cjs.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/backend-defaults",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0-next.0",
|
|
4
4
|
"description": "Backend defaults used by Backstage backend apps",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "node-library"
|
|
@@ -216,18 +216,18 @@
|
|
|
216
216
|
"@aws-sdk/credential-providers": "^3.350.0",
|
|
217
217
|
"@aws-sdk/types": "^3.347.0",
|
|
218
218
|
"@azure/storage-blob": "^12.5.0",
|
|
219
|
-
"@backstage/backend-app-api": "1.
|
|
219
|
+
"@backstage/backend-app-api": "1.4.0-next.0",
|
|
220
220
|
"@backstage/backend-dev-utils": "0.1.5",
|
|
221
|
-
"@backstage/backend-plugin-api": "1.5.
|
|
222
|
-
"@backstage/cli-node": "0.2.
|
|
223
|
-
"@backstage/config": "1.3.6
|
|
224
|
-
"@backstage/config-loader": "1.10.
|
|
221
|
+
"@backstage/backend-plugin-api": "1.5.1-next.0",
|
|
222
|
+
"@backstage/cli-node": "0.2.16-next.0",
|
|
223
|
+
"@backstage/config": "1.3.6",
|
|
224
|
+
"@backstage/config-loader": "1.10.7-next.0",
|
|
225
225
|
"@backstage/errors": "1.2.7",
|
|
226
|
-
"@backstage/integration": "1.18.
|
|
227
|
-
"@backstage/integration-aws-node": "0.1.19
|
|
228
|
-
"@backstage/plugin-auth-node": "0.6.
|
|
229
|
-
"@backstage/plugin-events-node": "0.4.
|
|
230
|
-
"@backstage/plugin-permission-node": "0.10.
|
|
226
|
+
"@backstage/integration": "1.18.3-next.0",
|
|
227
|
+
"@backstage/integration-aws-node": "0.1.19",
|
|
228
|
+
"@backstage/plugin-auth-node": "0.6.10-next.0",
|
|
229
|
+
"@backstage/plugin-events-node": "0.4.18-next.0",
|
|
230
|
+
"@backstage/plugin-permission-node": "0.10.7-next.0",
|
|
231
231
|
"@backstage/types": "1.2.2",
|
|
232
232
|
"@google-cloud/storage": "^7.0.0",
|
|
233
233
|
"@keyv/memcache": "^2.0.1",
|
|
@@ -240,7 +240,6 @@
|
|
|
240
240
|
"@types/express": "^4.17.6",
|
|
241
241
|
"archiver": "^7.0.0",
|
|
242
242
|
"base64-stream": "^1.0.0",
|
|
243
|
-
"better-sqlite3": "^12.0.0",
|
|
244
243
|
"compression": "^1.7.4",
|
|
245
244
|
"concat-stream": "^2.0.0",
|
|
246
245
|
"cookie": "^0.7.0",
|
|
@@ -284,9 +283,9 @@
|
|
|
284
283
|
},
|
|
285
284
|
"devDependencies": {
|
|
286
285
|
"@aws-sdk/util-stream-node": "^3.350.0",
|
|
287
|
-
"@backstage/backend-plugin-api": "1.5.
|
|
288
|
-
"@backstage/backend-test-utils": "1.10.
|
|
289
|
-
"@backstage/cli": "0.34.
|
|
286
|
+
"@backstage/backend-plugin-api": "1.5.1-next.0",
|
|
287
|
+
"@backstage/backend-test-utils": "1.10.1-next.0",
|
|
288
|
+
"@backstage/cli": "0.34.6-next.0",
|
|
290
289
|
"@google-cloud/cloud-sql-connector": "^1.4.0",
|
|
291
290
|
"@types/archiver": "^6.0.0",
|
|
292
291
|
"@types/base64-stream": "^1.0.2",
|
|
@@ -298,6 +297,7 @@
|
|
|
298
297
|
"@types/pg-format": "^1.0.5",
|
|
299
298
|
"@types/yauzl": "^2.10.0",
|
|
300
299
|
"aws-sdk-client-mock": "^4.0.0",
|
|
300
|
+
"better-sqlite3": "^12.0.0",
|
|
301
301
|
"http-errors": "^2.0.0",
|
|
302
302
|
"msw": "^1.0.0",
|
|
303
303
|
"node-mocks-http": "^1.0.0",
|
|
@@ -305,11 +305,15 @@
|
|
|
305
305
|
"wait-for-expect": "^3.0.2"
|
|
306
306
|
},
|
|
307
307
|
"peerDependencies": {
|
|
308
|
-
"@google-cloud/cloud-sql-connector": "^1.4.0"
|
|
308
|
+
"@google-cloud/cloud-sql-connector": "^1.4.0",
|
|
309
|
+
"better-sqlite3": "^12.0.0"
|
|
309
310
|
},
|
|
310
311
|
"peerDependenciesMeta": {
|
|
311
312
|
"@google-cloud/cloud-sql-connector": {
|
|
312
313
|
"optional": true
|
|
314
|
+
},
|
|
315
|
+
"better-sqlite3": {
|
|
316
|
+
"optional": true
|
|
313
317
|
}
|
|
314
318
|
},
|
|
315
319
|
"configSchema": "config.d.ts"
|