@zuplo/runtime 6.52.10 → 6.52.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/esm/index.js +35 -35
- package/out/types/index.d.ts +5180 -4129
- package/out/types/internal/index.d.ts +1015 -909
- package/out/types/mocks/index.d.ts +1483 -1075
- package/package.json +2 -2
|
@@ -4,96 +4,101 @@
|
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
6
|
declare interface BuildRouteConfiguration {
|
|
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
|
-
|
|
7
|
+
path: string;
|
|
8
|
+
methods: HttpMethod[];
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated This property is not used and will be removed in future versions
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated This property is not used and will be removed in future versions
|
|
15
|
+
*/
|
|
16
|
+
key?: string;
|
|
17
|
+
handler: HandlerDefinition;
|
|
18
|
+
corsPolicy?: CorsPolicy;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated This property is deprecated. Use route.raw() instead.
|
|
21
|
+
*/
|
|
22
|
+
custom?: any;
|
|
23
|
+
mcp?: {
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
};
|
|
26
|
+
policies?: {
|
|
27
|
+
inbound?: string[];
|
|
28
|
+
outbound?: string[];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated This property is not used and will be removed in future versions
|
|
32
|
+
*/
|
|
33
|
+
excludeFromOpenApi?: boolean;
|
|
34
|
+
pathPattern?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Build-time metadata for this route.
|
|
37
|
+
*/
|
|
38
|
+
metadata?: {
|
|
39
|
+
/**
|
|
40
|
+
* The source file this route was generated from.
|
|
41
|
+
*/
|
|
42
|
+
filepath: string;
|
|
43
|
+
};
|
|
44
|
+
/* Excluded from this release type: raw */
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* The compatibility date on which to run the gateway
|
|
49
49
|
*/
|
|
50
|
-
declare type CompatibilityDate =
|
|
50
|
+
declare type CompatibilityDate =
|
|
51
|
+
| "2023-03-14"
|
|
52
|
+
| "2024-01-15"
|
|
53
|
+
| "2024-03-14"
|
|
54
|
+
| "2024-09-02"
|
|
55
|
+
| "2025-02-06";
|
|
51
56
|
|
|
52
57
|
declare interface CompatibilityFlags {
|
|
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
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Whether or not outbound policies should run if the response from the
|
|
60
|
+
* handlers is not `response.ok`
|
|
61
|
+
*
|
|
62
|
+
* @compatibilityDate 2024-01-15
|
|
63
|
+
*/
|
|
64
|
+
runOutboundPoliciesOnHandlerOnAllStatuses: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Whether or not hooks run on system routes
|
|
67
|
+
*
|
|
68
|
+
* @compatibilityDate 2024-01-15
|
|
69
|
+
*/
|
|
70
|
+
doNotRunHooksOnSystemRoutes: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Remove all vendor (cf-, zp-) headers except for the specific
|
|
73
|
+
* list of allowed headers
|
|
74
|
+
*
|
|
75
|
+
* @compatibilityDate 2024-01-15
|
|
76
|
+
*/
|
|
77
|
+
removeAllVendorHeadersExceptListed: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Allow specifying a custom port when making a subrequest with
|
|
80
|
+
* the fetch() API.
|
|
81
|
+
*
|
|
82
|
+
* This flag doesn't actually do anything in the runtime. It is a
|
|
83
|
+
* workerd change. The flag is here only to generate a new compatibility
|
|
84
|
+
* date.
|
|
85
|
+
*
|
|
86
|
+
* @compatibilityDate 2024-09-02
|
|
87
|
+
*/
|
|
88
|
+
allowCustomPorts: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Whether or not to use the new logging system
|
|
91
|
+
*
|
|
92
|
+
* @compatibilityDate 2025-02-06
|
|
93
|
+
*/
|
|
94
|
+
removeLegacyLogInitialization: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Whether or not to enable the followRedirects option on the URL Forward handler
|
|
97
|
+
* NOTE: This flag was documented, but never implimented so its a breaking
|
|
98
|
+
* change to enable it.
|
|
99
|
+
* @compatibilityDate 2025-02-06
|
|
100
|
+
*/
|
|
101
|
+
useForwardRedirectsPropOnUrlForwardHandler: boolean;
|
|
97
102
|
}
|
|
98
103
|
|
|
99
104
|
/**
|
|
@@ -105,13 +110,13 @@ declare type CorsPolicy = string | "anything-goes" | "none";
|
|
|
105
110
|
* @public
|
|
106
111
|
*/
|
|
107
112
|
declare interface CorsPolicyConfiguration {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
name: string;
|
|
114
|
+
allowCredentials?: boolean;
|
|
115
|
+
maxAge?: number;
|
|
116
|
+
allowedOrigins: string[] | string;
|
|
117
|
+
allowedMethods?: HttpMethod[] | string;
|
|
118
|
+
allowedHeaders?: string[] | string;
|
|
119
|
+
exposeHeaders?: string[] | string;
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
/* Excluded from this release type: DevPortalRuntimeConfig */
|
|
@@ -130,351 +135,365 @@ export declare type DevPortalType = "legacy" | "zudoku";
|
|
|
130
135
|
* @public
|
|
131
136
|
*/
|
|
132
137
|
declare interface HandlerDefinition {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
module: any;
|
|
139
|
+
export: string;
|
|
140
|
+
options?: unknown;
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
/**
|
|
139
144
|
* @public
|
|
140
145
|
*/
|
|
141
|
-
export declare type HttpMethod =
|
|
146
|
+
export declare type HttpMethod =
|
|
147
|
+
| "GET"
|
|
148
|
+
| "HEAD"
|
|
149
|
+
| "POST"
|
|
150
|
+
| "PUT"
|
|
151
|
+
| "DELETE"
|
|
152
|
+
| "CONNECT"
|
|
153
|
+
| "OPTIONS"
|
|
154
|
+
| "TRACE"
|
|
155
|
+
| "PATCH";
|
|
142
156
|
|
|
143
157
|
/**
|
|
144
158
|
* @beta
|
|
145
159
|
*/
|
|
146
160
|
declare enum HttpStatusCode {
|
|
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
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
161
|
+
/**
|
|
162
|
+
* The server has received the request headers and the client should proceed to send the request body
|
|
163
|
+
* (in the case of a request for which a body needs to be sent; for example, a POST request).
|
|
164
|
+
* Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient.
|
|
165
|
+
* To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request
|
|
166
|
+
* and receive a 100 Continue status code in response before sending the body. The response 417 Expectation Failed indicates the request should not be continued.
|
|
167
|
+
*/
|
|
168
|
+
CONTINUE = 100,
|
|
169
|
+
/**
|
|
170
|
+
* The requester has asked the server to switch protocols and the server has agreed to do so.
|
|
171
|
+
*/
|
|
172
|
+
SWITCHING_PROTOCOLS = 101,
|
|
173
|
+
/**
|
|
174
|
+
* A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request.
|
|
175
|
+
* This code indicates that the server has received and is processing the request, but no response is available yet.
|
|
176
|
+
* This prevents the client from timing out and assuming the request was lost.
|
|
177
|
+
* @deprecated This status code is deprecated and shouldn't be sent any more. Clients may still accept it, but simply ignore them.
|
|
178
|
+
*/
|
|
179
|
+
PROCESSING = 102,
|
|
180
|
+
/**
|
|
181
|
+
* This response may be sent by a server while it is still preparing a
|
|
182
|
+
* response, with hints about the resources that the server is expecting
|
|
183
|
+
* the final response will link. This allows a browser to start preloading
|
|
184
|
+
* resources even before the server has prepared and sent that final response.
|
|
185
|
+
*/
|
|
186
|
+
EARLY_HINTS = 103,
|
|
187
|
+
/**
|
|
188
|
+
* Standard response for successful HTTP requests.
|
|
189
|
+
* The actual response will depend on the request method used.
|
|
190
|
+
* In a GET request, the response will contain an entity corresponding to the requested resource.
|
|
191
|
+
* In a POST request, the response will contain an entity describing or containing the result of the action.
|
|
192
|
+
*/
|
|
193
|
+
OK = 200,
|
|
194
|
+
/**
|
|
195
|
+
* The request has been fulfilled, resulting in the creation of a new resource.
|
|
196
|
+
*/
|
|
197
|
+
CREATED = 201,
|
|
198
|
+
/**
|
|
199
|
+
* The request has been accepted for processing, but the processing has not been completed.
|
|
200
|
+
* The request might or might not be eventually acted upon, and may be disallowed when processing occurs.
|
|
201
|
+
*/
|
|
202
|
+
ACCEPTED = 202,
|
|
203
|
+
/**
|
|
204
|
+
* SINCE HTTP/1.1
|
|
205
|
+
* The server is a transforming proxy that received a 200 OK from its origin,
|
|
206
|
+
* but is returning a modified version of the origin's response.
|
|
207
|
+
*/
|
|
208
|
+
NON_AUTHORITATIVE_INFORMATION = 203,
|
|
209
|
+
/**
|
|
210
|
+
* The server successfully processed the request and is not returning any content.
|
|
211
|
+
*/
|
|
212
|
+
NO_CONTENT = 204,
|
|
213
|
+
/**
|
|
214
|
+
* The server successfully processed the request, but is not returning any content.
|
|
215
|
+
* Unlike a 204 response, this response requires that the requester reset the document view.
|
|
216
|
+
*/
|
|
217
|
+
RESET_CONTENT = 205,
|
|
218
|
+
/**
|
|
219
|
+
* The server is delivering only part of the resource (byte serving) due to a range header sent by the client.
|
|
220
|
+
* The range header is used by HTTP clients to enable resuming of interrupted downloads,
|
|
221
|
+
* or split a download into multiple simultaneous streams.
|
|
222
|
+
*/
|
|
223
|
+
PARTIAL_CONTENT = 206,
|
|
224
|
+
/**
|
|
225
|
+
* The message body that follows is an XML message and can contain a number of separate response codes,
|
|
226
|
+
* depending on how many sub-requests were made.
|
|
227
|
+
*/
|
|
228
|
+
MULTI_STATUS = 207,
|
|
229
|
+
/**
|
|
230
|
+
* The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response,
|
|
231
|
+
* and are not being included again.
|
|
232
|
+
*/
|
|
233
|
+
ALREADY_REPORTED = 208,
|
|
234
|
+
/**
|
|
235
|
+
* The server has fulfilled a request for the resource,
|
|
236
|
+
* and the response is a representation of the result of one or more instance-manipulations applied to the current instance.
|
|
237
|
+
*/
|
|
238
|
+
IM_USED = 226,
|
|
239
|
+
/**
|
|
240
|
+
* Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).
|
|
241
|
+
* For example, this code could be used to present multiple video format options,
|
|
242
|
+
* to list files with different filename extensions, or to suggest word-sense disambiguation.
|
|
243
|
+
*/
|
|
244
|
+
MULTIPLE_CHOICES = 300,
|
|
245
|
+
/**
|
|
246
|
+
* This and all future requests should be directed to the given URI.
|
|
247
|
+
*/
|
|
248
|
+
MOVED_PERMANENTLY = 301,
|
|
249
|
+
/**
|
|
250
|
+
* This is an example of industry practice contradicting the standard.
|
|
251
|
+
* The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect
|
|
252
|
+
* (the original describing phrase was "Moved Temporarily"), but popular browsers implemented 302
|
|
253
|
+
* with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307
|
|
254
|
+
* to distinguish between the two behaviours. However, some Web applications and frameworks
|
|
255
|
+
* use the 302 status code as if it were the 303.
|
|
256
|
+
*/
|
|
257
|
+
FOUND = 302,
|
|
258
|
+
/**
|
|
259
|
+
* SINCE HTTP/1.1
|
|
260
|
+
* The response to the request can be found under another URI using a GET method.
|
|
261
|
+
* When received in response to a POST (or PUT/DELETE), the client should presume that
|
|
262
|
+
* the server has received the data and should issue a redirect with a separate GET message.
|
|
263
|
+
*/
|
|
264
|
+
SEE_OTHER = 303,
|
|
265
|
+
/**
|
|
266
|
+
* Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.
|
|
267
|
+
* In such case, there is no need to retransmit the resource since the client still has a previously-downloaded copy.
|
|
268
|
+
*/
|
|
269
|
+
NOT_MODIFIED = 304,
|
|
270
|
+
/**
|
|
271
|
+
* SINCE HTTP/1.1
|
|
272
|
+
* The requested resource is available only through a proxy, the address for which is provided in the response.
|
|
273
|
+
* Many HTTP clients (such as Mozilla and Internet Explorer) do not correctly handle responses with this status code, primarily for security reasons.
|
|
274
|
+
*/
|
|
275
|
+
USE_PROXY = 305,
|
|
276
|
+
/**
|
|
277
|
+
* No longer used. Originally meant "Subsequent requests should use the specified proxy."
|
|
278
|
+
* @deprecated No longer used
|
|
279
|
+
*/
|
|
280
|
+
SWITCH_PROXY = 306,
|
|
281
|
+
/**
|
|
282
|
+
* SINCE HTTP/1.1
|
|
283
|
+
* In this case, the request should be repeated with another URI; however, future requests should still use the original URI.
|
|
284
|
+
* In contrast to how 302 was historically implemented, the request method is not allowed to be changed when reissuing the original request.
|
|
285
|
+
* For example, a POST request should be repeated using another POST request.
|
|
286
|
+
*/
|
|
287
|
+
TEMPORARY_REDIRECT = 307,
|
|
288
|
+
/**
|
|
289
|
+
* The request and all future requests should be repeated using another URI.
|
|
290
|
+
* 307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.
|
|
291
|
+
* So, for example, submitting a form to a permanently redirected resource may continue smoothly.
|
|
292
|
+
*/
|
|
293
|
+
PERMANENT_REDIRECT = 308,
|
|
294
|
+
/**
|
|
295
|
+
* The server cannot or will not process the request due to an apparent client error
|
|
296
|
+
* (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).
|
|
297
|
+
*/
|
|
298
|
+
BAD_REQUEST = 400,
|
|
299
|
+
/**
|
|
300
|
+
* Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet
|
|
301
|
+
* been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the
|
|
302
|
+
* requested resource. See Basic access authentication and Digest access authentication. 401 semantically means
|
|
303
|
+
* "unauthenticated",i.e. the user does not have the necessary credentials.
|
|
304
|
+
*/
|
|
305
|
+
UNAUTHORIZED = 401,
|
|
306
|
+
/**
|
|
307
|
+
* Reserved for future use. The original intention was that this code might be used as part of some form of digital
|
|
308
|
+
* cash or micro payment scheme, but that has not happened, and this code is not usually used.
|
|
309
|
+
* Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.
|
|
310
|
+
*/
|
|
311
|
+
PAYMENT_REQUIRED = 402,
|
|
312
|
+
/**
|
|
313
|
+
* The request was valid, but the server is refusing action.
|
|
314
|
+
* The user might not have the necessary permissions for a resource.
|
|
315
|
+
*/
|
|
316
|
+
FORBIDDEN = 403,
|
|
317
|
+
/**
|
|
318
|
+
* The requested resource could not be found but may be available in the future.
|
|
319
|
+
* Subsequent requests by the client are permissible.
|
|
320
|
+
*/
|
|
321
|
+
NOT_FOUND = 404,
|
|
322
|
+
/**
|
|
323
|
+
* A request method is not supported for the requested resource;
|
|
324
|
+
* for example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.
|
|
325
|
+
*/
|
|
326
|
+
METHOD_NOT_ALLOWED = 405,
|
|
327
|
+
/**
|
|
328
|
+
* The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
|
|
329
|
+
*/
|
|
330
|
+
NOT_ACCEPTABLE = 406,
|
|
331
|
+
/**
|
|
332
|
+
* The client must first authenticate itself with the proxy.
|
|
333
|
+
*/
|
|
334
|
+
PROXY_AUTHENTICATION_REQUIRED = 407,
|
|
335
|
+
/**
|
|
336
|
+
* The server timed out waiting for the request.
|
|
337
|
+
* According to HTTP specifications:
|
|
338
|
+
* "The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time."
|
|
339
|
+
*/
|
|
340
|
+
REQUEST_TIMEOUT = 408,
|
|
341
|
+
/**
|
|
342
|
+
* Indicates that the request could not be processed because of conflict in the request,
|
|
343
|
+
* such as an edit conflict between multiple simultaneous updates.
|
|
344
|
+
*/
|
|
345
|
+
CONFLICT = 409,
|
|
346
|
+
/**
|
|
347
|
+
* Indicates that the resource requested is no longer available and will not be available again.
|
|
348
|
+
* This should be used when a resource has been intentionally removed and the resource should be purged.
|
|
349
|
+
* Upon receiving a 410 status code, the client should not request the resource in the future.
|
|
350
|
+
* Clients such as search engines should remove the resource from their indices.
|
|
351
|
+
* Most use cases do not require clients and search engines to purge the resource, and a "404 Not Found" may be used instead.
|
|
352
|
+
*/
|
|
353
|
+
GONE = 410,
|
|
354
|
+
/**
|
|
355
|
+
* The request did not specify the length of its content, which is required by the requested resource.
|
|
356
|
+
*/
|
|
357
|
+
LENGTH_REQUIRED = 411,
|
|
358
|
+
/**
|
|
359
|
+
* The server does not meet one of the preconditions that the requester put on the request.
|
|
360
|
+
*/
|
|
361
|
+
PRECONDITION_FAILED = 412,
|
|
362
|
+
/**
|
|
363
|
+
* The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".
|
|
364
|
+
*/
|
|
365
|
+
CONTENT_TOO_LARGE = 413,
|
|
366
|
+
/* Excluded from this release type: PAYLOAD_TOO_LARGE */
|
|
367
|
+
/**
|
|
368
|
+
* The URI provided was too long for the server to process. Often the result of too much data being encoded as a query-string of a GET request,
|
|
369
|
+
* in which case it should be converted to a POST request.
|
|
370
|
+
* Called "Request-URI Too Long" previously.
|
|
371
|
+
*/
|
|
372
|
+
URI_TOO_LONG = 414,
|
|
373
|
+
/**
|
|
374
|
+
* The request entity has a media type which the server or resource does not support.
|
|
375
|
+
* For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.
|
|
376
|
+
*/
|
|
377
|
+
UNSUPPORTED_MEDIA_TYPE = 415,
|
|
378
|
+
/**
|
|
379
|
+
* The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.
|
|
380
|
+
* For example, if the client asked for a part of the file that lies beyond the end of the file.
|
|
381
|
+
* Called "Requested Range Not Satisfiable" previously.
|
|
382
|
+
*/
|
|
383
|
+
RANGE_NOT_SATISFIABLE = 416,
|
|
384
|
+
/**
|
|
385
|
+
* The server cannot meet the requirements of the Expect request-header field.
|
|
386
|
+
*/
|
|
387
|
+
EXPECTATION_FAILED = 417,
|
|
388
|
+
/**
|
|
389
|
+
* This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol,
|
|
390
|
+
* and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by
|
|
391
|
+
* teapots requested to brew coffee. This HTTP status is used as an Easter egg in some websites, including Google.com.
|
|
392
|
+
*/
|
|
393
|
+
I_AM_A_TEAPOT = 418,
|
|
394
|
+
/**
|
|
395
|
+
* The request was directed at a server that is not able to produce a response (for example because a connection reuse).
|
|
396
|
+
*/
|
|
397
|
+
MISDIRECTED_REQUEST = 421,
|
|
398
|
+
/* Excluded from this release type: UNPROCESSABLE_ENTITY */
|
|
399
|
+
/**
|
|
400
|
+
* The request was well-formed but was unable to be followed due to semantic errors.
|
|
401
|
+
*/
|
|
402
|
+
UNPROCESSABLE_CONTENT = 422,
|
|
403
|
+
/**
|
|
404
|
+
* The resource that is being accessed is locked.
|
|
405
|
+
*/
|
|
406
|
+
LOCKED = 423,
|
|
407
|
+
/**
|
|
408
|
+
* The request failed due to failure of a previous request (e.g., a PROPPATCH).
|
|
409
|
+
*/
|
|
410
|
+
FAILED_DEPENDENCY = 424,
|
|
411
|
+
/**
|
|
412
|
+
* The server is unwilling to risk processing a request that might be
|
|
413
|
+
* replayed, which creates the potential for a replay attack.
|
|
414
|
+
*/
|
|
415
|
+
TOO_EARLY = 425,
|
|
416
|
+
/**
|
|
417
|
+
* The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.
|
|
418
|
+
*/
|
|
419
|
+
UPGRADE_REQUIRED = 426,
|
|
420
|
+
/**
|
|
421
|
+
* The origin server requires the request to be conditional.
|
|
422
|
+
* Intended to prevent "the 'lost update' problem, where a client
|
|
423
|
+
* GETs a resource's state, modifies it, and PUTs it back to the server,
|
|
424
|
+
* when meanwhile a third party has modified the state on the server, leading to a conflict."
|
|
425
|
+
*/
|
|
426
|
+
PRECONDITION_REQUIRED = 428,
|
|
427
|
+
/**
|
|
428
|
+
* The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.
|
|
429
|
+
*/
|
|
430
|
+
TOO_MANY_REQUESTS = 429,
|
|
431
|
+
/**
|
|
432
|
+
* The server is unwilling to process the request because either an individual header field,
|
|
433
|
+
* or all the header fields collectively, are too large.
|
|
434
|
+
*/
|
|
435
|
+
REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
|
|
436
|
+
/**
|
|
437
|
+
* A server operator has received a legal demand to deny access to a resource or to a set of resources
|
|
438
|
+
* that includes the requested resource. The code 451 was chosen as a reference to the novel Fahrenheit 451.
|
|
439
|
+
*/
|
|
440
|
+
UNAVAILABLE_FOR_LEGAL_REASONS = 451,
|
|
441
|
+
/**
|
|
442
|
+
* A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
|
|
443
|
+
*/
|
|
444
|
+
INTERNAL_SERVER_ERROR = 500,
|
|
445
|
+
/**
|
|
446
|
+
* The server either does not recognize the request method, or it lacks the ability to fulfill the request.
|
|
447
|
+
* Usually this implies future availability (e.g., a new feature of a web-service API).
|
|
448
|
+
*/
|
|
449
|
+
NOT_IMPLEMENTED = 501,
|
|
450
|
+
/**
|
|
451
|
+
* The server was acting as a gateway or proxy and received an invalid response from the upstream server.
|
|
452
|
+
*/
|
|
453
|
+
BAD_GATEWAY = 502,
|
|
454
|
+
/**
|
|
455
|
+
* The server is currently unavailable (because it is overloaded or down for maintenance).
|
|
456
|
+
* Generally, this is a temporary state.
|
|
457
|
+
*/
|
|
458
|
+
SERVICE_UNAVAILABLE = 503,
|
|
459
|
+
/**
|
|
460
|
+
* The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
|
|
461
|
+
*/
|
|
462
|
+
GATEWAY_TIMEOUT = 504,
|
|
463
|
+
/**
|
|
464
|
+
* The server does not support the HTTP protocol version used in the request
|
|
465
|
+
*/
|
|
466
|
+
HTTP_VERSION_NOT_SUPPORTED = 505,
|
|
467
|
+
/**
|
|
468
|
+
* Transparent content negotiation for the request results in a circular reference.
|
|
469
|
+
*/
|
|
470
|
+
VARIANT_ALSO_NEGOTIATES = 506,
|
|
471
|
+
/**
|
|
472
|
+
* The server is unable to store the representation needed to complete the request.
|
|
473
|
+
*/
|
|
474
|
+
INSUFFICIENT_STORAGE = 507,
|
|
475
|
+
/**
|
|
476
|
+
* The server detected an infinite loop while processing the request.
|
|
477
|
+
*/
|
|
478
|
+
LOOP_DETECTED = 508,
|
|
479
|
+
/**
|
|
480
|
+
* Further extensions to the request are required for the server to fulfill it.
|
|
481
|
+
*/
|
|
482
|
+
NOT_EXTENDED = 510,
|
|
483
|
+
/**
|
|
484
|
+
* The client needs to authenticate to gain network access.
|
|
485
|
+
* Intended for use by intercepting proxies used to control access to the network (e.g., "captive portals" used
|
|
486
|
+
* to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).
|
|
487
|
+
*/
|
|
488
|
+
NETWORK_AUTHENTICATION_REQUIRED = 511,
|
|
475
489
|
}
|
|
476
490
|
|
|
477
|
-
declare type HttpStatusCodeRangeDefinition =
|
|
491
|
+
declare type HttpStatusCodeRangeDefinition =
|
|
492
|
+
| "1XX"
|
|
493
|
+
| "2XX"
|
|
494
|
+
| "3XX"
|
|
495
|
+
| "4XX"
|
|
496
|
+
| "5XX";
|
|
478
497
|
|
|
479
498
|
/* Excluded from this release type: isRestrictedEnvVariableName */
|
|
480
499
|
|
|
@@ -483,549 +502,636 @@ declare type HttpStatusCodeRangeDefinition = "1XX" | "2XX" | "3XX" | "4XX" | "5X
|
|
|
483
502
|
declare type Modify<T, R> = Omit<T, keyof R> & R;
|
|
484
503
|
|
|
485
504
|
declare namespace OpenAPIV3 {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
enum?: string[];
|
|
524
|
-
default: string;
|
|
525
|
-
description?: string;
|
|
526
|
-
}
|
|
527
|
-
interface PathsObject<T extends {} = {}, P extends {} = {}> {
|
|
528
|
-
[pattern: string]: (PathItemObject<T> & P) | undefined;
|
|
529
|
-
}
|
|
530
|
-
enum HttpMethods {
|
|
531
|
-
GET = "get",
|
|
532
|
-
PUT = "put",
|
|
533
|
-
POST = "post",
|
|
534
|
-
DELETE = "delete",
|
|
535
|
-
OPTIONS = "options",
|
|
536
|
-
HEAD = "head",
|
|
537
|
-
PATCH = "patch",
|
|
538
|
-
TRACE = "trace"
|
|
539
|
-
}
|
|
540
|
-
type PathItemObject<T extends {} = {}> = {
|
|
541
|
-
$ref?: string;
|
|
542
|
-
summary?: string;
|
|
543
|
-
description?: string;
|
|
544
|
-
servers?: ServerObject[];
|
|
545
|
-
parameters?: (ReferenceObject | ParameterObject)[];
|
|
546
|
-
} & {
|
|
547
|
-
[method in HttpMethods]?: OperationObject<T>;
|
|
505
|
+
interface Document<T extends {} = {}> {
|
|
506
|
+
openapi: string;
|
|
507
|
+
info: InfoObject;
|
|
508
|
+
servers?: ServerObject[];
|
|
509
|
+
paths: PathsObject<T>;
|
|
510
|
+
components?: ComponentsObject;
|
|
511
|
+
security?: SecurityRequirementObject[];
|
|
512
|
+
tags?: TagObject[];
|
|
513
|
+
externalDocs?: ExternalDocumentationObject;
|
|
514
|
+
"x-express-openapi-additional-middleware"?: (
|
|
515
|
+
| ((request: any, response: any, next: any) => Promise<void>)
|
|
516
|
+
| ((request: any, response: any, next: any) => void)
|
|
517
|
+
)[];
|
|
518
|
+
"x-express-openapi-validation-strict"?: boolean;
|
|
519
|
+
}
|
|
520
|
+
interface InfoObject {
|
|
521
|
+
title: string;
|
|
522
|
+
description?: string;
|
|
523
|
+
termsOfService?: string;
|
|
524
|
+
contact?: ContactObject;
|
|
525
|
+
license?: LicenseObject;
|
|
526
|
+
version: string;
|
|
527
|
+
}
|
|
528
|
+
interface ContactObject {
|
|
529
|
+
name?: string;
|
|
530
|
+
url?: string;
|
|
531
|
+
email?: string;
|
|
532
|
+
}
|
|
533
|
+
interface LicenseObject {
|
|
534
|
+
name: string;
|
|
535
|
+
url?: string;
|
|
536
|
+
}
|
|
537
|
+
interface ServerObject {
|
|
538
|
+
url: string;
|
|
539
|
+
description?: string;
|
|
540
|
+
variables?: {
|
|
541
|
+
[variable: string]: ServerVariableObject;
|
|
548
542
|
};
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
543
|
+
}
|
|
544
|
+
interface ServerVariableObject {
|
|
545
|
+
enum?: string[];
|
|
546
|
+
default: string;
|
|
547
|
+
description?: string;
|
|
548
|
+
}
|
|
549
|
+
interface PathsObject<T extends {} = {}, P extends {} = {}> {
|
|
550
|
+
[pattern: string]: (PathItemObject<T> & P) | undefined;
|
|
551
|
+
}
|
|
552
|
+
enum HttpMethods {
|
|
553
|
+
GET = "get",
|
|
554
|
+
PUT = "put",
|
|
555
|
+
POST = "post",
|
|
556
|
+
DELETE = "delete",
|
|
557
|
+
OPTIONS = "options",
|
|
558
|
+
HEAD = "head",
|
|
559
|
+
PATCH = "patch",
|
|
560
|
+
TRACE = "trace",
|
|
561
|
+
}
|
|
562
|
+
type PathItemObject<T extends {} = {}> = {
|
|
563
|
+
$ref?: string;
|
|
564
|
+
summary?: string;
|
|
565
|
+
description?: string;
|
|
566
|
+
servers?: ServerObject[];
|
|
567
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
568
|
+
} & {
|
|
569
|
+
[method in HttpMethods]?: OperationObject<T>;
|
|
570
|
+
};
|
|
571
|
+
type OperationObject<T extends {} = {}> = {
|
|
572
|
+
tags?: string[];
|
|
573
|
+
summary?: string;
|
|
574
|
+
description?: string;
|
|
575
|
+
externalDocs?: ExternalDocumentationObject;
|
|
576
|
+
operationId?: string;
|
|
577
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
578
|
+
requestBody?: ReferenceObject | RequestBodyObject;
|
|
579
|
+
responses: ResponsesObject;
|
|
580
|
+
callbacks?: {
|
|
581
|
+
[callback: string]: ReferenceObject | CallbackObject;
|
|
582
|
+
};
|
|
583
|
+
deprecated?: boolean;
|
|
584
|
+
security?: SecurityRequirementObject[];
|
|
585
|
+
servers?: ServerObject[];
|
|
586
|
+
} & T;
|
|
587
|
+
interface ExternalDocumentationObject {
|
|
588
|
+
description?: string;
|
|
589
|
+
url: string;
|
|
590
|
+
}
|
|
591
|
+
interface ParameterObject extends ParameterBaseObject {
|
|
592
|
+
name: string;
|
|
593
|
+
in: string;
|
|
594
|
+
}
|
|
595
|
+
interface HeaderObject extends ParameterBaseObject {}
|
|
596
|
+
interface ParameterBaseObject {
|
|
597
|
+
description?: string;
|
|
598
|
+
required?: boolean;
|
|
599
|
+
deprecated?: boolean;
|
|
600
|
+
allowEmptyValue?: boolean;
|
|
601
|
+
style?: string;
|
|
602
|
+
explode?: boolean;
|
|
603
|
+
allowReserved?: boolean;
|
|
604
|
+
schema?: ReferenceObject | SchemaObject;
|
|
605
|
+
example?: any;
|
|
606
|
+
examples?: {
|
|
607
|
+
[media: string]: ReferenceObject | ExampleObject;
|
|
608
|
+
};
|
|
609
|
+
content?: {
|
|
610
|
+
[media: string]: MediaTypeObject;
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
type NonArraySchemaObjectType =
|
|
614
|
+
| "boolean"
|
|
615
|
+
| "object"
|
|
616
|
+
| "number"
|
|
617
|
+
| "string"
|
|
618
|
+
| "integer";
|
|
619
|
+
type ArraySchemaObjectType = "array";
|
|
620
|
+
type SchemaObject = ArraySchemaObject | NonArraySchemaObject;
|
|
621
|
+
interface ArraySchemaObject extends BaseSchemaObject {
|
|
622
|
+
type: ArraySchemaObjectType;
|
|
623
|
+
items: ReferenceObject | SchemaObject;
|
|
624
|
+
}
|
|
625
|
+
interface NonArraySchemaObject extends BaseSchemaObject {
|
|
626
|
+
type?: NonArraySchemaObjectType;
|
|
627
|
+
}
|
|
628
|
+
interface BaseSchemaObject {
|
|
629
|
+
title?: string;
|
|
630
|
+
description?: string;
|
|
631
|
+
format?: string;
|
|
632
|
+
default?: any;
|
|
633
|
+
multipleOf?: number;
|
|
634
|
+
maximum?: number;
|
|
635
|
+
exclusiveMaximum?: boolean;
|
|
636
|
+
minimum?: number;
|
|
637
|
+
exclusiveMinimum?: boolean;
|
|
638
|
+
maxLength?: number;
|
|
639
|
+
minLength?: number;
|
|
640
|
+
pattern?: string;
|
|
641
|
+
additionalProperties?: boolean | ReferenceObject | SchemaObject;
|
|
642
|
+
maxItems?: number;
|
|
643
|
+
minItems?: number;
|
|
644
|
+
uniqueItems?: boolean;
|
|
645
|
+
maxProperties?: number;
|
|
646
|
+
minProperties?: number;
|
|
647
|
+
required?: string[];
|
|
648
|
+
enum?: any[];
|
|
649
|
+
properties?: {
|
|
650
|
+
[name: string]: ReferenceObject | SchemaObject;
|
|
651
|
+
};
|
|
652
|
+
allOf?: (ReferenceObject | SchemaObject)[];
|
|
653
|
+
oneOf?: (ReferenceObject | SchemaObject)[];
|
|
654
|
+
anyOf?: (ReferenceObject | SchemaObject)[];
|
|
655
|
+
not?: ReferenceObject | SchemaObject;
|
|
656
|
+
nullable?: boolean;
|
|
657
|
+
discriminator?: DiscriminatorObject;
|
|
658
|
+
readOnly?: boolean;
|
|
659
|
+
writeOnly?: boolean;
|
|
660
|
+
xml?: XMLObject;
|
|
661
|
+
externalDocs?: ExternalDocumentationObject;
|
|
662
|
+
example?: any;
|
|
663
|
+
deprecated?: boolean;
|
|
664
|
+
}
|
|
665
|
+
interface DiscriminatorObject {
|
|
666
|
+
propertyName: string;
|
|
667
|
+
mapping?: {
|
|
668
|
+
[value: string]: string;
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
interface XMLObject {
|
|
672
|
+
name?: string;
|
|
673
|
+
namespace?: string;
|
|
674
|
+
prefix?: string;
|
|
675
|
+
attribute?: boolean;
|
|
676
|
+
wrapped?: boolean;
|
|
677
|
+
}
|
|
678
|
+
interface ReferenceObject {
|
|
679
|
+
$ref: string;
|
|
680
|
+
}
|
|
681
|
+
interface ExampleObject {
|
|
682
|
+
summary?: string;
|
|
683
|
+
description?: string;
|
|
684
|
+
value?: any;
|
|
685
|
+
externalValue?: string;
|
|
686
|
+
}
|
|
687
|
+
interface MediaTypeObject {
|
|
688
|
+
schema?: ReferenceObject | SchemaObject;
|
|
689
|
+
example?: any;
|
|
690
|
+
examples?: {
|
|
691
|
+
[media: string]: ReferenceObject | ExampleObject;
|
|
692
|
+
};
|
|
693
|
+
encoding?: {
|
|
694
|
+
[media: string]: EncodingObject;
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
interface EncodingObject {
|
|
698
|
+
contentType?: string;
|
|
699
|
+
headers?: {
|
|
700
|
+
[header: string]: ReferenceObject | HeaderObject;
|
|
701
|
+
};
|
|
702
|
+
style?: string;
|
|
703
|
+
explode?: boolean;
|
|
704
|
+
allowReserved?: boolean;
|
|
705
|
+
}
|
|
706
|
+
interface RequestBodyObject {
|
|
707
|
+
description?: string;
|
|
708
|
+
content: {
|
|
709
|
+
[media: string]: MediaTypeObject;
|
|
710
|
+
};
|
|
711
|
+
required?: boolean;
|
|
712
|
+
}
|
|
713
|
+
interface ResponsesObject {
|
|
714
|
+
[code: string]: ReferenceObject | ResponseObject;
|
|
715
|
+
}
|
|
716
|
+
interface ResponseObject {
|
|
717
|
+
description: string;
|
|
718
|
+
headers?: {
|
|
719
|
+
[header: string]: ReferenceObject | HeaderObject;
|
|
720
|
+
};
|
|
721
|
+
content?: {
|
|
722
|
+
[media: string]: MediaTypeObject;
|
|
723
|
+
};
|
|
724
|
+
links?: {
|
|
725
|
+
[link: string]: ReferenceObject | LinkObject;
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
interface LinkObject {
|
|
729
|
+
operationRef?: string;
|
|
730
|
+
operationId?: string;
|
|
731
|
+
parameters?: {
|
|
732
|
+
[parameter: string]: any;
|
|
733
|
+
};
|
|
734
|
+
requestBody?: any;
|
|
735
|
+
description?: string;
|
|
736
|
+
server?: ServerObject;
|
|
737
|
+
}
|
|
738
|
+
interface CallbackObject {
|
|
739
|
+
[url: string]: PathItemObject;
|
|
740
|
+
}
|
|
741
|
+
interface SecurityRequirementObject {
|
|
742
|
+
[name: string]: string[];
|
|
743
|
+
}
|
|
744
|
+
interface ComponentsObject {
|
|
745
|
+
schemas?: {
|
|
746
|
+
[key: string]: ReferenceObject | SchemaObject;
|
|
747
|
+
};
|
|
748
|
+
responses?: {
|
|
749
|
+
[key: string]: ReferenceObject | ResponseObject;
|
|
750
|
+
};
|
|
751
|
+
parameters?: {
|
|
752
|
+
[key: string]: ReferenceObject | ParameterObject;
|
|
753
|
+
};
|
|
754
|
+
examples?: {
|
|
755
|
+
[key: string]: ReferenceObject | ExampleObject;
|
|
756
|
+
};
|
|
757
|
+
requestBodies?: {
|
|
758
|
+
[key: string]: ReferenceObject | RequestBodyObject;
|
|
759
|
+
};
|
|
760
|
+
headers?: {
|
|
761
|
+
[key: string]: ReferenceObject | HeaderObject;
|
|
762
|
+
};
|
|
763
|
+
securitySchemes?: {
|
|
764
|
+
[key: string]: ReferenceObject | SecuritySchemeObject;
|
|
765
|
+
};
|
|
766
|
+
links?: {
|
|
767
|
+
[key: string]: ReferenceObject | LinkObject;
|
|
768
|
+
};
|
|
769
|
+
callbacks?: {
|
|
770
|
+
[key: string]: ReferenceObject | CallbackObject;
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
type SecuritySchemeObject =
|
|
774
|
+
| HttpSecurityScheme
|
|
775
|
+
| ApiKeySecurityScheme
|
|
776
|
+
| OAuth2SecurityScheme
|
|
777
|
+
| OpenIdSecurityScheme;
|
|
778
|
+
interface HttpSecurityScheme {
|
|
779
|
+
type: "http";
|
|
780
|
+
description?: string;
|
|
781
|
+
scheme: string;
|
|
782
|
+
bearerFormat?: string;
|
|
783
|
+
}
|
|
784
|
+
interface ApiKeySecurityScheme {
|
|
785
|
+
type: "apiKey";
|
|
786
|
+
description?: string;
|
|
787
|
+
name: string;
|
|
788
|
+
in: string;
|
|
789
|
+
}
|
|
790
|
+
interface OAuth2SecurityScheme {
|
|
791
|
+
type: "oauth2";
|
|
792
|
+
description?: string;
|
|
793
|
+
flows: {
|
|
794
|
+
implicit?: {
|
|
795
|
+
authorizationUrl: string;
|
|
796
|
+
refreshUrl?: string;
|
|
797
|
+
scopes: {
|
|
798
|
+
[scope: string]: string;
|
|
684
799
|
};
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
description: string;
|
|
692
|
-
headers?: {
|
|
693
|
-
[header: string]: ReferenceObject | HeaderObject;
|
|
800
|
+
};
|
|
801
|
+
password?: {
|
|
802
|
+
tokenUrl: string;
|
|
803
|
+
refreshUrl?: string;
|
|
804
|
+
scopes: {
|
|
805
|
+
[scope: string]: string;
|
|
694
806
|
};
|
|
695
|
-
|
|
696
|
-
|
|
807
|
+
};
|
|
808
|
+
clientCredentials?: {
|
|
809
|
+
tokenUrl: string;
|
|
810
|
+
refreshUrl?: string;
|
|
811
|
+
scopes: {
|
|
812
|
+
[scope: string]: string;
|
|
697
813
|
};
|
|
698
|
-
|
|
699
|
-
|
|
814
|
+
};
|
|
815
|
+
authorizationCode?: {
|
|
816
|
+
authorizationUrl: string;
|
|
817
|
+
tokenUrl: string;
|
|
818
|
+
refreshUrl?: string;
|
|
819
|
+
scopes: {
|
|
820
|
+
[scope: string]: string;
|
|
700
821
|
};
|
|
822
|
+
};
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
interface OpenIdSecurityScheme {
|
|
826
|
+
type: "openIdConnect";
|
|
827
|
+
description?: string;
|
|
828
|
+
openIdConnectUrl: string;
|
|
829
|
+
}
|
|
830
|
+
interface TagObject {
|
|
831
|
+
name: string;
|
|
832
|
+
description?: string;
|
|
833
|
+
externalDocs?: ExternalDocumentationObject;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
declare namespace OpenAPIV3_1 {
|
|
838
|
+
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
839
|
+
type PathsWebhooksComponents<T extends {} = {}> = {
|
|
840
|
+
paths: PathsObject<T>;
|
|
841
|
+
webhooks: Record<string, PathItemObject | ReferenceObject>;
|
|
842
|
+
components: ComponentsObject;
|
|
843
|
+
};
|
|
844
|
+
type Document<T extends {} = {}> = Modify<
|
|
845
|
+
Omit<OpenAPIV3.Document<T>, "paths" | "components">,
|
|
846
|
+
{
|
|
847
|
+
info: InfoObject;
|
|
848
|
+
jsonSchemaDialect?: string;
|
|
849
|
+
servers?: ServerObject[];
|
|
850
|
+
} & (
|
|
851
|
+
| (Pick<PathsWebhooksComponents<T>, "paths"> &
|
|
852
|
+
Omit<Partial<PathsWebhooksComponents<T>>, "paths">)
|
|
853
|
+
| (Pick<PathsWebhooksComponents<T>, "webhooks"> &
|
|
854
|
+
Omit<Partial<PathsWebhooksComponents<T>>, "webhooks">)
|
|
855
|
+
| (Pick<PathsWebhooksComponents<T>, "components"> &
|
|
856
|
+
Omit<Partial<PathsWebhooksComponents<T>>, "components">)
|
|
857
|
+
)
|
|
858
|
+
>;
|
|
859
|
+
type InfoObject = Modify<
|
|
860
|
+
OpenAPIV3.InfoObject,
|
|
861
|
+
{
|
|
862
|
+
summary?: string;
|
|
863
|
+
license?: LicenseObject;
|
|
701
864
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
requestBody?: any;
|
|
709
|
-
description?: string;
|
|
710
|
-
server?: ServerObject;
|
|
865
|
+
>;
|
|
866
|
+
type ContactObject = OpenAPIV3.ContactObject;
|
|
867
|
+
type LicenseObject = Modify<
|
|
868
|
+
OpenAPIV3.LicenseObject,
|
|
869
|
+
{
|
|
870
|
+
identifier?: string;
|
|
711
871
|
}
|
|
712
|
-
|
|
713
|
-
|
|
872
|
+
>;
|
|
873
|
+
type ServerObject = Modify<
|
|
874
|
+
OpenAPIV3.ServerObject,
|
|
875
|
+
{
|
|
876
|
+
url: string;
|
|
877
|
+
description?: string;
|
|
878
|
+
variables?: Record<string, ServerVariableObject>;
|
|
714
879
|
}
|
|
715
|
-
|
|
716
|
-
|
|
880
|
+
>;
|
|
881
|
+
type ServerVariableObject = Modify<
|
|
882
|
+
OpenAPIV3.ServerVariableObject,
|
|
883
|
+
{
|
|
884
|
+
enum?: [string, ...string[]];
|
|
717
885
|
}
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
[key: string]: ReferenceObject | ExampleObject;
|
|
730
|
-
};
|
|
731
|
-
requestBodies?: {
|
|
732
|
-
[key: string]: ReferenceObject | RequestBodyObject;
|
|
733
|
-
};
|
|
734
|
-
headers?: {
|
|
735
|
-
[key: string]: ReferenceObject | HeaderObject;
|
|
736
|
-
};
|
|
737
|
-
securitySchemes?: {
|
|
738
|
-
[key: string]: ReferenceObject | SecuritySchemeObject;
|
|
739
|
-
};
|
|
740
|
-
links?: {
|
|
741
|
-
[key: string]: ReferenceObject | LinkObject;
|
|
742
|
-
};
|
|
743
|
-
callbacks?: {
|
|
744
|
-
[key: string]: ReferenceObject | CallbackObject;
|
|
745
|
-
};
|
|
886
|
+
>;
|
|
887
|
+
type PathsObject<T extends {} = {}, P extends {} = {}> = Record<
|
|
888
|
+
string,
|
|
889
|
+
(PathItemObject<T> & P) | undefined
|
|
890
|
+
>;
|
|
891
|
+
type HttpMethods = OpenAPIV3.HttpMethods;
|
|
892
|
+
type PathItemObject<T extends {} = {}> = Modify<
|
|
893
|
+
OpenAPIV3.PathItemObject<T>,
|
|
894
|
+
{
|
|
895
|
+
servers?: ServerObject[];
|
|
896
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
746
897
|
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
898
|
+
> & {
|
|
899
|
+
[method in HttpMethods]?: OperationObject<T>;
|
|
900
|
+
};
|
|
901
|
+
type OperationObject<T extends {} = {}> = Modify<
|
|
902
|
+
OpenAPIV3.OperationObject<T>,
|
|
903
|
+
{
|
|
904
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
905
|
+
requestBody?: ReferenceObject | RequestBodyObject;
|
|
906
|
+
responses?: ResponsesObject;
|
|
907
|
+
callbacks?: Record<string, ReferenceObject | CallbackObject>;
|
|
908
|
+
servers?: ServerObject[];
|
|
753
909
|
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
910
|
+
> &
|
|
911
|
+
T;
|
|
912
|
+
type ExternalDocumentationObject = OpenAPIV3.ExternalDocumentationObject;
|
|
913
|
+
type ParameterObject = OpenAPIV3.ParameterObject;
|
|
914
|
+
type HeaderObject = OpenAPIV3.HeaderObject;
|
|
915
|
+
type ParameterBaseObject = OpenAPIV3.ParameterBaseObject;
|
|
916
|
+
type NonArraySchemaObjectType = OpenAPIV3.NonArraySchemaObjectType | "null";
|
|
917
|
+
type ArraySchemaObjectType = OpenAPIV3.ArraySchemaObjectType;
|
|
918
|
+
/**
|
|
919
|
+
* There is no way to tell typescript to require items when type is either 'array' or array containing 'array' type
|
|
920
|
+
* 'items' will be always visible as optional
|
|
921
|
+
* Casting schema object to ArraySchemaObject or NonArraySchemaObject will work fine
|
|
922
|
+
*/
|
|
923
|
+
type SchemaObject =
|
|
924
|
+
| ArraySchemaObject
|
|
925
|
+
| NonArraySchemaObject
|
|
926
|
+
| MixedSchemaObject;
|
|
927
|
+
interface ArraySchemaObject extends BaseSchemaObject {
|
|
928
|
+
type: ArraySchemaObjectType;
|
|
929
|
+
items: ReferenceObject | SchemaObject;
|
|
930
|
+
}
|
|
931
|
+
interface NonArraySchemaObject extends BaseSchemaObject {
|
|
932
|
+
type?: NonArraySchemaObjectType;
|
|
933
|
+
}
|
|
934
|
+
interface MixedSchemaObject extends BaseSchemaObject {
|
|
935
|
+
type?: (ArraySchemaObjectType | NonArraySchemaObjectType)[];
|
|
936
|
+
items?: ReferenceObject | SchemaObject;
|
|
937
|
+
}
|
|
938
|
+
type BaseSchemaObject = Modify<
|
|
939
|
+
Omit<OpenAPIV3.BaseSchemaObject, "nullable">,
|
|
940
|
+
{
|
|
941
|
+
examples?: OpenAPIV3.BaseSchemaObject["example"][];
|
|
942
|
+
exclusiveMinimum?: boolean | number;
|
|
943
|
+
exclusiveMaximum?: boolean | number;
|
|
944
|
+
contentMediaType?: string;
|
|
945
|
+
$schema?: string;
|
|
946
|
+
additionalProperties?: boolean | ReferenceObject | SchemaObject;
|
|
947
|
+
properties?: {
|
|
948
|
+
[name: string]: ReferenceObject | SchemaObject;
|
|
949
|
+
};
|
|
950
|
+
allOf?: (ReferenceObject | SchemaObject)[];
|
|
951
|
+
oneOf?: (ReferenceObject | SchemaObject)[];
|
|
952
|
+
anyOf?: (ReferenceObject | SchemaObject)[];
|
|
953
|
+
not?: ReferenceObject | SchemaObject;
|
|
954
|
+
discriminator?: DiscriminatorObject;
|
|
955
|
+
externalDocs?: ExternalDocumentationObject;
|
|
956
|
+
xml?: XMLObject;
|
|
957
|
+
const?: any;
|
|
759
958
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
[scope: string]: string;
|
|
769
|
-
};
|
|
770
|
-
};
|
|
771
|
-
password?: {
|
|
772
|
-
tokenUrl: string;
|
|
773
|
-
refreshUrl?: string;
|
|
774
|
-
scopes: {
|
|
775
|
-
[scope: string]: string;
|
|
776
|
-
};
|
|
777
|
-
};
|
|
778
|
-
clientCredentials?: {
|
|
779
|
-
tokenUrl: string;
|
|
780
|
-
refreshUrl?: string;
|
|
781
|
-
scopes: {
|
|
782
|
-
[scope: string]: string;
|
|
783
|
-
};
|
|
784
|
-
};
|
|
785
|
-
authorizationCode?: {
|
|
786
|
-
authorizationUrl: string;
|
|
787
|
-
tokenUrl: string;
|
|
788
|
-
refreshUrl?: string;
|
|
789
|
-
scopes: {
|
|
790
|
-
[scope: string]: string;
|
|
791
|
-
};
|
|
792
|
-
};
|
|
793
|
-
};
|
|
959
|
+
>;
|
|
960
|
+
type DiscriminatorObject = OpenAPIV3.DiscriminatorObject;
|
|
961
|
+
type XMLObject = OpenAPIV3.XMLObject;
|
|
962
|
+
type ReferenceObject = Modify<
|
|
963
|
+
OpenAPIV3.ReferenceObject,
|
|
964
|
+
{
|
|
965
|
+
summary?: string;
|
|
966
|
+
description?: string;
|
|
794
967
|
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
968
|
+
>;
|
|
969
|
+
type ExampleObject = OpenAPIV3.ExampleObject;
|
|
970
|
+
type MediaTypeObject = Modify<
|
|
971
|
+
OpenAPIV3.MediaTypeObject,
|
|
972
|
+
{
|
|
973
|
+
schema?: SchemaObject | ReferenceObject;
|
|
974
|
+
examples?: Record<string, ReferenceObject | ExampleObject>;
|
|
799
975
|
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
976
|
+
>;
|
|
977
|
+
type EncodingObject = OpenAPIV3.EncodingObject;
|
|
978
|
+
type RequestBodyObject = Modify<
|
|
979
|
+
OpenAPIV3.RequestBodyObject,
|
|
980
|
+
{
|
|
981
|
+
content: {
|
|
982
|
+
[media: string]: MediaTypeObject;
|
|
983
|
+
};
|
|
804
984
|
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
type InfoObject = Modify<OpenAPIV3.InfoObject, {
|
|
820
|
-
summary?: string;
|
|
821
|
-
license?: LicenseObject;
|
|
822
|
-
}>;
|
|
823
|
-
type ContactObject = OpenAPIV3.ContactObject;
|
|
824
|
-
type LicenseObject = Modify<OpenAPIV3.LicenseObject, {
|
|
825
|
-
identifier?: string;
|
|
826
|
-
}>;
|
|
827
|
-
type ServerObject = Modify<OpenAPIV3.ServerObject, {
|
|
828
|
-
url: string;
|
|
829
|
-
description?: string;
|
|
830
|
-
variables?: Record<string, ServerVariableObject>;
|
|
831
|
-
}>;
|
|
832
|
-
type ServerVariableObject = Modify<OpenAPIV3.ServerVariableObject, {
|
|
833
|
-
enum?: [string, ...string[]];
|
|
834
|
-
}>;
|
|
835
|
-
type PathsObject<T extends {} = {}, P extends {} = {}> = Record<string, (PathItemObject<T> & P) | undefined>;
|
|
836
|
-
type HttpMethods = OpenAPIV3.HttpMethods;
|
|
837
|
-
type PathItemObject<T extends {} = {}> = Modify<OpenAPIV3.PathItemObject<T>, {
|
|
838
|
-
servers?: ServerObject[];
|
|
839
|
-
parameters?: (ReferenceObject | ParameterObject)[];
|
|
840
|
-
}> & {
|
|
841
|
-
[method in HttpMethods]?: OperationObject<T>;
|
|
842
|
-
};
|
|
843
|
-
type OperationObject<T extends {} = {}> = Modify<OpenAPIV3.OperationObject<T>, {
|
|
844
|
-
parameters?: (ReferenceObject | ParameterObject)[];
|
|
845
|
-
requestBody?: ReferenceObject | RequestBodyObject;
|
|
846
|
-
responses?: ResponsesObject;
|
|
847
|
-
callbacks?: Record<string, ReferenceObject | CallbackObject>;
|
|
848
|
-
servers?: ServerObject[];
|
|
849
|
-
}> & T;
|
|
850
|
-
type ExternalDocumentationObject = OpenAPIV3.ExternalDocumentationObject;
|
|
851
|
-
type ParameterObject = OpenAPIV3.ParameterObject;
|
|
852
|
-
type HeaderObject = OpenAPIV3.HeaderObject;
|
|
853
|
-
type ParameterBaseObject = OpenAPIV3.ParameterBaseObject;
|
|
854
|
-
type NonArraySchemaObjectType = OpenAPIV3.NonArraySchemaObjectType | 'null';
|
|
855
|
-
type ArraySchemaObjectType = OpenAPIV3.ArraySchemaObjectType;
|
|
856
|
-
/**
|
|
857
|
-
* There is no way to tell typescript to require items when type is either 'array' or array containing 'array' type
|
|
858
|
-
* 'items' will be always visible as optional
|
|
859
|
-
* Casting schema object to ArraySchemaObject or NonArraySchemaObject will work fine
|
|
860
|
-
*/
|
|
861
|
-
type SchemaObject = ArraySchemaObject | NonArraySchemaObject | MixedSchemaObject;
|
|
862
|
-
interface ArraySchemaObject extends BaseSchemaObject {
|
|
863
|
-
type: ArraySchemaObjectType;
|
|
864
|
-
items: ReferenceObject | SchemaObject;
|
|
985
|
+
>;
|
|
986
|
+
type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
|
|
987
|
+
type ResponseObject = Modify<
|
|
988
|
+
OpenAPIV3.ResponseObject,
|
|
989
|
+
{
|
|
990
|
+
headers?: {
|
|
991
|
+
[header: string]: ReferenceObject | HeaderObject;
|
|
992
|
+
};
|
|
993
|
+
content?: {
|
|
994
|
+
[media: string]: MediaTypeObject;
|
|
995
|
+
};
|
|
996
|
+
links?: {
|
|
997
|
+
[link: string]: ReferenceObject | LinkObject;
|
|
998
|
+
};
|
|
865
999
|
}
|
|
866
|
-
|
|
867
|
-
|
|
1000
|
+
>;
|
|
1001
|
+
type LinkObject = Modify<
|
|
1002
|
+
OpenAPIV3.LinkObject,
|
|
1003
|
+
{
|
|
1004
|
+
server?: ServerObject;
|
|
868
1005
|
}
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
1006
|
+
>;
|
|
1007
|
+
type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
|
|
1008
|
+
type SecurityRequirementObject = OpenAPIV3.SecurityRequirementObject;
|
|
1009
|
+
type ComponentsObject = Modify<
|
|
1010
|
+
OpenAPIV3.ComponentsObject,
|
|
1011
|
+
{
|
|
1012
|
+
schemas?: Record<string, SchemaObject>;
|
|
1013
|
+
responses?: Record<string, ReferenceObject | ResponseObject>;
|
|
1014
|
+
parameters?: Record<string, ReferenceObject | ParameterObject>;
|
|
1015
|
+
examples?: Record<string, ReferenceObject | ExampleObject>;
|
|
1016
|
+
requestBodies?: Record<string, ReferenceObject | RequestBodyObject>;
|
|
1017
|
+
headers?: Record<string, ReferenceObject | HeaderObject>;
|
|
1018
|
+
securitySchemes?: Record<string, ReferenceObject | SecuritySchemeObject>;
|
|
1019
|
+
links?: Record<string, ReferenceObject | LinkObject>;
|
|
1020
|
+
callbacks?: Record<string, ReferenceObject | CallbackObject>;
|
|
1021
|
+
pathItems?: Record<string, ReferenceObject | PathItemObject>;
|
|
872
1022
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
};
|
|
883
|
-
allOf?: (ReferenceObject | SchemaObject)[];
|
|
884
|
-
oneOf?: (ReferenceObject | SchemaObject)[];
|
|
885
|
-
anyOf?: (ReferenceObject | SchemaObject)[];
|
|
886
|
-
not?: ReferenceObject | SchemaObject;
|
|
887
|
-
discriminator?: DiscriminatorObject;
|
|
888
|
-
externalDocs?: ExternalDocumentationObject;
|
|
889
|
-
xml?: XMLObject;
|
|
890
|
-
const?: any;
|
|
891
|
-
}>;
|
|
892
|
-
type DiscriminatorObject = OpenAPIV3.DiscriminatorObject;
|
|
893
|
-
type XMLObject = OpenAPIV3.XMLObject;
|
|
894
|
-
type ReferenceObject = Modify<OpenAPIV3.ReferenceObject, {
|
|
895
|
-
summary?: string;
|
|
896
|
-
description?: string;
|
|
897
|
-
}>;
|
|
898
|
-
type ExampleObject = OpenAPIV3.ExampleObject;
|
|
899
|
-
type MediaTypeObject = Modify<OpenAPIV3.MediaTypeObject, {
|
|
900
|
-
schema?: SchemaObject | ReferenceObject;
|
|
901
|
-
examples?: Record<string, ReferenceObject | ExampleObject>;
|
|
902
|
-
}>;
|
|
903
|
-
type EncodingObject = OpenAPIV3.EncodingObject;
|
|
904
|
-
type RequestBodyObject = Modify<OpenAPIV3.RequestBodyObject, {
|
|
905
|
-
content: {
|
|
906
|
-
[media: string]: MediaTypeObject;
|
|
907
|
-
};
|
|
908
|
-
}>;
|
|
909
|
-
type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
|
|
910
|
-
type ResponseObject = Modify<OpenAPIV3.ResponseObject, {
|
|
911
|
-
headers?: {
|
|
912
|
-
[header: string]: ReferenceObject | HeaderObject;
|
|
913
|
-
};
|
|
914
|
-
content?: {
|
|
915
|
-
[media: string]: MediaTypeObject;
|
|
916
|
-
};
|
|
917
|
-
links?: {
|
|
918
|
-
[link: string]: ReferenceObject | LinkObject;
|
|
919
|
-
};
|
|
920
|
-
}>;
|
|
921
|
-
type LinkObject = Modify<OpenAPIV3.LinkObject, {
|
|
922
|
-
server?: ServerObject;
|
|
923
|
-
}>;
|
|
924
|
-
type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
|
|
925
|
-
type SecurityRequirementObject = OpenAPIV3.SecurityRequirementObject;
|
|
926
|
-
type ComponentsObject = Modify<OpenAPIV3.ComponentsObject, {
|
|
927
|
-
schemas?: Record<string, SchemaObject>;
|
|
928
|
-
responses?: Record<string, ReferenceObject | ResponseObject>;
|
|
929
|
-
parameters?: Record<string, ReferenceObject | ParameterObject>;
|
|
930
|
-
examples?: Record<string, ReferenceObject | ExampleObject>;
|
|
931
|
-
requestBodies?: Record<string, ReferenceObject | RequestBodyObject>;
|
|
932
|
-
headers?: Record<string, ReferenceObject | HeaderObject>;
|
|
933
|
-
securitySchemes?: Record<string, ReferenceObject | SecuritySchemeObject>;
|
|
934
|
-
links?: Record<string, ReferenceObject | LinkObject>;
|
|
935
|
-
callbacks?: Record<string, ReferenceObject | CallbackObject>;
|
|
936
|
-
pathItems?: Record<string, ReferenceObject | PathItemObject>;
|
|
937
|
-
}>;
|
|
938
|
-
type SecuritySchemeObject = OpenAPIV3.SecuritySchemeObject;
|
|
939
|
-
type HttpSecurityScheme = OpenAPIV3.HttpSecurityScheme;
|
|
940
|
-
type ApiKeySecurityScheme = OpenAPIV3.ApiKeySecurityScheme;
|
|
941
|
-
type OAuth2SecurityScheme = OpenAPIV3.OAuth2SecurityScheme;
|
|
942
|
-
type OpenIdSecurityScheme = OpenAPIV3.OpenIdSecurityScheme;
|
|
943
|
-
type TagObject = OpenAPIV3.TagObject;
|
|
944
|
-
{};
|
|
1023
|
+
>;
|
|
1024
|
+
type SecuritySchemeObject = OpenAPIV3.SecuritySchemeObject;
|
|
1025
|
+
type HttpSecurityScheme = OpenAPIV3.HttpSecurityScheme;
|
|
1026
|
+
type ApiKeySecurityScheme = OpenAPIV3.ApiKeySecurityScheme;
|
|
1027
|
+
type OAuth2SecurityScheme = OpenAPIV3.OAuth2SecurityScheme;
|
|
1028
|
+
type OpenIdSecurityScheme = OpenAPIV3.OpenIdSecurityScheme;
|
|
1029
|
+
type TagObject = OpenAPIV3.TagObject;
|
|
1030
|
+
{
|
|
1031
|
+
}
|
|
945
1032
|
}
|
|
946
1033
|
|
|
947
1034
|
/**
|
|
948
1035
|
* Base object for parameter definitions
|
|
949
1036
|
* @public
|
|
950
1037
|
*/
|
|
951
|
-
declare type ParameterBaseObject = Modify<
|
|
1038
|
+
declare type ParameterBaseObject = Modify<
|
|
1039
|
+
Omit<
|
|
1040
|
+
OpenAPIV3_1.ParameterBaseObject,
|
|
1041
|
+
| "content"
|
|
1042
|
+
| "allowEmptyValue"
|
|
1043
|
+
| "style"
|
|
1044
|
+
| "allowReserved"
|
|
1045
|
+
| "explode"
|
|
1046
|
+
| "example"
|
|
1047
|
+
| "examples"
|
|
1048
|
+
>,
|
|
1049
|
+
{
|
|
952
1050
|
schema: OpenAPIV3_1.SchemaObject;
|
|
953
|
-
}
|
|
1051
|
+
}
|
|
1052
|
+
>;
|
|
954
1053
|
|
|
955
1054
|
/**
|
|
956
1055
|
* Definition of a parameter
|
|
957
1056
|
* @public
|
|
958
1057
|
*/
|
|
959
1058
|
declare interface ParameterDefinition extends ParameterBaseObject {
|
|
960
|
-
|
|
961
|
-
|
|
1059
|
+
name: string;
|
|
1060
|
+
in: string;
|
|
962
1061
|
}
|
|
963
1062
|
|
|
964
1063
|
/**
|
|
965
1064
|
* @public
|
|
966
1065
|
*/
|
|
967
1066
|
declare interface PolicyConfiguration {
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1067
|
+
name: string;
|
|
1068
|
+
policyType: string;
|
|
1069
|
+
handler: HandlerDefinition;
|
|
1070
|
+
options?: unknown;
|
|
972
1071
|
}
|
|
973
1072
|
|
|
974
1073
|
/**
|
|
975
1074
|
* Definition of responses for a route
|
|
976
1075
|
* @public
|
|
977
1076
|
*/
|
|
978
|
-
export declare type ResponsesDefinition = Record<
|
|
979
|
-
|
|
1077
|
+
export declare type ResponsesDefinition = Record<
|
|
1078
|
+
HttpStatusCode | HttpStatusCodeRangeDefinition,
|
|
1079
|
+
Modify<
|
|
1080
|
+
Omit<OpenAPIV3_1.ResponseObject, "links">,
|
|
1081
|
+
{
|
|
1082
|
+
headers?: {
|
|
980
1083
|
[header: string]: ParameterBaseObject;
|
|
981
|
-
|
|
982
|
-
}
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
>
|
|
1087
|
+
>;
|
|
983
1088
|
|
|
984
1089
|
/**
|
|
985
1090
|
* @public
|
|
986
1091
|
*/
|
|
987
|
-
export declare interface RouteConfiguration
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1092
|
+
export declare interface RouteConfiguration
|
|
1093
|
+
extends Omit<BuildRouteConfiguration, "raw"> {
|
|
1094
|
+
/**
|
|
1095
|
+
* @deprecated Please switch to "raw().operationId"
|
|
1096
|
+
*/
|
|
1097
|
+
operationId?: string;
|
|
1098
|
+
/**
|
|
1099
|
+
* @deprecated Please switch to "raw().summary"
|
|
1100
|
+
*/
|
|
1101
|
+
summary?: string;
|
|
1102
|
+
/**
|
|
1103
|
+
* @deprecated Please switch to "raw().tags"
|
|
1104
|
+
*/
|
|
1105
|
+
tags?: string[];
|
|
1106
|
+
/**
|
|
1107
|
+
* @deprecated Please switch to "raw().parameters"
|
|
1108
|
+
*/
|
|
1109
|
+
parameters?: ParameterDefinition[];
|
|
1110
|
+
/**
|
|
1111
|
+
* @deprecated Please switch to "raw().responses"
|
|
1112
|
+
*/
|
|
1113
|
+
responses?: ResponsesDefinition;
|
|
1114
|
+
/**
|
|
1115
|
+
* Gets the raw route configuration object
|
|
1116
|
+
*/
|
|
1117
|
+
raw<T = any>(): T;
|
|
1012
1118
|
}
|
|
1013
1119
|
|
|
1014
1120
|
/**
|
|
1015
1121
|
* @public
|
|
1016
1122
|
*/
|
|
1017
1123
|
export declare interface RouteData {
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1124
|
+
/**
|
|
1125
|
+
* @deprecated This property is not used and will be removed in future versions
|
|
1126
|
+
*/
|
|
1127
|
+
info?: OpenAPIV3_1.InfoObject;
|
|
1128
|
+
routes: RouteConfiguration[];
|
|
1129
|
+
policies: PolicyConfiguration[];
|
|
1130
|
+
corsPolicies: CorsPolicyConfiguration[];
|
|
1025
1131
|
}
|
|
1026
1132
|
|
|
1027
1133
|
/* Excluded from this release type: sanitizedIdentifierName */
|
|
1028
1134
|
|
|
1029
1135
|
/* Excluded from this release type: StandardEnv */
|
|
1030
1136
|
|
|
1031
|
-
export {
|
|
1137
|
+
export {};
|