@orval/core 7.4.1 → 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 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;
@@ -112,6 +113,7 @@ type NormalizedMutator = {
112
113
  name?: string;
113
114
  default: boolean;
114
115
  alias?: Record<string, string>;
116
+ extension?: string;
115
117
  };
116
118
  type NormalizedOperationOptions = {
117
119
  transformer?: OutputTransformer;
@@ -134,7 +136,7 @@ type NormalizedOperationOptions = {
134
136
  };
135
137
  type NormalizedInputOptions = {
136
138
  target: string | Record<string, unknown> | OpenAPIObject;
137
- validation: boolean;
139
+ validation: boolean | object;
138
140
  override: OverrideInput;
139
141
  converterOptions: swagger2openapi.Options;
140
142
  parserOptions: SwaggerParserOptions;
@@ -160,10 +162,18 @@ declare const PropertySortOrder: {
160
162
  readonly SPECIFICATION: "Specification";
161
163
  };
162
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];
163
172
  type OutputOptions = {
164
173
  workspace?: string;
165
174
  target?: string;
166
175
  schemas?: string;
176
+ namingConvention?: NamingConvention;
167
177
  fileExtension?: string;
168
178
  mode?: OutputMode;
169
179
  mock?: boolean | GlobalMockOptions | ClientMockBuilder;
@@ -196,7 +206,7 @@ type InputFiltersOption = {
196
206
  };
197
207
  type InputOptions = {
198
208
  target: string | Record<string, unknown> | OpenAPIObject;
199
- validation?: boolean;
209
+ validation?: boolean | object;
200
210
  override?: OverrideInput;
201
211
  converterOptions?: swagger2openapi.Options;
202
212
  parserOptions?: SwaggerParserOptions;
@@ -242,6 +252,7 @@ type GlobalMockOptions = {
242
252
  delayFunctionLazyExecute?: boolean;
243
253
  baseUrl?: string;
244
254
  locale?: keyof typeof allLocales;
255
+ indexMockFiles?: boolean;
245
256
  };
246
257
  type OverrideMockOptions = Partial<GlobalMockOptions> & {
247
258
  arrayMin?: number;
@@ -278,6 +289,7 @@ type MutatorObject = {
278
289
  name?: string;
279
290
  default?: boolean;
280
291
  alias?: Record<string, string>;
292
+ extension?: string;
281
293
  };
282
294
  type Mutator = string | MutatorObject;
283
295
  type ParamsSerializerOptions = {
@@ -337,7 +349,9 @@ type OverrideOutputContentType = {
337
349
  };
338
350
  type NormalizedHonoOptions = {
339
351
  handlers?: string;
352
+ compositeRoute: string;
340
353
  validator: boolean | 'hono';
354
+ validatorOutputPath: string;
341
355
  };
342
356
  type ZodOptions = {
343
357
  strict?: {
@@ -404,7 +418,9 @@ type NormalizedZodOptions = {
404
418
  };
405
419
  type HonoOptions = {
406
420
  handlers?: string;
421
+ compositeRoute?: string;
407
422
  validator?: boolean | 'hono';
423
+ validatorOutputPath?: string;
408
424
  };
409
425
  type NormalizedQueryOptions = {
410
426
  useQuery?: boolean;
@@ -498,7 +514,7 @@ declare const Verbs: {
498
514
  };
499
515
  type ImportOpenApi = {
500
516
  data: Record<string, unknown | OpenAPIObject>;
501
- input: InputOptions;
517
+ input: NormalizedInputOptions;
502
518
  output: NormalizedOutputOptions;
503
519
  target: string;
504
520
  workspace: string;
@@ -551,6 +567,7 @@ type GeneratorSchema = {
551
567
  type GeneratorImport = {
552
568
  name: string;
553
569
  schemaName?: string;
570
+ isConstant?: boolean;
554
571
  alias?: string;
555
572
  specKey?: string;
556
573
  default?: boolean;
@@ -930,12 +947,13 @@ declare const TEMPLATE_TAG_REGEX: RegExp;
930
947
 
931
948
  declare const generateComponentDefinition: (responses: ComponentsObject['responses'] | ComponentsObject['requestBodies'], context: ContextSpecs, suffix: string) => GeneratorSchema[];
932
949
 
933
- declare const generateImports: ({ imports, target, isRootKey, specsName, specKey: currentSpecKey, }: {
950
+ declare const generateImports: ({ imports, target, isRootKey, specsName, specKey: currentSpecKey, namingConvention, }: {
934
951
  imports: GeneratorImport[];
935
952
  target: string;
936
953
  isRootKey: boolean;
937
954
  specsName: Record<string, string>;
938
955
  specKey: string;
956
+ namingConvention?: NamingConvention | undefined;
939
957
  }) => string;
940
958
  declare const generateMutatorImports: ({ mutators, implementation, oneMore, }: {
941
959
  mutators: GeneratorMutator[];
@@ -1230,6 +1248,7 @@ declare const camel: (s: string) => string;
1230
1248
  declare const snake: (s: string) => string;
1231
1249
  declare const kebab: (s: string) => string;
1232
1250
  declare const upper: (s: string, fillWith: string, isDeapostrophe?: boolean) => string;
1251
+ declare const conventionName: (name: string, convention: NamingConvention) => string;
1233
1252
 
1234
1253
  declare const compareVersions: (firstVersion: string, secondVersions: string, operator?: CompareOperator) => boolean;
1235
1254
 
@@ -1408,26 +1427,28 @@ declare const isSyntheticDefaultImportsAllow: (config?: Tsconfig) => boolean;
1408
1427
  * More information: https://github.com/IBM/openapi-validator/#configuration
1409
1428
  * @param specs openAPI spec
1410
1429
  */
1411
- declare const ibmOpenapiValidator: (specs: OpenAPIObject) => Promise<void>;
1430
+ declare const ibmOpenapiValidator: (specs: OpenAPIObject, validation: boolean | object) => Promise<void>;
1412
1431
 
1413
1432
  declare const getIsBodyVerb: (verb: Verbs) => boolean;
1414
1433
 
1415
1434
  declare const writeModelInline: (acc: string, model: string) => string;
1416
1435
  declare const writeModelsInline: (array: GeneratorSchema[]) => string;
1417
- declare const writeSchema: ({ path, schema, target, fileExtension, specKey, isRootKey, specsName, header, }: {
1436
+ declare const writeSchema: ({ path, schema, target, namingConvention, fileExtension, specKey, isRootKey, specsName, header, }: {
1418
1437
  path: string;
1419
1438
  schema: GeneratorSchema;
1420
1439
  target: string;
1440
+ namingConvention: NamingConvention;
1421
1441
  fileExtension: string;
1422
1442
  specKey: string;
1423
1443
  isRootKey: boolean;
1424
1444
  specsName: Record<string, string>;
1425
1445
  header: string;
1426
1446
  }) => Promise<void>;
1427
- 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, }: {
1428
1448
  schemaPath: string;
1429
1449
  schemas: GeneratorSchema[];
1430
1450
  target: string;
1451
+ namingConvention: NamingConvention;
1431
1452
  fileExtension: string;
1432
1453
  specKey: string;
1433
1454
  isRootKey: boolean;
@@ -1450,4 +1471,4 @@ declare const generateTarget: (builder: WriteSpecsBuilder, options: NormalizedOu
1450
1471
 
1451
1472
  declare const generateTargetForTags: (builder: WriteSpecsBuilder, options: NormalizedOutputOptions) => Record<string, GeneratorTarget>;
1452
1473
 
1453
- 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 };