Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | /** * API Documentation Types * Types for the interactive API documentation system */ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; export interface ApiParameter { name: string; type: 'string' | 'number' | 'boolean' | 'object' | 'array'; required: boolean; description: string; example?: string | number | boolean; enum?: string[]; location: 'path' | 'query' | 'header'; } export interface ApiBodyField { name: string; type: 'string' | 'number' | 'boolean' | 'object' | 'array'; required: boolean; description: string; example?: unknown; enum?: string[]; nested?: ApiBodyField[]; } export interface ApiRequestBody { contentType: 'application/json' | 'multipart/form-data'; description?: string; fields: ApiBodyField[]; example?: Record<string, unknown>; } export interface ApiResponseSchema { status: number; description: string; contentType?: string; fields?: ApiBodyField[]; example?: unknown; } export interface ApiEndpoint { id: string; method: HttpMethod; path: string; summary: string; description?: string; category: string; tags?: string[]; parameters?: ApiParameter[]; requestBody?: ApiRequestBody; responses: ApiResponseSchema[]; requiresAuth: boolean; adminOnly?: boolean; } export interface ApiCategory { id: string; name: string; description: string; icon?: string; endpoints: ApiEndpoint[]; } export interface ApiRegistry { version: string; title: string; description: string; baseUrl: string; categories: ApiCategory[]; } // Request/Response types for the tester export interface ApiTestRequest { endpoint: ApiEndpoint; pathParams: Record<string, string>; queryParams: Record<string, string>; headers: Record<string, string>; body?: unknown; useAuth: boolean; } export interface ApiTestResponse { status: number; statusText: string; headers: Record<string, string>; body: unknown; duration: number; timestamp: Date; } export interface SavedRequest { id: string; name: string; request: ApiTestRequest; createdAt: Date; } export interface RequestHistoryItem { id: string; request: ApiTestRequest; response: ApiTestResponse; timestamp: Date; } // Environment configuration export interface ApiEnvironment { id: string; name: string; baseUrl: string; isDefault?: boolean; } // Saved request collection export interface SavedRequestCollection { id: string; name: string; description?: string; requests: SavedRequest[]; createdAt: Date; updatedAt: Date; } // OpenAPI types for export export interface OpenAPISpec { openapi: string; info: { title: string; version: string; description?: string; }; servers: { url: string; description?: string }[]; paths: Record<string, OpenAPIPathItem>; components?: { schemas?: Record<string, unknown>; securitySchemes?: Record<string, unknown>; }; } export interface OpenAPIPathItem { [method: string]: OpenAPIOperation; } export interface OpenAPIOperation { summary?: string; description?: string; operationId?: string; tags?: string[]; parameters?: OpenAPIParameter[]; requestBody?: OpenAPIRequestBody; responses: Record<string, OpenAPIResponse>; security?: Record<string, string[]>[]; } export interface OpenAPIParameter { name: string; in: 'path' | 'query' | 'header'; required?: boolean; description?: string; schema: { type: string; enum?: string[]; example?: unknown; }; } export interface OpenAPIRequestBody { required?: boolean; description?: string; content: { [contentType: string]: { schema: unknown; example?: unknown; }; }; } export interface OpenAPIResponse { description: string; content?: { [contentType: string]: { schema?: unknown; example?: unknown; }; }; } |