@orval/core 7.5.0 → 7.7.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 +23 -7
- package/dist/index.js +353 -245
- package/dist/index.js.map +1 -1
- package/package.json +5 -9
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ type NormalizedOutputOptions = {
|
|
|
33
33
|
workspace?: string;
|
|
34
34
|
target?: string;
|
|
35
35
|
schemas?: string;
|
|
36
|
+
namingConvention: NamingConvention;
|
|
36
37
|
fileExtension: string;
|
|
37
38
|
mode: OutputMode;
|
|
38
39
|
mock?: GlobalMockOptions | ClientMockBuilder;
|
|
@@ -135,7 +136,7 @@ type NormalizedOperationOptions = {
|
|
|
135
136
|
};
|
|
136
137
|
type NormalizedInputOptions = {
|
|
137
138
|
target: string | Record<string, unknown> | OpenAPIObject;
|
|
138
|
-
validation: boolean;
|
|
139
|
+
validation: boolean | object;
|
|
139
140
|
override: OverrideInput;
|
|
140
141
|
converterOptions: swagger2openapi.Options;
|
|
141
142
|
parserOptions: SwaggerParserOptions;
|
|
@@ -161,10 +162,18 @@ declare const PropertySortOrder: {
|
|
|
161
162
|
readonly SPECIFICATION: "Specification";
|
|
162
163
|
};
|
|
163
164
|
type PropertySortOrder = (typeof PropertySortOrder)[keyof typeof PropertySortOrder];
|
|
165
|
+
declare const NamingConvention: {
|
|
166
|
+
readonly CAMEL_CASE: "camelCase";
|
|
167
|
+
readonly PASCAL_CASE: "PascalCase";
|
|
168
|
+
readonly SNAKE_CASE: "snake_case";
|
|
169
|
+
readonly KEBAB_CASE: "kebab-case";
|
|
170
|
+
};
|
|
171
|
+
type NamingConvention = (typeof NamingConvention)[keyof typeof NamingConvention];
|
|
164
172
|
type OutputOptions = {
|
|
165
173
|
workspace?: string;
|
|
166
174
|
target?: string;
|
|
167
175
|
schemas?: string;
|
|
176
|
+
namingConvention?: NamingConvention;
|
|
168
177
|
fileExtension?: string;
|
|
169
178
|
mode?: OutputMode;
|
|
170
179
|
mock?: boolean | GlobalMockOptions | ClientMockBuilder;
|
|
@@ -197,7 +206,7 @@ type InputFiltersOption = {
|
|
|
197
206
|
};
|
|
198
207
|
type InputOptions = {
|
|
199
208
|
target: string | Record<string, unknown> | OpenAPIObject;
|
|
200
|
-
validation?: boolean;
|
|
209
|
+
validation?: boolean | object;
|
|
201
210
|
override?: OverrideInput;
|
|
202
211
|
converterOptions?: swagger2openapi.Options;
|
|
203
212
|
parserOptions?: SwaggerParserOptions;
|
|
@@ -428,6 +437,7 @@ type NormalizedQueryOptions = {
|
|
|
428
437
|
shouldExportMutatorHooks?: boolean;
|
|
429
438
|
shouldExportHttpClient?: boolean;
|
|
430
439
|
shouldExportQueryKey?: boolean;
|
|
440
|
+
shouldSplitQueryKey?: boolean;
|
|
431
441
|
signal?: boolean;
|
|
432
442
|
version?: 3 | 4 | 5;
|
|
433
443
|
};
|
|
@@ -446,6 +456,7 @@ type QueryOptions = {
|
|
|
446
456
|
shouldExportMutatorHooks?: boolean;
|
|
447
457
|
shouldExportHttpClient?: boolean;
|
|
448
458
|
shouldExportQueryKey?: boolean;
|
|
459
|
+
shouldSplitQueryKey?: boolean;
|
|
449
460
|
signal?: boolean;
|
|
450
461
|
version?: 3 | 4 | 5;
|
|
451
462
|
};
|
|
@@ -558,6 +569,7 @@ type GeneratorSchema = {
|
|
|
558
569
|
type GeneratorImport = {
|
|
559
570
|
name: string;
|
|
560
571
|
schemaName?: string;
|
|
572
|
+
isConstant?: boolean;
|
|
561
573
|
alias?: string;
|
|
562
574
|
specKey?: string;
|
|
563
575
|
default?: boolean;
|
|
@@ -937,12 +949,13 @@ declare const TEMPLATE_TAG_REGEX: RegExp;
|
|
|
937
949
|
|
|
938
950
|
declare const generateComponentDefinition: (responses: ComponentsObject['responses'] | ComponentsObject['requestBodies'], context: ContextSpecs, suffix: string) => GeneratorSchema[];
|
|
939
951
|
|
|
940
|
-
declare const generateImports: ({ imports, target, isRootKey, specsName, specKey: currentSpecKey, }: {
|
|
952
|
+
declare const generateImports: ({ imports, target, isRootKey, specsName, specKey: currentSpecKey, namingConvention, }: {
|
|
941
953
|
imports: GeneratorImport[];
|
|
942
954
|
target: string;
|
|
943
955
|
isRootKey: boolean;
|
|
944
956
|
specsName: Record<string, string>;
|
|
945
957
|
specKey: string;
|
|
958
|
+
namingConvention?: NamingConvention | undefined;
|
|
946
959
|
}) => string;
|
|
947
960
|
declare const generateMutatorImports: ({ mutators, implementation, oneMore, }: {
|
|
948
961
|
mutators: GeneratorMutator[];
|
|
@@ -1237,6 +1250,7 @@ declare const camel: (s: string) => string;
|
|
|
1237
1250
|
declare const snake: (s: string) => string;
|
|
1238
1251
|
declare const kebab: (s: string) => string;
|
|
1239
1252
|
declare const upper: (s: string, fillWith: string, isDeapostrophe?: boolean) => string;
|
|
1253
|
+
declare const conventionName: (name: string, convention: NamingConvention) => string;
|
|
1240
1254
|
|
|
1241
1255
|
declare const compareVersions: (firstVersion: string, secondVersions: string, operator?: CompareOperator) => boolean;
|
|
1242
1256
|
|
|
@@ -1415,26 +1429,28 @@ declare const isSyntheticDefaultImportsAllow: (config?: Tsconfig) => boolean;
|
|
|
1415
1429
|
* More information: https://github.com/IBM/openapi-validator/#configuration
|
|
1416
1430
|
* @param specs openAPI spec
|
|
1417
1431
|
*/
|
|
1418
|
-
declare const ibmOpenapiValidator: (specs: OpenAPIObject) => Promise<void>;
|
|
1432
|
+
declare const ibmOpenapiValidator: (specs: OpenAPIObject, validation: boolean | object) => Promise<void>;
|
|
1419
1433
|
|
|
1420
1434
|
declare const getIsBodyVerb: (verb: Verbs) => boolean;
|
|
1421
1435
|
|
|
1422
1436
|
declare const writeModelInline: (acc: string, model: string) => string;
|
|
1423
1437
|
declare const writeModelsInline: (array: GeneratorSchema[]) => string;
|
|
1424
|
-
declare const writeSchema: ({ path, schema, target, fileExtension, specKey, isRootKey, specsName, header, }: {
|
|
1438
|
+
declare const writeSchema: ({ path, schema, target, namingConvention, fileExtension, specKey, isRootKey, specsName, header, }: {
|
|
1425
1439
|
path: string;
|
|
1426
1440
|
schema: GeneratorSchema;
|
|
1427
1441
|
target: string;
|
|
1442
|
+
namingConvention: NamingConvention;
|
|
1428
1443
|
fileExtension: string;
|
|
1429
1444
|
specKey: string;
|
|
1430
1445
|
isRootKey: boolean;
|
|
1431
1446
|
specsName: Record<string, string>;
|
|
1432
1447
|
header: string;
|
|
1433
1448
|
}) => Promise<void>;
|
|
1434
|
-
declare const writeSchemas: ({ schemaPath, schemas, target, fileExtension, specKey, isRootKey, specsName, header, indexFiles, }: {
|
|
1449
|
+
declare const writeSchemas: ({ schemaPath, schemas, target, namingConvention, fileExtension, specKey, isRootKey, specsName, header, indexFiles, }: {
|
|
1435
1450
|
schemaPath: string;
|
|
1436
1451
|
schemas: GeneratorSchema[];
|
|
1437
1452
|
target: string;
|
|
1453
|
+
namingConvention: NamingConvention;
|
|
1438
1454
|
fileExtension: string;
|
|
1439
1455
|
specKey: string;
|
|
1440
1456
|
isRootKey: boolean;
|
|
@@ -1457,4 +1473,4 @@ declare const generateTarget: (builder: WriteSpecsBuilder, options: NormalizedOu
|
|
|
1457
1473
|
|
|
1458
1474
|
declare const generateTargetForTags: (builder: WriteSpecsBuilder, options: NormalizedOutputOptions) => Record<string, GeneratorTarget>;
|
|
1459
1475
|
|
|
1460
|
-
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, 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, 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 };
|
|
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 };
|