@backstage/backend-plugin-api 1.0.3-next.0 → 1.1.0-next.2

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,37 @@
1
1
  # @backstage/backend-plugin-api
2
2
 
3
+ ## 1.1.0-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 0e9c9fa: The `RootLifecycleService` now has a new `addBeforeShutdownHook` method, and hooks added through this method will run immediately when a termination event is received.
8
+
9
+ The backend will not proceed with the shutdown and run the `Shutdown` hooks until all `BeforeShutdown` hooks have completed.
10
+
11
+ - Updated dependencies
12
+ - @backstage/errors@1.2.6-next.0
13
+ - @backstage/plugin-auth-node@0.5.5-next.2
14
+ - @backstage/cli-common@0.1.15
15
+ - @backstage/config@1.3.1-next.0
16
+ - @backstage/types@1.2.0
17
+ - @backstage/plugin-permission-common@0.8.3-next.0
18
+
19
+ ## 1.1.0-next.1
20
+
21
+ ### Minor Changes
22
+
23
+ - 12eac85: **EXPERIMENTAL**: Adds a new `instanceMetadataService` to hold information about a specific backend instance.
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+ - @backstage/plugin-auth-node@0.5.5-next.1
29
+ - @backstage/cli-common@0.1.15
30
+ - @backstage/config@1.3.0
31
+ - @backstage/errors@1.2.5
32
+ - @backstage/types@1.2.0
33
+ - @backstage/plugin-permission-common@0.8.2
34
+
3
35
  ## 1.0.3-next.0
4
36
 
5
37
  ### Patch Changes
package/dist/alpha.cjs.js CHANGED
@@ -6,6 +6,10 @@ const featureDiscoveryServiceRef = backendPluginApi.createServiceRef({
6
6
  id: "core.featureDiscovery",
7
7
  scope: "root"
8
8
  });
9
+ const instanceMetadataServiceRef = backendPluginApi.createServiceRef({
10
+ id: "core.instanceMetadata"
11
+ });
9
12
 
10
13
  exports.featureDiscoveryServiceRef = featureDiscoveryServiceRef;
14
+ exports.instanceMetadataServiceRef = instanceMetadataServiceRef;
11
15
  //# sourceMappingURL=alpha.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.cjs.js","sources":["../src/alpha.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BackendFeature,\n createServiceRef,\n} from '@backstage/backend-plugin-api';\n\n/** @alpha */\nexport interface FeatureDiscoveryService {\n getBackendFeatures(): Promise<{ features: Array<BackendFeature> }>;\n}\n\n/**\n * An optional service that can be used to dynamically load in additional BackendFeatures at runtime.\n * @alpha\n * @deprecated The `featureDiscoveryServiceRef` is deprecated in favor of using {@link @backstage/backend-defaults#discoveryFeatureLoader} instead.\n */\nexport const featureDiscoveryServiceRef =\n createServiceRef<FeatureDiscoveryService>({\n id: 'core.featureDiscovery',\n scope: 'root',\n });\n"],"names":["createServiceRef"],"mappings":";;;;AA+BO,MAAM,6BACXA,iCAA0C,CAAA;AAAA,EACxC,EAAI,EAAA,uBAAA;AAAA,EACJ,KAAO,EAAA;AACT,CAAC;;;;"}
