orval 6.9.6 → 6.10.1
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-JOHLLG7L.js +352 -0
- package/dist/index.d.ts +25 -13
- package/dist/index.js +1 -1
- package/package.json +36 -36
- package/dist/chunk-ZVWRSIMB.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 = {
|
|
@@ -243,6 +244,8 @@ declare type NormalizedOverrideOutput = {
|
|
|
243
244
|
[key: string]: NormalizedOperationOptions;
|
|
244
245
|
};
|
|
245
246
|
mock?: {
|
|
247
|
+
arrayMin?: number;
|
|
248
|
+
arrayMax?: number;
|
|
246
249
|
properties?: MockProperties;
|
|
247
250
|
format?: {
|
|
248
251
|
[key: string]: unknown;
|
|
@@ -278,6 +281,7 @@ declare type NormalizedOverrideOutput = {
|
|
|
278
281
|
requestOptions: Record<string, any> | boolean;
|
|
279
282
|
useDates?: boolean;
|
|
280
283
|
useTypeOverInterfaces?: boolean;
|
|
284
|
+
useDeprecatedOperations?: boolean;
|
|
281
285
|
};
|
|
282
286
|
declare type NormalizedMutator = {
|
|
283
287
|
path: string;
|
|
@@ -370,12 +374,15 @@ declare type OverrideOutput = {
|
|
|
370
374
|
[key: string]: OperationOptions;
|
|
371
375
|
};
|
|
372
376
|
mock?: {
|
|
377
|
+
arrayMin?: number;
|
|
378
|
+
arrayMax?: number;
|
|
373
379
|
properties?: MockProperties;
|
|
374
380
|
format?: {
|
|
375
381
|
[key: string]: unknown;
|
|
376
382
|
};
|
|
377
383
|
required?: boolean;
|
|
378
384
|
baseUrl?: string;
|
|
385
|
+
delay?: number;
|
|
379
386
|
};
|
|
380
387
|
contentType?: OverrideOutputContentType;
|
|
381
388
|
header?: boolean | ((info: InfoObject) => string[] | string);
|
|
@@ -404,6 +411,7 @@ declare type OverrideOutput = {
|
|
|
404
411
|
requestOptions?: Record<string, any> | boolean;
|
|
405
412
|
useDates?: boolean;
|
|
406
413
|
useTypeOverInterfaces?: boolean;
|
|
414
|
+
useDeprecatedOperations?: boolean;
|
|
407
415
|
};
|
|
408
416
|
declare type OverrideOutputContentType = {
|
|
409
417
|
include?: string[];
|
|
@@ -508,6 +516,9 @@ declare const generateImports: ({ imports, target, isRootKey, specsName, }: {
|
|
|
508
516
|
isRootKey: boolean;
|
|
509
517
|
specsName: Record<string, string>;
|
|
510
518
|
}) => string;
|
|
519
|
+
declare const generateModelImports: ({ schemas, }: {
|
|
520
|
+
schemas: GeneratorImport[];
|
|
521
|
+
}) => string;
|
|
511
522
|
declare const generateMutatorImports: ({ mutators, implementation, oneMore, }: {
|
|
512
523
|
mutators: GeneratorMutator[];
|
|
513
524
|
implementation?: string | undefined;
|
|
@@ -551,7 +562,7 @@ declare const generateOptions: ({ route, body, headers, queryParams, response, v
|
|
|
551
562
|
hasSignal: boolean;
|
|
552
563
|
}) => string;
|
|
553
564
|
declare const generateBodyMutatorConfig: (body: GetterBody, isFormData: boolean, isFormUrlEncoded: boolean) => string;
|
|
554
|
-
declare const generateQueryParamsAxiosConfig: (response: GetterResponse, queryParams?: GetterQueryParam
|
|
565
|
+
declare const generateQueryParamsAxiosConfig: (response: GetterResponse, queryParams?: GetterQueryParam) => string;
|
|
555
566
|
declare const generateMutatorConfig: ({ route, body, headers, queryParams, response, verb, isFormData, isFormUrlEncoded, isBodyVerb, hasSignal, isExactOptionalPropertyTypes, }: {
|
|
556
567
|
route: string;
|
|
557
568
|
body: GetterBody;
|
|
@@ -574,20 +585,21 @@ declare const generateFormDataAndUrlEncodedFunction: ({ body, formData, formUrlE
|
|
|
574
585
|
isFormUrlEncoded: boolean;
|
|
575
586
|
}) => string;
|
|
576
587
|
|
|
577
|
-
declare const loadTsconfig: (tsconfig?:
|
|
578
|
-
declare const isSyntheticDefaultImportsAllow: (config?: Tsconfig
|
|
588
|
+
declare const loadTsconfig: (tsconfig?: Tsconfig | string, workspace?: string) => Promise<Tsconfig | undefined>;
|
|
589
|
+
declare const isSyntheticDefaultImportsAllow: (config?: Tsconfig) => boolean;
|
|
579
590
|
|
|
580
591
|
declare const stringify: (data?: string | any[] | {
|
|
581
592
|
[key: string]: any;
|
|
582
593
|
} | undefined) => string | undefined;
|
|
583
594
|
declare const sanitize: (value: string, options?: {
|
|
584
|
-
whitespace?: string | true
|
|
585
|
-
underscore?: string | true
|
|
586
|
-
dot?: string | true
|
|
587
|
-
dash?: string | true
|
|
588
|
-
es5keyword?: boolean
|
|
589
|
-
|
|
590
|
-
|
|
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;
|
|
591
603
|
declare const toObjectString: <T>(props: T[], path?: keyof T | undefined) => string;
|
|
592
604
|
declare const getNumberWord: (num: number) => string;
|
|
593
605
|
declare const escape: (str: string, char?: string) => string;
|
|
@@ -596,8 +608,8 @@ declare const pascal: (s: string) => string;
|
|
|
596
608
|
declare const camel: (s: string) => string;
|
|
597
609
|
declare const snake: (s: string) => string;
|
|
598
610
|
declare const kebab: (s: string) => string;
|
|
599
|
-
declare const upper: (s: string, fillWith?: string
|
|
611
|
+
declare const upper: (s: string, fillWith?: string, isDeapostrophe?: boolean) => string;
|
|
600
612
|
|
|
601
|
-
declare const generate: (optionsExport?: string | OptionsExport
|
|
613
|
+
declare const generate: (optionsExport?: string | OptionsExport, workspace?: string, options?: GlobalOptions) => Promise<void>;
|
|
602
614
|
|
|
603
|
-
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 _chunkJOHLLG7Ljs = require('./chunk-JOHLLG7L.js');var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);var $=async(e,a=process.cwd(),r)=>{if(!e||_chunkJOHLLG7Ljs.b.call(void 0, e))return _chunkJOHLLG7Ljs.M.call(void 0, e,r);let m=await _chunkJOHLLG7Ljs.H.call(void 0, e,a,r);if(r!=null&&r.watch)_chunkJOHLLG7Ljs.K.call(void 0, r==null?void 0:r.watch,async()=>{try{await _chunkJOHLLG7Ljs.L.call(void 0, a,m)}catch(f){_chunkJOHLLG7Ljs.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 _chunkJOHLLG7Ljs.L.call(void 0, a,m)}catch(f){_chunkJOHLLG7Ljs.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 = _chunkJOHLLG7Ljs.r; exports.VERBS_WITH_BODY = _chunkJOHLLG7Ljs.q; exports.addDependency = _chunkJOHLLG7Ljs.v; exports.camel = _chunkJOHLLG7Ljs.f; exports.default = rr; exports.defineConfig = _chunkJOHLLG7Ljs.G; exports.escape = _chunkJOHLLG7Ljs.n; exports.generalJSTypes = _chunkJOHLLG7Ljs.o; exports.generalJSTypesWithArray = _chunkJOHLLG7Ljs.p; exports.generate = $; exports.generateAxiosOptions = _chunkJOHLLG7Ljs.z; exports.generateBodyMutatorConfig = _chunkJOHLLG7Ljs.B; exports.generateBodyOptions = _chunkJOHLLG7Ljs.y; exports.generateDependencyImports = _chunkJOHLLG7Ljs.w; exports.generateFormDataAndUrlEncodedFunction = _chunkJOHLLG7Ljs.F; exports.generateImports = _chunkJOHLLG7Ljs.s; exports.generateModelImports = _chunkJOHLLG7Ljs.t; exports.generateMutatorConfig = _chunkJOHLLG7Ljs.D; exports.generateMutatorImports = _chunkJOHLLG7Ljs.u; exports.generateMutatorRequestOptions = _chunkJOHLLG7Ljs.E; exports.generateOptions = _chunkJOHLLG7Ljs.A; exports.generateQueryParamsAxiosConfig = _chunkJOHLLG7Ljs.C; exports.generateVerbImports = _chunkJOHLLG7Ljs.x; exports.getNumberWord = _chunkJOHLLG7Ljs.m; exports.isSyntheticDefaultImportsAllow = _chunkJOHLLG7Ljs.J; exports.kebab = _chunkJOHLLG7Ljs.h; exports.loadTsconfig = _chunkJOHLLG7Ljs.I; exports.pascal = _chunkJOHLLG7Ljs.e; exports.sanitize = _chunkJOHLLG7Ljs.k; exports.snake = _chunkJOHLLG7Ljs.g; exports.stringify = _chunkJOHLLG7Ljs.j; exports.toObjectString = _chunkJOHLLG7Ljs.l; exports.upper = _chunkJOHLLG7Ljs.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.1",
|
|
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",
|