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
+11 -11
View File
@@ -44,16 +44,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
? {
z.infer<TOutputSchema> extends void
? void
: {
output: z.infer<TOutputSchema>;
}
: void
>;
};
@@ -68,7 +68,7 @@ export interface ActionsRegistryService {
// @public (undocumented)
export interface ActionsService {
// (undocumented)
invokeAction(opts: {
invoke(opts: {
id: string;
input?: JsonObject;
credentials: BackstageCredentials;
@@ -76,7 +76,7 @@ export interface ActionsService {
output: JsonValue;
}>;
// (undocumented)
listActions: (opts: { credentials: BackstageCredentials }) => Promise<{
list: (opts: { credentials: BackstageCredentials }) => Promise<{
actions: ActionsServiceAction[];
}>;
}
@@ -87,9 +87,9 @@ export type ActionsServiceAction = {
name: string;
title: string;
description: string;
schema?: {
input?: JSONSchema7;
output?: JSONSchema7;
schema: {
input: JSONSchema7;
output: JSONSchema7;
};
};
@@ -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;