@backstage/backend-plugin-api 1.2.0-next.0 → 1.2.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 +17 -0
- package/dist/alpha.cjs.js +0 -5
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/alpha.d.ts +1 -14
- package/dist/index.d.ts +15 -7
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @backstage/backend-plugin-api
|
|
2
2
|
|
|
3
|
+
## 1.2.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 92a56f6: **BREAKING ALPHA**: Removed the deprecated `featureDiscoveryServiceRef` and `FeatureDiscoveryService`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @backstage/plugin-auth-node@0.6.0-next.1
|
|
13
|
+
- @backstage/cli-common@0.1.15
|
|
14
|
+
- @backstage/config@1.3.2
|
|
15
|
+
- @backstage/errors@1.2.7
|
|
16
|
+
- @backstage/types@1.2.1
|
|
17
|
+
- @backstage/plugin-permission-common@0.8.4
|
|
18
|
+
- @backstage/plugin-permission-node@0.8.8-next.1
|
|
19
|
+
|
|
3
20
|
## 1.2.0-next.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/dist/alpha.cjs.js
CHANGED
|
@@ -2,14 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
4
4
|
|
|
5
|
-
const featureDiscoveryServiceRef = backendPluginApi.createServiceRef({
|
|
6
|
-
id: "core.featureDiscovery",
|
|
7
|
-
scope: "root"
|
|
8
|
-
});
|
|
9
5
|
const instanceMetadataServiceRef = backendPluginApi.createServiceRef({
|
|
10
6
|
id: "core.instanceMetadata"
|
|
11
7
|
});
|
|
12
8
|
|
|
13
|
-
exports.featureDiscoveryServiceRef = featureDiscoveryServiceRef;
|
|
14
9
|
exports.instanceMetadataServiceRef = instanceMetadataServiceRef;
|
|
15
10
|
//# sourceMappingURL=alpha.cjs.js.map
|
package/dist/alpha.cjs.js.map
CHANGED
|
@@ -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 {
|
|
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 { createServiceRef } from '@backstage/backend-plugin-api';\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":";;;;AAuBO,MAAM,6BAA6BA,iCAExC,CAAA;AAAA,EACA,EAAI,EAAA;AACN,CAAC;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
2
|
-
import { BackendFeature } from '@backstage/backend-plugin-api';
|
|
3
2
|
|
|
4
3
|
/** @alpha */
|
|
5
4
|
type BackendFeatureMeta = {
|
|
@@ -15,18 +14,6 @@ interface InstanceMetadataService {
|
|
|
15
14
|
getInstalledFeatures: () => BackendFeatureMeta[];
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
/** @alpha */
|
|
19
|
-
interface FeatureDiscoveryService {
|
|
20
|
-
getBackendFeatures(): Promise<{
|
|
21
|
-
features: Array<BackendFeature>;
|
|
22
|
-
}>;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* An optional service that can be used to dynamically load in additional BackendFeatures at runtime.
|
|
26
|
-
* @alpha
|
|
27
|
-
* @deprecated The `featureDiscoveryServiceRef` is deprecated in favor of using {@link @backstage/backend-defaults#discoveryFeatureLoader} instead.
|
|
28
|
-
*/
|
|
29
|
-
declare const featureDiscoveryServiceRef: _backstage_backend_plugin_api.ServiceRef<FeatureDiscoveryService, "root", "singleton">;
|
|
30
17
|
/**
|
|
31
18
|
* EXPERIMENTAL: Instance metadata service.
|
|
32
19
|
*
|
|
@@ -34,4 +21,4 @@ declare const featureDiscoveryServiceRef: _backstage_backend_plugin_api.ServiceR
|
|
|
34
21
|
*/
|
|
35
22
|
declare const instanceMetadataServiceRef: _backstage_backend_plugin_api.ServiceRef<InstanceMetadataService, "plugin", "singleton">;
|
|
36
23
|
|
|
37
|
-
export { type BackendFeatureMeta, type
|
|
24
|
+
export { type BackendFeatureMeta, type InstanceMetadataService, instanceMetadataServiceRef };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { JsonObject, HumanDuration, JsonValue } from '@backstage/types';
|
|
|
3
3
|
import { Request, Response, Handler } from 'express';
|
|
4
4
|
import { PermissionAttributes, EvaluatorRequestOptions, PermissionEvaluator, AuthorizePermissionRequest, AuthorizePermissionResponse, QueryPermissionRequest, QueryPermissionResponse, Permission } from '@backstage/plugin-permission-common';
|
|
5
5
|
import { Knex } from 'knex';
|
|
6
|
-
import { PermissionRule } from '@backstage/plugin-permission-node';
|
|
6
|
+
import { PermissionResourceRef, PermissionRule, PermissionRuleset } from '@backstage/plugin-permission-node';
|
|
7
7
|
import { Config } from '@backstage/config';
|
|
8
8
|
import { Duration } from 'luxon';
|
|
9
9
|
import { Readable } from 'stream';
|
|
@@ -661,11 +661,11 @@ type NoInfer<T> = T extends infer S ? S : never;
|
|
|
661
661
|
*
|
|
662
662
|
* @public
|
|
663
663
|
*/
|
|
664
|
-
type PermissionsRegistryServiceAddResourceTypeOptions<TResourceType extends string, TResource> = {
|
|
664
|
+
type PermissionsRegistryServiceAddResourceTypeOptions<TResourceType extends string, TResource, TQuery> = {
|
|
665
665
|
/**
|
|
666
|
-
* The
|
|
666
|
+
* The {@link @backstage/plugin-permission-node#PermissionResourceRef} that identifies the resource type.
|
|
667
667
|
*/
|
|
668
|
-
|
|
668
|
+
resourceRef: PermissionResourceRef<TResource, TQuery, TResourceType>;
|
|
669
669
|
/**
|
|
670
670
|
* Permissions that are available for this resource type.
|
|
671
671
|
*/
|
|
@@ -673,7 +673,7 @@ type PermissionsRegistryServiceAddResourceTypeOptions<TResourceType extends stri
|
|
|
673
673
|
/**
|
|
674
674
|
* Permission rules that are available for this resource type.
|
|
675
675
|
*/
|
|
676
|
-
rules: PermissionRule<TResource
|
|
676
|
+
rules: PermissionRule<NoInfer<TResource>, NoInfer<TQuery>, NoInfer<TResourceType>>[];
|
|
677
677
|
/**
|
|
678
678
|
* The function used to load associated resources based in the provided
|
|
679
679
|
* references.
|
|
@@ -684,7 +684,7 @@ type PermissionsRegistryServiceAddResourceTypeOptions<TResourceType extends stri
|
|
|
684
684
|
* resolve conditional decisions except when requesting resources directly
|
|
685
685
|
* from the plugin.
|
|
686
686
|
*/
|
|
687
|
-
getResources?(resourceRefs: string[]): Promise<Array<TResource | undefined>>;
|
|
687
|
+
getResources?(resourceRefs: string[]): Promise<Array<NoInfer<TResource> | undefined>>;
|
|
688
688
|
};
|
|
689
689
|
/**
|
|
690
690
|
* Permission system integration for registering resources and permissions.
|
|
@@ -744,7 +744,15 @@ interface PermissionsRegistryService {
|
|
|
744
744
|
* called by the `permission-backend` when authorization conditions relating
|
|
745
745
|
* to this plugin need to be evaluated.
|
|
746
746
|
*/
|
|
747
|
-
addResourceType<const TResourceType extends string, TResource>(options: PermissionsRegistryServiceAddResourceTypeOptions<TResourceType, TResource>): void;
|
|
747
|
+
addResourceType<const TResourceType extends string, TResource, TQuery>(options: PermissionsRegistryServiceAddResourceTypeOptions<TResourceType, TResource, TQuery>): void;
|
|
748
|
+
/**
|
|
749
|
+
* Returns the set of registered rules for this resource.
|
|
750
|
+
*
|
|
751
|
+
* @remarks
|
|
752
|
+
*
|
|
753
|
+
* Primarily intended for use with {@link @backstage/plugin-permission-node#createConditionAuthorizer} and {@link @backstage/plugin-permission-node#createConditionTransformer}.
|
|
754
|
+
*/
|
|
755
|
+
getPermissionRuleset<TResourceType extends string, TResource, TQuery>(resourceRef: PermissionResourceRef<TResource, TQuery, TResourceType>): PermissionRuleset<TResource, TQuery, TResourceType>;
|
|
748
756
|
}
|
|
749
757
|
|
|
750
758
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/backend-plugin-api",
|
|
3
|
-
"version": "1.2.0-next.
|
|
3
|
+
"version": "1.2.0-next.1",
|
|
4
4
|
"description": "Core API used by Backstage backend plugins",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "node-library"
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"@backstage/cli-common": "0.1.15",
|
|
69
69
|
"@backstage/config": "1.3.2",
|
|
70
70
|
"@backstage/errors": "1.2.7",
|
|
71
|
-
"@backstage/plugin-auth-node": "0.
|
|
71
|
+
"@backstage/plugin-auth-node": "0.6.0-next.1",
|
|
72
72
|
"@backstage/plugin-permission-common": "0.8.4",
|
|
73
|
-
"@backstage/plugin-permission-node": "0.8.8-next.
|
|
73
|
+
"@backstage/plugin-permission-node": "0.8.8-next.1",
|
|
74
74
|
"@backstage/types": "1.2.1",
|
|
75
75
|
"@types/express": "^4.17.6",
|
|
76
76
|
"@types/luxon": "^3.0.0",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"luxon": "^3.0.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@backstage/backend-test-utils": "1.3.0-next.
|
|
82
|
-
"@backstage/cli": "0.30.0-next.
|
|
81
|
+
"@backstage/backend-test-utils": "1.3.0-next.2",
|
|
82
|
+
"@backstage/cli": "0.30.0-next.2"
|
|
83
83
|
},
|
|
84
84
|
"configSchema": "config.d.ts"
|
|
85
85
|
}
|