UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

1,160 lines 40.1 kB
import { z } from 'zod'; /** * Custom Zod schema for MySQL datetime format * Matches format: YYYY-MM-DD HH:mm:ss */ export declare const mysqlDatetimeSchema: () => z.ZodString; /** * Standard error response data structure * Matches the BaseResponse pattern but for error scenarios */ export declare const ErrorResponseDataSchema: z.ZodObject<{ /** Error code identifier */ code: z.ZodString; /** Human-readable error message */ message: z.ZodString; /** Optional error details for debugging */ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; /** Timestamp of when the error occurred */ timestamp: z.ZodOptional<z.ZodString>; /** Request ID for tracking */ requestId: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { code: string; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: string; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; /** * Validation error details schema * Used when request parameters or body fail validation */ export declare const ValidationErrorDetailSchema: z.ZodObject<{ /** Field path that failed validation */ field: z.ZodString; /** Validation error message */ message: z.ZodString; /** Error code (e.g., 'required', 'invalid_type', 'too_small') */ code: z.ZodString; /** Value that was received */ received: z.ZodOptional<z.ZodUnknown>; /** Value that was expected */ expected: z.ZodOptional<z.ZodUnknown>; }, "strip", z.ZodTypeAny, { code: string; message: string; field: string; received?: unknown; expected?: unknown; }, { code: string; message: string; field: string; received?: unknown; expected?: unknown; }>; /** * Validation error response data schema * Extends the base error response with validation-specific details */ export declare const ValidationErrorResponseDataSchema: z.ZodObject<{ /** Error code identifier */ code: z.ZodString; /** Human-readable error message */ message: z.ZodString; /** Optional error details for debugging */ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; /** Timestamp of when the error occurred */ timestamp: z.ZodOptional<z.ZodString>; /** Request ID for tracking */ requestId: z.ZodOptional<z.ZodString>; } & { /** Array of validation errors */ validationErrors: z.ZodArray<z.ZodObject<{ /** Field path that failed validation */ field: z.ZodString; /** Validation error message */ message: z.ZodString; /** Error code (e.g., 'required', 'invalid_type', 'too_small') */ code: z.ZodString; /** Value that was received */ received: z.ZodOptional<z.ZodUnknown>; /** Value that was expected */ expected: z.ZodOptional<z.ZodUnknown>; }, "strip", z.ZodTypeAny, { code: string; message: string; field: string; received?: unknown; expected?: unknown; }, { code: string; message: string; field: string; received?: unknown; expected?: unknown; }>, "many">; }, "strip", z.ZodTypeAny, { code: string; message: string; validationErrors: { code: string; message: string; field: string; received?: unknown; expected?: unknown; }[]; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: string; message: string; validationErrors: { code: string; message: string; field: string; received?: unknown; expected?: unknown; }[]; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; /** * Standard error response schema following BaseResponse pattern * All error responses MUST use this 8-field structure */ export declare const ErrorResponseSchema: z.ZodObject<{ count: z.ZodLiteral<0>; data: z.ZodObject<{ /** Error code identifier */ code: z.ZodString; /** Human-readable error message */ message: z.ZodString; /** Optional error details for debugging */ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; /** Timestamp of when the error occurred */ timestamp: z.ZodOptional<z.ZodString>; /** Request ID for tracking */ requestId: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { code: string; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: string; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; status: z.ZodNumber; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: string; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: number; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: string; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: number; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** * Validation error response schema following BaseResponse pattern * Used specifically for request validation failures (HTTP 400) */ export declare const ValidationErrorResponseSchema: z.ZodObject<{ count: z.ZodLiteral<0>; data: z.ZodObject<{ /** Error code identifier */ code: z.ZodString; /** Human-readable error message */ message: z.ZodString; /** Optional error details for debugging */ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; /** Timestamp of when the error occurred */ timestamp: z.ZodOptional<z.ZodString>; /** Request ID for tracking */ requestId: z.ZodOptional<z.ZodString>; } & { /** Array of validation errors */ validationErrors: z.ZodArray<z.ZodObject<{ /** Field path that failed validation */ field: z.ZodString; /** Validation error message */ message: z.ZodString; /** Error code (e.g., 'required', 'invalid_type', 'too_small') */ code: z.ZodString; /** Value that was received */ received: z.ZodOptional<z.ZodUnknown>; /** Value that was expected */ expected: z.ZodOptional<z.ZodUnknown>; }, "strip", z.ZodTypeAny, { code: string; message: string; field: string; received?: unknown; expected?: unknown; }, { code: string; message: string; field: string; received?: unknown; expected?: unknown; }>, "many">; }, "strip", z.ZodTypeAny, { code: string; message: string; validationErrors: { code: string; message: string; field: string; received?: unknown; expected?: unknown; }[]; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: string; message: string; validationErrors: { code: string; message: string; field: string; received?: unknown; expected?: unknown; }[]; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; status: z.ZodLiteral<400>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: string; message: string; validationErrors: { code: string; message: string; field: string; received?: unknown; expected?: unknown; }[]; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 400; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: string; message: string; validationErrors: { code: string; message: string; field: string; received?: unknown; expected?: unknown; }[]; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 400; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** * Common HTTP error response schemas * These provide standardized error responses for common HTTP status codes */ export declare const CommonErrorSchemas: { /** HTTP 400 - Bad Request (validation errors) */ readonly 400: z.ZodObject<{ count: z.ZodLiteral<0>; data: z.ZodObject<{ /** Error code identifier */ code: z.ZodString; /** Human-readable error message */ message: z.ZodString; /** Optional error details for debugging */ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; /** Timestamp of when the error occurred */ timestamp: z.ZodOptional<z.ZodString>; /** Request ID for tracking */ requestId: z.ZodOptional<z.ZodString>; } & { /** Array of validation errors */ validationErrors: z.ZodArray<z.ZodObject<{ /** Field path that failed validation */ field: z.ZodString; /** Validation error message */ message: z.ZodString; /** Error code (e.g., 'required', 'invalid_type', 'too_small') */ code: z.ZodString; /** Value that was received */ received: z.ZodOptional<z.ZodUnknown>; /** Value that was expected */ expected: z.ZodOptional<z.ZodUnknown>; }, "strip", z.ZodTypeAny, { code: string; message: string; field: string; received?: unknown; expected?: unknown; }, { code: string; message: string; field: string; received?: unknown; expected?: unknown; }>, "many">; }, "strip", z.ZodTypeAny, { code: string; message: string; validationErrors: { code: string; message: string; field: string; received?: unknown; expected?: unknown; }[]; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: string; message: string; validationErrors: { code: string; message: string; field: string; received?: unknown; expected?: unknown; }[]; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; status: z.ZodLiteral<400>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: string; message: string; validationErrors: { code: string; message: string; field: string; received?: unknown; expected?: unknown; }[]; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 400; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: string; message: string; validationErrors: { code: string; message: string; field: string; received?: unknown; expected?: unknown; }[]; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 400; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** HTTP 401 - Unauthorized (authentication required) */ readonly 401: z.ZodObject<{ count: z.ZodLiteral<0>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; } & { status: z.ZodLiteral<401>; data: z.ZodObject<{ message: z.ZodString; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; timestamp: z.ZodOptional<z.ZodString>; requestId: z.ZodOptional<z.ZodString>; } & { code: z.ZodLiteral<"AUTHENTICATION_REQUIRED">; }, "strip", z.ZodTypeAny, { code: "AUTHENTICATION_REQUIRED"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: "AUTHENTICATION_REQUIRED"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: "AUTHENTICATION_REQUIRED"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 401; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: "AUTHENTICATION_REQUIRED"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 401; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** HTTP 403 - Forbidden (insufficient permissions) */ readonly 403: z.ZodObject<{ count: z.ZodLiteral<0>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; } & { status: z.ZodLiteral<403>; data: z.ZodObject<{ message: z.ZodString; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; timestamp: z.ZodOptional<z.ZodString>; requestId: z.ZodOptional<z.ZodString>; } & { code: z.ZodLiteral<"INSUFFICIENT_PERMISSIONS">; }, "strip", z.ZodTypeAny, { code: "INSUFFICIENT_PERMISSIONS"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: "INSUFFICIENT_PERMISSIONS"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: "INSUFFICIENT_PERMISSIONS"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 403; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: "INSUFFICIENT_PERMISSIONS"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 403; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** HTTP 404 - Not Found (resource not found) */ readonly 404: z.ZodObject<{ count: z.ZodLiteral<0>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; } & { status: z.ZodLiteral<404>; data: z.ZodObject<{ message: z.ZodString; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; timestamp: z.ZodOptional<z.ZodString>; requestId: z.ZodOptional<z.ZodString>; } & { code: z.ZodLiteral<"RESOURCE_NOT_FOUND">; }, "strip", z.ZodTypeAny, { code: "RESOURCE_NOT_FOUND"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: "RESOURCE_NOT_FOUND"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: "RESOURCE_NOT_FOUND"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 404; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: "RESOURCE_NOT_FOUND"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 404; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** HTTP 409 - Conflict (resource already exists or conflict) */ readonly 409: z.ZodObject<{ count: z.ZodLiteral<0>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; } & { status: z.ZodLiteral<409>; data: z.ZodObject<{ message: z.ZodString; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; timestamp: z.ZodOptional<z.ZodString>; requestId: z.ZodOptional<z.ZodString>; } & { code: z.ZodLiteral<"RESOURCE_CONFLICT">; }, "strip", z.ZodTypeAny, { code: "RESOURCE_CONFLICT"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: "RESOURCE_CONFLICT"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: "RESOURCE_CONFLICT"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 409; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: "RESOURCE_CONFLICT"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 409; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** HTTP 422 - Unprocessable Entity (business logic errors) */ readonly 422: z.ZodObject<{ count: z.ZodLiteral<0>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; } & { status: z.ZodLiteral<422>; data: z.ZodObject<{ message: z.ZodString; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; timestamp: z.ZodOptional<z.ZodString>; requestId: z.ZodOptional<z.ZodString>; } & { code: z.ZodLiteral<"BUSINESS_LOGIC_ERROR">; }, "strip", z.ZodTypeAny, { code: "BUSINESS_LOGIC_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: "BUSINESS_LOGIC_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: "BUSINESS_LOGIC_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 422; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: "BUSINESS_LOGIC_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 422; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** HTTP 429 - Too Many Requests (rate limiting) */ readonly 429: z.ZodObject<{ count: z.ZodLiteral<0>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; } & { status: z.ZodLiteral<429>; data: z.ZodObject<{ message: z.ZodString; timestamp: z.ZodOptional<z.ZodString>; requestId: z.ZodOptional<z.ZodString>; } & { code: z.ZodLiteral<"RATE_LIMIT_EXCEEDED">; details: z.ZodOptional<z.ZodObject<{ retryAfter: z.ZodOptional<z.ZodNumber>; limit: z.ZodOptional<z.ZodNumber>; remaining: z.ZodOptional<z.ZodNumber>; resetTime: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { limit?: number | undefined; retryAfter?: number | undefined; remaining?: number | undefined; resetTime?: string | undefined; }, { limit?: number | undefined; retryAfter?: number | undefined; remaining?: number | undefined; resetTime?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { code: "RATE_LIMIT_EXCEEDED"; message: string; details?: { limit?: number | undefined; retryAfter?: number | undefined; remaining?: number | undefined; resetTime?: string | undefined; } | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: "RATE_LIMIT_EXCEEDED"; message: string; details?: { limit?: number | undefined; retryAfter?: number | undefined; remaining?: number | undefined; resetTime?: string | undefined; } | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: "RATE_LIMIT_EXCEEDED"; message: string; details?: { limit?: number | undefined; retryAfter?: number | undefined; remaining?: number | undefined; resetTime?: string | undefined; } | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 429; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: "RATE_LIMIT_EXCEEDED"; message: string; details?: { limit?: number | undefined; retryAfter?: number | undefined; remaining?: number | undefined; resetTime?: string | undefined; } | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 429; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** HTTP 500 - Internal Server Error */ readonly 500: z.ZodObject<{ count: z.ZodLiteral<0>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; } & { status: z.ZodLiteral<500>; data: z.ZodObject<{ message: z.ZodString; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; timestamp: z.ZodOptional<z.ZodString>; requestId: z.ZodOptional<z.ZodString>; } & { code: z.ZodLiteral<"INTERNAL_SERVER_ERROR">; }, "strip", z.ZodTypeAny, { code: "INTERNAL_SERVER_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: "INTERNAL_SERVER_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: "INTERNAL_SERVER_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 500; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: "INTERNAL_SERVER_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 500; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** HTTP 502 - Bad Gateway (upstream service error) */ readonly 502: z.ZodObject<{ count: z.ZodLiteral<0>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; } & { status: z.ZodLiteral<502>; data: z.ZodObject<{ message: z.ZodString; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; timestamp: z.ZodOptional<z.ZodString>; requestId: z.ZodOptional<z.ZodString>; } & { code: z.ZodLiteral<"UPSTREAM_SERVICE_ERROR">; }, "strip", z.ZodTypeAny, { code: "UPSTREAM_SERVICE_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: "UPSTREAM_SERVICE_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: "UPSTREAM_SERVICE_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 502; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: "UPSTREAM_SERVICE_ERROR"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 502; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** HTTP 503 - Service Unavailable (temporary outage) */ readonly 503: z.ZodObject<{ count: z.ZodLiteral<0>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; } & { status: z.ZodLiteral<503>; data: z.ZodObject<{ message: z.ZodString; timestamp: z.ZodOptional<z.ZodString>; requestId: z.ZodOptional<z.ZodString>; } & { code: z.ZodLiteral<"SERVICE_UNAVAILABLE">; details: z.ZodOptional<z.ZodObject<{ retryAfter: z.ZodOptional<z.ZodNumber>; maintenanceWindow: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { retryAfter?: number | undefined; maintenanceWindow?: string | undefined; }, { retryAfter?: number | undefined; maintenanceWindow?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { code: "SERVICE_UNAVAILABLE"; message: string; details?: { retryAfter?: number | undefined; maintenanceWindow?: string | undefined; } | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: "SERVICE_UNAVAILABLE"; message: string; details?: { retryAfter?: number | undefined; maintenanceWindow?: string | undefined; } | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: "SERVICE_UNAVAILABLE"; message: string; details?: { retryAfter?: number | undefined; maintenanceWindow?: string | undefined; } | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 503; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: "SERVICE_UNAVAILABLE"; message: string; details?: { retryAfter?: number | undefined; maintenanceWindow?: string | undefined; } | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 503; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; /** HTTP 504 - Gateway Timeout (upstream timeout) */ readonly 504: z.ZodObject<{ count: z.ZodLiteral<0>; message: z.ZodString; options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; total: z.ZodLiteral<0>; totalResults: z.ZodLiteral<0>; } & { status: z.ZodLiteral<504>; data: z.ZodObject<{ message: z.ZodString; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; timestamp: z.ZodOptional<z.ZodString>; requestId: z.ZodOptional<z.ZodString>; } & { code: z.ZodLiteral<"UPSTREAM_TIMEOUT">; }, "strip", z.ZodTypeAny, { code: "UPSTREAM_TIMEOUT"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }, { code: "UPSTREAM_TIMEOUT"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }>; }, "strip", z.ZodTypeAny, { params: Record<string, unknown>; data: { code: "UPSTREAM_TIMEOUT"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; options: Record<string, unknown>; status: 504; message: string; count: 0; total: 0; totalResults: 0; }, { data: { code: "UPSTREAM_TIMEOUT"; message: string; details?: Record<string, unknown> | undefined; timestamp?: string | undefined; requestId?: string | undefined; }; status: 504; message: string; count: 0; total: 0; totalResults: 0; params?: Record<string, unknown> | undefined; options?: Record<string, unknown> | undefined; }>; }; /** * Simple schema utilities for common patterns */ export declare class SchemaUtils { /** * Create pagination parameters schema */ static createPaginatedParamsSchema<T extends z.ZodRawShape>(additionalFields?: T, defaultLimit?: number): z.ZodObject<{ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; orderBy: z.ZodOptional<z.ZodString>; q: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { limit: number; offset: number; q?: string | undefined; orderBy?: string | undefined; }, { limit?: number | undefined; offset?: number | undefined; q?: string | undefined; orderBy?: string | undefined; }>; /** * Create search parameters schema */ static createSearchParamsSchema<T extends z.ZodRawShape>(additionalFields?: T): z.ZodObject<{ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; orderBy: z.ZodOptional<z.ZodString>; q: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { limit: number; offset: number; q?: string | undefined; orderBy?: string | undefined; }, { limit?: number | undefined; offset?: number | undefined; q?: string | undefined; orderBy?: string | undefined; }>; } export type ErrorResponseData = z.infer<typeof ErrorResponseDataSchema>; export type ValidationErrorDetail = z.infer<typeof ValidationErrorDetailSchema>; export type ValidationErrorResponseData = z.infer<typeof ValidationErrorResponseDataSchema>; export type ErrorResponse = z.infer<typeof ErrorResponseSchema>; export type ValidationErrorResponse = z.infer<typeof ValidationErrorResponseSchema>; export type CommonErrorResponse = { [K in keyof typeof CommonErrorSchemas]: z.infer<(typeof CommonErrorSchemas)[K]>; }; //# sourceMappingURL=schema-utils.d.ts.map