orval 6.9.4 → 6.10.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/bin/orval.js +1 -1
- package/dist/chunk-RTI3JSYB.js +352 -0
- package/dist/index.d.ts +26 -13
- package/dist/index.js +1 -1
- package/package.json +36 -36
- package/dist/chunk-OHBRNI7E.js +0 -352
package/dist/index.d.ts
CHANGED
|
@@ -153,6 +153,7 @@ declare type GeneratorVerbOptions = {
|
|
|
153
153
|
formData?: GeneratorMutator;
|
|
154
154
|
formUrlEncoded?: GeneratorMutator;
|
|
155
155
|
override: NormalizedOverrideOutput;
|
|
156
|
+
deprecated?: boolean;
|
|
156
157
|
};
|
|
157
158
|
declare type GeneratorVerbsOptions = GeneratorVerbOptions[];
|
|
158
159
|
declare type GeneratorOptions = {
|
|
@@ -175,6 +176,7 @@ declare type GeneratorClientExtra = {
|
|
|
175
176
|
};
|
|
176
177
|
declare type GeneratorMutatorParsingInfo = {
|
|
177
178
|
numberOfParams: number;
|
|
179
|
+
returnNumberOfParams?: number;
|
|
178
180
|
};
|
|
179
181
|
declare type GeneratorMutator = {
|
|
180
182
|
name: string;
|
|
@@ -242,6 +244,8 @@ declare type NormalizedOverrideOutput = {
|
|
|
242
244
|
[key: string]: NormalizedOperationOptions;
|
|
243
245
|
};
|
|
244
246
|
mock?: {
|
|
247
|
+
arrayMin?: number;
|
|
248
|
+
arrayMax?: number;
|
|
245
249
|
properties?: MockProperties;
|
|
246
250
|
format?: {
|
|
247
251
|
[key: string]: unknown;
|
|
@@ -277,6 +281,7 @@ declare type NormalizedOverrideOutput = {
|
|
|
277
281
|
requestOptions: Record<string, any> | boolean;
|
|
278
282
|
useDates?: boolean;
|
|
279
283
|
useTypeOverInterfaces?: boolean;
|
|
284
|
+
useDeprecatedOperations?: boolean;
|
|
280
285
|
};
|
|
281
286
|
declare type NormalizedMutator = {
|
|
282
287
|
path: string;
|
|
@@ -369,12 +374,15 @@ declare type OverrideOutput = {
|
|
|
369
374
|
[key: string]: OperationOptions;
|
|
370
375
|
};
|
|
371
376
|
mock?: {
|
|
377
|
+
arrayMin?: number;
|
|
378
|
+
arrayMax?: number;
|
|
372
379
|
properties?: MockProperties;
|
|
373
380
|
format?: {
|
|
374
381
|
[key: string]: unknown;
|
|
375
382
|
};
|
|
376
383
|
required?: boolean;
|
|
377
384
|
baseUrl?: string;
|
|
385
|
+
delay?: number;
|
|
378
386
|
};
|
|
379
387
|
contentType?: OverrideOutputContentType;
|
|
380
388
|
header?: boolean | ((info: InfoObject) => string[] | string);
|
|
@@ -403,6 +411,7 @@ declare type OverrideOutput = {
|
|
|
403
411
|
requestOptions?: Record<string, any> | boolean;
|
|
404
412
|
useDates?: boolean;
|
|
405
413
|
useTypeOverInterfaces?: boolean;
|
|
414
|
+
useDeprecatedOperations?: boolean;
|
|
406
415
|
};
|
|
407
416
|
declare type OverrideOutputContentType = {
|
|
408
417
|
include?: string[];
|
|
@@ -507,6 +516,9 @@ declare const generateImports: ({ imports, target, isRootKey, specsName, }: {
|
|
|
507
516
|
isRootKey: boolean;
|
|
508
517
|
specsName: Record<string, string>;
|
|
509
518
|
}) => string;
|
|
519
|
+
declare const generateModelImports: ({ schemas, }: {
|
|
520
|
+
schemas: GeneratorImport[];
|
|
521
|
+
}) => string;
|
|
510
522
|
declare const generateMutatorImports: ({ mutators, implementation, oneMore, }: {
|
|
511
523
|
mutators: GeneratorMutator[];
|
|
512
524
|
implementation?: string | undefined;
|
|
@@ -550,7 +562,7 @@ declare const generateOptions: ({ route, body, headers, queryParams, response, v
|
|
|
550
562
|
hasSignal: boolean;
|
|
551
563
|
}) => string;
|
|
552
564
|
declare const generateBodyMutatorConfig: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
553
|
-
declare const generateQueryParamsAxiosConfig: (response: GetterResponse, queryParams?: GetterQueryParam
|
|
565
|
+
declare const generateQueryParamsAxiosConfig: (response: GetterResponse, queryParams?: GetterQueryParam) => string;
|
|
554
566
|
declare const generateMutatorConfig: ({ route, body, headers, queryParams, response, verb, isFormData, isFormUrlEncoded, isBodyVerb, hasSignal, isExactOptionalPropertyTypes, }: {
|
|
555
567
|
route: string;
|
|
556
568
|
body: GetterBody;
|
|
@@ -573,20 +585,21 @@ declare const generateFormDataAndUrlEncodedFunction: ({ body, formData, formUrlE
|
|
|
573
585
|
isFormUrlEncoded: boolean;
|
|
574
586
|
}) => string;
|
|
575
587
|
|
|
576
|
-
declare const loadTsconfig: (tsconfig?:
|
|
577
|
-
declare const isSyntheticDefaultImportsAllow: (config?: Tsconfig
|
|
588
|
+
declare const loadTsconfig: (tsconfig?: Tsconfig | string, workspace?: string) => Promise<Tsconfig | undefined>;
|
|
589
|
+
declare const isSyntheticDefaultImportsAllow: (config?: Tsconfig) => boolean;
|
|
578
590
|
|
|
579
591
|
declare const stringify: (data?: string | any[] | {
|
|
580
592
|
[key: string]: any;
|
|
581
593
|
} | undefined) => string | undefined;
|
|
582
594
|
declare const sanitize: (value: string, options?: {
|
|
583
|
-
whitespace?: string | true
|
|
584
|
-
underscore?: string | true
|
|
585
|
-
dot?: string | true
|
|
586
|
-
dash?: string | true
|
|
587
|
-
es5keyword?: boolean
|
|
588
|
-
|
|
589
|
-
|
|
595
|
+
whitespace?: string | true;
|
|
596
|
+
underscore?: string | true;
|
|
597
|
+
dot?: string | true;
|
|
598
|
+
dash?: string | true;
|
|
599
|
+
es5keyword?: boolean;
|
|
600
|
+
es5IdentifierName?: boolean;
|
|
601
|
+
special?: boolean;
|
|
602
|
+
}) => string;
|
|
590
603
|
declare const toObjectString: <T>(props: T[], path?: keyof T | undefined) => string;
|
|
591
604
|
declare const getNumberWord: (num: number) => string;
|
|
592
605
|
declare const escape: (str: string, char?: string) => string;
|
|
@@ -595,8 +608,8 @@ declare const pascal: (s: string) => string;
|
|
|
595
608
|
declare const camel: (s: string) => string;
|
|
596
609
|
declare const snake: (s: string) => string;
|
|
597
610
|
declare const kebab: (s: string) => string;
|
|
598
|
-
declare const upper: (s: string, fillWith?: string
|
|
611
|
+
declare const upper: (s: string, fillWith?: string, isDeapostrophe?: boolean) => string;
|
|
599
612
|
|
|
600
|
-
declare const generate: (optionsExport?: string | OptionsExport
|
|
613
|
+
declare const generate: (optionsExport?: string | OptionsExport, workspace?: string, options?: GlobalOptions) => Promise<void>;
|
|
601
614
|
|
|
602
|
-
export { ClientBuilder, ClientDependenciesBuilder, ClientFooterBuilder, ClientGeneratorsBuilder, ClientHeaderBuilder, ClientMSWBuilder, ClientTitleBuilder, GeneratorApiResponse, GeneratorClient, GeneratorClientExtra, GeneratorClients, GeneratorDependency, GeneratorImport, GeneratorMutator, GeneratorMutatorParsingInfo, GeneratorOperation, GeneratorOperations, GeneratorOptions, GeneratorSchema, GeneratorTarget, GeneratorTargetFull, GeneratorVerbOptions, GeneratorVerbsOptions, Options, URL_REGEX, VERBS_WITH_BODY, addDependency, camel, generate as default, defineConfig, escape, generalJSTypes, generalJSTypesWithArray, generate, generateAxiosOptions, generateBodyMutatorConfig, generateBodyOptions, generateDependencyImports, generateFormDataAndUrlEncodedFunction, generateImports, generateMutatorConfig, generateMutatorImports, generateMutatorRequestOptions, generateOptions, generateQueryParamsAxiosConfig, generateVerbImports, getNumberWord, isSyntheticDefaultImportsAllow, kebab, loadTsconfig, pascal, sanitize, snake, stringify, toObjectString, upper };
|
|
615
|
+
export { ClientBuilder, ClientDependenciesBuilder, ClientFooterBuilder, ClientGeneratorsBuilder, ClientHeaderBuilder, ClientMSWBuilder, ClientTitleBuilder, GeneratorApiResponse, GeneratorClient, GeneratorClientExtra, GeneratorClients, GeneratorDependency, GeneratorImport, GeneratorMutator, GeneratorMutatorParsingInfo, GeneratorOperation, GeneratorOperations, GeneratorOptions, GeneratorSchema, GeneratorTarget, GeneratorTargetFull, GeneratorVerbOptions, GeneratorVerbsOptions, Options, URL_REGEX, VERBS_WITH_BODY, addDependency, camel, generate as default, defineConfig, escape, generalJSTypes, generalJSTypesWithArray, generate, generateAxiosOptions, generateBodyMutatorConfig, generateBodyOptions, generateDependencyImports, generateFormDataAndUrlEncodedFunction, generateImports, generateModelImports, generateMutatorConfig, generateMutatorImports, generateMutatorRequestOptions, generateOptions, generateQueryParamsAxiosConfig, generateVerbImports, getNumberWord, isSyntheticDefaultImportsAllow, kebab, loadTsconfig, pascal, sanitize, snake, stringify, toObjectString, upper };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkRTI3JSYBjs = require('./chunk-RTI3JSYB.js');var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);var $=async(e,a=process.cwd(),r)=>{if(!e||_chunkRTI3JSYBjs.b.call(void 0, e))return _chunkRTI3JSYBjs.M.call(void 0, e,r);let m=await _chunkRTI3JSYBjs.H.call(void 0, e,a,r);if(r!=null&&r.watch)_chunkRTI3JSYBjs.K.call(void 0, r==null?void 0:r.watch,async()=>{try{await _chunkRTI3JSYBjs.L.call(void 0, a,m)}catch(f){_chunkRTI3JSYBjs.c.call(void 0, _chalk2.default.red(`\u{1F6D1} ${r!=null&&r.projectName?`${r==null?void 0:r.projectName} - `:""}${f}`))}},m.input.target);else try{return await _chunkRTI3JSYBjs.L.call(void 0, a,m)}catch(f){_chunkRTI3JSYBjs.c.call(void 0, _chalk2.default.red(`\u{1F6D1} ${r!=null&&r.projectName?`${r==null?void 0:r.projectName} - `:""}${f}`))}};var rr=$;exports.URL_REGEX = _chunkRTI3JSYBjs.r; exports.VERBS_WITH_BODY = _chunkRTI3JSYBjs.q; exports.addDependency = _chunkRTI3JSYBjs.v; exports.camel = _chunkRTI3JSYBjs.f; exports.default = rr; exports.defineConfig = _chunkRTI3JSYBjs.G; exports.escape = _chunkRTI3JSYBjs.n; exports.generalJSTypes = _chunkRTI3JSYBjs.o; exports.generalJSTypesWithArray = _chunkRTI3JSYBjs.p; exports.generate = $; exports.generateAxiosOptions = _chunkRTI3JSYBjs.z; exports.generateBodyMutatorConfig = _chunkRTI3JSYBjs.B; exports.generateBodyOptions = _chunkRTI3JSYBjs.y; exports.generateDependencyImports = _chunkRTI3JSYBjs.w; exports.generateFormDataAndUrlEncodedFunction = _chunkRTI3JSYBjs.F; exports.generateImports = _chunkRTI3JSYBjs.s; exports.generateModelImports = _chunkRTI3JSYBjs.t; exports.generateMutatorConfig = _chunkRTI3JSYBjs.D; exports.generateMutatorImports = _chunkRTI3JSYBjs.u; exports.generateMutatorRequestOptions = _chunkRTI3JSYBjs.E; exports.generateOptions = _chunkRTI3JSYBjs.A; exports.generateQueryParamsAxiosConfig = _chunkRTI3JSYBjs.C; exports.generateVerbImports = _chunkRTI3JSYBjs.x; exports.getNumberWord = _chunkRTI3JSYBjs.m; exports.isSyntheticDefaultImportsAllow = _chunkRTI3JSYBjs.J; exports.kebab = _chunkRTI3JSYBjs.h; exports.loadTsconfig = _chunkRTI3JSYBjs.I; exports.pascal = _chunkRTI3JSYBjs.e; exports.sanitize = _chunkRTI3JSYBjs.k; exports.snake = _chunkRTI3JSYBjs.g; exports.stringify = _chunkRTI3JSYBjs.j; exports.toObjectString = _chunkRTI3JSYBjs.l; exports.upper = _chunkRTI3JSYBjs.i;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orval",
|
|
3
3
|
"description": "A swagger client generator for typescript",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.10.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"url": "https://github.com/anymaniax/orval"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
|
-
"build": "tsup ./src/bin/orval.ts ./src/index.ts --minify --clean --dts --splitting",
|
|
45
|
-
"dev": "tsup ./src/bin/orval.ts ./src/index.ts --clean --watch src --onSuccess 'yarn generate-api'",
|
|
44
|
+
"build": "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --minify --clean --dts --splitting",
|
|
45
|
+
"dev": "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --watch src --onSuccess 'yarn generate-api'",
|
|
46
46
|
"lint": "eslint src/**/*.ts",
|
|
47
47
|
"test": "vitest --global test.ts",
|
|
48
48
|
"format": "prettier --write .",
|
|
@@ -56,68 +56,68 @@
|
|
|
56
56
|
"update-samples": "zx ./scripts/update-samples.mjs"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@commitlint/cli": "^17.0.
|
|
59
|
+
"@commitlint/cli": "^17.0.3",
|
|
60
60
|
"@commitlint/config-conventional": "^17.0.3",
|
|
61
|
-
"@faker-js/faker": "^7.
|
|
61
|
+
"@faker-js/faker": "^7.4.0",
|
|
62
62
|
"@release-it/conventional-changelog": "^5.0.0",
|
|
63
63
|
"@types/chalk": "^2.2.0",
|
|
64
64
|
"@types/commander": "^2.12.2",
|
|
65
|
-
"@types/fs-extra": "^9.0.
|
|
66
|
-
"@types/inquirer": "^8.2.
|
|
67
|
-
"@types/lodash.get": "^4.4.
|
|
68
|
-
"@types/lodash.omit": "^4.5.
|
|
69
|
-
"@types/lodash.omitby": "^4.6.
|
|
70
|
-
"@types/lodash.uniq": "^4.5.
|
|
71
|
-
"@types/lodash.uniqby": "^4.7.
|
|
72
|
-
"@types/lodash.uniqwith": "^4.5.
|
|
65
|
+
"@types/fs-extra": "^9.0.13",
|
|
66
|
+
"@types/inquirer": "^8.2.2",
|
|
67
|
+
"@types/lodash.get": "^4.4.7",
|
|
68
|
+
"@types/lodash.omit": "^4.5.7",
|
|
69
|
+
"@types/lodash.omitby": "^4.6.7",
|
|
70
|
+
"@types/lodash.uniq": "^4.5.7",
|
|
71
|
+
"@types/lodash.uniqby": "^4.7.7",
|
|
72
|
+
"@types/lodash.uniqwith": "^4.5.7",
|
|
73
73
|
"@types/micromatch": "^4.0.2",
|
|
74
|
-
"@types/node": "^18.
|
|
75
|
-
"@types/prettier": "^2.
|
|
74
|
+
"@types/node": "^18.7.3",
|
|
75
|
+
"@types/prettier": "^2.7.0",
|
|
76
76
|
"@types/request": "^2.48.8",
|
|
77
|
-
"@types/validator": "^13.7.
|
|
78
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
79
|
-
"@typescript-eslint/parser": "^5.
|
|
80
|
-
"dotenv-cli": "^
|
|
81
|
-
"eslint": "^8.
|
|
77
|
+
"@types/validator": "^13.7.5",
|
|
78
|
+
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
|
79
|
+
"@typescript-eslint/parser": "^5.33.0",
|
|
80
|
+
"dotenv-cli": "^6.0.0",
|
|
81
|
+
"eslint": "^8.22.0",
|
|
82
82
|
"eslint-config-prettier": "^8.5.0",
|
|
83
|
-
"eslint-plugin-prettier": "^4.
|
|
83
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
84
84
|
"husky": "^8.0.1",
|
|
85
85
|
"lint-staged": "^13.0.3",
|
|
86
86
|
"npm-run-all": "^4.1.5",
|
|
87
|
-
"prettier": "2.
|
|
87
|
+
"prettier": "2.7.1",
|
|
88
88
|
"pretty-quick": "^3.1.3",
|
|
89
|
-
"release-it": "^15.
|
|
89
|
+
"release-it": "^15.3.0",
|
|
90
90
|
"rimraf": "^3.0.2",
|
|
91
|
-
"tsup": "^
|
|
92
|
-
"typescript": "^4.
|
|
93
|
-
"vitest": "^0.6.
|
|
94
|
-
"zx": "^7.0.
|
|
91
|
+
"tsup": "^6.2.2",
|
|
92
|
+
"typescript": "^4.7.4",
|
|
93
|
+
"vitest": "^0.6.3",
|
|
94
|
+
"zx": "^7.0.8"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
98
|
-
"acorn": "^8.
|
|
98
|
+
"acorn": "^8.8.0",
|
|
99
99
|
"cac": "^6.7.12",
|
|
100
100
|
"chalk": "^4.1.2",
|
|
101
101
|
"chokidar": "^3.5.3",
|
|
102
102
|
"compare-versions": "^4.1.3",
|
|
103
103
|
"cuid": "^2.1.8",
|
|
104
|
-
"debug": "^4.3.
|
|
105
|
-
"esbuild": "^0.
|
|
104
|
+
"debug": "^4.3.4",
|
|
105
|
+
"esbuild": "^0.15.3",
|
|
106
106
|
"esutils": "2.0.3",
|
|
107
107
|
"execa": "^5.1.1",
|
|
108
108
|
"find-up": "5.0.0",
|
|
109
|
-
"fs-extra": "^10.0
|
|
110
|
-
"globby": "11.0
|
|
111
|
-
"ibm-openapi-validator": "^0.
|
|
112
|
-
"inquirer": "^8.2.
|
|
109
|
+
"fs-extra": "^10.1.0",
|
|
110
|
+
"globby": "11.1.0",
|
|
111
|
+
"ibm-openapi-validator": "^0.88.0",
|
|
112
|
+
"inquirer": "^8.2.4",
|
|
113
113
|
"lodash.get": "^4.4.2",
|
|
114
114
|
"lodash.omit": "^4.5.0",
|
|
115
115
|
"lodash.omitby": "^4.6.0",
|
|
116
116
|
"lodash.uniq": "^4.5.0",
|
|
117
117
|
"lodash.uniqby": "^4.7.0",
|
|
118
118
|
"lodash.uniqwith": "^4.5.0",
|
|
119
|
-
"micromatch": "^4.0.
|
|
120
|
-
"openapi3-ts": "^
|
|
119
|
+
"micromatch": "^4.0.5",
|
|
120
|
+
"openapi3-ts": "^3.0.0",
|
|
121
121
|
"string-argv": "^0.3.1",
|
|
122
122
|
"swagger2openapi": "^7.0.8",
|
|
123
123
|
"tsconfck": "^2.0.1",
|