Skip to content

Commit

Permalink
chore: update V0 proxy request type and zod schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Utsab Chowdhury authored and Utsab Chowdhury committed Feb 5, 2024
1 parent 7ce0a66 commit 99f5cb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type ProxyV0Request = {
};
files?: Record<string, unknown>;
metadata: ProxyMetdata;
destinationConfig: Record<string, unknown>;
};

type ProxyV1Request = {
Expand Down
1 change: 1 addition & 0 deletions src/types/zodTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const ProxyV0RequestSchema = z.object({
.optional(),
files: z.record(z.unknown()).optional(),
metadata: ProxyMetadataSchema,
destinationConfig: z.record(z.unknown()),
});

export const ProxyV1RequestSchema = z.object({
Expand Down
7 changes: 6 additions & 1 deletion test/integrations/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,11 @@ export const compareObjects = (obj1, obj2, logPrefix = '', differences: string[]
return differences;
};

export const generateProxyV0Payload = (payloadParameters: any, metadataInput?: ProxyMetdata) => {
export const generateProxyV0Payload = (
payloadParameters: any,
metadataInput?: ProxyMetdata,
destinationConfig?: any,
) => {
let metadata: ProxyMetdata = {
jobId: 1,
attemptNum: 1,
Expand Down Expand Up @@ -411,6 +415,7 @@ export const generateProxyV0Payload = (payloadParameters: any, metadataInput?: P
},
files: payloadParameters.files || {},
metadata,
destinationConfig: destinationConfig || {},
};
return removeUndefinedAndNullValues(payload);
};
Expand Down

0 comments on commit 99f5cb2

Please sign in to comment.