@orval/core 7.14.0 → 8.0.0-rc.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/chunk-Bp6m_JJh.js +13 -0
- package/dist/index.d.ts +15 -31
- package/dist/index.js +260 -600
- package/dist/index.js.map +1 -1
- package/package.json +16 -16
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (all) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
return target;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __export as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import { t as __export } from "./chunk-Bp6m_JJh.js";
|
|
2
|
+
import { CompareOperator } from "compare-versions";
|
|
3
|
+
import debug from "debug";
|
|
4
|
+
import { ConvertInputOptions } from "swagger2openapi";
|
|
1
5
|
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
2
6
|
import { allLocales } from "@faker-js/faker";
|
|
3
7
|
import { JSONSchema6, JSONSchema7 } from "json-schema";
|
|
4
8
|
import { ComponentsObject, ExampleObject, InfoObject, OpenAPIObject, OperationObject, ParameterObject, PathItemObject, ReferenceObject, RequestBodyObject, ResponseObject, ResponsesObject, SchemaObject, SchemasObject } from "openapi3-ts/oas30";
|
|
5
|
-
import { ConvertInputOptions } from "swagger2openapi";
|
|
6
9
|
import { TypeDocOptions } from "typedoc";
|
|
7
10
|
import { ValueIteratee } from "lodash";
|
|
8
11
|
import { ServerObject } from "openapi3-ts/oas31";
|
|
9
|
-
import { CompareOperator } from "compare-versions";
|
|
10
|
-
import debug from "debug";
|
|
11
12
|
|
|
12
|
-
//#region rolldown:runtime
|
|
13
|
-
//#endregion
|
|
14
13
|
//#region src/types.d.ts
|
|
15
14
|
interface Options {
|
|
16
15
|
output?: string | OutputOptions;
|
|
@@ -97,7 +96,6 @@ type NormalizedOverrideOutput = {
|
|
|
97
96
|
operationName?: (operation: OperationObject, route: string, verb: Verbs) => string;
|
|
98
97
|
requestOptions: Record<string, any> | boolean;
|
|
99
98
|
useDates?: boolean;
|
|
100
|
-
coerceTypes?: boolean;
|
|
101
99
|
useTypeOverInterfaces?: boolean;
|
|
102
100
|
useDeprecatedOperations?: boolean;
|
|
103
101
|
useBigInt?: boolean;
|
|
@@ -364,10 +362,6 @@ type OverrideOutput = {
|
|
|
364
362
|
useDeprecatedOperations?: boolean;
|
|
365
363
|
useBigInt?: boolean;
|
|
366
364
|
useNamedParameters?: boolean;
|
|
367
|
-
/**
|
|
368
|
-
* @deprecated use 'enumGenerationType="enum"' instead
|
|
369
|
-
*/
|
|
370
|
-
useNativeEnums?: boolean;
|
|
371
365
|
enumGenerationType?: EnumGeneration;
|
|
372
366
|
suppressReadonlyModifier?: boolean;
|
|
373
367
|
jsDoc?: JsDocOptions;
|
|
@@ -483,6 +477,7 @@ type NormalizedQueryOptions = {
|
|
|
483
477
|
useSuspenseInfiniteQuery?: boolean;
|
|
484
478
|
useInfiniteQueryParam?: string;
|
|
485
479
|
usePrefetch?: boolean;
|
|
480
|
+
useInvalidate?: boolean;
|
|
486
481
|
options?: any;
|
|
487
482
|
queryKey?: NormalizedMutator;
|
|
488
483
|
queryOptions?: NormalizedMutator;
|
|
@@ -493,7 +488,7 @@ type NormalizedQueryOptions = {
|
|
|
493
488
|
shouldSplitQueryKey?: boolean;
|
|
494
489
|
useOperationIdAsQueryKey?: boolean;
|
|
495
490
|
signal?: boolean;
|
|
496
|
-
version?:
|
|
491
|
+
version?: 4 | 5;
|
|
497
492
|
};
|
|
498
493
|
type QueryOptions = {
|
|
499
494
|
useQuery?: boolean;
|
|
@@ -503,6 +498,7 @@ type QueryOptions = {
|
|
|
503
498
|
useSuspenseInfiniteQuery?: boolean;
|
|
504
499
|
useInfiniteQueryParam?: string;
|
|
505
500
|
usePrefetch?: boolean;
|
|
501
|
+
useInvalidate?: boolean;
|
|
506
502
|
options?: any;
|
|
507
503
|
queryKey?: Mutator;
|
|
508
504
|
queryOptions?: Mutator;
|
|
@@ -513,7 +509,7 @@ type QueryOptions = {
|
|
|
513
509
|
shouldSplitQueryKey?: boolean;
|
|
514
510
|
useOperationIdAsQueryKey?: boolean;
|
|
515
511
|
signal?: boolean;
|
|
516
|
-
version?:
|
|
512
|
+
version?: 4 | 5;
|
|
517
513
|
};
|
|
518
514
|
type AngularOptions = {
|
|
519
515
|
provideIn?: 'root' | 'any' | boolean;
|
|
@@ -528,13 +524,11 @@ type SwrOptions = {
|
|
|
528
524
|
type NormalizedFetchOptions = {
|
|
529
525
|
includeHttpResponseReturnType: boolean;
|
|
530
526
|
forceSuccessResponse: boolean;
|
|
531
|
-
explode: boolean;
|
|
532
527
|
jsonReviver?: Mutator;
|
|
533
528
|
};
|
|
534
529
|
type FetchOptions = {
|
|
535
530
|
includeHttpResponseReturnType?: boolean;
|
|
536
531
|
forceSuccessResponse?: boolean;
|
|
537
|
-
explode?: boolean;
|
|
538
532
|
jsonReviver?: Mutator;
|
|
539
533
|
};
|
|
540
534
|
type InputTransformerFn = (spec: OpenAPIObject) => OpenAPIObject;
|
|
@@ -568,7 +562,7 @@ interface HookOption {
|
|
|
568
562
|
}
|
|
569
563
|
type HookCommand = string | HookFunction | HookOption | (string | HookFunction | HookOption)[];
|
|
570
564
|
type NormalizedHookCommand = HookCommand[];
|
|
571
|
-
type HooksOptions<T = HookCommand | NormalizedHookCommand> = Partial<Record<Hook, T>>;
|
|
565
|
+
type HooksOptions<T$1 = HookCommand | NormalizedHookCommand> = Partial<Record<Hook, T$1>>;
|
|
572
566
|
type NormalizedHookOptions = HooksOptions<NormalizedHookCommand>;
|
|
573
567
|
type Verbs = 'post' | 'put' | 'get' | 'patch' | 'delete' | 'head';
|
|
574
568
|
declare const Verbs: {
|
|
@@ -639,6 +633,7 @@ type GeneratorImport = {
|
|
|
639
633
|
default?: boolean;
|
|
640
634
|
values?: boolean;
|
|
641
635
|
syntheticDefaultImport?: boolean;
|
|
636
|
+
namespaceImport?: boolean;
|
|
642
637
|
};
|
|
643
638
|
type GeneratorDependency = {
|
|
644
639
|
exports: GeneratorImport[];
|
|
@@ -1080,7 +1075,7 @@ declare const generateModelsInline: (obj: Record<string, GeneratorSchema[]>) =>
|
|
|
1080
1075
|
//#endregion
|
|
1081
1076
|
//#region src/generators/mutator.d.ts
|
|
1082
1077
|
declare const BODY_TYPE_NAME = "BodyType";
|
|
1083
|
-
declare
|
|
1078
|
+
declare function generateMutator({
|
|
1084
1079
|
output,
|
|
1085
1080
|
mutator,
|
|
1086
1081
|
name,
|
|
@@ -1092,7 +1087,7 @@ declare const generateMutator: ({
|
|
|
1092
1087
|
name: string;
|
|
1093
1088
|
workspace: string;
|
|
1094
1089
|
tsconfig?: Tsconfig;
|
|
1095
|
-
})
|
|
1090
|
+
}): Promise<GeneratorMutator | undefined>;
|
|
1096
1091
|
//#endregion
|
|
1097
1092
|
//#region src/generators/options.d.ts
|
|
1098
1093
|
declare const generateBodyOptions: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
@@ -1503,7 +1498,7 @@ interface DebuggerOptions {
|
|
|
1503
1498
|
declare function createDebugger(ns: string, options?: DebuggerOptions): debug.Debugger['log'];
|
|
1504
1499
|
//#endregion
|
|
1505
1500
|
//#region src/utils/deep-non-nullable.d.ts
|
|
1506
|
-
type DeepNonNullable<T> = T extends Function ? T : T extends readonly (infer U)[] ? DeepNonNullable<NonNullable<U>>[] : T extends object ? { [K in keyof T]: DeepNonNullable<NonNullable<T[K]>> } : NonNullable<T>;
|
|
1501
|
+
type DeepNonNullable<T$1> = T$1 extends Function ? T$1 : T$1 extends readonly (infer U)[] ? DeepNonNullable<NonNullable<U>>[] : T$1 extends object ? { [K in keyof T$1]: DeepNonNullable<NonNullable<T$1[K]>> } : NonNullable<T$1>;
|
|
1507
1502
|
//#endregion
|
|
1508
1503
|
//#region src/utils/doc.d.ts
|
|
1509
1504
|
declare function jsDoc(schema: {
|
|
@@ -1547,17 +1542,6 @@ declare const getFileInfo: (target?: string, {
|
|
|
1547
1542
|
dirname: string;
|
|
1548
1543
|
filename: string;
|
|
1549
1544
|
};
|
|
1550
|
-
declare function loadFile(filePath?: string, options?: {
|
|
1551
|
-
root?: string;
|
|
1552
|
-
defaultFileName?: string;
|
|
1553
|
-
alias?: Record<string, string>;
|
|
1554
|
-
tsconfig?: Tsconfig;
|
|
1555
|
-
}): Promise<{
|
|
1556
|
-
path: string;
|
|
1557
|
-
file?: string;
|
|
1558
|
-
error?: unknown;
|
|
1559
|
-
cached?: boolean;
|
|
1560
|
-
}>;
|
|
1561
1545
|
declare function removeFilesAndEmptyFolders(patterns: string[], dir: string): Promise<void>;
|
|
1562
1546
|
//#endregion
|
|
1563
1547
|
//#region src/utils/file-extensions.d.ts
|
|
@@ -1610,7 +1594,7 @@ interface LoggerOptions {
|
|
|
1610
1594
|
declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
|
|
1611
1595
|
//#endregion
|
|
1612
1596
|
//#region src/utils/merge-deep.d.ts
|
|
1613
|
-
declare function mergeDeep<T extends Record<string, any>, U extends Record<string, any>>(source: T, target: U): T & U;
|
|
1597
|
+
declare function mergeDeep<T$1 extends Record<string, any>, U$1 extends Record<string, any>>(source: T$1, target: U$1): T$1 & U$1;
|
|
1614
1598
|
//#endregion
|
|
1615
1599
|
//#region src/utils/occurrence.d.ts
|
|
1616
1600
|
declare const count: (str: string | undefined, key: string) => number;
|
|
@@ -1770,5 +1754,5 @@ declare const generateTargetForTags: (builder: WriteSpecsBuilder, options: Norma
|
|
|
1770
1754
|
declare const getOrvalGeneratedTypes: () => string;
|
|
1771
1755
|
declare const getTypedResponse: () => string;
|
|
1772
1756
|
//#endregion
|
|
1773
|
-
export { AngularOptions, BODY_TYPE_NAME, BaseUrlFromConstant, BaseUrlFromSpec, ClientBuilder, ClientDependenciesBuilder, ClientExtraFilesBuilder, ClientFileBuilder, ClientFooterBuilder, ClientGeneratorsBuilder, ClientHeaderBuilder, ClientMockBuilder, ClientMockGeneratorBuilder, ClientMockGeneratorImplementation, ClientTitleBuilder, Config, ConfigExternal, ConfigFn, ContextSpecs, DeepNonNullable, EnumGeneration, ErrorWithTag, FetchOptions, FormDataArrayHandling, FormDataType, GenerateMockImports, GeneratorApiBuilder, GeneratorApiOperations, GeneratorApiResponse, GeneratorClient, GeneratorClientExtra, GeneratorClientFooter, GeneratorClientHeader, GeneratorClientImports, GeneratorClientTitle, GeneratorClients, GeneratorDependency, GeneratorImport, GeneratorMutator, GeneratorMutatorParsingInfo, GeneratorOperation, GeneratorOperations, GeneratorOptions, GeneratorSchema, GeneratorTarget, GeneratorTargetFull, GeneratorVerbOptions, GeneratorVerbsOptions, GetterBody, GetterParam, GetterParameters, GetterParams, GetterProp, GetterPropType, GetterProps, GetterQueryParam, GetterResponse, GlobalMockOptions, GlobalOptions, HonoOptions, Hook, HookCommand, HookFunction, HookOption, HooksOptions, ImportOpenApi, InputFiltersOption, InputOptions, InputTransformerFn, JsDocOptions, LogLevel, LogLevels, LogOptions, LogType, Logger, LoggerOptions, MockData, MockDataArray, MockDataArrayFn, MockDataObject, MockDataObjectFn, MockOptions, MockProperties, MockPropertiesObject, MockPropertiesObjectFn, Mutator, MutatorObject, NamingConvention, NormalizedConfig, NormalizedFetchOptions, NormalizedFormDataType, NormalizedHonoOptions, NormalizedHookCommand, NormalizedHookOptions, NormalizedInputOptions, NormalizedJsDocOptions, NormalizedMutator, NormalizedOperationOptions, NormalizedOptions, NormalizedOutputOptions, NormalizedOverrideOutput, NormalizedParamsSerializerOptions, NormalizedQueryOptions, NormalizedZodOptions, OperationOptions, Options, OptionsExport, OptionsFn, OutputClient, OutputClientFunc, OutputDocsOptions, OutputHttpClient, OutputMockType, OutputMode, OutputOptions, OverrideInput, OverrideMockOptions, OverrideOutput, OverrideOutputContentType, PackageJson, ParamsSerializerOptions, PropertySortOrder, QueryOptions, RefComponentSuffix, RefInfo, ResReqTypesValue, ResolverValue, ScalarValue, SchemaType, SchemaWithConst, SwaggerParserOptions, SwrOptions, TEMPLATE_TAG_REGEX, TsConfigTarget, Tsconfig, URL_REGEX, VERBS_WITH_BODY, Verbs, WriteModeProps, WriteSpecsBuilder, ZodCoerceType, ZodDateTimeOptions, ZodOptions, 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$1 as isRootKey, isSchema, isString, isSyntheticDefaultImportsAllow, isUndefined, isUrl, isVerb, jsDoc, jsStringEscape, kebab, keyValuePairsToJsDoc,
|
|
1757
|
+
export { AngularOptions, BODY_TYPE_NAME, BaseUrlFromConstant, BaseUrlFromSpec, ClientBuilder, ClientDependenciesBuilder, ClientExtraFilesBuilder, ClientFileBuilder, ClientFooterBuilder, ClientGeneratorsBuilder, ClientHeaderBuilder, ClientMockBuilder, ClientMockGeneratorBuilder, ClientMockGeneratorImplementation, ClientTitleBuilder, Config, ConfigExternal, ConfigFn, ContextSpecs, DeepNonNullable, EnumGeneration, ErrorWithTag, FetchOptions, FormDataArrayHandling, FormDataType, GenerateMockImports, GeneratorApiBuilder, GeneratorApiOperations, GeneratorApiResponse, GeneratorClient, GeneratorClientExtra, GeneratorClientFooter, GeneratorClientHeader, GeneratorClientImports, GeneratorClientTitle, GeneratorClients, GeneratorDependency, GeneratorImport, GeneratorMutator, GeneratorMutatorParsingInfo, GeneratorOperation, GeneratorOperations, GeneratorOptions, GeneratorSchema, GeneratorTarget, GeneratorTargetFull, GeneratorVerbOptions, GeneratorVerbsOptions, GetterBody, GetterParam, GetterParameters, GetterParams, GetterProp, GetterPropType, GetterProps, GetterQueryParam, GetterResponse, GlobalMockOptions, GlobalOptions, HonoOptions, Hook, HookCommand, HookFunction, HookOption, HooksOptions, ImportOpenApi, InputFiltersOption, InputOptions, InputTransformerFn, JsDocOptions, LogLevel, LogLevels, LogOptions, LogType, Logger, LoggerOptions, MockData, MockDataArray, MockDataArrayFn, MockDataObject, MockDataObjectFn, MockOptions, MockProperties, MockPropertiesObject, MockPropertiesObjectFn, Mutator, MutatorObject, NamingConvention, NormalizedConfig, NormalizedFetchOptions, NormalizedFormDataType, NormalizedHonoOptions, NormalizedHookCommand, NormalizedHookOptions, NormalizedInputOptions, NormalizedJsDocOptions, NormalizedMutator, NormalizedOperationOptions, NormalizedOptions, NormalizedOutputOptions, NormalizedOverrideOutput, NormalizedParamsSerializerOptions, NormalizedQueryOptions, NormalizedZodOptions, OperationOptions, Options, OptionsExport, OptionsFn, OutputClient, OutputClientFunc, OutputDocsOptions, OutputHttpClient, OutputMockType, OutputMode, OutputOptions, OverrideInput, OverrideMockOptions, OverrideOutput, OverrideOutputContentType, PackageJson, ParamsSerializerOptions, PropertySortOrder, QueryOptions, RefComponentSuffix, RefInfo, ResReqTypesValue, ResolverValue, ScalarValue, SchemaType, SchemaWithConst, SwaggerParserOptions, SwrOptions, TEMPLATE_TAG_REGEX, TsConfigTarget, Tsconfig, URL_REGEX, VERBS_WITH_BODY, Verbs, WriteModeProps, WriteSpecsBuilder, ZodCoerceType, ZodDateTimeOptions, ZodOptions, 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$1 as isRootKey, isSchema, isString, isSyntheticDefaultImportsAllow, isUndefined, isUrl, isVerb, jsDoc, jsStringEscape, kebab, keyValuePairsToJsDoc, log, logError, mergeDeep, mismatchArgsMessage, openApiConverter, pascal, removeFilesAndEmptyFolders, resolveDiscriminators, resolveExampleRefs, resolveObject, resolveRef, resolveValue, sanitize, snake, sortByPriority, startMessage, stringify, toObjectString, path_d_exports as upath, upper, writeModelInline, writeModelsInline, writeSchema, writeSchemas, writeSingleMode, writeSplitMode, writeSplitTagsMode, writeTagsMode };
|
|
1774
1758
|
//# sourceMappingURL=index.d.ts.map
|