@backstage/core-app-api 1.19.2-next.0 → 1.19.2-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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @backstage/core-app-api
|
|
2
2
|
|
|
3
|
+
## 1.19.2-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b2bef92: Convert all enums to erasable-syntax compliant patterns
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/core-plugin-api@1.11.2-next.1
|
|
10
|
+
|
|
3
11
|
## 1.19.2-next.0
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})(ScopePriority || {});
|
|
1
|
+
const ScopePriority = {
|
|
2
|
+
default: 10,
|
|
3
|
+
app: 50,
|
|
4
|
+
static: 100
|
|
5
|
+
};
|
|
7
6
|
class ApiFactoryRegistry {
|
|
8
7
|
factories = /* @__PURE__ */ new Map();
|
|
9
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiFactoryRegistry.esm.js","sources":["../../../src/apis/system/ApiFactoryRegistry.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 { ApiFactoryHolder } from './types';\nimport {\n ApiRef,\n ApiFactory,\n AnyApiRef,\n AnyApiFactory,\n} from '@backstage/core-plugin-api';\n\n/**\n * Scope type when registering API factories.\n * @public\n */\nexport type ApiFactoryScope =\n | 'default' // Default factories registered by core and plugins\n | 'app' // Factories registered in the app, overriding default ones\n | 'static'; // APIs that can't be overridden, e.g. config\n\
|
|
1
|
+
{"version":3,"file":"ApiFactoryRegistry.esm.js","sources":["../../../src/apis/system/ApiFactoryRegistry.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 { ApiFactoryHolder } from './types';\nimport {\n ApiRef,\n ApiFactory,\n AnyApiRef,\n AnyApiFactory,\n} from '@backstage/core-plugin-api';\n\n/**\n * Scope type when registering API factories.\n * @public\n */\nexport type ApiFactoryScope =\n | 'default' // Default factories registered by core and plugins\n | 'app' // Factories registered in the app, overriding default ones\n | 'static'; // APIs that can't be overridden, e.g. config\n\nconst ScopePriority = {\n default: 10,\n app: 50,\n static: 100,\n} as const;\n\ntype FactoryTuple = {\n priority: number;\n factory: AnyApiFactory;\n};\n\n/**\n * ApiFactoryRegistry is an ApiFactoryHolder implementation that enables\n * registration of API Factories with different scope.\n *\n * Each scope has an assigned priority, where factories registered with\n * higher priority scopes override ones with lower priority.\n *\n * @public\n */\nexport class ApiFactoryRegistry implements ApiFactoryHolder {\n private readonly factories = new Map<string, FactoryTuple>();\n\n /**\n * Register a new API factory. Returns true if the factory was added\n * to the registry.\n *\n * A factory will not be added to the registry if there is already\n * an existing factory with the same or higher priority.\n */\n register<Api, Impl extends Api, Deps extends { [name in string]: unknown }>(\n scope: ApiFactoryScope,\n factory: ApiFactory<Api, Impl, Deps>,\n ) {\n const priority = ScopePriority[scope];\n const existing = this.factories.get(factory.api.id);\n if (existing && existing.priority >= priority) {\n return false;\n }\n\n this.factories.set(factory.api.id, { priority, factory });\n return true;\n }\n\n get<T>(\n api: ApiRef<T>,\n ): ApiFactory<T, T, { [x: string]: unknown }> | undefined {\n const tuple = this.factories.get(api.id);\n if (!tuple) {\n return undefined;\n }\n return tuple.factory as ApiFactory<T, T, { [x: string]: unknown }>;\n }\n\n getAllApis(): Set<AnyApiRef> {\n const refs = new Set<AnyApiRef>();\n for (const { factory } of this.factories.values()) {\n refs.add(factory.api);\n }\n return refs;\n }\n}\n"],"names":[],"mappings":"AAiCA,MAAM,aAAA,GAAgB;AAAA,EACpB,OAAA,EAAS,EAAA;AAAA,EACT,GAAA,EAAK,EAAA;AAAA,EACL,MAAA,EAAQ;AACV,CAAA;AAgBO,MAAM,kBAAA,CAA+C;AAAA,EACzC,SAAA,uBAAgB,GAAA,EAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS3D,QAAA,CACE,OACA,OAAA,EACA;AACA,IAAA,MAAM,QAAA,GAAW,cAAc,KAAK,CAAA;AACpC,IAAA,MAAM,WAAW,IAAA,CAAK,SAAA,CAAU,GAAA,CAAI,OAAA,CAAQ,IAAI,EAAE,CAAA;AAClD,IAAA,IAAI,QAAA,IAAY,QAAA,CAAS,QAAA,IAAY,QAAA,EAAU;AAC7C,MAAA,OAAO,KAAA;AAAA,IACT;AAEA,IAAA,IAAA,CAAK,SAAA,CAAU,IAAI,OAAA,CAAQ,GAAA,CAAI,IAAI,EAAE,QAAA,EAAU,SAAS,CAAA;AACxD,IAAA,OAAO,IAAA;AAAA,EACT;AAAA,EAEA,IACE,GAAA,EACwD;AACxD,IAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,SAAA,CAAU,GAAA,CAAI,IAAI,EAAE,CAAA;AACvC,IAAA,IAAI,CAAC,KAAA,EAAO;AACV,MAAA,OAAO,MAAA;AAAA,IACT;AACA,IAAA,OAAO,KAAA,CAAM,OAAA;AAAA,EACf;AAAA,EAEA,UAAA,GAA6B;AAC3B,IAAA,MAAM,IAAA,uBAAW,GAAA,EAAe;AAChC,IAAA,KAAA,MAAW,EAAE,OAAA,EAAQ,IAAK,IAAA,CAAK,SAAA,CAAU,QAAO,EAAG;AACjD,MAAA,IAAA,CAAK,GAAA,CAAI,QAAQ,GAAG,CAAA;AAAA,IACtB;AACA,IAAA,OAAO,IAAA;AAAA,EACT;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/core-app-api",
|
|
3
|
-
"version": "1.19.2-next.
|
|
3
|
+
"version": "1.19.2-next.1",
|
|
4
4
|
"description": "Core app API used by Backstage apps",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@backstage/config": "1.3.6-next.0",
|
|
54
|
-
"@backstage/core-plugin-api": "1.11.2-next.
|
|
54
|
+
"@backstage/core-plugin-api": "1.11.2-next.1",
|
|
55
55
|
"@backstage/types": "1.2.2",
|
|
56
56
|
"@backstage/version-bridge": "1.0.11",
|
|
57
57
|
"@types/prop-types": "^15.7.3",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"zod": "^3.22.4"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@backstage/cli": "0.34.5-next.
|
|
67
|
+
"@backstage/cli": "0.34.5-next.1",
|
|
68
68
|
"@backstage/test-utils": "1.7.13-next.0",
|
|
69
69
|
"@testing-library/dom": "^10.0.0",
|
|
70
70
|
"@testing-library/jest-dom": "^6.0.0",
|