/** * Common response definitions for v0 API routes * * This module provides reusable response definitions for error responses * and common headers to reduce duplication across route definitions. */ /** * Rate limit headers included in 429 responses */ declare const rateLimitHeaders: { readonly "X-RateLimit-Limit": { readonly schema: { readonly type: "integer"; }; readonly description: "The number of requests remaining in the current rate limit window."; }; readonly "X-RateLimit-Remaining": { readonly schema: { readonly type: "integer"; }; readonly description: "The number of requests remaining in the current rate limit window."; }; readonly "X-RateLimit-Reset": { readonly schema: { readonly type: "string"; }; readonly description: "The timestamp when the rate limit will be reset."; }; readonly "Retry-After": { readonly schema: { readonly type: "string"; }; readonly description: "The number of seconds to wait before retrying."; }; }; /** * Retry-After header included in 503 responses */ declare const retryAfterHeader: { readonly "Retry-After": { readonly schema: { readonly type: "string"; }; readonly description: "The number of seconds to wait before retrying."; }; }; /** * Common error response definitions for all v0 API routes * * These responses follow the JSON:API error response format and are * consistent across all endpoints. */ declare const commonErrorResponses: { /** * 400 Bad Request - Invalid request parameters or body */ readonly 400: { readonly description: "Bad Request"; readonly content: { readonly "application/json": { readonly schema: { readonly $ref: "#/components/schemas/ErrorsResponse"; }; }; }; }; /** * 401 Unauthorized - Missing or invalid authentication */ readonly 401: { readonly description: "Unauthorized"; readonly content: { readonly "application/json": { readonly schema: { readonly $ref: "#/components/schemas/ErrorsResponse"; }; }; }; }; /** * 429 Too Many Requests - Rate limit exceeded * Includes rate limit headers */ readonly 429: { readonly description: "Too Many Requests"; readonly headers: { readonly "X-RateLimit-Limit": { readonly schema: { readonly type: "integer"; }; readonly description: "The number of requests remaining in the current rate limit window."; }; readonly "X-RateLimit-Remaining": { readonly schema: { readonly type: "integer"; }; readonly description: "The number of requests remaining in the current rate limit window."; }; readonly "X-RateLimit-Reset": { readonly schema: { readonly type: "string"; }; readonly description: "The timestamp when the rate limit will be reset."; }; readonly "Retry-After": { readonly schema: { readonly type: "string"; }; readonly description: "The number of seconds to wait before retrying."; }; }; readonly content: { readonly "application/json": { readonly schema: { readonly $ref: "#/components/schemas/ErrorsResponse"; }; }; }; }; /** * 500 Server Error - Internal server error */ readonly 500: { readonly description: "Server Error"; readonly content: { readonly "application/json": { readonly schema: { readonly $ref: "#/components/schemas/ErrorsResponse"; }; }; }; }; /** * 503 Service Unavailable - Service temporarily unavailable * Includes Retry-After header */ readonly 503: { readonly description: "Service Unavailable"; readonly headers: { readonly "Retry-After": { readonly schema: { readonly type: "string"; }; readonly description: "The number of seconds to wait before retrying."; }; }; readonly content: { readonly "application/json": { readonly schema: { readonly $ref: "#/components/schemas/ErrorsResponse"; }; }; }; }; }; export { commonErrorResponses, rateLimitHeaders, retryAfterHeader };