1
+ {"version":3,"file":"alpha.cjs.js","sources":["../src/alpha.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BackendFeature,\n createServiceRef,\n} from '@backstage/backend-plugin-api';\n\n/** @alpha */\nexport interface FeatureDiscoveryService {\n getBackendFeatures(): Promise<{ features: Array<BackendFeature> }>;\n}\n\n/**\n * An optional service that can be used to dynamically load in additional BackendFeatures at runtime.\n * @alpha\n * @deprecated The `featureDiscoveryServiceRef` is deprecated in favor of using {@link @backstage/backend-defaults#discoveryFeatureLoader} instead.\n */\nexport const featureDiscoveryServiceRef =\n createServiceRef<FeatureDiscoveryService>({\n id: 'core.featureDiscovery',\n scope: 'root',\n });\n\n/**\n * EXPERIMENTAL: Instance metadata service.\n *\n * @alpha\n */\nexport const instanceMetadataServiceRef = createServiceRef<\n import('./services/definitions/InstanceMetadataService').InstanceMetadataService\n>({\n id: 'core.instanceMetadata',\n});\n\nexport type {\n BackendFeatureMeta,\n InstanceMetadataService,\n} from './services/definitions/InstanceMetadataService';\n"],"names":["createServiceRef"],"mappings":";;;;AA+BO,MAAM,6BACXA,iCAA0C,CAAA;AAAA,EACxC,EAAI,EAAA,uBAAA;AAAA,EACJ,KAAO,EAAA;AACT,CAAC;AAOI,MAAM,6BAA6BA,iCAExC,CAAA;AAAA,EACA,EAAI,EAAA;AACN,CAAC;;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -1,6 +1,20 @@
1
1
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
2
  import { BackendFeature } from '@backstage/backend-plugin-api';
3
3
 
4
+ /** @alpha */
5
+ type BackendFeatureMeta = {
6
+ type: 'plugin';
7
+ pluginId: string;
8
+ } | {
9
+ type: 'module';
10
+ pluginId: string;
11
+ moduleId: string;
12
+ };
13
+ /** @alpha */
14
+ interface InstanceMetadataService {
15
+ getInstalledFeatures: () => BackendFeatureMeta[];
16
+ }
17
+
4
18
  /** @alpha */
5
19
  interface FeatureDiscoveryService {
6
20
  getBackendFeatures(): Promise<{
@@ -13,5 +27,11 @@ interface FeatureDiscoveryService {
13
27
  * @deprecated The `featureDiscoveryServiceRef` is deprecated in favor of using {@link @backstage/backend-defaults#discoveryFeatureLoader} instead.
14
28
  */
15
29
  declare const featureDiscoveryServiceRef: _backstage_backend_plugin_api.ServiceRef<FeatureDiscoveryService, "root", "singleton">;
30
+ /**
31
+ * EXPERIMENTAL: Instance metadata service.
32
+ *
33
+ * @alpha
34
+ */
35
+ declare const instanceMetadataServiceRef: _backstage_backend_plugin_api.ServiceRef<InstanceMetadataService, "plugin", "singleton">;
16
36
 
17
- export { type FeatureDiscoveryService, featureDiscoveryServiceRef };
37
+ export { type BackendFeatureMeta, type FeatureDiscoveryService, type InstanceMetadataService, featureDiscoveryServiceRef, instanceMetadataServiceRef };
package/dist/index.d.ts CHANGED
@@ -726,6 +726,7 @@ interface LifecycleService {
726
726
  * @public
727
727
  */
728
728
  interface RootLifecycleService extends LifecycleService {
729
+ addBeforeShutdownHook(hook: () => void | Promise<void>): void;
729
730
  }
730
731
 
731
732
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/backend-plugin-api",
3
- "version": "1.0.3-next.0",
3
+ "version": "1.1.0-next.2",
4
4
  "description": "Core API used by Backstage backend plugins",
5
5
  "backstage": {
6
6
  "role": "node-library"
@@ -66,10 +66,10 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@backstage/cli-common": "0.1.15",
69
- "@backstage/config": "1.3.0",
70
- "@backstage/errors": "1.2.5",
71
- "@backstage/plugin-auth-node": "0.5.5-next.0",
72
- "@backstage/plugin-permission-common": "0.8.2",
69
+ "@backstage/config": "1.3.1-next.0",
70
+ "@backstage/errors": "1.2.6-next.0",
71
+ "@backstage/plugin-auth-node": "0.5.5-next.2",
72
+ "@backstage/plugin-permission-common": "0.8.3-next.0",
73
73
  "@backstage/types": "1.2.0",
74
74
  "@types/express": "^4.17.6",
75
75
  "@types/luxon": "^3.0.0",
@@ -77,8 +77,8 @@
77
77
  "luxon": "^3.0.0"
78
78
  },
79
79
  "devDependencies": {
80
- "@backstage/backend-test-utils": "1.2.0-next.0",
81
- "@backstage/cli": "0.29.3-next.0"
80
+ "@backstage/backend-test-utils": "1.2.0-next.2",
81
+ "@backstage/cli": "0.29.3-next.2"
82
82
  },
83
83
  "configSchema": "config.d.ts"
84
84
  }