@orval/core 7.8.0 → 7.10.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/dist/index.d.ts +120 -70
- package/dist/index.js +197 -85
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import SwaggerParser from '@apidevtools/swagger-parser';
|
|
2
2
|
import { allLocales } from '@faker-js/faker';
|
|
3
|
-
import
|
|
4
|
-
import { InfoObject, OperationObject, OpenAPIObject, ResponsesObject, ReferenceObject, RequestBodyObject, ParameterObject, SchemaObject, ComponentsObject, SchemasObject, PathItemObject, ResponseObject, ExampleObject } from 'openapi3-ts/oas30';
|
|
3
|
+
import { OpenAPIObject, SchemaObject, ResponsesObject, ReferenceObject, RequestBodyObject, OperationObject, InfoObject, ParameterObject, ComponentsObject, SchemasObject, PathItemObject, ResponseObject, ExampleObject } from 'openapi3-ts/oas30';
|
|
5
4
|
import swagger2openapi from 'swagger2openapi';
|
|
6
5
|
import { TypeDocOptions } from 'typedoc';
|
|
7
6
|
import { SchemaObject as SchemaObject$1 } from 'openapi3-ts/dist/model/openapi30';
|
|
@@ -73,7 +72,7 @@ type NormalizedOverrideOutput = {
|
|
|
73
72
|
mock?: OverrideMockOptions;
|
|
74
73
|
contentType?: OverrideOutputContentType;
|
|
75
74
|
header: false | ((info: InfoObject) => string[] | string);
|
|
76
|
-
formData:
|
|
75
|
+
formData: NormalizedFormDataType<NormalizedMutator>;
|
|
77
76
|
formUrlEncoded: boolean | NormalizedMutator;
|
|
78
77
|
paramsSerializer?: NormalizedMutator;
|
|
79
78
|
paramsSerializerOptions?: NormalizedParamsSerializerOptions;
|
|
@@ -106,8 +105,9 @@ type NormalizedOverrideOutput = {
|
|
|
106
105
|
useDeprecatedOperations?: boolean;
|
|
107
106
|
useBigInt?: boolean;
|
|
108
107
|
useNamedParameters?: boolean;
|
|
109
|
-
|
|
108
|
+
enumGenerationType: EnumGeneration;
|
|
110
109
|
suppressReadonlyModifier?: boolean;
|
|
110
|
+
jsDoc: NormalizedJsDocOptions;
|
|
111
111
|
};
|
|
112
112
|
type NormalizedMutator = {
|
|
113
113
|
path: string;
|
|
@@ -130,7 +130,7 @@ type NormalizedOperationOptions = {
|
|
|
130
130
|
zod?: NormalizedZodOptions;
|
|
131
131
|
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
132
132
|
fetch?: FetchOptions;
|
|
133
|
-
formData?:
|
|
133
|
+
formData?: NormalizedFormDataType<NormalizedMutator>;
|
|
134
134
|
formUrlEncoded?: boolean | NormalizedMutator;
|
|
135
135
|
paramsSerializer?: NormalizedMutator;
|
|
136
136
|
requestOptions?: object | boolean;
|
|
@@ -170,6 +170,12 @@ declare const NamingConvention: {
|
|
|
170
170
|
readonly KEBAB_CASE: "kebab-case";
|
|
171
171
|
};
|
|
172
172
|
type NamingConvention = (typeof NamingConvention)[keyof typeof NamingConvention];
|
|
173
|
+
declare const EnumGeneration: {
|
|
174
|
+
readonly CONST: "const";
|
|
175
|
+
readonly ENUM: "enum";
|
|
176
|
+
readonly UNION: "union";
|
|
177
|
+
};
|
|
178
|
+
type EnumGeneration = (typeof EnumGeneration)[keyof typeof EnumGeneration];
|
|
173
179
|
type OutputOptions = {
|
|
174
180
|
workspace?: string;
|
|
175
181
|
target?: string;
|
|
@@ -224,6 +230,7 @@ declare const OutputClient: {
|
|
|
224
230
|
readonly ZOD: "zod";
|
|
225
231
|
readonly HONO: "hono";
|
|
226
232
|
readonly FETCH: "fetch";
|
|
233
|
+
readonly MCP: "mcp";
|
|
227
234
|
};
|
|
228
235
|
type OutputClient = (typeof OutputClient)[keyof typeof OutputClient];
|
|
229
236
|
declare const OutputHttpClient: {
|
|
@@ -258,9 +265,14 @@ type GlobalMockOptions = {
|
|
|
258
265
|
type OverrideMockOptions = Partial<GlobalMockOptions> & {
|
|
259
266
|
arrayMin?: number;
|
|
260
267
|
arrayMax?: number;
|
|
268
|
+
stringMin?: number;
|
|
269
|
+
stringMax?: number;
|
|
270
|
+
numberMin?: number;
|
|
271
|
+
numberMax?: number;
|
|
261
272
|
required?: boolean;
|
|
262
273
|
properties?: MockProperties;
|
|
263
274
|
format?: Record<string, unknown>;
|
|
275
|
+
fractionDigits?: number;
|
|
264
276
|
};
|
|
265
277
|
type MockOptions = Omit<OverrideMockOptions, 'properties'> & {
|
|
266
278
|
properties?: Record<string, unknown>;
|
|
@@ -296,6 +308,28 @@ type Mutator = string | MutatorObject;
|
|
|
296
308
|
type ParamsSerializerOptions = {
|
|
297
309
|
qs?: Record<string, any>;
|
|
298
310
|
};
|
|
311
|
+
declare const FormDataArrayHandling: {
|
|
312
|
+
readonly SERIALIZE: "serialize";
|
|
313
|
+
readonly EXPLODE: "explode";
|
|
314
|
+
readonly SERIALIZE_WITH_BRACKETS: "serialize-with-brackets";
|
|
315
|
+
};
|
|
316
|
+
type FormDataArrayHandling = (typeof FormDataArrayHandling)[keyof typeof FormDataArrayHandling];
|
|
317
|
+
type NormalizedFormDataType<TMutator> = {
|
|
318
|
+
disabled: true;
|
|
319
|
+
mutator?: never;
|
|
320
|
+
arrayHandling: FormDataArrayHandling;
|
|
321
|
+
} | {
|
|
322
|
+
disabled: false;
|
|
323
|
+
mutator?: TMutator;
|
|
324
|
+
arrayHandling: FormDataArrayHandling;
|
|
325
|
+
};
|
|
326
|
+
type FormDataType<TMutator> = {
|
|
327
|
+
mutator: TMutator;
|
|
328
|
+
arrayHandling?: FormDataArrayHandling;
|
|
329
|
+
} | {
|
|
330
|
+
mutator?: TMutator;
|
|
331
|
+
arrayHandling: FormDataArrayHandling;
|
|
332
|
+
};
|
|
299
333
|
type OverrideOutput = {
|
|
300
334
|
title?: (title: string) => string;
|
|
301
335
|
transformer?: OutputTransformer;
|
|
@@ -309,7 +343,7 @@ type OverrideOutput = {
|
|
|
309
343
|
mock?: OverrideMockOptions;
|
|
310
344
|
contentType?: OverrideOutputContentType;
|
|
311
345
|
header?: boolean | ((info: InfoObject) => string[] | string);
|
|
312
|
-
formData?: boolean | Mutator
|
|
346
|
+
formData?: boolean | Mutator | FormDataType<Mutator>;
|
|
313
347
|
formUrlEncoded?: boolean | Mutator;
|
|
314
348
|
paramsSerializer?: Mutator;
|
|
315
349
|
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
@@ -341,8 +375,25 @@ type OverrideOutput = {
|
|
|
341
375
|
useDeprecatedOperations?: boolean;
|
|
342
376
|
useBigInt?: boolean;
|
|
343
377
|
useNamedParameters?: boolean;
|
|
378
|
+
/**
|
|
379
|
+
* @deprecated use 'enumGenerationType="enum"' instead
|
|
380
|
+
*/
|
|
344
381
|
useNativeEnums?: boolean;
|
|
382
|
+
enumGenerationType?: EnumGeneration;
|
|
345
383
|
suppressReadonlyModifier?: boolean;
|
|
384
|
+
jsDoc?: JsDocOptions;
|
|
385
|
+
};
|
|
386
|
+
type JsDocOptions = {
|
|
387
|
+
filter?: (schema: Record<string, any>) => {
|
|
388
|
+
key: string;
|
|
389
|
+
value: string;
|
|
390
|
+
}[];
|
|
391
|
+
};
|
|
392
|
+
type NormalizedJsDocOptions = {
|
|
393
|
+
filter?: (schema: Record<string, any>) => {
|
|
394
|
+
key: string;
|
|
395
|
+
value: string;
|
|
396
|
+
}[];
|
|
346
397
|
};
|
|
347
398
|
type OverrideOutputContentType = {
|
|
348
399
|
include?: string[];
|
|
@@ -498,7 +549,7 @@ type OperationOptions = {
|
|
|
498
549
|
zod?: ZodOptions;
|
|
499
550
|
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
500
551
|
fetch?: FetchOptions;
|
|
501
|
-
formData?: boolean | Mutator
|
|
552
|
+
formData?: boolean | Mutator | FormDataType<Mutator>;
|
|
502
553
|
formUrlEncoded?: boolean | Mutator;
|
|
503
554
|
paramsSerializer?: Mutator;
|
|
504
555
|
requestOptions?: object | boolean;
|
|
@@ -955,7 +1006,7 @@ declare const VERBS_WITH_BODY: Verbs[];
|
|
|
955
1006
|
declare const URL_REGEX: RegExp;
|
|
956
1007
|
declare const TEMPLATE_TAG_REGEX: RegExp;
|
|
957
1008
|
|
|
958
|
-
declare const generateComponentDefinition: (responses: ComponentsObject[
|
|
1009
|
+
declare const generateComponentDefinition: (responses: ComponentsObject["responses"] | ComponentsObject["requestBodies"], context: ContextSpecs, suffix: string) => GeneratorSchema[];
|
|
959
1010
|
|
|
960
1011
|
declare const generateImports: ({ imports, target, isRootKey, specsName, specKey: currentSpecKey, namingConvention, }: {
|
|
961
1012
|
imports: GeneratorImport[];
|
|
@@ -963,12 +1014,12 @@ declare const generateImports: ({ imports, target, isRootKey, specsName, specKey
|
|
|
963
1014
|
isRootKey: boolean;
|
|
964
1015
|
specsName: Record<string, string>;
|
|
965
1016
|
specKey: string;
|
|
966
|
-
namingConvention?: NamingConvention
|
|
1017
|
+
namingConvention?: NamingConvention;
|
|
967
1018
|
}) => string;
|
|
968
1019
|
declare const generateMutatorImports: ({ mutators, implementation, oneMore, }: {
|
|
969
1020
|
mutators: GeneratorMutator[];
|
|
970
|
-
implementation?: string
|
|
971
|
-
oneMore?: boolean
|
|
1021
|
+
implementation?: string;
|
|
1022
|
+
oneMore?: boolean;
|
|
972
1023
|
}) => string;
|
|
973
1024
|
declare const addDependency: ({ implementation, exports, dependency, specsName, hasSchemaDir, isAllowSyntheticDefaultImports, }: {
|
|
974
1025
|
implementation: string;
|
|
@@ -989,67 +1040,67 @@ declare const generateModelsInline: (obj: Record<string, GeneratorSchema[]>) =>
|
|
|
989
1040
|
|
|
990
1041
|
declare const BODY_TYPE_NAME = "BodyType";
|
|
991
1042
|
declare const generateMutator: ({ output, mutator, name, workspace, tsconfig, }: {
|
|
992
|
-
output?: string
|
|
993
|
-
mutator?: NormalizedMutator
|
|
1043
|
+
output?: string;
|
|
1044
|
+
mutator?: NormalizedMutator;
|
|
994
1045
|
name: string;
|
|
995
1046
|
workspace: string;
|
|
996
|
-
tsconfig?: Tsconfig
|
|
1047
|
+
tsconfig?: Tsconfig;
|
|
997
1048
|
}) => Promise<GeneratorMutator | undefined>;
|
|
998
1049
|
|
|
999
1050
|
declare const generateBodyOptions: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
1000
1051
|
declare const generateAxiosOptions: ({ response, isExactOptionalPropertyTypes, queryParams, headers, requestOptions, hasSignal, isVue, paramsSerializer, paramsSerializerOptions, }: {
|
|
1001
1052
|
response: GetterResponse;
|
|
1002
1053
|
isExactOptionalPropertyTypes: boolean;
|
|
1003
|
-
queryParams?: GeneratorSchema
|
|
1004
|
-
headers?: GeneratorSchema
|
|
1005
|
-
requestOptions?:
|
|
1054
|
+
queryParams?: GeneratorSchema;
|
|
1055
|
+
headers?: GeneratorSchema;
|
|
1056
|
+
requestOptions?: object | boolean;
|
|
1006
1057
|
hasSignal: boolean;
|
|
1007
1058
|
isVue: boolean;
|
|
1008
|
-
paramsSerializer?: GeneratorMutator
|
|
1009
|
-
paramsSerializerOptions?: ParamsSerializerOptions
|
|
1059
|
+
paramsSerializer?: GeneratorMutator;
|
|
1060
|
+
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
1010
1061
|
}) => string;
|
|
1011
1062
|
declare const generateOptions: ({ route, body, headers, queryParams, response, verb, requestOptions, isFormData, isFormUrlEncoded, isAngular, isExactOptionalPropertyTypes, hasSignal, isVue, paramsSerializer, paramsSerializerOptions, }: {
|
|
1012
1063
|
route: string;
|
|
1013
1064
|
body: GetterBody;
|
|
1014
|
-
headers?: GetterQueryParam
|
|
1015
|
-
queryParams?: GetterQueryParam
|
|
1065
|
+
headers?: GetterQueryParam;
|
|
1066
|
+
queryParams?: GetterQueryParam;
|
|
1016
1067
|
response: GetterResponse;
|
|
1017
1068
|
verb: Verbs;
|
|
1018
|
-
requestOptions?:
|
|
1069
|
+
requestOptions?: object | boolean;
|
|
1019
1070
|
isFormData: boolean;
|
|
1020
1071
|
isFormUrlEncoded: boolean;
|
|
1021
|
-
isAngular?: boolean
|
|
1072
|
+
isAngular?: boolean;
|
|
1022
1073
|
isExactOptionalPropertyTypes: boolean;
|
|
1023
1074
|
hasSignal: boolean;
|
|
1024
|
-
isVue?: boolean
|
|
1025
|
-
paramsSerializer?: GeneratorMutator
|
|
1026
|
-
paramsSerializerOptions?: ParamsSerializerOptions
|
|
1075
|
+
isVue?: boolean;
|
|
1076
|
+
paramsSerializer?: GeneratorMutator;
|
|
1077
|
+
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
1027
1078
|
}) => string;
|
|
1028
1079
|
declare const generateBodyMutatorConfig: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
1029
1080
|
declare const generateQueryParamsAxiosConfig: (response: GetterResponse, isVue: boolean, queryParams?: GetterQueryParam) => string;
|
|
1030
1081
|
declare const generateMutatorConfig: ({ route, body, headers, queryParams, response, verb, isFormData, isFormUrlEncoded, hasSignal, isExactOptionalPropertyTypes, isVue, }: {
|
|
1031
1082
|
route: string;
|
|
1032
1083
|
body: GetterBody;
|
|
1033
|
-
headers?: GetterQueryParam
|
|
1034
|
-
queryParams?: GetterQueryParam
|
|
1084
|
+
headers?: GetterQueryParam;
|
|
1085
|
+
queryParams?: GetterQueryParam;
|
|
1035
1086
|
response: GetterResponse;
|
|
1036
1087
|
verb: Verbs;
|
|
1037
1088
|
isFormData: boolean;
|
|
1038
1089
|
isFormUrlEncoded: boolean;
|
|
1039
1090
|
hasSignal: boolean;
|
|
1040
1091
|
isExactOptionalPropertyTypes: boolean;
|
|
1041
|
-
isVue?: boolean
|
|
1092
|
+
isVue?: boolean;
|
|
1042
1093
|
}) => string;
|
|
1043
1094
|
declare const generateMutatorRequestOptions: (requestOptions: boolean | object | undefined, hasSecondArgument: boolean) => string;
|
|
1044
1095
|
declare const generateFormDataAndUrlEncodedFunction: ({ body, formData, formUrlEncoded, isFormData, isFormUrlEncoded, }: {
|
|
1045
1096
|
body: GetterBody;
|
|
1046
|
-
formData?: GeneratorMutator
|
|
1047
|
-
formUrlEncoded?: GeneratorMutator
|
|
1097
|
+
formData?: GeneratorMutator;
|
|
1098
|
+
formUrlEncoded?: GeneratorMutator;
|
|
1048
1099
|
isFormData: boolean;
|
|
1049
1100
|
isFormUrlEncoded: boolean;
|
|
1050
1101
|
}) => string;
|
|
1051
1102
|
|
|
1052
|
-
declare const generateParameterDefinition: (parameters: ComponentsObject[
|
|
1103
|
+
declare const generateParameterDefinition: (parameters: ComponentsObject["parameters"], context: ContextSpecs, suffix: string) => GeneratorSchema[];
|
|
1053
1104
|
|
|
1054
1105
|
/**
|
|
1055
1106
|
* Extract all types from #/components/schemas
|
|
@@ -1066,7 +1117,7 @@ declare const generateVerbsOptions: ({ verbs, input, output, route, pathRoute, c
|
|
|
1066
1117
|
pathRoute: string;
|
|
1067
1118
|
context: ContextSpecs;
|
|
1068
1119
|
}) => Promise<GeneratorVerbsOptions>;
|
|
1069
|
-
declare const _filteredVerbs: (verbs: PathItemObject, filters: NormalizedInputOptions[
|
|
1120
|
+
declare const _filteredVerbs: (verbs: PathItemObject, filters: NormalizedInputOptions["filters"]) => [string, any][];
|
|
1070
1121
|
|
|
1071
1122
|
/**
|
|
1072
1123
|
* Return the output type from an array
|
|
@@ -1075,7 +1126,7 @@ declare const _filteredVerbs: (verbs: PathItemObject, filters: NormalizedInputOp
|
|
|
1075
1126
|
*/
|
|
1076
1127
|
declare const getArray: ({ schema, name, context, }: {
|
|
1077
1128
|
schema: SchemaObject;
|
|
1078
|
-
name?: string
|
|
1129
|
+
name?: string;
|
|
1079
1130
|
context: ContextSpecs;
|
|
1080
1131
|
}) => ScalarValue;
|
|
1081
1132
|
|
|
@@ -1083,12 +1134,12 @@ declare const getBody: ({ requestBody, operationName, context, contentType, }: {
|
|
|
1083
1134
|
requestBody: ReferenceObject | RequestBodyObject;
|
|
1084
1135
|
operationName: string;
|
|
1085
1136
|
context: ContextSpecs;
|
|
1086
|
-
contentType?: OverrideOutputContentType
|
|
1137
|
+
contentType?: OverrideOutputContentType;
|
|
1087
1138
|
}) => GetterBody;
|
|
1088
1139
|
|
|
1089
1140
|
type Separator = 'allOf' | 'anyOf' | 'oneOf';
|
|
1090
1141
|
declare const combineSchemas: ({ name, schema, separator, context, nullable, }: {
|
|
1091
|
-
name?: string
|
|
1142
|
+
name?: string;
|
|
1092
1143
|
schema: SchemaObject;
|
|
1093
1144
|
separator: Separator;
|
|
1094
1145
|
context: ContextSpecs;
|
|
@@ -1098,8 +1149,9 @@ declare const combineSchemas: ({ name, schema, separator, context, nullable, }:
|
|
|
1098
1149
|
declare const resolveDiscriminators: (schemas: SchemasObject, context: ContextSpecs) => SchemasObject;
|
|
1099
1150
|
|
|
1100
1151
|
declare const getEnumNames: (schemaObject: SchemaObject$1 | undefined) => any;
|
|
1101
|
-
declare const
|
|
1102
|
-
declare const
|
|
1152
|
+
declare const getEnumDescriptions: (schemaObject: SchemaObject$1 | undefined) => any;
|
|
1153
|
+
declare const getEnum: (value: string, enumName: string, names: string[] | undefined, enumGenerationType: EnumGeneration, descriptions?: string[]) => string;
|
|
1154
|
+
declare const getEnumImplementation: (value: string, names?: string[], descriptions?: string[]) => string;
|
|
1103
1155
|
|
|
1104
1156
|
declare const getKey: (key: string) => string;
|
|
1105
1157
|
|
|
@@ -1110,7 +1162,7 @@ declare const getKey: (key: string) => string;
|
|
|
1110
1162
|
*/
|
|
1111
1163
|
declare const getObject: ({ item, name, context, nullable, }: {
|
|
1112
1164
|
item: SchemaObject;
|
|
1113
|
-
name?: string
|
|
1165
|
+
name?: string;
|
|
1114
1166
|
context: ContextSpecs;
|
|
1115
1167
|
nullable: string;
|
|
1116
1168
|
}) => ScalarValue;
|
|
@@ -1135,10 +1187,7 @@ declare const getParameters: ({ parameters, context, }: {
|
|
|
1135
1187
|
declare const getParamsInPath: (path: string) => string[];
|
|
1136
1188
|
declare const getParams: ({ route, pathParams, operationId, context, output, }: {
|
|
1137
1189
|
route: string;
|
|
1138
|
-
pathParams?:
|
|
1139
|
-
parameter: openapi3_ts_oas30.ParameterObject;
|
|
1140
|
-
imports: GeneratorImport[];
|
|
1141
|
-
}[] | undefined;
|
|
1190
|
+
pathParams?: GetterParameters["query"];
|
|
1142
1191
|
operationId: string;
|
|
1143
1192
|
context: ContextSpecs;
|
|
1144
1193
|
output: NormalizedOutputOptions;
|
|
@@ -1146,18 +1195,18 @@ declare const getParams: ({ route, pathParams, operationId, context, output, }:
|
|
|
1146
1195
|
|
|
1147
1196
|
declare const getProps: ({ body, queryParams, params, operationName, headers, context, }: {
|
|
1148
1197
|
body: GetterBody;
|
|
1149
|
-
queryParams?: GetterQueryParam
|
|
1198
|
+
queryParams?: GetterQueryParam;
|
|
1150
1199
|
params: GetterParams;
|
|
1151
1200
|
operationName: string;
|
|
1152
|
-
headers?: GetterQueryParam
|
|
1201
|
+
headers?: GetterQueryParam;
|
|
1153
1202
|
context: ContextSpecs;
|
|
1154
1203
|
}) => GetterProps;
|
|
1155
1204
|
|
|
1156
1205
|
declare const getQueryParams: ({ queryParams, operationName, context, suffix, }: {
|
|
1157
|
-
queryParams: GetterParameters[
|
|
1206
|
+
queryParams: GetterParameters["query"];
|
|
1158
1207
|
operationName: string;
|
|
1159
1208
|
context: ContextSpecs;
|
|
1160
|
-
suffix?: string
|
|
1209
|
+
suffix?: string;
|
|
1161
1210
|
}) => GetterQueryParam | undefined;
|
|
1162
1211
|
|
|
1163
1212
|
type RefComponent = 'schemas' | 'responses' | 'parameters' | 'requestBodies';
|
|
@@ -1179,18 +1228,15 @@ interface RefInfo {
|
|
|
1179
1228
|
*
|
|
1180
1229
|
* @param $ref
|
|
1181
1230
|
*/
|
|
1182
|
-
declare const getRefInfo: ($ref: ReferenceObject[
|
|
1231
|
+
declare const getRefInfo: ($ref: ReferenceObject["$ref"], context: ContextSpecs) => RefInfo;
|
|
1183
1232
|
|
|
1184
|
-
declare const getResReqTypes: (responsesOrRequests: Array<[
|
|
1185
|
-
string,
|
|
1186
|
-
ResponseObject | ReferenceObject | RequestBodyObject
|
|
1187
|
-
]>, name: string, context: ContextSpecs, defaultType?: string, uniqueKey?: ValueIteratee<ResReqTypesValue>) => ResReqTypesValue[];
|
|
1233
|
+
declare const getResReqTypes: (responsesOrRequests: Array<[string, ResponseObject | ReferenceObject | RequestBodyObject]>, name: string, context: ContextSpecs, defaultType?: string, uniqueKey?: ValueIteratee<ResReqTypesValue>) => ResReqTypesValue[];
|
|
1188
1234
|
|
|
1189
1235
|
declare const getResponse: ({ responses, operationName, context, contentType, }: {
|
|
1190
1236
|
responses: ResponsesObject;
|
|
1191
1237
|
operationName: string;
|
|
1192
1238
|
context: ContextSpecs;
|
|
1193
|
-
contentType?: OverrideOutputContentType
|
|
1239
|
+
contentType?: OverrideOutputContentType;
|
|
1194
1240
|
}) => GetterResponse;
|
|
1195
1241
|
|
|
1196
1242
|
declare const getRoute: (route: string) => string;
|
|
@@ -1205,14 +1251,14 @@ declare const getRouteAsArray: (route: string) => string;
|
|
|
1205
1251
|
*/
|
|
1206
1252
|
declare const getScalar: ({ item, name, context, }: {
|
|
1207
1253
|
item: SchemaObject;
|
|
1208
|
-
name?: string
|
|
1254
|
+
name?: string;
|
|
1209
1255
|
context: ContextSpecs;
|
|
1210
1256
|
}) => ScalarValue;
|
|
1211
1257
|
|
|
1212
1258
|
declare const resolveObject: ({ schema, propName, combined, context, }: {
|
|
1213
1259
|
schema: SchemaObject | ReferenceObject;
|
|
1214
|
-
propName?: string
|
|
1215
|
-
combined?: boolean
|
|
1260
|
+
propName?: string;
|
|
1261
|
+
combined?: boolean;
|
|
1216
1262
|
context: ContextSpecs;
|
|
1217
1263
|
}) => ResolverValue;
|
|
1218
1264
|
|
|
@@ -1227,7 +1273,7 @@ declare const resolveExampleRefs: (examples: Examples, context: ContextSpecs) =>
|
|
|
1227
1273
|
|
|
1228
1274
|
declare const resolveValue: ({ schema, name, context, }: {
|
|
1229
1275
|
schema: SchemaObject | ReferenceObject;
|
|
1230
|
-
name?: string
|
|
1276
|
+
name?: string;
|
|
1231
1277
|
context: ContextSpecs;
|
|
1232
1278
|
}) => ResolverValue;
|
|
1233
1279
|
|
|
@@ -1268,7 +1314,7 @@ interface DebuggerOptions {
|
|
|
1268
1314
|
}
|
|
1269
1315
|
declare function createDebugger(ns: string, options?: DebuggerOptions): debug.Debugger['log'];
|
|
1270
1316
|
|
|
1271
|
-
declare function jsDoc(
|
|
1317
|
+
declare function jsDoc(schema: {
|
|
1272
1318
|
description?: string[] | string;
|
|
1273
1319
|
deprecated?: boolean;
|
|
1274
1320
|
summary?: string;
|
|
@@ -1282,9 +1328,13 @@ declare function jsDoc({ description, deprecated, summary, minLength, maxLength,
|
|
|
1282
1328
|
maxItems?: number;
|
|
1283
1329
|
nullable?: boolean;
|
|
1284
1330
|
pattern?: string;
|
|
1285
|
-
}, tryOneLine?: boolean): string;
|
|
1331
|
+
}, tryOneLine?: boolean, context?: ContextSpecs): string;
|
|
1332
|
+
declare function keyValuePairsToJsDoc(keyValues: {
|
|
1333
|
+
key: string;
|
|
1334
|
+
value: string;
|
|
1335
|
+
}[]): string;
|
|
1286
1336
|
|
|
1287
|
-
declare const dynamicImport: <T>(toImport:
|
|
1337
|
+
declare const dynamicImport: <T>(toImport: T | string, from?: string, takeDefault?: boolean) => Promise<T>;
|
|
1288
1338
|
|
|
1289
1339
|
declare const getExtension: (path: string) => "yaml" | "json";
|
|
1290
1340
|
|
|
@@ -1330,8 +1380,8 @@ interface LoggerOptions {
|
|
|
1330
1380
|
declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
|
|
1331
1381
|
|
|
1332
1382
|
declare const getFileInfo: (target?: string, { backupFilename, extension, }?: {
|
|
1333
|
-
backupFilename?: string
|
|
1334
|
-
extension?: string
|
|
1383
|
+
backupFilename?: string;
|
|
1384
|
+
extension?: string;
|
|
1335
1385
|
}) => {
|
|
1336
1386
|
path: string;
|
|
1337
1387
|
pathWithoutExtension: string;
|
|
@@ -1368,7 +1418,7 @@ declare const join: (...paths: string[]) => string;
|
|
|
1368
1418
|
declare const resolve: (...paths: string[]) => string;
|
|
1369
1419
|
declare const extname: (path: string) => string;
|
|
1370
1420
|
declare const dirname: (path: string) => string;
|
|
1371
|
-
declare const basename: (path: string, suffix?: string
|
|
1421
|
+
declare const basename: (path: string, suffix?: string) => string;
|
|
1372
1422
|
declare const isAbsolute: (path: string) => boolean;
|
|
1373
1423
|
|
|
1374
1424
|
/**
|
|
@@ -1398,16 +1448,16 @@ declare namespace path {
|
|
|
1398
1448
|
}
|
|
1399
1449
|
|
|
1400
1450
|
declare const sortByPriority: <T>(arr: (T & {
|
|
1401
|
-
default?: boolean
|
|
1402
|
-
required?: boolean
|
|
1451
|
+
default?: boolean;
|
|
1452
|
+
required?: boolean;
|
|
1403
1453
|
})[]) => (T & {
|
|
1404
|
-
default?: boolean
|
|
1405
|
-
required?: boolean
|
|
1454
|
+
default?: boolean;
|
|
1455
|
+
required?: boolean;
|
|
1406
1456
|
})[];
|
|
1407
1457
|
|
|
1408
1458
|
declare const stringify: (data?: string | any[] | {
|
|
1409
1459
|
[key: string]: any;
|
|
1410
|
-
}
|
|
1460
|
+
}) => string | undefined;
|
|
1411
1461
|
declare const sanitize: (value: string, options?: {
|
|
1412
1462
|
whitespace?: string | true;
|
|
1413
1463
|
underscore?: string | true;
|
|
@@ -1417,7 +1467,7 @@ declare const sanitize: (value: string, options?: {
|
|
|
1417
1467
|
es5IdentifierName?: boolean;
|
|
1418
1468
|
special?: boolean;
|
|
1419
1469
|
}) => string;
|
|
1420
|
-
declare const toObjectString: <T>(props: T[], path?: keyof T
|
|
1470
|
+
declare const toObjectString: <T>(props: T[], path?: keyof T) => string;
|
|
1421
1471
|
declare const getNumberWord: (num: number) => string;
|
|
1422
1472
|
declare const escape: (str: string | null, char?: string) => string | undefined;
|
|
1423
1473
|
/**
|
|
@@ -1482,4 +1532,4 @@ declare const generateTarget: (builder: WriteSpecsBuilder, options: NormalizedOu
|
|
|
1482
1532
|
|
|
1483
1533
|
declare const generateTargetForTags: (builder: WriteSpecsBuilder, options: NormalizedOutputOptions) => Record<string, GeneratorTarget>;
|
|
1484
1534
|
|
|
1485
|
-
export { type AngularOptions, BODY_TYPE_NAME, type BaseUrlFromConstant, type BaseUrlFromSpec, type ClientBuilder, type ClientDependenciesBuilder, type ClientExtraFilesBuilder, type ClientFileBuilder, type ClientFooterBuilder, type ClientGeneratorsBuilder, type ClientHeaderBuilder, type ClientMockBuilder, type ClientMockGeneratorBuilder, type ClientMockGeneratorImplementation, type ClientTitleBuilder, type Config, type ConfigExternal, type ConfigFn, type ContextSpecs, type FetchOptions, type GenerateMockImports, type GeneratorApiBuilder, type GeneratorApiOperations, type GeneratorApiResponse, type GeneratorClient, type GeneratorClientExtra, type GeneratorClientFooter, type GeneratorClientHeader, type GeneratorClientImports, type GeneratorClientTitle, type GeneratorClients, type GeneratorDependency, type GeneratorImport, type GeneratorMutator, type GeneratorMutatorParsingInfo, type GeneratorOperation, type GeneratorOperations, type GeneratorOptions, type GeneratorSchema, type GeneratorTarget, type GeneratorTargetFull, type GeneratorVerbOptions, type GeneratorVerbsOptions, type GetterBody, type GetterParam, type GetterParameters, type GetterParams, type GetterProp, GetterPropType, type GetterProps, type GetterQueryParam, type GetterResponse, type GlobalMockOptions, type GlobalOptions, type HonoOptions, type Hook, type HookCommand, type HookFunction, type HookOption, type HooksOptions, type ImportOpenApi, type InputFiltersOption, type InputOptions, type InputTransformerFn, type LogLevel, LogLevels, type LogOptions, type LogType, type Logger, type LoggerOptions, type MockData, type MockDataArray, type MockDataArrayFn, type MockDataObject, type MockDataObjectFn, type MockOptions, type MockProperties, type MockPropertiesObject, type MockPropertiesObjectFn, type Mutator, type MutatorObject, NamingConvention, type NormalizedConfig, type NormalizedHonoOptions, type NormalizedHookCommand, type NormalizedHookOptions, type NormalizedInputOptions, type NormalizedMutator, type NormalizedOperationOptions, type NormalizedOptions, type NormalizedOutputOptions, type NormalizedOverrideOutput, type NormalizedParamsSerializerOptions, type NormalizedQueryOptions, type NormalizedZodOptions, type OperationOptions, type Options, type OptionsExport, type OptionsFn, OutputClient, type OutputClientFunc, type OutputDocsOptions, OutputHttpClient, OutputMockType, OutputMode, type OutputOptions, type OverrideInput, type OverrideMockOptions, type OverrideOutput, type OverrideOutputContentType, type PackageJson, type ParamsSerializerOptions, PropertySortOrder, type QueryOptions, RefComponentSuffix, type RefInfo, type ResReqTypesValue, type ResolverValue, type ScalarValue, SchemaType, type SchemaWithConst, type SwaggerParserOptions, type SwrOptions, TEMPLATE_TAG_REGEX, type TsConfigTarget, type Tsconfig, URL_REGEX, VERBS_WITH_BODY, Verbs, type WriteModeProps, type WriteSpecsBuilder, type ZodCoerceType, type ZodDateTimeOptions, type ZodOptions, _filteredVerbs, addDependency, asyncReduce, camel, combineSchemas, compareVersions, conventionName, count, createDebugger, createLogger, createSuccessMessage, dynamicImport, escape, generalJSTypes, generalJSTypesWithArray, generateAxiosOptions, generateBodyMutatorConfig, generateBodyOptions, generateComponentDefinition, generateDependencyImports, generateFormDataAndUrlEncodedFunction, generateImports, generateModelInline, generateModelsInline, generateMutator, generateMutatorConfig, generateMutatorImports, generateMutatorRequestOptions, generateOptions, generateParameterDefinition, generateQueryParamsAxiosConfig, generateSchemasDefinition, generateTarget, generateTargetForTags, generateVerbImports, generateVerbsOptions, getArray, getBody, getEnum, getEnumImplementation, getEnumNames, getExtension, getFileInfo, getFullRoute, getIsBodyVerb, getKey, getMockFileExtensionByTypeName, getNumberWord, getObject, getOperationId, getOrvalGeneratedTypes, getParameters, getParams, getParamsInPath, getProps, getQueryParams, getRefInfo, getResReqTypes, getResponse, getRoute, getRouteAsArray, getScalar, ibmOpenapiValidator, ibmOpenapiValidatorErrors, ibmOpenapiValidatorWarnings, isBoolean, isDirectory, isFunction, isModule, isNull, isNumber, isNumeric, isObject, isReference, isRootKey, isSchema, isString, isSyntheticDefaultImportsAllow, isUndefined, isUrl, isVerb, jsDoc, jsStringEscape, kebab, loadFile, log, logError, mergeDeep, mismatchArgsMessage, openApiConverter, pascal, removeFiles, resolveDiscriminators, resolveExampleRefs, resolveObject, resolveRef, resolveValue, sanitize, snake, sortByPriority, startMessage, stringify, toObjectString, path as upath, upper, writeModelInline, writeModelsInline, writeSchema, writeSchemas, writeSingleMode, writeSplitMode, writeSplitTagsMode, writeTagsMode };
|
|
1535
|
+
export { type AngularOptions, BODY_TYPE_NAME, type BaseUrlFromConstant, type BaseUrlFromSpec, type ClientBuilder, type ClientDependenciesBuilder, type ClientExtraFilesBuilder, type ClientFileBuilder, type ClientFooterBuilder, type ClientGeneratorsBuilder, type ClientHeaderBuilder, type ClientMockBuilder, type ClientMockGeneratorBuilder, type ClientMockGeneratorImplementation, type ClientTitleBuilder, type Config, type ConfigExternal, type ConfigFn, type ContextSpecs, EnumGeneration, type FetchOptions, FormDataArrayHandling, type FormDataType, type GenerateMockImports, type GeneratorApiBuilder, type GeneratorApiOperations, type GeneratorApiResponse, type GeneratorClient, type GeneratorClientExtra, type GeneratorClientFooter, type GeneratorClientHeader, type GeneratorClientImports, type GeneratorClientTitle, type GeneratorClients, type GeneratorDependency, type GeneratorImport, type GeneratorMutator, type GeneratorMutatorParsingInfo, type GeneratorOperation, type GeneratorOperations, type GeneratorOptions, type GeneratorSchema, type GeneratorTarget, type GeneratorTargetFull, type GeneratorVerbOptions, type GeneratorVerbsOptions, type GetterBody, type GetterParam, type GetterParameters, type GetterParams, type GetterProp, GetterPropType, type GetterProps, type GetterQueryParam, type GetterResponse, type GlobalMockOptions, type GlobalOptions, type HonoOptions, type Hook, type HookCommand, type HookFunction, type HookOption, type HooksOptions, type ImportOpenApi, type InputFiltersOption, type InputOptions, type InputTransformerFn, type JsDocOptions, type LogLevel, LogLevels, type LogOptions, type LogType, type Logger, type LoggerOptions, type MockData, type MockDataArray, type MockDataArrayFn, type MockDataObject, type MockDataObjectFn, type MockOptions, type MockProperties, type MockPropertiesObject, type MockPropertiesObjectFn, type Mutator, type MutatorObject, NamingConvention, type NormalizedConfig, type NormalizedFormDataType, type NormalizedHonoOptions, type NormalizedHookCommand, type NormalizedHookOptions, type NormalizedInputOptions, type NormalizedJsDocOptions, type NormalizedMutator, type NormalizedOperationOptions, type NormalizedOptions, type NormalizedOutputOptions, type NormalizedOverrideOutput, type NormalizedParamsSerializerOptions, type NormalizedQueryOptions, type NormalizedZodOptions, type OperationOptions, type Options, type OptionsExport, type OptionsFn, OutputClient, type OutputClientFunc, type OutputDocsOptions, OutputHttpClient, OutputMockType, OutputMode, type OutputOptions, type OverrideInput, type OverrideMockOptions, type OverrideOutput, type OverrideOutputContentType, type PackageJson, type ParamsSerializerOptions, PropertySortOrder, type QueryOptions, RefComponentSuffix, type RefInfo, type ResReqTypesValue, type ResolverValue, type ScalarValue, SchemaType, type SchemaWithConst, type SwaggerParserOptions, type SwrOptions, TEMPLATE_TAG_REGEX, type TsConfigTarget, type Tsconfig, URL_REGEX, VERBS_WITH_BODY, Verbs, type WriteModeProps, type WriteSpecsBuilder, type ZodCoerceType, type ZodDateTimeOptions, type ZodOptions, _filteredVerbs, addDependency, asyncReduce, camel, combineSchemas, compareVersions, conventionName, count, createDebugger, createLogger, createSuccessMessage, dynamicImport, escape, generalJSTypes, generalJSTypesWithArray, generateAxiosOptions, generateBodyMutatorConfig, generateBodyOptions, generateComponentDefinition, generateDependencyImports, generateFormDataAndUrlEncodedFunction, generateImports, generateModelInline, generateModelsInline, generateMutator, generateMutatorConfig, generateMutatorImports, generateMutatorRequestOptions, generateOptions, generateParameterDefinition, generateQueryParamsAxiosConfig, generateSchemasDefinition, generateTarget, generateTargetForTags, generateVerbImports, generateVerbsOptions, getArray, getBody, getEnum, getEnumDescriptions, getEnumImplementation, getEnumNames, getExtension, getFileInfo, getFullRoute, getIsBodyVerb, getKey, getMockFileExtensionByTypeName, getNumberWord, getObject, getOperationId, getOrvalGeneratedTypes, getParameters, getParams, getParamsInPath, getProps, getQueryParams, getRefInfo, getResReqTypes, getResponse, getRoute, getRouteAsArray, getScalar, ibmOpenapiValidator, ibmOpenapiValidatorErrors, ibmOpenapiValidatorWarnings, isBoolean, isDirectory, isFunction, isModule, isNull, isNumber, isNumeric, isObject, isReference, isRootKey, isSchema, isString, isSyntheticDefaultImportsAllow, isUndefined, isUrl, isVerb, jsDoc, jsStringEscape, kebab, keyValuePairsToJsDoc, loadFile, log, logError, mergeDeep, mismatchArgsMessage, openApiConverter, pascal, removeFiles, resolveDiscriminators, resolveExampleRefs, resolveObject, resolveRef, resolveValue, sanitize, snake, sortByPriority, startMessage, stringify, toObjectString, path as upath, upper, writeModelInline, writeModelsInline, writeSchema, writeSchemas, writeSingleMode, writeSplitMode, writeSplitTagsMode, writeTagsMode };
|