@scalar/openapi-types 0.0.1 → 0.1.0
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/CHANGELOG.md +6 -0
- package/README.md +4 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/openapi-types.d.ts +760 -0
- package/dist/openapi-types.d.ts.map +1 -0
- package/dist/openapi-types.js +37 -0
- package/package.json +18 -3
- package/src/index.ts +0 -1
- package/src/openapi-types.ts +0 -957
|
@@ -0,0 +1,760 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These types are copied from openapi-types, with two modifications:
|
|
3
|
+
*
|
|
4
|
+
* - all attributes are optional, you can’t rely on the specification for user input
|
|
5
|
+
* - extensions (basically any attributes, not only prefixed with an `x-`) are allowed
|
|
6
|
+
*
|
|
7
|
+
* We deal with user input and can’t assume they really stick to any official specification.
|
|
8
|
+
*/
|
|
9
|
+
/** any other attribute, for example x-* extensions */
|
|
10
|
+
type AnyOtherAttribute = {
|
|
11
|
+
/** OpenAPI extension */
|
|
12
|
+
[customExtension: `x-${string}`]: any;
|
|
13
|
+
/** Unknown attribute */
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
export declare namespace OpenAPI {
|
|
17
|
+
type Document<T extends AnyOtherAttribute = {}> = OpenAPIV2.Document<T> | OpenAPIV3.Document<T> | OpenAPIV3_1.Document<T>;
|
|
18
|
+
type Operation<T = {}> = OpenAPIV2.OperationObject<T> | OpenAPIV3.OperationObject<T> | OpenAPIV3_1.OperationObject<T>;
|
|
19
|
+
type Request = {
|
|
20
|
+
body?: any;
|
|
21
|
+
headers?: object;
|
|
22
|
+
params?: object;
|
|
23
|
+
query?: object;
|
|
24
|
+
};
|
|
25
|
+
type ResponseObject = OpenAPIV2.ResponseObject | OpenAPIV3.ResponseObject | OpenAPIV3_1.ResponseObject;
|
|
26
|
+
type Parameter = OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.ParameterObject | OpenAPIV3.ReferenceObject | OpenAPIV3.ParameterObject | OpenAPIV2.ReferenceObject | OpenAPIV2.Parameter;
|
|
27
|
+
type Parameters = (OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.ParameterObject)[] | (OpenAPIV3.ReferenceObject | OpenAPIV3.ParameterObject)[] | (OpenAPIV2.ReferenceObject | OpenAPIV2.Parameter)[];
|
|
28
|
+
type ExampleObject = OpenAPIV2.ExampleObject | OpenAPIV3.ExampleObject | OpenAPIV3_1.ExampleObject;
|
|
29
|
+
type SchemaObject = OpenAPIV2.SchemaObject | OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject;
|
|
30
|
+
}
|
|
31
|
+
export declare namespace OpenAPIV3_1 {
|
|
32
|
+
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
33
|
+
type PathsWebhooksComponents<T = {}> = {
|
|
34
|
+
paths?: PathsObject<T>;
|
|
35
|
+
webhooks?: Record<string, PathItemObject | ReferenceObject>;
|
|
36
|
+
components?: ComponentsObject;
|
|
37
|
+
};
|
|
38
|
+
export type Document<T = {}> = Modify<Omit<OpenAPIV3.Document<T>, 'paths' | 'components'>, {
|
|
39
|
+
/**
|
|
40
|
+
* Version of the OpenAPI specification
|
|
41
|
+
* @see https://github.com/OAI/OpenAPI-Specification/tree/main/versions
|
|
42
|
+
*/
|
|
43
|
+
openapi?: '3.1.0';
|
|
44
|
+
swagger?: undefined;
|
|
45
|
+
info?: InfoObject;
|
|
46
|
+
jsonSchemaDialect?: string;
|
|
47
|
+
servers?: ServerObject[];
|
|
48
|
+
} & ((Pick<PathsWebhooksComponents<T>, 'paths'> & Omit<Partial<PathsWebhooksComponents<T>>, 'paths'>) | (Pick<PathsWebhooksComponents<T>, 'webhooks'> & Omit<Partial<PathsWebhooksComponents<T>>, 'webhooks'>) | (Pick<PathsWebhooksComponents<T>, 'components'> & Omit<Partial<PathsWebhooksComponents<T>>, 'components'>)) & T & AnyOtherAttribute>;
|
|
49
|
+
export type InfoObject = Modify<OpenAPIV3.InfoObject, {
|
|
50
|
+
summary?: string;
|
|
51
|
+
license?: LicenseObject;
|
|
52
|
+
}>;
|
|
53
|
+
export type ContactObject = OpenAPIV3.ContactObject;
|
|
54
|
+
export type LicenseObject = Modify<OpenAPIV3.LicenseObject, {
|
|
55
|
+
identifier?: string;
|
|
56
|
+
}>;
|
|
57
|
+
export type ServerObject = Modify<OpenAPIV3.ServerObject, {
|
|
58
|
+
url?: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
variables?: Record<string, ServerVariableObject>;
|
|
61
|
+
}>;
|
|
62
|
+
export type ServerVariableObject = Modify<OpenAPIV3.ServerVariableObject, {
|
|
63
|
+
enum?: [string, ...string[]];
|
|
64
|
+
}>;
|
|
65
|
+
export type PathsObject<T = {}, P extends {} = {}> = Record<string, (PathItemObject<T> & P) | undefined>;
|
|
66
|
+
export type HttpMethods = OpenAPIV3.HttpMethods;
|
|
67
|
+
export type PathItemObject<T = {}> = Modify<OpenAPIV3.PathItemObject<T>, {
|
|
68
|
+
servers?: ServerObject[];
|
|
69
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
70
|
+
}> & {
|
|
71
|
+
[method in HttpMethods]?: OperationObject<T>;
|
|
72
|
+
};
|
|
73
|
+
export type OperationObject<T = {}> = Modify<OpenAPIV3.OperationObject<T>, {
|
|
74
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
75
|
+
requestBody?: ReferenceObject | RequestBodyObject;
|
|
76
|
+
responses?: ResponsesObject;
|
|
77
|
+
callbacks?: Record<string, ReferenceObject | CallbackObject>;
|
|
78
|
+
servers?: ServerObject[];
|
|
79
|
+
}> & T;
|
|
80
|
+
export type ExternalDocumentationObject = OpenAPIV3.ExternalDocumentationObject;
|
|
81
|
+
export type ParameterObject = OpenAPIV3.ParameterObject;
|
|
82
|
+
export type HeaderObject = OpenAPIV3.HeaderObject;
|
|
83
|
+
export type ParameterBaseObject = OpenAPIV3.ParameterBaseObject;
|
|
84
|
+
export type NonArraySchemaObjectType = OpenAPIV3.NonArraySchemaObjectType | 'null';
|
|
85
|
+
export type ArraySchemaObjectType = OpenAPIV3.ArraySchemaObjectType;
|
|
86
|
+
/**
|
|
87
|
+
* There is no way to tell typescript to require items when type is either 'array' or array containing 'array' type
|
|
88
|
+
* 'items' will be always visible as optional
|
|
89
|
+
* Casting schema object to ArraySchemaObject or NonArraySchemaObject will work fine
|
|
90
|
+
*/
|
|
91
|
+
export type SchemaObject = (ArraySchemaObject | NonArraySchemaObject | MixedSchemaObject | boolean) & AnyOtherAttribute;
|
|
92
|
+
export type ArraySchemaObject = {
|
|
93
|
+
type?: ArraySchemaObjectType;
|
|
94
|
+
items?: ReferenceObject | SchemaObject;
|
|
95
|
+
} & BaseSchemaObject;
|
|
96
|
+
export type NonArraySchemaObject = {
|
|
97
|
+
type?: NonArraySchemaObjectType;
|
|
98
|
+
} & BaseSchemaObject;
|
|
99
|
+
type MixedSchemaObject = {
|
|
100
|
+
type?: (ArraySchemaObjectType | NonArraySchemaObjectType)[];
|
|
101
|
+
items?: ReferenceObject | SchemaObject;
|
|
102
|
+
} & BaseSchemaObject;
|
|
103
|
+
export type BaseSchemaObject = Modify<Omit<OpenAPIV3.BaseSchemaObject, 'nullable'>, {
|
|
104
|
+
examples?: OpenAPIV3.BaseSchemaObject['example'][];
|
|
105
|
+
exclusiveMinimum?: boolean | number;
|
|
106
|
+
exclusiveMaximum?: boolean | number;
|
|
107
|
+
contentMediaType?: string;
|
|
108
|
+
$schema?: string;
|
|
109
|
+
additionalProperties?: boolean | ReferenceObject | SchemaObject;
|
|
110
|
+
properties?: {
|
|
111
|
+
[name: string]: ReferenceObject | SchemaObject;
|
|
112
|
+
};
|
|
113
|
+
allOf?: (ReferenceObject | SchemaObject)[];
|
|
114
|
+
oneOf?: (ReferenceObject | SchemaObject)[];
|
|
115
|
+
anyOf?: (ReferenceObject | SchemaObject)[];
|
|
116
|
+
not?: ReferenceObject | SchemaObject;
|
|
117
|
+
discriminator?: DiscriminatorObject;
|
|
118
|
+
externalDocs?: ExternalDocumentationObject;
|
|
119
|
+
xml?: XMLObject;
|
|
120
|
+
const?: any;
|
|
121
|
+
}>;
|
|
122
|
+
export type DiscriminatorObject = OpenAPIV3.DiscriminatorObject;
|
|
123
|
+
export type XMLObject = OpenAPIV3.XMLObject;
|
|
124
|
+
export type ReferenceObject = Modify<OpenAPIV3.ReferenceObject, {
|
|
125
|
+
summary?: string;
|
|
126
|
+
description?: string;
|
|
127
|
+
}>;
|
|
128
|
+
export type ExampleObject = OpenAPIV3.ExampleObject;
|
|
129
|
+
export type MediaTypeObject = Modify<OpenAPIV3.MediaTypeObject, {
|
|
130
|
+
schema?: SchemaObject | ReferenceObject;
|
|
131
|
+
examples?: Record<string, ReferenceObject | ExampleObject>;
|
|
132
|
+
}>;
|
|
133
|
+
export type EncodingObject = OpenAPIV3.EncodingObject;
|
|
134
|
+
export type RequestBodyObject = Modify<OpenAPIV3.RequestBodyObject, {
|
|
135
|
+
content?: {
|
|
136
|
+
[media: string]: MediaTypeObject;
|
|
137
|
+
};
|
|
138
|
+
}>;
|
|
139
|
+
export type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
|
|
140
|
+
export type ResponseObject = Modify<OpenAPIV3.ResponseObject, {
|
|
141
|
+
headers?: {
|
|
142
|
+
[header: string]: ReferenceObject | HeaderObject;
|
|
143
|
+
};
|
|
144
|
+
content?: {
|
|
145
|
+
[media: string]: MediaTypeObject;
|
|
146
|
+
};
|
|
147
|
+
links?: {
|
|
148
|
+
[link: string]: ReferenceObject | LinkObject;
|
|
149
|
+
};
|
|
150
|
+
}>;
|
|
151
|
+
export type LinkObject = Modify<OpenAPIV3.LinkObject, {
|
|
152
|
+
server?: ServerObject;
|
|
153
|
+
}>;
|
|
154
|
+
export type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
|
|
155
|
+
export type SecurityRequirementObject = OpenAPIV3.SecurityRequirementObject;
|
|
156
|
+
export type ComponentsObject = Modify<OpenAPIV3.ComponentsObject, {
|
|
157
|
+
schemas?: Record<string, SchemaObject>;
|
|
158
|
+
responses?: Record<string, ReferenceObject | ResponseObject>;
|
|
159
|
+
parameters?: Record<string, ReferenceObject | ParameterObject>;
|
|
160
|
+
examples?: Record<string, ReferenceObject | ExampleObject>;
|
|
161
|
+
requestBodies?: Record<string, ReferenceObject | RequestBodyObject>;
|
|
162
|
+
headers?: Record<string, ReferenceObject | HeaderObject>;
|
|
163
|
+
securitySchemes?: Record<string, ReferenceObject | SecuritySchemeObject>;
|
|
164
|
+
links?: Record<string, ReferenceObject | LinkObject>;
|
|
165
|
+
callbacks?: Record<string, ReferenceObject | CallbackObject>;
|
|
166
|
+
pathItems?: Record<string, ReferenceObject | PathItemObject>;
|
|
167
|
+
}>;
|
|
168
|
+
export type SecuritySchemeObject = OpenAPIV3.SecuritySchemeObject;
|
|
169
|
+
export type HttpSecurityScheme = OpenAPIV3.HttpSecurityScheme;
|
|
170
|
+
export type ApiKeySecurityScheme = OpenAPIV3.ApiKeySecurityScheme;
|
|
171
|
+
export type OAuth2SecurityScheme = OpenAPIV3.OAuth2SecurityScheme;
|
|
172
|
+
export type OpenIdSecurityScheme = OpenAPIV3.OpenIdSecurityScheme;
|
|
173
|
+
export type TagObject = OpenAPIV3.TagObject;
|
|
174
|
+
export {};
|
|
175
|
+
}
|
|
176
|
+
export declare namespace OpenAPIV3 {
|
|
177
|
+
type Document<T = {}> = {
|
|
178
|
+
/**
|
|
179
|
+
* Version of the OpenAPI specification
|
|
180
|
+
* @see https://github.com/OAI/OpenAPI-Specification/tree/main/versions
|
|
181
|
+
*/
|
|
182
|
+
openapi?: '3.0.0' | '3.0.1' | '3.0.2' | '3.0.2';
|
|
183
|
+
swagger?: undefined;
|
|
184
|
+
info?: InfoObject;
|
|
185
|
+
servers?: ServerObject[];
|
|
186
|
+
paths?: PathsObject<T>;
|
|
187
|
+
components?: ComponentsObject;
|
|
188
|
+
security?: SecurityRequirementObject[];
|
|
189
|
+
tags?: TagObject[];
|
|
190
|
+
externalDocs?: ExternalDocumentationObject;
|
|
191
|
+
} & T & AnyOtherAttribute;
|
|
192
|
+
type InfoObject = {
|
|
193
|
+
title?: string;
|
|
194
|
+
description?: string;
|
|
195
|
+
termsOfService?: string;
|
|
196
|
+
contact?: ContactObject;
|
|
197
|
+
license?: LicenseObject;
|
|
198
|
+
version?: string;
|
|
199
|
+
};
|
|
200
|
+
type ContactObject = {
|
|
201
|
+
name?: string;
|
|
202
|
+
url?: string;
|
|
203
|
+
email?: string;
|
|
204
|
+
};
|
|
205
|
+
type LicenseObject = {
|
|
206
|
+
name?: string;
|
|
207
|
+
url?: string;
|
|
208
|
+
};
|
|
209
|
+
type ServerObject = {
|
|
210
|
+
url?: string;
|
|
211
|
+
description?: string;
|
|
212
|
+
variables?: {
|
|
213
|
+
[variable: string]: ServerVariableObject;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
type ServerVariableObject = {
|
|
217
|
+
enum?: string[] | number[];
|
|
218
|
+
default?: string | number;
|
|
219
|
+
description?: string;
|
|
220
|
+
};
|
|
221
|
+
type PathsObject<T = {}, P extends {} = {}> = {
|
|
222
|
+
[pattern: string]: (PathItemObject<T> & P) | undefined;
|
|
223
|
+
};
|
|
224
|
+
enum HttpMethods {
|
|
225
|
+
GET = "get",
|
|
226
|
+
PUT = "put",
|
|
227
|
+
POST = "post",
|
|
228
|
+
DELETE = "delete",
|
|
229
|
+
OPTIONS = "options",
|
|
230
|
+
HEAD = "head",
|
|
231
|
+
PATCH = "patch",
|
|
232
|
+
TRACE = "trace"
|
|
233
|
+
}
|
|
234
|
+
type PathItemObject<T = {}> = {
|
|
235
|
+
$ref?: string;
|
|
236
|
+
summary?: string;
|
|
237
|
+
description?: string;
|
|
238
|
+
servers?: ServerObject[];
|
|
239
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
240
|
+
} & {
|
|
241
|
+
[method in HttpMethods]?: OperationObject<T>;
|
|
242
|
+
} & T & AnyOtherAttribute;
|
|
243
|
+
type OperationObject<T = {}> = {
|
|
244
|
+
tags?: string[];
|
|
245
|
+
summary?: string;
|
|
246
|
+
description?: string;
|
|
247
|
+
externalDocs?: ExternalDocumentationObject;
|
|
248
|
+
operationId?: string;
|
|
249
|
+
parameters?: (ReferenceObject | ParameterObject)[];
|
|
250
|
+
requestBody?: ReferenceObject | RequestBodyObject;
|
|
251
|
+
responses?: ResponsesObject;
|
|
252
|
+
callbacks?: {
|
|
253
|
+
[callback: string]: ReferenceObject | CallbackObject;
|
|
254
|
+
};
|
|
255
|
+
deprecated?: boolean;
|
|
256
|
+
security?: SecurityRequirementObject[];
|
|
257
|
+
servers?: ServerObject[];
|
|
258
|
+
} & T & AnyOtherAttribute;
|
|
259
|
+
type ExternalDocumentationObject = {
|
|
260
|
+
description?: string;
|
|
261
|
+
url?: string;
|
|
262
|
+
};
|
|
263
|
+
type ParameterObject = {
|
|
264
|
+
name?: string;
|
|
265
|
+
in?: string;
|
|
266
|
+
} & ParameterBaseObject;
|
|
267
|
+
type HeaderObject = {} & ParameterBaseObject;
|
|
268
|
+
type ParameterBaseObject = {
|
|
269
|
+
description?: string;
|
|
270
|
+
required?: boolean;
|
|
271
|
+
deprecated?: boolean;
|
|
272
|
+
allowEmptyValue?: boolean;
|
|
273
|
+
style?: string;
|
|
274
|
+
explode?: boolean;
|
|
275
|
+
allowReserved?: boolean;
|
|
276
|
+
schema?: ReferenceObject | SchemaObject;
|
|
277
|
+
example?: any;
|
|
278
|
+
examples?: {
|
|
279
|
+
[media: string]: ReferenceObject | ExampleObject;
|
|
280
|
+
};
|
|
281
|
+
content?: {
|
|
282
|
+
[media: string]: MediaTypeObject;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
type NonArraySchemaObjectType = 'boolean' | 'object' | 'number' | 'string' | 'integer';
|
|
286
|
+
type ArraySchemaObjectType = 'array';
|
|
287
|
+
type SchemaObject = (ArraySchemaObject | NonArraySchemaObject) & AnyOtherAttribute;
|
|
288
|
+
type ArraySchemaObject = {
|
|
289
|
+
type?: ArraySchemaObjectType;
|
|
290
|
+
items?: ReferenceObject | SchemaObject;
|
|
291
|
+
} & BaseSchemaObject;
|
|
292
|
+
type NonArraySchemaObject = {
|
|
293
|
+
type?: NonArraySchemaObjectType;
|
|
294
|
+
} & BaseSchemaObject;
|
|
295
|
+
type BaseSchemaObject = {
|
|
296
|
+
title?: string;
|
|
297
|
+
description?: string;
|
|
298
|
+
format?: string;
|
|
299
|
+
default?: any;
|
|
300
|
+
multipleOf?: number;
|
|
301
|
+
maximum?: number;
|
|
302
|
+
exclusiveMaximum?: boolean;
|
|
303
|
+
minimum?: number;
|
|
304
|
+
exclusiveMinimum?: boolean;
|
|
305
|
+
maxLength?: number;
|
|
306
|
+
minLength?: number;
|
|
307
|
+
pattern?: string;
|
|
308
|
+
additionalProperties?: boolean | ReferenceObject | SchemaObject;
|
|
309
|
+
maxItems?: number;
|
|
310
|
+
minItems?: number;
|
|
311
|
+
uniqueItems?: boolean;
|
|
312
|
+
maxProperties?: number;
|
|
313
|
+
minProperties?: number;
|
|
314
|
+
required?: string[];
|
|
315
|
+
enum?: any[];
|
|
316
|
+
properties?: {
|
|
317
|
+
[name: string]: ReferenceObject | SchemaObject;
|
|
318
|
+
};
|
|
319
|
+
allOf?: (ReferenceObject | SchemaObject)[];
|
|
320
|
+
oneOf?: (ReferenceObject | SchemaObject)[];
|
|
321
|
+
anyOf?: (ReferenceObject | SchemaObject)[];
|
|
322
|
+
not?: ReferenceObject | SchemaObject;
|
|
323
|
+
nullable?: boolean;
|
|
324
|
+
discriminator?: DiscriminatorObject;
|
|
325
|
+
readOnly?: boolean;
|
|
326
|
+
writeOnly?: boolean;
|
|
327
|
+
xml?: XMLObject;
|
|
328
|
+
externalDocs?: ExternalDocumentationObject;
|
|
329
|
+
example?: any;
|
|
330
|
+
deprecated?: boolean;
|
|
331
|
+
};
|
|
332
|
+
type DiscriminatorObject = {
|
|
333
|
+
propertyName?: string;
|
|
334
|
+
mapping?: {
|
|
335
|
+
[value: string]: string;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
type XMLObject = {
|
|
339
|
+
name?: string;
|
|
340
|
+
namespace?: string;
|
|
341
|
+
prefix?: string;
|
|
342
|
+
attribute?: boolean;
|
|
343
|
+
wrapped?: boolean;
|
|
344
|
+
};
|
|
345
|
+
type ReferenceObject = {
|
|
346
|
+
$ref?: string;
|
|
347
|
+
} & AnyOtherAttribute;
|
|
348
|
+
type ExampleObject = {
|
|
349
|
+
summary?: string;
|
|
350
|
+
description?: string;
|
|
351
|
+
value?: any;
|
|
352
|
+
externalValue?: string;
|
|
353
|
+
};
|
|
354
|
+
type MediaTypeObject = {
|
|
355
|
+
schema?: ReferenceObject | SchemaObject;
|
|
356
|
+
example?: any;
|
|
357
|
+
examples?: {
|
|
358
|
+
[media: string]: ReferenceObject | ExampleObject;
|
|
359
|
+
};
|
|
360
|
+
encoding?: {
|
|
361
|
+
[media: string]: EncodingObject;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
type EncodingObject = {
|
|
365
|
+
contentType?: string;
|
|
366
|
+
headers?: {
|
|
367
|
+
[header: string]: ReferenceObject | HeaderObject;
|
|
368
|
+
};
|
|
369
|
+
style?: string;
|
|
370
|
+
explode?: boolean;
|
|
371
|
+
allowReserved?: boolean;
|
|
372
|
+
};
|
|
373
|
+
type RequestBodyObject = {
|
|
374
|
+
description?: string;
|
|
375
|
+
content?: {
|
|
376
|
+
[media: string]: MediaTypeObject;
|
|
377
|
+
};
|
|
378
|
+
required?: boolean;
|
|
379
|
+
};
|
|
380
|
+
type ResponsesObject = {
|
|
381
|
+
[code: string]: ReferenceObject | ResponseObject;
|
|
382
|
+
};
|
|
383
|
+
type ResponseObject = {
|
|
384
|
+
description?: string;
|
|
385
|
+
headers?: {
|
|
386
|
+
[header: string]: ReferenceObject | HeaderObject;
|
|
387
|
+
};
|
|
388
|
+
content?: {
|
|
389
|
+
[media: string]: MediaTypeObject;
|
|
390
|
+
};
|
|
391
|
+
links?: {
|
|
392
|
+
[link: string]: ReferenceObject | LinkObject;
|
|
393
|
+
};
|
|
394
|
+
} & AnyOtherAttribute;
|
|
395
|
+
type LinkObject = {
|
|
396
|
+
operationRef?: string;
|
|
397
|
+
operationId?: string;
|
|
398
|
+
parameters?: {
|
|
399
|
+
[parameter: string]: any;
|
|
400
|
+
};
|
|
401
|
+
requestBody?: any;
|
|
402
|
+
description?: string;
|
|
403
|
+
server?: ServerObject;
|
|
404
|
+
};
|
|
405
|
+
type CallbackObject = {
|
|
406
|
+
[url: string]: PathItemObject;
|
|
407
|
+
};
|
|
408
|
+
type SecurityRequirementObject = {
|
|
409
|
+
[name: string]: string[];
|
|
410
|
+
};
|
|
411
|
+
type ComponentsObject = {
|
|
412
|
+
schemas?: {
|
|
413
|
+
[key: string]: ReferenceObject | SchemaObject;
|
|
414
|
+
};
|
|
415
|
+
responses?: {
|
|
416
|
+
[key: string]: ReferenceObject | ResponseObject;
|
|
417
|
+
};
|
|
418
|
+
parameters?: {
|
|
419
|
+
[key: string]: ReferenceObject | ParameterObject;
|
|
420
|
+
};
|
|
421
|
+
examples?: {
|
|
422
|
+
[key: string]: ReferenceObject | ExampleObject;
|
|
423
|
+
};
|
|
424
|
+
requestBodies?: {
|
|
425
|
+
[key: string]: ReferenceObject | RequestBodyObject;
|
|
426
|
+
};
|
|
427
|
+
headers?: {
|
|
428
|
+
[key: string]: ReferenceObject | HeaderObject;
|
|
429
|
+
};
|
|
430
|
+
securitySchemes?: {
|
|
431
|
+
[key: string]: ReferenceObject | SecuritySchemeObject;
|
|
432
|
+
};
|
|
433
|
+
links?: {
|
|
434
|
+
[key: string]: ReferenceObject | LinkObject;
|
|
435
|
+
};
|
|
436
|
+
callbacks?: {
|
|
437
|
+
[key: string]: ReferenceObject | CallbackObject;
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
type SecuritySchemeObject = HttpSecurityScheme | ApiKeySecurityScheme | OAuth2SecurityScheme | OpenIdSecurityScheme;
|
|
441
|
+
type HttpSecurityScheme = {
|
|
442
|
+
type?: 'http';
|
|
443
|
+
description?: string;
|
|
444
|
+
scheme?: string;
|
|
445
|
+
bearerFormat?: string;
|
|
446
|
+
};
|
|
447
|
+
type ApiKeySecurityScheme = {
|
|
448
|
+
type?: 'apiKey';
|
|
449
|
+
description?: string;
|
|
450
|
+
name?: string;
|
|
451
|
+
in?: string;
|
|
452
|
+
};
|
|
453
|
+
type OAuth2SecurityScheme = {
|
|
454
|
+
type?: 'oauth2';
|
|
455
|
+
description?: string;
|
|
456
|
+
flows?: {
|
|
457
|
+
implicit?: {
|
|
458
|
+
authorizationUrl?: string;
|
|
459
|
+
refreshUrl?: string;
|
|
460
|
+
scopes?: {
|
|
461
|
+
[scope: string]: string;
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
password?: {
|
|
465
|
+
tokenUrl?: string;
|
|
466
|
+
refreshUrl?: string;
|
|
467
|
+
scopes?: {
|
|
468
|
+
[scope: string]: string;
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
clientCredentials?: {
|
|
472
|
+
tokenUrl?: string;
|
|
473
|
+
refreshUrl?: string;
|
|
474
|
+
scopes?: {
|
|
475
|
+
[scope: string]: string;
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
authorizationCode?: {
|
|
479
|
+
authorizationUrl?: string;
|
|
480
|
+
tokenUrl?: string;
|
|
481
|
+
refreshUrl?: string;
|
|
482
|
+
scopes?: {
|
|
483
|
+
[scope: string]: string;
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
type OpenIdSecurityScheme = {
|
|
489
|
+
type?: 'openIdConnect';
|
|
490
|
+
description?: string;
|
|
491
|
+
openIdConnectUrl?: string;
|
|
492
|
+
};
|
|
493
|
+
type TagObject = {
|
|
494
|
+
name?: string;
|
|
495
|
+
description?: string;
|
|
496
|
+
externalDocs?: ExternalDocumentationObject;
|
|
497
|
+
} & AnyOtherAttribute;
|
|
498
|
+
}
|
|
499
|
+
export declare namespace OpenAPIV2 {
|
|
500
|
+
type Document<T = {}> = {
|
|
501
|
+
/**
|
|
502
|
+
* Version of the OpenAPI specification
|
|
503
|
+
* @see https://github.com/OAI/OpenAPI-Specification/tree/main/versions
|
|
504
|
+
*/
|
|
505
|
+
swagger?: '2.0';
|
|
506
|
+
openapi?: never;
|
|
507
|
+
basePath?: string;
|
|
508
|
+
consumes?: MimeTypes;
|
|
509
|
+
definitions?: DefinitionsObject;
|
|
510
|
+
externalDocs?: ExternalDocumentationObject;
|
|
511
|
+
host?: string;
|
|
512
|
+
info?: InfoObject;
|
|
513
|
+
parameters?: ParametersDefinitionsObject;
|
|
514
|
+
paths?: PathsObject<T>;
|
|
515
|
+
produces?: MimeTypes;
|
|
516
|
+
responses?: ResponsesDefinitionsObject;
|
|
517
|
+
schemes?: string[];
|
|
518
|
+
security?: SecurityRequirementObject[];
|
|
519
|
+
securityDefinitions?: SecurityDefinitionsObject;
|
|
520
|
+
tags?: TagObject[];
|
|
521
|
+
} & T & AnyOtherAttribute;
|
|
522
|
+
type TagObject = {
|
|
523
|
+
name?: string;
|
|
524
|
+
description?: string;
|
|
525
|
+
externalDocs?: ExternalDocumentationObject;
|
|
526
|
+
} & AnyOtherAttribute;
|
|
527
|
+
type SecuritySchemeObjectBase = {
|
|
528
|
+
type?: 'basic' | 'apiKey' | 'oauth2';
|
|
529
|
+
description?: string;
|
|
530
|
+
};
|
|
531
|
+
type SecuritySchemeBasic = {
|
|
532
|
+
type?: 'basic';
|
|
533
|
+
} & SecuritySchemeObjectBase;
|
|
534
|
+
type SecuritySchemeApiKey = {
|
|
535
|
+
type?: 'apiKey';
|
|
536
|
+
name?: string;
|
|
537
|
+
in?: string;
|
|
538
|
+
} & SecuritySchemeObjectBase;
|
|
539
|
+
type SecuritySchemeOauth2 = SecuritySchemeOauth2Implicit | SecuritySchemeOauth2AccessCode | SecuritySchemeOauth2Password | SecuritySchemeOauth2Application;
|
|
540
|
+
type ScopesObject = {
|
|
541
|
+
[index: string]: any;
|
|
542
|
+
};
|
|
543
|
+
type SecuritySchemeOauth2Base = {
|
|
544
|
+
type?: 'oauth2';
|
|
545
|
+
flow?: 'implicit' | 'password' | 'application' | 'accessCode';
|
|
546
|
+
scopes?: ScopesObject;
|
|
547
|
+
} & SecuritySchemeObjectBase;
|
|
548
|
+
type SecuritySchemeOauth2Implicit = {
|
|
549
|
+
flow?: 'implicit';
|
|
550
|
+
authorizationUrl?: string;
|
|
551
|
+
} & SecuritySchemeOauth2Base;
|
|
552
|
+
type SecuritySchemeOauth2AccessCode = {
|
|
553
|
+
flow?: 'accessCode';
|
|
554
|
+
authorizationUrl?: string;
|
|
555
|
+
tokenUrl?: string;
|
|
556
|
+
} & SecuritySchemeOauth2Base;
|
|
557
|
+
type SecuritySchemeOauth2Password = {
|
|
558
|
+
flow?: 'password';
|
|
559
|
+
tokenUrl?: string;
|
|
560
|
+
} & SecuritySchemeOauth2Base;
|
|
561
|
+
type SecuritySchemeOauth2Application = {
|
|
562
|
+
flow?: 'application';
|
|
563
|
+
tokenUrl?: string;
|
|
564
|
+
} & SecuritySchemeOauth2Base;
|
|
565
|
+
type SecuritySchemeObject = SecuritySchemeBasic | SecuritySchemeApiKey | SecuritySchemeOauth2;
|
|
566
|
+
type SecurityDefinitionsObject = {
|
|
567
|
+
[index: string]: SecuritySchemeObject;
|
|
568
|
+
};
|
|
569
|
+
type SecurityRequirementObject = {
|
|
570
|
+
[index: string]: string[];
|
|
571
|
+
};
|
|
572
|
+
type ReferenceObject = {
|
|
573
|
+
$ref: string;
|
|
574
|
+
} & AnyOtherAttribute;
|
|
575
|
+
type Response = ResponseObject | ReferenceObject;
|
|
576
|
+
type ResponsesDefinitionsObject = {
|
|
577
|
+
[index: string]: ResponseObject;
|
|
578
|
+
};
|
|
579
|
+
type Schema = SchemaObject | ReferenceObject;
|
|
580
|
+
type ResponseObject = {
|
|
581
|
+
description?: string;
|
|
582
|
+
schema?: Schema;
|
|
583
|
+
headers?: HeadersObject;
|
|
584
|
+
examples?: ExampleObject;
|
|
585
|
+
} & AnyOtherAttribute;
|
|
586
|
+
type HeadersObject = {
|
|
587
|
+
[index: string]: HeaderObject;
|
|
588
|
+
};
|
|
589
|
+
type HeaderObject = {
|
|
590
|
+
description?: string;
|
|
591
|
+
} & ItemsObject;
|
|
592
|
+
type ExampleObject = {
|
|
593
|
+
[index: string]: any;
|
|
594
|
+
};
|
|
595
|
+
type OperationObject<T = {}> = {
|
|
596
|
+
tags?: string[];
|
|
597
|
+
summary?: string;
|
|
598
|
+
description?: string;
|
|
599
|
+
externalDocs?: ExternalDocumentationObject;
|
|
600
|
+
operationId?: string;
|
|
601
|
+
consumes?: MimeTypes;
|
|
602
|
+
produces?: MimeTypes;
|
|
603
|
+
parameters?: Parameters;
|
|
604
|
+
responses: ResponsesObject;
|
|
605
|
+
schemes?: string[];
|
|
606
|
+
deprecated?: boolean;
|
|
607
|
+
security?: SecurityRequirementObject[];
|
|
608
|
+
} & T & AnyOtherAttribute;
|
|
609
|
+
type ResponsesObject = {
|
|
610
|
+
[index: string]: Response | undefined;
|
|
611
|
+
default?: Response;
|
|
612
|
+
};
|
|
613
|
+
type Parameters = (ReferenceObject | Parameter)[];
|
|
614
|
+
type Parameter = InBodyParameterObject | GeneralParameterObject;
|
|
615
|
+
type InBodyParameterObject = {
|
|
616
|
+
schema?: Schema;
|
|
617
|
+
} & ParameterObject;
|
|
618
|
+
type GeneralParameterObject = {
|
|
619
|
+
allowEmptyValue?: boolean;
|
|
620
|
+
} & ParameterObject & ItemsObject;
|
|
621
|
+
enum HttpMethods {
|
|
622
|
+
GET = "get",
|
|
623
|
+
PUT = "put",
|
|
624
|
+
POST = "post",
|
|
625
|
+
DELETE = "delete",
|
|
626
|
+
OPTIONS = "options",
|
|
627
|
+
HEAD = "head",
|
|
628
|
+
PATCH = "patch"
|
|
629
|
+
}
|
|
630
|
+
type PathItemObject<T = {}> = {
|
|
631
|
+
$ref?: string;
|
|
632
|
+
parameters?: Parameters;
|
|
633
|
+
} & {
|
|
634
|
+
[method in HttpMethods]?: OperationObject<T>;
|
|
635
|
+
};
|
|
636
|
+
type PathsObject<T = {}> = {
|
|
637
|
+
[index: string]: PathItemObject<T>;
|
|
638
|
+
};
|
|
639
|
+
type ParametersDefinitionsObject = {
|
|
640
|
+
[index: string]: ParameterObject;
|
|
641
|
+
};
|
|
642
|
+
type ParameterObject = {
|
|
643
|
+
name?: string;
|
|
644
|
+
in?: string;
|
|
645
|
+
description?: string;
|
|
646
|
+
required?: boolean;
|
|
647
|
+
[index: string]: any;
|
|
648
|
+
};
|
|
649
|
+
type MimeTypes = string[];
|
|
650
|
+
type DefinitionsObject = {
|
|
651
|
+
[index: string]: SchemaObject;
|
|
652
|
+
};
|
|
653
|
+
type SchemaObject = {
|
|
654
|
+
[index: string]: any;
|
|
655
|
+
discriminator?: string;
|
|
656
|
+
readOnly?: boolean;
|
|
657
|
+
xml?: XMLObject;
|
|
658
|
+
externalDocs?: ExternalDocumentationObject;
|
|
659
|
+
example?: any;
|
|
660
|
+
default?: any;
|
|
661
|
+
items?: ItemsObject | ReferenceObject;
|
|
662
|
+
properties?: {
|
|
663
|
+
[name: string]: SchemaObject;
|
|
664
|
+
};
|
|
665
|
+
} & IJsonSchema;
|
|
666
|
+
type ExternalDocumentationObject = {
|
|
667
|
+
[index: string]: any;
|
|
668
|
+
description?: string;
|
|
669
|
+
url?: string;
|
|
670
|
+
};
|
|
671
|
+
type ItemsObject = {
|
|
672
|
+
type?: string;
|
|
673
|
+
format?: string;
|
|
674
|
+
items?: ItemsObject | ReferenceObject;
|
|
675
|
+
collectionFormat?: string;
|
|
676
|
+
default?: any;
|
|
677
|
+
maximum?: number;
|
|
678
|
+
exclusiveMaximum?: boolean;
|
|
679
|
+
minimum?: number;
|
|
680
|
+
exclusiveMinimum?: boolean;
|
|
681
|
+
maxLength?: number;
|
|
682
|
+
minLength?: number;
|
|
683
|
+
pattern?: string;
|
|
684
|
+
maxItems?: number;
|
|
685
|
+
minItems?: number;
|
|
686
|
+
uniqueItems?: boolean;
|
|
687
|
+
enum?: any[];
|
|
688
|
+
multipleOf?: number;
|
|
689
|
+
$ref?: string;
|
|
690
|
+
};
|
|
691
|
+
type XMLObject = {
|
|
692
|
+
[index: string]: any;
|
|
693
|
+
name?: string;
|
|
694
|
+
namespace?: string;
|
|
695
|
+
prefix?: string;
|
|
696
|
+
attribute?: boolean;
|
|
697
|
+
wrapped?: boolean;
|
|
698
|
+
};
|
|
699
|
+
type InfoObject = {
|
|
700
|
+
title?: string;
|
|
701
|
+
description?: string;
|
|
702
|
+
termsOfService?: string;
|
|
703
|
+
contact?: ContactObject;
|
|
704
|
+
license?: LicenseObject;
|
|
705
|
+
version?: string;
|
|
706
|
+
};
|
|
707
|
+
type ContactObject = {
|
|
708
|
+
name?: string;
|
|
709
|
+
url?: string;
|
|
710
|
+
email?: string;
|
|
711
|
+
};
|
|
712
|
+
type LicenseObject = {
|
|
713
|
+
name?: string;
|
|
714
|
+
url?: string;
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
export type IJsonSchema = {
|
|
718
|
+
id?: string;
|
|
719
|
+
$schema?: string;
|
|
720
|
+
title?: string;
|
|
721
|
+
description?: string;
|
|
722
|
+
multipleOf?: number;
|
|
723
|
+
maximum?: number;
|
|
724
|
+
exclusiveMaximum?: boolean;
|
|
725
|
+
minimum?: number;
|
|
726
|
+
exclusiveMinimum?: boolean;
|
|
727
|
+
maxLength?: number;
|
|
728
|
+
minLength?: number;
|
|
729
|
+
pattern?: string;
|
|
730
|
+
additionalItems?: boolean | IJsonSchema;
|
|
731
|
+
items?: IJsonSchema | IJsonSchema[];
|
|
732
|
+
maxItems?: number;
|
|
733
|
+
minItems?: number;
|
|
734
|
+
uniqueItems?: boolean;
|
|
735
|
+
maxProperties?: number;
|
|
736
|
+
minProperties?: number;
|
|
737
|
+
required?: string[];
|
|
738
|
+
additionalProperties?: boolean | IJsonSchema;
|
|
739
|
+
definitions?: {
|
|
740
|
+
[name: string]: IJsonSchema;
|
|
741
|
+
};
|
|
742
|
+
properties?: {
|
|
743
|
+
[name: string]: IJsonSchema;
|
|
744
|
+
};
|
|
745
|
+
patternProperties?: {
|
|
746
|
+
[name: string]: IJsonSchema;
|
|
747
|
+
};
|
|
748
|
+
dependencies?: {
|
|
749
|
+
[name: string]: IJsonSchema | string[];
|
|
750
|
+
};
|
|
751
|
+
enum?: any[];
|
|
752
|
+
type?: string | string[];
|
|
753
|
+
allOf?: IJsonSchema[];
|
|
754
|
+
anyOf?: IJsonSchema[];
|
|
755
|
+
oneOf?: IJsonSchema[];
|
|
756
|
+
not?: IJsonSchema;
|
|
757
|
+
$ref?: string;
|
|
758
|
+
} & AnyOtherAttribute;
|
|
759
|
+
export {};
|
|
760
|
+
//# sourceMappingURL=openapi-types.d.ts.map
|