chore: code review comments

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2025-05-27 14:19:41 +02:00
parent 2d2d97e12b
commit a9219496d5
11 changed files with 115 additions and 77 deletions
@@ -36,14 +36,16 @@ export type ActionsRegistryActionOptions<
name: string;
title: string;
description: string;
schema?: {
input?: (zod: typeof z) => TInputSchema;
output?: (zod: typeof z) => TOutputSchema;
schema: {
input: (zod: typeof z) => TInputSchema;
output: (zod: typeof z) => TOutputSchema;
};
action: (
context: ActionsRegistryActionContext<TInputSchema>,
) => Promise<
TOutputSchema extends ZodType ? { output: z.infer<TOutputSchema> } : void
z.infer<TOutputSchema> extends void
? void
: { output: z.infer<TOutputSchema> }
>;
};
@@ -25,9 +25,9 @@ export type ActionsServiceAction = {
name: string;
title: string;
description: string;
schema?: {
input?: JSONSchema7;
output?: JSONSchema7;
schema: {
input: JSONSchema7;
output: JSONSchema7;
};
};
@@ -35,10 +35,10 @@ export type ActionsServiceAction = {
* @public
*/
export interface ActionsService {
listActions: (opts: {
list: (opts: {
credentials: BackstageCredentials;
}) => Promise<{ actions: ActionsServiceAction[] }>;
invokeAction(opts: {
invoke(opts: {
id: string;
input?: JsonObject;
credentials: BackstageCredentials;