1 | declare type DataType =
|
2 |
|
3 | "string" | "number" | "integer" | "boolean" | "array" | "object";
|
4 | export interface Schema {
|
5 | title?: string;
|
6 | nullable?: boolean;
|
7 | ["x-nullable"]?: boolean;
|
8 | maxLength?: number;
|
9 | max?: number;
|
10 | min?: number;
|
11 | pattern?: string;
|
12 | type?: DataType;
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | items?: Schema | {};
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | format?: "int32" | "int64" | "float" | "double" | "byte" | "binary" | "date" | "date-time" | "date" | "password" | "guid" | "uuid";
|
37 | |
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 | additionalProperties?: Schema | true | {};
|
45 | properties?: {
|
46 | [name: string]: Schema;
|
47 | };
|
48 | |
49 |
|
50 |
|
51 |
|
52 | required?: string[];
|
53 | description?: string;
|
54 | example?: string;
|
55 | deprecated?: boolean;
|
56 | "x-deprecatedMessage"?: string;
|
57 | "x-enumNames"?: string[];
|
58 | enum?: string[];
|
59 | $ref?: string;
|
60 | allOf?: Schema[];
|
61 | oneOf?: Schema[];
|
62 |
|
63 | anyOf?: Schema[];
|
64 | |
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 | minimum?: number;
|
80 | exclusiveMinimum?: boolean;
|
81 | exclusiveMaximum?: boolean;
|
82 | maximum?: number;
|
83 | |
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 | AnyValue?: {
|
96 | nullable?: boolean;
|
97 | description?: string;
|
98 | };
|
99 | discriminator?: {
|
100 | propertyName: string;
|
101 | mapping?: {
|
102 | [key: string]: string;
|
103 | };
|
104 | };
|
105 | readOnly?: boolean;
|
106 | writeOnly?: boolean;
|
107 | xml?: {
|
108 | name?: string;
|
109 | namespace?: string;
|
110 | prefix?: string;
|
111 | attribute?: boolean;
|
112 | wrapped?: boolean;
|
113 | };
|
114 | externalDocs?: {
|
115 | description?: string;
|
116 | url: string;
|
117 | };
|
118 | examples?: {
|
119 | [x: string]: string;
|
120 | };
|
121 | not?: Schema;
|
122 | default?: any;
|
123 | multipleOf?: number;
|
124 | minLength?: number;
|
125 | maxItems?: number;
|
126 | minItems?: number;
|
127 | uniqueItems?: boolean;
|
128 | maxProperties?: number;
|
129 | minProperties?: number;
|
130 | }
|
131 | export declare type Parameter = {
|
132 | |
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 | name: string;
|
142 |
|
143 | in: "query" | "header" | "cookie" | "path";
|
144 | |
145 |
|
146 |
|
147 |
|
148 |
|
149 | required?: boolean;
|
150 |
|
151 | schema?: Schema;
|
152 | $ref?: string;
|
153 | |
154 |
|
155 |
|
156 |
|
157 | description?: string;
|
158 | |
159 |
|
160 |
|
161 |
|
162 | deprecated?: boolean;
|
163 | };
|
164 | export interface SwaggerResponse {
|
165 | $ref?: string;
|
166 | description?: string;
|
167 | content?: Partial<Record<ApiAST["contentType"], Pick<Schema, "example" | "examples"> & {
|
168 | schema: Schema;
|
169 | }>>;
|
170 | }
|
171 | export interface SwaggerRequest {
|
172 | tags?: string[];
|
173 | summary?: string;
|
174 | operationId?: string;
|
175 | parameters?: Parameter[];
|
176 | requestBody?: SwaggerResponse;
|
177 | responses: {
|
178 | [x: string]: SwaggerResponse;
|
179 | };
|
180 | deprecated?: boolean;
|
181 | security?: any[];
|
182 | description?: string;
|
183 | externalDocs?: any;
|
184 | callbacks?: any;
|
185 | servers?: any[];
|
186 | }
|
187 | export interface Components {
|
188 | schemas?: Record<string, Schema>;
|
189 | parameters?: Record<string, Parameter>;
|
190 | requestBodies?: Record<string, SwaggerResponse>;
|
191 | }
|
192 | export interface SwaggerJson {
|
193 | openapi?: string;
|
194 | swagger?: string;
|
195 | paths: {
|
196 | [url: string]: PathItem;
|
197 | };
|
198 | components?: Components;
|
199 | info: InfoObject;
|
200 | servers?: any[];
|
201 | security?: any[];
|
202 | tags?: any[];
|
203 | externalDocs?: any;
|
204 | }
|
205 | export interface PathItem {
|
206 | $ref?: string;
|
207 | summary?: string;
|
208 | description?: string;
|
209 | get?: SwaggerRequest;
|
210 | put?: SwaggerRequest;
|
211 | post?: SwaggerRequest;
|
212 | delete?: SwaggerRequest;
|
213 | options?: SwaggerRequest;
|
214 | head?: SwaggerRequest;
|
215 | patch?: SwaggerRequest;
|
216 | trace?: SwaggerRequest;
|
217 | servers?: any[];
|
218 | parameters?: any[];
|
219 | }
|
220 | export interface InfoObject {
|
221 | title: string;
|
222 | version: string;
|
223 | description?: string;
|
224 | termsOfService?: string;
|
225 | contact?: any;
|
226 | license?: any;
|
227 | }
|
228 | export interface Config {
|
229 | url?: string | {
|
230 | branch: string;
|
231 | url: string;
|
232 | }[];
|
233 | dir: string;
|
234 | |
235 |
|
236 |
|
237 |
|
238 |
|
239 | hub?: string;
|
240 |
|
241 | keepJson?: boolean;
|
242 | reactHooks?: boolean;
|
243 | useQuery?: string[];
|
244 | useInfiniteQuery?: string[];
|
245 | tag?: string[];
|
246 | mock?: string;
|
247 | prettierPath?: string;
|
248 | language?: "javascript" | "typescript";
|
249 | methodName?: string;
|
250 | prefix?: string;
|
251 | ignore?: {
|
252 | headerParams?: string[];
|
253 | };
|
254 |
|
255 | local?: boolean;
|
256 |
|
257 | branch?: string;
|
258 | generateEnumAsType?: boolean;
|
259 | _isSwagger2?: boolean;
|
260 | }
|
261 | export declare type SwaggerConfig = Config | Config[];
|
262 | export declare type Method = "get" | "put" | "post" | "delete" | "options" | "head" | "patch" | "trace";
|
263 | export declare type ApiAST = {
|
264 | contentType: "*/*" | "text/json" | "application/json" | "application/octet-stream" | "application/json-patch+json" | "application/*+json" | "multipart/form-data" | "application/x-www-form-urlencoded";
|
265 | summary: string | undefined;
|
266 | deprecated: boolean | undefined;
|
267 | serviceName: string;
|
268 | pathParams: Parameter[];
|
269 | requestBody: Schema | undefined;
|
270 | queryParamsTypeName: string | false;
|
271 | headerParams: string;
|
272 | isQueryParamsNullable: boolean;
|
273 | isHeaderParamsNullable: boolean;
|
274 | responses: Schema | undefined;
|
275 | pathParamsRefString: string | undefined;
|
276 | endPoint: string;
|
277 | method: Method;
|
278 | security: string;
|
279 | additionalAxiosConfig: string;
|
280 | queryParameters: Parameter[];
|
281 | };
|
282 | export declare type TypeAST = {
|
283 | name: string;
|
284 | schema?: Schema;
|
285 | description?: string;
|
286 | };
|
287 | export declare type JsdocAST = Pick<Schema, "min" | "max" | "title" | "description" | "format" | "minimum" | "maximum" | "pattern" | "maxLength" | "minLength" | "example"> & {
|
288 | deprecated?: string;
|
289 | };
|
290 | export declare type ConstantsAST = {
|
291 | value: string;
|
292 | name: string;
|
293 | };
|
294 | export {};
|
295 |
|
\ | No newline at end of file |