@scalar/openapi-parser 0.7.2 → 0.8.2

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