@orval/core 7.10.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 +24 -5
- package/dist/index.js +197 -41
- 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,
|
|
@@ -50390,6 +50407,51 @@ var getKey = (key) => {
|
|
|
50390
50407
|
return import_esutils4.keyword.isIdentifierNameES5(key) ? key : `'${key}'`;
|
|
50391
50408
|
};
|
|
50392
50409
|
|
|
50410
|
+
// src/getters/imports.ts
|
|
50411
|
+
var getAliasedImports = ({
|
|
50412
|
+
name,
|
|
50413
|
+
resolvedValue,
|
|
50414
|
+
existingImports,
|
|
50415
|
+
context
|
|
50416
|
+
}) => context.output.schemas && resolvedValue.isRef ? resolvedValue.imports.map((imp) => {
|
|
50417
|
+
if (!needCreateImportAlias({
|
|
50418
|
+
name,
|
|
50419
|
+
imp,
|
|
50420
|
+
existingImports
|
|
50421
|
+
})) {
|
|
50422
|
+
return imp;
|
|
50423
|
+
}
|
|
50424
|
+
const specName = pascal(
|
|
50425
|
+
getSpecName(imp.specKey ?? "", context.specKey)
|
|
50426
|
+
);
|
|
50427
|
+
const normalizedSpecName = /^\d/.test(specName) ? `__${specName}` : specName;
|
|
50428
|
+
return {
|
|
50429
|
+
...imp,
|
|
50430
|
+
alias: `${normalizedSpecName}__${imp.name}`
|
|
50431
|
+
};
|
|
50432
|
+
}) : resolvedValue.imports;
|
|
50433
|
+
var needCreateImportAlias = ({
|
|
50434
|
+
existingImports,
|
|
50435
|
+
imp,
|
|
50436
|
+
name
|
|
50437
|
+
}) => !imp.alias && // !!imp.specKey &&
|
|
50438
|
+
(imp.name === name || existingImports.some(
|
|
50439
|
+
(existingImport) => imp.name === existingImport.name && imp.specKey !== existingImport.specKey
|
|
50440
|
+
));
|
|
50441
|
+
var getImportAliasForRefOrValue = ({
|
|
50442
|
+
context,
|
|
50443
|
+
imports,
|
|
50444
|
+
resolvedValue
|
|
50445
|
+
}) => {
|
|
50446
|
+
if (!context.output.schemas || !resolvedValue.isRef) {
|
|
50447
|
+
return resolvedValue.value;
|
|
50448
|
+
}
|
|
50449
|
+
const importWithSameName = imports.find(
|
|
50450
|
+
(imp) => imp.name === resolvedValue.value
|
|
50451
|
+
);
|
|
50452
|
+
return importWithSameName?.alias ?? resolvedValue.value;
|
|
50453
|
+
};
|
|
50454
|
+
|
|
50393
50455
|
// src/getters/object.ts
|
|
50394
50456
|
var getObject = ({
|
|
50395
50457
|
item,
|
|
@@ -50421,7 +50483,7 @@ var getObject = ({
|
|
|
50421
50483
|
nullable
|
|
50422
50484
|
});
|
|
50423
50485
|
}
|
|
50424
|
-
if (item.type
|
|
50486
|
+
if (Array.isArray(item.type)) {
|
|
50425
50487
|
return combineSchemas({
|
|
50426
50488
|
schema: {
|
|
50427
50489
|
anyOf: item.type.map((type) => ({
|
|
@@ -50470,9 +50532,20 @@ var getObject = ({
|
|
|
50470
50532
|
}
|
|
50471
50533
|
const doc = jsDoc(schema, true, context);
|
|
50472
50534
|
acc.hasReadonlyProps ||= isReadOnly || false;
|
|
50473
|
-
|
|
50535
|
+
const aliasedImports = getAliasedImports({
|
|
50536
|
+
name,
|
|
50537
|
+
context,
|
|
50538
|
+
resolvedValue,
|
|
50539
|
+
existingImports: acc.imports
|
|
50540
|
+
});
|
|
50541
|
+
acc.imports.push(...aliasedImports);
|
|
50542
|
+
const propValue = getImportAliasForRefOrValue({
|
|
50543
|
+
context,
|
|
50544
|
+
resolvedValue,
|
|
50545
|
+
imports: aliasedImports
|
|
50546
|
+
});
|
|
50474
50547
|
acc.value += `
|
|
50475
|
-
${doc ? `${doc} ` : ""}${isReadOnly && !context.output.override.suppressReadonlyModifier ? "readonly " : ""}${getKey(key)}${isRequired ? "" : "?"}: ${
|
|
50548
|
+
${doc ? `${doc} ` : ""}${isReadOnly && !context.output.override.suppressReadonlyModifier ? "readonly " : ""}${getKey(key)}${isRequired ? "" : "?"}: ${propValue};`;
|
|
50476
50549
|
acc.schemas.push(...resolvedValue.schemas);
|
|
50477
50550
|
if (arr.length - 1 === index3) {
|
|
50478
50551
|
if (item.additionalProperties) {
|
|
@@ -50567,8 +50640,7 @@ var getScalar = ({
|
|
|
50567
50640
|
name,
|
|
50568
50641
|
context
|
|
50569
50642
|
}) => {
|
|
50570
|
-
const
|
|
50571
|
-
const nullable = item.nullable && !isAngularClient ? " | null" : "";
|
|
50643
|
+
const nullable = item.nullable ? " | null" : "";
|
|
50572
50644
|
const enumItems = item.enum?.filter((enumItem) => enumItem !== null);
|
|
50573
50645
|
if (!item.type && item.items) {
|
|
50574
50646
|
item.type = "array";
|
|
@@ -50793,8 +50865,19 @@ var combineSchemas = ({
|
|
|
50793
50865
|
combined: true,
|
|
50794
50866
|
context
|
|
50795
50867
|
});
|
|
50796
|
-
|
|
50797
|
-
|
|
50868
|
+
const aliasedImports = getAliasedImports({
|
|
50869
|
+
context,
|
|
50870
|
+
name,
|
|
50871
|
+
resolvedValue: resolvedValue2,
|
|
50872
|
+
existingImports: acc.imports
|
|
50873
|
+
});
|
|
50874
|
+
const value2 = getImportAliasForRefOrValue({
|
|
50875
|
+
context,
|
|
50876
|
+
resolvedValue: resolvedValue2,
|
|
50877
|
+
imports: aliasedImports
|
|
50878
|
+
});
|
|
50879
|
+
acc.values.push(value2);
|
|
50880
|
+
acc.imports.push(...aliasedImports);
|
|
50798
50881
|
acc.schemas.push(...resolvedValue2.schemas);
|
|
50799
50882
|
acc.isEnum.push(resolvedValue2.isEnum);
|
|
50800
50883
|
acc.types.push(resolvedValue2.type);
|
|
@@ -51090,8 +51173,8 @@ var getProps = ({
|
|
|
51090
51173
|
};
|
|
51091
51174
|
const queryParamsProp = {
|
|
51092
51175
|
name: "params",
|
|
51093
|
-
definition:
|
|
51094
|
-
implementation:
|
|
51176
|
+
definition: getQueryParamDefinition(queryParams, context),
|
|
51177
|
+
implementation: getQueryParamDefinition(queryParams, context),
|
|
51095
51178
|
default: false,
|
|
51096
51179
|
required: !isUndefined(queryParams?.isOptional) ? !queryParams?.isOptional && !context.output.allParamsOptional : !context.output.allParamsOptional,
|
|
51097
51180
|
type: GetterPropType.QUERY_PARAM
|
|
@@ -51147,6 +51230,13 @@ var getProps = ({
|
|
|
51147
51230
|
const sortedProps = sortByPriority(props);
|
|
51148
51231
|
return sortedProps;
|
|
51149
51232
|
};
|
|
51233
|
+
function getQueryParamDefinition(queryParams, context) {
|
|
51234
|
+
let paramType = queryParams?.schema.name;
|
|
51235
|
+
if (OutputClient.ANGULAR === context.output.client) {
|
|
51236
|
+
paramType = `DeepNonNullable<${paramType}>`;
|
|
51237
|
+
}
|
|
51238
|
+
return `params${queryParams?.isOptional || context.output.allParamsOptional ? "?" : ""}: ${paramType}`;
|
|
51239
|
+
}
|
|
51150
51240
|
|
|
51151
51241
|
// src/getters/query-params.ts
|
|
51152
51242
|
var getQueryParamsTypes = (queryParams, operationName, context) => {
|
|
@@ -51194,7 +51284,8 @@ var getQueryParamsTypes = (queryParams, operationName, context) => {
|
|
|
51194
51284
|
enumName,
|
|
51195
51285
|
getEnumNames(resolvedValue.originalSchema),
|
|
51196
51286
|
context.output.override.enumGenerationType,
|
|
51197
|
-
getEnumDescriptions(resolvedValue.originalSchema)
|
|
51287
|
+
getEnumDescriptions(resolvedValue.originalSchema),
|
|
51288
|
+
context.output.override.namingConvention?.enum
|
|
51198
51289
|
);
|
|
51199
51290
|
return {
|
|
51200
51291
|
definition: `${doc}${key}${!required || schema.default ? "?" : ""}: ${enumName};`,
|
|
@@ -51269,8 +51360,8 @@ var getResponse = ({
|
|
|
51269
51360
|
Object.entries(responses),
|
|
51270
51361
|
operationName,
|
|
51271
51362
|
context,
|
|
51272
|
-
"
|
|
51273
|
-
(type) => type.key
|
|
51363
|
+
"null",
|
|
51364
|
+
(type) => `${type.key}-${type.value}`
|
|
51274
51365
|
);
|
|
51275
51366
|
const filteredTypes = contentType ? types.filter((type) => {
|
|
51276
51367
|
let include = true;
|
|
@@ -51893,7 +51984,7 @@ var generateAxiosOptions = ({
|
|
|
51893
51984
|
paramsSerializerOptions
|
|
51894
51985
|
}) => {
|
|
51895
51986
|
const isRequestOptions = requestOptions !== false;
|
|
51896
|
-
if (!queryParams && !headers && !response.isBlob) {
|
|
51987
|
+
if (!queryParams && !headers && !response.isBlob && response.definition.success !== "string") {
|
|
51897
51988
|
if (isRequestOptions) {
|
|
51898
51989
|
return "options";
|
|
51899
51990
|
}
|
|
@@ -51914,9 +52005,14 @@ var generateAxiosOptions = ({
|
|
|
51914
52005
|
value += !isExactOptionalPropertyTypes ? "\n signal," : "\n ...(signal ? { signal } : {}),";
|
|
51915
52006
|
}
|
|
51916
52007
|
}
|
|
51917
|
-
if (
|
|
51918
|
-
|
|
52008
|
+
if (!isObject(requestOptions) || !requestOptions.hasOwnProperty("responseType")) {
|
|
52009
|
+
if (response.isBlob) {
|
|
52010
|
+
value += `
|
|
51919
52011
|
responseType: 'blob',`;
|
|
52012
|
+
} else if (response.definition.success === "string") {
|
|
52013
|
+
value += `
|
|
52014
|
+
responseType: 'text',`;
|
|
52015
|
+
}
|
|
51920
52016
|
}
|
|
51921
52017
|
if (isObject(requestOptions)) {
|
|
51922
52018
|
value += `
|
|
@@ -52174,7 +52270,7 @@ export type ${name} = typeof ${name}Value;
|
|
|
52174
52270
|
`;
|
|
52175
52271
|
}
|
|
52176
52272
|
const externalModulesImportsOnly = scalar.imports.filter(
|
|
52177
|
-
(importName) => importName.name !== name
|
|
52273
|
+
(importName) => importName.alias ? importName.alias !== name : importName.name !== name
|
|
52178
52274
|
);
|
|
52179
52275
|
return [
|
|
52180
52276
|
...scalar.schemas,
|
|
@@ -52236,7 +52332,8 @@ var generateSchemasDefinition = (schemas = {}, context, suffix, filters) => {
|
|
|
52236
52332
|
schemaName,
|
|
52237
52333
|
getEnumNames(resolvedValue.originalSchema),
|
|
52238
52334
|
context.output.override.enumGenerationType,
|
|
52239
|
-
getEnumDescriptions(resolvedValue.originalSchema)
|
|
52335
|
+
getEnumDescriptions(resolvedValue.originalSchema),
|
|
52336
|
+
context.output.override.namingConvention?.enum
|
|
52240
52337
|
);
|
|
52241
52338
|
} else if (schemaName === resolvedValue.value && resolvedValue.isRef) {
|
|
52242
52339
|
const { schema: referredSchema } = resolveRef(schema, context);
|
|
@@ -52384,6 +52481,13 @@ var generateVerbOptions = async ({
|
|
|
52384
52481
|
workspace: context.workspace,
|
|
52385
52482
|
tsconfig: context.output.tsconfig
|
|
52386
52483
|
}) : void 0;
|
|
52484
|
+
const fetchReviver = isString2(override?.fetch.jsonReviver) || isObject(override?.fetch.jsonReviver) ? await generateMutator({
|
|
52485
|
+
output: output.target,
|
|
52486
|
+
name: "fetchReviver",
|
|
52487
|
+
mutator: override.fetch.jsonReviver,
|
|
52488
|
+
workspace: context.workspace,
|
|
52489
|
+
tsconfig: context.output.tsconfig
|
|
52490
|
+
}) : void 0;
|
|
52387
52491
|
const doc = jsDoc({ description, deprecated, summary });
|
|
52388
52492
|
const verbOption = {
|
|
52389
52493
|
verb,
|
|
@@ -52403,6 +52507,7 @@ var generateVerbOptions = async ({
|
|
|
52403
52507
|
formData,
|
|
52404
52508
|
formUrlEncoded,
|
|
52405
52509
|
paramsSerializer,
|
|
52510
|
+
fetchReviver,
|
|
52406
52511
|
override,
|
|
52407
52512
|
doc,
|
|
52408
52513
|
deprecated,
|
|
@@ -52614,6 +52719,11 @@ type NonReadonly<T> = [T] extends [UnionToIntersection<T>] ? {
|
|
|
52614
52719
|
: T[P];
|
|
52615
52720
|
} : DistributeReadOnlyOverUnions<T>;
|
|
52616
52721
|
`;
|
|
52722
|
+
var getTypedResponse = () => `
|
|
52723
|
+
interface TypedResponse<T> extends Response {
|
|
52724
|
+
json(): Promise<T>;
|
|
52725
|
+
}
|
|
52726
|
+
`;
|
|
52617
52727
|
|
|
52618
52728
|
// src/writers/single-mode.ts
|
|
52619
52729
|
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
@@ -52661,6 +52771,9 @@ var generateTarget = (builder, options) => {
|
|
|
52661
52771
|
if (operation.clientMutators) {
|
|
52662
52772
|
acc.clientMutators.push(...operation.clientMutators);
|
|
52663
52773
|
}
|
|
52774
|
+
if (operation.fetchReviver) {
|
|
52775
|
+
acc.fetchReviver.push(operation.fetchReviver);
|
|
52776
|
+
}
|
|
52664
52777
|
if (index3 === arr.length - 1) {
|
|
52665
52778
|
const isMutator = acc.mutators.some(
|
|
52666
52779
|
(mutator) => isAngularClient ? mutator.hasThirdArg : mutator.hasSecondArg
|
|
@@ -52707,7 +52820,8 @@ var generateTarget = (builder, options) => {
|
|
|
52707
52820
|
clientMutators: [],
|
|
52708
52821
|
formData: [],
|
|
52709
52822
|
formUrlEncoded: [],
|
|
52710
|
-
paramsSerializer: []
|
|
52823
|
+
paramsSerializer: [],
|
|
52824
|
+
fetchReviver: []
|
|
52711
52825
|
}
|
|
52712
52826
|
);
|
|
52713
52827
|
return {
|
|
@@ -52741,7 +52855,8 @@ var writeSingleMode = async ({
|
|
|
52741
52855
|
clientMutators,
|
|
52742
52856
|
formData,
|
|
52743
52857
|
formUrlEncoded,
|
|
52744
|
-
paramsSerializer
|
|
52858
|
+
paramsSerializer,
|
|
52859
|
+
fetchReviver
|
|
52745
52860
|
} = generateTarget(builder, output);
|
|
52746
52861
|
let data = header;
|
|
52747
52862
|
const schemasPath = output.schemas ? path_exports.relativeSafe(
|
|
@@ -52799,10 +52914,17 @@ var writeSingleMode = async ({
|
|
|
52799
52914
|
if (paramsSerializer) {
|
|
52800
52915
|
data += generateMutatorImports({ mutators: paramsSerializer });
|
|
52801
52916
|
}
|
|
52917
|
+
if (fetchReviver) {
|
|
52918
|
+
data += generateMutatorImports({ mutators: fetchReviver });
|
|
52919
|
+
}
|
|
52802
52920
|
if (implementation.includes("NonReadonly<")) {
|
|
52803
52921
|
data += getOrvalGeneratedTypes();
|
|
52804
52922
|
data += "\n";
|
|
52805
52923
|
}
|
|
52924
|
+
if (implementation.includes("TypedResponse<")) {
|
|
52925
|
+
data += getTypedResponse();
|
|
52926
|
+
data += "\n";
|
|
52927
|
+
}
|
|
52806
52928
|
if (!output.schemas && needSchema) {
|
|
52807
52929
|
data += generateModelsInline(builder.schemas);
|
|
52808
52930
|
}
|
|
@@ -52845,7 +52967,8 @@ var writeSplitMode = async ({
|
|
|
52845
52967
|
clientMutators,
|
|
52846
52968
|
formData,
|
|
52847
52969
|
formUrlEncoded,
|
|
52848
|
-
paramsSerializer
|
|
52970
|
+
paramsSerializer,
|
|
52971
|
+
fetchReviver
|
|
52849
52972
|
} = generateTarget(builder, output);
|
|
52850
52973
|
let implementationData = header;
|
|
52851
52974
|
let mockData = header;
|
|
@@ -52921,8 +53044,18 @@ var writeSplitMode = async ({
|
|
|
52921
53044
|
mutators: paramsSerializer
|
|
52922
53045
|
});
|
|
52923
53046
|
}
|
|
53047
|
+
if (fetchReviver) {
|
|
53048
|
+
implementationData += generateMutatorImports({
|
|
53049
|
+
mutators: fetchReviver
|
|
53050
|
+
});
|
|
53051
|
+
}
|
|
52924
53052
|
if (implementation.includes("NonReadonly<")) {
|
|
52925
53053
|
implementationData += getOrvalGeneratedTypes();
|
|
53054
|
+
implementationData += "\n";
|
|
53055
|
+
}
|
|
53056
|
+
if (implementation.includes("TypedResponse<")) {
|
|
53057
|
+
implementationData += getTypedResponse();
|
|
53058
|
+
implementationData += "\n";
|
|
52926
53059
|
}
|
|
52927
53060
|
implementationData += `
|
|
52928
53061
|
${implementation}`;
|
|
@@ -52971,6 +53104,7 @@ var generateTargetTags = (currentAcc, operation) => {
|
|
|
52971
53104
|
formData: operation.formData ? [operation.formData] : [],
|
|
52972
53105
|
formUrlEncoded: operation.formUrlEncoded ? [operation.formUrlEncoded] : [],
|
|
52973
53106
|
paramsSerializer: operation.paramsSerializer ? [operation.paramsSerializer] : [],
|
|
53107
|
+
fetchReviver: operation.fetchReviver ? [operation.fetchReviver] : [],
|
|
52974
53108
|
implementation: operation.implementation,
|
|
52975
53109
|
implementationMock: {
|
|
52976
53110
|
function: operation.implementationMock.function,
|
|
@@ -52999,7 +53133,8 @@ var generateTargetTags = (currentAcc, operation) => {
|
|
|
52999
53133
|
paramsSerializer: operation.paramsSerializer ? [
|
|
53000
53134
|
...currentOperation.paramsSerializer ?? [],
|
|
53001
53135
|
operation.paramsSerializer
|
|
53002
|
-
] : currentOperation.paramsSerializer
|
|
53136
|
+
] : currentOperation.paramsSerializer,
|
|
53137
|
+
fetchReviver: operation.fetchReviver ? [...currentOperation.fetchReviver ?? [], operation.fetchReviver] : currentOperation.fetchReviver
|
|
53003
53138
|
};
|
|
53004
53139
|
return currentAcc;
|
|
53005
53140
|
};
|
|
@@ -53056,7 +53191,8 @@ var generateTargetForTags = (builder, options) => {
|
|
|
53056
53191
|
clientMutators: target.clientMutators,
|
|
53057
53192
|
formData: target.formData,
|
|
53058
53193
|
formUrlEncoded: target.formUrlEncoded,
|
|
53059
|
-
paramsSerializer: target.paramsSerializer
|
|
53194
|
+
paramsSerializer: target.paramsSerializer,
|
|
53195
|
+
fetchReviver: target.fetchReviver
|
|
53060
53196
|
};
|
|
53061
53197
|
return acc2;
|
|
53062
53198
|
}, {});
|
|
@@ -53111,6 +53247,7 @@ var writeSplitTagsMode = async ({
|
|
|
53111
53247
|
mutators,
|
|
53112
53248
|
clientMutators,
|
|
53113
53249
|
formData,
|
|
53250
|
+
fetchReviver,
|
|
53114
53251
|
formUrlEncoded,
|
|
53115
53252
|
paramsSerializer
|
|
53116
53253
|
} = target2;
|
|
@@ -53189,10 +53326,20 @@ var writeSplitTagsMode = async ({
|
|
|
53189
53326
|
oneMore: true
|
|
53190
53327
|
});
|
|
53191
53328
|
}
|
|
53329
|
+
if (fetchReviver) {
|
|
53330
|
+
implementationData += generateMutatorImports({
|
|
53331
|
+
mutators: fetchReviver,
|
|
53332
|
+
oneMore: true
|
|
53333
|
+
});
|
|
53334
|
+
}
|
|
53192
53335
|
if (implementation.includes("NonReadonly<")) {
|
|
53193
53336
|
implementationData += getOrvalGeneratedTypes();
|
|
53194
53337
|
implementationData += "\n";
|
|
53195
53338
|
}
|
|
53339
|
+
if (implementation.includes("TypedResponse<")) {
|
|
53340
|
+
implementationData += getTypedResponse();
|
|
53341
|
+
implementationData += "\n";
|
|
53342
|
+
}
|
|
53196
53343
|
implementationData += `
|
|
53197
53344
|
${implementation}`;
|
|
53198
53345
|
mockData += `
|
|
@@ -53263,6 +53410,7 @@ var writeTagsMode = async ({
|
|
|
53263
53410
|
clientMutators,
|
|
53264
53411
|
formData,
|
|
53265
53412
|
formUrlEncoded,
|
|
53413
|
+
fetchReviver,
|
|
53266
53414
|
paramsSerializer
|
|
53267
53415
|
} = target2;
|
|
53268
53416
|
let data = header;
|
|
@@ -53329,11 +53477,18 @@ var writeTagsMode = async ({
|
|
|
53329
53477
|
if (paramsSerializer) {
|
|
53330
53478
|
data += generateMutatorImports({ mutators: paramsSerializer });
|
|
53331
53479
|
}
|
|
53480
|
+
if (fetchReviver) {
|
|
53481
|
+
data += generateMutatorImports({ mutators: fetchReviver });
|
|
53482
|
+
}
|
|
53332
53483
|
data += "\n\n";
|
|
53333
53484
|
if (implementation.includes("NonReadonly<")) {
|
|
53334
53485
|
data += getOrvalGeneratedTypes();
|
|
53335
53486
|
data += "\n";
|
|
53336
53487
|
}
|
|
53488
|
+
if (implementation.includes("TypedResponse<")) {
|
|
53489
|
+
data += getTypedResponse();
|
|
53490
|
+
data += "\n";
|
|
53491
|
+
}
|
|
53337
53492
|
data += implementation;
|
|
53338
53493
|
if (output.mock) {
|
|
53339
53494
|
data += "\n\n";
|
|
@@ -53434,6 +53589,7 @@ var writeTagsMode = async ({
|
|
|
53434
53589
|
getRoute,
|
|
53435
53590
|
getRouteAsArray,
|
|
53436
53591
|
getScalar,
|
|
53592
|
+
getTypedResponse,
|
|
53437
53593
|
ibmOpenapiValidator,
|
|
53438
53594
|
ibmOpenapiValidatorErrors,
|
|
53439
53595
|
ibmOpenapiValidatorWarnings,
|