Skip to content

Commit

Permalink
extract type
Browse files Browse the repository at this point in the history
  • Loading branch information
fengelniederhammer committed Jan 21, 2025
1 parent bcf5fbb commit f5657a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/src/lapisApi/lapisTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ const insertionCount = z.object({
});
export const insertionsResponse = makeLapisResponse(z.array(insertionCount));

export const aggregatedItem = z.object({ count: z.number() }).catchall(z.union([z.string(), z.number(), z.null()]));
const baseResponseValueSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);

export const aggregatedItem = z.object({ count: z.number() }).catchall(baseResponseValueSchema);
export const aggregatedResponse = makeLapisResponse(z.array(aggregatedItem));
export type AggregatedItem = z.infer<typeof aggregatedItem>;

export const detailsItem = z.object({}).catchall(z.union([z.string(), z.number(), z.null()]));
export const detailsItem = z.object({}).catchall(baseResponseValueSchema);
export const detailsResponse = makeLapisResponse(z.array(detailsItem));
export type DetailsItem = z.infer<typeof detailsItem>;

Expand Down

0 comments on commit f5657a3

Please sign in to comment.