chore: build api-reports

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2025-02-07 13:45:48 +01:00
committed by benjdlambert
parent e2d82fc3d8
commit 4abd0747cb
5 changed files with 28 additions and 10 deletions
@@ -55,6 +55,8 @@ describe('createTemplateAction', () => {
ctx.output('test2', 'value');
},
});
expect(action).toBeDefined();
});
it('should allow creating with zod and use the old deprecated types', () => {
@@ -87,6 +89,8 @@ describe('createTemplateAction', () => {
ctx.output('test2', 'value');
},
});
expect(action).toBeDefined();
});
it('should allow creating with new first class zod support', () => {
@@ -121,5 +125,7 @@ describe('createTemplateAction', () => {
ctx.output('test2', 'value');
},
});
expect(action).toBeDefined();
});
});
@@ -92,6 +92,7 @@ export function createTemplateAction<
TInputSchema
>;
/**
* @public
* @deprecated migrate to using the new built in zod schema definitions for schemas
*/
export function createTemplateAction<
@@ -110,6 +111,7 @@ export function createTemplateAction<
>,
): TemplateAction<TActionInput, TActionOutput, TInputSchema>;
/**
* @public
* @deprecated migrate to using the new built in zod schema definitions for schemas
*/
export function createTemplateAction<
@@ -167,7 +169,7 @@ export function createTemplateAction<
TInputSchema,
TOutputSchema
>,
): TemplateAction<TActionInput, TActionOutput, TInputSchema> {
): TemplateAction<TActionInput, TActionOutput, TInputSchema, TOutputSchema> {
const { inputSchema, outputSchema } = parseSchemas(action);
return {
+18 -3
View File
@@ -35,7 +35,12 @@ export type ActionContext<
TActionOutput extends JsonObject = JsonObject,
TInputSchema extends
| { [key in string]: (zImpl: typeof z) => z.ZodType }
| Schema = Schema,
| Schema
| unknown = unknown,
_TOutputSchema extends
| { [key in string]: (zImpl: typeof z) => z.ZodType }
| Schema
| unknown = unknown,
> = TInputSchema extends { [key in string]: (zImpl: typeof z) => z.ZodType }
? {
logger: LoggerService;
@@ -173,7 +178,12 @@ export type TemplateAction<
TActionOutput extends JsonObject = JsonObject,
TInputSchema extends
| { [key in string]: (zImpl: typeof z) => z.ZodType }
| Schema = Schema,
| Schema
| unknown = unknown,
TOutputSchema extends
| { [key in string]: (zImpl: typeof z) => z.ZodType }
| Schema
| unknown = unknown,
> = {
id: string;
description?: string;
@@ -184,6 +194,11 @@ export type TemplateAction<
output?: Schema;
};
handler: (
ctx: ActionContext<TActionInput, TActionOutput, TInputSchema>,
ctx: ActionContext<
TActionInput,
TActionOutput,
TInputSchema,
TOutputSchema
>,
) => Promise<void>;
};
+1 -1
View File
@@ -34,7 +34,7 @@ export * from './globals';
* @alpha
*/
export interface ScaffolderActionsExtensionPoint {
addActions(...actions: TemplateAction<any, any>[]): void;
addActions(...actions: TemplateAction<any, any, any>[]): void;
}
/**