orval 6.30.2 → 7.0.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 +9 -8
- package/dist/bin/orval.js +101 -80
- package/dist/bin/orval.js.map +1 -1
- package/dist/index.js +101 -80
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[](https://badge.fury.io/js/orval)
|
|
2
2
|
[](https://opensource.org/licenses/MIT)
|
|
3
|
-
[](https://github.com/orval-labs/orval/actions/workflows/tests.yaml)
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<img src="./logo/orval-logo-horizontal.svg?raw=true" width="500" height="160" alt="orval - Restfull Client Generator" />
|
|
@@ -19,10 +19,11 @@
|
|
|
19
19
|
|
|
20
20
|
You can find below some samples
|
|
21
21
|
|
|
22
|
-
- [react app](https://github.com/
|
|
23
|
-
- [react query](https://github.com/
|
|
24
|
-
- [svelte query](https://github.com/
|
|
25
|
-
- [vue query](https://github.com/
|
|
26
|
-
- [react app with swr](https://github.com/
|
|
27
|
-
- [angular app](https://github.com/
|
|
28
|
-
- [hono](https://github.com/
|
|
22
|
+
- [react app](https://github.com/orval-labs/orval/tree/master/samples/react-app)
|
|
23
|
+
- [react query](https://github.com/orval-labs/orval/tree/master/samples/react-query)
|
|
24
|
+
- [svelte query](https://github.com/orval-labs/orval/tree/master/samples/svelte-query)
|
|
25
|
+
- [vue query](https://github.com/orval-labs/orval/tree/master/samples/vue-query)
|
|
26
|
+
- [react app with swr](https://github.com/orval-labs/orval/tree/master/samples/react-app-with-swr)
|
|
27
|
+
- [angular app](https://github.com/orval-labs/orval/tree/master/samples/angular-app)
|
|
28
|
+
- [hono](https://github.com/orval-labs/orval/tree/master/samples/hono)
|
|
29
|
+
- [next app with fetch](https://github.com/orval-labs/orval/tree/master/samples/next-app-with-fetch)
|
package/dist/bin/orval.js
CHANGED
|
@@ -3302,7 +3302,8 @@ var generateClientImports = ({
|
|
|
3302
3302
|
...dependencies(
|
|
3303
3303
|
hasGlobalMutator,
|
|
3304
3304
|
hasParamsSerializerOptions,
|
|
3305
|
-
packageJson
|
|
3305
|
+
packageJson,
|
|
3306
|
+
output.httpClient
|
|
3306
3307
|
),
|
|
3307
3308
|
...imports
|
|
3308
3309
|
] : imports,
|
|
@@ -3812,7 +3813,7 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
3812
3813
|
var package_default = {
|
|
3813
3814
|
name: "orval",
|
|
3814
3815
|
description: "A swagger client generator for typescript",
|
|
3815
|
-
version: "
|
|
3816
|
+
version: "7.0.0",
|
|
3816
3817
|
license: "MIT",
|
|
3817
3818
|
files: [
|
|
3818
3819
|
"dist"
|
|
@@ -3850,7 +3851,7 @@ var package_default = {
|
|
|
3850
3851
|
},
|
|
3851
3852
|
repository: {
|
|
3852
3853
|
type: "git",
|
|
3853
|
-
url: "https://github.com/
|
|
3854
|
+
url: "https://github.com/orval-labs/orval"
|
|
3854
3855
|
},
|
|
3855
3856
|
scripts: {
|
|
3856
3857
|
build: "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --sourcemap --dts",
|
|
@@ -3866,15 +3867,15 @@ var package_default = {
|
|
|
3866
3867
|
},
|
|
3867
3868
|
dependencies: {
|
|
3868
3869
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
3869
|
-
"@orval/angular": "
|
|
3870
|
-
"@orval/axios": "
|
|
3871
|
-
"@orval/core": "
|
|
3872
|
-
"@orval/fetch": "
|
|
3873
|
-
"@orval/hono": "
|
|
3874
|
-
"@orval/mock": "
|
|
3875
|
-
"@orval/query": "
|
|
3876
|
-
"@orval/swr": "
|
|
3877
|
-
"@orval/zod": "
|
|
3870
|
+
"@orval/angular": "7.0.0",
|
|
3871
|
+
"@orval/axios": "7.0.0",
|
|
3872
|
+
"@orval/core": "7.0.0",
|
|
3873
|
+
"@orval/fetch": "7.0.0",
|
|
3874
|
+
"@orval/hono": "7.0.0",
|
|
3875
|
+
"@orval/mock": "7.0.0",
|
|
3876
|
+
"@orval/query": "7.0.0",
|
|
3877
|
+
"@orval/swr": "7.0.0",
|
|
3878
|
+
"@orval/zod": "7.0.0",
|
|
3878
3879
|
ajv: "^8.12.0",
|
|
3879
3880
|
cac: "^6.7.14",
|
|
3880
3881
|
chalk: "^4.1.2",
|
|
@@ -4099,7 +4100,7 @@ var loadTsconfig = async (tsconfig, workspace = process.cwd()) => {
|
|
|
4099
4100
|
|
|
4100
4101
|
// src/utils/options.ts
|
|
4101
4102
|
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;
|
|
4103
|
+
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, _Qb, _Rb, _Sb, _Tb, _Ub, _Vb, _Wb;
|
|
4103
4104
|
const options = await ((0, import_core7.isFunction)(optionsExport) ? optionsExport() : optionsExport);
|
|
4104
4105
|
if (!options.input) {
|
|
4105
4106
|
(0, import_core7.createLogger)().error(import_chalk2.default.red(`Config require an input`));
|
|
@@ -4115,7 +4116,7 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4115
4116
|
outputOptions.workspace || "",
|
|
4116
4117
|
workspace
|
|
4117
4118
|
);
|
|
4118
|
-
const { clean, prettier, client, mode, tslint, biome } = globalOptions;
|
|
4119
|
+
const { clean, prettier, client, httpClient, mode, tslint, biome } = globalOptions;
|
|
4119
4120
|
const tsconfig = await loadTsconfig(
|
|
4120
4121
|
outputOptions.tsconfig || globalOptions.tsconfig,
|
|
4121
4122
|
workspace
|
|
@@ -4169,34 +4170,35 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4169
4170
|
fileExtension: outputOptions.fileExtension || defaultFileExtension,
|
|
4170
4171
|
workspace: outputOptions.workspace ? outputWorkspace : void 0,
|
|
4171
4172
|
client: (_g = (_f = outputOptions.client) != null ? _f : client) != null ? _g : import_core7.OutputClient.AXIOS_FUNCTIONS,
|
|
4172
|
-
|
|
4173
|
+
httpClient: (_i = (_h = outputOptions.httpClient) != null ? _h : httpClient) != null ? _i : import_core7.OutputHttpClient.AXIOS,
|
|
4174
|
+
mode: normalizeOutputMode((_j = outputOptions.mode) != null ? _j : mode),
|
|
4173
4175
|
mock: mock2,
|
|
4174
|
-
clean: (
|
|
4175
|
-
prettier: (
|
|
4176
|
-
tslint: (
|
|
4177
|
-
biome: (
|
|
4176
|
+
clean: (_l = (_k = outputOptions.clean) != null ? _k : clean) != null ? _l : false,
|
|
4177
|
+
prettier: (_n = (_m = outputOptions.prettier) != null ? _m : prettier) != null ? _n : false,
|
|
4178
|
+
tslint: (_p = (_o = outputOptions.tslint) != null ? _o : tslint) != null ? _p : false,
|
|
4179
|
+
biome: (_r = (_q = outputOptions.biome) != null ? _q : biome) != null ? _r : false,
|
|
4178
4180
|
tsconfig,
|
|
4179
4181
|
packageJson,
|
|
4180
|
-
headers: (
|
|
4181
|
-
indexFiles: (
|
|
4182
|
+
headers: (_s = outputOptions.headers) != null ? _s : false,
|
|
4183
|
+
indexFiles: (_t = outputOptions.indexFiles) != null ? _t : true,
|
|
4182
4184
|
baseUrl: outputOptions.baseUrl,
|
|
4183
|
-
unionAddMissingProperties: (
|
|
4185
|
+
unionAddMissingProperties: (_u = outputOptions.unionAddMissingProperties) != null ? _u : false,
|
|
4184
4186
|
override: {
|
|
4185
4187
|
...outputOptions.override,
|
|
4186
4188
|
mock: {
|
|
4187
|
-
arrayMin: (
|
|
4188
|
-
arrayMax: (
|
|
4189
|
-
...(
|
|
4189
|
+
arrayMin: (_x = (_w = (_v = outputOptions.override) == null ? void 0 : _v.mock) == null ? void 0 : _w.arrayMin) != null ? _x : 1,
|
|
4190
|
+
arrayMax: (_A = (_z = (_y = outputOptions.override) == null ? void 0 : _y.mock) == null ? void 0 : _z.arrayMax) != null ? _A : 10,
|
|
4191
|
+
...(_C = (_B = outputOptions.override) == null ? void 0 : _B.mock) != null ? _C : {}
|
|
4190
4192
|
},
|
|
4191
4193
|
operations: normalizeOperationsAndTags(
|
|
4192
|
-
(
|
|
4194
|
+
(_E = (_D = outputOptions.override) == null ? void 0 : _D.operations) != null ? _E : {},
|
|
4193
4195
|
outputWorkspace,
|
|
4194
4196
|
{
|
|
4195
4197
|
query: globalQueryOptions
|
|
4196
4198
|
}
|
|
4197
4199
|
),
|
|
4198
4200
|
tags: normalizeOperationsAndTags(
|
|
4199
|
-
(
|
|
4201
|
+
(_G = (_F = outputOptions.override) == null ? void 0 : _F.tags) != null ? _G : {},
|
|
4200
4202
|
outputWorkspace,
|
|
4201
4203
|
{
|
|
4202
4204
|
query: globalQueryOptions
|
|
@@ -4204,105 +4206,113 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4204
4206
|
),
|
|
4205
4207
|
mutator: normalizeMutator(
|
|
4206
4208
|
outputWorkspace,
|
|
4207
|
-
(
|
|
4209
|
+
(_H = outputOptions.override) == null ? void 0 : _H.mutator
|
|
4208
4210
|
),
|
|
4209
|
-
formData: (
|
|
4211
|
+
formData: (_L = !(0, import_core7.isBoolean)((_I = outputOptions.override) == null ? void 0 : _I.formData) ? normalizeMutator(
|
|
4210
4212
|
outputWorkspace,
|
|
4211
|
-
(
|
|
4212
|
-
) : (
|
|
4213
|
-
formUrlEncoded: (
|
|
4213
|
+
(_J = outputOptions.override) == null ? void 0 : _J.formData
|
|
4214
|
+
) : (_K = outputOptions.override) == null ? void 0 : _K.formData) != null ? _L : true,
|
|
4215
|
+
formUrlEncoded: (_P = !(0, import_core7.isBoolean)((_M = outputOptions.override) == null ? void 0 : _M.formUrlEncoded) ? normalizeMutator(
|
|
4214
4216
|
outputWorkspace,
|
|
4215
|
-
(
|
|
4216
|
-
) : (
|
|
4217
|
+
(_N = outputOptions.override) == null ? void 0 : _N.formUrlEncoded
|
|
4218
|
+
) : (_O = outputOptions.override) == null ? void 0 : _O.formUrlEncoded) != null ? _P : true,
|
|
4217
4219
|
paramsSerializer: normalizeMutator(
|
|
4218
4220
|
outputWorkspace,
|
|
4219
|
-
(
|
|
4221
|
+
(_Q = outputOptions.override) == null ? void 0 : _Q.paramsSerializer
|
|
4220
4222
|
),
|
|
4221
|
-
header: ((
|
|
4222
|
-
requestOptions: (
|
|
4223
|
+
header: ((_R = outputOptions.override) == null ? void 0 : _R.header) === false ? false : (0, import_core7.isFunction)((_S = outputOptions.override) == null ? void 0 : _S.header) ? (_T = outputOptions.override) == null ? void 0 : _T.header : getDefaultFilesHeader,
|
|
4224
|
+
requestOptions: (_V = (_U = outputOptions.override) == null ? void 0 : _U.requestOptions) != null ? _V : true,
|
|
4223
4225
|
components: {
|
|
4224
4226
|
schemas: {
|
|
4225
4227
|
suffix: import_core7.RefComponentSuffix.schemas,
|
|
4226
|
-
itemSuffix: (
|
|
4227
|
-
...(
|
|
4228
|
+
itemSuffix: (_Z = (_Y = (_X = (_W = outputOptions.override) == null ? void 0 : _W.components) == null ? void 0 : _X.schemas) == null ? void 0 : _Y.itemSuffix) != null ? _Z : "Item",
|
|
4229
|
+
...(_aa = (_$ = (__ = outputOptions.override) == null ? void 0 : __.components) == null ? void 0 : _$.schemas) != null ? _aa : {}
|
|
4228
4230
|
},
|
|
4229
4231
|
responses: {
|
|
4230
4232
|
suffix: import_core7.RefComponentSuffix.responses,
|
|
4231
|
-
...(
|
|
4233
|
+
...(_da = (_ca = (_ba = outputOptions.override) == null ? void 0 : _ba.components) == null ? void 0 : _ca.responses) != null ? _da : {}
|
|
4232
4234
|
},
|
|
4233
4235
|
parameters: {
|
|
4234
4236
|
suffix: import_core7.RefComponentSuffix.parameters,
|
|
4235
|
-
...(
|
|
4237
|
+
...(_ga = (_fa = (_ea = outputOptions.override) == null ? void 0 : _ea.components) == null ? void 0 : _fa.parameters) != null ? _ga : {}
|
|
4236
4238
|
},
|
|
4237
4239
|
requestBodies: {
|
|
4238
4240
|
suffix: import_core7.RefComponentSuffix.requestBodies,
|
|
4239
|
-
...(
|
|
4241
|
+
...(_ja = (_ia = (_ha = outputOptions.override) == null ? void 0 : _ha.components) == null ? void 0 : _ia.requestBodies) != null ? _ja : {}
|
|
4240
4242
|
}
|
|
4241
4243
|
},
|
|
4242
|
-
hono: normalizeHonoOptions((
|
|
4244
|
+
hono: normalizeHonoOptions((_ka = outputOptions.override) == null ? void 0 : _ka.hono, workspace),
|
|
4243
4245
|
query: globalQueryOptions,
|
|
4244
4246
|
zod: {
|
|
4245
4247
|
strict: {
|
|
4246
|
-
param: (
|
|
4247
|
-
query: (
|
|
4248
|
-
header: (
|
|
4249
|
-
body: (
|
|
4250
|
-
response: (
|
|
4248
|
+
param: (_oa = (_na = (_ma = (_la = outputOptions.override) == null ? void 0 : _la.zod) == null ? void 0 : _ma.strict) == null ? void 0 : _na.param) != null ? _oa : false,
|
|
4249
|
+
query: (_sa = (_ra = (_qa = (_pa = outputOptions.override) == null ? void 0 : _pa.zod) == null ? void 0 : _qa.strict) == null ? void 0 : _ra.query) != null ? _sa : false,
|
|
4250
|
+
header: (_wa = (_va = (_ua = (_ta = outputOptions.override) == null ? void 0 : _ta.zod) == null ? void 0 : _ua.strict) == null ? void 0 : _va.header) != null ? _wa : false,
|
|
4251
|
+
body: (_Aa = (_za = (_ya = (_xa = outputOptions.override) == null ? void 0 : _xa.zod) == null ? void 0 : _ya.strict) == null ? void 0 : _za.body) != null ? _Aa : false,
|
|
4252
|
+
response: (_Ea = (_Da = (_Ca = (_Ba = outputOptions.override) == null ? void 0 : _Ba.zod) == null ? void 0 : _Ca.strict) == null ? void 0 : _Da.response) != null ? _Ea : false
|
|
4253
|
+
},
|
|
4254
|
+
generate: {
|
|
4255
|
+
param: (_Ia = (_Ha = (_Ga = (_Fa = outputOptions.override) == null ? void 0 : _Fa.zod) == null ? void 0 : _Ga.generate) == null ? void 0 : _Ha.param) != null ? _Ia : true,
|
|
4256
|
+
query: (_Ma = (_La = (_Ka = (_Ja = outputOptions.override) == null ? void 0 : _Ja.zod) == null ? void 0 : _Ka.generate) == null ? void 0 : _La.query) != null ? _Ma : true,
|
|
4257
|
+
header: (_Qa = (_Pa = (_Oa = (_Na = outputOptions.override) == null ? void 0 : _Na.zod) == null ? void 0 : _Oa.generate) == null ? void 0 : _Pa.header) != null ? _Qa : true,
|
|
4258
|
+
body: (_Ua = (_Ta = (_Sa = (_Ra = outputOptions.override) == null ? void 0 : _Ra.zod) == null ? void 0 : _Sa.generate) == null ? void 0 : _Ta.body) != null ? _Ua : true,
|
|
4259
|
+
response: (_Ya = (_Xa = (_Wa = (_Va = outputOptions.override) == null ? void 0 : _Va.zod) == null ? void 0 : _Wa.generate) == null ? void 0 : _Xa.response) != null ? _Ya : true
|
|
4251
4260
|
},
|
|
4252
4261
|
coerce: {
|
|
4253
|
-
param: (
|
|
4254
|
-
query: (
|
|
4255
|
-
header: (
|
|
4256
|
-
body: (
|
|
4257
|
-
response: (
|
|
4262
|
+
param: (_ab = (_$a = (__a = (_Za = outputOptions.override) == null ? void 0 : _Za.zod) == null ? void 0 : __a.coerce) == null ? void 0 : _$a.param) != null ? _ab : false,
|
|
4263
|
+
query: (_eb = (_db = (_cb = (_bb = outputOptions.override) == null ? void 0 : _bb.zod) == null ? void 0 : _cb.coerce) == null ? void 0 : _db.query) != null ? _eb : false,
|
|
4264
|
+
header: (_ib = (_hb = (_gb = (_fb = outputOptions.override) == null ? void 0 : _fb.zod) == null ? void 0 : _gb.coerce) == null ? void 0 : _hb.header) != null ? _ib : false,
|
|
4265
|
+
body: (_mb = (_lb = (_kb = (_jb = outputOptions.override) == null ? void 0 : _jb.zod) == null ? void 0 : _kb.coerce) == null ? void 0 : _lb.body) != null ? _mb : false,
|
|
4266
|
+
response: (_qb = (_pb = (_ob = (_nb = outputOptions.override) == null ? void 0 : _nb.zod) == null ? void 0 : _ob.coerce) == null ? void 0 : _pb.response) != null ? _qb : false
|
|
4258
4267
|
},
|
|
4259
4268
|
preprocess: {
|
|
4260
|
-
...((
|
|
4269
|
+
...((_tb = (_sb = (_rb = outputOptions.override) == null ? void 0 : _rb.zod) == null ? void 0 : _sb.preprocess) == null ? void 0 : _tb.param) ? {
|
|
4261
4270
|
param: normalizeMutator(
|
|
4262
4271
|
workspace,
|
|
4263
4272
|
outputOptions.override.zod.preprocess.param
|
|
4264
4273
|
)
|
|
4265
4274
|
} : {},
|
|
4266
|
-
...((
|
|
4275
|
+
...((_wb = (_vb = (_ub = outputOptions.override) == null ? void 0 : _ub.zod) == null ? void 0 : _vb.preprocess) == null ? void 0 : _wb.query) ? {
|
|
4267
4276
|
query: normalizeMutator(
|
|
4268
4277
|
workspace,
|
|
4269
4278
|
outputOptions.override.zod.preprocess.query
|
|
4270
4279
|
)
|
|
4271
4280
|
} : {},
|
|
4272
|
-
...((
|
|
4281
|
+
...((_zb = (_yb = (_xb = outputOptions.override) == null ? void 0 : _xb.zod) == null ? void 0 : _yb.preprocess) == null ? void 0 : _zb.header) ? {
|
|
4273
4282
|
header: normalizeMutator(
|
|
4274
4283
|
workspace,
|
|
4275
4284
|
outputOptions.override.zod.preprocess.header
|
|
4276
4285
|
)
|
|
4277
4286
|
} : {},
|
|
4278
|
-
...((
|
|
4287
|
+
...((_Cb = (_Bb = (_Ab = outputOptions.override) == null ? void 0 : _Ab.zod) == null ? void 0 : _Bb.preprocess) == null ? void 0 : _Cb.body) ? {
|
|
4279
4288
|
body: normalizeMutator(
|
|
4280
4289
|
workspace,
|
|
4281
4290
|
outputOptions.override.zod.preprocess.body
|
|
4282
4291
|
)
|
|
4283
4292
|
} : {},
|
|
4284
|
-
...((
|
|
4293
|
+
...((_Fb = (_Eb = (_Db = outputOptions.override) == null ? void 0 : _Db.zod) == null ? void 0 : _Eb.preprocess) == null ? void 0 : _Fb.response) ? {
|
|
4285
4294
|
response: normalizeMutator(
|
|
4286
4295
|
workspace,
|
|
4287
4296
|
outputOptions.override.zod.preprocess.response
|
|
4288
4297
|
)
|
|
4289
4298
|
} : {}
|
|
4290
|
-
}
|
|
4299
|
+
},
|
|
4300
|
+
generateEachHttpStatus: (_Ib = (_Hb = (_Gb = outputOptions.override) == null ? void 0 : _Gb.zod) == null ? void 0 : _Hb.generateEachHttpStatus) != null ? _Ib : false
|
|
4291
4301
|
},
|
|
4292
4302
|
swr: {
|
|
4293
|
-
...(
|
|
4303
|
+
...(_Kb = (_Jb = outputOptions.override) == null ? void 0 : _Jb.swr) != null ? _Kb : {}
|
|
4294
4304
|
},
|
|
4295
4305
|
angular: {
|
|
4296
|
-
provideIn: (
|
|
4306
|
+
provideIn: (_Nb = (_Mb = (_Lb = outputOptions.override) == null ? void 0 : _Lb.angular) == null ? void 0 : _Mb.provideIn) != null ? _Nb : "root"
|
|
4297
4307
|
},
|
|
4298
|
-
useDates: ((
|
|
4299
|
-
useDeprecatedOperations: (
|
|
4300
|
-
useNativeEnums: (
|
|
4301
|
-
suppressReadonlyModifier: ((
|
|
4308
|
+
useDates: ((_Ob = outputOptions.override) == null ? void 0 : _Ob.useDates) || false,
|
|
4309
|
+
useDeprecatedOperations: (_Qb = (_Pb = outputOptions.override) == null ? void 0 : _Pb.useDeprecatedOperations) != null ? _Qb : true,
|
|
4310
|
+
useNativeEnums: (_Sb = (_Rb = outputOptions.override) == null ? void 0 : _Rb.useNativeEnums) != null ? _Sb : false,
|
|
4311
|
+
suppressReadonlyModifier: ((_Tb = outputOptions.override) == null ? void 0 : _Tb.suppressReadonlyModifier) || false
|
|
4302
4312
|
},
|
|
4303
|
-
allParamsOptional: (
|
|
4304
|
-
urlEncodeParameters: (
|
|
4305
|
-
optionsParamRequired: (
|
|
4313
|
+
allParamsOptional: (_Ub = outputOptions.allParamsOptional) != null ? _Ub : false,
|
|
4314
|
+
urlEncodeParameters: (_Vb = outputOptions.urlEncodeParameters) != null ? _Vb : false,
|
|
4315
|
+
optionsParamRequired: (_Wb = outputOptions.optionsParamRequired) != null ? _Wb : false
|
|
4306
4316
|
},
|
|
4307
4317
|
hooks: options.hooks ? normalizeHooks(options.hooks) : {}
|
|
4308
4318
|
};
|
|
@@ -4371,7 +4381,7 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
|
|
|
4371
4381
|
...rest
|
|
4372
4382
|
}
|
|
4373
4383
|
]) => {
|
|
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;
|
|
4384
|
+
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;
|
|
4375
4385
|
return [
|
|
4376
4386
|
key,
|
|
4377
4387
|
{
|
|
@@ -4388,45 +4398,53 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
|
|
|
4388
4398
|
body: (_h = (_g = zod2.strict) == null ? void 0 : _g.body) != null ? _h : false,
|
|
4389
4399
|
response: (_j = (_i = zod2.strict) == null ? void 0 : _i.response) != null ? _j : false
|
|
4390
4400
|
},
|
|
4401
|
+
generate: {
|
|
4402
|
+
param: (_l = (_k = zod2.generate) == null ? void 0 : _k.param) != null ? _l : true,
|
|
4403
|
+
query: (_n = (_m = zod2.generate) == null ? void 0 : _m.query) != null ? _n : true,
|
|
4404
|
+
header: (_p = (_o = zod2.generate) == null ? void 0 : _o.header) != null ? _p : true,
|
|
4405
|
+
body: (_r = (_q = zod2.generate) == null ? void 0 : _q.body) != null ? _r : true,
|
|
4406
|
+
response: (_t = (_s = zod2.generate) == null ? void 0 : _s.response) != null ? _t : true
|
|
4407
|
+
},
|
|
4391
4408
|
coerce: {
|
|
4392
|
-
param: (
|
|
4393
|
-
query: (
|
|
4394
|
-
header: (
|
|
4395
|
-
body: (
|
|
4396
|
-
response: (
|
|
4409
|
+
param: (_v = (_u = zod2.coerce) == null ? void 0 : _u.param) != null ? _v : false,
|
|
4410
|
+
query: (_x = (_w = zod2.coerce) == null ? void 0 : _w.query) != null ? _x : false,
|
|
4411
|
+
header: (_z = (_y = zod2.coerce) == null ? void 0 : _y.header) != null ? _z : false,
|
|
4412
|
+
body: (_B = (_A = zod2.coerce) == null ? void 0 : _A.body) != null ? _B : false,
|
|
4413
|
+
response: (_D = (_C = zod2.coerce) == null ? void 0 : _C.response) != null ? _D : false
|
|
4397
4414
|
},
|
|
4398
4415
|
preprocess: {
|
|
4399
|
-
...((
|
|
4416
|
+
...((_E = zod2.preprocess) == null ? void 0 : _E.param) ? {
|
|
4400
4417
|
param: normalizeMutator(
|
|
4401
4418
|
workspace,
|
|
4402
4419
|
zod2.preprocess.param
|
|
4403
4420
|
)
|
|
4404
4421
|
} : {},
|
|
4405
|
-
...((
|
|
4422
|
+
...((_F = zod2.preprocess) == null ? void 0 : _F.query) ? {
|
|
4406
4423
|
query: normalizeMutator(
|
|
4407
4424
|
workspace,
|
|
4408
4425
|
zod2.preprocess.query
|
|
4409
4426
|
)
|
|
4410
4427
|
} : {},
|
|
4411
|
-
...((
|
|
4428
|
+
...((_G = zod2.preprocess) == null ? void 0 : _G.header) ? {
|
|
4412
4429
|
header: normalizeMutator(
|
|
4413
4430
|
workspace,
|
|
4414
4431
|
zod2.preprocess.header
|
|
4415
4432
|
)
|
|
4416
4433
|
} : {},
|
|
4417
|
-
...((
|
|
4434
|
+
...((_H = zod2.preprocess) == null ? void 0 : _H.body) ? {
|
|
4418
4435
|
body: normalizeMutator(
|
|
4419
4436
|
workspace,
|
|
4420
4437
|
zod2.preprocess.body
|
|
4421
4438
|
)
|
|
4422
4439
|
} : {},
|
|
4423
|
-
...((
|
|
4440
|
+
...((_I = zod2.preprocess) == null ? void 0 : _I.response) ? {
|
|
4424
4441
|
response: normalizeMutator(
|
|
4425
4442
|
workspace,
|
|
4426
4443
|
zod2.preprocess.response
|
|
4427
4444
|
)
|
|
4428
4445
|
} : {}
|
|
4429
|
-
}
|
|
4446
|
+
},
|
|
4447
|
+
generateEachHttpStatus: (_J = zod2 == null ? void 0 : zod2.generateEachHttpStatus) != null ? _J : false
|
|
4430
4448
|
}
|
|
4431
4449
|
} : {},
|
|
4432
4450
|
...transformer ? { transformer: normalizePath(transformer, workspace) } : {},
|
|
@@ -4645,6 +4663,7 @@ var getHeader = (option, info) => {
|
|
|
4645
4663
|
return Array.isArray(header) ? (0, import_core10.jsDoc)({ description: header }) : header;
|
|
4646
4664
|
};
|
|
4647
4665
|
var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
4666
|
+
var _a;
|
|
4648
4667
|
const { info = { title: "", version: 0 }, schemas, target } = builder;
|
|
4649
4668
|
const { output } = options;
|
|
4650
4669
|
const projectTitle = projectName || info.title;
|
|
@@ -4660,6 +4679,7 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
|
4660
4679
|
const header = getHeader(output.override.header, info);
|
|
4661
4680
|
if (output.schemas) {
|
|
4662
4681
|
const rootSchemaPath = output.schemas;
|
|
4682
|
+
const fileExtension = ["tags", "tags-split", "split"].includes(output.mode) ? ".ts" : (_a = output.fileExtension) != null ? _a : ".ts";
|
|
4663
4683
|
await Promise.all(
|
|
4664
4684
|
Object.entries(schemas).map(([specKey, schemas2]) => {
|
|
4665
4685
|
const schemaPath = !(0, import_core10.isRootKey)(specKey, target) ? import_core10.upath.join(rootSchemaPath, specsName[specKey]) : rootSchemaPath;
|
|
@@ -4667,6 +4687,7 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
|
4667
4687
|
schemaPath,
|
|
4668
4688
|
schemas: schemas2,
|
|
4669
4689
|
target,
|
|
4690
|
+
fileExtension,
|
|
4670
4691
|
specsName,
|
|
4671
4692
|
specKey,
|
|
4672
4693
|
isRootKey: (0, import_core10.isRootKey)(specKey, target),
|