@orval/core 7.10.0 → 7.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +24 -5
- package/dist/index.js +205 -45
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -76,6 +76,9 @@ type NormalizedOverrideOutput = {
|
|
|
76
76
|
formUrlEncoded: boolean | NormalizedMutator;
|
|
77
77
|
paramsSerializer?: NormalizedMutator;
|
|
78
78
|
paramsSerializerOptions?: NormalizedParamsSerializerOptions;
|
|
79
|
+
namingConvention: {
|
|
80
|
+
enum?: NamingConvention;
|
|
81
|
+
};
|
|
79
82
|
components: {
|
|
80
83
|
schemas: {
|
|
81
84
|
suffix: string;
|
|
@@ -347,6 +350,9 @@ type OverrideOutput = {
|
|
|
347
350
|
formUrlEncoded?: boolean | Mutator;
|
|
348
351
|
paramsSerializer?: Mutator;
|
|
349
352
|
paramsSerializerOptions?: ParamsSerializerOptions;
|
|
353
|
+
namingConvention?: {
|
|
354
|
+
enum?: NamingConvention;
|
|
355
|
+
};
|
|
350
356
|
components?: {
|
|
351
357
|
schemas?: {
|
|
352
358
|
suffix?: string;
|
|
@@ -410,6 +416,9 @@ type ZodDateTimeOptions = {
|
|
|
410
416
|
local?: boolean;
|
|
411
417
|
precision?: number;
|
|
412
418
|
};
|
|
419
|
+
type ZodTimeOptions = {
|
|
420
|
+
precision?: -1 | 0 | 1 | 2 | 3;
|
|
421
|
+
};
|
|
413
422
|
type ZodOptions = {
|
|
414
423
|
strict?: {
|
|
415
424
|
param?: boolean;
|
|
@@ -440,6 +449,7 @@ type ZodOptions = {
|
|
|
440
449
|
response?: Mutator;
|
|
441
450
|
};
|
|
442
451
|
dateTimeOptions?: ZodDateTimeOptions;
|
|
452
|
+
timeOptions?: ZodTimeOptions;
|
|
443
453
|
generateEachHttpStatus?: boolean;
|
|
444
454
|
};
|
|
445
455
|
type ZodCoerceType = 'string' | 'number' | 'boolean' | 'bigint' | 'date';
|
|
@@ -474,6 +484,7 @@ type NormalizedZodOptions = {
|
|
|
474
484
|
};
|
|
475
485
|
generateEachHttpStatus: boolean;
|
|
476
486
|
dateTimeOptions: ZodDateTimeOptions;
|
|
487
|
+
timeOptions: ZodTimeOptions;
|
|
477
488
|
};
|
|
478
489
|
type HonoOptions = {
|
|
479
490
|
handlers?: string;
|
|
@@ -524,12 +535,15 @@ type AngularOptions = {
|
|
|
524
535
|
};
|
|
525
536
|
type SwrOptions = {
|
|
526
537
|
useInfinite?: boolean;
|
|
538
|
+
useSWRMutationForGet?: boolean;
|
|
527
539
|
swrOptions?: any;
|
|
528
540
|
swrMutationOptions?: any;
|
|
529
541
|
swrInfiniteOptions?: any;
|
|
530
542
|
};
|
|
531
543
|
type FetchOptions = {
|
|
532
|
-
includeHttpResponseReturnType
|
|
544
|
+
includeHttpResponseReturnType?: boolean;
|
|
545
|
+
explode?: boolean;
|
|
546
|
+
jsonReviver?: Mutator;
|
|
533
547
|
};
|
|
534
548
|
type InputTransformerFn = (spec: OpenAPIObject) => OpenAPIObject;
|
|
535
549
|
type InputTransformer = string | InputTransformerFn;
|
|
@@ -656,6 +670,7 @@ type GeneratorTarget = {
|
|
|
656
670
|
formData?: GeneratorMutator[];
|
|
657
671
|
formUrlEncoded?: GeneratorMutator[];
|
|
658
672
|
paramsSerializer?: GeneratorMutator[];
|
|
673
|
+
fetchReviver?: GeneratorMutator[];
|
|
659
674
|
};
|
|
660
675
|
type GeneratorTargetFull = {
|
|
661
676
|
imports: GeneratorImport[];
|
|
@@ -671,6 +686,7 @@ type GeneratorTargetFull = {
|
|
|
671
686
|
formData?: GeneratorMutator[];
|
|
672
687
|
formUrlEncoded?: GeneratorMutator[];
|
|
673
688
|
paramsSerializer?: GeneratorMutator[];
|
|
689
|
+
fetchReviver?: GeneratorMutator[];
|
|
674
690
|
};
|
|
675
691
|
type GeneratorOperation = {
|
|
676
692
|
imports: GeneratorImport[];
|
|
@@ -687,6 +703,7 @@ type GeneratorOperation = {
|
|
|
687
703
|
formData?: GeneratorMutator;
|
|
688
704
|
formUrlEncoded?: GeneratorMutator;
|
|
689
705
|
paramsSerializer?: GeneratorMutator;
|
|
706
|
+
fetchReviver?: GeneratorMutator;
|
|
690
707
|
operationName: string;
|
|
691
708
|
types?: {
|
|
692
709
|
result: (title?: string) => string;
|
|
@@ -711,6 +728,7 @@ type GeneratorVerbOptions = {
|
|
|
711
728
|
formData?: GeneratorMutator;
|
|
712
729
|
formUrlEncoded?: GeneratorMutator;
|
|
713
730
|
paramsSerializer?: GeneratorMutator;
|
|
731
|
+
fetchReviver?: GeneratorMutator;
|
|
714
732
|
override: NormalizedOverrideOutput;
|
|
715
733
|
deprecated?: boolean;
|
|
716
734
|
originalOperation: OperationObject;
|
|
@@ -771,7 +789,7 @@ type ClientFooterBuilder = (params: {
|
|
|
771
789
|
hasMutator: boolean;
|
|
772
790
|
}) => string;
|
|
773
791
|
type ClientTitleBuilder = (title: string) => string;
|
|
774
|
-
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[];
|
|
775
793
|
type ClientMockGeneratorImplementation = {
|
|
776
794
|
function: string;
|
|
777
795
|
handlerName: string;
|
|
@@ -1150,8 +1168,8 @@ declare const resolveDiscriminators: (schemas: SchemasObject, context: ContextSp
|
|
|
1150
1168
|
|
|
1151
1169
|
declare const getEnumNames: (schemaObject: SchemaObject$1 | undefined) => any;
|
|
1152
1170
|
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;
|
|
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;
|
|
1155
1173
|
|
|
1156
1174
|
declare const getKey: (key: string) => string;
|
|
1157
1175
|
|
|
@@ -1519,6 +1537,7 @@ declare const writeSchemas: ({ schemaPath, schemas, target, namingConvention, fi
|
|
|
1519
1537
|
}) => Promise<void>;
|
|
1520
1538
|
|
|
1521
1539
|
declare const getOrvalGeneratedTypes: () => string;
|
|
1540
|
+
declare const getTypedResponse: () => string;
|
|
1522
1541
|
|
|
1523
1542
|
declare const writeSingleMode: ({ builder, output, specsName, header, needSchema, }: WriteModeProps) => Promise<string[]>;
|
|
1524
1543
|
|
|
@@ -1532,4 +1551,4 @@ declare const generateTarget: (builder: WriteSpecsBuilder, options: NormalizedOu
|
|
|
1532
1551
|
|
|
1533
1552
|
declare const generateTargetForTags: (builder: WriteSpecsBuilder, options: NormalizedOutputOptions) => Record<string, GeneratorTarget>;
|
|
1534
1553
|
|
|
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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -48208,6 +48208,7 @@ __export(index_exports, {
|
|
|
48208
48208
|
getRoute: () => getRoute,
|
|
48209
48209
|
getRouteAsArray: () => getRouteAsArray,
|
|
48210
48210
|
getScalar: () => getScalar,
|
|
48211
|
+
getTypedResponse: () => getTypedResponse,
|
|
48211
48212
|
ibmOpenapiValidator: () => ibmOpenapiValidator,
|
|
48212
48213
|
ibmOpenapiValidatorErrors: () => ibmOpenapiValidatorErrors,
|
|
48213
48214
|
ibmOpenapiValidatorWarnings: () => ibmOpenapiValidatorWarnings,
|
|
@@ -49471,23 +49472,34 @@ var getEnumNames = (schemaObject) => {
|
|
|
49471
49472
|
var getEnumDescriptions = (schemaObject) => {
|
|
49472
49473
|
return schemaObject?.["x-enumDescriptions"] || schemaObject?.["x-enumdescriptions"] || schemaObject?.["x-enum-descriptions"];
|
|
49473
49474
|
};
|
|
49474
|
-
var getEnum = (value, enumName, names, enumGenerationType, descriptions) => {
|
|
49475
|
+
var getEnum = (value, enumName, names, enumGenerationType, descriptions, enumNamingConvention) => {
|
|
49475
49476
|
if (enumGenerationType === EnumGeneration.CONST)
|
|
49476
|
-
return getTypeConstEnum(
|
|
49477
|
+
return getTypeConstEnum(
|
|
49478
|
+
value,
|
|
49479
|
+
enumName,
|
|
49480
|
+
names,
|
|
49481
|
+
descriptions,
|
|
49482
|
+
enumNamingConvention
|
|
49483
|
+
);
|
|
49477
49484
|
if (enumGenerationType === EnumGeneration.ENUM)
|
|
49478
|
-
return getNativeEnum(value, enumName, names);
|
|
49485
|
+
return getNativeEnum(value, enumName, names, enumNamingConvention);
|
|
49479
49486
|
if (enumGenerationType === EnumGeneration.UNION)
|
|
49480
49487
|
return getUnion(value, enumName);
|
|
49481
49488
|
throw new Error(`Invalid enumGenerationType: ${enumGenerationType}`);
|
|
49482
49489
|
};
|
|
49483
|
-
var getTypeConstEnum = (value, enumName, names, descriptions) => {
|
|
49490
|
+
var getTypeConstEnum = (value, enumName, names, descriptions, enumNamingConvention) => {
|
|
49484
49491
|
let enumValue = `export type ${enumName} = typeof ${enumName}[keyof typeof ${enumName}]`;
|
|
49485
49492
|
if (value.endsWith(" | null")) {
|
|
49486
49493
|
value = value.replace(" | null", "");
|
|
49487
49494
|
enumValue += " | null";
|
|
49488
49495
|
}
|
|
49489
49496
|
enumValue += ";\n";
|
|
49490
|
-
const implementation = getEnumImplementation(
|
|
49497
|
+
const implementation = getEnumImplementation(
|
|
49498
|
+
value,
|
|
49499
|
+
names,
|
|
49500
|
+
descriptions,
|
|
49501
|
+
enumNamingConvention
|
|
49502
|
+
);
|
|
49491
49503
|
enumValue += "\n\n";
|
|
49492
49504
|
enumValue += "// eslint-disable-next-line @typescript-eslint/no-redeclare\n";
|
|
49493
49505
|
enumValue += `export const ${enumName} = {
|
|
@@ -49495,7 +49507,7 @@ ${implementation}} as const;
|
|
|
49495
49507
|
`;
|
|
49496
49508
|
return enumValue;
|
|
49497
49509
|
};
|
|
49498
|
-
var getEnumImplementation = (value, names, descriptions) => {
|
|
49510
|
+
var getEnumImplementation = (value, names, descriptions, enumNamingConvention) => {
|
|
49499
49511
|
if (value === "") return "";
|
|
49500
49512
|
return [...new Set(value.split(" | "))].reduce((acc, val, index3) => {
|
|
49501
49513
|
const name = names?.[index3];
|
|
@@ -49519,18 +49531,21 @@ var getEnumImplementation = (value, names, descriptions) => {
|
|
|
49519
49531
|
special: true
|
|
49520
49532
|
});
|
|
49521
49533
|
}
|
|
49534
|
+
if (enumNamingConvention) {
|
|
49535
|
+
key = conventionName(key, enumNamingConvention);
|
|
49536
|
+
}
|
|
49522
49537
|
return acc + comment + ` ${import_esutils2.keyword.isIdentifierNameES5(key) ? key : `'${key}'`}: ${val},
|
|
49523
49538
|
`;
|
|
49524
49539
|
}, "");
|
|
49525
49540
|
};
|
|
49526
|
-
var getNativeEnum = (value, enumName, names) => {
|
|
49527
|
-
const enumItems = getNativeEnumItems(value, names);
|
|
49541
|
+
var getNativeEnum = (value, enumName, names, enumNamingConvention) => {
|
|
49542
|
+
const enumItems = getNativeEnumItems(value, names, enumNamingConvention);
|
|
49528
49543
|
const enumValue = `export enum ${enumName} {
|
|
49529
49544
|
${enumItems}
|
|
49530
49545
|
}`;
|
|
49531
49546
|
return enumValue;
|
|
49532
49547
|
};
|
|
49533
|
-
var getNativeEnumItems = (value, names) => {
|
|
49548
|
+
var getNativeEnumItems = (value, names, enumNamingConvention) => {
|
|
49534
49549
|
if (value === "") return "";
|
|
49535
49550
|
return [...new Set(value.split(" | "))].reduce((acc, val, index3) => {
|
|
49536
49551
|
const name = names?.[index3];
|
|
@@ -49551,6 +49566,9 @@ var getNativeEnumItems = (value, names) => {
|
|
|
49551
49566
|
special: true
|
|
49552
49567
|
});
|
|
49553
49568
|
}
|
|
49569
|
+
if (enumNamingConvention) {
|
|
49570
|
+
key = conventionName(key, enumNamingConvention);
|
|
49571
|
+
}
|
|
49554
49572
|
return acc + ` ${import_esutils2.keyword.isIdentifierNameES5(key) ? key : `'${key}'`}= ${val},
|
|
49555
49573
|
`;
|
|
49556
49574
|
}, "");
|
|
@@ -49809,7 +49827,8 @@ var resolveObjectOriginal = ({
|
|
|
49809
49827
|
propName,
|
|
49810
49828
|
getEnumNames(resolvedValue.originalSchema),
|
|
49811
49829
|
context.output.override.enumGenerationType,
|
|
49812
|
-
getEnumDescriptions(resolvedValue.originalSchema)
|
|
49830
|
+
getEnumDescriptions(resolvedValue.originalSchema),
|
|
49831
|
+
context.output.override.namingConvention?.enum
|
|
49813
49832
|
);
|
|
49814
49833
|
return {
|
|
49815
49834
|
value: propName,
|
|
@@ -50107,16 +50126,14 @@ var getFormDataAdditionalImports = ({
|
|
|
50107
50126
|
context
|
|
50108
50127
|
}) => {
|
|
50109
50128
|
const { schema } = resolveRef(schemaObject, context);
|
|
50110
|
-
if (schema.type
|
|
50111
|
-
|
|
50112
|
-
|
|
50113
|
-
|
|
50114
|
-
|
|
50115
|
-
|
|
50116
|
-
});
|
|
50117
|
-
}
|
|
50129
|
+
if (schema.type !== "object") {
|
|
50130
|
+
return [];
|
|
50131
|
+
}
|
|
50132
|
+
const combinedSchemas = schema.oneOf || schema.anyOf;
|
|
50133
|
+
if (!combinedSchemas) {
|
|
50134
|
+
return [];
|
|
50118
50135
|
}
|
|
50119
|
-
return [];
|
|
50136
|
+
return combinedSchemas.map((schema2) => resolveRef(schema2, context).imports[0]).filter(Boolean);
|
|
50120
50137
|
};
|
|
50121
50138
|
var getSchemaFormDataAndUrlEncoded = ({
|
|
50122
50139
|
name,
|
|
@@ -50144,10 +50161,14 @@ var getSchemaFormDataAndUrlEncoded = ({
|
|
|
50144
50161
|
schema2,
|
|
50145
50162
|
context
|
|
50146
50163
|
);
|
|
50147
|
-
|
|
50148
|
-
|
|
50149
|
-
|
|
50150
|
-
|
|
50164
|
+
let newPropName = propName;
|
|
50165
|
+
let newPropDefinition = "";
|
|
50166
|
+
if (shouldCast && imports2[0]) {
|
|
50167
|
+
additionalImports.push(imports2[0]);
|
|
50168
|
+
newPropName = `${propName}${pascal(imports2[0].name)}`;
|
|
50169
|
+
newPropDefinition = `const ${newPropName} = (${propName} as ${imports2[0].name}${isRequestBodyOptional ? " | undefined" : ""});
|
|
50170
|
+
`;
|
|
50171
|
+
}
|
|
50151
50172
|
return newPropDefinition + resolveSchemaPropertiesToFormData({
|
|
50152
50173
|
schema: combinedSchema,
|
|
50153
50174
|
variableName,
|
|
@@ -50390,6 +50411,51 @@ var getKey = (key) => {
|
|
|
50390
50411
|
return import_esutils4.keyword.isIdentifierNameES5(key) ? key : `'${key}'`;
|
|
50391
50412
|
};
|
|
50392
50413
|
|
|
50414
|
+
// src/getters/imports.ts
|
|
50415
|
+
var getAliasedImports = ({
|
|
50416
|
+
name,
|
|
50417
|
+
resolvedValue,
|
|
50418
|
+
existingImports,
|
|
50419
|
+
context
|
|
50420
|
+
}) => context.output.schemas && resolvedValue.isRef ? resolvedValue.imports.map((imp) => {
|
|
50421
|
+
if (!needCreateImportAlias({
|
|
50422
|
+
name,
|
|
50423
|
+
imp,
|
|
50424
|
+
existingImports
|
|
50425
|
+
})) {
|
|
50426
|
+
return imp;
|
|
50427
|
+
}
|
|
50428
|
+
const specName = pascal(
|
|
50429
|
+
getSpecName(imp.specKey ?? "", context.specKey)
|
|
50430
|
+
);
|
|
50431
|
+
const normalizedSpecName = /^\d/.test(specName) ? `__${specName}` : specName;
|
|
50432
|
+
return {
|
|
50433
|
+
...imp,
|
|
50434
|
+
alias: `${normalizedSpecName}__${imp.name}`
|
|
50435
|
+
};
|
|
50436
|
+
}) : resolvedValue.imports;
|
|
50437
|
+
var needCreateImportAlias = ({
|
|
50438
|
+
existingImports,
|
|
50439
|
+
imp,
|
|
50440
|
+
name
|
|
50441
|
+
}) => !imp.alias && // !!imp.specKey &&
|
|
50442
|
+
(imp.name === name || existingImports.some(
|
|
50443
|
+
(existingImport) => imp.name === existingImport.name && imp.specKey !== existingImport.specKey
|
|
50444
|
+
));
|
|
50445
|
+
var getImportAliasForRefOrValue = ({
|
|
50446
|
+
context,
|
|
50447
|
+
imports,
|
|
50448
|
+
resolvedValue
|
|
50449
|
+
}) => {
|
|
50450
|
+
if (!context.output.schemas || !resolvedValue.isRef) {
|
|
50451
|
+
return resolvedValue.value;
|
|
50452
|
+
}
|
|
50453
|
+
const importWithSameName = imports.find(
|
|
50454
|
+
(imp) => imp.name === resolvedValue.value
|
|
50455
|
+
);
|
|
50456
|
+
return importWithSameName?.alias ?? resolvedValue.value;
|
|
50457
|
+
};
|
|
50458
|
+
|
|
50393
50459
|
// src/getters/object.ts
|
|
50394
50460
|
var getObject = ({
|
|
50395
50461
|
item,
|
|
@@ -50421,7 +50487,7 @@ var getObject = ({
|
|
|
50421
50487
|
nullable
|
|
50422
50488
|
});
|
|
50423
50489
|
}
|
|
50424
|
-
if (item.type
|
|
50490
|
+
if (Array.isArray(item.type)) {
|
|
50425
50491
|
return combineSchemas({
|
|
50426
50492
|
schema: {
|
|
50427
50493
|
anyOf: item.type.map((type) => ({
|
|
@@ -50470,9 +50536,20 @@ var getObject = ({
|
|
|
50470
50536
|
}
|
|
50471
50537
|
const doc = jsDoc(schema, true, context);
|
|
50472
50538
|
acc.hasReadonlyProps ||= isReadOnly || false;
|
|
50473
|
-
|
|
50539
|
+
const aliasedImports = getAliasedImports({
|
|
50540
|
+
name,
|
|
50541
|
+
context,
|
|
50542
|
+
resolvedValue,
|
|
50543
|
+
existingImports: acc.imports
|
|
50544
|
+
});
|
|
50545
|
+
acc.imports.push(...aliasedImports);
|
|
50546
|
+
const propValue = getImportAliasForRefOrValue({
|
|
50547
|
+
context,
|
|
50548
|
+
resolvedValue,
|
|
50549
|
+
imports: aliasedImports
|
|
50550
|
+
});
|
|
50474
50551
|
acc.value += `
|
|
50475
|
-
${doc ? `${doc} ` : ""}${isReadOnly && !context.output.override.suppressReadonlyModifier ? "readonly " : ""}${getKey(key)}${isRequired ? "" : "?"}: ${
|
|
50552
|
+
${doc ? `${doc} ` : ""}${isReadOnly && !context.output.override.suppressReadonlyModifier ? "readonly " : ""}${getKey(key)}${isRequired ? "" : "?"}: ${propValue};`;
|
|
50476
50553
|
acc.schemas.push(...resolvedValue.schemas);
|
|
50477
50554
|
if (arr.length - 1 === index3) {
|
|
50478
50555
|
if (item.additionalProperties) {
|
|
@@ -50567,8 +50644,7 @@ var getScalar = ({
|
|
|
50567
50644
|
name,
|
|
50568
50645
|
context
|
|
50569
50646
|
}) => {
|
|
50570
|
-
const
|
|
50571
|
-
const nullable = item.nullable && !isAngularClient ? " | null" : "";
|
|
50647
|
+
const nullable = item.nullable ? " | null" : "";
|
|
50572
50648
|
const enumItems = item.enum?.filter((enumItem) => enumItem !== null);
|
|
50573
50649
|
if (!item.type && item.items) {
|
|
50574
50650
|
item.type = "array";
|
|
@@ -50793,8 +50869,19 @@ var combineSchemas = ({
|
|
|
50793
50869
|
combined: true,
|
|
50794
50870
|
context
|
|
50795
50871
|
});
|
|
50796
|
-
|
|
50797
|
-
|
|
50872
|
+
const aliasedImports = getAliasedImports({
|
|
50873
|
+
context,
|
|
50874
|
+
name,
|
|
50875
|
+
resolvedValue: resolvedValue2,
|
|
50876
|
+
existingImports: acc.imports
|
|
50877
|
+
});
|
|
50878
|
+
const value2 = getImportAliasForRefOrValue({
|
|
50879
|
+
context,
|
|
50880
|
+
resolvedValue: resolvedValue2,
|
|
50881
|
+
imports: aliasedImports
|
|
50882
|
+
});
|
|
50883
|
+
acc.values.push(value2);
|
|
50884
|
+
acc.imports.push(...aliasedImports);
|
|
50798
50885
|
acc.schemas.push(...resolvedValue2.schemas);
|
|
50799
50886
|
acc.isEnum.push(resolvedValue2.isEnum);
|
|
50800
50887
|
acc.types.push(resolvedValue2.type);
|
|
@@ -51090,8 +51177,8 @@ var getProps = ({
|
|
|
51090
51177
|
};
|
|
51091
51178
|
const queryParamsProp = {
|
|
51092
51179
|
name: "params",
|
|
51093
|
-
definition:
|
|
51094
|
-
implementation:
|
|
51180
|
+
definition: getQueryParamDefinition(queryParams, context),
|
|
51181
|
+
implementation: getQueryParamDefinition(queryParams, context),
|
|
51095
51182
|
default: false,
|
|
51096
51183
|
required: !isUndefined(queryParams?.isOptional) ? !queryParams?.isOptional && !context.output.allParamsOptional : !context.output.allParamsOptional,
|
|
51097
51184
|
type: GetterPropType.QUERY_PARAM
|
|
@@ -51147,6 +51234,13 @@ var getProps = ({
|
|
|
51147
51234
|
const sortedProps = sortByPriority(props);
|
|
51148
51235
|
return sortedProps;
|
|
51149
51236
|
};
|
|
51237
|
+
function getQueryParamDefinition(queryParams, context) {
|
|
51238
|
+
let paramType = queryParams?.schema.name;
|
|
51239
|
+
if (OutputClient.ANGULAR === context.output.client) {
|
|
51240
|
+
paramType = `DeepNonNullable<${paramType}>`;
|
|
51241
|
+
}
|
|
51242
|
+
return `params${queryParams?.isOptional || context.output.allParamsOptional ? "?" : ""}: ${paramType}`;
|
|
51243
|
+
}
|
|
51150
51244
|
|
|
51151
51245
|
// src/getters/query-params.ts
|
|
51152
51246
|
var getQueryParamsTypes = (queryParams, operationName, context) => {
|
|
@@ -51194,7 +51288,8 @@ var getQueryParamsTypes = (queryParams, operationName, context) => {
|
|
|
51194
51288
|
enumName,
|
|
51195
51289
|
getEnumNames(resolvedValue.originalSchema),
|
|
51196
51290
|
context.output.override.enumGenerationType,
|
|
51197
|
-
getEnumDescriptions(resolvedValue.originalSchema)
|
|
51291
|
+
getEnumDescriptions(resolvedValue.originalSchema),
|
|
51292
|
+
context.output.override.namingConvention?.enum
|
|
51198
51293
|
);
|
|
51199
51294
|
return {
|
|
51200
51295
|
definition: `${doc}${key}${!required || schema.default ? "?" : ""}: ${enumName};`,
|
|
@@ -51269,8 +51364,8 @@ var getResponse = ({
|
|
|
51269
51364
|
Object.entries(responses),
|
|
51270
51365
|
operationName,
|
|
51271
51366
|
context,
|
|
51272
|
-
"
|
|
51273
|
-
(type) => type.key
|
|
51367
|
+
"null",
|
|
51368
|
+
(type) => `${type.key}-${type.value}`
|
|
51274
51369
|
);
|
|
51275
51370
|
const filteredTypes = contentType ? types.filter((type) => {
|
|
51276
51371
|
let include = true;
|
|
@@ -51893,7 +51988,7 @@ var generateAxiosOptions = ({
|
|
|
51893
51988
|
paramsSerializerOptions
|
|
51894
51989
|
}) => {
|
|
51895
51990
|
const isRequestOptions = requestOptions !== false;
|
|
51896
|
-
if (!queryParams && !headers && !response.isBlob) {
|
|
51991
|
+
if (!queryParams && !headers && !response.isBlob && response.definition.success !== "string") {
|
|
51897
51992
|
if (isRequestOptions) {
|
|
51898
51993
|
return "options";
|
|
51899
51994
|
}
|
|
@@ -51914,9 +52009,14 @@ var generateAxiosOptions = ({
|
|
|
51914
52009
|
value += !isExactOptionalPropertyTypes ? "\n signal," : "\n ...(signal ? { signal } : {}),";
|
|
51915
52010
|
}
|
|
51916
52011
|
}
|
|
51917
|
-
if (
|
|
51918
|
-
|
|
52012
|
+
if (!isObject(requestOptions) || !requestOptions.hasOwnProperty("responseType")) {
|
|
52013
|
+
if (response.isBlob) {
|
|
52014
|
+
value += `
|
|
51919
52015
|
responseType: 'blob',`;
|
|
52016
|
+
} else if (response.definition.success === "string") {
|
|
52017
|
+
value += `
|
|
52018
|
+
responseType: 'text',`;
|
|
52019
|
+
}
|
|
51920
52020
|
}
|
|
51921
52021
|
if (isObject(requestOptions)) {
|
|
51922
52022
|
value += `
|
|
@@ -52174,7 +52274,7 @@ export type ${name} = typeof ${name}Value;
|
|
|
52174
52274
|
`;
|
|
52175
52275
|
}
|
|
52176
52276
|
const externalModulesImportsOnly = scalar.imports.filter(
|
|
52177
|
-
(importName) => importName.name !== name
|
|
52277
|
+
(importName) => importName.alias ? importName.alias !== name : importName.name !== name
|
|
52178
52278
|
);
|
|
52179
52279
|
return [
|
|
52180
52280
|
...scalar.schemas,
|
|
@@ -52236,7 +52336,8 @@ var generateSchemasDefinition = (schemas = {}, context, suffix, filters) => {
|
|
|
52236
52336
|
schemaName,
|
|
52237
52337
|
getEnumNames(resolvedValue.originalSchema),
|
|
52238
52338
|
context.output.override.enumGenerationType,
|
|
52239
|
-
getEnumDescriptions(resolvedValue.originalSchema)
|
|
52339
|
+
getEnumDescriptions(resolvedValue.originalSchema),
|
|
52340
|
+
context.output.override.namingConvention?.enum
|
|
52240
52341
|
);
|
|
52241
52342
|
} else if (schemaName === resolvedValue.value && resolvedValue.isRef) {
|
|
52242
52343
|
const { schema: referredSchema } = resolveRef(schema, context);
|
|
@@ -52384,6 +52485,13 @@ var generateVerbOptions = async ({
|
|
|
52384
52485
|
workspace: context.workspace,
|
|
52385
52486
|
tsconfig: context.output.tsconfig
|
|
52386
52487
|
}) : void 0;
|
|
52488
|
+
const fetchReviver = isString2(override?.fetch.jsonReviver) || isObject(override?.fetch.jsonReviver) ? await generateMutator({
|
|
52489
|
+
output: output.target,
|
|
52490
|
+
name: "fetchReviver",
|
|
52491
|
+
mutator: override.fetch.jsonReviver,
|
|
52492
|
+
workspace: context.workspace,
|
|
52493
|
+
tsconfig: context.output.tsconfig
|
|
52494
|
+
}) : void 0;
|
|
52387
52495
|
const doc = jsDoc({ description, deprecated, summary });
|
|
52388
52496
|
const verbOption = {
|
|
52389
52497
|
verb,
|
|
@@ -52403,6 +52511,7 @@ var generateVerbOptions = async ({
|
|
|
52403
52511
|
formData,
|
|
52404
52512
|
formUrlEncoded,
|
|
52405
52513
|
paramsSerializer,
|
|
52514
|
+
fetchReviver,
|
|
52406
52515
|
override,
|
|
52407
52516
|
doc,
|
|
52408
52517
|
deprecated,
|
|
@@ -52614,6 +52723,11 @@ type NonReadonly<T> = [T] extends [UnionToIntersection<T>] ? {
|
|
|
52614
52723
|
: T[P];
|
|
52615
52724
|
} : DistributeReadOnlyOverUnions<T>;
|
|
52616
52725
|
`;
|
|
52726
|
+
var getTypedResponse = () => `
|
|
52727
|
+
interface TypedResponse<T> extends Response {
|
|
52728
|
+
json(): Promise<T>;
|
|
52729
|
+
}
|
|
52730
|
+
`;
|
|
52617
52731
|
|
|
52618
52732
|
// src/writers/single-mode.ts
|
|
52619
52733
|
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
@@ -52661,6 +52775,9 @@ var generateTarget = (builder, options) => {
|
|
|
52661
52775
|
if (operation.clientMutators) {
|
|
52662
52776
|
acc.clientMutators.push(...operation.clientMutators);
|
|
52663
52777
|
}
|
|
52778
|
+
if (operation.fetchReviver) {
|
|
52779
|
+
acc.fetchReviver.push(operation.fetchReviver);
|
|
52780
|
+
}
|
|
52664
52781
|
if (index3 === arr.length - 1) {
|
|
52665
52782
|
const isMutator = acc.mutators.some(
|
|
52666
52783
|
(mutator) => isAngularClient ? mutator.hasThirdArg : mutator.hasSecondArg
|
|
@@ -52707,7 +52824,8 @@ var generateTarget = (builder, options) => {
|
|
|
52707
52824
|
clientMutators: [],
|
|
52708
52825
|
formData: [],
|
|
52709
52826
|
formUrlEncoded: [],
|
|
52710
|
-
paramsSerializer: []
|
|
52827
|
+
paramsSerializer: [],
|
|
52828
|
+
fetchReviver: []
|
|
52711
52829
|
}
|
|
52712
52830
|
);
|
|
52713
52831
|
return {
|
|
@@ -52741,7 +52859,8 @@ var writeSingleMode = async ({
|
|
|
52741
52859
|
clientMutators,
|
|
52742
52860
|
formData,
|
|
52743
52861
|
formUrlEncoded,
|
|
52744
|
-
paramsSerializer
|
|
52862
|
+
paramsSerializer,
|
|
52863
|
+
fetchReviver
|
|
52745
52864
|
} = generateTarget(builder, output);
|
|
52746
52865
|
let data = header;
|
|
52747
52866
|
const schemasPath = output.schemas ? path_exports.relativeSafe(
|
|
@@ -52799,10 +52918,17 @@ var writeSingleMode = async ({
|
|
|
52799
52918
|
if (paramsSerializer) {
|
|
52800
52919
|
data += generateMutatorImports({ mutators: paramsSerializer });
|
|
52801
52920
|
}
|
|
52921
|
+
if (fetchReviver) {
|
|
52922
|
+
data += generateMutatorImports({ mutators: fetchReviver });
|
|
52923
|
+
}
|
|
52802
52924
|
if (implementation.includes("NonReadonly<")) {
|
|
52803
52925
|
data += getOrvalGeneratedTypes();
|
|
52804
52926
|
data += "\n";
|
|
52805
52927
|
}
|
|
52928
|
+
if (implementation.includes("TypedResponse<")) {
|
|
52929
|
+
data += getTypedResponse();
|
|
52930
|
+
data += "\n";
|
|
52931
|
+
}
|
|
52806
52932
|
if (!output.schemas && needSchema) {
|
|
52807
52933
|
data += generateModelsInline(builder.schemas);
|
|
52808
52934
|
}
|
|
@@ -52845,7 +52971,8 @@ var writeSplitMode = async ({
|
|
|
52845
52971
|
clientMutators,
|
|
52846
52972
|
formData,
|
|
52847
52973
|
formUrlEncoded,
|
|
52848
|
-
paramsSerializer
|
|
52974
|
+
paramsSerializer,
|
|
52975
|
+
fetchReviver
|
|
52849
52976
|
} = generateTarget(builder, output);
|
|
52850
52977
|
let implementationData = header;
|
|
52851
52978
|
let mockData = header;
|
|
@@ -52921,8 +53048,18 @@ var writeSplitMode = async ({
|
|
|
52921
53048
|
mutators: paramsSerializer
|
|
52922
53049
|
});
|
|
52923
53050
|
}
|
|
53051
|
+
if (fetchReviver) {
|
|
53052
|
+
implementationData += generateMutatorImports({
|
|
53053
|
+
mutators: fetchReviver
|
|
53054
|
+
});
|
|
53055
|
+
}
|
|
52924
53056
|
if (implementation.includes("NonReadonly<")) {
|
|
52925
53057
|
implementationData += getOrvalGeneratedTypes();
|
|
53058
|
+
implementationData += "\n";
|
|
53059
|
+
}
|
|
53060
|
+
if (implementation.includes("TypedResponse<")) {
|
|
53061
|
+
implementationData += getTypedResponse();
|
|
53062
|
+
implementationData += "\n";
|
|
52926
53063
|
}
|
|
52927
53064
|
implementationData += `
|
|
52928
53065
|
${implementation}`;
|
|
@@ -52971,6 +53108,7 @@ var generateTargetTags = (currentAcc, operation) => {
|
|
|
52971
53108
|
formData: operation.formData ? [operation.formData] : [],
|
|
52972
53109
|
formUrlEncoded: operation.formUrlEncoded ? [operation.formUrlEncoded] : [],
|
|
52973
53110
|
paramsSerializer: operation.paramsSerializer ? [operation.paramsSerializer] : [],
|
|
53111
|
+
fetchReviver: operation.fetchReviver ? [operation.fetchReviver] : [],
|
|
52974
53112
|
implementation: operation.implementation,
|
|
52975
53113
|
implementationMock: {
|
|
52976
53114
|
function: operation.implementationMock.function,
|
|
@@ -52999,7 +53137,8 @@ var generateTargetTags = (currentAcc, operation) => {
|
|
|
52999
53137
|
paramsSerializer: operation.paramsSerializer ? [
|
|
53000
53138
|
...currentOperation.paramsSerializer ?? [],
|
|
53001
53139
|
operation.paramsSerializer
|
|
53002
|
-
] : currentOperation.paramsSerializer
|
|
53140
|
+
] : currentOperation.paramsSerializer,
|
|
53141
|
+
fetchReviver: operation.fetchReviver ? [...currentOperation.fetchReviver ?? [], operation.fetchReviver] : currentOperation.fetchReviver
|
|
53003
53142
|
};
|
|
53004
53143
|
return currentAcc;
|
|
53005
53144
|
};
|
|
@@ -53056,7 +53195,8 @@ var generateTargetForTags = (builder, options) => {
|
|
|
53056
53195
|
clientMutators: target.clientMutators,
|
|
53057
53196
|
formData: target.formData,
|
|
53058
53197
|
formUrlEncoded: target.formUrlEncoded,
|
|
53059
|
-
paramsSerializer: target.paramsSerializer
|
|
53198
|
+
paramsSerializer: target.paramsSerializer,
|
|
53199
|
+
fetchReviver: target.fetchReviver
|
|
53060
53200
|
};
|
|
53061
53201
|
return acc2;
|
|
53062
53202
|
}, {});
|
|
@@ -53111,6 +53251,7 @@ var writeSplitTagsMode = async ({
|
|
|
53111
53251
|
mutators,
|
|
53112
53252
|
clientMutators,
|
|
53113
53253
|
formData,
|
|
53254
|
+
fetchReviver,
|
|
53114
53255
|
formUrlEncoded,
|
|
53115
53256
|
paramsSerializer
|
|
53116
53257
|
} = target2;
|
|
@@ -53189,10 +53330,20 @@ var writeSplitTagsMode = async ({
|
|
|
53189
53330
|
oneMore: true
|
|
53190
53331
|
});
|
|
53191
53332
|
}
|
|
53333
|
+
if (fetchReviver) {
|
|
53334
|
+
implementationData += generateMutatorImports({
|
|
53335
|
+
mutators: fetchReviver,
|
|
53336
|
+
oneMore: true
|
|
53337
|
+
});
|
|
53338
|
+
}
|
|
53192
53339
|
if (implementation.includes("NonReadonly<")) {
|
|
53193
53340
|
implementationData += getOrvalGeneratedTypes();
|
|
53194
53341
|
implementationData += "\n";
|
|
53195
53342
|
}
|
|
53343
|
+
if (implementation.includes("TypedResponse<")) {
|
|
53344
|
+
implementationData += getTypedResponse();
|
|
53345
|
+
implementationData += "\n";
|
|
53346
|
+
}
|
|
53196
53347
|
implementationData += `
|
|
53197
53348
|
${implementation}`;
|
|
53198
53349
|
mockData += `
|
|
@@ -53263,6 +53414,7 @@ var writeTagsMode = async ({
|
|
|
53263
53414
|
clientMutators,
|
|
53264
53415
|
formData,
|
|
53265
53416
|
formUrlEncoded,
|
|
53417
|
+
fetchReviver,
|
|
53266
53418
|
paramsSerializer
|
|
53267
53419
|
} = target2;
|
|
53268
53420
|
let data = header;
|
|
@@ -53329,11 +53481,18 @@ var writeTagsMode = async ({
|
|
|
53329
53481
|
if (paramsSerializer) {
|
|
53330
53482
|
data += generateMutatorImports({ mutators: paramsSerializer });
|
|
53331
53483
|
}
|
|
53484
|
+
if (fetchReviver) {
|
|
53485
|
+
data += generateMutatorImports({ mutators: fetchReviver });
|
|
53486
|
+
}
|
|
53332
53487
|
data += "\n\n";
|
|
53333
53488
|
if (implementation.includes("NonReadonly<")) {
|
|
53334
53489
|
data += getOrvalGeneratedTypes();
|
|
53335
53490
|
data += "\n";
|
|
53336
53491
|
}
|
|
53492
|
+
if (implementation.includes("TypedResponse<")) {
|
|
53493
|
+
data += getTypedResponse();
|
|
53494
|
+
data += "\n";
|
|
53495
|
+
}
|
|
53337
53496
|
data += implementation;
|
|
53338
53497
|
if (output.mock) {
|
|
53339
53498
|
data += "\n\n";
|
|
@@ -53434,6 +53593,7 @@ var writeTagsMode = async ({
|
|
|
53434
53593
|
getRoute,
|
|
53435
53594
|
getRouteAsArray,
|
|
53436
53595
|
getScalar,
|
|
53596
|
+
getTypedResponse,
|
|
53437
53597
|
ibmOpenapiValidator,
|
|
53438
53598
|
ibmOpenapiValidatorErrors,
|
|
53439
53599
|
ibmOpenapiValidatorWarnings,
|