@orval/core 7.7.0 → 7.9.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 +49 -7
- package/dist/index.js +134 -63
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import * as openapi3_ts_oas30 from 'openapi3-ts/oas30';
|
|
|
4
4
|
import { InfoObject, OperationObject, OpenAPIObject, ResponsesObject, ReferenceObject, RequestBodyObject, ParameterObject, SchemaObject, ComponentsObject, SchemasObject, PathItemObject, ResponseObject, ExampleObject } from 'openapi3-ts/oas30';
|
|
5
5
|
import swagger2openapi from 'swagger2openapi';
|
|
6
6
|
import { TypeDocOptions } from 'typedoc';
|
|
7
|
+
import { SchemaObject as SchemaObject$1 } from 'openapi3-ts/dist/model/openapi30';
|
|
7
8
|
import { ValueIteratee } from 'lodash';
|
|
8
9
|
import { ServerObject } from 'openapi3-ts/oas31';
|
|
9
10
|
import { CompareOperator } from 'compare-versions';
|
|
@@ -72,7 +73,7 @@ type NormalizedOverrideOutput = {
|
|
|
72
73
|
mock?: OverrideMockOptions;
|
|
73
74
|
contentType?: OverrideOutputContentType;
|
|
74
75
|
header: false | ((info: InfoObject) => string[] | string);
|
|
75
|
-
formData:
|
|
76
|
+
formData: NormalizedFormDataType<NormalizedMutator>;
|
|
76
77
|
formUrlEncoded: boolean | NormalizedMutator;
|
|
77
78
|
paramsSerializer?: NormalizedMutator;
|
|
78
79
|
paramsSerializerOptions?: NormalizedParamsSerializerOptions;
|
|
@@ -105,7 +106,7 @@ type NormalizedOverrideOutput = {
|
|
|
105
106
|
useDeprecatedOperations?: boolean;
|
|
106
107
|
useBigInt?: boolean;
|
|
107
108
|
useNamedParameters?: boolean;
|
|
108
|
-
|
|
109
|
+
enumGenerationType: EnumGeneration;
|
|
109
110
|
suppressReadonlyModifier?: boolean;
|
|
110
111
|
};
|
|
111
112
|
type NormalizedMutator = {
|
|
@@ -129,7 +130,7 @@ type NormalizedOperationOptions = {
|
|
|
129
130
|
zod?: NormalizedZodOptions;
|
|
130
131
|
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
131
132
|
fetch?: FetchOptions;
|
|
132
|
-
formData?:
|
|
133
|
+
formData?: NormalizedFormDataType<NormalizedMutator>;
|
|
133
134
|
formUrlEncoded?: boolean | NormalizedMutator;
|
|
134
135
|
paramsSerializer?: NormalizedMutator;
|
|
135
136
|
requestOptions?: object | boolean;
|
|
@@ -169,6 +170,12 @@ declare const NamingConvention: {
|
|
|
169
170
|
readonly KEBAB_CASE: "kebab-case";
|
|
170
171
|
};
|
|
171
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];
|
|
172
179
|
type OutputOptions = {
|
|
173
180
|
workspace?: string;
|
|
174
181
|
target?: string;
|
|
@@ -223,6 +230,7 @@ declare const OutputClient: {
|
|
|
223
230
|
readonly ZOD: "zod";
|
|
224
231
|
readonly HONO: "hono";
|
|
225
232
|
readonly FETCH: "fetch";
|
|
233
|
+
readonly MCP: "mcp";
|
|
226
234
|
};
|
|
227
235
|
type OutputClient = (typeof OutputClient)[keyof typeof OutputClient];
|
|
228
236
|
declare const OutputHttpClient: {
|
|
@@ -295,6 +303,28 @@ type Mutator = string | MutatorObject;
|
|
|
295
303
|
type ParamsSerializerOptions = {
|
|
296
304
|
qs?: Record<string, any>;
|
|
297
305
|
};
|
|
306
|
+
declare const FormDataArrayHandling: {
|
|
307
|
+
readonly SERIALIZE: "serialize";
|
|
308
|
+
readonly EXPLODE: "explode";
|
|
309
|
+
readonly SERIALIZE_WITH_BRACKETS: "serialize-with-brackets";
|
|
310
|
+
};
|
|
311
|
+
type FormDataArrayHandling = (typeof FormDataArrayHandling)[keyof typeof FormDataArrayHandling];
|
|
312
|
+
type NormalizedFormDataType<TMutator> = {
|
|
313
|
+
disabled: true;
|
|
314
|
+
mutator?: never;
|
|
315
|
+
arrayHandling: FormDataArrayHandling;
|
|
316
|
+
} | {
|
|
317
|
+
disabled: false;
|
|
318
|
+
mutator?: TMutator;
|
|
319
|
+
arrayHandling: FormDataArrayHandling;
|
|
320
|
+
};
|
|
321
|
+
type FormDataType<TMutator> = {
|
|
322
|
+
mutator: TMutator;
|
|
323
|
+
arrayHandling?: FormDataArrayHandling;
|
|
324
|
+
} | {
|
|
325
|
+
mutator?: TMutator;
|
|
326
|
+
arrayHandling: FormDataArrayHandling;
|
|
327
|
+
};
|
|
298
328
|
type OverrideOutput = {
|
|
299
329
|
title?: (title: string) => string;
|
|
300
330
|
transformer?: OutputTransformer;
|
|
@@ -308,7 +338,7 @@ type OverrideOutput = {
|
|
|
308
338
|
mock?: OverrideMockOptions;
|
|
309
339
|
contentType?: OverrideOutputContentType;
|
|
310
340
|
header?: boolean | ((info: InfoObject) => string[] | string);
|
|
311
|
-
formData?: boolean | Mutator
|
|
341
|
+
formData?: boolean | Mutator | FormDataType<Mutator>;
|
|
312
342
|
formUrlEncoded?: boolean | Mutator;
|
|
313
343
|
paramsSerializer?: Mutator;
|
|
314
344
|
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
@@ -340,7 +370,11 @@ type OverrideOutput = {
|
|
|
340
370
|
useDeprecatedOperations?: boolean;
|
|
341
371
|
useBigInt?: boolean;
|
|
342
372
|
useNamedParameters?: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* @deprecated use 'enumGenerationType="enum"' instead
|
|
375
|
+
*/
|
|
343
376
|
useNativeEnums?: boolean;
|
|
377
|
+
enumGenerationType?: EnumGeneration;
|
|
344
378
|
suppressReadonlyModifier?: boolean;
|
|
345
379
|
};
|
|
346
380
|
type OverrideOutputContentType = {
|
|
@@ -353,6 +387,11 @@ type NormalizedHonoOptions = {
|
|
|
353
387
|
validator: boolean | 'hono';
|
|
354
388
|
validatorOutputPath: string;
|
|
355
389
|
};
|
|
390
|
+
type ZodDateTimeOptions = {
|
|
391
|
+
offset?: boolean;
|
|
392
|
+
local?: boolean;
|
|
393
|
+
precision?: number;
|
|
394
|
+
};
|
|
356
395
|
type ZodOptions = {
|
|
357
396
|
strict?: {
|
|
358
397
|
param?: boolean;
|
|
@@ -382,6 +421,7 @@ type ZodOptions = {
|
|
|
382
421
|
body?: Mutator;
|
|
383
422
|
response?: Mutator;
|
|
384
423
|
};
|
|
424
|
+
dateTimeOptions?: ZodDateTimeOptions;
|
|
385
425
|
generateEachHttpStatus?: boolean;
|
|
386
426
|
};
|
|
387
427
|
type ZodCoerceType = 'string' | 'number' | 'boolean' | 'bigint' | 'date';
|
|
@@ -415,6 +455,7 @@ type NormalizedZodOptions = {
|
|
|
415
455
|
response?: NormalizedMutator;
|
|
416
456
|
};
|
|
417
457
|
generateEachHttpStatus: boolean;
|
|
458
|
+
dateTimeOptions: ZodDateTimeOptions;
|
|
418
459
|
};
|
|
419
460
|
type HonoOptions = {
|
|
420
461
|
handlers?: string;
|
|
@@ -490,7 +531,7 @@ type OperationOptions = {
|
|
|
490
531
|
zod?: ZodOptions;
|
|
491
532
|
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
492
533
|
fetch?: FetchOptions;
|
|
493
|
-
formData?: boolean | Mutator
|
|
534
|
+
formData?: boolean | Mutator | FormDataType<Mutator>;
|
|
494
535
|
formUrlEncoded?: boolean | Mutator;
|
|
495
536
|
paramsSerializer?: Mutator;
|
|
496
537
|
requestOptions?: object | boolean;
|
|
@@ -1089,7 +1130,8 @@ declare const combineSchemas: ({ name, schema, separator, context, nullable, }:
|
|
|
1089
1130
|
|
|
1090
1131
|
declare const resolveDiscriminators: (schemas: SchemasObject, context: ContextSpecs) => SchemasObject;
|
|
1091
1132
|
|
|
1092
|
-
declare const
|
|
1133
|
+
declare const getEnumNames: (schemaObject: SchemaObject$1 | undefined) => any;
|
|
1134
|
+
declare const getEnum: (value: string, enumName: string, names: string[] | undefined, enumGenerationType: EnumGeneration) => string;
|
|
1093
1135
|
declare const getEnumImplementation: (value: string, names?: string[]) => string;
|
|
1094
1136
|
|
|
1095
1137
|
declare const getKey: (key: string) => string;
|
|
@@ -1473,4 +1515,4 @@ declare const generateTarget: (builder: WriteSpecsBuilder, options: NormalizedOu
|
|
|
1473
1515
|
|
|
1474
1516
|
declare const generateTargetForTags: (builder: WriteSpecsBuilder, options: NormalizedOutputOptions) => Record<string, GeneratorTarget>;
|
|
1475
1517
|
|
|
1476
|
-
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 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, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -4682,7 +4682,7 @@ var require_lodash = __commonJS({
|
|
|
4682
4682
|
function isArrayLikeObject(value) {
|
|
4683
4683
|
return isObjectLike(value) && isArrayLike(value);
|
|
4684
4684
|
}
|
|
4685
|
-
function
|
|
4685
|
+
function isBoolean3(value) {
|
|
4686
4686
|
return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
|
|
4687
4687
|
}
|
|
4688
4688
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
@@ -5819,7 +5819,7 @@ var require_lodash = __commonJS({
|
|
|
5819
5819
|
lodash.isArrayBuffer = isArrayBuffer;
|
|
5820
5820
|
lodash.isArrayLike = isArrayLike;
|
|
5821
5821
|
lodash.isArrayLikeObject = isArrayLikeObject;
|
|
5822
|
-
lodash.isBoolean =
|
|
5822
|
+
lodash.isBoolean = isBoolean3;
|
|
5823
5823
|
lodash.isBuffer = isBuffer;
|
|
5824
5824
|
lodash.isDate = isDate;
|
|
5825
5825
|
lodash.isElement = isElement;
|
|
@@ -9475,14 +9475,14 @@ var require_bool = __commonJS({
|
|
|
9475
9475
|
function constructYamlBoolean(data) {
|
|
9476
9476
|
return data === "true" || data === "True" || data === "TRUE";
|
|
9477
9477
|
}
|
|
9478
|
-
function
|
|
9478
|
+
function isBoolean3(object) {
|
|
9479
9479
|
return "[object Boolean]" === Object.prototype.toString.call(object);
|
|
9480
9480
|
}
|
|
9481
9481
|
module2.exports = new type_1.Type("tag:yaml.org,2002:bool", {
|
|
9482
9482
|
kind: "scalar",
|
|
9483
9483
|
resolve: resolveYamlBoolean,
|
|
9484
9484
|
construct: constructYamlBoolean,
|
|
9485
|
-
predicate:
|
|
9485
|
+
predicate: isBoolean3,
|
|
9486
9486
|
represent: {
|
|
9487
9487
|
lowercase: function(object) {
|
|
9488
9488
|
return object ? "true" : "false";
|
|
@@ -31107,7 +31107,7 @@ var require_index_node_cjs = __commonJS({
|
|
|
31107
31107
|
* @returns {string}
|
|
31108
31108
|
*/
|
|
31109
31109
|
static get version() {
|
|
31110
|
-
return "1.
|
|
31110
|
+
return "1.4.0";
|
|
31111
31111
|
}
|
|
31112
31112
|
/**
|
|
31113
31113
|
* @returns {string}
|
|
@@ -31890,6 +31890,7 @@ var require_index_node_cjs = __commonJS({
|
|
|
31890
31890
|
// see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)
|
|
31891
31891
|
binary_ops: {
|
|
31892
31892
|
"||": 1,
|
|
31893
|
+
"??": 1,
|
|
31893
31894
|
"&&": 2,
|
|
31894
31895
|
"|": 3,
|
|
31895
31896
|
"^": 4,
|
|
@@ -31909,10 +31910,11 @@ var require_index_node_cjs = __commonJS({
|
|
|
31909
31910
|
"-": 9,
|
|
31910
31911
|
"*": 10,
|
|
31911
31912
|
"/": 10,
|
|
31912
|
-
"%": 10
|
|
31913
|
+
"%": 10,
|
|
31914
|
+
"**": 11
|
|
31913
31915
|
},
|
|
31914
31916
|
// sets specific binary_ops as right-associative
|
|
31915
|
-
right_associative: /* @__PURE__ */ new Set(),
|
|
31917
|
+
right_associative: /* @__PURE__ */ new Set(["**"]),
|
|
31916
31918
|
// Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char)
|
|
31917
31919
|
additional_identifier_chars: /* @__PURE__ */ new Set(["$", "_"]),
|
|
31918
31920
|
// Literals
|
|
@@ -32028,7 +32030,7 @@ var require_index_node_cjs = __commonJS({
|
|
|
32028
32030
|
var MINUS_CODE = 45;
|
|
32029
32031
|
var plugin = {
|
|
32030
32032
|
name: "assignment",
|
|
32031
|
-
assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|="]),
|
|
32033
|
+
assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "||=", "&&=", "??="]),
|
|
32032
32034
|
updateOperators: [PLUS_CODE, MINUS_CODE],
|
|
32033
32035
|
assignmentPrecedence: 0.9,
|
|
32034
32036
|
init(jsep2) {
|
|
@@ -32090,6 +32092,7 @@ var require_index_node_cjs = __commonJS({
|
|
|
32090
32092
|
jsep.addUnaryOp("typeof");
|
|
32091
32093
|
jsep.addLiteral("null", null);
|
|
32092
32094
|
jsep.addLiteral("undefined", void 0);
|
|
32095
|
+
var BLOCKED_PROTO_PROPERTIES = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__"]);
|
|
32093
32096
|
var SafeEval = {
|
|
32094
32097
|
/**
|
|
32095
32098
|
* @param {jsep.Expression} ast
|
|
@@ -32168,7 +32171,7 @@ var require_index_node_cjs = __commonJS({
|
|
|
32168
32171
|
return SafeEval.evalAst(ast.alternate, subs);
|
|
32169
32172
|
},
|
|
32170
32173
|
evalIdentifier(ast, subs) {
|
|
32171
|
-
if (ast.name
|
|
32174
|
+
if (Object.hasOwn(subs, ast.name)) {
|
|
32172
32175
|
return subs[ast.name];
|
|
32173
32176
|
}
|
|
32174
32177
|
throw ReferenceError(`${ast.name} is not defined`);
|
|
@@ -32177,22 +32180,22 @@ var require_index_node_cjs = __commonJS({
|
|
|
32177
32180
|
return ast.value;
|
|
32178
32181
|
},
|
|
32179
32182
|
evalMemberExpression(ast, subs) {
|
|
32180
|
-
|
|
32181
|
-
|
|
32182
|
-
|
|
32183
|
-
|
|
32183
|
+
const prop = String(
|
|
32184
|
+
// NOTE: `String(value)` throws error when
|
|
32185
|
+
// value has overwritten the toString method to return non-string
|
|
32186
|
+
// i.e. `value = {toString: () => []}`
|
|
32187
|
+
ast.computed ? SafeEval.evalAst(ast.property) : ast.property.name
|
|
32188
|
+
// `object.property` property is Identifier
|
|
32189
|
+
);
|
|
32184
32190
|
const obj = SafeEval.evalAst(ast.object, subs);
|
|
32191
|
+
if (obj === void 0 || obj === null) {
|
|
32192
|
+
throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`);
|
|
32193
|
+
}
|
|
32194
|
+
if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) {
|
|
32195
|
+
throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`);
|
|
32196
|
+
}
|
|
32185
32197
|
const result = obj[prop];
|
|
32186
32198
|
if (typeof result === "function") {
|
|
32187
|
-
if (obj === Function && prop === "bind") {
|
|
32188
|
-
throw new Error("Function.prototype.bind is disabled");
|
|
32189
|
-
}
|
|
32190
|
-
if (obj === Function && (prop === "call" || prop === "apply")) {
|
|
32191
|
-
throw new Error("Function.prototype.call and Function.prototype.apply are disabled");
|
|
32192
|
-
}
|
|
32193
|
-
if (result === Function) {
|
|
32194
|
-
return result;
|
|
32195
|
-
}
|
|
32196
32199
|
return result.bind(obj);
|
|
32197
32200
|
}
|
|
32198
32201
|
return result;
|
|
@@ -32214,9 +32217,6 @@ var require_index_node_cjs = __commonJS({
|
|
|
32214
32217
|
evalCallExpression(ast, subs) {
|
|
32215
32218
|
const args = ast.arguments.map((arg) => SafeEval.evalAst(arg, subs));
|
|
32216
32219
|
const func = SafeEval.evalAst(ast.callee, subs);
|
|
32217
|
-
if (func === Function) {
|
|
32218
|
-
throw new Error("Function constructor is disabled");
|
|
32219
|
-
}
|
|
32220
32220
|
return func(...args);
|
|
32221
32221
|
},
|
|
32222
32222
|
evalAssignmentExpression(ast, subs) {
|
|
@@ -32224,9 +32224,6 @@ var require_index_node_cjs = __commonJS({
|
|
|
32224
32224
|
throw SyntaxError("Invalid left-hand side in assignment");
|
|
32225
32225
|
}
|
|
32226
32226
|
const id = ast.left.name;
|
|
32227
|
-
if (id === "__proto__") {
|
|
32228
|
-
throw new Error("Assignment to __proto__ is disabled");
|
|
32229
|
-
}
|
|
32230
32227
|
const value = SafeEval.evalAst(ast.right, subs);
|
|
32231
32228
|
subs[id] = value;
|
|
32232
32229
|
return subs[id];
|
|
@@ -32246,9 +32243,7 @@ var require_index_node_cjs = __commonJS({
|
|
|
32246
32243
|
* @returns {EvaluatedResult} Result of evaluated code
|
|
32247
32244
|
*/
|
|
32248
32245
|
runInNewContext(context) {
|
|
32249
|
-
const keyMap =
|
|
32250
|
-
...context
|
|
32251
|
-
};
|
|
32246
|
+
const keyMap = Object.assign(/* @__PURE__ */ Object.create(null), context);
|
|
32252
32247
|
return SafeEval.evalAst(this.ast, keyMap);
|
|
32253
32248
|
}
|
|
32254
32249
|
};
|
|
@@ -45732,7 +45727,7 @@ var require_object_inspect = __commonJS({
|
|
|
45732
45727
|
if (isBigInt(obj)) {
|
|
45733
45728
|
return markBoxed(inspect(bigIntValueOf.call(obj)));
|
|
45734
45729
|
}
|
|
45735
|
-
if (
|
|
45730
|
+
if (isBoolean3(obj)) {
|
|
45736
45731
|
return markBoxed(booleanValueOf.call(obj));
|
|
45737
45732
|
}
|
|
45738
45733
|
if (isString3(obj)) {
|
|
@@ -45786,7 +45781,7 @@ var require_object_inspect = __commonJS({
|
|
|
45786
45781
|
function isNumber2(obj) {
|
|
45787
45782
|
return toStr(obj) === "[object Number]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj));
|
|
45788
45783
|
}
|
|
45789
|
-
function
|
|
45784
|
+
function isBoolean3(obj) {
|
|
45790
45785
|
return toStr(obj) === "[object Boolean]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj));
|
|
45791
45786
|
}
|
|
45792
45787
|
function isSymbol(obj) {
|
|
@@ -48117,6 +48112,8 @@ var require_dist10 = __commonJS({
|
|
|
48117
48112
|
var src_exports = {};
|
|
48118
48113
|
__export(src_exports, {
|
|
48119
48114
|
BODY_TYPE_NAME: () => BODY_TYPE_NAME,
|
|
48115
|
+
EnumGeneration: () => EnumGeneration,
|
|
48116
|
+
FormDataArrayHandling: () => FormDataArrayHandling,
|
|
48120
48117
|
GetterPropType: () => GetterPropType,
|
|
48121
48118
|
LogLevels: () => LogLevels,
|
|
48122
48119
|
NamingConvention: () => NamingConvention,
|
|
@@ -48171,6 +48168,7 @@ __export(src_exports, {
|
|
|
48171
48168
|
getBody: () => getBody,
|
|
48172
48169
|
getEnum: () => getEnum,
|
|
48173
48170
|
getEnumImplementation: () => getEnumImplementation,
|
|
48171
|
+
getEnumNames: () => getEnumNames,
|
|
48174
48172
|
getExtension: () => getExtension,
|
|
48175
48173
|
getFileInfo: () => getFileInfo,
|
|
48176
48174
|
getFullRoute: () => getFullRoute,
|
|
@@ -48257,6 +48255,11 @@ var NamingConvention = {
|
|
|
48257
48255
|
SNAKE_CASE: "snake_case",
|
|
48258
48256
|
KEBAB_CASE: "kebab-case"
|
|
48259
48257
|
};
|
|
48258
|
+
var EnumGeneration = {
|
|
48259
|
+
CONST: "const",
|
|
48260
|
+
ENUM: "enum",
|
|
48261
|
+
UNION: "union"
|
|
48262
|
+
};
|
|
48260
48263
|
var OutputClient = {
|
|
48261
48264
|
ANGULAR: "angular",
|
|
48262
48265
|
AXIOS: "axios",
|
|
@@ -48267,7 +48270,8 @@ var OutputClient = {
|
|
|
48267
48270
|
SWR: "swr",
|
|
48268
48271
|
ZOD: "zod",
|
|
48269
48272
|
HONO: "hono",
|
|
48270
|
-
FETCH: "fetch"
|
|
48273
|
+
FETCH: "fetch",
|
|
48274
|
+
MCP: "mcp"
|
|
48271
48275
|
};
|
|
48272
48276
|
var OutputHttpClient = {
|
|
48273
48277
|
AXIOS: "axios",
|
|
@@ -48282,6 +48286,11 @@ var OutputMode = {
|
|
|
48282
48286
|
var OutputMockType = {
|
|
48283
48287
|
MSW: "msw"
|
|
48284
48288
|
};
|
|
48289
|
+
var FormDataArrayHandling = {
|
|
48290
|
+
SERIALIZE: "serialize",
|
|
48291
|
+
EXPLODE: "explode",
|
|
48292
|
+
SERIALIZE_WITH_BRACKETS: "serialize-with-brackets"
|
|
48293
|
+
};
|
|
48285
48294
|
var Verbs = {
|
|
48286
48295
|
POST: "post",
|
|
48287
48296
|
PUT: "put",
|
|
@@ -49419,9 +49428,17 @@ var ibmOpenapiValidator = async (specs, validation) => {
|
|
|
49419
49428
|
var getIsBodyVerb = (verb) => VERBS_WITH_BODY.includes(verb);
|
|
49420
49429
|
|
|
49421
49430
|
// src/getters/enum.ts
|
|
49422
|
-
var
|
|
49423
|
-
|
|
49424
|
-
|
|
49431
|
+
var getEnumNames = (schemaObject) => {
|
|
49432
|
+
return schemaObject?.["x-enumNames"] || schemaObject?.["x-enumnames"] || schemaObject?.["x-enum-varnames"];
|
|
49433
|
+
};
|
|
49434
|
+
var getEnum = (value, enumName, names, enumGenerationType) => {
|
|
49435
|
+
if (enumGenerationType === EnumGeneration.CONST)
|
|
49436
|
+
return getTypeConstEnum(value, enumName, names);
|
|
49437
|
+
if (enumGenerationType === EnumGeneration.ENUM)
|
|
49438
|
+
return getNativeEnum(value, enumName, names);
|
|
49439
|
+
if (enumGenerationType === EnumGeneration.UNION)
|
|
49440
|
+
return getUnion(value, enumName);
|
|
49441
|
+
throw new Error(`Invalid enumGenerationType: ${enumGenerationType}`);
|
|
49425
49442
|
};
|
|
49426
49443
|
var getTypeConstEnum = (value, enumName, names) => {
|
|
49427
49444
|
let enumValue = `export type ${enumName} = typeof ${enumName}[keyof typeof ${enumName}]`;
|
|
@@ -49506,6 +49523,9 @@ var toNumberKey = (value) => {
|
|
|
49506
49523
|
}
|
|
49507
49524
|
return `NUMBER_${value}`;
|
|
49508
49525
|
};
|
|
49526
|
+
var getUnion = (value, enumName) => {
|
|
49527
|
+
return `export type ${enumName} = ${value};`;
|
|
49528
|
+
};
|
|
49509
49529
|
|
|
49510
49530
|
// src/getters/ref.ts
|
|
49511
49531
|
var RefComponentSuffix = {
|
|
@@ -49746,11 +49766,11 @@ var resolveObjectOriginal = ({
|
|
|
49746
49766
|
const enumValue = getEnum(
|
|
49747
49767
|
resolvedValue.value,
|
|
49748
49768
|
propName,
|
|
49749
|
-
resolvedValue.originalSchema
|
|
49750
|
-
context.output.override.
|
|
49769
|
+
getEnumNames(resolvedValue.originalSchema),
|
|
49770
|
+
context.output.override.enumGenerationType
|
|
49751
49771
|
);
|
|
49752
49772
|
return {
|
|
49753
|
-
value:
|
|
49773
|
+
value: propName,
|
|
49754
49774
|
imports: [{ name: propName }],
|
|
49755
49775
|
schemas: [
|
|
49756
49776
|
...resolvedValue.schemas,
|
|
@@ -50136,7 +50156,9 @@ var resolveSchemaPropertiesToFormData = ({
|
|
|
50136
50156
|
variableName,
|
|
50137
50157
|
propName,
|
|
50138
50158
|
context,
|
|
50139
|
-
isRequestBodyOptional
|
|
50159
|
+
isRequestBodyOptional,
|
|
50160
|
+
keyPrefix = "",
|
|
50161
|
+
depth = 0
|
|
50140
50162
|
}) => {
|
|
50141
50163
|
const formDataValues = Object.entries(schema.properties ?? {}).reduce(
|
|
50142
50164
|
(acc, [key, value]) => {
|
|
@@ -50147,28 +50169,64 @@ var resolveSchemaPropertiesToFormData = ({
|
|
|
50147
50169
|
const valueKey = `${propName}${formattedKeyPrefix}${formattedKey}`;
|
|
50148
50170
|
const nonOptionalValueKey = `${propName}${formattedKey}`;
|
|
50149
50171
|
if (property.type === "object") {
|
|
50150
|
-
|
|
50172
|
+
if (context.output.override.formData.arrayHandling === FormDataArrayHandling.EXPLODE) {
|
|
50173
|
+
formDataValue = resolveSchemaPropertiesToFormData({
|
|
50174
|
+
schema: property,
|
|
50175
|
+
variableName,
|
|
50176
|
+
propName: nonOptionalValueKey,
|
|
50177
|
+
context,
|
|
50178
|
+
isRequestBodyOptional,
|
|
50179
|
+
keyPrefix: `${keyPrefix}${key}.`,
|
|
50180
|
+
depth: depth + 1
|
|
50181
|
+
});
|
|
50182
|
+
} else {
|
|
50183
|
+
formDataValue = `${variableName}.append(\`${keyPrefix}${key}\`, JSON.stringify(${nonOptionalValueKey}));
|
|
50151
50184
|
`;
|
|
50185
|
+
}
|
|
50152
50186
|
} else if (property.type === "array") {
|
|
50153
50187
|
let valueStr = "value";
|
|
50188
|
+
let hasNonPrimitiveChild = false;
|
|
50154
50189
|
if (property.items) {
|
|
50155
50190
|
const { schema: itemSchema } = resolveRef(
|
|
50156
50191
|
property.items,
|
|
50157
50192
|
context
|
|
50158
50193
|
);
|
|
50159
50194
|
if (itemSchema.type === "object" || itemSchema.type === "array") {
|
|
50160
|
-
|
|
50195
|
+
if (context.output.override.formData.arrayHandling === FormDataArrayHandling.EXPLODE) {
|
|
50196
|
+
hasNonPrimitiveChild = true;
|
|
50197
|
+
const resolvedValue = resolveSchemaPropertiesToFormData({
|
|
50198
|
+
schema: itemSchema,
|
|
50199
|
+
variableName,
|
|
50200
|
+
propName: "value",
|
|
50201
|
+
context,
|
|
50202
|
+
isRequestBodyOptional,
|
|
50203
|
+
keyPrefix: `${keyPrefix}${key}[\${index${depth > 0 ? depth : ""}}].`,
|
|
50204
|
+
depth: depth + 1
|
|
50205
|
+
});
|
|
50206
|
+
formDataValue = `${valueKey}.forEach((value, index${depth > 0 ? depth : ""}) => {
|
|
50207
|
+
${resolvedValue}});
|
|
50208
|
+
`;
|
|
50209
|
+
} else {
|
|
50210
|
+
valueStr = "JSON.stringify(value)";
|
|
50211
|
+
}
|
|
50161
50212
|
} else if (itemSchema.type === "number" || itemSchema.type?.includes("number") || itemSchema.type === "integer" || itemSchema.type?.includes("integer") || itemSchema.type === "boolean" || itemSchema.type?.includes("boolean")) {
|
|
50162
50213
|
valueStr = "value.toString()";
|
|
50163
50214
|
}
|
|
50164
50215
|
}
|
|
50165
|
-
|
|
50216
|
+
if (context.output.override.formData.arrayHandling === FormDataArrayHandling.EXPLODE) {
|
|
50217
|
+
if (!hasNonPrimitiveChild) {
|
|
50218
|
+
formDataValue = `${valueKey}.forEach((value, index${depth > 0 ? depth : ""}) => ${variableName}.append(\`${keyPrefix}${key}[\${index${depth > 0 ? depth : ""}}]\`, ${valueStr}));
|
|
50219
|
+
`;
|
|
50220
|
+
}
|
|
50221
|
+
} else {
|
|
50222
|
+
formDataValue = `${valueKey}.forEach(value => ${variableName}.append(\`${keyPrefix}${key}${context.output.override.formData.arrayHandling === FormDataArrayHandling.SERIALIZE_WITH_BRACKETS ? "[]" : ""}\`, ${valueStr}));
|
|
50166
50223
|
`;
|
|
50224
|
+
}
|
|
50167
50225
|
} else if (property.type === "number" || property.type?.includes("number") || property.type === "integer" || property.type?.includes("integer") || property.type === "boolean" || property.type?.includes("boolean")) {
|
|
50168
|
-
formDataValue = `${variableName}.append(
|
|
50226
|
+
formDataValue = `${variableName}.append(\`${keyPrefix}${key}\`, ${nonOptionalValueKey}.toString())
|
|
50169
50227
|
`;
|
|
50170
50228
|
} else {
|
|
50171
|
-
formDataValue = `${variableName}.append(
|
|
50229
|
+
formDataValue = `${variableName}.append(\`${keyPrefix}${key}\`, ${nonOptionalValueKey})
|
|
50172
50230
|
`;
|
|
50173
50231
|
}
|
|
50174
50232
|
let existSubSchemaNullable = false;
|
|
@@ -50180,7 +50238,7 @@ var resolveSchemaPropertiesToFormData = ({
|
|
|
50180
50238
|
if (subSchemas?.some((subSchema) => {
|
|
50181
50239
|
return ["number", "integer", "boolean"].includes(subSchema.type);
|
|
50182
50240
|
})) {
|
|
50183
|
-
formDataValue = `${variableName}.append(
|
|
50241
|
+
formDataValue = `${variableName}.append(\`${key}\`, ${nonOptionalValueKey}.toString())
|
|
50184
50242
|
`;
|
|
50185
50243
|
}
|
|
50186
50244
|
if (subSchemas?.some((subSchema) => {
|
|
@@ -50369,7 +50427,7 @@ var getObject = ({
|
|
|
50369
50427
|
acc.hasReadonlyProps ||= isReadOnly || false;
|
|
50370
50428
|
acc.imports.push(...resolvedValue.imports);
|
|
50371
50429
|
acc.value += `
|
|
50372
|
-
${doc ? `${doc} ` : ""}${isReadOnly && !context.output.override.suppressReadonlyModifier ? "readonly " : ""}${getKey(key)}${isRequired ? "" : "?"}: ${resolvedValue.
|
|
50430
|
+
${doc ? `${doc} ` : ""}${isReadOnly && !context.output.override.suppressReadonlyModifier ? "readonly " : ""}${getKey(key)}${isRequired ? "" : "?"}: ${resolvedValue.value};`;
|
|
50373
50431
|
acc.schemas.push(...resolvedValue.schemas);
|
|
50374
50432
|
if (arr.length - 1 === index3) {
|
|
50375
50433
|
if (item.additionalProperties) {
|
|
@@ -50622,7 +50680,16 @@ var combineValues = ({
|
|
|
50622
50680
|
return `${resolvedData.values.join(` | `)}${resolvedValue ? ` | ${resolvedValue.value}` : ""}`;
|
|
50623
50681
|
}
|
|
50624
50682
|
if (separator2 === "allOf") {
|
|
50625
|
-
|
|
50683
|
+
let resolvedDataValue = resolvedData.values.join(` & `);
|
|
50684
|
+
if (resolvedData.originalSchema.length > 0 && resolvedValue) {
|
|
50685
|
+
const discriminatedPropertySchemas = resolvedData.originalSchema.filter(
|
|
50686
|
+
(s2) => s2?.discriminator && resolvedValue.value.includes(` ${s2.discriminator.propertyName}:`)
|
|
50687
|
+
);
|
|
50688
|
+
if (discriminatedPropertySchemas.length > 0) {
|
|
50689
|
+
resolvedDataValue = `Omit<${resolvedDataValue}, '${discriminatedPropertySchemas.map((s2) => s2.discriminator?.propertyName).join("' | '")}'>`;
|
|
50690
|
+
}
|
|
50691
|
+
}
|
|
50692
|
+
const joined = `${resolvedDataValue}${resolvedValue ? ` & ${resolvedValue.value}` : ""}`;
|
|
50626
50693
|
const overrideRequiredProperties = resolvedData.requiredProperties.filter(
|
|
50627
50694
|
(prop) => !resolvedData.originalSchema.some(
|
|
50628
50695
|
(schema) => schema && schema.properties?.[prop] && schema.required?.includes(prop)
|
|
@@ -50789,7 +50856,7 @@ var getCombineEnumValue = ({
|
|
|
50789
50856
|
if (isRef[i3]) {
|
|
50790
50857
|
return `...${e3},`;
|
|
50791
50858
|
}
|
|
50792
|
-
const names = originalSchema[i3]
|
|
50859
|
+
const names = getEnumNames(originalSchema[i3]);
|
|
50793
50860
|
return getEnumImplementation(e3, names);
|
|
50794
50861
|
}).join("");
|
|
50795
50862
|
return `{${enums}} as const`;
|
|
@@ -51072,8 +51139,8 @@ var getQueryParamsTypes = (queryParams, operationName, context) => {
|
|
|
51072
51139
|
const enumValue = getEnum(
|
|
51073
51140
|
resolvedValue.value,
|
|
51074
51141
|
enumName,
|
|
51075
|
-
resolvedValue.originalSchema
|
|
51076
|
-
context.output.override.
|
|
51142
|
+
getEnumNames(resolvedValue.originalSchema),
|
|
51143
|
+
context.output.override.enumGenerationType
|
|
51077
51144
|
);
|
|
51078
51145
|
return {
|
|
51079
51146
|
definition: `${doc}${key}${!required || schema.default ? "?" : ""}: ${enumName};`,
|
|
@@ -51363,15 +51430,17 @@ var generateMutatorImports = ({
|
|
|
51363
51430
|
acc += "\n";
|
|
51364
51431
|
if (implementation && (mutator.hasErrorType || mutator.bodyTypeName)) {
|
|
51365
51432
|
let errorImportName = "";
|
|
51366
|
-
|
|
51367
|
-
|
|
51433
|
+
const targetErrorImportName = mutator.default ? `ErrorType as ${mutator.errorTypeName}` : mutator.errorTypeName;
|
|
51434
|
+
if (mutator.hasErrorType && implementation.includes(mutator.errorTypeName) && !acc.includes(`{ ${targetErrorImportName} `)) {
|
|
51435
|
+
errorImportName = targetErrorImportName;
|
|
51368
51436
|
}
|
|
51369
51437
|
let bodyImportName = "";
|
|
51370
|
-
|
|
51371
|
-
|
|
51438
|
+
const targetBodyImportName = mutator.default ? `BodyType as ${mutator.bodyTypeName}` : mutator.bodyTypeName;
|
|
51439
|
+
if (mutator.bodyTypeName && implementation.includes(mutator.bodyTypeName) && !acc.includes(` ${targetBodyImportName} }`)) {
|
|
51440
|
+
bodyImportName = targetBodyImportName;
|
|
51372
51441
|
}
|
|
51373
51442
|
if (bodyImportName || errorImportName) {
|
|
51374
|
-
acc += `import type { ${errorImportName}${errorImportName && bodyImportName ? ", " : ""}${bodyImportName} } from '${path2}';`;
|
|
51443
|
+
acc += `import type { ${errorImportName}${errorImportName && bodyImportName ? " , " : ""}${bodyImportName} } from '${path2}';`;
|
|
51375
51444
|
acc += "\n";
|
|
51376
51445
|
}
|
|
51377
51446
|
}
|
|
@@ -52111,8 +52180,8 @@ var generateSchemasDefinition = (schemas = {}, context, suffix, filters) => {
|
|
|
52111
52180
|
output += getEnum(
|
|
52112
52181
|
resolvedValue.value,
|
|
52113
52182
|
schemaName,
|
|
52114
|
-
resolvedValue.originalSchema
|
|
52115
|
-
context.output.override.
|
|
52183
|
+
getEnumNames(resolvedValue.originalSchema),
|
|
52184
|
+
context.output.override.enumGenerationType
|
|
52116
52185
|
);
|
|
52117
52186
|
} else if (schemaName === resolvedValue.value && resolvedValue.isRef) {
|
|
52118
52187
|
const { schema: referredSchema } = resolveRef(schema, context);
|
|
@@ -52189,8 +52258,7 @@ var generateVerbOptions = async ({
|
|
|
52189
52258
|
overrideOperation
|
|
52190
52259
|
);
|
|
52191
52260
|
const overrideOperationName = overrideOperation?.operationName || output.override?.operationName;
|
|
52192
|
-
const
|
|
52193
|
-
const operationName = sanitize(overriddenOperationName, { es5keyword: true });
|
|
52261
|
+
const operationName = overrideOperationName ? overrideOperationName(operation, route, verb) : sanitize(camel(operationId), { es5keyword: true });
|
|
52194
52262
|
const response = getResponse({
|
|
52195
52263
|
responses,
|
|
52196
52264
|
operationName,
|
|
@@ -52240,10 +52308,10 @@ var generateVerbOptions = async ({
|
|
|
52240
52308
|
workspace: context.workspace,
|
|
52241
52309
|
tsconfig: context.output.tsconfig
|
|
52242
52310
|
});
|
|
52243
|
-
const formData =
|
|
52311
|
+
const formData = !override.formData.disabled && body.formData ? await generateMutator({
|
|
52244
52312
|
output: output.target,
|
|
52245
52313
|
name: operationName,
|
|
52246
|
-
mutator: override.formData,
|
|
52314
|
+
mutator: override.formData.mutator,
|
|
52247
52315
|
workspace: context.workspace,
|
|
52248
52316
|
tsconfig: context.output.tsconfig
|
|
52249
52317
|
}) : void 0;
|
|
@@ -53232,6 +53300,8 @@ var writeTagsMode = async ({
|
|
|
53232
53300
|
// Annotate the CommonJS export names for ESM import in node:
|
|
53233
53301
|
0 && (module.exports = {
|
|
53234
53302
|
BODY_TYPE_NAME,
|
|
53303
|
+
EnumGeneration,
|
|
53304
|
+
FormDataArrayHandling,
|
|
53235
53305
|
GetterPropType,
|
|
53236
53306
|
LogLevels,
|
|
53237
53307
|
NamingConvention,
|
|
@@ -53286,6 +53356,7 @@ var writeTagsMode = async ({
|
|
|
53286
53356
|
getBody,
|
|
53287
53357
|
getEnum,
|
|
53288
53358
|
getEnumImplementation,
|
|
53359
|
+
getEnumNames,
|
|
53289
53360
|
getExtension,
|
|
53290
53361
|
getFileInfo,
|
|
53291
53362
|
getFullRoute,
|