Skip to content

Commit

Permalink
Update SignedApiResponse schema (#120)
Browse files Browse the repository at this point in the history
* Update SignedApiResponse schema
  • Loading branch information
aquarat authored Nov 21, 2023
1 parent 6baac21 commit 5af2da4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/api/src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ export const batchInsertData = async (requestBody: unknown): Promise<ApiResponse
return {
statusCode: 201,
headers: COMMON_HEADERS,
body: JSON.stringify({ count: newSignedData.length, skipped: batchSignedData.length - newSignedData.length }),
body: JSON.stringify({
count: newSignedData.length,
skipped: batchSignedData.length - newSignedData.length,
}),
};
};

Expand Down
1 change: 1 addition & 0 deletions packages/pusher/src/validation/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ export const secretsSchema = z.record(z.string());

export const signedApiResponseSchema = z.strictObject({
count: z.number(),
skipped: z.number(),
});

export type SignedApiResponse = z.infer<typeof signedApiResponseSchema>;
Expand Down
2 changes: 1 addition & 1 deletion packages/pusher/test/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const signedApiResponse: Partial<AxiosResponse> = {
'access-control-allow-origin': '*',
'access-control-allow-methods': '*',
},
data: { count: 3 },
data: { count: 3, skipped: 1 },
};

export const verifyHeartbeatLog = (heartbeatPayload: HeartbeatPayload, rawConfig: string) => {
Expand Down

0 comments on commit 5af2da4

Please sign in to comment.