orval 6.30.1 → 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 +100 -92
- package/dist/bin/orval.js.map +1 -1
- package/dist/index.js +100 -92
- 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, _yb, _zb, _Ab
|
|
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`));
|
|
@@ -4138,13 +4138,13 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4138
4138
|
}
|
|
4139
4139
|
const defaultFileExtension = ".ts";
|
|
4140
4140
|
const globalQueryOptions = {
|
|
4141
|
-
useQuery:
|
|
4142
|
-
useMutation:
|
|
4143
|
-
signal:
|
|
4144
|
-
shouldExportMutatorHooks:
|
|
4145
|
-
shouldExportHttpClient:
|
|
4146
|
-
shouldExportQueryKey:
|
|
4147
|
-
...normalizeQueryOptions((
|
|
4141
|
+
useQuery: true,
|
|
4142
|
+
useMutation: true,
|
|
4143
|
+
signal: true,
|
|
4144
|
+
shouldExportMutatorHooks: true,
|
|
4145
|
+
shouldExportHttpClient: true,
|
|
4146
|
+
shouldExportQueryKey: true,
|
|
4147
|
+
...normalizeQueryOptions((_b = outputOptions.override) == null ? void 0 : _b.query, workspace)
|
|
4148
4148
|
};
|
|
4149
4149
|
const normalizedOptions = {
|
|
4150
4150
|
input: {
|
|
@@ -4152,14 +4152,14 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4152
4152
|
validation: inputOptions.validation || false,
|
|
4153
4153
|
override: {
|
|
4154
4154
|
transformer: normalizePath(
|
|
4155
|
-
(
|
|
4155
|
+
(_c = inputOptions.override) == null ? void 0 : _c.transformer,
|
|
4156
4156
|
workspace
|
|
4157
4157
|
)
|
|
4158
4158
|
},
|
|
4159
|
-
converterOptions: (
|
|
4159
|
+
converterOptions: (_d = inputOptions.converterOptions) != null ? _d : {},
|
|
4160
4160
|
parserOptions: (0, import_core7.mergeDeep)(
|
|
4161
4161
|
parserDefaultOptions,
|
|
4162
|
-
(
|
|
4162
|
+
(_e = inputOptions.parserOptions) != null ? _e : {}
|
|
4163
4163
|
),
|
|
4164
4164
|
filters: inputOptions.filters
|
|
4165
4165
|
},
|
|
@@ -4168,35 +4168,35 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4168
4168
|
schemas: normalizePath(outputOptions.schemas, outputWorkspace),
|
|
4169
4169
|
fileExtension: outputOptions.fileExtension || defaultFileExtension,
|
|
4170
4170
|
workspace: outputOptions.workspace ? outputWorkspace : void 0,
|
|
4171
|
-
client: (
|
|
4172
|
-
mode: normalizeOutputMode((
|
|
4171
|
+
client: (_g = (_f = outputOptions.client) != null ? _f : client) != null ? _g : import_core7.OutputClient.AXIOS_FUNCTIONS,
|
|
4172
|
+
mode: normalizeOutputMode((_h = outputOptions.mode) != null ? _h : mode),
|
|
4173
4173
|
mock: mock2,
|
|
4174
|
-
clean: (
|
|
4175
|
-
prettier: (
|
|
4176
|
-
tslint: (
|
|
4177
|
-
biome: (
|
|
4174
|
+
clean: (_j = (_i = outputOptions.clean) != null ? _i : clean) != null ? _j : false,
|
|
4175
|
+
prettier: (_l = (_k = outputOptions.prettier) != null ? _k : prettier) != null ? _l : false,
|
|
4176
|
+
tslint: (_n = (_m = outputOptions.tslint) != null ? _m : tslint) != null ? _n : false,
|
|
4177
|
+
biome: (_p = (_o = outputOptions.biome) != null ? _o : biome) != null ? _p : false,
|
|
4178
4178
|
tsconfig,
|
|
4179
4179
|
packageJson,
|
|
4180
|
-
headers: (
|
|
4181
|
-
indexFiles: (
|
|
4180
|
+
headers: (_q = outputOptions.headers) != null ? _q : false,
|
|
4181
|
+
indexFiles: (_r = outputOptions.indexFiles) != null ? _r : true,
|
|
4182
4182
|
baseUrl: outputOptions.baseUrl,
|
|
4183
|
-
unionAddMissingProperties: (
|
|
4183
|
+
unionAddMissingProperties: (_s = outputOptions.unionAddMissingProperties) != null ? _s : false,
|
|
4184
4184
|
override: {
|
|
4185
4185
|
...outputOptions.override,
|
|
4186
4186
|
mock: {
|
|
4187
|
-
arrayMin: (
|
|
4188
|
-
arrayMax: (
|
|
4189
|
-
...(
|
|
4187
|
+
arrayMin: (_v = (_u = (_t = outputOptions.override) == null ? void 0 : _t.mock) == null ? void 0 : _u.arrayMin) != null ? _v : 1,
|
|
4188
|
+
arrayMax: (_y = (_x = (_w = outputOptions.override) == null ? void 0 : _w.mock) == null ? void 0 : _x.arrayMax) != null ? _y : 10,
|
|
4189
|
+
...(_A = (_z = outputOptions.override) == null ? void 0 : _z.mock) != null ? _A : {}
|
|
4190
4190
|
},
|
|
4191
4191
|
operations: normalizeOperationsAndTags(
|
|
4192
|
-
(
|
|
4192
|
+
(_C = (_B = outputOptions.override) == null ? void 0 : _B.operations) != null ? _C : {},
|
|
4193
4193
|
outputWorkspace,
|
|
4194
4194
|
{
|
|
4195
4195
|
query: globalQueryOptions
|
|
4196
4196
|
}
|
|
4197
4197
|
),
|
|
4198
4198
|
tags: normalizeOperationsAndTags(
|
|
4199
|
-
(
|
|
4199
|
+
(_E = (_D = outputOptions.override) == null ? void 0 : _D.tags) != null ? _E : {},
|
|
4200
4200
|
outputWorkspace,
|
|
4201
4201
|
{
|
|
4202
4202
|
query: globalQueryOptions
|
|
@@ -4204,113 +4204,106 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4204
4204
|
),
|
|
4205
4205
|
mutator: normalizeMutator(
|
|
4206
4206
|
outputWorkspace,
|
|
4207
|
-
(
|
|
4207
|
+
(_F = outputOptions.override) == null ? void 0 : _F.mutator
|
|
4208
4208
|
),
|
|
4209
|
-
formData: (
|
|
4209
|
+
formData: (_J = !(0, import_core7.isBoolean)((_G = outputOptions.override) == null ? void 0 : _G.formData) ? normalizeMutator(
|
|
4210
4210
|
outputWorkspace,
|
|
4211
|
-
(
|
|
4212
|
-
) : (
|
|
4213
|
-
formUrlEncoded: (
|
|
4211
|
+
(_H = outputOptions.override) == null ? void 0 : _H.formData
|
|
4212
|
+
) : (_I = outputOptions.override) == null ? void 0 : _I.formData) != null ? _J : true,
|
|
4213
|
+
formUrlEncoded: (_N = !(0, import_core7.isBoolean)((_K = outputOptions.override) == null ? void 0 : _K.formUrlEncoded) ? normalizeMutator(
|
|
4214
4214
|
outputWorkspace,
|
|
4215
|
-
(
|
|
4216
|
-
) : (
|
|
4215
|
+
(_L = outputOptions.override) == null ? void 0 : _L.formUrlEncoded
|
|
4216
|
+
) : (_M = outputOptions.override) == null ? void 0 : _M.formUrlEncoded) != null ? _N : true,
|
|
4217
4217
|
paramsSerializer: normalizeMutator(
|
|
4218
4218
|
outputWorkspace,
|
|
4219
|
-
(
|
|
4219
|
+
(_O = outputOptions.override) == null ? void 0 : _O.paramsSerializer
|
|
4220
4220
|
),
|
|
4221
|
-
header: ((
|
|
4222
|
-
requestOptions: (
|
|
4221
|
+
header: ((_P = outputOptions.override) == null ? void 0 : _P.header) === false ? false : (0, import_core7.isFunction)((_Q = outputOptions.override) == null ? void 0 : _Q.header) ? (_R = outputOptions.override) == null ? void 0 : _R.header : getDefaultFilesHeader,
|
|
4222
|
+
requestOptions: (_T = (_S = outputOptions.override) == null ? void 0 : _S.requestOptions) != null ? _T : true,
|
|
4223
4223
|
components: {
|
|
4224
4224
|
schemas: {
|
|
4225
4225
|
suffix: import_core7.RefComponentSuffix.schemas,
|
|
4226
|
-
itemSuffix: (
|
|
4227
|
-
...(
|
|
4226
|
+
itemSuffix: (_X = (_W = (_V = (_U = outputOptions.override) == null ? void 0 : _U.components) == null ? void 0 : _V.schemas) == null ? void 0 : _W.itemSuffix) != null ? _X : "Item",
|
|
4227
|
+
...(__ = (_Z = (_Y = outputOptions.override) == null ? void 0 : _Y.components) == null ? void 0 : _Z.schemas) != null ? __ : {}
|
|
4228
4228
|
},
|
|
4229
4229
|
responses: {
|
|
4230
4230
|
suffix: import_core7.RefComponentSuffix.responses,
|
|
4231
|
-
...(
|
|
4231
|
+
...(_ba = (_aa = (_$ = outputOptions.override) == null ? void 0 : _$.components) == null ? void 0 : _aa.responses) != null ? _ba : {}
|
|
4232
4232
|
},
|
|
4233
4233
|
parameters: {
|
|
4234
4234
|
suffix: import_core7.RefComponentSuffix.parameters,
|
|
4235
|
-
...(
|
|
4235
|
+
...(_ea = (_da = (_ca = outputOptions.override) == null ? void 0 : _ca.components) == null ? void 0 : _da.parameters) != null ? _ea : {}
|
|
4236
4236
|
},
|
|
4237
4237
|
requestBodies: {
|
|
4238
4238
|
suffix: import_core7.RefComponentSuffix.requestBodies,
|
|
4239
|
-
...(
|
|
4239
|
+
...(_ha = (_ga = (_fa = outputOptions.override) == null ? void 0 : _fa.components) == null ? void 0 : _ga.requestBodies) != null ? _ha : {}
|
|
4240
4240
|
}
|
|
4241
4241
|
},
|
|
4242
|
-
hono: normalizeHonoOptions((
|
|
4243
|
-
query:
|
|
4244
|
-
useQuery: (_Da = (_Ca = (_Ba = outputOptions.override) == null ? void 0 : _Ba.query) == null ? void 0 : _Ca.useQuery) != null ? _Da : true,
|
|
4245
|
-
useMutation: (_Ga = (_Fa = (_Ea = outputOptions.override) == null ? void 0 : _Ea.query) == null ? void 0 : _Fa.useMutation) != null ? _Ga : true,
|
|
4246
|
-
signal: (_Ja = (_Ia = (_Ha = outputOptions.override) == null ? void 0 : _Ha.query) == null ? void 0 : _Ia.signal) != null ? _Ja : true,
|
|
4247
|
-
shouldExportMutatorHooks: (_Ma = (_La = (_Ka = outputOptions.override) == null ? void 0 : _Ka.query) == null ? void 0 : _La.shouldExportMutatorHooks) != null ? _Ma : true,
|
|
4248
|
-
shouldExportHttpClient: (_Pa = (_Oa = (_Na = outputOptions.override) == null ? void 0 : _Na.query) == null ? void 0 : _Oa.shouldExportHttpClient) != null ? _Pa : true,
|
|
4249
|
-
shouldExportQueryKey: (_Sa = (_Ra = (_Qa = outputOptions.override) == null ? void 0 : _Qa.query) == null ? void 0 : _Ra.shouldExportQueryKey) != null ? _Sa : true,
|
|
4250
|
-
...normalizeQueryOptions((_Ta = outputOptions.override) == null ? void 0 : _Ta.query, workspace)
|
|
4251
|
-
},
|
|
4242
|
+
hono: normalizeHonoOptions((_ia = outputOptions.override) == null ? void 0 : _ia.hono, workspace),
|
|
4243
|
+
query: globalQueryOptions,
|
|
4252
4244
|
zod: {
|
|
4253
4245
|
strict: {
|
|
4254
|
-
param: (
|
|
4255
|
-
query: (
|
|
4256
|
-
header: (
|
|
4257
|
-
body: (
|
|
4258
|
-
response: (
|
|
4246
|
+
param: (_ma = (_la = (_ka = (_ja = outputOptions.override) == null ? void 0 : _ja.zod) == null ? void 0 : _ka.strict) == null ? void 0 : _la.param) != null ? _ma : false,
|
|
4247
|
+
query: (_qa = (_pa = (_oa = (_na = outputOptions.override) == null ? void 0 : _na.zod) == null ? void 0 : _oa.strict) == null ? void 0 : _pa.query) != null ? _qa : false,
|
|
4248
|
+
header: (_ua = (_ta = (_sa = (_ra = outputOptions.override) == null ? void 0 : _ra.zod) == null ? void 0 : _sa.strict) == null ? void 0 : _ta.header) != null ? _ua : false,
|
|
4249
|
+
body: (_ya = (_xa = (_wa = (_va = outputOptions.override) == null ? void 0 : _va.zod) == null ? void 0 : _wa.strict) == null ? void 0 : _xa.body) != null ? _ya : false,
|
|
4250
|
+
response: (_Ca = (_Ba = (_Aa = (_za = outputOptions.override) == null ? void 0 : _za.zod) == null ? void 0 : _Aa.strict) == null ? void 0 : _Ba.response) != null ? _Ca : false
|
|
4259
4251
|
},
|
|
4260
4252
|
coerce: {
|
|
4261
|
-
param: (
|
|
4262
|
-
query: (
|
|
4263
|
-
header: (
|
|
4264
|
-
body: (
|
|
4265
|
-
response: (
|
|
4253
|
+
param: (_Ga = (_Fa = (_Ea = (_Da = outputOptions.override) == null ? void 0 : _Da.zod) == null ? void 0 : _Ea.coerce) == null ? void 0 : _Fa.param) != null ? _Ga : false,
|
|
4254
|
+
query: (_Ka = (_Ja = (_Ia = (_Ha = outputOptions.override) == null ? void 0 : _Ha.zod) == null ? void 0 : _Ia.coerce) == null ? void 0 : _Ja.query) != null ? _Ka : false,
|
|
4255
|
+
header: (_Oa = (_Na = (_Ma = (_La = outputOptions.override) == null ? void 0 : _La.zod) == null ? void 0 : _Ma.coerce) == null ? void 0 : _Na.header) != null ? _Oa : false,
|
|
4256
|
+
body: (_Sa = (_Ra = (_Qa = (_Pa = outputOptions.override) == null ? void 0 : _Pa.zod) == null ? void 0 : _Qa.coerce) == null ? void 0 : _Ra.body) != null ? _Sa : false,
|
|
4257
|
+
response: (_Wa = (_Va = (_Ua = (_Ta = outputOptions.override) == null ? void 0 : _Ta.zod) == null ? void 0 : _Ua.coerce) == null ? void 0 : _Va.response) != null ? _Wa : false
|
|
4266
4258
|
},
|
|
4267
4259
|
preprocess: {
|
|
4268
|
-
...((
|
|
4260
|
+
...((_Za = (_Ya = (_Xa = outputOptions.override) == null ? void 0 : _Xa.zod) == null ? void 0 : _Ya.preprocess) == null ? void 0 : _Za.param) ? {
|
|
4269
4261
|
param: normalizeMutator(
|
|
4270
4262
|
workspace,
|
|
4271
4263
|
outputOptions.override.zod.preprocess.param
|
|
4272
4264
|
)
|
|
4273
4265
|
} : {},
|
|
4274
|
-
...((
|
|
4266
|
+
...((_ab = (_$a = (__a = outputOptions.override) == null ? void 0 : __a.zod) == null ? void 0 : _$a.preprocess) == null ? void 0 : _ab.query) ? {
|
|
4275
4267
|
query: normalizeMutator(
|
|
4276
4268
|
workspace,
|
|
4277
4269
|
outputOptions.override.zod.preprocess.query
|
|
4278
4270
|
)
|
|
4279
4271
|
} : {},
|
|
4280
|
-
...((
|
|
4272
|
+
...((_db = (_cb = (_bb = outputOptions.override) == null ? void 0 : _bb.zod) == null ? void 0 : _cb.preprocess) == null ? void 0 : _db.header) ? {
|
|
4281
4273
|
header: normalizeMutator(
|
|
4282
4274
|
workspace,
|
|
4283
4275
|
outputOptions.override.zod.preprocess.header
|
|
4284
4276
|
)
|
|
4285
4277
|
} : {},
|
|
4286
|
-
...((
|
|
4278
|
+
...((_gb = (_fb = (_eb = outputOptions.override) == null ? void 0 : _eb.zod) == null ? void 0 : _fb.preprocess) == null ? void 0 : _gb.body) ? {
|
|
4287
4279
|
body: normalizeMutator(
|
|
4288
4280
|
workspace,
|
|
4289
4281
|
outputOptions.override.zod.preprocess.body
|
|
4290
4282
|
)
|
|
4291
4283
|
} : {},
|
|
4292
|
-
...((
|
|
4284
|
+
...((_jb = (_ib = (_hb = outputOptions.override) == null ? void 0 : _hb.zod) == null ? void 0 : _ib.preprocess) == null ? void 0 : _jb.response) ? {
|
|
4293
4285
|
response: normalizeMutator(
|
|
4294
4286
|
workspace,
|
|
4295
4287
|
outputOptions.override.zod.preprocess.response
|
|
4296
4288
|
)
|
|
4297
4289
|
} : {}
|
|
4298
|
-
}
|
|
4290
|
+
},
|
|
4291
|
+
generateEachHttpStatus: (_mb = (_lb = (_kb = outputOptions.override) == null ? void 0 : _kb.zod) == null ? void 0 : _lb.generateEachHttpStatus) != null ? _mb : false
|
|
4299
4292
|
},
|
|
4300
4293
|
swr: {
|
|
4301
|
-
...(
|
|
4294
|
+
...(_ob = (_nb = outputOptions.override) == null ? void 0 : _nb.swr) != null ? _ob : {}
|
|
4302
4295
|
},
|
|
4303
4296
|
angular: {
|
|
4304
|
-
provideIn: (
|
|
4297
|
+
provideIn: (_rb = (_qb = (_pb = outputOptions.override) == null ? void 0 : _pb.angular) == null ? void 0 : _qb.provideIn) != null ? _rb : "root"
|
|
4305
4298
|
},
|
|
4306
|
-
useDates: ((
|
|
4307
|
-
useDeprecatedOperations: (
|
|
4308
|
-
useNativeEnums: (
|
|
4309
|
-
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
|
|
4310
4303
|
},
|
|
4311
|
-
allParamsOptional: (
|
|
4312
|
-
urlEncodeParameters: (
|
|
4313
|
-
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
|
|
4314
4307
|
},
|
|
4315
4308
|
hooks: options.hooks ? normalizeHooks(options.hooks) : {}
|
|
4316
4309
|
};
|
|
@@ -4379,7 +4372,7 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
|
|
|
4379
4372
|
...rest
|
|
4380
4373
|
}
|
|
4381
4374
|
]) => {
|
|
4382
|
-
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;
|
|
4383
4376
|
return [
|
|
4384
4377
|
key,
|
|
4385
4378
|
{
|
|
@@ -4434,7 +4427,8 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
|
|
|
4434
4427
|
zod2.preprocess.response
|
|
4435
4428
|
)
|
|
4436
4429
|
} : {}
|
|
4437
|
-
}
|
|
4430
|
+
},
|
|
4431
|
+
generateEachHttpStatus: (_z = zod2 == null ? void 0 : zod2.generateEachHttpStatus) != null ? _z : false
|
|
4438
4432
|
}
|
|
4439
4433
|
} : {},
|
|
4440
4434
|
...transformer ? { transformer: normalizePath(transformer, workspace) } : {},
|
|
@@ -4502,7 +4496,6 @@ var normalizeHonoOptions = (hono2 = {}, workspace) => {
|
|
|
4502
4496
|
};
|
|
4503
4497
|
};
|
|
4504
4498
|
var normalizeQueryOptions = (queryOptions = {}, outputWorkspace, globalOptions = {}) => {
|
|
4505
|
-
var _a, _b, _c, _d;
|
|
4506
4499
|
if (queryOptions.options) {
|
|
4507
4500
|
console.warn(
|
|
4508
4501
|
"[WARN] Using query options is deprecated and will be removed in a future major release. Please use queryOptions or mutationOptions instead."
|
|
@@ -4541,10 +4534,22 @@ var normalizeQueryOptions = (queryOptions = {}, outputWorkspace, globalOptions =
|
|
|
4541
4534
|
queryOptions == null ? void 0 : queryOptions.mutationOptions
|
|
4542
4535
|
)
|
|
4543
4536
|
} : {},
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4537
|
+
...!(0, import_core7.isUndefined)(globalOptions.shouldExportQueryKey) ? {
|
|
4538
|
+
shouldExportQueryKey: globalOptions.shouldExportQueryKey
|
|
4539
|
+
} : {},
|
|
4540
|
+
...!(0, import_core7.isUndefined)(queryOptions.shouldExportQueryKey) ? { shouldExportQueryKey: queryOptions.shouldExportQueryKey } : {},
|
|
4541
|
+
...!(0, import_core7.isUndefined)(globalOptions.shouldExportHttpClient) ? {
|
|
4542
|
+
shouldExportHttpClient: globalOptions.shouldExportHttpClient
|
|
4543
|
+
} : {},
|
|
4544
|
+
...!(0, import_core7.isUndefined)(queryOptions.shouldExportHttpClient) ? { shouldExportHttpClient: queryOptions.shouldExportHttpClient } : {},
|
|
4545
|
+
...!(0, import_core7.isUndefined)(globalOptions.shouldExportMutatorHooks) ? {
|
|
4546
|
+
shouldExportMutatorHooks: globalOptions.shouldExportMutatorHooks
|
|
4547
|
+
} : {},
|
|
4548
|
+
...!(0, import_core7.isUndefined)(queryOptions.shouldExportMutatorHooks) ? { shouldExportMutatorHooks: queryOptions.shouldExportMutatorHooks } : {},
|
|
4549
|
+
...!(0, import_core7.isUndefined)(globalOptions.signal) ? {
|
|
4550
|
+
signal: globalOptions.signal
|
|
4551
|
+
} : {},
|
|
4552
|
+
...!(0, import_core7.isUndefined)(queryOptions.signal) ? { signal: queryOptions.signal } : {},
|
|
4548
4553
|
...!(0, import_core7.isUndefined)(globalOptions.version) ? {
|
|
4549
4554
|
version: globalOptions.version
|
|
4550
4555
|
} : {},
|
|
@@ -4642,6 +4647,7 @@ var getHeader = (option, info) => {
|
|
|
4642
4647
|
return Array.isArray(header) ? (0, import_core10.jsDoc)({ description: header }) : header;
|
|
4643
4648
|
};
|
|
4644
4649
|
var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
4650
|
+
var _a;
|
|
4645
4651
|
const { info = { title: "", version: 0 }, schemas, target } = builder;
|
|
4646
4652
|
const { output } = options;
|
|
4647
4653
|
const projectTitle = projectName || info.title;
|
|
@@ -4657,6 +4663,7 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
|
4657
4663
|
const header = getHeader(output.override.header, info);
|
|
4658
4664
|
if (output.schemas) {
|
|
4659
4665
|
const rootSchemaPath = output.schemas;
|
|
4666
|
+
const fileExtension = ["tags", "tags-split", "split"].includes(output.mode) ? ".ts" : (_a = output.fileExtension) != null ? _a : ".ts";
|
|
4660
4667
|
await Promise.all(
|
|
4661
4668
|
Object.entries(schemas).map(([specKey, schemas2]) => {
|
|
4662
4669
|
const schemaPath = !(0, import_core10.isRootKey)(specKey, target) ? import_core10.upath.join(rootSchemaPath, specsName[specKey]) : rootSchemaPath;
|
|
@@ -4664,6 +4671,7 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
|
|
|
4664
4671
|
schemaPath,
|
|
4665
4672
|
schemas: schemas2,
|
|
4666
4673
|
target,
|
|
4674
|
+
fileExtension,
|
|
4667
4675
|
specsName,
|
|
4668
4676
|
specKey,
|
|
4669
4677
|
isRootKey: (0, import_core10.isRootKey)(specKey, target),
|