UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

99 lines 8.19 kB
import { z } from 'zod'; /** * Schema factory utilities for creating consistent, reusable schema patterns * across all microservices. These factories reduce duplication and ensure * standardization of common API patterns. */ /** * Create a standardized list parameters schema with pagination, search, and caching * * @param extensions Additional service-specific parameters to merge * @returns Combined schema with standard list parameters plus service extensions */ export declare const createListParamsSchema: <T extends z.ZodRawShape>(extensions?: T) => z.ZodObject<{ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; orderBy: z.ZodOptional<z.ZodString>; } & { edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; } & { q: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { limit: number; offset: number; edgeCache?: 3 | 2 | 1 | 4 | 5 | 8 | undefined; q?: string | undefined; orderBy?: string | undefined; }, { limit?: number | undefined; offset?: number | undefined; edgeCache?: 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8" | undefined; q?: string | undefined; orderBy?: string | undefined; }> | z.ZodObject<z.objectUtil.extendShape<{ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; orderBy: z.ZodOptional<z.ZodString>; } & { edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; } & { q: z.ZodOptional<z.ZodString>; }, T>, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; orderBy: z.ZodOptional<z.ZodString>; } & { edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; } & { q: z.ZodOptional<z.ZodString>; }, T>>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; orderBy: z.ZodOptional<z.ZodString>; } & { edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; } & { q: z.ZodOptional<z.ZodString>; }, T>>, any>[k]; } : never, z.baseObjectInputType<z.objectUtil.extendShape<{ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; orderBy: z.ZodOptional<z.ZodString>; } & { edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; } & { q: z.ZodOptional<z.ZodString>; }, T>> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<z.objectUtil.extendShape<{ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; orderBy: z.ZodOptional<z.ZodString>; } & { edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; } & { q: z.ZodOptional<z.ZodString>; }, T>>[k_1]; } : never>; /** * Create a standardized get parameters schema with caching support * * @param extensions Additional service-specific parameters to merge * @returns Combined schema with caching parameters plus service extensions */ export declare const createGetParamsSchema: <T extends z.ZodRawShape>(extensions?: T) => z.ZodObject<{ edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; }, "strip", z.ZodTypeAny, { edgeCache?: 3 | 2 | 1 | 4 | 5 | 8 | undefined; }, { edgeCache?: 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8" | undefined; }> | z.ZodObject<z.objectUtil.extendShape<{ edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; }, T>, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{ edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; }, T>>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{ edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; }, T>>, any>[k]; } : never, z.baseObjectInputType<z.objectUtil.extendShape<{ edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; }, T>> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<z.objectUtil.extendShape<{ edgeCache: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<8>, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"8">]>, 3 | 2 | 1 | 4 | 5 | 8, 3 | 2 | 1 | 4 | "1" | 5 | 8 | "2" | "3" | "4" | "5" | "8">>; }, T>>[k_1]; } : never>; export type ListParamsSchema<T extends z.ZodRawShape = Record<string, never>> = ReturnType<typeof createListParamsSchema<T>>; export type GetParamsSchema<T extends z.ZodRawShape = Record<string, never>> = ReturnType<typeof createGetParamsSchema<T>>; //# sourceMappingURL=schema-factories.d.ts.map