/** * Response schemas for the CommonGrants API. * * These schemas define the structure of API responses, including success and error responses. * Generic schemas like `Ok`, `Paginated`, and `Filtered` can be used with other schemas. * * @packageDocumentation */ import { z } from "zod"; /** Default success response */ export declare const SuccessSchema: z.ZodObject<{ status: z.ZodNumber; message: z.ZodString; }, z.core.$strip>; /** * Template for a 200 response with data * * @template T The schema for the value of the `"data"` property in this response * @example How to specify a custom 200 response model * * ```typescript * // Define a schema * const CustomModelSchema = z.object({ * id: z.string(), * description: z.string(), * }); * * // Pass that schema to the `OkSchema` function * const CustomModel200Schema = OkSchema(CustomModelSchema); * ``` */ export declare const OkSchema: (dataSchema: T) => z.ZodObject<{ status: z.ZodNumber; message: z.ZodString; data: T; }, z.core.$strip>; /** * Template for a 200 response with paginated list of items * * @template T The schema for the value of the `"items"` property in this response * @example How to specify a custom paginated response model * * ```typescript * // Define a schema * const CustomModelSchema = z.object({ * id: z.string(), * description: z.string(), * }); * * // Pass that schema to the `PaginatedSchema` function * const CustomModelResponseSchema = PaginatedSchema(CustomModelSchema); * ``` */ export declare const PaginatedSchema: (itemsSchema: T) => z.ZodObject<{ status: z.ZodNumber; message: z.ZodString; items: z.ZodArray; paginationInfo: z.ZodObject<{ page: z.ZodNumber; pageSize: z.ZodNumber; totalItems: z.ZodOptional>; totalPages: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>; /** * A paginated list of items with a sort order * * @template T The schema for the value of the `"items"` property in this response * @example How to specify a custom sorted response model * * ```typescript * // Define a schema * const CustomModelSchema = z.object({ * id: z.string(), * description: z.string(), * }); * * // Pass that schema to the `SortedSchema` function * const CustomModelSortedResponseSchema = SortedSchema(CustomModelSchema); * ``` */ export declare const SortedSchema: (itemsSchema: T) => z.ZodObject<{ status: z.ZodNumber; message: z.ZodString; items: z.ZodArray; paginationInfo: z.ZodObject<{ page: z.ZodNumber; pageSize: z.ZodNumber; totalItems: z.ZodOptional>; totalPages: z.ZodOptional>; }, z.core.$strip>; sortInfo: z.ZodObject<{ sortBy: z.ZodString; customSortBy: z.ZodOptional>; sortOrder: z.ZodEnum<{ asc: "asc"; desc: "desc"; }>; errors: z.ZodOptional>>; }, z.core.$strip>; }, z.core.$strip>; /** * A paginated list of items with a filter * * @template ItemsT The schema for the value of the `"items"` property in this response * @template FilterT The schema for the value of the `"filter"` property in this response * @example How to specify a custom filtered response model * * ```typescript * // Define a schema for the items in the response * const CustomModelSchema = z.object({ * id: z.string(), * description: z.string(), * }); * * // Define a schema for the filter in the response * const CustomFilterSchema = z.object({ * lastModifiedAt: DateComparisonFilterSchema, * }); * * // Pass those schemas to the `FilteredSchema` function * const CustomModelFilteredResponseSchema = FilteredSchema(CustomModelSchema, CustomFilterSchema); * ``` */ export declare const FilteredSchema: (itemsSchema: ItemsT, filterSchema: FilterT) => z.ZodObject<{ status: z.ZodNumber; message: z.ZodString; items: z.ZodArray; paginationInfo: z.ZodObject<{ page: z.ZodNumber; pageSize: z.ZodNumber; totalItems: z.ZodOptional>; totalPages: z.ZodOptional>; }, z.core.$strip>; sortInfo: z.ZodObject<{ sortBy: z.ZodString; customSortBy: z.ZodOptional>; sortOrder: z.ZodEnum<{ asc: "asc"; desc: "desc"; }>; errors: z.ZodOptional>>; }, z.core.$strip>; filterInfo: z.ZodObject<{ filters: FilterT; errors: z.ZodOptional>>; }, z.core.$strict>; }, z.core.$strip>; /** * A 201 response with data * * @template T The schema for the value of the `"data"` property in this response * @example How to specify a custom 201 response model * * ```typescript * // Define a schema * const CustomModelSchema = z.object({ * id: z.string(), * description: z.string(), * }); * * // Pass that schema to the `CreatedSchema` function * const CustomModel201Schema = CreatedSchema(CustomModelSchema); * ``` */ export declare const CreatedSchema: (dataSchema: T) => z.ZodObject<{ status: z.ZodNumber; message: z.ZodString; data: T; }, z.core.$strip>; /** A standard error response schema */ export declare const ErrorSchema: z.ZodObject<{ status: z.ZodNumber; message: z.ZodString; errors: z.ZodArray; }, z.core.$strip>; /** A 401 Unauthorized error response */ export declare const UnauthorizedSchema: z.ZodObject<{ message: z.ZodString; errors: z.ZodArray; status: z.ZodLiteral<401>; }, z.core.$strip>; /** A 404 Not Found error response */ export declare const NotFoundSchema: z.ZodObject<{ message: z.ZodString; errors: z.ZodArray; status: z.ZodLiteral<404>; }, z.core.$strip>; /** A failure to submit an application due to validation errors */ export declare const ApplicationSubmissionErrorSchema: z.ZodObject<{ message: z.ZodString; errors: z.ZodArray; status: z.ZodLiteral<400>; }, z.core.$strip>; //# sourceMappingURL=responses.d.ts.map