orval 6.28.2 → 6.29.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 +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/bin/orval.js
CHANGED
|
@@ -3449,7 +3449,6 @@ var generateOperations = (outputClient = DEFAULT_CLIENT, verbsOptions, options,
|
|
|
3449
3449
|
imports: client.imports,
|
|
3450
3450
|
// @ts-expect-error // FIXME
|
|
3451
3451
|
implementationMock: generatedMock.implementation,
|
|
3452
|
-
// @ts-expect-error // FIXME
|
|
3453
3452
|
importsMock: generatedMock.imports,
|
|
3454
3453
|
tags: verbOption.tags,
|
|
3455
3454
|
mutator: verbOption.mutator,
|
|
@@ -3775,7 +3774,6 @@ var importSpecs = async (workspace, options) => {
|
|
|
3775
3774
|
if ((0, import_core4.isObject)(input.target)) {
|
|
3776
3775
|
return importOpenApi({
|
|
3777
3776
|
data: { [workspace]: input.target },
|
|
3778
|
-
// @ts-expect-error // FIXME
|
|
3779
3777
|
input,
|
|
3780
3778
|
output,
|
|
3781
3779
|
target: workspace,
|
|
@@ -3792,7 +3790,6 @@ var importSpecs = async (workspace, options) => {
|
|
|
3792
3790
|
);
|
|
3793
3791
|
return importOpenApi({
|
|
3794
3792
|
data,
|
|
3795
|
-
// @ts-expect-error // FIXME
|
|
3796
3793
|
input,
|
|
3797
3794
|
output,
|
|
3798
3795
|
// @ts-expect-error // FIXME
|
|
@@ -3810,7 +3807,7 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
3810
3807
|
var package_default = {
|
|
3811
3808
|
name: "orval",
|
|
3812
3809
|
description: "A swagger client generator for typescript",
|
|
3813
|
-
version: "6.
|
|
3810
|
+
version: "6.29.1",
|
|
3814
3811
|
license: "MIT",
|
|
3815
3812
|
files: [
|
|
3816
3813
|
"dist"
|
|
@@ -3864,14 +3861,14 @@ var package_default = {
|
|
|
3864
3861
|
},
|
|
3865
3862
|
dependencies: {
|
|
3866
3863
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
3867
|
-
"@orval/angular": "6.
|
|
3868
|
-
"@orval/axios": "6.
|
|
3869
|
-
"@orval/core": "6.
|
|
3870
|
-
"@orval/
|
|
3871
|
-
"@orval/
|
|
3872
|
-
"@orval/
|
|
3873
|
-
"@orval/
|
|
3874
|
-
"@orval/
|
|
3864
|
+
"@orval/angular": "6.29.1",
|
|
3865
|
+
"@orval/axios": "6.29.1",
|
|
3866
|
+
"@orval/core": "6.29.1",
|
|
3867
|
+
"@orval/hono": "6.29.1",
|
|
3868
|
+
"@orval/mock": "6.29.1",
|
|
3869
|
+
"@orval/query": "6.29.1",
|
|
3870
|
+
"@orval/swr": "6.29.1",
|
|
3871
|
+
"@orval/zod": "6.29.1",
|
|
3875
3872
|
ajv: "^8.12.0",
|
|
3876
3873
|
cac: "^6.7.14",
|
|
3877
3874
|
chalk: "^4.1.2",
|
|
@@ -4096,7 +4093,7 @@ var loadTsconfig = async (tsconfig, workspace = process.cwd()) => {
|
|
|
4096
4093
|
|
|
4097
4094
|
// src/utils/options.ts
|
|
4098
4095
|
var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOptions = {}) => {
|
|
4099
|
-
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;
|
|
4096
|
+
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;
|
|
4100
4097
|
const options = await ((0, import_core7.isFunction)(optionsExport) ? optionsExport() : optionsExport);
|
|
4101
4098
|
if (!options.input) {
|
|
4102
4099
|
(0, import_core7.createLogger)().error(import_chalk2.default.red(`Config require an input`));
|
|
@@ -4223,40 +4220,76 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4223
4220
|
},
|
|
4224
4221
|
hono: normalizeHonoOptions((_ha = outputOptions.override) == null ? void 0 : _ha.hono, workspace),
|
|
4225
4222
|
query: {
|
|
4226
|
-
useQuery: true,
|
|
4227
|
-
useMutation: true,
|
|
4228
|
-
signal: true,
|
|
4229
|
-
shouldExportMutatorHooks: true,
|
|
4230
|
-
|
|
4223
|
+
useQuery: (_ka = (_ja = (_ia = outputOptions.override) == null ? void 0 : _ia.query) == null ? void 0 : _ja.useQuery) != null ? _ka : true,
|
|
4224
|
+
useMutation: (_na = (_ma = (_la = outputOptions.override) == null ? void 0 : _la.query) == null ? void 0 : _ma.useMutation) != null ? _na : true,
|
|
4225
|
+
signal: (_qa = (_pa = (_oa = outputOptions.override) == null ? void 0 : _oa.query) == null ? void 0 : _pa.signal) != null ? _qa : true,
|
|
4226
|
+
shouldExportMutatorHooks: (_ta = (_sa = (_ra = outputOptions.override) == null ? void 0 : _ra.query) == null ? void 0 : _sa.shouldExportMutatorHooks) != null ? _ta : true,
|
|
4227
|
+
shouldExportHttpClient: (_wa = (_va = (_ua = outputOptions.override) == null ? void 0 : _ua.query) == null ? void 0 : _va.shouldExportHttpClient) != null ? _wa : true,
|
|
4228
|
+
shouldExportQueryKey: (_za = (_ya = (_xa = outputOptions.override) == null ? void 0 : _xa.query) == null ? void 0 : _ya.shouldExportQueryKey) != null ? _za : true,
|
|
4229
|
+
...normalizeQueryOptions((_Aa = outputOptions.override) == null ? void 0 : _Aa.query, workspace)
|
|
4231
4230
|
},
|
|
4232
4231
|
zod: {
|
|
4233
4232
|
strict: {
|
|
4234
|
-
param: (
|
|
4235
|
-
query: (
|
|
4236
|
-
header: (
|
|
4237
|
-
body: (
|
|
4238
|
-
response: (
|
|
4233
|
+
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,
|
|
4234
|
+
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,
|
|
4235
|
+
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,
|
|
4236
|
+
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,
|
|
4237
|
+
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
|
|
4239
4238
|
},
|
|
4240
4239
|
coerce: {
|
|
4241
|
-
param: (
|
|
4242
|
-
query: (
|
|
4243
|
-
header: (
|
|
4244
|
-
body: (
|
|
4245
|
-
response: (
|
|
4240
|
+
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,
|
|
4241
|
+
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,
|
|
4242
|
+
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,
|
|
4243
|
+
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,
|
|
4244
|
+
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
|
|
4245
|
+
},
|
|
4246
|
+
preprocess: {
|
|
4247
|
+
...((_pb = (_ob = (_nb = outputOptions.override) == null ? void 0 : _nb.zod) == null ? void 0 : _ob.preprocess) == null ? void 0 : _pb.param) ? {
|
|
4248
|
+
param: normalizeMutator(
|
|
4249
|
+
workspace,
|
|
4250
|
+
outputOptions.override.zod.preprocess.param
|
|
4251
|
+
)
|
|
4252
|
+
} : {},
|
|
4253
|
+
...((_sb = (_rb = (_qb = outputOptions.override) == null ? void 0 : _qb.zod) == null ? void 0 : _rb.preprocess) == null ? void 0 : _sb.query) ? {
|
|
4254
|
+
query: normalizeMutator(
|
|
4255
|
+
workspace,
|
|
4256
|
+
outputOptions.override.zod.preprocess.query
|
|
4257
|
+
)
|
|
4258
|
+
} : {},
|
|
4259
|
+
...((_vb = (_ub = (_tb = outputOptions.override) == null ? void 0 : _tb.zod) == null ? void 0 : _ub.preprocess) == null ? void 0 : _vb.header) ? {
|
|
4260
|
+
header: normalizeMutator(
|
|
4261
|
+
workspace,
|
|
4262
|
+
outputOptions.override.zod.preprocess.header
|
|
4263
|
+
)
|
|
4264
|
+
} : {},
|
|
4265
|
+
...((_yb = (_xb = (_wb = outputOptions.override) == null ? void 0 : _wb.zod) == null ? void 0 : _xb.preprocess) == null ? void 0 : _yb.body) ? {
|
|
4266
|
+
body: normalizeMutator(
|
|
4267
|
+
workspace,
|
|
4268
|
+
outputOptions.override.zod.preprocess.body
|
|
4269
|
+
)
|
|
4270
|
+
} : {},
|
|
4271
|
+
...((_Bb = (_Ab = (_zb = outputOptions.override) == null ? void 0 : _zb.zod) == null ? void 0 : _Ab.preprocess) == null ? void 0 : _Bb.response) ? {
|
|
4272
|
+
response: normalizeMutator(
|
|
4273
|
+
workspace,
|
|
4274
|
+
outputOptions.override.zod.preprocess.response
|
|
4275
|
+
)
|
|
4276
|
+
} : {}
|
|
4246
4277
|
}
|
|
4247
4278
|
},
|
|
4248
4279
|
swr: {
|
|
4249
|
-
...(
|
|
4280
|
+
...(_Db = (_Cb = outputOptions.override) == null ? void 0 : _Cb.swr) != null ? _Db : {}
|
|
4250
4281
|
},
|
|
4251
4282
|
angular: {
|
|
4252
|
-
provideIn: (
|
|
4283
|
+
provideIn: (_Gb = (_Fb = (_Eb = outputOptions.override) == null ? void 0 : _Eb.angular) == null ? void 0 : _Fb.provideIn) != null ? _Gb : "root"
|
|
4253
4284
|
},
|
|
4254
|
-
useDates: ((
|
|
4255
|
-
useDeprecatedOperations: (
|
|
4256
|
-
useNativeEnums: (
|
|
4285
|
+
useDates: ((_Hb = outputOptions.override) == null ? void 0 : _Hb.useDates) || false,
|
|
4286
|
+
useDeprecatedOperations: (_Jb = (_Ib = outputOptions.override) == null ? void 0 : _Ib.useDeprecatedOperations) != null ? _Jb : true,
|
|
4287
|
+
useNativeEnums: (_Lb = (_Kb = outputOptions.override) == null ? void 0 : _Kb.useNativeEnums) != null ? _Lb : false,
|
|
4288
|
+
suppressReadonlyModifier: ((_Mb = outputOptions.override) == null ? void 0 : _Mb.suppressReadonlyModifier) || false
|
|
4257
4289
|
},
|
|
4258
|
-
allParamsOptional: (
|
|
4259
|
-
urlEncodeParameters: (
|
|
4290
|
+
allParamsOptional: (_Nb = outputOptions.allParamsOptional) != null ? _Nb : false,
|
|
4291
|
+
urlEncodeParameters: (_Ob = outputOptions.urlEncodeParameters) != null ? _Ob : false,
|
|
4292
|
+
optionsParamRequired: (_Pb = outputOptions.optionsParamRequired) != null ? _Pb : false
|
|
4260
4293
|
},
|
|
4261
4294
|
hooks: options.hooks ? normalizeHooks(options.hooks) : {}
|
|
4262
4295
|
};
|
|
@@ -4325,7 +4358,7 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace) => {
|
|
|
4325
4358
|
...rest
|
|
4326
4359
|
}
|
|
4327
4360
|
]) => {
|
|
4328
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
4361
|
+
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;
|
|
4329
4362
|
return [
|
|
4330
4363
|
key,
|
|
4331
4364
|
{
|
|
@@ -4348,6 +4381,38 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace) => {
|
|
|
4348
4381
|
header: (_p = (_o = zod2.coerce) == null ? void 0 : _o.header) != null ? _p : false,
|
|
4349
4382
|
body: (_r = (_q = zod2.coerce) == null ? void 0 : _q.body) != null ? _r : false,
|
|
4350
4383
|
response: (_t = (_s = zod2.coerce) == null ? void 0 : _s.response) != null ? _t : false
|
|
4384
|
+
},
|
|
4385
|
+
preprocess: {
|
|
4386
|
+
...((_u = zod2.preprocess) == null ? void 0 : _u.param) ? {
|
|
4387
|
+
param: normalizeMutator(
|
|
4388
|
+
workspace,
|
|
4389
|
+
zod2.preprocess.param
|
|
4390
|
+
)
|
|
4391
|
+
} : {},
|
|
4392
|
+
...((_v = zod2.preprocess) == null ? void 0 : _v.query) ? {
|
|
4393
|
+
query: normalizeMutator(
|
|
4394
|
+
workspace,
|
|
4395
|
+
zod2.preprocess.query
|
|
4396
|
+
)
|
|
4397
|
+
} : {},
|
|
4398
|
+
...((_w = zod2.preprocess) == null ? void 0 : _w.header) ? {
|
|
4399
|
+
header: normalizeMutator(
|
|
4400
|
+
workspace,
|
|
4401
|
+
zod2.preprocess.header
|
|
4402
|
+
)
|
|
4403
|
+
} : {},
|
|
4404
|
+
...((_x = zod2.preprocess) == null ? void 0 : _x.body) ? {
|
|
4405
|
+
body: normalizeMutator(
|
|
4406
|
+
workspace,
|
|
4407
|
+
zod2.preprocess.body
|
|
4408
|
+
)
|
|
4409
|
+
} : {},
|
|
4410
|
+
...((_y = zod2.preprocess) == null ? void 0 : _y.response) ? {
|
|
4411
|
+
response: normalizeMutator(
|
|
4412
|
+
workspace,
|
|
4413
|
+
zod2.preprocess.response
|
|
4414
|
+
)
|
|
4415
|
+
} : {}
|
|
4351
4416
|
}
|
|
4352
4417
|
}
|
|
4353
4418
|
} : {},
|
|
@@ -4409,8 +4474,10 @@ var normalizeHooks = (hooks) => {
|
|
|
4409
4474
|
}, {});
|
|
4410
4475
|
};
|
|
4411
4476
|
var normalizeHonoOptions = (hono2 = {}, workspace) => {
|
|
4477
|
+
var _a;
|
|
4412
4478
|
return {
|
|
4413
|
-
...hono2.handlers ? { handlers: import_core7.upath.resolve(workspace, hono2.handlers) } : {}
|
|
4479
|
+
...hono2.handlers ? { handlers: import_core7.upath.resolve(workspace, hono2.handlers) } : {},
|
|
4480
|
+
validator: (_a = hono2.validator) != null ? _a : true
|
|
4414
4481
|
};
|
|
4415
4482
|
};
|
|
4416
4483
|
var normalizeQueryOptions = (queryOptions = {}, outputWorkspace) => {
|
|
@@ -4444,6 +4511,8 @@ var normalizeQueryOptions = (queryOptions = {}, outputWorkspace) => {
|
|
|
4444
4511
|
)
|
|
4445
4512
|
} : {},
|
|
4446
4513
|
...!(0, import_core7.isUndefined)(queryOptions.shouldExportMutatorHooks) ? { shouldExportMutatorHooks: queryOptions.shouldExportMutatorHooks } : {},
|
|
4514
|
+
...!(0, import_core7.isUndefined)(queryOptions.shouldExportQueryKey) ? { shouldExportQueryKey: queryOptions.shouldExportQueryKey } : {},
|
|
4515
|
+
...!(0, import_core7.isUndefined)(queryOptions.shouldExportHttpClient) ? { shouldExportHttpClient: queryOptions.shouldExportHttpClient } : {},
|
|
4447
4516
|
...!(0, import_core7.isUndefined)(queryOptions.signal) ? { signal: queryOptions.signal } : {},
|
|
4448
4517
|
...!(0, import_core7.isUndefined)(queryOptions.version) ? { version: queryOptions.version } : {}
|
|
4449
4518
|
};
|