orval 6.28.2 → 6.29.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 +106 -37
- package/dist/bin/orval.js.map +1 -1
- package/dist/index.js +106 -37
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -3460,7 +3460,6 @@ var generateOperations = (outputClient = DEFAULT_CLIENT, verbsOptions, options,
|
|
|
3460
3460
|
imports: client.imports,
|
|
3461
3461
|
// @ts-expect-error // FIXME
|
|
3462
3462
|
implementationMock: generatedMock.implementation,
|
|
3463
|
-
// @ts-expect-error // FIXME
|
|
3464
3463
|
importsMock: generatedMock.imports,
|
|
3465
3464
|
tags: verbOption.tags,
|
|
3466
3465
|
mutator: verbOption.mutator,
|
|
@@ -3786,7 +3785,6 @@ var importSpecs = async (workspace, options) => {
|
|
|
3786
3785
|
if ((0, import_core4.isObject)(input.target)) {
|
|
3787
3786
|
return importOpenApi({
|
|
3788
3787
|
data: { [workspace]: input.target },
|
|
3789
|
-
// @ts-expect-error // FIXME
|
|
3790
3788
|
input,
|
|
3791
3789
|
output,
|
|
3792
3790
|
target: workspace,
|
|
@@ -3803,7 +3801,6 @@ var importSpecs = async (workspace, options) => {
|
|
|
3803
3801
|
);
|
|
3804
3802
|
return importOpenApi({
|
|
3805
3803
|
data,
|
|
3806
|
-
// @ts-expect-error // FIXME
|
|
3807
3804
|
input,
|
|
3808
3805
|
output,
|
|
3809
3806
|
// @ts-expect-error // FIXME
|
|
@@ -3821,7 +3818,7 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
3821
3818
|
var package_default = {
|
|
3822
3819
|
name: "orval",
|
|
3823
3820
|
description: "A swagger client generator for typescript",
|
|
3824
|
-
version: "6.
|
|
3821
|
+
version: "6.29.0",
|
|
3825
3822
|
license: "MIT",
|
|
3826
3823
|
files: [
|
|
3827
3824
|
"dist"
|
|
@@ -3875,14 +3872,14 @@ var package_default = {
|
|
|
3875
3872
|
},
|
|
3876
3873
|
dependencies: {
|
|
3877
3874
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
3878
|
-
"@orval/angular": "6.
|
|
3879
|
-
"@orval/axios": "6.
|
|
3880
|
-
"@orval/core": "6.
|
|
3881
|
-
"@orval/
|
|
3882
|
-
"@orval/
|
|
3883
|
-
"@orval/
|
|
3884
|
-
"@orval/
|
|
3885
|
-
"@orval/
|
|
3875
|
+
"@orval/angular": "6.29.0",
|
|
3876
|
+
"@orval/axios": "6.29.0",
|
|
3877
|
+
"@orval/core": "6.29.0",
|
|
3878
|
+
"@orval/hono": "6.29.0",
|
|
3879
|
+
"@orval/mock": "6.29.0",
|
|
3880
|
+
"@orval/query": "6.29.0",
|
|
3881
|
+
"@orval/swr": "6.29.0",
|
|
3882
|
+
"@orval/zod": "6.29.0",
|
|
3886
3883
|
ajv: "^8.12.0",
|
|
3887
3884
|
cac: "^6.7.14",
|
|
3888
3885
|
chalk: "^4.1.2",
|
|
@@ -4110,7 +4107,7 @@ function defineConfig(options) {
|
|
|
4110
4107
|
return options;
|
|
4111
4108
|
}
|
|
4112
4109
|
var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOptions = {}) => {
|
|
4113
|
-
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, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb;
|
|
4110
|
+
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, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub, _vb, _wb, _xb, _yb, _zb, _Ab, _Bb, _Cb, _Db, _Eb, _Fb, _Gb, _Hb, _Ib, _Jb, _Kb, _Lb, _Mb, _Nb, _Ob, _Pb;
|
|
4114
4111
|
const options = await ((0, import_core7.isFunction)(optionsExport) ? optionsExport() : optionsExport);
|
|
4115
4112
|
if (!options.input) {
|
|
4116
4113
|
(0, import_core7.createLogger)().error(import_chalk2.default.red(`Config require an input`));
|
|
@@ -4237,40 +4234,76 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4237
4234
|
},
|
|
4238
4235
|
hono: normalizeHonoOptions((_ha = outputOptions.override) == null ? void 0 : _ha.hono, workspace),
|
|
4239
4236
|
query: {
|
|
4240
|
-
useQuery: true,
|
|
4241
|
-
useMutation: true,
|
|
4242
|
-
signal: true,
|
|
4243
|
-
shouldExportMutatorHooks: true,
|
|
4244
|
-
|
|
4237
|
+
useQuery: (_ka = (_ja = (_ia = outputOptions.override) == null ? void 0 : _ia.query) == null ? void 0 : _ja.useQuery) != null ? _ka : true,
|
|
4238
|
+
useMutation: (_na = (_ma = (_la = outputOptions.override) == null ? void 0 : _la.query) == null ? void 0 : _ma.useMutation) != null ? _na : true,
|
|
4239
|
+
signal: (_qa = (_pa = (_oa = outputOptions.override) == null ? void 0 : _oa.query) == null ? void 0 : _pa.signal) != null ? _qa : true,
|
|
4240
|
+
shouldExportMutatorHooks: (_ta = (_sa = (_ra = outputOptions.override) == null ? void 0 : _ra.query) == null ? void 0 : _sa.shouldExportMutatorHooks) != null ? _ta : true,
|
|
4241
|
+
shouldExportHttpClient: (_wa = (_va = (_ua = outputOptions.override) == null ? void 0 : _ua.query) == null ? void 0 : _va.shouldExportHttpClient) != null ? _wa : true,
|
|
4242
|
+
shouldExportQueryKey: (_za = (_ya = (_xa = outputOptions.override) == null ? void 0 : _xa.query) == null ? void 0 : _ya.shouldExportQueryKey) != null ? _za : true,
|
|
4243
|
+
...normalizeQueryOptions((_Aa = outputOptions.override) == null ? void 0 : _Aa.query, workspace)
|
|
4245
4244
|
},
|
|
4246
4245
|
zod: {
|
|
4247
4246
|
strict: {
|
|
4248
|
-
param: (
|
|
4249
|
-
query: (
|
|
4250
|
-
header: (
|
|
4251
|
-
body: (
|
|
4252
|
-
response: (
|
|
4247
|
+
param: (_Ea = (_Da = (_Ca = (_Ba = outputOptions.override) == null ? void 0 : _Ba.zod) == null ? void 0 : _Ca.strict) == null ? void 0 : _Da.param) != null ? _Ea : false,
|
|
4248
|
+
query: (_Ia = (_Ha = (_Ga = (_Fa = outputOptions.override) == null ? void 0 : _Fa.zod) == null ? void 0 : _Ga.strict) == null ? void 0 : _Ha.query) != null ? _Ia : false,
|
|
4249
|
+
header: (_Ma = (_La = (_Ka = (_Ja = outputOptions.override) == null ? void 0 : _Ja.zod) == null ? void 0 : _Ka.strict) == null ? void 0 : _La.header) != null ? _Ma : false,
|
|
4250
|
+
body: (_Qa = (_Pa = (_Oa = (_Na = outputOptions.override) == null ? void 0 : _Na.zod) == null ? void 0 : _Oa.strict) == null ? void 0 : _Pa.body) != null ? _Qa : false,
|
|
4251
|
+
response: (_Ua = (_Ta = (_Sa = (_Ra = outputOptions.override) == null ? void 0 : _Ra.zod) == null ? void 0 : _Sa.strict) == null ? void 0 : _Ta.response) != null ? _Ua : false
|
|
4253
4252
|
},
|
|
4254
4253
|
coerce: {
|
|
4255
|
-
param: (
|
|
4256
|
-
query: (
|
|
4257
|
-
header: (
|
|
4258
|
-
body: (
|
|
4259
|
-
response: (
|
|
4254
|
+
param: (_Ya = (_Xa = (_Wa = (_Va = outputOptions.override) == null ? void 0 : _Va.zod) == null ? void 0 : _Wa.coerce) == null ? void 0 : _Xa.param) != null ? _Ya : false,
|
|
4255
|
+
query: (_ab = (_$a = (__a = (_Za = outputOptions.override) == null ? void 0 : _Za.zod) == null ? void 0 : __a.coerce) == null ? void 0 : _$a.query) != null ? _ab : false,
|
|
4256
|
+
header: (_eb = (_db = (_cb = (_bb = outputOptions.override) == null ? void 0 : _bb.zod) == null ? void 0 : _cb.coerce) == null ? void 0 : _db.header) != null ? _eb : false,
|
|
4257
|
+
body: (_ib = (_hb = (_gb = (_fb = outputOptions.override) == null ? void 0 : _fb.zod) == null ? void 0 : _gb.coerce) == null ? void 0 : _hb.body) != null ? _ib : false,
|
|
4258
|
+
response: (_mb = (_lb = (_kb = (_jb = outputOptions.override) == null ? void 0 : _jb.zod) == null ? void 0 : _kb.coerce) == null ? void 0 : _lb.response) != null ? _mb : false
|
|
4259
|
+
},
|
|
4260
|
+
preprocess: {
|
|
4261
|
+
...((_pb = (_ob = (_nb = outputOptions.override) == null ? void 0 : _nb.zod) == null ? void 0 : _ob.preprocess) == null ? void 0 : _pb.param) ? {
|
|
4262
|
+
param: normalizeMutator(
|
|
4263
|
+
workspace,
|
|
4264
|
+
outputOptions.override.zod.preprocess.param
|
|
4265
|
+
)
|
|
4266
|
+
} : {},
|
|
4267
|
+
...((_sb = (_rb = (_qb = outputOptions.override) == null ? void 0 : _qb.zod) == null ? void 0 : _rb.preprocess) == null ? void 0 : _sb.query) ? {
|
|
4268
|
+
query: normalizeMutator(
|
|
4269
|
+
workspace,
|
|
4270
|
+
outputOptions.override.zod.preprocess.query
|
|
4271
|
+
)
|
|
4272
|
+
} : {},
|
|
4273
|
+
...((_vb = (_ub = (_tb = outputOptions.override) == null ? void 0 : _tb.zod) == null ? void 0 : _ub.preprocess) == null ? void 0 : _vb.header) ? {
|
|
4274
|
+
header: normalizeMutator(
|
|
4275
|
+
workspace,
|
|
4276
|
+
outputOptions.override.zod.preprocess.header
|
|
4277
|
+
)
|
|
4278
|
+
} : {},
|
|
4279
|
+
...((_yb = (_xb = (_wb = outputOptions.override) == null ? void 0 : _wb.zod) == null ? void 0 : _xb.preprocess) == null ? void 0 : _yb.body) ? {
|
|
4280
|
+
body: normalizeMutator(
|
|
4281
|
+
workspace,
|
|
4282
|
+
outputOptions.override.zod.preprocess.body
|
|
4283
|
+
)
|
|
4284
|
+
} : {},
|
|
4285
|
+
...((_Bb = (_Ab = (_zb = outputOptions.override) == null ? void 0 : _zb.zod) == null ? void 0 : _Ab.preprocess) == null ? void 0 : _Bb.response) ? {
|
|
4286
|
+
response: normalizeMutator(
|
|
4287
|
+
workspace,
|
|
4288
|
+
outputOptions.override.zod.preprocess.response
|
|
4289
|
+
)
|
|
4290
|
+
} : {}
|
|
4260
4291
|
}
|
|
4261
4292
|
},
|
|
4262
4293
|
swr: {
|
|
4263
|
-
...(
|
|
4294
|
+
...(_Db = (_Cb = outputOptions.override) == null ? void 0 : _Cb.swr) != null ? _Db : {}
|
|
4264
4295
|
},
|
|
4265
4296
|
angular: {
|
|
4266
|
-
provideIn: (
|
|
4297
|
+
provideIn: (_Gb = (_Fb = (_Eb = outputOptions.override) == null ? void 0 : _Eb.angular) == null ? void 0 : _Fb.provideIn) != null ? _Gb : "root"
|
|
4267
4298
|
},
|
|
4268
|
-
useDates: ((
|
|
4269
|
-
useDeprecatedOperations: (
|
|
4270
|
-
useNativeEnums: (
|
|
4299
|
+
useDates: ((_Hb = outputOptions.override) == null ? void 0 : _Hb.useDates) || false,
|
|
4300
|
+
useDeprecatedOperations: (_Jb = (_Ib = outputOptions.override) == null ? void 0 : _Ib.useDeprecatedOperations) != null ? _Jb : true,
|
|
4301
|
+
useNativeEnums: (_Lb = (_Kb = outputOptions.override) == null ? void 0 : _Kb.useNativeEnums) != null ? _Lb : false,
|
|
4302
|
+
suppressReadonlyModifier: ((_Mb = outputOptions.override) == null ? void 0 : _Mb.suppressReadonlyModifier) || false
|
|
4271
4303
|
},
|
|
4272
|
-
allParamsOptional: (
|
|
4273
|
-
urlEncodeParameters: (
|
|
4304
|
+
allParamsOptional: (_Nb = outputOptions.allParamsOptional) != null ? _Nb : false,
|
|
4305
|
+
urlEncodeParameters: (_Ob = outputOptions.urlEncodeParameters) != null ? _Ob : false,
|
|
4306
|
+
optionsParamRequired: (_Pb = outputOptions.optionsParamRequired) != null ? _Pb : false
|
|
4274
4307
|
},
|
|
4275
4308
|
hooks: options.hooks ? normalizeHooks(options.hooks) : {}
|
|
4276
4309
|
};
|
|
@@ -4339,7 +4372,7 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace) => {
|
|
|
4339
4372
|
...rest
|
|
4340
4373
|
}
|
|
4341
4374
|
]) => {
|
|
4342
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
4375
|
+
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;
|
|
4343
4376
|
return [
|
|
4344
4377
|
key,
|
|
4345
4378
|
{
|
|
@@ -4362,6 +4395,38 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace) => {
|
|
|
4362
4395
|
header: (_p = (_o = zod2.coerce) == null ? void 0 : _o.header) != null ? _p : false,
|
|
4363
4396
|
body: (_r = (_q = zod2.coerce) == null ? void 0 : _q.body) != null ? _r : false,
|
|
4364
4397
|
response: (_t = (_s = zod2.coerce) == null ? void 0 : _s.response) != null ? _t : false
|
|
4398
|
+
},
|
|
4399
|
+
preprocess: {
|
|
4400
|
+
...((_u = zod2.preprocess) == null ? void 0 : _u.param) ? {
|
|
4401
|
+
param: normalizeMutator(
|
|
4402
|
+
workspace,
|
|
4403
|
+
zod2.preprocess.param
|
|
4404
|
+
)
|
|
4405
|
+
} : {},
|
|
4406
|
+
...((_v = zod2.preprocess) == null ? void 0 : _v.query) ? {
|
|
4407
|
+
query: normalizeMutator(
|
|
4408
|
+
workspace,
|
|
4409
|
+
zod2.preprocess.query
|
|
4410
|
+
)
|
|
4411
|
+
} : {},
|
|
4412
|
+
...((_w = zod2.preprocess) == null ? void 0 : _w.header) ? {
|
|
4413
|
+
header: normalizeMutator(
|
|
4414
|
+
workspace,
|
|
4415
|
+
zod2.preprocess.header
|
|
4416
|
+
)
|
|
4417
|
+
} : {},
|
|
4418
|
+
...((_x = zod2.preprocess) == null ? void 0 : _x.body) ? {
|
|
4419
|
+
body: normalizeMutator(
|
|
4420
|
+
workspace,
|
|
4421
|
+
zod2.preprocess.body
|
|
4422
|
+
)
|
|
4423
|
+
} : {},
|
|
4424
|
+
...((_y = zod2.preprocess) == null ? void 0 : _y.response) ? {
|
|
4425
|
+
response: normalizeMutator(
|
|
4426
|
+
workspace,
|
|
4427
|
+
zod2.preprocess.response
|
|
4428
|
+
)
|
|
4429
|
+
} : {}
|
|
4365
4430
|
}
|
|
4366
4431
|
}
|
|
4367
4432
|
} : {},
|
|
@@ -4423,8 +4488,10 @@ var normalizeHooks = (hooks) => {
|
|
|
4423
4488
|
}, {});
|
|
4424
4489
|
};
|
|
4425
4490
|
var normalizeHonoOptions = (hono2 = {}, workspace) => {
|
|
4491
|
+
var _a;
|
|
4426
4492
|
return {
|
|
4427
|
-
...hono2.handlers ? { handlers: import_core7.upath.resolve(workspace, hono2.handlers) } : {}
|
|
4493
|
+
...hono2.handlers ? { handlers: import_core7.upath.resolve(workspace, hono2.handlers) } : {},
|
|
4494
|
+
validator: (_a = hono2.validator) != null ? _a : true
|
|
4428
4495
|
};
|
|
4429
4496
|
};
|
|
4430
4497
|
var normalizeQueryOptions = (queryOptions = {}, outputWorkspace) => {
|
|
@@ -4458,6 +4525,8 @@ var normalizeQueryOptions = (queryOptions = {}, outputWorkspace) => {
|
|
|
4458
4525
|
)
|
|
4459
4526
|
} : {},
|
|
4460
4527
|
...!(0, import_core7.isUndefined)(queryOptions.shouldExportMutatorHooks) ? { shouldExportMutatorHooks: queryOptions.shouldExportMutatorHooks } : {},
|
|
4528
|
+
...!(0, import_core7.isUndefined)(queryOptions.shouldExportQueryKey) ? { shouldExportQueryKey: queryOptions.shouldExportQueryKey } : {},
|
|
4529
|
+
...!(0, import_core7.isUndefined)(queryOptions.shouldExportHttpClient) ? { shouldExportHttpClient: queryOptions.shouldExportHttpClient } : {},
|
|
4461
4530
|
...!(0, import_core7.isUndefined)(queryOptions.signal) ? { signal: queryOptions.signal } : {},
|
|
4462
4531
|
...!(0, import_core7.isUndefined)(queryOptions.version) ? { version: queryOptions.version } : {}
|
|
4463
4532
|
};
|