@orval/core 7.5.0 → 7.6.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 +21 -7
- package/dist/index.js +344 -242
- package/dist/index.js.map +1 -1
- package/package.json +4 -8
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;
|
|
@@ -558,6 +567,7 @@ type GeneratorSchema = {
|
|
|
558
567
|
type GeneratorImport = {
|
|
559
568
|
name: string;
|
|
560
569
|
schemaName?: string;
|
|
570
|
+
isConstant?: boolean;
|
|
561
571
|
alias?: string;
|
|
562
572
|
specKey?: string;
|
|
563
573
|
default?: boolean;
|
|
@@ -937,12 +947,13 @@ declare const TEMPLATE_TAG_REGEX: RegExp;
|
|
|
937
947
|
|
|
938
948
|
declare const generateComponentDefinition: (responses: ComponentsObject['responses'] | ComponentsObject['requestBodies'], context: ContextSpecs, suffix: string) => GeneratorSchema[];
|
|
939
949
|
|
|
940
|
-
declare const generateImports: ({ imports, target, isRootKey, specsName, specKey: currentSpecKey, }: {
|
|
950
|
+
declare const generateImports: ({ imports, target, isRootKey, specsName, specKey: currentSpecKey, namingConvention, }: {
|
|
941
951
|
imports: GeneratorImport[];
|
|
942
952
|
target: string;
|
|
943
953
|
isRootKey: boolean;
|
|
944
954
|
specsName: Record<string, string>;
|
|
945
955
|
specKey: string;
|
|
956
|
+
namingConvention?: NamingConvention | undefined;
|
|
946
957
|
}) => string;
|
|
947
958
|
declare const generateMutatorImports: ({ mutators, implementation, oneMore, }: {
|
|
948
959
|
mutators: GeneratorMutator[];
|
|
@@ -1237,6 +1248,7 @@ declare const camel: (s: string) => string;
|
|
|
1237
1248
|
declare const snake: (s: string) => string;
|
|
1238
1249
|
declare const kebab: (s: string) => string;
|
|
1239
1250
|
declare const upper: (s: string, fillWith: string, isDeapostrophe?: boolean) => string;
|
|
1251
|
+
declare const conventionName: (name: string, convention: NamingConvention) => string;
|
|
1240
1252
|
|
|
1241
1253
|
declare const compareVersions: (firstVersion: string, secondVersions: string, operator?: CompareOperator) => boolean;
|
|
1242
1254
|
|
|
@@ -1415,26 +1427,28 @@ declare const isSyntheticDefaultImportsAllow: (config?: Tsconfig) => boolean;
|
|
|
1415
1427
|
* More information: https://github.com/IBM/openapi-validator/#configuration
|
|
1416
1428
|
* @param specs openAPI spec
|
|
1417
1429
|
*/
|
|
1418
|
-
declare const ibmOpenapiValidator: (specs: OpenAPIObject) => Promise<void>;
|
|
1430
|
+
declare const ibmOpenapiValidator: (specs: OpenAPIObject, validation: boolean | object) => Promise<void>;
|
|
1419
1431
|
|
|
1420
1432
|
declare const getIsBodyVerb: (verb: Verbs) => boolean;
|
|
1421
1433
|
|
|
1422
1434
|
declare const writeModelInline: (acc: string, model: string) => string;
|
|
1423
1435
|
declare const writeModelsInline: (array: GeneratorSchema[]) => string;
|
|
1424
|
-
declare const writeSchema: ({ path, schema, target, fileExtension, specKey, isRootKey, specsName, header, }: {
|
|
1436
|
+
declare const writeSchema: ({ path, schema, target, namingConvention, fileExtension, specKey, isRootKey, specsName, header, }: {
|
|
1425
1437
|
path: string;
|
|
1426
1438
|
schema: GeneratorSchema;
|
|
1427
1439
|
target: string;
|
|
1440
|
+
namingConvention: NamingConvention;
|
|
1428
1441
|
fileExtension: string;
|
|
1429
1442
|
specKey: string;
|
|
1430
1443
|
isRootKey: boolean;
|
|
1431
1444
|
specsName: Record<string, string>;
|
|
1432
1445
|
header: string;
|
|
1433
1446
|
}) => Promise<void>;
|
|
1434
|
-
declare const writeSchemas: ({ schemaPath, schemas, target, fileExtension, specKey, isRootKey, specsName, header, indexFiles, }: {
|
|
1447
|
+
declare const writeSchemas: ({ schemaPath, schemas, target, namingConvention, fileExtension, specKey, isRootKey, specsName, header, indexFiles, }: {
|
|
1435
1448
|
schemaPath: string;
|
|
1436
1449
|
schemas: GeneratorSchema[];
|
|
1437
1450
|
target: string;
|
|
1451
|
+
namingConvention: NamingConvention;
|
|
1438
1452
|
fileExtension: string;
|
|
1439
1453
|
specKey: string;
|
|
1440
1454
|
isRootKey: boolean;
|
|
@@ -1457,4 +1471,4 @@ declare const generateTarget: (builder: WriteSpecsBuilder, options: NormalizedOu
|
|
|
1457
1471
|
|
|
1458
1472
|
declare const generateTargetForTags: (builder: WriteSpecsBuilder, options: NormalizedOutputOptions) => Record<string, GeneratorTarget>;
|
|
1459
1473
|
|
|
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 };
|
|
1474
|
+
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 };
|