@e22m4u/js-openapi 0.0.5
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/.c8rc +9 -0
- package/.commitlintrc +5 -0
- package/.editorconfig +13 -0
- package/.husky/commit-msg +1 -0
- package/.husky/pre-commit +6 -0
- package/.mocharc.json +4 -0
- package/.prettierrc +7 -0
- package/LICENSE +21 -0
- package/README.md +510 -0
- package/build-cjs.js +16 -0
- package/dist/cjs/index.cjs +2695 -0
- package/eslint.config.js +41 -0
- package/package.json +64 -0
- package/src/data-type/index.d.ts +1 -0
- package/src/data-type/index.js +1 -0
- package/src/data-type/infer-openapi-data-type.d.ts +30 -0
- package/src/data-type/infer-openapi-data-type.js +38 -0
- package/src/data-validation/data-format-validator-map.d.ts +13 -0
- package/src/data-validation/data-format-validator-map.js +36 -0
- package/src/data-validation/data-format-validator-map.spec.js +39 -0
- package/src/data-validation/data-format-validators.d.ts +84 -0
- package/src/data-validation/data-format-validators.js +217 -0
- package/src/data-validation/index.d.ts +3 -0
- package/src/data-validation/index.js +3 -0
- package/src/data-validation/validate-data-with-openapi-schema.d.ts +46 -0
- package/src/data-validation/validate-data-with-openapi-schema.js +1913 -0
- package/src/data-validation/validate-data-with-openapi-schema.spec.js +6953 -0
- package/src/errors/index.d.ts +1 -0
- package/src/errors/index.js +1 -0
- package/src/errors/oa-data-validation-error.d.ts +6 -0
- package/src/errors/oa-data-validation-error.js +6 -0
- package/src/errors/oa-data-validation-error.spec.js +17 -0
- package/src/index.d.ts +9 -0
- package/src/index.js +9 -0
- package/src/json-pointer/escape-json-pointer.d.ts +7 -0
- package/src/json-pointer/escape-json-pointer.js +18 -0
- package/src/json-pointer/escape-json-pointer.spec.js +36 -0
- package/src/json-pointer/index.d.ts +3 -0
- package/src/json-pointer/index.js +3 -0
- package/src/json-pointer/resolve-json-pointer.d.ts +10 -0
- package/src/json-pointer/resolve-json-pointer.js +83 -0
- package/src/json-pointer/resolve-json-pointer.spec.js +103 -0
- package/src/json-pointer/unescape-json-pointer.d.ts +8 -0
- package/src/json-pointer/unescape-json-pointer.js +18 -0
- package/src/json-pointer/unescape-json-pointer.spec.js +32 -0
- package/src/oa-document-builder.d.ts +312 -0
- package/src/oa-document-builder.js +450 -0
- package/src/oa-document-object/index.d.ts +1 -0
- package/src/oa-document-object/index.js +1 -0
- package/src/oa-document-object/validate-shallow-oa-document.d.ts +10 -0
- package/src/oa-document-object/validate-shallow-oa-document.js +209 -0
- package/src/oa-document-object/validate-shallow-oa-document.spec.js +362 -0
- package/src/oa-document-scope.d.ts +52 -0
- package/src/oa-document-scope.js +228 -0
- package/src/oa-reference-object/index.d.ts +3 -0
- package/src/oa-reference-object/index.js +3 -0
- package/src/oa-reference-object/is-oa-reference-object.d.ts +9 -0
- package/src/oa-reference-object/is-oa-reference-object.js +14 -0
- package/src/oa-reference-object/is-oa-reference-object.spec.js +19 -0
- package/src/oa-reference-object/oa-ref.d.ts +11 -0
- package/src/oa-reference-object/oa-ref.js +31 -0
- package/src/oa-reference-object/oa-ref.spec.js +56 -0
- package/src/oa-reference-object/resolve-oa-reference-object.d.ts +18 -0
- package/src/oa-reference-object/resolve-oa-reference-object.js +113 -0
- package/src/oa-reference-object/resolve-oa-reference-object.spec.js +233 -0
- package/src/oa-specification.d.ts +767 -0
- package/src/oa-specification.js +153 -0
- package/src/types.d.ts +4 -0
- package/src/utils/count-unicode.d.ts +11 -0
- package/src/utils/count-unicode.js +15 -0
- package/src/utils/index.d.ts +5 -0
- package/src/utils/index.js +5 -0
- package/src/utils/join-path.d.ts +6 -0
- package/src/utils/join-path.js +36 -0
- package/src/utils/join-path.spec.js +104 -0
- package/src/utils/normalize-path.d.ts +12 -0
- package/src/utils/normalize-path.js +22 -0
- package/src/utils/normalize-path.spec.js +56 -0
- package/src/utils/to-pascal-case.d.ts +6 -0
- package/src/utils/to-pascal-case.js +26 -0
- package/src/utils/to-pascal-case.spec.js +15 -0
- package/src/utils/to-spaced-json.d.ts +17 -0
- package/src/utils/to-spaced-json.js +27 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,767 @@
|
|
|
1
|
+
// OpenApi version 3.1.0
|
|
2
|
+
// https://spec.openapis.org/oas/v3.1.0
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* OpenAPI version.
|
|
6
|
+
*/
|
|
7
|
+
export declare const OPENAPI_VERSION: '3.1.0';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Document object.
|
|
11
|
+
* https://spec.openapis.org/oas/v3.1.0#openapi-object
|
|
12
|
+
*/
|
|
13
|
+
export type OADocumentObject = {
|
|
14
|
+
openapi: string;
|
|
15
|
+
info: OAInfoObject;
|
|
16
|
+
jsonSchemaDialect?: string;
|
|
17
|
+
servers?: OAServerObject[];
|
|
18
|
+
paths?: OAPathsObject;
|
|
19
|
+
webhooks?: OAWebhooksObject;
|
|
20
|
+
components?: OAComponentsObject;
|
|
21
|
+
security?: OASecurityRequirementObject[];
|
|
22
|
+
tags?: OATagObject[];
|
|
23
|
+
externalDocs?: OAExternalDocumentationObject;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Info Object.
|
|
28
|
+
* https://spec.openapis.org/oas/v3.1.0#info-object
|
|
29
|
+
*/
|
|
30
|
+
export type OAInfoObject = {
|
|
31
|
+
title: string;
|
|
32
|
+
summary?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
termsOfService?: string;
|
|
35
|
+
contact?: OAContactObject;
|
|
36
|
+
license?: OALicenseObject;
|
|
37
|
+
version: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Contact Object.
|
|
42
|
+
* https://spec.openapis.org/oas/v3.1.0#contact-object
|
|
43
|
+
*/
|
|
44
|
+
export type OAContactObject = {
|
|
45
|
+
name?: string;
|
|
46
|
+
url?: string;
|
|
47
|
+
email?: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* License Object.
|
|
52
|
+
* https://spec.openapis.org/oas/v3.1.0#license-object
|
|
53
|
+
*/
|
|
54
|
+
export type OALicenseObject = {
|
|
55
|
+
name: string;
|
|
56
|
+
identifier?: string;
|
|
57
|
+
url?: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Server Object.
|
|
62
|
+
* https://spec.openapis.org/oas/v3.1.0#server-object
|
|
63
|
+
*/
|
|
64
|
+
export type OAServerObject = {
|
|
65
|
+
url: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
variables?: OAServerVariablesObject;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Server variable object.
|
|
72
|
+
* https://spec.openapis.org/oas/v3.1.0#server-variable-object
|
|
73
|
+
*/
|
|
74
|
+
export type OAServerVariableObject = {
|
|
75
|
+
enum?: string[];
|
|
76
|
+
default: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Paths Object.
|
|
82
|
+
* https://spec.openapis.org/oas/v3.1.0#paths-object
|
|
83
|
+
*/
|
|
84
|
+
export type OAPathsObject = {
|
|
85
|
+
[path: string]: OAPathItemObject | undefined;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Path Item Object
|
|
90
|
+
* https://spec.openapis.org/oas/v3.1.0#path-item-object
|
|
91
|
+
*/
|
|
92
|
+
export type OAPathItemObject = {
|
|
93
|
+
$ref?: string;
|
|
94
|
+
summary?: string;
|
|
95
|
+
description?: string;
|
|
96
|
+
get?: OAOperationObject;
|
|
97
|
+
put?: OAOperationObject;
|
|
98
|
+
post?: OAOperationObject;
|
|
99
|
+
delete?: OAOperationObject;
|
|
100
|
+
options?: OAOperationObject;
|
|
101
|
+
head?: OAOperationObject;
|
|
102
|
+
patch?: OAOperationObject;
|
|
103
|
+
trace?: OAOperationObject;
|
|
104
|
+
servers?: OAServerObject[];
|
|
105
|
+
parameters?: (OAParameterObject | OAReferenceObject)[];
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Operation Method.
|
|
110
|
+
* https://spec.openapis.org/oas/v3.1.0#path-item-object
|
|
111
|
+
*/
|
|
112
|
+
export declare const OAOperationMethod: {
|
|
113
|
+
GET: 'get';
|
|
114
|
+
PUT: 'put';
|
|
115
|
+
POST: 'post';
|
|
116
|
+
DELETE: 'delete';
|
|
117
|
+
OPTIONS: 'options';
|
|
118
|
+
HEAD: 'head';
|
|
119
|
+
PATCH: 'patch';
|
|
120
|
+
TRACE: 'trace';
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Operation Method.
|
|
125
|
+
* https://spec.openapis.org/oas/v3.1.0#path-item-object
|
|
126
|
+
*/
|
|
127
|
+
export type OAOperationMethod =
|
|
128
|
+
(typeof OAOperationMethod)[keyof typeof OAOperationMethod];
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Parameter Object.
|
|
132
|
+
* https://spec.openapis.org/oas/v3.1.0#parameter-object
|
|
133
|
+
*/
|
|
134
|
+
export type OAParameterObject = {
|
|
135
|
+
name: string;
|
|
136
|
+
in: OAParameterLocation;
|
|
137
|
+
description?: string;
|
|
138
|
+
required?: boolean;
|
|
139
|
+
deprecated?: boolean;
|
|
140
|
+
allowEmptyValue?: boolean;
|
|
141
|
+
style?: OAParameterStyle;
|
|
142
|
+
explode?: boolean;
|
|
143
|
+
allowReserved?: boolean;
|
|
144
|
+
schema?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
145
|
+
content?: OAContentObject;
|
|
146
|
+
example?: unknown;
|
|
147
|
+
examples?: OAExamplesObject;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Parameter Location.
|
|
152
|
+
* https://spec.openapis.org/oas/v3.1.0#parameter-locations
|
|
153
|
+
*/
|
|
154
|
+
export declare const OAParameterLocation: {
|
|
155
|
+
QUERY: 'query';
|
|
156
|
+
HEADER: 'header';
|
|
157
|
+
PATH: 'path';
|
|
158
|
+
COOKIE: 'cookie';
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Parameter Location.
|
|
163
|
+
* https://spec.openapis.org/oas/v3.1.0#parameter-locations
|
|
164
|
+
*/
|
|
165
|
+
export type OAParameterLocation =
|
|
166
|
+
(typeof OAParameterLocation)[keyof typeof OAParameterLocation];
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Parameter Style.
|
|
170
|
+
* https://spec.openapis.org/oas/v3.1.0#style-values
|
|
171
|
+
*/
|
|
172
|
+
export declare const OAParameterStyle: {
|
|
173
|
+
MATRIX: 'matrix';
|
|
174
|
+
LABEL: 'label';
|
|
175
|
+
FORM: 'form';
|
|
176
|
+
SIMPLE: 'simple';
|
|
177
|
+
SPACE_DELIMITED: 'spaceDelimited';
|
|
178
|
+
PIPE_DELIMITED: 'pipeDelimited';
|
|
179
|
+
DEEP_OBJECT: 'deepObject';
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Parameter Style.
|
|
184
|
+
* https://spec.openapis.org/oas/v3.1.0#style-values
|
|
185
|
+
*/
|
|
186
|
+
export type OAParameterStyle =
|
|
187
|
+
(typeof OAParameterStyle)[keyof typeof OAParameterStyle];
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Reference Object.
|
|
191
|
+
* https://spec.openapis.org/oas/v3.1.0#reference-object
|
|
192
|
+
*/
|
|
193
|
+
export type OAReferenceObject = {
|
|
194
|
+
$ref: string;
|
|
195
|
+
summary?: string;
|
|
196
|
+
description?: string;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Boolean Schema.
|
|
201
|
+
* https://json-schema.org/draft/2020-12/json-schema-core#section-4.3.2
|
|
202
|
+
*/
|
|
203
|
+
export type OABooleanSchema = boolean;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Schema Object.
|
|
207
|
+
* https://spec.openapis.org/oas/v3.1.0#schema-object
|
|
208
|
+
* https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-01
|
|
209
|
+
* https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-01#name-table-of-contents-2
|
|
210
|
+
*/
|
|
211
|
+
export type OASchemaObject = {
|
|
212
|
+
$schema?: string;
|
|
213
|
+
$id?: string;
|
|
214
|
+
$anchor?: string;
|
|
215
|
+
$dynamicAnchor?: string;
|
|
216
|
+
$ref?: string;
|
|
217
|
+
$dynamicRef?: string;
|
|
218
|
+
$defs?: OADefinitionsObject;
|
|
219
|
+
$comment?: string;
|
|
220
|
+
$vocabulary?: {[uri: string]: boolean};
|
|
221
|
+
// common
|
|
222
|
+
title?: string;
|
|
223
|
+
description?: string;
|
|
224
|
+
default?: unknown;
|
|
225
|
+
deprecated?: boolean;
|
|
226
|
+
readOnly?: boolean;
|
|
227
|
+
writeOnly?: boolean;
|
|
228
|
+
examples?: unknown[];
|
|
229
|
+
// any
|
|
230
|
+
type?: OADataType | OADataType[];
|
|
231
|
+
format?: OADataFormat | string;
|
|
232
|
+
enum?: unknown[];
|
|
233
|
+
const?: unknown;
|
|
234
|
+
// composition
|
|
235
|
+
allOf?: (OABooleanSchema | OASchemaObject | OAReferenceObject)[];
|
|
236
|
+
oneOf?: (OABooleanSchema | OASchemaObject | OAReferenceObject)[];
|
|
237
|
+
anyOf?: (OABooleanSchema | OASchemaObject | OAReferenceObject)[];
|
|
238
|
+
not?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
239
|
+
// string
|
|
240
|
+
minLength?: number;
|
|
241
|
+
maxLength?: number;
|
|
242
|
+
pattern?: string;
|
|
243
|
+
// number and integer
|
|
244
|
+
minimum?: number;
|
|
245
|
+
maximum?: number;
|
|
246
|
+
exclusiveMinimum?: number;
|
|
247
|
+
exclusiveMaximum?: number;
|
|
248
|
+
multipleOf?: number;
|
|
249
|
+
// arrays
|
|
250
|
+
items?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
251
|
+
prefixItems?: (OABooleanSchema | OASchemaObject | OAReferenceObject)[];
|
|
252
|
+
minItems?: number;
|
|
253
|
+
maxItems?: number;
|
|
254
|
+
uniqueItems?: boolean;
|
|
255
|
+
contains?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
256
|
+
maxContains?: number;
|
|
257
|
+
minContains?: number;
|
|
258
|
+
unevaluatedItems?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
259
|
+
// objects
|
|
260
|
+
properties?: OASchemaPropertiesObject;
|
|
261
|
+
maxProperties?: number;
|
|
262
|
+
minProperties?: number;
|
|
263
|
+
required?: string[];
|
|
264
|
+
dependentRequired?: OADependentRequiredObject;
|
|
265
|
+
dependentSchemas?: OADependentSchemasObject;
|
|
266
|
+
additionalProperties?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
267
|
+
patternProperties?: OAPatternPropertiesObject;
|
|
268
|
+
unevaluatedProperties?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
269
|
+
propertyNames?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
270
|
+
// openapi specific
|
|
271
|
+
xml?: OAXmlObject;
|
|
272
|
+
externalDocs?: OAExternalDocumentationObject;
|
|
273
|
+
discriminator?: OADiscriminatorObject;
|
|
274
|
+
example?: unknown;
|
|
275
|
+
// contents of string-encoded data
|
|
276
|
+
contentEncoding?: string;
|
|
277
|
+
contentMediaType?: string;
|
|
278
|
+
contentSchema?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
279
|
+
// conditional validation
|
|
280
|
+
if?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
281
|
+
then?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
282
|
+
else?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Data type.
|
|
287
|
+
* https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-4.2.1
|
|
288
|
+
*/
|
|
289
|
+
export declare const OADataType: {
|
|
290
|
+
STRING: 'string';
|
|
291
|
+
NUMBER: 'number';
|
|
292
|
+
INTEGER: 'integer';
|
|
293
|
+
BOOLEAN: 'boolean';
|
|
294
|
+
OBJECT: 'object';
|
|
295
|
+
ARRAY: 'array';
|
|
296
|
+
NULL: 'null';
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Data type.
|
|
301
|
+
* https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-4.2.1
|
|
302
|
+
*/
|
|
303
|
+
export type OADataType = (typeof OADataType)[keyof typeof OADataType];
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Data type list.
|
|
307
|
+
* https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-4.2.1
|
|
308
|
+
*/
|
|
309
|
+
export declare const OA_DATA_TYPE_LIST: OADataType[];
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Data format.
|
|
313
|
+
* https://spec.openapis.org/oas/v3.1.0#dataTypeFormat
|
|
314
|
+
*/
|
|
315
|
+
export declare const OADataFormat: {
|
|
316
|
+
// number
|
|
317
|
+
INT32: 'int32';
|
|
318
|
+
INT64: 'int64';
|
|
319
|
+
FLOAT: 'float';
|
|
320
|
+
DOUBLE: 'double';
|
|
321
|
+
// date and time
|
|
322
|
+
DATE: 'date';
|
|
323
|
+
DATE_TIME: 'date-time';
|
|
324
|
+
TIME: 'time';
|
|
325
|
+
DURATION: 'duration';
|
|
326
|
+
// binary
|
|
327
|
+
BYTE: 'byte';
|
|
328
|
+
BINARY: 'binary';
|
|
329
|
+
// identifiers and network
|
|
330
|
+
EMAIL: 'email';
|
|
331
|
+
IDN_EMAIL: 'idn-email';
|
|
332
|
+
UUID: 'uuid';
|
|
333
|
+
HOSTNAME: 'hostname';
|
|
334
|
+
IDN_HOSTNAME: 'idn-hostname';
|
|
335
|
+
IPV4: 'ipv4';
|
|
336
|
+
IPV6: 'ipv6';
|
|
337
|
+
URI: 'uri';
|
|
338
|
+
URI_REFERENCE: 'uri-reference';
|
|
339
|
+
IRI: 'iri';
|
|
340
|
+
IRI_REFERENCE: 'iri-reference';
|
|
341
|
+
// extra
|
|
342
|
+
PASSWORD: 'password';
|
|
343
|
+
REGEX: 'regex';
|
|
344
|
+
JSON_POINTER: 'json-pointer';
|
|
345
|
+
RELATIVE_JSON_POINTER: 'relative-json-pointer';
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Data format.
|
|
350
|
+
* https://spec.openapis.org/oas/v3.1.0#dataTypeFormat
|
|
351
|
+
*/
|
|
352
|
+
export type OADataFormat = (typeof OADataFormat)[keyof typeof OADataFormat];
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Discriminator Object.
|
|
356
|
+
* https://spec.openapis.org/oas/v3.1.0#discriminator-object
|
|
357
|
+
*/
|
|
358
|
+
export type OADiscriminatorObject = {
|
|
359
|
+
propertyName: string;
|
|
360
|
+
mapping?: {[name: string]: string | undefined};
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Xml Object.
|
|
365
|
+
* https://spec.openapis.org/oas/v3.1.0#xml-object
|
|
366
|
+
*/
|
|
367
|
+
export type OAXmlObject = {
|
|
368
|
+
name?: string;
|
|
369
|
+
namespace?: string;
|
|
370
|
+
prefix?: string;
|
|
371
|
+
attribute?: boolean;
|
|
372
|
+
wrapped?: boolean;
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* External Documentation Object.
|
|
377
|
+
* https://spec.openapis.org/oas/v3.1.0#external-documentation-object
|
|
378
|
+
*/
|
|
379
|
+
export type OAExternalDocumentationObject = {
|
|
380
|
+
description?: string;
|
|
381
|
+
url: string;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Operation Object.
|
|
386
|
+
* https://spec.openapis.org/oas/v3.1.0#operation-object
|
|
387
|
+
*/
|
|
388
|
+
export type OAOperationObject = {
|
|
389
|
+
tags?: string[];
|
|
390
|
+
summary?: string;
|
|
391
|
+
description?: string;
|
|
392
|
+
externalDocs?: OAExternalDocumentationObject;
|
|
393
|
+
operationId?: string;
|
|
394
|
+
parameters?: (OAParameterObject | OAReferenceObject)[];
|
|
395
|
+
requestBody?: OARequestBodyObject | OAReferenceObject;
|
|
396
|
+
responses?: OAResponsesObject;
|
|
397
|
+
callbacks?: OACallbacksObject;
|
|
398
|
+
deprecated?: boolean;
|
|
399
|
+
security?: OASecurityRequirementObject[];
|
|
400
|
+
servers?: OAServerObject[];
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Callback Object.
|
|
405
|
+
* https://spec.openapis.org/oas/v3.1.0#callback-object
|
|
406
|
+
*/
|
|
407
|
+
export type OACallbackObject = {
|
|
408
|
+
[expression: string]: OAPathItemObject | OAReferenceObject | undefined;
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Request Body Object.
|
|
413
|
+
* https://spec.openapis.org/oas/v3.1.0#request-body-object
|
|
414
|
+
*/
|
|
415
|
+
export type OARequestBodyObject = {
|
|
416
|
+
description?: string;
|
|
417
|
+
content: OAContentObject;
|
|
418
|
+
required?: boolean;
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Media type.
|
|
423
|
+
* https://spec.openapis.org/oas/v3.1.0#media-types
|
|
424
|
+
*/
|
|
425
|
+
export declare const OAMediaType: {
|
|
426
|
+
TEXT_PLAIN: 'text/plain';
|
|
427
|
+
TEXT_HTML: 'text/html';
|
|
428
|
+
APPLICATION_XML: 'application/xml';
|
|
429
|
+
APPLICATION_JSON: 'application/json';
|
|
430
|
+
MULTIPART_FORM_DATA: 'multipart/form-data';
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Media type.
|
|
435
|
+
* https://spec.openapis.org/oas/v3.1.0#media-types
|
|
436
|
+
*/
|
|
437
|
+
export type OAMediaType = (typeof OAMediaType)[keyof typeof OAMediaType];
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Responses Object.
|
|
441
|
+
* https://spec.openapis.org/oas/v3.1.0#responses-object
|
|
442
|
+
*/
|
|
443
|
+
export type OAResponsesObject = {
|
|
444
|
+
[httpStatusCode: string]: OAResponseObject | OAReferenceObject | undefined;
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Response Object.
|
|
449
|
+
* https://spec.openapis.org/oas/v3.1.0#response-object
|
|
450
|
+
*/
|
|
451
|
+
export type OAResponseObject = {
|
|
452
|
+
description: string;
|
|
453
|
+
headers?: OAHeadersObject;
|
|
454
|
+
content?: OAContentObject;
|
|
455
|
+
links?: OALinksObject;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Media Type Object.
|
|
460
|
+
* https://spec.openapis.org/oas/v3.1.0#media-type-object
|
|
461
|
+
*/
|
|
462
|
+
export type OAMediaTypeObject = {
|
|
463
|
+
schema?: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
464
|
+
example?: unknown;
|
|
465
|
+
examples?: OAExamplesObject;
|
|
466
|
+
encoding?: OAPropertiesEncodingObject;
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Example Object.
|
|
471
|
+
* https://spec.openapis.org/oas/v3.1.0#example-object
|
|
472
|
+
*/
|
|
473
|
+
export type OAExampleObject = {
|
|
474
|
+
summary?: string;
|
|
475
|
+
description?: string;
|
|
476
|
+
value?: unknown;
|
|
477
|
+
externalValue?: string;
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Encoding Object.
|
|
482
|
+
* https://spec.openapis.org/oas/v3.1.0#encoding-object
|
|
483
|
+
*/
|
|
484
|
+
export type OAEncodingObject = {
|
|
485
|
+
contentType?: string;
|
|
486
|
+
headers?: OAHeadersObject;
|
|
487
|
+
style?: OAParameterStyle;
|
|
488
|
+
explode?: boolean;
|
|
489
|
+
allowReserved?: boolean;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Header Object.
|
|
494
|
+
* https://spec.openapis.org/oas/v3.1.0#header-object
|
|
495
|
+
*/
|
|
496
|
+
export type OAHeaderObject = Omit<
|
|
497
|
+
OAParameterObject,
|
|
498
|
+
'name' | 'in' | 'allowEmptyValue'
|
|
499
|
+
>;
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Link Object.
|
|
503
|
+
* https://spec.openapis.org/oas/v3.1.0#link-object
|
|
504
|
+
*/
|
|
505
|
+
export type OALinkObject = {
|
|
506
|
+
operationRef?: string;
|
|
507
|
+
operationId?: string;
|
|
508
|
+
parameters?: {[name: string]: unknown | undefined};
|
|
509
|
+
requestBody?: unknown;
|
|
510
|
+
description?: string;
|
|
511
|
+
server?: OAServerObject;
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Components Object.
|
|
516
|
+
* https://spec.openapis.org/oas/v3.1.0#components-object
|
|
517
|
+
*/
|
|
518
|
+
export type OAComponentsObject = {
|
|
519
|
+
schemas?: {[name: string]: OABooleanSchema | OASchemaObject | undefined};
|
|
520
|
+
responses?: {
|
|
521
|
+
[name: string]: OAResponseObject | OAReferenceObject | undefined;
|
|
522
|
+
};
|
|
523
|
+
parameters?: {
|
|
524
|
+
[name: string]: OAParameterObject | OAReferenceObject | undefined;
|
|
525
|
+
};
|
|
526
|
+
examples?: {
|
|
527
|
+
[name: string]: OAExampleObject | OAReferenceObject | undefined;
|
|
528
|
+
};
|
|
529
|
+
requestBodies?: {
|
|
530
|
+
[name: string]: OARequestBodyObject | OAReferenceObject | undefined;
|
|
531
|
+
};
|
|
532
|
+
headers?: {
|
|
533
|
+
[name: string]: OAHeaderObject | OAReferenceObject | undefined;
|
|
534
|
+
};
|
|
535
|
+
securitySchemes?: {
|
|
536
|
+
[name: string]: OASecuritySchemeObject | OAReferenceObject | undefined;
|
|
537
|
+
};
|
|
538
|
+
links?: {
|
|
539
|
+
[name: string]: OALinkObject | OAReferenceObject | undefined;
|
|
540
|
+
};
|
|
541
|
+
callbacks?: {
|
|
542
|
+
[name: string]: OACallbackObject | OAReferenceObject | undefined;
|
|
543
|
+
};
|
|
544
|
+
pathItems?: {
|
|
545
|
+
[name: string]: OAPathItemObject | OAReferenceObject | undefined;
|
|
546
|
+
};
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Security Scheme Object.
|
|
551
|
+
* https://spec.openapis.org/oas/v3.1.0#security-scheme-object
|
|
552
|
+
*/
|
|
553
|
+
export type OASecuritySchemeObject = {
|
|
554
|
+
type: OASecuritySchemeType;
|
|
555
|
+
description?: string;
|
|
556
|
+
name?: string;
|
|
557
|
+
in?: OAApiKeyLocation;
|
|
558
|
+
scheme?: string;
|
|
559
|
+
bearerFormat?: string;
|
|
560
|
+
flows?: OAOAuthFlowsObject;
|
|
561
|
+
openIdConnectUrl?: string;
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Security Scheme Type.
|
|
566
|
+
* https://spec.openapis.org/oas/v3.1.0#security-scheme-object
|
|
567
|
+
*/
|
|
568
|
+
export declare const OASecuritySchemeType: {
|
|
569
|
+
API_KEY: 'apiKey';
|
|
570
|
+
HTTP: 'http';
|
|
571
|
+
MUTUAL_TLS: 'mutualTLS';
|
|
572
|
+
OAUTH_2: 'oauth2';
|
|
573
|
+
OPEN_ID_CONNECT: 'openIdConnect';
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Security Scheme Type.
|
|
578
|
+
* https://spec.openapis.org/oas/v3.1.0#security-scheme-object
|
|
579
|
+
*/
|
|
580
|
+
export type OASecuritySchemeType =
|
|
581
|
+
(typeof OASecuritySchemeType)[keyof typeof OASecuritySchemeType];
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Api Key Location.
|
|
585
|
+
* https://spec.openapis.org/oas/v3.1.0#security-scheme-object
|
|
586
|
+
*/
|
|
587
|
+
export declare const OAApiKeyLocation: {
|
|
588
|
+
QUERY: 'query';
|
|
589
|
+
HEADER: 'header';
|
|
590
|
+
COOKIE: 'cookie';
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Api Key Location.
|
|
595
|
+
* https://spec.openapis.org/oas/v3.1.0#security-scheme-object
|
|
596
|
+
*/
|
|
597
|
+
export type OAApiKeyLocation =
|
|
598
|
+
(typeof OAApiKeyLocation)[keyof typeof OAApiKeyLocation];
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* OAuth Flows Object.
|
|
602
|
+
* https://spec.openapis.org/oas/v3.1.0#oauth-flows-object
|
|
603
|
+
*/
|
|
604
|
+
export type OAOAuthFlowsObject = {
|
|
605
|
+
implicit?: OAOAuthFlowObject;
|
|
606
|
+
password?: OAOAuthFlowObject;
|
|
607
|
+
clientCredentials?: OAOAuthFlowObject;
|
|
608
|
+
authorizationCode?: OAOAuthFlowObject;
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* OAuth Flow Object.
|
|
613
|
+
* https://spec.openapis.org/oas/v3.1.0#oauth-flow-object
|
|
614
|
+
*/
|
|
615
|
+
export type OAOAuthFlowObject = {
|
|
616
|
+
authorizationUrl?: string;
|
|
617
|
+
tokenUrl?: string;
|
|
618
|
+
refreshUrl?: string;
|
|
619
|
+
scopes: {[name: string]: string | undefined};
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Security Requirement Object.
|
|
624
|
+
* https://spec.openapis.org/oas/v3.1.0#security-requirement-object
|
|
625
|
+
*/
|
|
626
|
+
export type OASecurityRequirementObject = {
|
|
627
|
+
[name: string]: string[] | undefined;
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Tag object.
|
|
632
|
+
* https://spec.openapis.org/oas/v3.1.0#tag-object
|
|
633
|
+
*/
|
|
634
|
+
export type OATagObject = {
|
|
635
|
+
name: string;
|
|
636
|
+
description?: string;
|
|
637
|
+
externalDocs?: OAExternalDocumentationObject;
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Definitions Object.
|
|
642
|
+
* https://json-schema.org/draft/2020-12/json-schema-core#name-schema-re-use-with-defs
|
|
643
|
+
*/
|
|
644
|
+
export type OADefinitionsObject = {
|
|
645
|
+
[name: string]: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Dependent schemas object.
|
|
650
|
+
* https://json-schema.org/draft/2020-12/json-schema-core#name-dependentschemas
|
|
651
|
+
*/
|
|
652
|
+
export type OADependentSchemasObject = {
|
|
653
|
+
[key: string]: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Dependent required object.
|
|
658
|
+
* https://json-schema.org/draft/2020-12/json-schema-validation#name-dependentrequired
|
|
659
|
+
*/
|
|
660
|
+
export type OADependentRequiredObject = {
|
|
661
|
+
[key: string]: string[] | undefined;
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Pattern properties object.
|
|
666
|
+
* https://json-schema.org/draft/2020-12/json-schema-core#name-patternproperties
|
|
667
|
+
*/
|
|
668
|
+
export type OAPatternPropertiesObject = {
|
|
669
|
+
[pattern: string]: OABooleanSchema | OASchemaObject | OAReferenceObject;
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Access mode.
|
|
674
|
+
* https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-01#name-readonly-and-writeonly
|
|
675
|
+
*/
|
|
676
|
+
export declare const OAAccessMode: {
|
|
677
|
+
READ: 'read';
|
|
678
|
+
WRITE: 'write';
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Access mode.
|
|
683
|
+
* https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-01#name-readonly-and-writeonly
|
|
684
|
+
*/
|
|
685
|
+
export type OAAccessMode = (typeof OAAccessMode)[keyof typeof OAAccessMode];
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Access mode list.
|
|
689
|
+
* https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-01#name-readonly-and-writeonly
|
|
690
|
+
*/
|
|
691
|
+
export declare const ACCESS_MODE_LIST: OAAccessMode[];
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Server Variables Object.
|
|
695
|
+
* (non-spec type)
|
|
696
|
+
*/
|
|
697
|
+
export type OAServerVariablesObject = {
|
|
698
|
+
[name: string]: OAServerVariableObject | undefined;
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Schema Properties Object.
|
|
703
|
+
* (non-spec type)
|
|
704
|
+
*/
|
|
705
|
+
export type OASchemaPropertiesObject = {
|
|
706
|
+
[name: string]:
|
|
707
|
+
| OABooleanSchema
|
|
708
|
+
| OASchemaObject
|
|
709
|
+
| OAReferenceObject
|
|
710
|
+
| undefined;
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Webhooks Object.
|
|
715
|
+
* (non-spec type)
|
|
716
|
+
*/
|
|
717
|
+
export type OAWebhooksObject = {
|
|
718
|
+
[name: string]: OAPathItemObject | OAReferenceObject | undefined;
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Callbacks Object.
|
|
723
|
+
* (non-spec type)
|
|
724
|
+
*/
|
|
725
|
+
export type OACallbacksObject = {
|
|
726
|
+
[key: string]: OACallbackObject | OAReferenceObject | undefined;
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Content Object.
|
|
731
|
+
* (non-spec type)
|
|
732
|
+
*/
|
|
733
|
+
export type OAContentObject = {
|
|
734
|
+
[mediaType: string]: OAMediaTypeObject | undefined;
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Headers Object.
|
|
739
|
+
* (non-spec type)
|
|
740
|
+
*/
|
|
741
|
+
export type OAHeadersObject = {
|
|
742
|
+
[name: string]: OAHeaderObject | OAReferenceObject | undefined;
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Links Object.
|
|
747
|
+
* (non-spec type)
|
|
748
|
+
*/
|
|
749
|
+
export type OALinksObject = {
|
|
750
|
+
[name: string]: OALinkObject | OAReferenceObject | undefined;
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
/**
|
|
754
|
+
* Examples Object.
|
|
755
|
+
* (non-spec type)
|
|
756
|
+
*/
|
|
757
|
+
export type OAExamplesObject = {
|
|
758
|
+
[name: string]: OAExampleObject | OAReferenceObject | undefined;
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* Properties Encoding Object.
|
|
763
|
+
* (non-spec type)
|
|
764
|
+
*/
|
|
765
|
+
export type OAPropertiesEncodingObject = {
|
|
766
|
+
[propertyName: string]: OAEncodingObject | undefined;
|
|
767
|
+
};
|