diff --git a/src/__tests__/if-run/builtins/copy-param.test.ts b/src/__tests__/if-run/builtins/copy-param.test.ts index 952546505..e6e197d2e 100644 --- a/src/__tests__/if-run/builtins/copy-param.test.ts +++ b/src/__tests__/if-run/builtins/copy-param.test.ts @@ -91,7 +91,7 @@ describe('builtins/copy: ', () => { } catch (error) { expect(error).toStrictEqual( new InputValidationError( - '"original" parameter is required. Error code: invalid_type.' + '"original" parameter is required. Error code: invalid_union.' ) ); } diff --git a/src/if-run/builtins/copy-param/index.ts b/src/if-run/builtins/copy-param/index.ts index 7f10bf696..0cfe81d3b 100644 --- a/src/if-run/builtins/copy-param/index.ts +++ b/src/if-run/builtins/copy-param/index.ts @@ -36,7 +36,7 @@ export const Copy = ( const globalConfigSchema = z.object({ 'keep-existing': z.boolean(), - from: z.string().min(1), + from: z.string().min(1).or(z.number()), to: z.string().min(1), }); @@ -51,7 +51,7 @@ export const Copy = ( */ const validateSingleInput = ( input: PluginParams, - inputParameters: string[] + inputParameters: (string | number)[] ) => { const inputData = inputParameters.reduce( (acc, param) => { @@ -59,10 +59,10 @@ export const Copy = ( return acc; }, - {} as Record + {} as Record ); - const validationSchema = z.record(z.string(), z.string()); + const validationSchema = z.record(z.string(), z.string().or(z.number())); validate(validationSchema, inputData);