orval 6.29.1 → 6.30.1
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 +0 -1
- package/dist/bin/orval.js +126 -92
- package/dist/bin/orval.js.map +1 -1
- package/dist/index.js +126 -92
- package/dist/index.js.map +1 -1
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -24,6 +24,5 @@ You can find below some samples
|
|
|
24
24
|
- [svelte query](https://github.com/anymaniax/orval/tree/master/samples/svelte-query)
|
|
25
25
|
- [vue query](https://github.com/anymaniax/orval/tree/master/samples/vue-query)
|
|
26
26
|
- [react app with swr](https://github.com/anymaniax/orval/tree/master/samples/react-app-with-swr)
|
|
27
|
-
- [nx fastify react](https://github.com/anymaniax/orval/tree/master/samples/nx-fastify-react)
|
|
28
27
|
- [angular app](https://github.com/anymaniax/orval/tree/master/samples/angular-app)
|
|
29
28
|
- [hono](https://github.com/anymaniax/orval/tree/master/samples/hono)
|
package/dist/bin/orval.js
CHANGED
|
@@ -3262,6 +3262,7 @@ var import_query = __toESM(require("@orval/query"));
|
|
|
3262
3262
|
var import_swr = __toESM(require("@orval/swr"));
|
|
3263
3263
|
var import_zod = __toESM(require("@orval/zod"));
|
|
3264
3264
|
var import_hono = __toESM(require("@orval/hono"));
|
|
3265
|
+
var import_fetch = __toESM(require("@orval/fetch"));
|
|
3265
3266
|
var DEFAULT_CLIENT = import_core.OutputClient.AXIOS;
|
|
3266
3267
|
var getGeneratorClient = (outputClient, output) => {
|
|
3267
3268
|
const GENERATOR_CLIENT = {
|
|
@@ -3273,7 +3274,8 @@ var getGeneratorClient = (outputClient, output) => {
|
|
|
3273
3274
|
"vue-query": (0, import_query.default)({ output, type: "vue-query" })(),
|
|
3274
3275
|
swr: (0, import_swr.default)()(),
|
|
3275
3276
|
zod: (0, import_zod.default)()(),
|
|
3276
|
-
hono: (0, import_hono.default)()()
|
|
3277
|
+
hono: (0, import_hono.default)()(),
|
|
3278
|
+
fetch: (0, import_fetch.default)()()
|
|
3277
3279
|
};
|
|
3278
3280
|
const generator = (0, import_core.isFunction)(outputClient) ? outputClient(GENERATOR_CLIENT) : GENERATOR_CLIENT[outputClient];
|
|
3279
3281
|
if (!generator) {
|
|
@@ -3594,7 +3596,7 @@ var importOpenApi = async ({
|
|
|
3594
3596
|
}) => {
|
|
3595
3597
|
var _a;
|
|
3596
3598
|
const specs = await generateInputSpecs({ specs: data, input, workspace });
|
|
3597
|
-
const schemas = getApiSchemas({ output, target, workspace, specs });
|
|
3599
|
+
const schemas = getApiSchemas({ input, output, target, workspace, specs });
|
|
3598
3600
|
const api = await getApiBuilder({
|
|
3599
3601
|
// @ts-expect-error // FIXME
|
|
3600
3602
|
input,
|
|
@@ -3643,6 +3645,7 @@ var generateInputSpecs = async ({
|
|
|
3643
3645
|
);
|
|
3644
3646
|
};
|
|
3645
3647
|
var getApiSchemas = ({
|
|
3648
|
+
input,
|
|
3646
3649
|
output,
|
|
3647
3650
|
target,
|
|
3648
3651
|
workspace,
|
|
@@ -3650,7 +3653,7 @@ var getApiSchemas = ({
|
|
|
3650
3653
|
}) => {
|
|
3651
3654
|
return Object.entries(specs).reduce(
|
|
3652
3655
|
(acc, [specKey, spec]) => {
|
|
3653
|
-
var _a, _b, _c, _d;
|
|
3656
|
+
var _a, _b, _c, _d, _e;
|
|
3654
3657
|
const context = {
|
|
3655
3658
|
specKey,
|
|
3656
3659
|
target,
|
|
@@ -3658,23 +3661,25 @@ var getApiSchemas = ({
|
|
|
3658
3661
|
specs,
|
|
3659
3662
|
output
|
|
3660
3663
|
};
|
|
3664
|
+
const parsedSchemas = spec.openapi ? (_a = spec.components) == null ? void 0 : _a.schemas : getAllSchemas(spec, specKey);
|
|
3661
3665
|
const schemaDefinition = (0, import_core3.generateSchemasDefinition)(
|
|
3662
|
-
|
|
3666
|
+
parsedSchemas,
|
|
3663
3667
|
context,
|
|
3664
|
-
output.override.components.schemas.suffix
|
|
3668
|
+
output.override.components.schemas.suffix,
|
|
3669
|
+
(_b = input.filters) == null ? void 0 : _b.schemas
|
|
3665
3670
|
);
|
|
3666
3671
|
const responseDefinition = (0, import_core3.generateComponentDefinition)(
|
|
3667
|
-
(
|
|
3672
|
+
(_c = spec.components) == null ? void 0 : _c.responses,
|
|
3668
3673
|
context,
|
|
3669
3674
|
output.override.components.responses.suffix
|
|
3670
3675
|
);
|
|
3671
3676
|
const bodyDefinition = (0, import_core3.generateComponentDefinition)(
|
|
3672
|
-
(
|
|
3677
|
+
(_d = spec.components) == null ? void 0 : _d.requestBodies,
|
|
3673
3678
|
context,
|
|
3674
3679
|
output.override.components.requestBodies.suffix
|
|
3675
3680
|
);
|
|
3676
3681
|
const parameters = (0, import_core3.generateParameterDefinition)(
|
|
3677
|
-
(
|
|
3682
|
+
(_e = spec.components) == null ? void 0 : _e.parameters,
|
|
3678
3683
|
context,
|
|
3679
3684
|
output.override.components.parameters.suffix
|
|
3680
3685
|
);
|
|
@@ -3807,7 +3812,7 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
3807
3812
|
var package_default = {
|
|
3808
3813
|
name: "orval",
|
|
3809
3814
|
description: "A swagger client generator for typescript",
|
|
3810
|
-
version: "6.
|
|
3815
|
+
version: "6.30.1",
|
|
3811
3816
|
license: "MIT",
|
|
3812
3817
|
files: [
|
|
3813
3818
|
"dist"
|
|
@@ -3861,18 +3866,19 @@ var package_default = {
|
|
|
3861
3866
|
},
|
|
3862
3867
|
dependencies: {
|
|
3863
3868
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
3864
|
-
"@orval/angular": "6.
|
|
3865
|
-
"@orval/axios": "6.
|
|
3866
|
-
"@orval/core": "6.
|
|
3867
|
-
"@orval/
|
|
3868
|
-
"@orval/
|
|
3869
|
-
"@orval/
|
|
3870
|
-
"@orval/
|
|
3871
|
-
"@orval/
|
|
3869
|
+
"@orval/angular": "6.30.1",
|
|
3870
|
+
"@orval/axios": "6.30.1",
|
|
3871
|
+
"@orval/core": "6.30.1",
|
|
3872
|
+
"@orval/fetch": "6.30.1",
|
|
3873
|
+
"@orval/hono": "6.30.1",
|
|
3874
|
+
"@orval/mock": "6.30.1",
|
|
3875
|
+
"@orval/query": "6.30.1",
|
|
3876
|
+
"@orval/swr": "6.30.1",
|
|
3877
|
+
"@orval/zod": "6.30.1",
|
|
3872
3878
|
ajv: "^8.12.0",
|
|
3873
3879
|
cac: "^6.7.14",
|
|
3874
3880
|
chalk: "^4.1.2",
|
|
3875
|
-
chokidar: "^3.
|
|
3881
|
+
chokidar: "^3.6.0",
|
|
3876
3882
|
enquirer: "^2.4.1",
|
|
3877
3883
|
execa: "^5.1.1",
|
|
3878
3884
|
"find-up": "5.0.0",
|
|
@@ -4093,7 +4099,7 @@ var loadTsconfig = async (tsconfig, workspace = process.cwd()) => {
|
|
|
4093
4099
|
|
|
4094
4100
|
// src/utils/options.ts
|
|
4095
4101
|
var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOptions = {}) => {
|
|
4096
|
-
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;
|
|
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, _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, __b, _$b, _ac, _bc, _cc, _dc, _ec, _fc, _gc;
|
|
4097
4103
|
const options = await ((0, import_core7.isFunction)(optionsExport) ? optionsExport() : optionsExport);
|
|
4098
4104
|
if (!options.input) {
|
|
4099
4105
|
(0, import_core7.createLogger)().error(import_chalk2.default.red(`Config require an input`));
|
|
@@ -4131,20 +4137,29 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4131
4137
|
};
|
|
4132
4138
|
}
|
|
4133
4139
|
const defaultFileExtension = ".ts";
|
|
4140
|
+
const globalQueryOptions = {
|
|
4141
|
+
useQuery: (_d = (_c = (_b = outputOptions.override) == null ? void 0 : _b.query) == null ? void 0 : _c.useQuery) != null ? _d : true,
|
|
4142
|
+
useMutation: (_g = (_f = (_e = outputOptions.override) == null ? void 0 : _e.query) == null ? void 0 : _f.useMutation) != null ? _g : true,
|
|
4143
|
+
signal: (_j = (_i = (_h = outputOptions.override) == null ? void 0 : _h.query) == null ? void 0 : _i.signal) != null ? _j : true,
|
|
4144
|
+
shouldExportMutatorHooks: (_m = (_l = (_k = outputOptions.override) == null ? void 0 : _k.query) == null ? void 0 : _l.shouldExportMutatorHooks) != null ? _m : true,
|
|
4145
|
+
shouldExportHttpClient: (_p = (_o = (_n = outputOptions.override) == null ? void 0 : _n.query) == null ? void 0 : _o.shouldExportHttpClient) != null ? _p : true,
|
|
4146
|
+
shouldExportQueryKey: (_s = (_r = (_q = outputOptions.override) == null ? void 0 : _q.query) == null ? void 0 : _r.shouldExportQueryKey) != null ? _s : true,
|
|
4147
|
+
...normalizeQueryOptions((_t = outputOptions.override) == null ? void 0 : _t.query, workspace)
|
|
4148
|
+
};
|
|
4134
4149
|
const normalizedOptions = {
|
|
4135
4150
|
input: {
|
|
4136
4151
|
target: globalOptions.input ? normalizePathOrUrl(globalOptions.input, process.cwd()) : normalizePathOrUrl(inputOptions.target, workspace),
|
|
4137
4152
|
validation: inputOptions.validation || false,
|
|
4138
4153
|
override: {
|
|
4139
4154
|
transformer: normalizePath(
|
|
4140
|
-
(
|
|
4155
|
+
(_u = inputOptions.override) == null ? void 0 : _u.transformer,
|
|
4141
4156
|
workspace
|
|
4142
4157
|
)
|
|
4143
4158
|
},
|
|
4144
|
-
converterOptions: (
|
|
4159
|
+
converterOptions: (_v = inputOptions.converterOptions) != null ? _v : {},
|
|
4145
4160
|
parserOptions: (0, import_core7.mergeDeep)(
|
|
4146
4161
|
parserDefaultOptions,
|
|
4147
|
-
(
|
|
4162
|
+
(_w = inputOptions.parserOptions) != null ? _w : {}
|
|
4148
4163
|
),
|
|
4149
4164
|
filters: inputOptions.filters
|
|
4150
4165
|
},
|
|
@@ -4153,122 +4168,128 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4153
4168
|
schemas: normalizePath(outputOptions.schemas, outputWorkspace),
|
|
4154
4169
|
fileExtension: outputOptions.fileExtension || defaultFileExtension,
|
|
4155
4170
|
workspace: outputOptions.workspace ? outputWorkspace : void 0,
|
|
4156
|
-
client: (
|
|
4157
|
-
mode: normalizeOutputMode((
|
|
4171
|
+
client: (_y = (_x = outputOptions.client) != null ? _x : client) != null ? _y : import_core7.OutputClient.AXIOS_FUNCTIONS,
|
|
4172
|
+
mode: normalizeOutputMode((_z = outputOptions.mode) != null ? _z : mode),
|
|
4158
4173
|
mock: mock2,
|
|
4159
|
-
clean: (
|
|
4160
|
-
prettier: (
|
|
4161
|
-
tslint: (
|
|
4162
|
-
biome: (
|
|
4174
|
+
clean: (_B = (_A = outputOptions.clean) != null ? _A : clean) != null ? _B : false,
|
|
4175
|
+
prettier: (_D = (_C = outputOptions.prettier) != null ? _C : prettier) != null ? _D : false,
|
|
4176
|
+
tslint: (_F = (_E = outputOptions.tslint) != null ? _E : tslint) != null ? _F : false,
|
|
4177
|
+
biome: (_H = (_G = outputOptions.biome) != null ? _G : biome) != null ? _H : false,
|
|
4163
4178
|
tsconfig,
|
|
4164
4179
|
packageJson,
|
|
4165
|
-
headers: (
|
|
4166
|
-
indexFiles: (
|
|
4180
|
+
headers: (_I = outputOptions.headers) != null ? _I : false,
|
|
4181
|
+
indexFiles: (_J = outputOptions.indexFiles) != null ? _J : true,
|
|
4167
4182
|
baseUrl: outputOptions.baseUrl,
|
|
4168
|
-
unionAddMissingProperties: (
|
|
4183
|
+
unionAddMissingProperties: (_K = outputOptions.unionAddMissingProperties) != null ? _K : false,
|
|
4169
4184
|
override: {
|
|
4170
4185
|
...outputOptions.override,
|
|
4171
4186
|
mock: {
|
|
4172
|
-
arrayMin: (
|
|
4173
|
-
arrayMax: (
|
|
4174
|
-
...(
|
|
4187
|
+
arrayMin: (_N = (_M = (_L = outputOptions.override) == null ? void 0 : _L.mock) == null ? void 0 : _M.arrayMin) != null ? _N : 1,
|
|
4188
|
+
arrayMax: (_Q = (_P = (_O = outputOptions.override) == null ? void 0 : _O.mock) == null ? void 0 : _P.arrayMax) != null ? _Q : 10,
|
|
4189
|
+
...(_S = (_R = outputOptions.override) == null ? void 0 : _R.mock) != null ? _S : {}
|
|
4175
4190
|
},
|
|
4176
4191
|
operations: normalizeOperationsAndTags(
|
|
4177
|
-
(
|
|
4178
|
-
outputWorkspace
|
|
4192
|
+
(_U = (_T = outputOptions.override) == null ? void 0 : _T.operations) != null ? _U : {},
|
|
4193
|
+
outputWorkspace,
|
|
4194
|
+
{
|
|
4195
|
+
query: globalQueryOptions
|
|
4196
|
+
}
|
|
4179
4197
|
),
|
|
4180
4198
|
tags: normalizeOperationsAndTags(
|
|
4181
|
-
(
|
|
4182
|
-
outputWorkspace
|
|
4199
|
+
(_W = (_V = outputOptions.override) == null ? void 0 : _V.tags) != null ? _W : {},
|
|
4200
|
+
outputWorkspace,
|
|
4201
|
+
{
|
|
4202
|
+
query: globalQueryOptions
|
|
4203
|
+
}
|
|
4183
4204
|
),
|
|
4184
4205
|
mutator: normalizeMutator(
|
|
4185
4206
|
outputWorkspace,
|
|
4186
|
-
(
|
|
4207
|
+
(_X = outputOptions.override) == null ? void 0 : _X.mutator
|
|
4187
4208
|
),
|
|
4188
|
-
formData: (
|
|
4209
|
+
formData: (_$ = !(0, import_core7.isBoolean)((_Y = outputOptions.override) == null ? void 0 : _Y.formData) ? normalizeMutator(
|
|
4189
4210
|
outputWorkspace,
|
|
4190
|
-
(
|
|
4191
|
-
) : (
|
|
4192
|
-
formUrlEncoded: (
|
|
4211
|
+
(_Z = outputOptions.override) == null ? void 0 : _Z.formData
|
|
4212
|
+
) : (__ = outputOptions.override) == null ? void 0 : __.formData) != null ? _$ : true,
|
|
4213
|
+
formUrlEncoded: (_da = !(0, import_core7.isBoolean)((_aa = outputOptions.override) == null ? void 0 : _aa.formUrlEncoded) ? normalizeMutator(
|
|
4193
4214
|
outputWorkspace,
|
|
4194
|
-
(
|
|
4195
|
-
) : (
|
|
4215
|
+
(_ba = outputOptions.override) == null ? void 0 : _ba.formUrlEncoded
|
|
4216
|
+
) : (_ca = outputOptions.override) == null ? void 0 : _ca.formUrlEncoded) != null ? _da : true,
|
|
4196
4217
|
paramsSerializer: normalizeMutator(
|
|
4197
4218
|
outputWorkspace,
|
|
4198
|
-
(
|
|
4219
|
+
(_ea = outputOptions.override) == null ? void 0 : _ea.paramsSerializer
|
|
4199
4220
|
),
|
|
4200
|
-
header: ((
|
|
4201
|
-
requestOptions: (
|
|
4221
|
+
header: ((_fa = outputOptions.override) == null ? void 0 : _fa.header) === false ? false : (0, import_core7.isFunction)((_ga = outputOptions.override) == null ? void 0 : _ga.header) ? (_ha = outputOptions.override) == null ? void 0 : _ha.header : getDefaultFilesHeader,
|
|
4222
|
+
requestOptions: (_ja = (_ia = outputOptions.override) == null ? void 0 : _ia.requestOptions) != null ? _ja : true,
|
|
4202
4223
|
components: {
|
|
4203
4224
|
schemas: {
|
|
4204
4225
|
suffix: import_core7.RefComponentSuffix.schemas,
|
|
4205
|
-
itemSuffix: (
|
|
4206
|
-
...(
|
|
4226
|
+
itemSuffix: (_na = (_ma = (_la = (_ka = outputOptions.override) == null ? void 0 : _ka.components) == null ? void 0 : _la.schemas) == null ? void 0 : _ma.itemSuffix) != null ? _na : "Item",
|
|
4227
|
+
...(_qa = (_pa = (_oa = outputOptions.override) == null ? void 0 : _oa.components) == null ? void 0 : _pa.schemas) != null ? _qa : {}
|
|
4207
4228
|
},
|
|
4208
4229
|
responses: {
|
|
4209
4230
|
suffix: import_core7.RefComponentSuffix.responses,
|
|
4210
|
-
...(
|
|
4231
|
+
...(_ta = (_sa = (_ra = outputOptions.override) == null ? void 0 : _ra.components) == null ? void 0 : _sa.responses) != null ? _ta : {}
|
|
4211
4232
|
},
|
|
4212
4233
|
parameters: {
|
|
4213
4234
|
suffix: import_core7.RefComponentSuffix.parameters,
|
|
4214
|
-
...(
|
|
4235
|
+
...(_wa = (_va = (_ua = outputOptions.override) == null ? void 0 : _ua.components) == null ? void 0 : _va.parameters) != null ? _wa : {}
|
|
4215
4236
|
},
|
|
4216
4237
|
requestBodies: {
|
|
4217
4238
|
suffix: import_core7.RefComponentSuffix.requestBodies,
|
|
4218
|
-
...(
|
|
4239
|
+
...(_za = (_ya = (_xa = outputOptions.override) == null ? void 0 : _xa.components) == null ? void 0 : _ya.requestBodies) != null ? _za : {}
|
|
4219
4240
|
}
|
|
4220
4241
|
},
|
|
4221
|
-
hono: normalizeHonoOptions((
|
|
4242
|
+
hono: normalizeHonoOptions((_Aa = outputOptions.override) == null ? void 0 : _Aa.hono, workspace),
|
|
4222
4243
|
query: {
|
|
4223
|
-
useQuery: (
|
|
4224
|
-
useMutation: (
|
|
4225
|
-
signal: (
|
|
4226
|
-
shouldExportMutatorHooks: (
|
|
4227
|
-
shouldExportHttpClient: (
|
|
4228
|
-
shouldExportQueryKey: (
|
|
4229
|
-
...normalizeQueryOptions((
|
|
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)
|
|
4230
4251
|
},
|
|
4231
4252
|
zod: {
|
|
4232
4253
|
strict: {
|
|
4233
|
-
param: (
|
|
4234
|
-
query: (
|
|
4235
|
-
header: (
|
|
4236
|
-
body: (
|
|
4237
|
-
response: (
|
|
4254
|
+
param: (_Xa = (_Wa = (_Va = (_Ua = outputOptions.override) == null ? void 0 : _Ua.zod) == null ? void 0 : _Va.strict) == null ? void 0 : _Wa.param) != null ? _Xa : false,
|
|
4255
|
+
query: (_$a = (__a = (_Za = (_Ya = outputOptions.override) == null ? void 0 : _Ya.zod) == null ? void 0 : _Za.strict) == null ? void 0 : __a.query) != null ? _$a : false,
|
|
4256
|
+
header: (_db = (_cb = (_bb = (_ab = outputOptions.override) == null ? void 0 : _ab.zod) == null ? void 0 : _bb.strict) == null ? void 0 : _cb.header) != null ? _db : false,
|
|
4257
|
+
body: (_hb = (_gb = (_fb = (_eb = outputOptions.override) == null ? void 0 : _eb.zod) == null ? void 0 : _fb.strict) == null ? void 0 : _gb.body) != null ? _hb : false,
|
|
4258
|
+
response: (_lb = (_kb = (_jb = (_ib = outputOptions.override) == null ? void 0 : _ib.zod) == null ? void 0 : _jb.strict) == null ? void 0 : _kb.response) != null ? _lb : false
|
|
4238
4259
|
},
|
|
4239
4260
|
coerce: {
|
|
4240
|
-
param: (
|
|
4241
|
-
query: (
|
|
4242
|
-
header: (
|
|
4243
|
-
body: (
|
|
4244
|
-
response: (
|
|
4261
|
+
param: (_pb = (_ob = (_nb = (_mb = outputOptions.override) == null ? void 0 : _mb.zod) == null ? void 0 : _nb.coerce) == null ? void 0 : _ob.param) != null ? _pb : false,
|
|
4262
|
+
query: (_tb = (_sb = (_rb = (_qb = outputOptions.override) == null ? void 0 : _qb.zod) == null ? void 0 : _rb.coerce) == null ? void 0 : _sb.query) != null ? _tb : false,
|
|
4263
|
+
header: (_xb = (_wb = (_vb = (_ub = outputOptions.override) == null ? void 0 : _ub.zod) == null ? void 0 : _vb.coerce) == null ? void 0 : _wb.header) != null ? _xb : false,
|
|
4264
|
+
body: (_Bb = (_Ab = (_zb = (_yb = outputOptions.override) == null ? void 0 : _yb.zod) == null ? void 0 : _zb.coerce) == null ? void 0 : _Ab.body) != null ? _Bb : false,
|
|
4265
|
+
response: (_Fb = (_Eb = (_Db = (_Cb = outputOptions.override) == null ? void 0 : _Cb.zod) == null ? void 0 : _Db.coerce) == null ? void 0 : _Eb.response) != null ? _Fb : false
|
|
4245
4266
|
},
|
|
4246
4267
|
preprocess: {
|
|
4247
|
-
...((
|
|
4268
|
+
...((_Ib = (_Hb = (_Gb = outputOptions.override) == null ? void 0 : _Gb.zod) == null ? void 0 : _Hb.preprocess) == null ? void 0 : _Ib.param) ? {
|
|
4248
4269
|
param: normalizeMutator(
|
|
4249
4270
|
workspace,
|
|
4250
4271
|
outputOptions.override.zod.preprocess.param
|
|
4251
4272
|
)
|
|
4252
4273
|
} : {},
|
|
4253
|
-
...((
|
|
4274
|
+
...((_Lb = (_Kb = (_Jb = outputOptions.override) == null ? void 0 : _Jb.zod) == null ? void 0 : _Kb.preprocess) == null ? void 0 : _Lb.query) ? {
|
|
4254
4275
|
query: normalizeMutator(
|
|
4255
4276
|
workspace,
|
|
4256
4277
|
outputOptions.override.zod.preprocess.query
|
|
4257
4278
|
)
|
|
4258
4279
|
} : {},
|
|
4259
|
-
...((
|
|
4280
|
+
...((_Ob = (_Nb = (_Mb = outputOptions.override) == null ? void 0 : _Mb.zod) == null ? void 0 : _Nb.preprocess) == null ? void 0 : _Ob.header) ? {
|
|
4260
4281
|
header: normalizeMutator(
|
|
4261
4282
|
workspace,
|
|
4262
4283
|
outputOptions.override.zod.preprocess.header
|
|
4263
4284
|
)
|
|
4264
4285
|
} : {},
|
|
4265
|
-
...((
|
|
4286
|
+
...((_Rb = (_Qb = (_Pb = outputOptions.override) == null ? void 0 : _Pb.zod) == null ? void 0 : _Qb.preprocess) == null ? void 0 : _Rb.body) ? {
|
|
4266
4287
|
body: normalizeMutator(
|
|
4267
4288
|
workspace,
|
|
4268
4289
|
outputOptions.override.zod.preprocess.body
|
|
4269
4290
|
)
|
|
4270
4291
|
} : {},
|
|
4271
|
-
...((
|
|
4292
|
+
...((_Ub = (_Tb = (_Sb = outputOptions.override) == null ? void 0 : _Sb.zod) == null ? void 0 : _Tb.preprocess) == null ? void 0 : _Ub.response) ? {
|
|
4272
4293
|
response: normalizeMutator(
|
|
4273
4294
|
workspace,
|
|
4274
4295
|
outputOptions.override.zod.preprocess.response
|
|
@@ -4277,19 +4298,19 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4277
4298
|
}
|
|
4278
4299
|
},
|
|
4279
4300
|
swr: {
|
|
4280
|
-
...(
|
|
4301
|
+
...(_Wb = (_Vb = outputOptions.override) == null ? void 0 : _Vb.swr) != null ? _Wb : {}
|
|
4281
4302
|
},
|
|
4282
4303
|
angular: {
|
|
4283
|
-
provideIn: (
|
|
4304
|
+
provideIn: (_Zb = (_Yb = (_Xb = outputOptions.override) == null ? void 0 : _Xb.angular) == null ? void 0 : _Yb.provideIn) != null ? _Zb : "root"
|
|
4284
4305
|
},
|
|
4285
|
-
useDates: ((
|
|
4286
|
-
useDeprecatedOperations: (
|
|
4287
|
-
useNativeEnums: (
|
|
4288
|
-
suppressReadonlyModifier: ((
|
|
4306
|
+
useDates: ((__b = outputOptions.override) == null ? void 0 : __b.useDates) || false,
|
|
4307
|
+
useDeprecatedOperations: (_ac = (_$b = outputOptions.override) == null ? void 0 : _$b.useDeprecatedOperations) != null ? _ac : true,
|
|
4308
|
+
useNativeEnums: (_cc = (_bc = outputOptions.override) == null ? void 0 : _bc.useNativeEnums) != null ? _cc : false,
|
|
4309
|
+
suppressReadonlyModifier: ((_dc = outputOptions.override) == null ? void 0 : _dc.suppressReadonlyModifier) || false
|
|
4289
4310
|
},
|
|
4290
|
-
allParamsOptional: (
|
|
4291
|
-
urlEncodeParameters: (
|
|
4292
|
-
optionsParamRequired: (
|
|
4311
|
+
allParamsOptional: (_ec = outputOptions.allParamsOptional) != null ? _ec : false,
|
|
4312
|
+
urlEncodeParameters: (_fc = outputOptions.urlEncodeParameters) != null ? _fc : false,
|
|
4313
|
+
optionsParamRequired: (_gc = outputOptions.optionsParamRequired) != null ? _gc : false
|
|
4293
4314
|
},
|
|
4294
4315
|
hooks: options.hooks ? normalizeHooks(options.hooks) : {}
|
|
4295
4316
|
};
|
|
@@ -4342,7 +4363,7 @@ var normalizePath = (path, workspace) => {
|
|
|
4342
4363
|
}
|
|
4343
4364
|
return import_core7.upath.resolve(workspace, path);
|
|
4344
4365
|
};
|
|
4345
|
-
var normalizeOperationsAndTags = (operationsOrTags, workspace) => {
|
|
4366
|
+
var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
|
|
4346
4367
|
return Object.fromEntries(
|
|
4347
4368
|
Object.entries(operationsOrTags).map(
|
|
4348
4369
|
([
|
|
@@ -4364,7 +4385,7 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace) => {
|
|
|
4364
4385
|
{
|
|
4365
4386
|
...rest,
|
|
4366
4387
|
...query2 ? {
|
|
4367
|
-
query: normalizeQueryOptions(query2, workspace)
|
|
4388
|
+
query: normalizeQueryOptions(query2, workspace, global2.query)
|
|
4368
4389
|
} : {},
|
|
4369
4390
|
...zod2 ? {
|
|
4370
4391
|
zod: {
|
|
@@ -4480,7 +4501,8 @@ var normalizeHonoOptions = (hono2 = {}, workspace) => {
|
|
|
4480
4501
|
validator: (_a = hono2.validator) != null ? _a : true
|
|
4481
4502
|
};
|
|
4482
4503
|
};
|
|
4483
|
-
var normalizeQueryOptions = (queryOptions = {}, outputWorkspace) => {
|
|
4504
|
+
var normalizeQueryOptions = (queryOptions = {}, outputWorkspace, globalOptions = {}) => {
|
|
4505
|
+
var _a, _b, _c, _d;
|
|
4484
4506
|
if (queryOptions.options) {
|
|
4485
4507
|
console.warn(
|
|
4486
4508
|
"[WARN] Using query options is deprecated and will be removed in a future major release. Please use queryOptions or mutationOptions instead."
|
|
@@ -4495,25 +4517,37 @@ var normalizeQueryOptions = (queryOptions = {}, outputWorkspace) => {
|
|
|
4495
4517
|
...!(0, import_core7.isUndefined)(queryOptions.useSuspenseInfiniteQuery) ? { useSuspenseInfiniteQuery: queryOptions.useSuspenseInfiniteQuery } : {},
|
|
4496
4518
|
...queryOptions.useInfiniteQueryParam ? { useInfiniteQueryParam: queryOptions.useInfiniteQueryParam } : {},
|
|
4497
4519
|
...queryOptions.options ? { options: queryOptions.options } : {},
|
|
4520
|
+
...globalOptions.queryKey ? {
|
|
4521
|
+
queryKey: globalOptions.queryKey
|
|
4522
|
+
} : {},
|
|
4498
4523
|
...(queryOptions == null ? void 0 : queryOptions.queryKey) ? {
|
|
4499
4524
|
queryKey: normalizeMutator(outputWorkspace, queryOptions == null ? void 0 : queryOptions.queryKey)
|
|
4500
4525
|
} : {},
|
|
4526
|
+
...globalOptions.queryOptions ? {
|
|
4527
|
+
queryOptions: globalOptions.queryOptions
|
|
4528
|
+
} : {},
|
|
4501
4529
|
...(queryOptions == null ? void 0 : queryOptions.queryOptions) ? {
|
|
4502
4530
|
queryOptions: normalizeMutator(
|
|
4503
4531
|
outputWorkspace,
|
|
4504
4532
|
queryOptions == null ? void 0 : queryOptions.queryOptions
|
|
4505
4533
|
)
|
|
4506
4534
|
} : {},
|
|
4535
|
+
...globalOptions.mutationOptions ? {
|
|
4536
|
+
mutationOptions: globalOptions.mutationOptions
|
|
4537
|
+
} : {},
|
|
4507
4538
|
...(queryOptions == null ? void 0 : queryOptions.mutationOptions) ? {
|
|
4508
4539
|
mutationOptions: normalizeMutator(
|
|
4509
4540
|
outputWorkspace,
|
|
4510
4541
|
queryOptions == null ? void 0 : queryOptions.mutationOptions
|
|
4511
4542
|
)
|
|
4512
4543
|
} : {},
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4544
|
+
shouldExportQueryKey: (_a = queryOptions.shouldExportQueryKey) != null ? _a : globalOptions.shouldExportQueryKey,
|
|
4545
|
+
shouldExportHttpClient: (_b = queryOptions.shouldExportHttpClient) != null ? _b : globalOptions.shouldExportHttpClient,
|
|
4546
|
+
shouldExportMutatorHooks: (_c = queryOptions.shouldExportMutatorHooks) != null ? _c : globalOptions.shouldExportMutatorHooks,
|
|
4547
|
+
signal: (_d = queryOptions.signal) != null ? _d : globalOptions.signal,
|
|
4548
|
+
...!(0, import_core7.isUndefined)(globalOptions.version) ? {
|
|
4549
|
+
version: globalOptions.version
|
|
4550
|
+
} : {},
|
|
4517
4551
|
...!(0, import_core7.isUndefined)(queryOptions.version) ? { version: queryOptions.version } : {}
|
|
4518
4552
|
};
|
|
4519
4553
|
};
|