orval 6.30.2 → 6.31.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/README.md +1 -0
- package/dist/bin/orval.js +28 -23
- package/dist/bin/orval.js.map +1 -1
- package/dist/index.js +28 -23
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -3823,7 +3823,7 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
3823
3823
|
var package_default = {
|
|
3824
3824
|
name: "orval",
|
|
3825
3825
|
description: "A swagger client generator for typescript",
|
|
3826
|
-
version: "6.
|
|
3826
|
+
version: "6.31.0",
|
|
3827
3827
|
license: "MIT",
|
|
3828
3828
|
files: [
|
|
3829
3829
|
"dist"
|
|
@@ -3877,15 +3877,15 @@ var package_default = {
|
|
|
3877
3877
|
},
|
|
3878
3878
|
dependencies: {
|
|
3879
3879
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
3880
|
-
"@orval/angular": "6.
|
|
3881
|
-
"@orval/axios": "6.
|
|
3882
|
-
"@orval/core": "6.
|
|
3883
|
-
"@orval/fetch": "6.
|
|
3884
|
-
"@orval/hono": "6.
|
|
3885
|
-
"@orval/mock": "6.
|
|
3886
|
-
"@orval/query": "6.
|
|
3887
|
-
"@orval/swr": "6.
|
|
3888
|
-
"@orval/zod": "6.
|
|
3880
|
+
"@orval/angular": "6.31.0",
|
|
3881
|
+
"@orval/axios": "6.31.0",
|
|
3882
|
+
"@orval/core": "6.31.0",
|
|
3883
|
+
"@orval/fetch": "6.31.0",
|
|
3884
|
+
"@orval/hono": "6.31.0",
|
|
3885
|
+
"@orval/mock": "6.31.0",
|
|
3886
|
+
"@orval/query": "6.31.0",
|
|
3887
|
+
"@orval/swr": "6.31.0",
|
|
3888
|
+
"@orval/zod": "6.31.0",
|
|
3889
3889
|
ajv: "^8.12.0",
|
|
3890
3890
|
cac: "^6.7.14",
|
|
3891
3891
|
chalk: "^4.1.2",
|
|
@@ -4113,7 +4113,7 @@ function defineConfig(options) {
|
|
|
4113
4113
|
return options;
|
|
4114
4114
|
}
|
|
4115
4115
|
var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOptions = {}) => {
|
|
4116
|
-
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;
|
|
4116
|
+
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;
|
|
4117
4117
|
const options = await ((0, import_core7.isFunction)(optionsExport) ? optionsExport() : optionsExport);
|
|
4118
4118
|
if (!options.input) {
|
|
4119
4119
|
(0, import_core7.createLogger)().error(import_chalk2.default.red(`Config require an input`));
|
|
@@ -4301,22 +4301,23 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4301
4301
|
outputOptions.override.zod.preprocess.response
|
|
4302
4302
|
)
|
|
4303
4303
|
} : {}
|
|
4304
|
-
}
|
|
4304
|
+
},
|
|
4305
|
+
generateEachHttpStatus: (_mb = (_lb = (_kb = outputOptions.override) == null ? void 0 : _kb.zod) == null ? void 0 : _lb.generateEachHttpStatus) != null ? _mb : false
|
|
4305
4306
|
},
|
|
4306
4307
|
swr: {
|
|
4307
|
-
...(
|
|
4308
|
+
...(_ob = (_nb = outputOptions.override) == null ? void 0 : _nb.swr) != null ? _ob : {}
|
|
4308
4309
|
},
|
|
4309
4310
|
angular: {
|
|
4310
|
-
provideIn: (
|
|
4311
|
+
provideIn: (_rb = (_qb = (_pb = outputOptions.override) == null ? void 0 : _pb.angular) == null ? void 0 : _qb.provideIn) != null ? _rb : "root"
|
|
4311
4312
|
},
|
|
4312
|
-
useDates: ((
|
|
4313
|
-
useDeprecatedOperations: (
|
|
4314
|
-
useNativeEnums: (
|
|
4315
|
-
suppressReadonlyModifier: ((
|
|
4313
|
+
useDates: ((_sb = outputOptions.override) == null ? void 0 : _sb.useDates) || false,
|
|
4314
|
+
useDeprecatedOperations: (_ub = (_tb = outputOptions.override) == null ? void 0 : _tb.useDeprecatedOperations) != null ? _ub : true,
|
|
4315
|
+
useNativeEnums: (_wb = (_vb = outputOptions.override) == null ? void 0 : _vb.useNativeEnums) != null ? _wb : false,
|
|
4316
|
+
suppressReadonlyModifier: ((_xb = outputOptions.override) == null ? void 0 : _xb.suppressReadonlyModifier) || false
|
|
4316
4317
|
},
|
|
4317
|
-
allParamsOptional: (
|
|
4318
|
-
urlEncodeParameters: (
|
|
4319
|
-
optionsParamRequired: (
|
|
4318
|
+
allParamsOptional: (_yb = outputOptions.allParamsOptional) != null ? _yb : false,
|
|
4319
|
+
urlEncodeParameters: (_zb = outputOptions.urlEncodeParameters) != null ? _zb : false,
|
|
4320
|
+
optionsParamRequired: (_Ab = outputOptions.optionsParamRequired) != null ? _Ab : false
|
|
4320
4321
|
},
|
|
4321
4322
|
hooks: options.hooks ? normalizeHooks(options.hooks) : {}
|
|
4322
4323
|
};
|
|
@@ -4385,7 +4386,7 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
|
|
|
4385
4386
|
...rest
|
|
4386
4387
|
}
|
|
4387
4388
|
]) => {
|
|
4388
|
-
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;
|
|
4389
|
+
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;
|
|
4389
4390
|
return [
|
|
4390
4391
|
key,
|
|
4391
4392
|
{
|
|
@@ -4440,7 +4441,8 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
|
|
|
4440
4441
|
zod2.preprocess.response
|
|
4441
4442
|
)
|
|
4442
4443
|
} : {}
|
|
4443
|
-
}
|
|
4444
|
+
},
|
|
4445
|
+
generateEachHttpStatus: (_z = zod2 == null ? void 0 : zod2.generateEachHttpStatus) != null ? _z : false
|
|
4444
4446
|
}
|
|
4445
4447
|
} : {},
|
|
4446
4448
|
...transformer ? { transformer: normalizePath(transformer, workspace) } : {},
|
|
@@ -4659,6 +4661,7 @@ var getHeader = (option, info) => {
|
|
|
4659
4661
|
return Array.isArray(header) ? (0, import_core10.jsDoc)({ description: header }) : header;
|
|
4660
4662
|
};
|
|
4661
4663
|
var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
4664
|
+
var _a;
|
|
4662
4665
|
const { info = { title: "", version: 0 }, schemas, target } = builder;
|
|
4663
4666
|
const { output } = options;
|
|
4664
4667
|
const projectTitle = projectName || info.title;
|
|
@@ -4674,6 +4677,7 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
|
4674
4677
|
const header = getHeader(output.override.header, info);
|
|
4675
4678
|
if (output.schemas) {
|
|
4676
4679
|
const rootSchemaPath = output.schemas;
|
|
4680
|
+
const fileExtension = ["tags", "tags-split", "split"].includes(output.mode) ? ".ts" : (_a = output.fileExtension) != null ? _a : ".ts";
|
|
4677
4681
|
await Promise.all(
|
|
4678
4682
|
Object.entries(schemas).map(([specKey, schemas2]) => {
|
|
4679
4683
|
const schemaPath = !(0, import_core10.isRootKey)(specKey, target) ? import_core10.upath.join(rootSchemaPath, specsName[specKey]) : rootSchemaPath;
|
|
@@ -4681,6 +4685,7 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
|
4681
4685
|
schemaPath,
|
|
4682
4686
|
schemas: schemas2,
|
|
4683
4687
|
target,
|
|
4688
|
+
fileExtension,
|
|
4684
4689
|
specsName,
|
|
4685
4690
|
specKey,
|
|
4686
4691
|
isRootKey: (0, import_core10.isRootKey)(specKey, target),
|