@orval/core 7.9.0 → 7.11.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 +103 -67
- package/dist/index.js +283 -70
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
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';
|
|
@@ -77,6 +76,9 @@ type NormalizedOverrideOutput = {
|
|
|
77
76
|
formUrlEncoded: boolean | NormalizedMutator;
|
|
78
77
|
paramsSerializer?: NormalizedMutator;
|
|
79
78
|
paramsSerializerOptions?: NormalizedParamsSerializerOptions;
|
|
79
|
+
namingConvention: {
|
|
80
|
+
enum?: NamingConvention;
|
|
81
|
+
};
|
|
80
82
|
components: {
|
|
81
83
|
schemas: {
|
|
82
84
|
suffix: string;
|
|
@@ -108,6 +110,7 @@ type NormalizedOverrideOutput = {
|
|
|
108
110
|
useNamedParameters?: boolean;
|
|
109
111
|
enumGenerationType: EnumGeneration;
|
|
110
112
|
suppressReadonlyModifier?: boolean;
|
|
113
|
+
jsDoc: NormalizedJsDocOptions;
|
|
111
114
|
};
|
|
112
115
|
type NormalizedMutator = {
|
|
113
116
|
path: string;
|
|
@@ -265,9 +268,14 @@ type GlobalMockOptions = {
|
|
|
265
268
|
type OverrideMockOptions = Partial<GlobalMockOptions> & {
|
|
266
269
|
arrayMin?: number;
|
|
267
270
|
arrayMax?: number;
|
|
271
|
+
stringMin?: number;
|
|
272
|
+
stringMax?: number;
|
|
273
|
+
numberMin?: number;
|
|
274
|
+
numberMax?: number;
|
|
268
275
|
required?: boolean;
|
|
269
276
|
properties?: MockProperties;
|
|
270
277
|
format?: Record<string, unknown>;
|
|
278
|
+
fractionDigits?: number;
|
|
271
279
|
};
|
|
272
280
|
type MockOptions = Omit<OverrideMockOptions, 'properties'> & {
|
|
273
281
|
properties?: Record<string, unknown>;
|
|
@@ -342,6 +350,9 @@ type OverrideOutput = {
|
|
|
342
350
|
formUrlEncoded?: boolean | Mutator;
|
|
343
351
|
paramsSerializer?: Mutator;
|
|
344
352
|
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
353
|
+
namingConvention?: {
|
|
354
|
+
enum?: NamingConvention;
|
|
355
|
+
};
|
|
345
356
|
components?: {
|
|
346
357
|
schemas?: {
|
|
347
358
|
suffix?: string;
|
|
@@ -376,6 +387,19 @@ type OverrideOutput = {
|
|
|
376
387
|
useNativeEnums?: boolean;
|
|
377
388
|
enumGenerationType?: EnumGeneration;
|
|
378
389
|
suppressReadonlyModifier?: boolean;
|
|
390
|
+
jsDoc?: JsDocOptions;
|
|
391
|
+
};
|
|
392
|
+
type JsDocOptions = {
|
|
393
|
+
filter?: (schema: Record<string, any>) => {
|
|
394
|
+
key: string;
|
|
395
|
+
value: string;
|
|
396
|
+
}[];
|
|
397
|
+
};
|
|
398
|
+
type NormalizedJsDocOptions = {
|
|
399
|
+
filter?: (schema: Record<string, any>) => {
|
|
400
|
+
key: string;
|
|
401
|
+
value: string;
|
|
402
|
+
}[];
|
|
379
403
|
};
|
|
380
404
|
type OverrideOutputContentType = {
|
|
381
405
|
include?: string[];
|
|
@@ -392,6 +416,9 @@ type ZodDateTimeOptions = {
|
|
|
392
416
|
local?: boolean;
|
|
393
417
|
precision?: number;
|
|
394
418
|
};
|
|
419
|
+
type ZodTimeOptions = {
|
|
420
|
+
precision?: -1 | 0 | 1 | 2 | 3;
|
|
421
|
+
};
|
|
395
422
|
type ZodOptions = {
|
|
396
423
|
strict?: {
|
|
397
424
|
param?: boolean;
|
|
@@ -422,6 +449,7 @@ type ZodOptions = {
|
|
|
422
449
|
response?: Mutator;
|
|
423
450
|
};
|
|
424
451
|
dateTimeOptions?: ZodDateTimeOptions;
|
|
452
|
+
timeOptions?: ZodTimeOptions;
|
|
425
453
|
generateEachHttpStatus?: boolean;
|
|
426
454
|
};
|
|
427
455
|
type ZodCoerceType = 'string' | 'number' | 'boolean' | 'bigint' | 'date';
|
|
@@ -456,6 +484,7 @@ type NormalizedZodOptions = {
|
|
|
456
484
|
};
|
|
457
485
|
generateEachHttpStatus: boolean;
|
|
458
486
|
dateTimeOptions: ZodDateTimeOptions;
|
|
487
|
+
timeOptions: ZodTimeOptions;
|
|
459
488
|
};
|
|
460
489
|
type HonoOptions = {
|
|
461
490
|
handlers?: string;
|
|
@@ -506,12 +535,15 @@ type AngularOptions = {
|
|
|
506
535
|
};
|
|
507
536
|
type SwrOptions = {
|
|
508
537
|
useInfinite?: boolean;
|
|
538
|
+
useSWRMutationForGet?: boolean;
|
|
509
539
|
swrOptions?: any;
|
|
510
540
|
swrMutationOptions?: any;
|
|
511
541
|
swrInfiniteOptions?: any;
|
|
512
542
|
};
|
|
513
543
|
type FetchOptions = {
|
|
514
|
-
includeHttpResponseReturnType
|
|
544
|
+
includeHttpResponseReturnType?: boolean;
|
|
545
|
+
explode?: boolean;
|
|
546
|
+
jsonReviver?: Mutator;
|
|
515
547
|
};
|
|
516
548
|
type InputTransformerFn = (spec: OpenAPIObject) => OpenAPIObject;
|
|
517
549
|
type InputTransformer = string | InputTransformerFn;
|
|
@@ -638,6 +670,7 @@ type GeneratorTarget = {
|
|
|
638
670
|
formData?: GeneratorMutator[];
|
|
639
671
|
formUrlEncoded?: GeneratorMutator[];
|
|
640
672
|
paramsSerializer?: GeneratorMutator[];
|
|
673
|
+
fetchReviver?: GeneratorMutator[];
|
|
641
674
|
};
|
|
642
675
|
type GeneratorTargetFull = {
|
|
643
676
|
imports: GeneratorImport[];
|
|
@@ -653,6 +686,7 @@ type GeneratorTargetFull = {
|
|
|
653
686
|
formData?: GeneratorMutator[];
|
|
654
687
|
formUrlEncoded?: GeneratorMutator[];
|
|
655
688
|
paramsSerializer?: GeneratorMutator[];
|
|
689
|
+
fetchReviver?: GeneratorMutator[];
|
|
656
690
|
};
|
|
657
691
|
type GeneratorOperation = {
|
|
658
692
|
imports: GeneratorImport[];
|
|
@@ -669,6 +703,7 @@ type GeneratorOperation = {
|
|
|
669
703
|
formData?: GeneratorMutator;
|
|
670
704
|
formUrlEncoded?: GeneratorMutator;
|
|
671
705
|
paramsSerializer?: GeneratorMutator;
|
|
706
|
+
fetchReviver?: GeneratorMutator;
|
|
672
707
|
operationName: string;
|
|
673
708
|
types?: {
|
|
674
709
|
result: (title?: string) => string;
|
|
@@ -693,6 +728,7 @@ type GeneratorVerbOptions = {
|
|
|
693
728
|
formData?: GeneratorMutator;
|
|
694
729
|
formUrlEncoded?: GeneratorMutator;
|
|
695
730
|
paramsSerializer?: GeneratorMutator;
|
|
731
|
+
fetchReviver?: GeneratorMutator;
|
|
696
732
|
override: NormalizedOverrideOutput;
|
|
697
733
|
deprecated?: boolean;
|
|
698
734
|
originalOperation: OperationObject;
|
|
@@ -753,7 +789,7 @@ type ClientFooterBuilder = (params: {
|
|
|
753
789
|
hasMutator: boolean;
|
|
754
790
|
}) => string;
|
|
755
791
|
type ClientTitleBuilder = (title: string) => string;
|
|
756
|
-
type ClientDependenciesBuilder = (hasGlobalMutator: boolean, hasParamsSerializerOptions: boolean, packageJson?: PackageJson, httpClient?: OutputHttpClient, hasTagsMutator?: boolean) => GeneratorDependency[];
|
|
792
|
+
type ClientDependenciesBuilder = (hasGlobalMutator: boolean, hasParamsSerializerOptions: boolean, packageJson?: PackageJson, httpClient?: OutputHttpClient, hasTagsMutator?: boolean, override?: NormalizedOverrideOutput) => GeneratorDependency[];
|
|
757
793
|
type ClientMockGeneratorImplementation = {
|
|
758
794
|
function: string;
|
|
759
795
|
handlerName: string;
|
|
@@ -988,7 +1024,7 @@ declare const VERBS_WITH_BODY: Verbs[];
|
|
|
988
1024
|
declare const URL_REGEX: RegExp;
|
|
989
1025
|
declare const TEMPLATE_TAG_REGEX: RegExp;
|
|
990
1026
|
|
|
991
|
-
declare const generateComponentDefinition: (responses: ComponentsObject[
|
|
1027
|
+
declare const generateComponentDefinition: (responses: ComponentsObject["responses"] | ComponentsObject["requestBodies"], context: ContextSpecs, suffix: string) => GeneratorSchema[];
|
|
992
1028
|
|
|
993
1029
|
declare const generateImports: ({ imports, target, isRootKey, specsName, specKey: currentSpecKey, namingConvention, }: {
|
|
994
1030
|
imports: GeneratorImport[];
|
|
@@ -996,12 +1032,12 @@ declare const generateImports: ({ imports, target, isRootKey, specsName, specKey
|
|
|
996
1032
|
isRootKey: boolean;
|
|
997
1033
|
specsName: Record<string, string>;
|
|
998
1034
|
specKey: string;
|
|
999
|
-
namingConvention?: NamingConvention
|
|
1035
|
+
namingConvention?: NamingConvention;
|
|
1000
1036
|
}) => string;
|
|
1001
1037
|
declare const generateMutatorImports: ({ mutators, implementation, oneMore, }: {
|
|
1002
1038
|
mutators: GeneratorMutator[];
|
|
1003
|
-
implementation?: string
|
|
1004
|
-
oneMore?: boolean
|
|
1039
|
+
implementation?: string;
|
|
1040
|
+
oneMore?: boolean;
|
|
1005
1041
|
}) => string;
|
|
1006
1042
|
declare const addDependency: ({ implementation, exports, dependency, specsName, hasSchemaDir, isAllowSyntheticDefaultImports, }: {
|
|
1007
1043
|
implementation: string;
|
|
@@ -1022,67 +1058,67 @@ declare const generateModelsInline: (obj: Record<string, GeneratorSchema[]>) =>
|
|
|
1022
1058
|
|
|
1023
1059
|
declare const BODY_TYPE_NAME = "BodyType";
|
|
1024
1060
|
declare const generateMutator: ({ output, mutator, name, workspace, tsconfig, }: {
|
|
1025
|
-
output?: string
|
|
1026
|
-
mutator?: NormalizedMutator
|
|
1061
|
+
output?: string;
|
|
1062
|
+
mutator?: NormalizedMutator;
|
|
1027
1063
|
name: string;
|
|
1028
1064
|
workspace: string;
|
|
1029
|
-
tsconfig?: Tsconfig
|
|
1065
|
+
tsconfig?: Tsconfig;
|
|
1030
1066
|
}) => Promise<GeneratorMutator | undefined>;
|
|
1031
1067
|
|
|
1032
1068
|
declare const generateBodyOptions: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
1033
1069
|
declare const generateAxiosOptions: ({ response, isExactOptionalPropertyTypes, queryParams, headers, requestOptions, hasSignal, isVue, paramsSerializer, paramsSerializerOptions, }: {
|
|
1034
1070
|
response: GetterResponse;
|
|
1035
1071
|
isExactOptionalPropertyTypes: boolean;
|
|
1036
|
-
queryParams?: GeneratorSchema
|
|
1037
|
-
headers?: GeneratorSchema
|
|
1038
|
-
requestOptions?:
|
|
1072
|
+
queryParams?: GeneratorSchema;
|
|
1073
|
+
headers?: GeneratorSchema;
|
|
1074
|
+
requestOptions?: object | boolean;
|
|
1039
1075
|
hasSignal: boolean;
|
|
1040
1076
|
isVue: boolean;
|
|
1041
|
-
paramsSerializer?: GeneratorMutator
|
|
1042
|
-
paramsSerializerOptions?: ParamsSerializerOptions
|
|
1077
|
+
paramsSerializer?: GeneratorMutator;
|
|
1078
|
+
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
1043
1079
|
}) => string;
|
|
1044
1080
|
declare const generateOptions: ({ route, body, headers, queryParams, response, verb, requestOptions, isFormData, isFormUrlEncoded, isAngular, isExactOptionalPropertyTypes, hasSignal, isVue, paramsSerializer, paramsSerializerOptions, }: {
|
|
1045
1081
|
route: string;
|
|
1046
1082
|
body: GetterBody;
|
|
1047
|
-
headers?: GetterQueryParam
|
|
1048
|
-
queryParams?: GetterQueryParam
|
|
1083
|
+
headers?: GetterQueryParam;
|
|
1084
|
+
queryParams?: GetterQueryParam;
|
|
1049
1085
|
response: GetterResponse;
|
|
1050
1086
|
verb: Verbs;
|
|
1051
|
-
requestOptions?:
|
|
1087
|
+
requestOptions?: object | boolean;
|
|
1052
1088
|
isFormData: boolean;
|
|
1053
1089
|
isFormUrlEncoded: boolean;
|
|
1054
|
-
isAngular?: boolean
|
|
1090
|
+
isAngular?: boolean;
|
|
1055
1091
|
isExactOptionalPropertyTypes: boolean;
|
|
1056
1092
|
hasSignal: boolean;
|
|
1057
|
-
isVue?: boolean
|
|
1058
|
-
paramsSerializer?: GeneratorMutator
|
|
1059
|
-
paramsSerializerOptions?: ParamsSerializerOptions
|
|
1093
|
+
isVue?: boolean;
|
|
1094
|
+
paramsSerializer?: GeneratorMutator;
|
|
1095
|
+
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
1060
1096
|
}) => string;
|
|
1061
1097
|
declare const generateBodyMutatorConfig: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
1062
1098
|
declare const generateQueryParamsAxiosConfig: (response: GetterResponse, isVue: boolean, queryParams?: GetterQueryParam) => string;
|
|
1063
1099
|
declare const generateMutatorConfig: ({ route, body, headers, queryParams, response, verb, isFormData, isFormUrlEncoded, hasSignal, isExactOptionalPropertyTypes, isVue, }: {
|
|
1064
1100
|
route: string;
|
|
1065
1101
|
body: GetterBody;
|
|
1066
|
-
headers?: GetterQueryParam
|
|
1067
|
-
queryParams?: GetterQueryParam
|
|
1102
|
+
headers?: GetterQueryParam;
|
|
1103
|
+
queryParams?: GetterQueryParam;
|
|
1068
1104
|
response: GetterResponse;
|
|
1069
1105
|
verb: Verbs;
|
|
1070
1106
|
isFormData: boolean;
|
|
1071
1107
|
isFormUrlEncoded: boolean;
|
|
1072
1108
|
hasSignal: boolean;
|
|
1073
1109
|
isExactOptionalPropertyTypes: boolean;
|
|
1074
|
-
isVue?: boolean
|
|
1110
|
+
isVue?: boolean;
|
|
1075
1111
|
}) => string;
|
|
1076
1112
|
declare const generateMutatorRequestOptions: (requestOptions: boolean | object | undefined, hasSecondArgument: boolean) => string;
|
|
1077
1113
|
declare const generateFormDataAndUrlEncodedFunction: ({ body, formData, formUrlEncoded, isFormData, isFormUrlEncoded, }: {
|
|
1078
1114
|
body: GetterBody;
|
|
1079
|
-
formData?: GeneratorMutator
|
|
1080
|
-
formUrlEncoded?: GeneratorMutator
|
|
1115
|
+
formData?: GeneratorMutator;
|
|
1116
|
+
formUrlEncoded?: GeneratorMutator;
|
|
1081
1117
|
isFormData: boolean;
|
|
1082
1118
|
isFormUrlEncoded: boolean;
|
|
1083
1119
|
}) => string;
|
|
1084
1120
|
|
|
1085
|
-
declare const generateParameterDefinition: (parameters: ComponentsObject[
|
|
1121
|
+
declare const generateParameterDefinition: (parameters: ComponentsObject["parameters"], context: ContextSpecs, suffix: string) => GeneratorSchema[];
|
|
1086
1122
|
|
|
1087
1123
|
/**
|
|
1088
1124
|
* Extract all types from #/components/schemas
|
|
@@ -1099,7 +1135,7 @@ declare const generateVerbsOptions: ({ verbs, input, output, route, pathRoute, c
|
|
|
1099
1135
|
pathRoute: string;
|
|
1100
1136
|
context: ContextSpecs;
|
|
1101
1137
|
}) => Promise<GeneratorVerbsOptions>;
|
|
1102
|
-
declare const _filteredVerbs: (verbs: PathItemObject, filters: NormalizedInputOptions[
|
|
1138
|
+
declare const _filteredVerbs: (verbs: PathItemObject, filters: NormalizedInputOptions["filters"]) => [string, any][];
|
|
1103
1139
|
|
|
1104
1140
|
/**
|
|
1105
1141
|
* Return the output type from an array
|
|
@@ -1108,7 +1144,7 @@ declare const _filteredVerbs: (verbs: PathItemObject, filters: NormalizedInputOp
|
|
|
1108
1144
|
*/
|
|
1109
1145
|
declare const getArray: ({ schema, name, context, }: {
|
|
1110
1146
|
schema: SchemaObject;
|
|
1111
|
-
name?: string
|
|
1147
|
+
name?: string;
|
|
1112
1148
|
context: ContextSpecs;
|
|
1113
1149
|
}) => ScalarValue;
|
|
1114
1150
|
|
|
@@ -1116,12 +1152,12 @@ declare const getBody: ({ requestBody, operationName, context, contentType, }: {
|
|
|
1116
1152
|
requestBody: ReferenceObject | RequestBodyObject;
|
|
1117
1153
|
operationName: string;
|
|
1118
1154
|
context: ContextSpecs;
|
|
1119
|
-
contentType?: OverrideOutputContentType
|
|
1155
|
+
contentType?: OverrideOutputContentType;
|
|
1120
1156
|
}) => GetterBody;
|
|
1121
1157
|
|
|
1122
1158
|
type Separator = 'allOf' | 'anyOf' | 'oneOf';
|
|
1123
1159
|
declare const combineSchemas: ({ name, schema, separator, context, nullable, }: {
|
|
1124
|
-
name?: string
|
|
1160
|
+
name?: string;
|
|
1125
1161
|
schema: SchemaObject;
|
|
1126
1162
|
separator: Separator;
|
|
1127
1163
|
context: ContextSpecs;
|
|
@@ -1131,8 +1167,9 @@ declare const combineSchemas: ({ name, schema, separator, context, nullable, }:
|
|
|
1131
1167
|
declare const resolveDiscriminators: (schemas: SchemasObject, context: ContextSpecs) => SchemasObject;
|
|
1132
1168
|
|
|
1133
1169
|
declare const getEnumNames: (schemaObject: SchemaObject$1 | undefined) => any;
|
|
1134
|
-
declare const
|
|
1135
|
-
declare const
|
|
1170
|
+
declare const getEnumDescriptions: (schemaObject: SchemaObject$1 | undefined) => any;
|
|
1171
|
+
declare const getEnum: (value: string, enumName: string, names: string[] | undefined, enumGenerationType: EnumGeneration, descriptions?: string[], enumNamingConvention?: NamingConvention) => string;
|
|
1172
|
+
declare const getEnumImplementation: (value: string, names?: string[], descriptions?: string[], enumNamingConvention?: NamingConvention) => string;
|
|
1136
1173
|
|
|
1137
1174
|
declare const getKey: (key: string) => string;
|
|
1138
1175
|
|
|
@@ -1143,7 +1180,7 @@ declare const getKey: (key: string) => string;
|
|
|
1143
1180
|
*/
|
|
1144
1181
|
declare const getObject: ({ item, name, context, nullable, }: {
|
|
1145
1182
|
item: SchemaObject;
|
|
1146
|
-
name?: string
|
|
1183
|
+
name?: string;
|
|
1147
1184
|
context: ContextSpecs;
|
|
1148
1185
|
nullable: string;
|
|
1149
1186
|
}) => ScalarValue;
|
|
@@ -1168,10 +1205,7 @@ declare const getParameters: ({ parameters, context, }: {
|
|
|
1168
1205
|
declare const getParamsInPath: (path: string) => string[];
|
|
1169
1206
|
declare const getParams: ({ route, pathParams, operationId, context, output, }: {
|
|
1170
1207
|
route: string;
|
|
1171
|
-
pathParams?:
|
|
1172
|
-
parameter: openapi3_ts_oas30.ParameterObject;
|
|
1173
|
-
imports: GeneratorImport[];
|
|
1174
|
-
}[] | undefined;
|
|
1208
|
+
pathParams?: GetterParameters["query"];
|
|
1175
1209
|
operationId: string;
|
|
1176
1210
|
context: ContextSpecs;
|
|
1177
1211
|
output: NormalizedOutputOptions;
|
|
@@ -1179,18 +1213,18 @@ declare const getParams: ({ route, pathParams, operationId, context, output, }:
|
|
|
1179
1213
|
|
|
1180
1214
|
declare const getProps: ({ body, queryParams, params, operationName, headers, context, }: {
|
|
1181
1215
|
body: GetterBody;
|
|
1182
|
-
queryParams?: GetterQueryParam
|
|
1216
|
+
queryParams?: GetterQueryParam;
|
|
1183
1217
|
params: GetterParams;
|
|
1184
1218
|
operationName: string;
|
|
1185
|
-
headers?: GetterQueryParam
|
|
1219
|
+
headers?: GetterQueryParam;
|
|
1186
1220
|
context: ContextSpecs;
|
|
1187
1221
|
}) => GetterProps;
|
|
1188
1222
|
|
|
1189
1223
|
declare const getQueryParams: ({ queryParams, operationName, context, suffix, }: {
|
|
1190
|
-
queryParams: GetterParameters[
|
|
1224
|
+
queryParams: GetterParameters["query"];
|
|
1191
1225
|
operationName: string;
|
|
1192
1226
|
context: ContextSpecs;
|
|
1193
|
-
suffix?: string
|
|
1227
|
+
suffix?: string;
|
|
1194
1228
|
}) => GetterQueryParam | undefined;
|
|
1195
1229
|
|
|
1196
1230
|
type RefComponent = 'schemas' | 'responses' | 'parameters' | 'requestBodies';
|
|
@@ -1212,18 +1246,15 @@ interface RefInfo {
|
|
|
1212
1246
|
*
|
|
1213
1247
|
* @param $ref
|
|
1214
1248
|
*/
|
|
1215
|
-
declare const getRefInfo: ($ref: ReferenceObject[
|
|
1249
|
+
declare const getRefInfo: ($ref: ReferenceObject["$ref"], context: ContextSpecs) => RefInfo;
|
|
1216
1250
|
|
|
1217
|
-
declare const getResReqTypes: (responsesOrRequests: Array<[
|
|
1218
|
-
string,
|
|
1219
|
-
ResponseObject | ReferenceObject | RequestBodyObject
|
|
1220
|
-
]>, name: string, context: ContextSpecs, defaultType?: string, uniqueKey?: ValueIteratee<ResReqTypesValue>) => ResReqTypesValue[];
|
|
1251
|
+
declare const getResReqTypes: (responsesOrRequests: Array<[string, ResponseObject | ReferenceObject | RequestBodyObject]>, name: string, context: ContextSpecs, defaultType?: string, uniqueKey?: ValueIteratee<ResReqTypesValue>) => ResReqTypesValue[];
|
|
1221
1252
|
|
|
1222
1253
|
declare const getResponse: ({ responses, operationName, context, contentType, }: {
|
|
1223
1254
|
responses: ResponsesObject;
|
|
1224
1255
|
operationName: string;
|
|
1225
1256
|
context: ContextSpecs;
|
|
1226
|
-
contentType?: OverrideOutputContentType
|
|
1257
|
+
contentType?: OverrideOutputContentType;
|
|
1227
1258
|
}) => GetterResponse;
|
|
1228
1259
|
|
|
1229
1260
|
declare const getRoute: (route: string) => string;
|
|
@@ -1238,14 +1269,14 @@ declare const getRouteAsArray: (route: string) => string;
|
|
|
1238
1269
|
*/
|
|
1239
1270
|
declare const getScalar: ({ item, name, context, }: {
|
|
1240
1271
|
item: SchemaObject;
|
|
1241
|
-
name?: string
|
|
1272
|
+
name?: string;
|
|
1242
1273
|
context: ContextSpecs;
|
|
1243
1274
|
}) => ScalarValue;
|
|
1244
1275
|
|
|
1245
1276
|
declare const resolveObject: ({ schema, propName, combined, context, }: {
|
|
1246
1277
|
schema: SchemaObject | ReferenceObject;
|
|
1247
|
-
propName?: string
|
|
1248
|
-
combined?: boolean
|
|
1278
|
+
propName?: string;
|
|
1279
|
+
combined?: boolean;
|
|
1249
1280
|
context: ContextSpecs;
|
|
1250
1281
|
}) => ResolverValue;
|
|
1251
1282
|
|
|
@@ -1260,7 +1291,7 @@ declare const resolveExampleRefs: (examples: Examples, context: ContextSpecs) =>
|
|
|
1260
1291
|
|
|
1261
1292
|
declare const resolveValue: ({ schema, name, context, }: {
|
|
1262
1293
|
schema: SchemaObject | ReferenceObject;
|
|
1263
|
-
name?: string
|
|
1294
|
+
name?: string;
|
|
1264
1295
|
context: ContextSpecs;
|
|
1265
1296
|
}) => ResolverValue;
|
|
1266
1297
|
|
|
@@ -1301,7 +1332,7 @@ interface DebuggerOptions {
|
|
|
1301
1332
|
}
|
|
1302
1333
|
declare function createDebugger(ns: string, options?: DebuggerOptions): debug.Debugger['log'];
|
|
1303
1334
|
|
|
1304
|
-
declare function jsDoc(
|
|
1335
|
+
declare function jsDoc(schema: {
|
|
1305
1336
|
description?: string[] | string;
|
|
1306
1337
|
deprecated?: boolean;
|
|
1307
1338
|
summary?: string;
|
|
@@ -1315,9 +1346,13 @@ declare function jsDoc({ description, deprecated, summary, minLength, maxLength,
|
|
|
1315
1346
|
maxItems?: number;
|
|
1316
1347
|
nullable?: boolean;
|
|
1317
1348
|
pattern?: string;
|
|
1318
|
-
}, tryOneLine?: boolean): string;
|
|
1349
|
+
}, tryOneLine?: boolean, context?: ContextSpecs): string;
|
|
1350
|
+
declare function keyValuePairsToJsDoc(keyValues: {
|
|
1351
|
+
key: string;
|
|
1352
|
+
value: string;
|
|
1353
|
+
}[]): string;
|
|
1319
1354
|
|
|
1320
|
-
declare const dynamicImport: <T>(toImport:
|
|
1355
|
+
declare const dynamicImport: <T>(toImport: T | string, from?: string, takeDefault?: boolean) => Promise<T>;
|
|
1321
1356
|
|
|
1322
1357
|
declare const getExtension: (path: string) => "yaml" | "json";
|
|
1323
1358
|
|
|
@@ -1363,8 +1398,8 @@ interface LoggerOptions {
|
|
|
1363
1398
|
declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
|
|
1364
1399
|
|
|
1365
1400
|
declare const getFileInfo: (target?: string, { backupFilename, extension, }?: {
|
|
1366
|
-
backupFilename?: string
|
|
1367
|
-
extension?: string
|
|
1401
|
+
backupFilename?: string;
|
|
1402
|
+
extension?: string;
|
|
1368
1403
|
}) => {
|
|
1369
1404
|
path: string;
|
|
1370
1405
|
pathWithoutExtension: string;
|
|
@@ -1401,7 +1436,7 @@ declare const join: (...paths: string[]) => string;
|
|
|
1401
1436
|
declare const resolve: (...paths: string[]) => string;
|
|
1402
1437
|
declare const extname: (path: string) => string;
|
|
1403
1438
|
declare const dirname: (path: string) => string;
|
|
1404
|
-
declare const basename: (path: string, suffix?: string
|
|
1439
|
+
declare const basename: (path: string, suffix?: string) => string;
|
|
1405
1440
|
declare const isAbsolute: (path: string) => boolean;
|
|
1406
1441
|
|
|
1407
1442
|
/**
|
|
@@ -1431,16 +1466,16 @@ declare namespace path {
|
|
|
1431
1466
|
}
|
|
1432
1467
|
|
|
1433
1468
|
declare const sortByPriority: <T>(arr: (T & {
|
|
1434
|
-
default?: boolean
|
|
1435
|
-
required?: boolean
|
|
1469
|
+
default?: boolean;
|
|
1470
|
+
required?: boolean;
|
|
1436
1471
|
})[]) => (T & {
|
|
1437
|
-
default?: boolean
|
|
1438
|
-
required?: boolean
|
|
1472
|
+
default?: boolean;
|
|
1473
|
+
required?: boolean;
|
|
1439
1474
|
})[];
|
|
1440
1475
|
|
|
1441
1476
|
declare const stringify: (data?: string | any[] | {
|
|
1442
1477
|
[key: string]: any;
|
|
1443
|
-
}
|
|
1478
|
+
}) => string | undefined;
|
|
1444
1479
|
declare const sanitize: (value: string, options?: {
|
|
1445
1480
|
whitespace?: string | true;
|
|
1446
1481
|
underscore?: string | true;
|
|
@@ -1450,7 +1485,7 @@ declare const sanitize: (value: string, options?: {
|
|
|
1450
1485
|
es5IdentifierName?: boolean;
|
|
1451
1486
|
special?: boolean;
|
|
1452
1487
|
}) => string;
|
|
1453
|
-
declare const toObjectString: <T>(props: T[], path?: keyof T
|
|
1488
|
+
declare const toObjectString: <T>(props: T[], path?: keyof T) => string;
|
|
1454
1489
|
declare const getNumberWord: (num: number) => string;
|
|
1455
1490
|
declare const escape: (str: string | null, char?: string) => string | undefined;
|
|
1456
1491
|
/**
|
|
@@ -1502,6 +1537,7 @@ declare const writeSchemas: ({ schemaPath, schemas, target, namingConvention, fi
|
|
|
1502
1537
|
}) => Promise<void>;
|
|
1503
1538
|
|
|
1504
1539
|
declare const getOrvalGeneratedTypes: () => string;
|
|
1540
|
+
declare const getTypedResponse: () => string;
|
|
1505
1541
|
|
|
1506
1542
|
declare const writeSingleMode: ({ builder, output, specsName, header, needSchema, }: WriteModeProps) => Promise<string[]>;
|
|
1507
1543
|
|
|
@@ -1515,4 +1551,4 @@ declare const generateTarget: (builder: WriteSpecsBuilder, options: NormalizedOu
|
|
|
1515
1551
|
|
|
1516
1552
|
declare const generateTargetForTags: (builder: WriteSpecsBuilder, options: NormalizedOutputOptions) => Record<string, GeneratorTarget>;
|
|
1517
1553
|
|
|
1518
|
-
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 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 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 };
|
|
1554
|
+
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, type ZodTimeOptions, _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, getTypedResponse, 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 };
|