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/dist/index.js
CHANGED
|
@@ -3313,7 +3313,8 @@ var generateClientImports = ({
|
|
|
3313
3313
|
...dependencies(
|
|
3314
3314
|
hasGlobalMutator,
|
|
3315
3315
|
hasParamsSerializerOptions,
|
|
3316
|
-
packageJson
|
|
3316
|
+
packageJson,
|
|
3317
|
+
output.httpClient
|
|
3317
3318
|
),
|
|
3318
3319
|
...imports
|
|
3319
3320
|
] : imports,
|
|
@@ -3823,7 +3824,7 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
3823
3824
|
var package_default = {
|
|
3824
3825
|
name: "orval",
|
|
3825
3826
|
description: "A swagger client generator for typescript",
|
|
3826
|
-
version: "
|
|
3827
|
+
version: "7.0.0",
|
|
3827
3828
|
license: "MIT",
|
|
3828
3829
|
files: [
|
|
3829
3830
|
"dist"
|
|
@@ -3861,7 +3862,7 @@ var package_default = {
|
|
|
3861
3862
|
},
|
|
3862
3863
|
repository: {
|
|
3863
3864
|
type: "git",
|
|
3864
|
-
url: "https://github.com/
|
|
3865
|
+
url: "https://github.com/orval-labs/orval"
|
|
3865
3866
|
},
|
|
3866
3867
|
scripts: {
|
|
3867
3868
|
build: "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --sourcemap --dts",
|
|
@@ -3877,15 +3878,15 @@ var package_default = {
|
|
|
3877
3878
|
},
|
|
3878
3879
|
dependencies: {
|
|
3879
3880
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
3880
|
-
"@orval/angular": "
|
|
3881
|
-
"@orval/axios": "
|
|
3882
|
-
"@orval/core": "
|
|
3883
|
-
"@orval/fetch": "
|
|
3884
|
-
"@orval/hono": "
|
|
3885
|
-
"@orval/mock": "
|
|
3886
|
-
"@orval/query": "
|
|
3887
|
-
"@orval/swr": "
|
|
3888
|
-
"@orval/zod": "
|
|
3881
|
+
"@orval/angular": "7.0.0",
|
|
3882
|
+
"@orval/axios": "7.0.0",
|
|
3883
|
+
"@orval/core": "7.0.0",
|
|
3884
|
+
"@orval/fetch": "7.0.0",
|
|
3885
|
+
"@orval/hono": "7.0.0",
|
|
3886
|
+
"@orval/mock": "7.0.0",
|
|
3887
|
+
"@orval/query": "7.0.0",
|
|
3888
|
+
"@orval/swr": "7.0.0",
|
|
3889
|
+
"@orval/zod": "7.0.0",
|
|
3889
3890
|
ajv: "^8.12.0",
|
|
3890
3891
|
cac: "^6.7.14",
|
|
3891
3892
|
chalk: "^4.1.2",
|
|
@@ -4113,7 +4114,7 @@ function defineConfig(options) {
|
|
|
4113
4114
|
return options;
|
|
4114
4115
|
}
|
|
4115
4116
|
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;
|
|
4117
|
+
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;
|
|
4117
4118
|
const options = await ((0, import_core7.isFunction)(optionsExport) ? optionsExport() : optionsExport);
|
|
4118
4119
|
if (!options.input) {
|
|
4119
4120
|
(0, import_core7.createLogger)().error(import_chalk2.default.red(`Config require an input`));
|
|
@@ -4129,7 +4130,7 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4129
4130
|
outputOptions.workspace || "",
|
|
4130
4131
|
workspace
|
|
4131
4132
|
);
|
|
4132
|
-
const { clean, prettier, client, mode, tslint, biome } = globalOptions;
|
|
4133
|
+
const { clean, prettier, client, httpClient, mode, tslint, biome } = globalOptions;
|
|
4133
4134
|
const tsconfig = await loadTsconfig(
|
|
4134
4135
|
outputOptions.tsconfig || globalOptions.tsconfig,
|
|
4135
4136
|
workspace
|
|
@@ -4183,34 +4184,35 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4183
4184
|
fileExtension: outputOptions.fileExtension || defaultFileExtension,
|
|
4184
4185
|
workspace: outputOptions.workspace ? outputWorkspace : void 0,
|
|
4185
4186
|
client: (_g = (_f = outputOptions.client) != null ? _f : client) != null ? _g : import_core7.OutputClient.AXIOS_FUNCTIONS,
|
|
4186
|
-
|
|
4187
|
+
httpClient: (_i = (_h = outputOptions.httpClient) != null ? _h : httpClient) != null ? _i : import_core7.OutputHttpClient.AXIOS,
|
|
4188
|
+
mode: normalizeOutputMode((_j = outputOptions.mode) != null ? _j : mode),
|
|
4187
4189
|
mock: mock2,
|
|
4188
|
-
clean: (
|
|
4189
|
-
prettier: (
|
|
4190
|
-
tslint: (
|
|
4191
|
-
biome: (
|
|
4190
|
+
clean: (_l = (_k = outputOptions.clean) != null ? _k : clean) != null ? _l : false,
|
|
4191
|
+
prettier: (_n = (_m = outputOptions.prettier) != null ? _m : prettier) != null ? _n : false,
|
|
4192
|
+
tslint: (_p = (_o = outputOptions.tslint) != null ? _o : tslint) != null ? _p : false,
|
|
4193
|
+
biome: (_r = (_q = outputOptions.biome) != null ? _q : biome) != null ? _r : false,
|
|
4192
4194
|
tsconfig,
|
|
4193
4195
|
packageJson,
|
|
4194
|
-
headers: (
|
|
4195
|
-
indexFiles: (
|
|
4196
|
+
headers: (_s = outputOptions.headers) != null ? _s : false,
|
|
4197
|
+
indexFiles: (_t = outputOptions.indexFiles) != null ? _t : true,
|
|
4196
4198
|
baseUrl: outputOptions.baseUrl,
|
|
4197
|
-
unionAddMissingProperties: (
|
|
4199
|
+
unionAddMissingProperties: (_u = outputOptions.unionAddMissingProperties) != null ? _u : false,
|
|
4198
4200
|
override: {
|
|
4199
4201
|
...outputOptions.override,
|
|
4200
4202
|
mock: {
|
|
4201
|
-
arrayMin: (
|
|
4202
|
-
arrayMax: (
|
|
4203
|
-
...(
|
|
4203
|
+
arrayMin: (_x = (_w = (_v = outputOptions.override) == null ? void 0 : _v.mock) == null ? void 0 : _w.arrayMin) != null ? _x : 1,
|
|
4204
|
+
arrayMax: (_A = (_z = (_y = outputOptions.override) == null ? void 0 : _y.mock) == null ? void 0 : _z.arrayMax) != null ? _A : 10,
|
|
4205
|
+
...(_C = (_B = outputOptions.override) == null ? void 0 : _B.mock) != null ? _C : {}
|
|
4204
4206
|
},
|
|
4205
4207
|
operations: normalizeOperationsAndTags(
|
|
4206
|
-
(
|
|
4208
|
+
(_E = (_D = outputOptions.override) == null ? void 0 : _D.operations) != null ? _E : {},
|
|
4207
4209
|
outputWorkspace,
|
|
4208
4210
|
{
|
|
4209
4211
|
query: globalQueryOptions
|
|
4210
4212
|
}
|
|
4211
4213
|
),
|
|
4212
4214
|
tags: normalizeOperationsAndTags(
|
|
4213
|
-
(
|
|
4215
|
+
(_G = (_F = outputOptions.override) == null ? void 0 : _F.tags) != null ? _G : {},
|
|
4214
4216
|
outputWorkspace,
|
|
4215
4217
|
{
|
|
4216
4218
|
query: globalQueryOptions
|
|
@@ -4218,105 +4220,113 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4218
4220
|
),
|
|
4219
4221
|
mutator: normalizeMutator(
|
|
4220
4222
|
outputWorkspace,
|
|
4221
|
-
(
|
|
4223
|
+
(_H = outputOptions.override) == null ? void 0 : _H.mutator
|
|
4222
4224
|
),
|
|
4223
|
-
formData: (
|
|
4225
|
+
formData: (_L = !(0, import_core7.isBoolean)((_I = outputOptions.override) == null ? void 0 : _I.formData) ? normalizeMutator(
|
|
4224
4226
|
outputWorkspace,
|
|
4225
|
-
(
|
|
4226
|
-
) : (
|
|
4227
|
-
formUrlEncoded: (
|
|
4227
|
+
(_J = outputOptions.override) == null ? void 0 : _J.formData
|
|
4228
|
+
) : (_K = outputOptions.override) == null ? void 0 : _K.formData) != null ? _L : true,
|
|
4229
|
+
formUrlEncoded: (_P = !(0, import_core7.isBoolean)((_M = outputOptions.override) == null ? void 0 : _M.formUrlEncoded) ? normalizeMutator(
|
|
4228
4230
|
outputWorkspace,
|
|
4229
|
-
(
|
|
4230
|
-
) : (
|
|
4231
|
+
(_N = outputOptions.override) == null ? void 0 : _N.formUrlEncoded
|
|
4232
|
+
) : (_O = outputOptions.override) == null ? void 0 : _O.formUrlEncoded) != null ? _P : true,
|
|
4231
4233
|
paramsSerializer: normalizeMutator(
|
|
4232
4234
|
outputWorkspace,
|
|
4233
|
-
(
|
|
4235
|
+
(_Q = outputOptions.override) == null ? void 0 : _Q.paramsSerializer
|
|
4234
4236
|
),
|
|
4235
|
-
header: ((
|
|
4236
|
-
requestOptions: (
|
|
4237
|
+
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,
|
|
4238
|
+
requestOptions: (_V = (_U = outputOptions.override) == null ? void 0 : _U.requestOptions) != null ? _V : true,
|
|
4237
4239
|
components: {
|
|
4238
4240
|
schemas: {
|
|
4239
4241
|
suffix: import_core7.RefComponentSuffix.schemas,
|
|
4240
|
-
itemSuffix: (
|
|
4241
|
-
...(
|
|
4242
|
+
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",
|
|
4243
|
+
...(_aa = (_$ = (__ = outputOptions.override) == null ? void 0 : __.components) == null ? void 0 : _$.schemas) != null ? _aa : {}
|
|
4242
4244
|
},
|
|
4243
4245
|
responses: {
|
|
4244
4246
|
suffix: import_core7.RefComponentSuffix.responses,
|
|
4245
|
-
...(
|
|
4247
|
+
...(_da = (_ca = (_ba = outputOptions.override) == null ? void 0 : _ba.components) == null ? void 0 : _ca.responses) != null ? _da : {}
|
|
4246
4248
|
},
|
|
4247
4249
|
parameters: {
|
|
4248
4250
|
suffix: import_core7.RefComponentSuffix.parameters,
|
|
4249
|
-
...(
|
|
4251
|
+
...(_ga = (_fa = (_ea = outputOptions.override) == null ? void 0 : _ea.components) == null ? void 0 : _fa.parameters) != null ? _ga : {}
|
|
4250
4252
|
},
|
|
4251
4253
|
requestBodies: {
|
|
4252
4254
|
suffix: import_core7.RefComponentSuffix.requestBodies,
|
|
4253
|
-
...(
|
|
4255
|
+
...(_ja = (_ia = (_ha = outputOptions.override) == null ? void 0 : _ha.components) == null ? void 0 : _ia.requestBodies) != null ? _ja : {}
|
|
4254
4256
|
}
|
|
4255
4257
|
},
|
|
4256
|
-
hono: normalizeHonoOptions((
|
|
4258
|
+
hono: normalizeHonoOptions((_ka = outputOptions.override) == null ? void 0 : _ka.hono, workspace),
|
|
4257
4259
|
query: globalQueryOptions,
|
|
4258
4260
|
zod: {
|
|
4259
4261
|
strict: {
|
|
4260
|
-
param: (
|
|
4261
|
-
query: (
|
|
4262
|
-
header: (
|
|
4263
|
-
body: (
|
|
4264
|
-
response: (
|
|
4262
|
+
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,
|
|
4263
|
+
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,
|
|
4264
|
+
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,
|
|
4265
|
+
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,
|
|
4266
|
+
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
|
|
4267
|
+
},
|
|
4268
|
+
generate: {
|
|
4269
|
+
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,
|
|
4270
|
+
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,
|
|
4271
|
+
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,
|
|
4272
|
+
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,
|
|
4273
|
+
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
|
|
4265
4274
|
},
|
|
4266
4275
|
coerce: {
|
|
4267
|
-
param: (
|
|
4268
|
-
query: (
|
|
4269
|
-
header: (
|
|
4270
|
-
body: (
|
|
4271
|
-
response: (
|
|
4276
|
+
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,
|
|
4277
|
+
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,
|
|
4278
|
+
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,
|
|
4279
|
+
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,
|
|
4280
|
+
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
|
|
4272
4281
|
},
|
|
4273
4282
|
preprocess: {
|
|
4274
|
-
...((
|
|
4283
|
+
...((_tb = (_sb = (_rb = outputOptions.override) == null ? void 0 : _rb.zod) == null ? void 0 : _sb.preprocess) == null ? void 0 : _tb.param) ? {
|
|
4275
4284
|
param: normalizeMutator(
|
|
4276
4285
|
workspace,
|
|
4277
4286
|
outputOptions.override.zod.preprocess.param
|
|
4278
4287
|
)
|
|
4279
4288
|
} : {},
|
|
4280
|
-
...((
|
|
4289
|
+
...((_wb = (_vb = (_ub = outputOptions.override) == null ? void 0 : _ub.zod) == null ? void 0 : _vb.preprocess) == null ? void 0 : _wb.query) ? {
|
|
4281
4290
|
query: normalizeMutator(
|
|
4282
4291
|
workspace,
|
|
4283
4292
|
outputOptions.override.zod.preprocess.query
|
|
4284
4293
|
)
|
|
4285
4294
|
} : {},
|
|
4286
|
-
...((
|
|
4295
|
+
...((_zb = (_yb = (_xb = outputOptions.override) == null ? void 0 : _xb.zod) == null ? void 0 : _yb.preprocess) == null ? void 0 : _zb.header) ? {
|
|
4287
4296
|
header: normalizeMutator(
|
|
4288
4297
|
workspace,
|
|
4289
4298
|
outputOptions.override.zod.preprocess.header
|
|
4290
4299
|
)
|
|
4291
4300
|
} : {},
|
|
4292
|
-
...((
|
|
4301
|
+
...((_Cb = (_Bb = (_Ab = outputOptions.override) == null ? void 0 : _Ab.zod) == null ? void 0 : _Bb.preprocess) == null ? void 0 : _Cb.body) ? {
|
|
4293
4302
|
body: normalizeMutator(
|
|
4294
4303
|
workspace,
|
|
4295
4304
|
outputOptions.override.zod.preprocess.body
|
|
4296
4305
|
)
|
|
4297
4306
|
} : {},
|
|
4298
|
-
...((
|
|
4307
|
+
...((_Fb = (_Eb = (_Db = outputOptions.override) == null ? void 0 : _Db.zod) == null ? void 0 : _Eb.preprocess) == null ? void 0 : _Fb.response) ? {
|
|
4299
4308
|
response: normalizeMutator(
|
|
4300
4309
|
workspace,
|
|
4301
4310
|
outputOptions.override.zod.preprocess.response
|
|
4302
4311
|
)
|
|
4303
4312
|
} : {}
|
|
4304
|
-
}
|
|
4313
|
+
},
|
|
4314
|
+
generateEachHttpStatus: (_Ib = (_Hb = (_Gb = outputOptions.override) == null ? void 0 : _Gb.zod) == null ? void 0 : _Hb.generateEachHttpStatus) != null ? _Ib : false
|
|
4305
4315
|
},
|
|
4306
4316
|
swr: {
|
|
4307
|
-
...(
|
|
4317
|
+
...(_Kb = (_Jb = outputOptions.override) == null ? void 0 : _Jb.swr) != null ? _Kb : {}
|
|
4308
4318
|
},
|
|
4309
4319
|
angular: {
|
|
4310
|
-
provideIn: (
|
|
4320
|
+
provideIn: (_Nb = (_Mb = (_Lb = outputOptions.override) == null ? void 0 : _Lb.angular) == null ? void 0 : _Mb.provideIn) != null ? _Nb : "root"
|
|
4311
4321
|
},
|
|
4312
|
-
useDates: ((
|
|
4313
|
-
useDeprecatedOperations: (
|
|
4314
|
-
useNativeEnums: (
|
|
4315
|
-
suppressReadonlyModifier: ((
|
|
4322
|
+
useDates: ((_Ob = outputOptions.override) == null ? void 0 : _Ob.useDates) || false,
|
|
4323
|
+
useDeprecatedOperations: (_Qb = (_Pb = outputOptions.override) == null ? void 0 : _Pb.useDeprecatedOperations) != null ? _Qb : true,
|
|
4324
|
+
useNativeEnums: (_Sb = (_Rb = outputOptions.override) == null ? void 0 : _Rb.useNativeEnums) != null ? _Sb : false,
|
|
4325
|
+
suppressReadonlyModifier: ((_Tb = outputOptions.override) == null ? void 0 : _Tb.suppressReadonlyModifier) || false
|
|
4316
4326
|
},
|
|
4317
|
-
allParamsOptional: (
|
|
4318
|
-
urlEncodeParameters: (
|
|
4319
|
-
optionsParamRequired: (
|
|
4327
|
+
allParamsOptional: (_Ub = outputOptions.allParamsOptional) != null ? _Ub : false,
|
|
4328
|
+
urlEncodeParameters: (_Vb = outputOptions.urlEncodeParameters) != null ? _Vb : false,
|
|
4329
|
+
optionsParamRequired: (_Wb = outputOptions.optionsParamRequired) != null ? _Wb : false
|
|
4320
4330
|
},
|
|
4321
4331
|
hooks: options.hooks ? normalizeHooks(options.hooks) : {}
|
|
4322
4332
|
};
|
|
@@ -4385,7 +4395,7 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
|
|
|
4385
4395
|
...rest
|
|
4386
4396
|
}
|
|
4387
4397
|
]) => {
|
|
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;
|
|
4398
|
+
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;
|
|
4389
4399
|
return [
|
|
4390
4400
|
key,
|
|
4391
4401
|
{
|
|
@@ -4402,45 +4412,53 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
|
|
|
4402
4412
|
body: (_h = (_g = zod2.strict) == null ? void 0 : _g.body) != null ? _h : false,
|
|
4403
4413
|
response: (_j = (_i = zod2.strict) == null ? void 0 : _i.response) != null ? _j : false
|
|
4404
4414
|
},
|
|
4415
|
+
generate: {
|
|
4416
|
+
param: (_l = (_k = zod2.generate) == null ? void 0 : _k.param) != null ? _l : true,
|
|
4417
|
+
query: (_n = (_m = zod2.generate) == null ? void 0 : _m.query) != null ? _n : true,
|
|
4418
|
+
header: (_p = (_o = zod2.generate) == null ? void 0 : _o.header) != null ? _p : true,
|
|
4419
|
+
body: (_r = (_q = zod2.generate) == null ? void 0 : _q.body) != null ? _r : true,
|
|
4420
|
+
response: (_t = (_s = zod2.generate) == null ? void 0 : _s.response) != null ? _t : true
|
|
4421
|
+
},
|
|
4405
4422
|
coerce: {
|
|
4406
|
-
param: (
|
|
4407
|
-
query: (
|
|
4408
|
-
header: (
|
|
4409
|
-
body: (
|
|
4410
|
-
response: (
|
|
4423
|
+
param: (_v = (_u = zod2.coerce) == null ? void 0 : _u.param) != null ? _v : false,
|
|
4424
|
+
query: (_x = (_w = zod2.coerce) == null ? void 0 : _w.query) != null ? _x : false,
|
|
4425
|
+
header: (_z = (_y = zod2.coerce) == null ? void 0 : _y.header) != null ? _z : false,
|
|
4426
|
+
body: (_B = (_A = zod2.coerce) == null ? void 0 : _A.body) != null ? _B : false,
|
|
4427
|
+
response: (_D = (_C = zod2.coerce) == null ? void 0 : _C.response) != null ? _D : false
|
|
4411
4428
|
},
|
|
4412
4429
|
preprocess: {
|
|
4413
|
-
...((
|
|
4430
|
+
...((_E = zod2.preprocess) == null ? void 0 : _E.param) ? {
|
|
4414
4431
|
param: normalizeMutator(
|
|
4415
4432
|
workspace,
|
|
4416
4433
|
zod2.preprocess.param
|
|
4417
4434
|
)
|
|
4418
4435
|
} : {},
|
|
4419
|
-
...((
|
|
4436
|
+
...((_F = zod2.preprocess) == null ? void 0 : _F.query) ? {
|
|
4420
4437
|
query: normalizeMutator(
|
|
4421
4438
|
workspace,
|
|
4422
4439
|
zod2.preprocess.query
|
|
4423
4440
|
)
|
|
4424
4441
|
} : {},
|
|
4425
|
-
...((
|
|
4442
|
+
...((_G = zod2.preprocess) == null ? void 0 : _G.header) ? {
|
|
4426
4443
|
header: normalizeMutator(
|
|
4427
4444
|
workspace,
|
|
4428
4445
|
zod2.preprocess.header
|
|
4429
4446
|
)
|
|
4430
4447
|
} : {},
|
|
4431
|
-
...((
|
|
4448
|
+
...((_H = zod2.preprocess) == null ? void 0 : _H.body) ? {
|
|
4432
4449
|
body: normalizeMutator(
|
|
4433
4450
|
workspace,
|
|
4434
4451
|
zod2.preprocess.body
|
|
4435
4452
|
)
|
|
4436
4453
|
} : {},
|
|
4437
|
-
...((
|
|
4454
|
+
...((_I = zod2.preprocess) == null ? void 0 : _I.response) ? {
|
|
4438
4455
|
response: normalizeMutator(
|
|
4439
4456
|
workspace,
|
|
4440
4457
|
zod2.preprocess.response
|
|
4441
4458
|
)
|
|
4442
4459
|
} : {}
|
|
4443
|
-
}
|
|
4460
|
+
},
|
|
4461
|
+
generateEachHttpStatus: (_J = zod2 == null ? void 0 : zod2.generateEachHttpStatus) != null ? _J : false
|
|
4444
4462
|
}
|
|
4445
4463
|
} : {},
|
|
4446
4464
|
...transformer ? { transformer: normalizePath(transformer, workspace) } : {},
|
|
@@ -4659,6 +4677,7 @@ var getHeader = (option, info) => {
|
|
|
4659
4677
|
return Array.isArray(header) ? (0, import_core10.jsDoc)({ description: header }) : header;
|
|
4660
4678
|
};
|
|
4661
4679
|
var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
4680
|
+
var _a;
|
|
4662
4681
|
const { info = { title: "", version: 0 }, schemas, target } = builder;
|
|
4663
4682
|
const { output } = options;
|
|
4664
4683
|
const projectTitle = projectName || info.title;
|
|
@@ -4674,6 +4693,7 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
|
4674
4693
|
const header = getHeader(output.override.header, info);
|
|
4675
4694
|
if (output.schemas) {
|
|
4676
4695
|
const rootSchemaPath = output.schemas;
|
|
4696
|
+
const fileExtension = ["tags", "tags-split", "split"].includes(output.mode) ? ".ts" : (_a = output.fileExtension) != null ? _a : ".ts";
|
|
4677
4697
|
await Promise.all(
|
|
4678
4698
|
Object.entries(schemas).map(([specKey, schemas2]) => {
|
|
4679
4699
|
const schemaPath = !(0, import_core10.isRootKey)(specKey, target) ? import_core10.upath.join(rootSchemaPath, specsName[specKey]) : rootSchemaPath;
|
|
@@ -4681,6 +4701,7 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
|
4681
4701
|
schemaPath,
|
|
4682
4702
|
schemas: schemas2,
|
|
4683
4703
|
target,
|
|
4704
|
+
fileExtension,
|
|
4684
4705
|
specsName,
|
|
4685
4706
|
specKey,
|
|
4686
4707
|
isRootKey: (0, import_core10.isRootKey)(specKey, target),
|