orval 6.21.0 → 6.22.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 +57 -35
- package/dist/index.js +57 -35
- package/package.json +11 -10
package/dist/bin/orval.js
CHANGED
|
@@ -3264,17 +3264,17 @@ var import_query = __toESM(require("@orval/query"));
|
|
|
3264
3264
|
var import_swr = __toESM(require("@orval/swr"));
|
|
3265
3265
|
var import_zod = __toESM(require("@orval/zod"));
|
|
3266
3266
|
var DEFAULT_CLIENT = import_core.OutputClient.AXIOS;
|
|
3267
|
-
var
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3267
|
+
var getGeneratorClient = (outputClient, output) => {
|
|
3268
|
+
const GENERATOR_CLIENT = {
|
|
3269
|
+
axios: (0, import_axios.default)({ type: "axios" })(),
|
|
3270
|
+
"axios-functions": (0, import_axios.default)({ type: "axios-functions" })(),
|
|
3271
|
+
angular: (0, import_angular.default)()(),
|
|
3272
|
+
"react-query": (0, import_query.default)({ output, type: "react-query" })(),
|
|
3273
|
+
"svelte-query": (0, import_query.default)({ output, type: "svelte-query" })(),
|
|
3274
|
+
"vue-query": (0, import_query.default)({ output, type: "vue-query" })(),
|
|
3275
|
+
swr: (0, import_swr.default)()(),
|
|
3276
|
+
zod: (0, import_zod.default)()()
|
|
3277
|
+
};
|
|
3278
3278
|
const generator = (0, import_core.isFunction)(outputClient) ? outputClient(GENERATOR_CLIENT) : GENERATOR_CLIENT[outputClient];
|
|
3279
3279
|
if (!generator) {
|
|
3280
3280
|
throw `Oups... \u{1F37B}. Client not found: ${outputClient}`;
|
|
@@ -3290,9 +3290,10 @@ var generateClientImports = ({
|
|
|
3290
3290
|
isAllowSyntheticDefaultImports,
|
|
3291
3291
|
hasGlobalMutator,
|
|
3292
3292
|
hasParamsSerializerOptions,
|
|
3293
|
-
packageJson
|
|
3293
|
+
packageJson,
|
|
3294
|
+
output
|
|
3294
3295
|
}) => {
|
|
3295
|
-
const { dependencies } = getGeneratorClient(client);
|
|
3296
|
+
const { dependencies } = getGeneratorClient(client, output);
|
|
3296
3297
|
return (0, import_core.generateDependencyImports)(
|
|
3297
3298
|
implementation,
|
|
3298
3299
|
dependencies ? [
|
|
@@ -3315,9 +3316,10 @@ var generateClientHeader = ({
|
|
|
3315
3316
|
isMutator,
|
|
3316
3317
|
provideIn,
|
|
3317
3318
|
hasAwaitedType,
|
|
3318
|
-
titles
|
|
3319
|
+
titles,
|
|
3320
|
+
output
|
|
3319
3321
|
}) => {
|
|
3320
|
-
const { header } = getGeneratorClient(outputClient);
|
|
3322
|
+
const { header } = getGeneratorClient(outputClient, output);
|
|
3321
3323
|
return {
|
|
3322
3324
|
implementation: header ? header({
|
|
3323
3325
|
title: titles.implementation,
|
|
@@ -3336,9 +3338,10 @@ var generateClientFooter = ({
|
|
|
3336
3338
|
operationNames,
|
|
3337
3339
|
hasMutator,
|
|
3338
3340
|
hasAwaitedType,
|
|
3339
|
-
titles
|
|
3341
|
+
titles,
|
|
3342
|
+
output
|
|
3340
3343
|
}) => {
|
|
3341
|
-
const { footer } = getGeneratorClient(outputClient);
|
|
3344
|
+
const { footer } = getGeneratorClient(outputClient, output);
|
|
3342
3345
|
if (!footer) {
|
|
3343
3346
|
return {
|
|
3344
3347
|
implementation: "",
|
|
@@ -3380,9 +3383,10 @@ var generateClientFooter = ({
|
|
|
3380
3383
|
var generateClientTitle = ({
|
|
3381
3384
|
outputClient = DEFAULT_CLIENT,
|
|
3382
3385
|
title,
|
|
3383
|
-
customTitleFunc
|
|
3386
|
+
customTitleFunc,
|
|
3387
|
+
output
|
|
3384
3388
|
}) => {
|
|
3385
|
-
const { title: generatorTitle } = getGeneratorClient(outputClient);
|
|
3389
|
+
const { title: generatorTitle } = getGeneratorClient(outputClient, output);
|
|
3386
3390
|
if (!generatorTitle) {
|
|
3387
3391
|
return {
|
|
3388
3392
|
implementation: "",
|
|
@@ -3414,13 +3418,19 @@ var generateMock2 = (verbOption, options) => {
|
|
|
3414
3418
|
if ((0, import_core.isFunction)(options.mock)) {
|
|
3415
3419
|
return options.mock(verbOption, options);
|
|
3416
3420
|
}
|
|
3417
|
-
return mock.generateMock(
|
|
3421
|
+
return mock.generateMock(
|
|
3422
|
+
verbOption,
|
|
3423
|
+
options
|
|
3424
|
+
);
|
|
3418
3425
|
};
|
|
3419
|
-
var generateOperations = (outputClient = DEFAULT_CLIENT, verbsOptions, options) => {
|
|
3426
|
+
var generateOperations = (outputClient = DEFAULT_CLIENT, verbsOptions, options, output) => {
|
|
3420
3427
|
return (0, import_core.asyncReduce)(
|
|
3421
3428
|
verbsOptions,
|
|
3422
3429
|
async (acc, verbOption) => {
|
|
3423
|
-
const { client: generatorClient } = getGeneratorClient(
|
|
3430
|
+
const { client: generatorClient } = getGeneratorClient(
|
|
3431
|
+
outputClient,
|
|
3432
|
+
output
|
|
3433
|
+
);
|
|
3424
3434
|
const client = await generatorClient(verbOption, options, outputClient);
|
|
3425
3435
|
const generatedMock = generateMock2(verbOption, options);
|
|
3426
3436
|
if (!client.implementation) {
|
|
@@ -3429,7 +3439,9 @@ var generateOperations = (outputClient = DEFAULT_CLIENT, verbsOptions, options)
|
|
|
3429
3439
|
acc[verbOption.operationId] = {
|
|
3430
3440
|
implementation: verbOption.doc + client.implementation,
|
|
3431
3441
|
imports: client.imports,
|
|
3442
|
+
// @ts-expect-error // FIXME
|
|
3432
3443
|
implementationMock: generatedMock.implementation,
|
|
3444
|
+
// @ts-expect-error // FIXME
|
|
3433
3445
|
importsMock: generatedMock.imports,
|
|
3434
3446
|
tags: verbOption.tags,
|
|
3435
3447
|
mutator: verbOption.mutator,
|
|
@@ -3517,8 +3529,10 @@ var getApiBuilder = async ({
|
|
|
3517
3529
|
override: output.override,
|
|
3518
3530
|
context: resolvedContext,
|
|
3519
3531
|
mock: output.mock,
|
|
3532
|
+
// @ts-expect-error // FIXME
|
|
3520
3533
|
output: output.target
|
|
3521
|
-
}
|
|
3534
|
+
},
|
|
3535
|
+
output
|
|
3522
3536
|
);
|
|
3523
3537
|
acc.schemas.push(...schemas);
|
|
3524
3538
|
acc.operations = { ...acc.operations, ...pathOperations };
|
|
@@ -3552,6 +3566,7 @@ var importOpenApi = async ({
|
|
|
3552
3566
|
const specs = await generateInputSpecs({ specs: data, input, workspace });
|
|
3553
3567
|
const schemas = getApiSchemas({ output, target, workspace, specs });
|
|
3554
3568
|
const api = await getApiBuilder({
|
|
3569
|
+
// @ts-expect-error // FIXME
|
|
3555
3570
|
input,
|
|
3556
3571
|
output,
|
|
3557
3572
|
context: {
|
|
@@ -3732,6 +3747,7 @@ var importSpecs = async (workspace, options) => {
|
|
|
3732
3747
|
if ((0, import_core4.isObject)(input.target)) {
|
|
3733
3748
|
return importOpenApi({
|
|
3734
3749
|
data: { [workspace]: input.target },
|
|
3750
|
+
// @ts-expect-error // FIXME
|
|
3735
3751
|
input,
|
|
3736
3752
|
output,
|
|
3737
3753
|
target: workspace,
|
|
@@ -3740,6 +3756,7 @@ var importSpecs = async (workspace, options) => {
|
|
|
3740
3756
|
}
|
|
3741
3757
|
const isPathUrl = (0, import_core4.isUrl)(input.target);
|
|
3742
3758
|
const data = await resolveSpecs(
|
|
3759
|
+
// @ts-expect-error // FIXME
|
|
3743
3760
|
input.target,
|
|
3744
3761
|
input.parserOptions,
|
|
3745
3762
|
isPathUrl,
|
|
@@ -3747,8 +3764,10 @@ var importSpecs = async (workspace, options) => {
|
|
|
3747
3764
|
);
|
|
3748
3765
|
return importOpenApi({
|
|
3749
3766
|
data,
|
|
3767
|
+
// @ts-expect-error // FIXME
|
|
3750
3768
|
input,
|
|
3751
3769
|
output,
|
|
3770
|
+
// @ts-expect-error // FIXME
|
|
3752
3771
|
target: input.target,
|
|
3753
3772
|
workspace
|
|
3754
3773
|
});
|
|
@@ -3763,7 +3782,7 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
3763
3782
|
var package_default = {
|
|
3764
3783
|
name: "orval",
|
|
3765
3784
|
description: "A swagger client generator for typescript",
|
|
3766
|
-
version: "6.
|
|
3785
|
+
version: "6.22.0",
|
|
3767
3786
|
license: "MIT",
|
|
3768
3787
|
files: [
|
|
3769
3788
|
"dist"
|
|
@@ -3806,7 +3825,8 @@ var package_default = {
|
|
|
3806
3825
|
build: "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --dts",
|
|
3807
3826
|
dev: "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --watch ./src --onSuccess 'yarn generate-api'",
|
|
3808
3827
|
lint: "eslint src/**/*.ts",
|
|
3809
|
-
"generate-api": "node ./dist/bin/orval.js --config ../../samples/react-query/basic/orval.config.ts"
|
|
3828
|
+
"generate-api": "node ./dist/bin/orval.js --config ../../samples/react-query/basic/orval.config.ts",
|
|
3829
|
+
test: "tsc --noEmit && vitest --passWithNoTests"
|
|
3810
3830
|
},
|
|
3811
3831
|
devDependencies: {
|
|
3812
3832
|
"@types/inquirer": "^9.0.6",
|
|
@@ -3815,13 +3835,13 @@ var package_default = {
|
|
|
3815
3835
|
},
|
|
3816
3836
|
dependencies: {
|
|
3817
3837
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
3818
|
-
"@orval/angular": "6.
|
|
3819
|
-
"@orval/axios": "6.
|
|
3820
|
-
"@orval/core": "6.
|
|
3821
|
-
"@orval/mock": "6.
|
|
3822
|
-
"@orval/query": "6.
|
|
3823
|
-
"@orval/swr": "6.
|
|
3824
|
-
"@orval/zod": "6.
|
|
3838
|
+
"@orval/angular": "6.22.0",
|
|
3839
|
+
"@orval/axios": "6.22.0",
|
|
3840
|
+
"@orval/core": "6.22.0",
|
|
3841
|
+
"@orval/mock": "6.22.0",
|
|
3842
|
+
"@orval/query": "6.22.0",
|
|
3843
|
+
"@orval/swr": "6.22.0",
|
|
3844
|
+
"@orval/zod": "6.22.0",
|
|
3825
3845
|
ajv: "^8.12.0",
|
|
3826
3846
|
cac: "^6.7.14",
|
|
3827
3847
|
chalk: "^4.1.2",
|
|
@@ -3829,7 +3849,7 @@ var package_default = {
|
|
|
3829
3849
|
enquirer: "^2.4.1",
|
|
3830
3850
|
execa: "^5.1.1",
|
|
3831
3851
|
"find-up": "5.0.0",
|
|
3832
|
-
"fs-extra": "^11.
|
|
3852
|
+
"fs-extra": "^11.2.0",
|
|
3833
3853
|
"lodash.uniq": "^4.5.0",
|
|
3834
3854
|
"openapi-types": "^12.1.3",
|
|
3835
3855
|
"openapi3-ts": "^3.2.0",
|
|
@@ -4047,7 +4067,7 @@ var loadTsconfig = async (tsconfig, workspace = process.cwd()) => {
|
|
|
4047
4067
|
|
|
4048
4068
|
// src/utils/options.ts
|
|
4049
4069
|
var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOptions = {}) => {
|
|
4050
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka;
|
|
4070
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma;
|
|
4051
4071
|
const options = await ((0, import_core7.isFunction)(optionsExport) ? optionsExport() : optionsExport);
|
|
4052
4072
|
if (!options.input) {
|
|
4053
4073
|
(0, import_core7.createLogger)().error(import_chalk2.default.red(`Config require an input`));
|
|
@@ -4181,7 +4201,9 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4181
4201
|
useDates: ((_ga = outputOptions.override) == null ? void 0 : _ga.useDates) || false,
|
|
4182
4202
|
useDeprecatedOperations: (_ia = (_ha = outputOptions.override) == null ? void 0 : _ha.useDeprecatedOperations) != null ? _ia : true,
|
|
4183
4203
|
useNativeEnums: (_ka = (_ja = outputOptions.override) == null ? void 0 : _ja.useNativeEnums) != null ? _ka : false
|
|
4184
|
-
}
|
|
4204
|
+
},
|
|
4205
|
+
allParamsOptional: (_la = outputOptions.allParamsOptional) != null ? _la : false,
|
|
4206
|
+
urlEncodeParameters: (_ma = outputOptions.urlEncodeParameters) != null ? _ma : false
|
|
4185
4207
|
},
|
|
4186
4208
|
hooks: options.hooks ? normalizeHooks(options.hooks) : {}
|
|
4187
4209
|
};
|
package/dist/index.js
CHANGED
|
@@ -3275,17 +3275,17 @@ var import_query = __toESM(require("@orval/query"));
|
|
|
3275
3275
|
var import_swr = __toESM(require("@orval/swr"));
|
|
3276
3276
|
var import_zod = __toESM(require("@orval/zod"));
|
|
3277
3277
|
var DEFAULT_CLIENT = import_core.OutputClient.AXIOS;
|
|
3278
|
-
var
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3278
|
+
var getGeneratorClient = (outputClient, output) => {
|
|
3279
|
+
const GENERATOR_CLIENT = {
|
|
3280
|
+
axios: (0, import_axios.default)({ type: "axios" })(),
|
|
3281
|
+
"axios-functions": (0, import_axios.default)({ type: "axios-functions" })(),
|
|
3282
|
+
angular: (0, import_angular.default)()(),
|
|
3283
|
+
"react-query": (0, import_query.default)({ output, type: "react-query" })(),
|
|
3284
|
+
"svelte-query": (0, import_query.default)({ output, type: "svelte-query" })(),
|
|
3285
|
+
"vue-query": (0, import_query.default)({ output, type: "vue-query" })(),
|
|
3286
|
+
swr: (0, import_swr.default)()(),
|
|
3287
|
+
zod: (0, import_zod.default)()()
|
|
3288
|
+
};
|
|
3289
3289
|
const generator = (0, import_core.isFunction)(outputClient) ? outputClient(GENERATOR_CLIENT) : GENERATOR_CLIENT[outputClient];
|
|
3290
3290
|
if (!generator) {
|
|
3291
3291
|
throw `Oups... \u{1F37B}. Client not found: ${outputClient}`;
|
|
@@ -3301,9 +3301,10 @@ var generateClientImports = ({
|
|
|
3301
3301
|
isAllowSyntheticDefaultImports,
|
|
3302
3302
|
hasGlobalMutator,
|
|
3303
3303
|
hasParamsSerializerOptions,
|
|
3304
|
-
packageJson
|
|
3304
|
+
packageJson,
|
|
3305
|
+
output
|
|
3305
3306
|
}) => {
|
|
3306
|
-
const { dependencies } = getGeneratorClient(client);
|
|
3307
|
+
const { dependencies } = getGeneratorClient(client, output);
|
|
3307
3308
|
return (0, import_core.generateDependencyImports)(
|
|
3308
3309
|
implementation,
|
|
3309
3310
|
dependencies ? [
|
|
@@ -3326,9 +3327,10 @@ var generateClientHeader = ({
|
|
|
3326
3327
|
isMutator,
|
|
3327
3328
|
provideIn,
|
|
3328
3329
|
hasAwaitedType,
|
|
3329
|
-
titles
|
|
3330
|
+
titles,
|
|
3331
|
+
output
|
|
3330
3332
|
}) => {
|
|
3331
|
-
const { header } = getGeneratorClient(outputClient);
|
|
3333
|
+
const { header } = getGeneratorClient(outputClient, output);
|
|
3332
3334
|
return {
|
|
3333
3335
|
implementation: header ? header({
|
|
3334
3336
|
title: titles.implementation,
|
|
@@ -3347,9 +3349,10 @@ var generateClientFooter = ({
|
|
|
3347
3349
|
operationNames,
|
|
3348
3350
|
hasMutator,
|
|
3349
3351
|
hasAwaitedType,
|
|
3350
|
-
titles
|
|
3352
|
+
titles,
|
|
3353
|
+
output
|
|
3351
3354
|
}) => {
|
|
3352
|
-
const { footer } = getGeneratorClient(outputClient);
|
|
3355
|
+
const { footer } = getGeneratorClient(outputClient, output);
|
|
3353
3356
|
if (!footer) {
|
|
3354
3357
|
return {
|
|
3355
3358
|
implementation: "",
|
|
@@ -3391,9 +3394,10 @@ var generateClientFooter = ({
|
|
|
3391
3394
|
var generateClientTitle = ({
|
|
3392
3395
|
outputClient = DEFAULT_CLIENT,
|
|
3393
3396
|
title,
|
|
3394
|
-
customTitleFunc
|
|
3397
|
+
customTitleFunc,
|
|
3398
|
+
output
|
|
3395
3399
|
}) => {
|
|
3396
|
-
const { title: generatorTitle } = getGeneratorClient(outputClient);
|
|
3400
|
+
const { title: generatorTitle } = getGeneratorClient(outputClient, output);
|
|
3397
3401
|
if (!generatorTitle) {
|
|
3398
3402
|
return {
|
|
3399
3403
|
implementation: "",
|
|
@@ -3425,13 +3429,19 @@ var generateMock2 = (verbOption, options) => {
|
|
|
3425
3429
|
if ((0, import_core.isFunction)(options.mock)) {
|
|
3426
3430
|
return options.mock(verbOption, options);
|
|
3427
3431
|
}
|
|
3428
|
-
return mock.generateMock(
|
|
3432
|
+
return mock.generateMock(
|
|
3433
|
+
verbOption,
|
|
3434
|
+
options
|
|
3435
|
+
);
|
|
3429
3436
|
};
|
|
3430
|
-
var generateOperations = (outputClient = DEFAULT_CLIENT, verbsOptions, options) => {
|
|
3437
|
+
var generateOperations = (outputClient = DEFAULT_CLIENT, verbsOptions, options, output) => {
|
|
3431
3438
|
return (0, import_core.asyncReduce)(
|
|
3432
3439
|
verbsOptions,
|
|
3433
3440
|
async (acc, verbOption) => {
|
|
3434
|
-
const { client: generatorClient } = getGeneratorClient(
|
|
3441
|
+
const { client: generatorClient } = getGeneratorClient(
|
|
3442
|
+
outputClient,
|
|
3443
|
+
output
|
|
3444
|
+
);
|
|
3435
3445
|
const client = await generatorClient(verbOption, options, outputClient);
|
|
3436
3446
|
const generatedMock = generateMock2(verbOption, options);
|
|
3437
3447
|
if (!client.implementation) {
|
|
@@ -3440,7 +3450,9 @@ var generateOperations = (outputClient = DEFAULT_CLIENT, verbsOptions, options)
|
|
|
3440
3450
|
acc[verbOption.operationId] = {
|
|
3441
3451
|
implementation: verbOption.doc + client.implementation,
|
|
3442
3452
|
imports: client.imports,
|
|
3453
|
+
// @ts-expect-error // FIXME
|
|
3443
3454
|
implementationMock: generatedMock.implementation,
|
|
3455
|
+
// @ts-expect-error // FIXME
|
|
3444
3456
|
importsMock: generatedMock.imports,
|
|
3445
3457
|
tags: verbOption.tags,
|
|
3446
3458
|
mutator: verbOption.mutator,
|
|
@@ -3528,8 +3540,10 @@ var getApiBuilder = async ({
|
|
|
3528
3540
|
override: output.override,
|
|
3529
3541
|
context: resolvedContext,
|
|
3530
3542
|
mock: output.mock,
|
|
3543
|
+
// @ts-expect-error // FIXME
|
|
3531
3544
|
output: output.target
|
|
3532
|
-
}
|
|
3545
|
+
},
|
|
3546
|
+
output
|
|
3533
3547
|
);
|
|
3534
3548
|
acc.schemas.push(...schemas);
|
|
3535
3549
|
acc.operations = { ...acc.operations, ...pathOperations };
|
|
@@ -3563,6 +3577,7 @@ var importOpenApi = async ({
|
|
|
3563
3577
|
const specs = await generateInputSpecs({ specs: data, input, workspace });
|
|
3564
3578
|
const schemas = getApiSchemas({ output, target, workspace, specs });
|
|
3565
3579
|
const api = await getApiBuilder({
|
|
3580
|
+
// @ts-expect-error // FIXME
|
|
3566
3581
|
input,
|
|
3567
3582
|
output,
|
|
3568
3583
|
context: {
|
|
@@ -3743,6 +3758,7 @@ var importSpecs = async (workspace, options) => {
|
|
|
3743
3758
|
if ((0, import_core4.isObject)(input.target)) {
|
|
3744
3759
|
return importOpenApi({
|
|
3745
3760
|
data: { [workspace]: input.target },
|
|
3761
|
+
// @ts-expect-error // FIXME
|
|
3746
3762
|
input,
|
|
3747
3763
|
output,
|
|
3748
3764
|
target: workspace,
|
|
@@ -3751,6 +3767,7 @@ var importSpecs = async (workspace, options) => {
|
|
|
3751
3767
|
}
|
|
3752
3768
|
const isPathUrl = (0, import_core4.isUrl)(input.target);
|
|
3753
3769
|
const data = await resolveSpecs(
|
|
3770
|
+
// @ts-expect-error // FIXME
|
|
3754
3771
|
input.target,
|
|
3755
3772
|
input.parserOptions,
|
|
3756
3773
|
isPathUrl,
|
|
@@ -3758,8 +3775,10 @@ var importSpecs = async (workspace, options) => {
|
|
|
3758
3775
|
);
|
|
3759
3776
|
return importOpenApi({
|
|
3760
3777
|
data,
|
|
3778
|
+
// @ts-expect-error // FIXME
|
|
3761
3779
|
input,
|
|
3762
3780
|
output,
|
|
3781
|
+
// @ts-expect-error // FIXME
|
|
3763
3782
|
target: input.target,
|
|
3764
3783
|
workspace
|
|
3765
3784
|
});
|
|
@@ -3774,7 +3793,7 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
3774
3793
|
var package_default = {
|
|
3775
3794
|
name: "orval",
|
|
3776
3795
|
description: "A swagger client generator for typescript",
|
|
3777
|
-
version: "6.
|
|
3796
|
+
version: "6.22.0",
|
|
3778
3797
|
license: "MIT",
|
|
3779
3798
|
files: [
|
|
3780
3799
|
"dist"
|
|
@@ -3817,7 +3836,8 @@ var package_default = {
|
|
|
3817
3836
|
build: "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --dts",
|
|
3818
3837
|
dev: "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --watch ./src --onSuccess 'yarn generate-api'",
|
|
3819
3838
|
lint: "eslint src/**/*.ts",
|
|
3820
|
-
"generate-api": "node ./dist/bin/orval.js --config ../../samples/react-query/basic/orval.config.ts"
|
|
3839
|
+
"generate-api": "node ./dist/bin/orval.js --config ../../samples/react-query/basic/orval.config.ts",
|
|
3840
|
+
test: "tsc --noEmit && vitest --passWithNoTests"
|
|
3821
3841
|
},
|
|
3822
3842
|
devDependencies: {
|
|
3823
3843
|
"@types/inquirer": "^9.0.6",
|
|
@@ -3826,13 +3846,13 @@ var package_default = {
|
|
|
3826
3846
|
},
|
|
3827
3847
|
dependencies: {
|
|
3828
3848
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
3829
|
-
"@orval/angular": "6.
|
|
3830
|
-
"@orval/axios": "6.
|
|
3831
|
-
"@orval/core": "6.
|
|
3832
|
-
"@orval/mock": "6.
|
|
3833
|
-
"@orval/query": "6.
|
|
3834
|
-
"@orval/swr": "6.
|
|
3835
|
-
"@orval/zod": "6.
|
|
3849
|
+
"@orval/angular": "6.22.0",
|
|
3850
|
+
"@orval/axios": "6.22.0",
|
|
3851
|
+
"@orval/core": "6.22.0",
|
|
3852
|
+
"@orval/mock": "6.22.0",
|
|
3853
|
+
"@orval/query": "6.22.0",
|
|
3854
|
+
"@orval/swr": "6.22.0",
|
|
3855
|
+
"@orval/zod": "6.22.0",
|
|
3836
3856
|
ajv: "^8.12.0",
|
|
3837
3857
|
cac: "^6.7.14",
|
|
3838
3858
|
chalk: "^4.1.2",
|
|
@@ -3840,7 +3860,7 @@ var package_default = {
|
|
|
3840
3860
|
enquirer: "^2.4.1",
|
|
3841
3861
|
execa: "^5.1.1",
|
|
3842
3862
|
"find-up": "5.0.0",
|
|
3843
|
-
"fs-extra": "^11.
|
|
3863
|
+
"fs-extra": "^11.2.0",
|
|
3844
3864
|
"lodash.uniq": "^4.5.0",
|
|
3845
3865
|
"openapi-types": "^12.1.3",
|
|
3846
3866
|
"openapi3-ts": "^3.2.0",
|
|
@@ -4061,7 +4081,7 @@ function defineConfig(options) {
|
|
|
4061
4081
|
return options;
|
|
4062
4082
|
}
|
|
4063
4083
|
var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOptions = {}) => {
|
|
4064
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka;
|
|
4084
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma;
|
|
4065
4085
|
const options = await ((0, import_core7.isFunction)(optionsExport) ? optionsExport() : optionsExport);
|
|
4066
4086
|
if (!options.input) {
|
|
4067
4087
|
(0, import_core7.createLogger)().error(import_chalk2.default.red(`Config require an input`));
|
|
@@ -4195,7 +4215,9 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4195
4215
|
useDates: ((_ga = outputOptions.override) == null ? void 0 : _ga.useDates) || false,
|
|
4196
4216
|
useDeprecatedOperations: (_ia = (_ha = outputOptions.override) == null ? void 0 : _ha.useDeprecatedOperations) != null ? _ia : true,
|
|
4197
4217
|
useNativeEnums: (_ka = (_ja = outputOptions.override) == null ? void 0 : _ja.useNativeEnums) != null ? _ka : false
|
|
4198
|
-
}
|
|
4218
|
+
},
|
|
4219
|
+
allParamsOptional: (_la = outputOptions.allParamsOptional) != null ? _la : false,
|
|
4220
|
+
urlEncodeParameters: (_ma = outputOptions.urlEncodeParameters) != null ? _ma : false
|
|
4199
4221
|
},
|
|
4200
4222
|
hooks: options.hooks ? normalizeHooks(options.hooks) : {}
|
|
4201
4223
|
};
|
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.22.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
"build": "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --dts",
|
|
45
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
|
-
"generate-api": "node ./dist/bin/orval.js --config ../../samples/react-query/basic/orval.config.ts"
|
|
47
|
+
"generate-api": "node ./dist/bin/orval.js --config ../../samples/react-query/basic/orval.config.ts",
|
|
48
|
+
"test": "tsc --noEmit && vitest --passWithNoTests"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"@types/inquirer": "^9.0.6",
|
|
@@ -53,13 +54,13 @@
|
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
56
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
56
|
-
"@orval/angular": "6.
|
|
57
|
-
"@orval/axios": "6.
|
|
58
|
-
"@orval/core": "6.
|
|
59
|
-
"@orval/mock": "6.
|
|
60
|
-
"@orval/query": "6.
|
|
61
|
-
"@orval/swr": "6.
|
|
62
|
-
"@orval/zod": "6.
|
|
57
|
+
"@orval/angular": "6.22.0",
|
|
58
|
+
"@orval/axios": "6.22.0",
|
|
59
|
+
"@orval/core": "6.22.0",
|
|
60
|
+
"@orval/mock": "6.22.0",
|
|
61
|
+
"@orval/query": "6.22.0",
|
|
62
|
+
"@orval/swr": "6.22.0",
|
|
63
|
+
"@orval/zod": "6.22.0",
|
|
63
64
|
"ajv": "^8.12.0",
|
|
64
65
|
"cac": "^6.7.14",
|
|
65
66
|
"chalk": "^4.1.2",
|
|
@@ -67,7 +68,7 @@
|
|
|
67
68
|
"enquirer": "^2.4.1",
|
|
68
69
|
"execa": "^5.1.1",
|
|
69
70
|
"find-up": "5.0.0",
|
|
70
|
-
"fs-extra": "^11.
|
|
71
|
+
"fs-extra": "^11.2.0",
|
|
71
72
|
"lodash.uniq": "^4.5.0",
|
|
72
73
|
"openapi-types": "^12.1.3",
|
|
73
74
|
"openapi3-ts": "^3.2.0",
|