@backstage/backend-plugin-api 1.0.2 → 1.1.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @backstage/backend-plugin-api
2
2
 
3
+ ## 1.1.0-next.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 12eac85: **EXPERIMENTAL**: Adds a new `instanceMetadataService` to hold information about a specific backend instance.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @backstage/plugin-auth-node@0.5.5-next.1
13
+ - @backstage/cli-common@0.1.15
14
+ - @backstage/config@1.3.0
15
+ - @backstage/errors@1.2.5
16
+ - @backstage/types@1.2.0
17
+ - @backstage/plugin-permission-common@0.8.2
18
+
19
+ ## 1.0.3-next.0
20
+
21
+ ### Patch Changes
22
+
23
+ - eef3ef1: Removed unused `express` dependencies.
24
+ - Updated dependencies
25
+ - @backstage/plugin-auth-node@0.5.5-next.0
26
+ - @backstage/cli-common@0.1.15
27
+ - @backstage/config@1.3.0
28
+ - @backstage/errors@1.2.5
29
+ - @backstage/types@1.2.0
30
+ - @backstage/plugin-permission-common@0.8.2
31
+
3
32
  ## 1.0.2
4
33
 
5
34
  ### 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
@@ -1,10 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  import { Readable } from 'stream';
3
3
  import { Config } from '@backstage/config';
4
- import { HumanDuration, JsonObject, JsonValue } from '@backstage/types';
4
+ import { JsonObject, HumanDuration, JsonValue } from '@backstage/types';
5
5
  import { Duration } from 'luxon';
6
6
  import { Handler, Request, Response } from 'express';
7
- import { PermissionAttributes, PermissionEvaluator, AuthorizePermissionRequest, EvaluatorRequestOptions, AuthorizePermissionResponse, QueryPermissionRequest, QueryPermissionResponse } from '@backstage/plugin-permission-common';
7
+ import { PermissionAttributes, EvaluatorRequestOptions, PermissionEvaluator, AuthorizePermissionRequest, AuthorizePermissionResponse, QueryPermissionRequest, QueryPermissionResponse } from '@backstage/plugin-permission-common';
8
8
  import { Knex } from 'knex';
9
9
  export { isChildPath } from '@backstage/cli-common';
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/backend-plugin-api",
3
- "version": "1.0.2",
3
+ "version": "1.1.0-next.1",
4
4
  "description": "Core API used by Backstage backend plugins",
5
5
  "backstage": {
6
6
  "role": "node-library"
@@ -65,21 +65,20 @@
65
65
  "test": "backstage-cli package test"
66
66
  },
67
67
  "dependencies": {
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.4",
72
- "@backstage/plugin-permission-common": "^0.8.2",
73
- "@backstage/types": "^1.2.0",
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.1",
72
+ "@backstage/plugin-permission-common": "0.8.2",
73
+ "@backstage/types": "1.2.0",
74
74
  "@types/express": "^4.17.6",
75
75
  "@types/luxon": "^3.0.0",
76
- "express": "^4.17.1",
77
76
  "knex": "^3.0.0",
78
77
  "luxon": "^3.0.0"
79
78
  },
80
79
  "devDependencies": {
81
- "@backstage/backend-test-utils": "^1.1.0",
82
- "@backstage/cli": "^0.29.0"
80
+ "@backstage/backend-test-utils": "1.2.0-next.1",
81
+ "@backstage/cli": "0.29.3-next.1"
83
82
  },
84
83
  "configSchema": "config.d.ts"
85
84
  }