@kubb/swagger-ts 2.4.0 → 2.4.1
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/dist/{chunk-FCNKYMOH.js → chunk-7UWJRVRW.js} +20 -15
- package/dist/chunk-7UWJRVRW.js.map +1 -0
- package/dist/{chunk-FUVECZEQ.cjs → chunk-CMZLMWOU.cjs} +20 -15
- package/dist/chunk-CMZLMWOU.cjs.map +1 -0
- package/dist/components.cjs +4 -4
- package/dist/components.js +1 -1
- package/dist/{index-sycg8owy.d.cts → index-x0xIwSiH.d.cts} +75 -75
- package/dist/{index-sycg8owy.d.ts → index-x0xIwSiH.d.ts} +75 -75
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/oas.d.cts +1 -1
- package/dist/oas.d.ts +1 -1
- package/package.json +9 -9
- package/src/TypeGenerator.ts +2 -1
- package/src/components/Query.tsx +17 -12
- package/src/oas/infer.ts +9 -10
- package/src/oas/mappers.ts +16 -17
- package/src/oas/model.ts +9 -10
- package/src/oas/requestParams.ts +14 -16
- package/src/oas/response.ts +3 -4
- package/src/oas/security.ts +20 -20
- package/src/plugin.ts +1 -1
- package/dist/chunk-FCNKYMOH.js.map +0 -1
- package/dist/chunk-FUVECZEQ.cjs.map +0 -1
@@ -4,32 +4,32 @@ import { OasTypes } from '@kubb/swagger/oas';
|
|
4
4
|
import { JSONSchema, FromSchema } from 'json-schema-to-ts';
|
5
5
|
import { TupleToUnion, SplitByDelimiter } from '@kubb/types';
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
type Checks$5 = {
|
8
|
+
AllOFf: {
|
9
9
|
allOf: any[];
|
10
10
|
};
|
11
|
-
|
11
|
+
Object: {
|
12
12
|
type: 'object';
|
13
13
|
properties: any;
|
14
14
|
};
|
15
|
-
|
15
|
+
Properties: {
|
16
16
|
properties: any;
|
17
17
|
};
|
18
|
-
|
18
|
+
PropertiesRequired: {
|
19
19
|
properties: Record<string, any>;
|
20
20
|
required: string[];
|
21
21
|
};
|
22
|
-
}
|
23
|
-
type FixAdditionalPropertiesForAllOf<T> = T extends Checks$5
|
22
|
+
};
|
23
|
+
type FixAdditionalPropertiesForAllOf<T> = T extends Checks$5['AllOFf'] ? Omit<T, 'allOf'> & {
|
24
24
|
allOf: Call<Tuples.Map<Objects.Omit<'additionalProperties'>>, T['allOf']>;
|
25
25
|
} : T;
|
26
|
-
type FixMissingAdditionalProperties<T> = T extends Checks$5
|
26
|
+
type FixMissingAdditionalProperties<T> = T extends Checks$5['Object'] ? Omit<T, 'additionalProperties'> & {
|
27
27
|
additionalProperties: false;
|
28
28
|
} : T;
|
29
|
-
type FixMissingTypeObject<T> = T extends Checks$5
|
29
|
+
type FixMissingTypeObject<T> = T extends Checks$5['Properties'] ? T & {
|
30
30
|
type: 'object';
|
31
31
|
} : T;
|
32
|
-
type FixExtraRequiredFields<T> = T extends Checks$5
|
32
|
+
type FixExtraRequiredFields<T> = T extends Checks$5['PropertiesRequired'] ? Omit<T, 'required'> & {
|
33
33
|
required: Call<Tuples.Filter<Booleans.Extends<keyof T['properties']>>, T['required']>;
|
34
34
|
} : T;
|
35
35
|
type FixJSONSchema<T> = FixAdditionalPropertiesForAllOf<FixMissingAdditionalProperties<FixMissingTypeObject<FixExtraRequiredFields<T>>>>;
|
@@ -48,29 +48,29 @@ type ResolveRefsInObj<T, TBase = T> = {
|
|
48
48
|
};
|
49
49
|
type Infer<TOAS> = Mutable<ResolveRefsInObj<TOAS>>;
|
50
50
|
|
51
|
-
|
52
|
-
|
51
|
+
type Checks$4<TParamType = never> = {
|
52
|
+
Required: {
|
53
53
|
required: true;
|
54
54
|
};
|
55
|
-
|
55
|
+
Schemas: {
|
56
56
|
schema: JSONSchema;
|
57
57
|
};
|
58
|
-
|
58
|
+
Enum: {
|
59
59
|
type: JSONSchemaTypeName;
|
60
60
|
enum?: any[];
|
61
61
|
};
|
62
|
-
|
62
|
+
Parameters: {
|
63
63
|
in: string;
|
64
64
|
required?: boolean;
|
65
65
|
}[];
|
66
|
-
|
66
|
+
SingleParameter: [{
|
67
67
|
in: TParamType;
|
68
68
|
required?: true;
|
69
69
|
}];
|
70
|
-
|
70
|
+
Responses: {
|
71
71
|
responses: any;
|
72
72
|
};
|
73
|
-
}
|
73
|
+
};
|
74
74
|
type PathMap<TOAS extends OasTypes.OASDocument> = TOAS['paths'];
|
75
75
|
interface ParamPropMap {
|
76
76
|
query: 'query';
|
@@ -80,94 +80,94 @@ interface ParamPropMap {
|
|
80
80
|
type JSONSchemaTypeName = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
|
81
81
|
type ParamObj<TParameter extends {
|
82
82
|
name: string;
|
83
|
-
}> = TParameter extends Checks$4
|
84
|
-
[TName in TParameter['name']]: TParameter extends Checks$4
|
83
|
+
}> = TParameter extends Checks$4['Required'] ? {
|
84
|
+
[TName in TParameter['name']]: TParameter extends Checks$4['Schemas'] ? FromSchema<TParameter['schema']> : TParameter extends Checks$4['Enum'] ? FromSchema<{
|
85
85
|
type: TParameter['type'];
|
86
86
|
enum: TParameter['enum'];
|
87
87
|
}> : unknown;
|
88
88
|
} : {
|
89
|
-
[TName in TParameter['name']]?: TParameter extends Checks$4
|
89
|
+
[TName in TParameter['name']]?: TParameter extends Checks$4['Schemas'] ? FromSchema<TParameter['schema']> : TParameter extends Checks$4['Enum'] ? FromSchema<{
|
90
90
|
type: TParameter['type'];
|
91
91
|
enum: TParameter['enum'];
|
92
92
|
}> : unknown;
|
93
93
|
};
|
94
|
-
interface ParamToRequestParam<TParameters extends Checks$4
|
94
|
+
interface ParamToRequestParam<TParameters extends Checks$4['Parameters']> extends Fn {
|
95
95
|
return: this['arg0'] extends {
|
96
96
|
name: string;
|
97
97
|
in: infer TParamType;
|
98
|
-
} ? TParameters extends Checks$4
|
98
|
+
} ? TParameters extends Checks$4<TParamType>['SingleParameter'] ? {
|
99
99
|
[TKey in TParamType extends keyof ParamPropMap ? ParamPropMap[TParamType] : never]: ParamObj<this['arg0']>;
|
100
100
|
} : {
|
101
101
|
[TKey in TParamType extends keyof ParamPropMap ? ParamPropMap[TParamType] : never]?: ParamObj<this['arg0']>;
|
102
102
|
} : {};
|
103
103
|
}
|
104
|
-
type ParamMap<TParameters extends Checks$4
|
104
|
+
type ParamMap<TParameters extends Checks$4['Parameters']> = Pipe<TParameters, [
|
105
105
|
Tuples.Map<ParamToRequestParam<TParameters>>,
|
106
106
|
Tuples.ToIntersection
|
107
107
|
]>;
|
108
108
|
type MethodMap<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>> = PathMap<TOAS>[TPath];
|
109
|
-
type StatusMap<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>, TMethod extends keyof MethodMap<TOAS, TPath>> = MethodMap<TOAS, TPath>[TMethod] extends Checks$4
|
109
|
+
type StatusMap<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>, TMethod extends keyof MethodMap<TOAS, TPath>> = MethodMap<TOAS, TPath>[TMethod] extends Checks$4['Responses'] ? MethodMap<TOAS, TPath>[TMethod]['responses'] : never;
|
110
110
|
|
111
|
-
|
112
|
-
|
111
|
+
type Checks$3<TName extends string | number | symbol = never> = {
|
112
|
+
ModelWithSchemas: {
|
113
113
|
components: {
|
114
114
|
schemas: Record<string, JSONSchema>;
|
115
115
|
};
|
116
116
|
};
|
117
|
-
|
117
|
+
ModelWithSchemasNamed: {
|
118
118
|
components: {
|
119
119
|
schemas: {
|
120
120
|
[TModelName in TName]: JSONSchema;
|
121
121
|
};
|
122
122
|
};
|
123
123
|
};
|
124
|
-
|
124
|
+
ModelWithDefinitions: {
|
125
125
|
definitions: Record<string, JSONSchema>;
|
126
126
|
};
|
127
|
-
|
127
|
+
ModelWithDefinitionsNamed: {
|
128
128
|
definitions: {
|
129
129
|
[TModelName in TName]: JSONSchema;
|
130
130
|
};
|
131
131
|
};
|
132
|
-
}
|
133
|
-
type Model<TOAS extends OasTypes.OASDocument, TName extends TOAS extends Checks$3
|
132
|
+
};
|
133
|
+
type Model<TOAS extends OasTypes.OASDocument, TName extends TOAS extends Checks$3['ModelWithSchemas'] ? keyof TOAS['components']['schemas'] : TOAS extends Checks$3['ModelWithDefinitions'] ? keyof TOAS['definitions'] : never> = TOAS extends Checks$3<TName>['ModelWithSchemasNamed'] ? FromSchema<TOAS['components']['schemas'][TName]> : TOAS extends Checks$3<TName>['ModelWithDefinitionsNamed'] ? FromSchema<TOAS['definitions'][TName]> : never;
|
134
134
|
|
135
|
-
|
136
|
-
|
135
|
+
type Checks$2 = {
|
136
|
+
Security: {
|
137
137
|
security: {
|
138
138
|
[key: string]: any;
|
139
139
|
}[];
|
140
140
|
};
|
141
|
-
|
142
|
-
|
141
|
+
AuthParams: {
|
142
|
+
Basic: {
|
143
143
|
type: 'http';
|
144
144
|
scheme: 'basic';
|
145
145
|
} | {
|
146
146
|
type: 'basic';
|
147
147
|
};
|
148
|
-
|
148
|
+
Bearer: {
|
149
149
|
type: 'http';
|
150
150
|
scheme: 'bearer';
|
151
151
|
} | {
|
152
152
|
type: 'bearer';
|
153
153
|
};
|
154
|
-
|
154
|
+
OAuth2: {
|
155
155
|
type: 'oauth2';
|
156
156
|
};
|
157
|
-
|
157
|
+
ApiKey: {
|
158
158
|
type: 'apiKey';
|
159
159
|
in: 'header';
|
160
160
|
};
|
161
|
-
}
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
}
|
167
|
-
}
|
168
|
-
type SecuritySchemeName<T extends Checks$2
|
161
|
+
};
|
162
|
+
AuthName: {
|
163
|
+
Basic: `basic${string}`;
|
164
|
+
Bearer: `bearer${string}`;
|
165
|
+
OAuth2: `oauth${string}`;
|
166
|
+
};
|
167
|
+
};
|
168
|
+
type SecuritySchemeName<T extends Checks$2['Security']> = Call<Tuples.Map<Objects.Keys>, T['security']>[number];
|
169
169
|
declare namespace AuthParams {
|
170
|
-
type Basic<TSecurityScheme> = TSecurityScheme extends Checks$2
|
170
|
+
type Basic<TSecurityScheme> = TSecurityScheme extends Checks$2['AuthParams']['Basic'] ? {
|
171
171
|
headers: {
|
172
172
|
/**
|
173
173
|
* `Authorization` header is required for basic authentication
|
@@ -183,7 +183,7 @@ declare namespace AuthParams {
|
|
183
183
|
Authorization: `Basic ${string}`;
|
184
184
|
};
|
185
185
|
} : {};
|
186
|
-
type Bearer<TSecurityScheme> = TSecurityScheme extends Checks$2
|
186
|
+
type Bearer<TSecurityScheme> = TSecurityScheme extends Checks$2['AuthParams']['Bearer'] ? {
|
187
187
|
/**
|
188
188
|
* `Authorization` header is required for bearer authentication
|
189
189
|
* @see https://swagger.io/docs/specification/authentication/bearer-authentication/
|
@@ -200,7 +200,7 @@ declare namespace AuthParams {
|
|
200
200
|
Authorization: `Bearer ${string}`;
|
201
201
|
};
|
202
202
|
} : {};
|
203
|
-
type ApiKey<TSecurityScheme> = TSecurityScheme extends Checks$2
|
203
|
+
type ApiKey<TSecurityScheme> = TSecurityScheme extends Checks$2['AuthParams']['ApiKey'] & {
|
204
204
|
name: infer TApiKeyHeaderName;
|
205
205
|
} ? {
|
206
206
|
headers: {
|
@@ -215,7 +215,7 @@ declare namespace AuthParams {
|
|
215
215
|
[TQueryName in TApiKeyQueryName extends string ? TApiKeyQueryName : never]: string;
|
216
216
|
};
|
217
217
|
} : {};
|
218
|
-
type OAuth2<TSecurityScheme> = TSecurityScheme extends Checks$2
|
218
|
+
type OAuth2<TSecurityScheme> = TSecurityScheme extends Checks$2['AuthParams']['OAuth2'] ? {
|
219
219
|
/**
|
220
220
|
* `Authorization` header is required for OAuth2.
|
221
221
|
*/
|
@@ -229,7 +229,7 @@ declare namespace AuthParams {
|
|
229
229
|
} : {};
|
230
230
|
}
|
231
231
|
type OASSecurityParams<TSecurityScheme> = AuthParams.Basic<TSecurityScheme> & AuthParams.Bearer<TSecurityScheme> & AuthParams.ApiKey<TSecurityScheme> & AuthParams.OAuth2<TSecurityScheme>;
|
232
|
-
type SecurityParamsBySecurityRef<TOAS, TSecurityObj> = TSecurityObj extends Checks$2
|
232
|
+
type SecurityParamsBySecurityRef<TOAS, TSecurityObj> = TSecurityObj extends Checks$2['Security'] ? TOAS extends {
|
233
233
|
components: {
|
234
234
|
securitySchemes: {
|
235
235
|
[TSecuritySchemeNameKey in SecuritySchemeName<TSecurityObj> extends string ? SecuritySchemeName<TSecurityObj> : never]: infer TSecurityScheme;
|
@@ -239,18 +239,18 @@ type SecurityParamsBySecurityRef<TOAS, TSecurityObj> = TSecurityObj extends Chec
|
|
239
239
|
securityDefinitions: {
|
240
240
|
[TSecuritySchemeNameKey in SecuritySchemeName<TSecurityObj> extends string ? SecuritySchemeName<TSecurityObj> : never]: infer TSecurityScheme;
|
241
241
|
};
|
242
|
-
} ? OASSecurityParams<TSecurityScheme> : SecuritySchemeName<TSecurityObj> extends Checks$2
|
242
|
+
} ? OASSecurityParams<TSecurityScheme> : SecuritySchemeName<TSecurityObj> extends Checks$2['AuthName']['Basic'] ? AuthParams.Basic<{
|
243
243
|
type: 'http';
|
244
244
|
scheme: 'basic';
|
245
|
-
}> : SecuritySchemeName<TSecurityObj> extends Checks$2
|
245
|
+
}> : SecuritySchemeName<TSecurityObj> extends Checks$2['AuthName']['Bearer'] ? AuthParams.Bearer<{
|
246
246
|
type: 'http';
|
247
247
|
scheme: 'bearer';
|
248
|
-
}> : SecuritySchemeName<TSecurityObj> extends Checks$2
|
248
|
+
}> : SecuritySchemeName<TSecurityObj> extends Checks$2['AuthName']['OAuth2'] ? AuthParams.OAuth2<{
|
249
249
|
type: 'oauth2';
|
250
250
|
}> : {} : {};
|
251
251
|
|
252
|
-
|
253
|
-
|
252
|
+
type Checks$1 = {
|
253
|
+
RequestBodyJson: {
|
254
254
|
requestBody: {
|
255
255
|
content: {
|
256
256
|
'application/json': {
|
@@ -259,7 +259,7 @@ declare namespace Checks$1 {
|
|
259
259
|
};
|
260
260
|
};
|
261
261
|
};
|
262
|
-
|
262
|
+
RequestBodyFormData: {
|
263
263
|
requestBody: {
|
264
264
|
content: {
|
265
265
|
'multipart/form-data': {
|
@@ -268,7 +268,7 @@ declare namespace Checks$1 {
|
|
268
268
|
};
|
269
269
|
};
|
270
270
|
};
|
271
|
-
|
271
|
+
RequestBodyFormEncoded: {
|
272
272
|
requestBody: {
|
273
273
|
content: {
|
274
274
|
'application/x-www-form-urlencoded': {
|
@@ -277,18 +277,18 @@ declare namespace Checks$1 {
|
|
277
277
|
};
|
278
278
|
};
|
279
279
|
};
|
280
|
-
|
280
|
+
Parameters: {
|
281
281
|
parameters: {
|
282
282
|
name: string;
|
283
283
|
in: string;
|
284
284
|
}[];
|
285
285
|
};
|
286
|
-
|
287
|
-
|
288
|
-
|
286
|
+
PathBrackets: `${string}{${string}}${string}`;
|
287
|
+
PathPattern: `${string}:${string}${string}`;
|
288
|
+
Required: {
|
289
289
|
required: true;
|
290
290
|
};
|
291
|
-
}
|
291
|
+
};
|
292
292
|
type ExtractPathParamsWithPattern<TPath extends string> = Pipe<TPath, [
|
293
293
|
Strings.Split<'/'>,
|
294
294
|
Tuples.Filter<Strings.StartsWith<':'>>,
|
@@ -304,7 +304,7 @@ type ExtractSubSegments<T extends any[]> = {
|
|
304
304
|
[K in keyof T]: SplitByDelimiter<T[K], ';'>;
|
305
305
|
};
|
306
306
|
type ExtractPathParamsWithBrackets<TPath extends string> = TupleToUnion<ExtractPathParameters<ExtractSubSegments<ExtractSegments<TPath>>[number]>>;
|
307
|
-
type RequestParams<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>, TMethod extends keyof MethodMap<TOAS, TPath>> = (MethodMap<TOAS, TPath>[TMethod] extends Checks$1
|
307
|
+
type RequestParams<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>, TMethod extends keyof MethodMap<TOAS, TPath>> = (MethodMap<TOAS, TPath>[TMethod] extends Checks$1['RequestBodyJson'] ? MethodMap<TOAS, TPath>[TMethod]['requestBody'] extends Checks$1['Required'] ? {
|
308
308
|
/**
|
309
309
|
* The request body in JSON is required for this request.
|
310
310
|
*
|
@@ -318,7 +318,7 @@ type RequestParams<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMa
|
|
318
318
|
* The value of `json` will be stringified and sent as the request body with `Content-Type: application/json`.
|
319
319
|
*/
|
320
320
|
json?: FromSchema<MethodMap<TOAS, TPath>[TMethod]['requestBody']['content']['application/json']['schema']>;
|
321
|
-
} : MethodMap<TOAS, TPath>[TMethod] extends Checks$1
|
321
|
+
} : MethodMap<TOAS, TPath>[TMethod] extends Checks$1['RequestBodyFormData'] ? MethodMap<TOAS, TPath>[TMethod]['requestBody'] extends Checks$1['Required'] ? {
|
322
322
|
/**
|
323
323
|
* The request body in multipart/form-data is required for this request.
|
324
324
|
*
|
@@ -332,7 +332,7 @@ type RequestParams<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMa
|
|
332
332
|
* The value of `formData` will be sent as the request body with `Content-Type: multipart/form-data`.
|
333
333
|
*/
|
334
334
|
formData?: FromSchema<MethodMap<TOAS, TPath>[TMethod]['requestBody']['content']['multipart/form-data']['schema']>;
|
335
|
-
} : MethodMap<TOAS, TPath>[TMethod] extends Checks$1
|
335
|
+
} : MethodMap<TOAS, TPath>[TMethod] extends Checks$1['RequestBodyFormEncoded'] ? MethodMap<TOAS, TPath>[TMethod]['requestBody'] extends Checks$1['Required'] ? {
|
336
336
|
/**
|
337
337
|
* The request body in application/x-www-form-urlencoded is required for this request.
|
338
338
|
*
|
@@ -346,8 +346,8 @@ type RequestParams<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMa
|
|
346
346
|
* The value of `formUrlEncoded` will be sent as the request body with `Content-Type: application/x-www-form-urlencoded`.
|
347
347
|
*/
|
348
348
|
formUrlEncoded?: FromSchema<MethodMap<TOAS, TPath>[TMethod]['requestBody']['content']['application/x-www-form-urlencoded']['schema']>;
|
349
|
-
} : {}) & (MethodMap<TOAS, TPath>[TMethod] extends Checks$1
|
350
|
-
(TPath extends Checks$1
|
349
|
+
} : {}) & (MethodMap<TOAS, TPath>[TMethod] extends Checks$1['Parameters'] ? ParamMap<MethodMap<TOAS, TPath>[TMethod]['parameters']> : {}) & // If there is any parameters defined in path but not in the parameters array, we should add them to the params
|
350
|
+
(TPath extends Checks$1['PathBrackets'] ? {
|
351
351
|
/**
|
352
352
|
* Parameters defined in the path are required for this request.
|
353
353
|
*
|
@@ -356,7 +356,7 @@ type RequestParams<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMa
|
|
356
356
|
* For example if path is `/todos/{id}` and `params` is `{ id: '1' }`, the path will be `/todos/1`
|
357
357
|
*/
|
358
358
|
params: Record<ExtractPathParamsWithBrackets<TPath>, string | number | bigint | boolean>;
|
359
|
-
} : {}) & (TPath extends Checks$1
|
359
|
+
} : {}) & (TPath extends Checks$1['PathPattern'] ? {
|
360
360
|
/**
|
361
361
|
* Parameters defined in the path are required for this request.
|
362
362
|
*
|
@@ -369,18 +369,18 @@ type RequestParams<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMa
|
|
369
369
|
SecurityParamsBySecurityRef<TOAS, MethodMap<TOAS, TPath>[TMethod]> & // Respect global security definitions
|
370
370
|
SecurityParamsBySecurityRef<TOAS, TOAS>;
|
371
371
|
|
372
|
-
|
373
|
-
|
372
|
+
type Checks = {
|
373
|
+
Content: {
|
374
374
|
content: any;
|
375
375
|
};
|
376
|
-
}
|
376
|
+
};
|
377
377
|
type ResponseSchemas<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>, TMethod extends keyof MethodMap<TOAS, TPath>, TStatus extends keyof StatusMap<TOAS, TPath, TMethod>> = StatusMap<TOAS, TPath, TMethod>[TStatus]['content'];
|
378
|
-
type JSONResponseSchema<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>, TMethod extends keyof MethodMap<TOAS, TPath>, TStatus extends keyof StatusMap<TOAS, TPath, TMethod>> = StatusMap<TOAS, TPath, TMethod>[TStatus] extends Checks
|
378
|
+
type JSONResponseSchema<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>, TMethod extends keyof MethodMap<TOAS, TPath>, TStatus extends keyof StatusMap<TOAS, TPath, TMethod>> = StatusMap<TOAS, TPath, TMethod>[TStatus] extends Checks['Content'] ? ResponseSchemas<TOAS, TPath, TMethod, TStatus>[keyof ResponseSchemas<TOAS, TPath, TMethod, TStatus>]['schema'] : StatusMap<TOAS, TPath, TMethod>[TStatus]['schema'];
|
379
379
|
type Response<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>, TMethod extends keyof MethodMap<TOAS, TPath>, TStatusCode extends keyof StatusMap<TOAS, TPath, TMethod> = 200> = FromSchema<JSONResponseSchema<TOAS, TPath, TMethod, TStatusCode>>;
|
380
380
|
|
381
381
|
type index_Infer<TOAS> = Infer<TOAS>;
|
382
382
|
type index_MethodMap<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>> = MethodMap<TOAS, TPath>;
|
383
|
-
type index_Model<TOAS extends OasTypes.OASDocument, TName extends TOAS extends Checks$3
|
383
|
+
type index_Model<TOAS extends OasTypes.OASDocument, TName extends TOAS extends Checks$3['ModelWithSchemas'] ? keyof TOAS['components']['schemas'] : TOAS extends Checks$3['ModelWithDefinitions'] ? keyof TOAS['definitions'] : never> = Model<TOAS, TName>;
|
384
384
|
type index_PathMap<TOAS extends OasTypes.OASDocument> = PathMap<TOAS>;
|
385
385
|
type index_RequestParams<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>, TMethod extends keyof MethodMap<TOAS, TPath>> = RequestParams<TOAS, TPath, TMethod>;
|
386
386
|
type index_Response<TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap<TOAS>, TMethod extends keyof MethodMap<TOAS, TPath>, TStatusCode extends keyof StatusMap<TOAS, TPath, TMethod> = 200> = Response<TOAS, TPath, TMethod, TStatusCode>;
|