@orval/core 7.15.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 +9 -28
- package/dist/index.js +254 -594
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
|
@@ -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;
|
|
@@ -494,7 +488,7 @@ type NormalizedQueryOptions = {
|
|
|
494
488
|
shouldSplitQueryKey?: boolean;
|
|
495
489
|
useOperationIdAsQueryKey?: boolean;
|
|
496
490
|
signal?: boolean;
|
|
497
|
-
version?:
|
|
491
|
+
version?: 4 | 5;
|
|
498
492
|
};
|
|
499
493
|
type QueryOptions = {
|
|
500
494
|
useQuery?: boolean;
|
|
@@ -515,7 +509,7 @@ type QueryOptions = {
|
|
|
515
509
|
shouldSplitQueryKey?: boolean;
|
|
516
510
|
useOperationIdAsQueryKey?: boolean;
|
|
517
511
|
signal?: boolean;
|
|
518
|
-
version?:
|
|
512
|
+
version?: 4 | 5;
|
|
519
513
|
};
|
|
520
514
|
type AngularOptions = {
|
|
521
515
|
provideIn?: 'root' | 'any' | boolean;
|
|
@@ -530,13 +524,11 @@ type SwrOptions = {
|
|
|
530
524
|
type NormalizedFetchOptions = {
|
|
531
525
|
includeHttpResponseReturnType: boolean;
|
|
532
526
|
forceSuccessResponse: boolean;
|
|
533
|
-
explode: boolean;
|
|
534
527
|
jsonReviver?: Mutator;
|
|
535
528
|
};
|
|
536
529
|
type FetchOptions = {
|
|
537
530
|
includeHttpResponseReturnType?: boolean;
|
|
538
531
|
forceSuccessResponse?: boolean;
|
|
539
|
-
explode?: boolean;
|
|
540
532
|
jsonReviver?: Mutator;
|
|
541
533
|
};
|
|
542
534
|
type InputTransformerFn = (spec: OpenAPIObject) => OpenAPIObject;
|
|
@@ -1083,7 +1075,7 @@ declare const generateModelsInline: (obj: Record<string, GeneratorSchema[]>) =>
|
|
|
1083
1075
|
//#endregion
|
|
1084
1076
|
//#region src/generators/mutator.d.ts
|
|
1085
1077
|
declare const BODY_TYPE_NAME = "BodyType";
|
|
1086
|
-
declare
|
|
1078
|
+
declare function generateMutator({
|
|
1087
1079
|
output,
|
|
1088
1080
|
mutator,
|
|
1089
1081
|
name,
|
|
@@ -1095,7 +1087,7 @@ declare const generateMutator: ({
|
|
|
1095
1087
|
name: string;
|
|
1096
1088
|
workspace: string;
|
|
1097
1089
|
tsconfig?: Tsconfig;
|
|
1098
|
-
})
|
|
1090
|
+
}): Promise<GeneratorMutator | undefined>;
|
|
1099
1091
|
//#endregion
|
|
1100
1092
|
//#region src/generators/options.d.ts
|
|
1101
1093
|
declare const generateBodyOptions: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
@@ -1550,17 +1542,6 @@ declare const getFileInfo: (target?: string, {
|
|
|
1550
1542
|
dirname: string;
|
|
1551
1543
|
filename: string;
|
|
1552
1544
|
};
|
|
1553
|
-
declare function loadFile(filePath?: string, options?: {
|
|
1554
|
-
root?: string;
|
|
1555
|
-
defaultFileName?: string;
|
|
1556
|
-
alias?: Record<string, string>;
|
|
1557
|
-
tsconfig?: Tsconfig;
|
|
1558
|
-
}): Promise<{
|
|
1559
|
-
path: string;
|
|
1560
|
-
file?: string;
|
|
1561
|
-
error?: unknown;
|
|
1562
|
-
cached?: boolean;
|
|
1563
|
-
}>;
|
|
1564
1545
|
declare function removeFilesAndEmptyFolders(patterns: string[], dir: string): Promise<void>;
|
|
1565
1546
|
//#endregion
|
|
1566
1547
|
//#region src/utils/file-extensions.d.ts
|
|
@@ -1773,5 +1754,5 @@ declare const generateTargetForTags: (builder: WriteSpecsBuilder, options: Norma
|
|
|
1773
1754
|
declare const getOrvalGeneratedTypes: () => string;
|
|
1774
1755
|
declare const getTypedResponse: () => string;
|
|
1775
1756
|
//#endregion
|
|
1776
|
-
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 };
|
|
1777
1758
|
//# sourceMappingURL=index.d.ts.map
|