@backstage/backend-plugin-api 1.8.0-next.1 → 1.8.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 CHANGED
@@ -1,5 +1,49 @@
1
1
  # @backstage/backend-plugin-api
2
2
 
3
+ ## 1.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cc8348e: Added optional `visibilityPermission` field to `ActionsRegistryActionOptions`, allowing actions to declare a `BasicPermission` that controls visibility and access.
8
+
9
+ ```typescript
10
+ import { createPermission } from '@backstage/plugin-permission-common';
11
+
12
+ const myPermission = createPermission({
13
+ name: 'myPlugin.myAction.use',
14
+ attributes: {},
15
+ });
16
+
17
+ actionsRegistry.register({
18
+ name: 'my-action',
19
+ title: 'My Action',
20
+ description: 'An action that requires permission',
21
+ visibilityPermission: myPermission,
22
+ schema: {
23
+ input: z => z.object({ name: z.string() }),
24
+ output: z => z.object({ ok: z.boolean() }),
25
+ },
26
+ action: async ({ input }) => {
27
+ return { output: { ok: true } };
28
+ },
29
+ });
30
+ ```
31
+
32
+ Actions without a `visibilityPermission` field continue to work as before.
33
+
34
+ - 015668c: Added `cancelTask` method to the `SchedulerService` interface and implementation, allowing cancellation of currently running scheduled tasks. For global tasks, the database lock is released and a periodic liveness check aborts the running task function. For local tasks, the task's abort signal is triggered directly. A new `POST /.backstage/scheduler/v1/tasks/:id/cancel` endpoint is also available.
35
+
36
+ ### Patch Changes
37
+
38
+ - dee4283: Added `pluginId` field to `ActionsServiceAction` type, populated from the registering plugin's metadata.
39
+ - 1ee5b28: Adds an alpha `MetricsService` to provide a unified interface for metrics instrumentation across Backstage plugins.
40
+ - a49a40d: Updated dependency `zod` to `^3.25.76 || ^4.0.0` & migrated to `/v3` or `/v4` imports.
41
+ - Updated dependencies
42
+ - @backstage/cli-common@0.2.0
43
+ - @backstage/plugin-permission-common@0.9.7
44
+ - @backstage/plugin-permission-node@0.10.11
45
+ - @backstage/plugin-auth-node@0.6.14
46
+
3
47
  ## 1.8.0-next.1
4
48
 
5
49
  ### Minor Changes
package/dist/alpha.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { AnyZodObject, z } from 'zod';
1
+ import { AnyZodObject, z } from 'zod/v3';
2
+ import { BasicPermission } from '@backstage/plugin-permission-common';
2
3
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
3
4
  import { LoggerService, BackstageCredentials } from '@backstage/backend-plugin-api';
4
5
  import { JsonObject, JsonValue } from '@backstage/types';
@@ -32,6 +33,7 @@ type ActionsRegistryActionOptions<TInputSchema extends AnyZodObject, TOutputSche
32
33
  input: (zod: typeof z) => TInputSchema;
33
34
  output: (zod: typeof z) => TOutputSchema;
34
35
  };
36
+ visibilityPermission?: BasicPermission;
35
37
  attributes?: {
36
38
  destructive?: boolean;
37
39
  idempotent?: boolean;
@@ -53,6 +55,7 @@ interface ActionsRegistryService {
53
55
  */
54
56
  type ActionsServiceAction = {
55
57
  id: string;
58
+ pluginId: string;
56
59
  name: string;
57
60
  title: string;
58
61
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/backend-plugin-api",
3
- "version": "1.8.0-next.1",
3
+ "version": "1.8.0",
4
4
  "description": "Core API used by Backstage backend plugins",
5
5
  "backstage": {
6
6
  "role": "node-library"
@@ -65,24 +65,24 @@
65
65
  "test": "backstage-cli package test"
66
66
  },
67
67
  "dependencies": {
68
- "@backstage/cli-common": "0.2.0-next.2",
69
- "@backstage/config": "1.3.6",
70
- "@backstage/errors": "1.2.7",
71
- "@backstage/plugin-auth-node": "0.6.14-next.2",
72
- "@backstage/plugin-permission-common": "0.9.6",
73
- "@backstage/plugin-permission-node": "0.10.11-next.1",
74
- "@backstage/types": "1.2.2",
68
+ "@backstage/cli-common": "^0.2.0",
69
+ "@backstage/config": "^1.3.6",
70
+ "@backstage/errors": "^1.2.7",
71
+ "@backstage/plugin-auth-node": "^0.6.14",
72
+ "@backstage/plugin-permission-common": "^0.9.7",
73
+ "@backstage/plugin-permission-node": "^0.10.11",
74
+ "@backstage/types": "^1.2.2",
75
75
  "@types/express": "^4.17.6",
76
76
  "@types/json-schema": "^7.0.6",
77
77
  "@types/luxon": "^3.0.0",
78
78
  "json-schema": "^0.4.0",
79
79
  "knex": "^3.0.0",
80
80
  "luxon": "^3.0.0",
81
- "zod": "^3.25.76"
81
+ "zod": "^3.25.76 || ^4.0.0"
82
82
  },
83
83
  "devDependencies": {
84
- "@backstage/backend-test-utils": "1.11.1-next.2",
85
- "@backstage/cli": "0.36.0-next.2"
84
+ "@backstage/backend-test-utils": "^1.11.1",
85
+ "@backstage/cli": "^0.36.0"
86
86
  },
87
87
  "configSchema": "config.d.ts"
88
88
  }