@backstage/backend-plugin-api 1.9.1 → 1.9.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,19 @@
1
1
  # @backstage/backend-plugin-api
2
2
 
3
+ ## 1.9.2-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0211390: Added optional `secrets` schema support to `ActionsRegistryActionOptions` and `ActionsRegistryActionContext`. Actions can now declare a Zod secrets schema separate from the input schema, enabling surfaces to collect sensitive credentials independently from tool arguments. Added optional `secrets` field to `ActionsServiceAction` metadata and `ActionsService.invoke()` parameters.
8
+
9
+ ## 1.9.2-next.0
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+ - @backstage/plugin-auth-node@0.7.2-next.0
15
+ - @backstage/plugin-permission-node@0.11.1-next.0
16
+
3
17
  ## 1.9.1
4
18
 
5
19
  ### Patch Changes
package/dist/alpha.d.ts CHANGED
@@ -18,8 +18,9 @@ interface RootSystemMetadataService {
18
18
  /**
19
19
  * @alpha
20
20
  */
21
- type ActionsRegistryActionContext<TInputSchema extends AnyZodObject> = {
21
+ type ActionsRegistryActionContext<TInputSchema extends AnyZodObject, TSecretsSchema extends AnyZodObject | undefined = undefined> = {
22
22
  input: z.infer<TInputSchema>;
23
+ secrets: TSecretsSchema extends AnyZodObject ? z.infer<TSecretsSchema> : undefined;
23
24
  logger: LoggerService;
24
25
  credentials: BackstageCredentials;
25
26
  };
@@ -37,13 +38,14 @@ type ActionsRegistryActionExample<TInputSchema extends AnyZodObject, TOutputSche
37
38
  /**
38
39
  * @alpha
39
40
  */
40
- type ActionsRegistryActionOptions<TInputSchema extends AnyZodObject, TOutputSchema extends AnyZodObject> = {
41
+ type ActionsRegistryActionOptions<TInputSchema extends AnyZodObject, TOutputSchema extends AnyZodObject, TSecretsSchema extends AnyZodObject | undefined = undefined> = {
41
42
  name: string;
42
43
  title: string;
43
44
  description: string;
44
45
  schema: {
45
46
  input: (zod: typeof z) => TInputSchema;
46
47
  output: (zod: typeof z) => TOutputSchema;
48
+ secrets?: (zod: typeof z) => TSecretsSchema extends AnyZodObject ? TSecretsSchema : never;
47
49
  };
48
50
  examples?: Array<ActionsRegistryActionExample<TInputSchema, TOutputSchema>>;
49
51
  visibilityPermission?: BasicPermission;
@@ -52,7 +54,7 @@ type ActionsRegistryActionOptions<TInputSchema extends AnyZodObject, TOutputSche
52
54
  idempotent?: boolean;
53
55
  readOnly?: boolean;
54
56
  };
55
- action: (context: ActionsRegistryActionContext<TInputSchema>) => Promise<z.infer<TOutputSchema> extends void ? void : {
57
+ action: (context: ActionsRegistryActionContext<TInputSchema, TSecretsSchema>) => Promise<z.infer<TOutputSchema> extends void ? void : {
56
58
  output: z.infer<TOutputSchema>;
57
59
  }>;
58
60
  };
@@ -60,7 +62,7 @@ type ActionsRegistryActionOptions<TInputSchema extends AnyZodObject, TOutputSche
60
62
  * @alpha
61
63
  */
62
64
  interface ActionsRegistryService {
63
- register<TInputSchema extends AnyZodObject, TOutputSchema extends AnyZodObject>(options: ActionsRegistryActionOptions<TInputSchema, TOutputSchema>): void;
65
+ register<TInputSchema extends AnyZodObject, TOutputSchema extends AnyZodObject, TSecretsSchema extends AnyZodObject | undefined = undefined>(options: ActionsRegistryActionOptions<TInputSchema, TOutputSchema, TSecretsSchema>): void;
64
66
  }
65
67
 
66
68
  /**
@@ -75,6 +77,7 @@ type ActionsServiceAction = {
75
77
  schema: {
76
78
  input: JSONSchema7;
77
79
  output: JSONSchema7;
80
+ secrets?: JSONSchema7;
78
81
  };
79
82
  examples?: Array<{
80
83
  title: string;
@@ -100,6 +103,7 @@ interface ActionsService {
100
103
  invoke(opts: {
101
104
  id: string;
102
105
  input?: JsonObject;
106
+ secrets?: JsonObject;
103
107
  credentials: BackstageCredentials;
104
108
  }): Promise<{
105
109
  output: JsonValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/backend-plugin-api",
3
- "version": "1.9.1",
3
+ "version": "1.9.2-next.1",
4
4
  "description": "Core API used by Backstage backend plugins",
5
5
  "backstage": {
6
6
  "role": "node-library"
@@ -65,13 +65,13 @@
65
65
  "test": "backstage-cli package test"
66
66
  },
67
67
  "dependencies": {
68
- "@backstage/cli-common": "^0.2.2",
69
- "@backstage/config": "^1.3.8",
70
- "@backstage/errors": "^1.3.1",
71
- "@backstage/plugin-auth-node": "^0.7.1",
72
- "@backstage/plugin-permission-common": "^0.9.9",
73
- "@backstage/plugin-permission-node": "^0.11.0",
74
- "@backstage/types": "^1.2.2",
68
+ "@backstage/cli-common": "0.2.2",
69
+ "@backstage/config": "1.3.8",
70
+ "@backstage/errors": "1.3.1",
71
+ "@backstage/plugin-auth-node": "0.7.2-next.0",
72
+ "@backstage/plugin-permission-common": "0.9.9",
73
+ "@backstage/plugin-permission-node": "0.11.1-next.0",
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",
@@ -81,8 +81,8 @@
81
81
  "zod": "^3.25.76 || ^4.0.0"
82
82
  },
83
83
  "devDependencies": {
84
- "@backstage/backend-test-utils": "^1.11.3",
85
- "@backstage/cli": "^0.36.2"
84
+ "@backstage/backend-test-utils": "1.11.4-next.1",
85
+ "@backstage/cli": "0.36.3-next.1"
86
86
  },
87
87
  "configSchema": "config.d.ts"
88
88
  }