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/README.md
CHANGED
|
@@ -26,3 +26,4 @@ You can find below some samples
|
|
|
26
26
|
- [react app with swr](https://github.com/anymaniax/orval/tree/master/samples/react-app-with-swr)
|
|
27
27
|
- [angular app](https://github.com/anymaniax/orval/tree/master/samples/angular-app)
|
|
28
28
|
- [hono](https://github.com/anymaniax/orval/tree/master/samples/hono)
|
|
29
|
+
- [next app with fetch](https://github.com/anymaniax/orval/tree/master/samples/next-app-with-fetch)
|
package/dist/bin/orval.js
CHANGED
|
@@ -3812,7 +3812,7 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
3812
3812
|
var package_default = {
|
|
3813
3813
|
name: "orval",
|
|
3814
3814
|
description: "A swagger client generator for typescript",
|
|
3815
|
-
version: "6.
|
|
3815
|
+
version: "6.31.0",
|
|
3816
3816
|
license: "MIT",
|
|
3817
3817
|
files: [
|
|
3818
3818
|
"dist"
|
|
@@ -3866,15 +3866,15 @@ var package_default = {
|
|
|
3866
3866
|
},
|
|
3867
3867
|
dependencies: {
|
|
3868
3868
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
3869
|
-
"@orval/angular": "6.
|
|
3870
|
-
"@orval/axios": "6.
|
|
3871
|
-
"@orval/core": "6.
|
|
3872
|
-
"@orval/fetch": "6.
|
|
3873
|
-
"@orval/hono": "6.
|
|
3874
|
-
"@orval/mock": "6.
|
|
3875
|
-
"@orval/query": "6.
|
|
3876
|
-
"@orval/swr": "6.
|
|
3877
|
-
"@orval/zod": "6.
|
|
3869
|
+
"@orval/angular": "6.31.0",
|
|
3870
|
+
"@orval/axios": "6.31.0",
|
|
3871
|
+
"@orval/core": "6.31.0",
|
|
3872
|
+
"@orval/fetch": "6.31.0",
|
|
3873
|
+
"@orval/hono": "6.31.0",
|
|
3874
|
+
"@orval/mock": "6.31.0",
|
|
3875
|
+
"@orval/query": "6.31.0",
|
|
3876
|
+
"@orval/swr": "6.31.0",
|
|
3877
|
+
"@orval/zod": "6.31.0",
|
|
3878
3878
|
ajv: "^8.12.0",
|
|
3879
3879
|
cac: "^6.7.14",
|
|
3880
3880
|
chalk: "^4.1.2",
|
|
@@ -4099,7 +4099,7 @@ var loadTsconfig = async (tsconfig, workspace = process.cwd()) => {
|
|
|
4099
4099
|
|
|
4100
4100
|
// src/utils/options.ts
|
|
4101
4101
|
var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOptions = {}) => {
|
|
4102
|
-
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;
|
|
4102
|
+
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;
|
|
4103
4103
|
const options = await ((0, import_core7.isFunction)(optionsExport) ? optionsExport() : optionsExport);
|
|
4104
4104
|
if (!options.input) {
|
|
4105
4105
|
(0, import_core7.createLogger)().error(import_chalk2.default.red(`Config require an input`));
|
|
@@ -4287,22 +4287,23 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4287
4287
|
outputOptions.override.zod.preprocess.response
|
|
4288
4288
|
)
|
|
4289
4289
|
} : {}
|
|
4290
|
-
}
|
|
4290
|
+
},
|
|
4291
|
+
generateEachHttpStatus: (_mb = (_lb = (_kb = outputOptions.override) == null ? void 0 : _kb.zod) == null ? void 0 : _lb.generateEachHttpStatus) != null ? _mb : false
|
|
4291
4292
|
},
|
|
4292
4293
|
swr: {
|
|
4293
|
-
...(
|
|
4294
|
+
...(_ob = (_nb = outputOptions.override) == null ? void 0 : _nb.swr) != null ? _ob : {}
|
|
4294
4295
|
},
|
|
4295
4296
|
angular: {
|
|
4296
|
-
provideIn: (
|
|
4297
|
+
provideIn: (_rb = (_qb = (_pb = outputOptions.override) == null ? void 0 : _pb.angular) == null ? void 0 : _qb.provideIn) != null ? _rb : "root"
|
|
4297
4298
|
},
|
|
4298
|
-
useDates: ((
|
|
4299
|
-
useDeprecatedOperations: (
|
|
4300
|
-
useNativeEnums: (
|
|
4301
|
-
suppressReadonlyModifier: ((
|
|
4299
|
+
useDates: ((_sb = outputOptions.override) == null ? void 0 : _sb.useDates) || false,
|
|
4300
|
+
useDeprecatedOperations: (_ub = (_tb = outputOptions.override) == null ? void 0 : _tb.useDeprecatedOperations) != null ? _ub : true,
|
|
4301
|
+
useNativeEnums: (_wb = (_vb = outputOptions.override) == null ? void 0 : _vb.useNativeEnums) != null ? _wb : false,
|
|
4302
|
+
suppressReadonlyModifier: ((_xb = outputOptions.override) == null ? void 0 : _xb.suppressReadonlyModifier) || false
|
|
4302
4303
|
},
|
|
4303
|
-
allParamsOptional: (
|
|
4304
|
-
urlEncodeParameters: (
|
|
4305
|
-
optionsParamRequired: (
|
|
4304
|
+
allParamsOptional: (_yb = outputOptions.allParamsOptional) != null ? _yb : false,
|
|
4305
|
+
urlEncodeParameters: (_zb = outputOptions.urlEncodeParameters) != null ? _zb : false,
|
|
4306
|
+
optionsParamRequired: (_Ab = outputOptions.optionsParamRequired) != null ? _Ab : false
|
|
4306
4307
|
},
|
|
4307
4308
|
hooks: options.hooks ? normalizeHooks(options.hooks) : {}
|
|
4308
4309
|
};
|
|
@@ -4371,7 +4372,7 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
|
|
|
4371
4372
|
...rest
|
|
4372
4373
|
}
|
|
4373
4374
|
]) => {
|
|
4374
|
-
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;
|
|
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, _z;
|
|
4375
4376
|
return [
|
|
4376
4377
|
key,
|
|
4377
4378
|
{
|
|
@@ -4426,7 +4427,8 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
|
|
|
4426
4427
|
zod2.preprocess.response
|
|
4427
4428
|
)
|
|
4428
4429
|
} : {}
|
|
4429
|
-
}
|
|
4430
|
+
},
|
|
4431
|
+
generateEachHttpStatus: (_z = zod2 == null ? void 0 : zod2.generateEachHttpStatus) != null ? _z : false
|
|
4430
4432
|
}
|
|
4431
4433
|
} : {},
|
|
4432
4434
|
...transformer ? { transformer: normalizePath(transformer, workspace) } : {},
|
|
@@ -4645,6 +4647,7 @@ var getHeader = (option, info) => {
|
|
|
4645
4647
|
return Array.isArray(header) ? (0, import_core10.jsDoc)({ description: header }) : header;
|
|
4646
4648
|
};
|
|
4647
4649
|
var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
4650
|
+
var _a;
|
|
4648
4651
|
const { info = { title: "", version: 0 }, schemas, target } = builder;
|
|
4649
4652
|
const { output } = options;
|
|
4650
4653
|
const projectTitle = projectName || info.title;
|
|
@@ -4660,6 +4663,7 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
|
4660
4663
|
const header = getHeader(output.override.header, info);
|
|
4661
4664
|
if (output.schemas) {
|
|
4662
4665
|
const rootSchemaPath = output.schemas;
|
|
4666
|
+
const fileExtension = ["tags", "tags-split", "split"].includes(output.mode) ? ".ts" : (_a = output.fileExtension) != null ? _a : ".ts";
|
|
4663
4667
|
await Promise.all(
|
|
4664
4668
|
Object.entries(schemas).map(([specKey, schemas2]) => {
|
|
4665
4669
|
const schemaPath = !(0, import_core10.isRootKey)(specKey, target) ? import_core10.upath.join(rootSchemaPath, specsName[specKey]) : rootSchemaPath;
|
|
@@ -4667,6 +4671,7 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
|
4667
4671
|
schemaPath,
|
|
4668
4672
|
schemas: schemas2,
|
|
4669
4673
|
target,
|
|
4674
|
+
fileExtension,
|
|
4670
4675
|
specsName,
|
|
4671
4676
|
specKey,
|
|
4672
4677
|
isRootKey: (0, import_core10.isRootKey)(specKey, target),
|