@orval/query 7.15.0 → 8.0.0-rc.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/dist/index.js +118 -159
- package/dist/index.js.map +1 -1
- package/package.json +12 -11
package/dist/index.js
CHANGED
|
@@ -1,35 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
-
get: ((k) => from[k]).bind(null, key),
|
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
-
value: mod,
|
|
21
|
-
enumerable: true
|
|
22
|
-
}) : target, mod));
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
let __orval_core = require("@orval/core");
|
|
26
|
-
__orval_core = __toESM(__orval_core);
|
|
27
|
-
let lodash_omitby = require("lodash.omitby");
|
|
28
|
-
lodash_omitby = __toESM(lodash_omitby);
|
|
29
|
-
let __orval_fetch = require("@orval/fetch");
|
|
30
|
-
__orval_fetch = __toESM(__orval_fetch);
|
|
31
|
-
let chalk = require("chalk");
|
|
32
|
-
chalk = __toESM(chalk);
|
|
1
|
+
import { GetterPropType, OutputClient, OutputHttpClient, TEMPLATE_TAG_REGEX, Verbs, camel, compareVersions, generateFormDataAndUrlEncodedFunction, generateMutator, generateMutatorConfig, generateMutatorRequestOptions, generateOptions, generateVerbImports, getIsBodyVerb, getRouteAsArray, isObject, isString, isSyntheticDefaultImportsAllow, jsDoc, mergeDeep, pascal, stringify, toObjectString, upath } from "@orval/core";
|
|
2
|
+
import { omitBy } from "remeda";
|
|
3
|
+
import { generateFetchHeader, generateRequestFunction } from "@orval/fetch";
|
|
4
|
+
import chalk from "chalk";
|
|
33
5
|
|
|
34
6
|
//#region src/utils.ts
|
|
35
7
|
const normalizeQueryOptions = (queryOptions = {}, outputWorkspace) => {
|
|
@@ -52,16 +24,16 @@ const normalizeQueryOptions = (queryOptions = {}, outputWorkspace) => {
|
|
|
52
24
|
};
|
|
53
25
|
};
|
|
54
26
|
const normalizeMutator = (workspace, mutator) => {
|
|
55
|
-
if (
|
|
56
|
-
if (!mutator.path) throw new Error(chalk.
|
|
27
|
+
if (isObject(mutator)) {
|
|
28
|
+
if (!mutator.path) throw new Error(chalk.red(`Mutator need a path`));
|
|
57
29
|
return {
|
|
58
30
|
...mutator,
|
|
59
|
-
path:
|
|
31
|
+
path: upath.resolve(workspace, mutator.path),
|
|
60
32
|
default: (mutator.default || !mutator.name) ?? false
|
|
61
33
|
};
|
|
62
34
|
}
|
|
63
|
-
if (
|
|
64
|
-
path:
|
|
35
|
+
if (isString(mutator)) return {
|
|
36
|
+
path: upath.resolve(workspace, mutator),
|
|
65
37
|
default: true
|
|
66
38
|
};
|
|
67
39
|
return mutator;
|
|
@@ -70,7 +42,7 @@ function vueWrapTypeWithMaybeRef(props) {
|
|
|
70
42
|
return props.map((prop) => {
|
|
71
43
|
const [paramName, paramType] = prop.implementation.split(":");
|
|
72
44
|
if (!paramType) return prop;
|
|
73
|
-
const name = prop.type ===
|
|
45
|
+
const name = prop.type === GetterPropType.NAMED_PATH_PARAMS ? prop.name : paramName;
|
|
74
46
|
const [type, defaultValue] = paramType.split("=");
|
|
75
47
|
return {
|
|
76
48
|
...prop,
|
|
@@ -80,14 +52,14 @@ function vueWrapTypeWithMaybeRef(props) {
|
|
|
80
52
|
}
|
|
81
53
|
const vueUnRefParams = (props) => {
|
|
82
54
|
return props.map((prop) => {
|
|
83
|
-
if (prop.type ===
|
|
55
|
+
if (prop.type === GetterPropType.NAMED_PATH_PARAMS) return `const ${prop.destructured} = unref(${prop.name});`;
|
|
84
56
|
return `${prop.name} = unref(${prop.name});`;
|
|
85
57
|
}).join("\n");
|
|
86
58
|
};
|
|
87
|
-
const wrapRouteParameters = (route, prepend, append) => route.replaceAll(
|
|
59
|
+
const wrapRouteParameters = (route, prepend, append) => route.replaceAll(TEMPLATE_TAG_REGEX, `\${${prepend}$1${append}}`);
|
|
88
60
|
const makeRouteSafe = (route) => wrapRouteParameters(route, "encodeURIComponent(String(", "))");
|
|
89
|
-
const isVue = (client) =>
|
|
90
|
-
const getHasSignal = ({ overrideQuerySignal = false, verb }) => overrideQuerySignal && (!
|
|
61
|
+
const isVue = (client) => OutputClient.VUE_QUERY === client;
|
|
62
|
+
const getHasSignal = ({ overrideQuerySignal = false, verb }) => overrideQuerySignal && (!getIsBodyVerb(verb) || verb === Verbs.POST);
|
|
91
63
|
|
|
92
64
|
//#endregion
|
|
93
65
|
//#region src/client.ts
|
|
@@ -106,7 +78,7 @@ const AXIOS_DEPENDENCIES = [{
|
|
|
106
78
|
dependency: "axios"
|
|
107
79
|
}];
|
|
108
80
|
const generateQueryRequestFunction = (verbOptions, options, isVue$1) => {
|
|
109
|
-
return options.context.output.httpClient ===
|
|
81
|
+
return options.context.output.httpClient === OutputHttpClient.AXIOS ? generateAxiosRequestFunction(verbOptions, options, isVue$1) : generateRequestFunction(verbOptions, options);
|
|
110
82
|
};
|
|
111
83
|
const generateAxiosRequestFunction = ({ headers, queryParams, operationName, response, mutator, body, props: _props, verb, formData, formUrlEncoded, override, paramsSerializer }, { route: _route, context }, isVue$1) => {
|
|
112
84
|
let props = _props;
|
|
@@ -121,7 +93,7 @@ const generateAxiosRequestFunction = ({ headers, queryParams, operationName, res
|
|
|
121
93
|
verb
|
|
122
94
|
});
|
|
123
95
|
const isExactOptionalPropertyTypes = !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;
|
|
124
|
-
const bodyForm =
|
|
96
|
+
const bodyForm = generateFormDataAndUrlEncodedFunction({
|
|
125
97
|
formData,
|
|
126
98
|
formUrlEncoded,
|
|
127
99
|
body,
|
|
@@ -129,7 +101,7 @@ const generateAxiosRequestFunction = ({ headers, queryParams, operationName, res
|
|
|
129
101
|
isFormUrlEncoded
|
|
130
102
|
});
|
|
131
103
|
if (mutator) {
|
|
132
|
-
const mutatorConfig =
|
|
104
|
+
const mutatorConfig = generateMutatorConfig({
|
|
133
105
|
route,
|
|
134
106
|
body,
|
|
135
107
|
headers,
|
|
@@ -143,10 +115,10 @@ const generateAxiosRequestFunction = ({ headers, queryParams, operationName, res
|
|
|
143
115
|
isVue: isVue$1
|
|
144
116
|
});
|
|
145
117
|
const bodyDefinition = body.definition.replace("[]", String.raw`\[\]`);
|
|
146
|
-
const propsImplementation = mutator?.bodyTypeName && body.definition ?
|
|
147
|
-
const requestOptions = isRequestOptions ?
|
|
118
|
+
const propsImplementation = mutator?.bodyTypeName && body.definition ? toObjectString(props, "implementation").replace(/* @__PURE__ */ new RegExp(`(\\w*):\\s?${bodyDefinition}`), `$1: ${mutator.bodyTypeName}<${body.definition}>`) : toObjectString(props, "implementation");
|
|
119
|
+
const requestOptions = isRequestOptions ? generateMutatorRequestOptions(override.requestOptions, mutator.hasSecondArg) : "";
|
|
148
120
|
if (mutator.isHook) {
|
|
149
|
-
const ret = `${override.query.shouldExportMutatorHooks ? "export " : ""}const use${
|
|
121
|
+
const ret = `${override.query.shouldExportMutatorHooks ? "export " : ""}const use${pascal(operationName)}Hook = () => {
|
|
150
122
|
const ${operationName} = ${mutator.name}<${response.definition.success || "unknown"}>();
|
|
151
123
|
|
|
152
124
|
return useCallback((\n ${propsImplementation}\n ${isRequestOptions && mutator.hasSecondArg ? `options${context.output.optionsParamRequired ? "" : "?"}: SecondParameter<ReturnType<typeof ${mutator.name}>>,` : ""}${hasSignal ? "signal?: AbortSignal\n" : ""}) => {${bodyForm}
|
|
@@ -156,7 +128,7 @@ const generateAxiosRequestFunction = ({ headers, queryParams, operationName, res
|
|
|
156
128
|
}, [${operationName}])
|
|
157
129
|
}
|
|
158
130
|
`;
|
|
159
|
-
const vueRet = `${override.query.shouldExportMutatorHooks ? "export " : ""}const use${
|
|
131
|
+
const vueRet = `${override.query.shouldExportMutatorHooks ? "export " : ""}const use${pascal(operationName)}Hook = () => {
|
|
160
132
|
const ${operationName} = ${mutator.name}<${response.definition.success || "unknown"}>();
|
|
161
133
|
|
|
162
134
|
return (\n ${propsImplementation}\n ${isRequestOptions && mutator.hasSecondArg ? `options${context.output.optionsParamRequired ? "" : "?"}: SecondParameter<ReturnType<typeof ${mutator.name}>>,` : ""}${hasSignal ? "signal?: AbortSignal\n" : ""}) => {${bodyForm}
|
|
@@ -177,8 +149,8 @@ const generateAxiosRequestFunction = ({ headers, queryParams, operationName, res
|
|
|
177
149
|
}
|
|
178
150
|
`;
|
|
179
151
|
}
|
|
180
|
-
const isSyntheticDefaultImportsAllowed =
|
|
181
|
-
const options =
|
|
152
|
+
const isSyntheticDefaultImportsAllowed = isSyntheticDefaultImportsAllow(context.output.tsconfig);
|
|
153
|
+
const options = generateOptions({
|
|
182
154
|
route,
|
|
183
155
|
body,
|
|
184
156
|
headers,
|
|
@@ -198,7 +170,7 @@ const generateAxiosRequestFunction = ({ headers, queryParams, operationName, res
|
|
|
198
170
|
isRequestOptions,
|
|
199
171
|
hasSignal
|
|
200
172
|
});
|
|
201
|
-
const queryProps =
|
|
173
|
+
const queryProps = toObjectString(props, "implementation");
|
|
202
174
|
return `${override.query.shouldExportHttpClient ? "export " : ""}const ${operationName} = (\n ${queryProps} ${optionsArgs} ): Promise<AxiosResponse<${response.definition.success || "unknown"}>> => {
|
|
203
175
|
${isVue$1 ? vueUnRefParams(props) : ""}
|
|
204
176
|
${bodyForm}
|
|
@@ -211,20 +183,20 @@ const generateRequestOptionsArguments = ({ isRequestOptions, hasSignal }) => {
|
|
|
211
183
|
return hasSignal ? "signal?: AbortSignal\n" : "";
|
|
212
184
|
};
|
|
213
185
|
const getQueryArgumentsRequestType = (httpClient, mutator) => {
|
|
214
|
-
if (!mutator) return httpClient ===
|
|
186
|
+
if (!mutator) return httpClient === OutputHttpClient.AXIOS ? `axios?: AxiosRequestConfig` : "fetch?: RequestInit";
|
|
215
187
|
if (mutator.hasSecondArg && !mutator.isHook) return `request?: SecondParameter<typeof ${mutator.name}>`;
|
|
216
188
|
if (mutator.hasSecondArg && mutator.isHook) return `request?: SecondParameter<ReturnType<typeof ${mutator.name}>>`;
|
|
217
189
|
return "";
|
|
218
190
|
};
|
|
219
191
|
const getQueryOptions = ({ isRequestOptions, mutator, isExactOptionalPropertyTypes, hasSignal, httpClient }) => {
|
|
220
192
|
if (!mutator && isRequestOptions) {
|
|
221
|
-
const options = httpClient ===
|
|
193
|
+
const options = httpClient === OutputHttpClient.AXIOS ? "axiosOptions" : "fetchOptions";
|
|
222
194
|
if (!hasSignal) return options;
|
|
223
195
|
return `{ ${isExactOptionalPropertyTypes ? "...(signal ? { signal } : {})" : "signal"}, ...${options} }`;
|
|
224
196
|
}
|
|
225
197
|
if (mutator?.hasSecondArg && isRequestOptions) {
|
|
226
198
|
if (!hasSignal) return "requestOptions";
|
|
227
|
-
return httpClient ===
|
|
199
|
+
return httpClient === OutputHttpClient.AXIOS ? "requestOptions, signal" : "{ signal, ...requestOptions }";
|
|
228
200
|
}
|
|
229
201
|
if (hasSignal) return "signal";
|
|
230
202
|
return "";
|
|
@@ -233,7 +205,7 @@ const getHookOptions = ({ isRequestOptions, httpClient, mutator }) => {
|
|
|
233
205
|
if (!isRequestOptions) return "";
|
|
234
206
|
let value = "const {query: queryOptions";
|
|
235
207
|
if (!mutator) {
|
|
236
|
-
const options = httpClient ===
|
|
208
|
+
const options = httpClient === OutputHttpClient.AXIOS ? ", axios: axiosOptions" : ", fetch: fetchOptions";
|
|
237
209
|
value += options;
|
|
238
210
|
}
|
|
239
211
|
if (mutator?.hasSecondArg) value += ", request: requestOptions";
|
|
@@ -246,28 +218,28 @@ const dedupeUnionTypes = (types) => {
|
|
|
246
218
|
};
|
|
247
219
|
const getQueryErrorType = (operationName, response, httpClient, mutator) => {
|
|
248
220
|
const errorsType = dedupeUnionTypes(response.definition.errors || "unknown");
|
|
249
|
-
if (mutator) return mutator.hasErrorType ? `${mutator.default ?
|
|
250
|
-
else return httpClient ===
|
|
221
|
+
if (mutator) return mutator.hasErrorType ? `${mutator.default ? pascal(operationName) : ""}ErrorType<${errorsType}>` : errorsType;
|
|
222
|
+
else return httpClient === OutputHttpClient.AXIOS ? `AxiosError<${errorsType}>` : errorsType;
|
|
251
223
|
};
|
|
252
224
|
const getHooksOptionImplementation = (isRequestOptions, httpClient, operationName, mutator) => {
|
|
253
|
-
const options = httpClient ===
|
|
225
|
+
const options = httpClient === OutputHttpClient.AXIOS ? ", axios: axiosOptions" : ", fetch: fetchOptions";
|
|
254
226
|
return isRequestOptions ? `const mutationKey = ['${operationName}'];
|
|
255
227
|
const {mutation: mutationOptions${mutator ? mutator?.hasSecondArg ? ", request: requestOptions" : "" : options}} = options ?
|
|
256
228
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
257
229
|
options
|
|
258
230
|
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
259
|
-
: {mutation: { mutationKey, }${mutator?.hasSecondArg ? ", request: undefined" : ""}${mutator ? "" : httpClient ===
|
|
231
|
+
: {mutation: { mutationKey, }${mutator?.hasSecondArg ? ", request: undefined" : ""}${mutator ? "" : httpClient === OutputHttpClient.AXIOS ? ", axios: undefined" : ", fetch: undefined"}};` : "";
|
|
260
232
|
};
|
|
261
233
|
const getMutationRequestArgs = (isRequestOptions, httpClient, mutator) => {
|
|
262
|
-
const options = httpClient ===
|
|
234
|
+
const options = httpClient === OutputHttpClient.AXIOS ? "axiosOptions" : "fetchOptions";
|
|
263
235
|
return isRequestOptions ? mutator ? mutator?.hasSecondArg ? "requestOptions" : "" : options : "";
|
|
264
236
|
};
|
|
265
237
|
const getHttpFunctionQueryProps = (isVue$1, httpClient, queryProperties) => {
|
|
266
|
-
if (isVue$1 && httpClient ===
|
|
238
|
+
if (isVue$1 && httpClient === OutputHttpClient.FETCH && queryProperties) return queryProperties.split(",").map((prop) => `unref(${prop})`).join(",");
|
|
267
239
|
return queryProperties;
|
|
268
240
|
};
|
|
269
241
|
const getQueryHeader = (params) => {
|
|
270
|
-
return params.output.httpClient ===
|
|
242
|
+
return params.output.httpClient === OutputHttpClient.FETCH ? generateFetchHeader(params) : "";
|
|
271
243
|
};
|
|
272
244
|
|
|
273
245
|
//#endregion
|
|
@@ -356,7 +328,7 @@ const isSvelteQueryV6 = (packageJson) => {
|
|
|
356
328
|
const getSvelteQueryDependencies = (hasGlobalMutator, hasParamsSerializerOptions, packageJson, httpClient) => {
|
|
357
329
|
const hasSvelteQueryV3 = isSvelteQueryV3(packageJson);
|
|
358
330
|
return [
|
|
359
|
-
...!hasGlobalMutator && httpClient ===
|
|
331
|
+
...!hasGlobalMutator && httpClient === OutputHttpClient.AXIOS ? AXIOS_DEPENDENCIES : [],
|
|
360
332
|
...hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : [],
|
|
361
333
|
...hasSvelteQueryV3 ? SVELTE_QUERY_DEPENDENCIES_V3 : SVELTE_QUERY_DEPENDENCIES
|
|
362
334
|
];
|
|
@@ -449,7 +421,7 @@ const getReactQueryDependencies = (hasGlobalMutator, hasParamsSerializerOptions,
|
|
|
449
421
|
const useReactQueryV3 = override?.query.version === void 0 ? hasReactQuery && !hasReactQueryV4 : override?.query.version <= 3;
|
|
450
422
|
return [
|
|
451
423
|
...hasGlobalMutator || hasTagsMutator ? REACT_DEPENDENCIES : [],
|
|
452
|
-
...!hasGlobalMutator && httpClient ===
|
|
424
|
+
...!hasGlobalMutator && httpClient === OutputHttpClient.AXIOS ? AXIOS_DEPENDENCIES : [],
|
|
453
425
|
...hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : [],
|
|
454
426
|
...useReactQueryV3 ? REACT_QUERY_DEPENDENCIES_V3 : REACT_QUERY_DEPENDENCIES
|
|
455
427
|
];
|
|
@@ -553,7 +525,7 @@ const isVueQueryV3 = (packageJson) => {
|
|
|
553
525
|
const getVueQueryDependencies = (hasGlobalMutator, hasParamsSerializerOptions, packageJson, httpClient) => {
|
|
554
526
|
const hasVueQueryV3 = isVueQueryV3(packageJson);
|
|
555
527
|
return [
|
|
556
|
-
...!hasGlobalMutator && httpClient ===
|
|
528
|
+
...!hasGlobalMutator && httpClient === OutputHttpClient.AXIOS ? AXIOS_DEPENDENCIES : [],
|
|
557
529
|
...hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : [],
|
|
558
530
|
...hasVueQueryV3 ? VUE_QUERY_DEPENDENCIES_V3 : VUE_QUERY_DEPENDENCIES
|
|
559
531
|
];
|
|
@@ -562,25 +534,25 @@ const isQueryV5 = (packageJson, queryClient) => {
|
|
|
562
534
|
const version = getPackageByQueryClient(packageJson, queryClient);
|
|
563
535
|
if (!version) return false;
|
|
564
536
|
const withoutRc = version.split("-")[0];
|
|
565
|
-
return
|
|
537
|
+
return compareVersions(withoutRc, "5.0.0");
|
|
566
538
|
};
|
|
567
539
|
const isQueryV6 = (packageJson, queryClient) => {
|
|
568
540
|
const version = getPackageByQueryClient(packageJson, queryClient);
|
|
569
541
|
if (!version) return false;
|
|
570
542
|
const withoutRc = version.split("-")[0];
|
|
571
|
-
return
|
|
543
|
+
return compareVersions(withoutRc, "6.0.0");
|
|
572
544
|
};
|
|
573
545
|
const isQueryV5WithDataTagError = (packageJson, queryClient) => {
|
|
574
546
|
const version = getPackageByQueryClient(packageJson, queryClient);
|
|
575
547
|
if (!version) return false;
|
|
576
548
|
const withoutRc = version.split("-")[0];
|
|
577
|
-
return
|
|
549
|
+
return compareVersions(withoutRc, "5.62.0");
|
|
578
550
|
};
|
|
579
551
|
const isQueryV5WithInfiniteQueryOptionsError = (packageJson, queryClient) => {
|
|
580
552
|
const version = getPackageByQueryClient(packageJson, queryClient);
|
|
581
553
|
if (!version) return false;
|
|
582
554
|
const withoutRc = version.split("-")[0];
|
|
583
|
-
return
|
|
555
|
+
return compareVersions(withoutRc, "5.80.0");
|
|
584
556
|
};
|
|
585
557
|
const getPackageByQueryClient = (packageJson, queryClient) => {
|
|
586
558
|
switch (queryClient) {
|
|
@@ -598,12 +570,12 @@ const QueryType = {
|
|
|
598
570
|
const INFINITE_QUERY_PROPERTIES = new Set(["getNextPageParam", "getPreviousPageParam"]);
|
|
599
571
|
const generateQueryOptions = ({ params, options, type, outputClient }) => {
|
|
600
572
|
if (options === false) return "";
|
|
601
|
-
const queryConfig =
|
|
573
|
+
const queryConfig = isObject(options) ? ` ${stringify(omitBy(options, (_, key) => (type !== QueryType.INFINITE || type !== QueryType.SUSPENSE_INFINITE) && INFINITE_QUERY_PROPERTIES.has(key)))?.slice(1, -1)}` : "";
|
|
602
574
|
if (params.length === 0 || isSuspenseQuery(type)) {
|
|
603
575
|
if (options) return `${queryConfig} ...queryOptions`;
|
|
604
576
|
return "...queryOptions";
|
|
605
577
|
}
|
|
606
|
-
return `${!
|
|
578
|
+
return `${!isObject(options) || !options.hasOwnProperty("enabled") ? isVue(outputClient) ? `enabled: computed(() => !!(${params.map(({ name }) => `unref(${name})`).join(" && ")})),` : `enabled: !!(${params.map(({ name }) => name).join(" && ")}),` : ""}${queryConfig} ...queryOptions`;
|
|
607
579
|
};
|
|
608
580
|
const isSuspenseQuery = (type) => {
|
|
609
581
|
return [QueryType.SUSPENSE_INFINITE, QueryType.SUSPENSE_QUERY].includes(type);
|
|
@@ -613,18 +585,18 @@ const getQueryOptionsDefinition = ({ operationName, mutator, definitions, type,
|
|
|
613
585
|
const prefix = hasSvelteQueryV4 ? "Create" : "Use";
|
|
614
586
|
const partialOptions = !isReturnType && hasQueryV5;
|
|
615
587
|
if (type) {
|
|
616
|
-
const funcReturnType = `Awaited<ReturnType<${isMutatorHook ? `ReturnType<typeof use${
|
|
588
|
+
const funcReturnType = `Awaited<ReturnType<${isMutatorHook ? `ReturnType<typeof use${pascal(operationName)}Hook>` : `typeof ${operationName}`}>>`;
|
|
617
589
|
const optionTypeInitialDataPostfix = initialData && !isSuspenseQuery(type) ? ` & Pick<
|
|
618
|
-
${
|
|
590
|
+
${pascal(initialData)}InitialDataOptions<
|
|
619
591
|
${funcReturnType},
|
|
620
592
|
TError,
|
|
621
593
|
${funcReturnType}${hasQueryV5 && (type === QueryType.INFINITE || type === QueryType.SUSPENSE_INFINITE) && queryParam && queryParams ? `, QueryKey` : ""}
|
|
622
594
|
> , 'initialData'
|
|
623
595
|
>` : "";
|
|
624
|
-
const optionType = `${prefix}${
|
|
596
|
+
const optionType = `${prefix}${pascal(type)}Options<${funcReturnType}, TError, TData${hasQueryV5 && (type === QueryType.INFINITE || type === QueryType.SUSPENSE_INFINITE) && queryParam && queryParams ? hasQueryV5WithInfiniteQueryOptionsError ? `, QueryKey, ${queryParams?.schema.name}['${queryParam}']` : `, ${funcReturnType}, QueryKey, ${queryParams?.schema.name}['${queryParam}']` : ""}>`;
|
|
625
597
|
return `${partialOptions ? "Partial<" : ""}${optionType}${partialOptions ? ">" : ""}${optionTypeInitialDataPostfix}`;
|
|
626
598
|
}
|
|
627
|
-
return `${prefix}MutationOptions<Awaited<ReturnType<${isMutatorHook ? `ReturnType<typeof use${
|
|
599
|
+
return `${prefix}MutationOptions<Awaited<ReturnType<${isMutatorHook ? `ReturnType<typeof use${pascal(operationName)}Hook>` : `typeof ${operationName}`}>>, TError,${definitions ? `{${definitions}}` : "void"}, TContext>`;
|
|
628
600
|
};
|
|
629
601
|
const generateQueryArguments = ({ operationName, definitions, mutator, isRequestOptions, type, hasSvelteQueryV4, hasQueryV5, hasQueryV5WithInfiniteQueryOptionsError, queryParams, queryParam, initialData, httpClient }) => {
|
|
630
602
|
const definition = getQueryOptionsDefinition({
|
|
@@ -647,31 +619,31 @@ const generateQueryArguments = ({ operationName, definitions, mutator, isRequest
|
|
|
647
619
|
};
|
|
648
620
|
const generateQueryReturnType = ({ outputClient, type, isMutatorHook, operationName, hasVueQueryV4, hasSvelteQueryV4, hasQueryV5, hasQueryV5WithDataTagError, isInitialDataDefined }) => {
|
|
649
621
|
switch (outputClient) {
|
|
650
|
-
case
|
|
651
|
-
if (!hasSvelteQueryV4) return `Use${
|
|
652
|
-
return `Create${
|
|
653
|
-
case
|
|
654
|
-
if (!hasVueQueryV4) return ` UseQueryReturnType<TData, TError, Use${
|
|
622
|
+
case OutputClient.SVELTE_QUERY:
|
|
623
|
+
if (!hasSvelteQueryV4) return `Use${pascal(type)}StoreResult<Awaited<ReturnType<${isMutatorHook ? `ReturnType<typeof use${pascal(operationName)}Hook>` : `typeof ${operationName}`}>>, TError, TData, QueryKey> & { queryKey: QueryKey} }`;
|
|
624
|
+
return `Create${pascal(type)}Result<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ", TError" : ""}>` : "QueryKey"} }`;
|
|
625
|
+
case OutputClient.VUE_QUERY:
|
|
626
|
+
if (!hasVueQueryV4) return ` UseQueryReturnType<TData, TError, Use${pascal(type)}Result<TData, TError>> & { queryKey: QueryKey} }`;
|
|
655
627
|
if (type !== QueryType.INFINITE && type !== QueryType.SUSPENSE_INFINITE) return `UseQueryReturnType<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ", TError" : ""}>` : "QueryKey"} }`;
|
|
656
628
|
return `UseInfiniteQueryReturnType<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ", TError" : ""}>` : "QueryKey"} }`;
|
|
657
|
-
case
|
|
658
|
-
default: return ` ${isInitialDataDefined && !isSuspenseQuery(type) ? "Defined" : ""}Use${
|
|
629
|
+
case OutputClient.REACT_QUERY:
|
|
630
|
+
default: return ` ${isInitialDataDefined && !isSuspenseQuery(type) ? "Defined" : ""}Use${pascal(type)}Result<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ", TError" : ""}>` : "QueryKey"} }`;
|
|
659
631
|
}
|
|
660
632
|
};
|
|
661
633
|
const generateMutatorReturnType = ({ outputClient, dataType, variableType }) => {
|
|
662
|
-
if (outputClient ===
|
|
634
|
+
if (outputClient === OutputClient.REACT_QUERY) return `: UseMutationResult<
|
|
663
635
|
Awaited<ReturnType<${dataType}>>,
|
|
664
636
|
TError,
|
|
665
637
|
${variableType},
|
|
666
638
|
TContext
|
|
667
639
|
>`;
|
|
668
|
-
if (outputClient ===
|
|
640
|
+
if (outputClient === OutputClient.SVELTE_QUERY) return `: CreateMutationResult<
|
|
669
641
|
Awaited<ReturnType<${dataType}>>,
|
|
670
642
|
TError,
|
|
671
643
|
${variableType},
|
|
672
644
|
TContext
|
|
673
645
|
>`;
|
|
674
|
-
if (outputClient ===
|
|
646
|
+
if (outputClient === OutputClient.VUE_QUERY) return `: UseMutationReturnType<
|
|
675
647
|
Awaited<ReturnType<${dataType}>>,
|
|
676
648
|
TError,
|
|
677
649
|
${variableType},
|
|
@@ -690,10 +662,8 @@ const getQueryFnArguments = ({ hasQueryParam, hasSignal }) => {
|
|
|
690
662
|
const generatePrefetch = ({ usePrefetch, type, useQuery, useInfinite, operationName, mutator, doc, queryProps, dataType, errorType, queryArguments, queryOptionsVarName, queryOptionsFnName, queryProperties, isRequestOptions, hasSvelteQueryV6 }) => {
|
|
691
663
|
if (!(usePrefetch && (type === QueryType.QUERY || type === QueryType.INFINITE || type === QueryType.SUSPENSE_QUERY && !useQuery || type === QueryType.SUSPENSE_INFINITE && !useInfinite))) return "";
|
|
692
664
|
const prefetchType = type === QueryType.QUERY || type === QueryType.SUSPENSE_QUERY ? "query" : "infinite-query";
|
|
693
|
-
const prefetchFnName =
|
|
694
|
-
if (mutator?.isHook) {
|
|
695
|
-
const prefetchVarName = (0, __orval_core.camel)(`use-prefetch-${operationName}-${prefetchType}`);
|
|
696
|
-
return `${doc}export const ${prefetchVarName} = <TData = Awaited<ReturnType<${dataType}>>, TError = ${errorType}>(${queryProps} ${queryArguments}) => {
|
|
665
|
+
const prefetchFnName = camel(`prefetch-${prefetchType}`);
|
|
666
|
+
if (mutator?.isHook) return `${doc}export const ${camel(`use-prefetch-${operationName}-${prefetchType}`)} = <TData = Awaited<ReturnType<${dataType}>>, TError = ${errorType}>(${queryProps} ${queryArguments}) => {
|
|
697
667
|
const queryClient = useQueryClient();
|
|
698
668
|
const ${queryOptionsVarName} = ${queryOptionsFnName}(${queryProperties}${queryProperties ? "," : ""}${isRequestOptions ? "options" : "queryOptions"})
|
|
699
669
|
return useCallback(async (): Promise<QueryClient> => {
|
|
@@ -701,9 +671,7 @@ const generatePrefetch = ({ usePrefetch, type, useQuery, useInfinite, operationN
|
|
|
701
671
|
return queryClient;
|
|
702
672
|
},[queryClient, ${queryOptionsVarName}]);
|
|
703
673
|
};\n`;
|
|
704
|
-
}
|
|
705
|
-
const prefetchVarName = (0, __orval_core.camel)(`prefetch-${operationName}-${prefetchType}`);
|
|
706
|
-
return `${doc}export const ${prefetchVarName} = async <TData = Awaited<ReturnType<${dataType}>>, TError = ${errorType}>(\n queryClient: QueryClient, ${queryProps} ${queryArguments}\n ): Promise<QueryClient> => {
|
|
674
|
+
else return `${doc}export const ${camel(`prefetch-${operationName}-${prefetchType}`)} = async <TData = Awaited<ReturnType<${dataType}>>, TError = ${errorType}>(\n queryClient: QueryClient, ${queryProps} ${queryArguments}\n ): Promise<QueryClient> => {
|
|
707
675
|
|
|
708
676
|
const ${queryOptionsVarName} = ${queryOptionsFnName}(${queryProperties}${queryProperties ? "," : ""}${isRequestOptions ? "options" : "queryOptions"})
|
|
709
677
|
|
|
@@ -711,11 +679,10 @@ const generatePrefetch = ({ usePrefetch, type, useQuery, useInfinite, operationN
|
|
|
711
679
|
|
|
712
680
|
return queryClient;
|
|
713
681
|
}\n`;
|
|
714
|
-
}
|
|
715
682
|
};
|
|
716
683
|
const generateQueryImplementation = ({ queryOption: { name, queryParam, options, type, queryKeyFnName }, operationName, queryProperties, queryKeyProperties, queryParams, params, props, mutator, queryOptionsMutator, queryKeyMutator, isRequestOptions, response, outputClient, httpClient, isExactOptionalPropertyTypes, hasSignal, route, hasVueQueryV4, hasSvelteQueryV4, hasSvelteQueryV6, hasQueryV5, hasQueryV5WithDataTagError, hasQueryV5WithInfiniteQueryOptionsError, doc, usePrefetch, useQuery, useInfinite, useInvalidate }) => {
|
|
717
|
-
const queryPropDefinitions =
|
|
718
|
-
const definedInitialDataQueryPropsDefinitions =
|
|
684
|
+
const queryPropDefinitions = toObjectString(props, "definition");
|
|
685
|
+
const definedInitialDataQueryPropsDefinitions = toObjectString(props.map((prop) => {
|
|
719
686
|
const regex = /* @__PURE__ */ new RegExp(`^${prop.name}\\s*\\?:`);
|
|
720
687
|
if (!regex.test(prop.definition)) return prop;
|
|
721
688
|
const definitionWithUndefined = prop.definition.replace(regex, `${prop.name}: undefined | `);
|
|
@@ -724,10 +691,10 @@ const generateQueryImplementation = ({ queryOption: { name, queryParam, options,
|
|
|
724
691
|
definition: definitionWithUndefined
|
|
725
692
|
};
|
|
726
693
|
}), "definition");
|
|
727
|
-
const queryProps =
|
|
694
|
+
const queryProps = toObjectString(props, "implementation");
|
|
728
695
|
const hasInfiniteQueryParam = queryParam && queryParams?.schema.name;
|
|
729
696
|
const httpFunctionProps = queryParam ? props.map((param) => {
|
|
730
|
-
if (param.type ===
|
|
697
|
+
if (param.type === GetterPropType.NAMED_PATH_PARAMS && !isVue(outputClient)) return param.destructured;
|
|
731
698
|
return param.name === "params" ? `{...${isVue(outputClient) ? `unref(params)` : "params"}, '${queryParam}': pageParam || ${isVue(outputClient) ? `unref(params)?.['${queryParam}']` : `params?.['${queryParam}']`}}` : param.name;
|
|
732
699
|
}).join(",") : getHttpFunctionQueryProps(isVue(outputClient), httpClient, queryProperties);
|
|
733
700
|
const definedInitialDataReturnType = generateQueryReturnType({
|
|
@@ -752,7 +719,7 @@ const generateQueryImplementation = ({ queryOption: { name, queryParam, options,
|
|
|
752
719
|
hasQueryV5WithDataTagError
|
|
753
720
|
});
|
|
754
721
|
const errorType = getQueryErrorType(operationName, response, httpClient, mutator);
|
|
755
|
-
const dataType = mutator?.isHook ? `ReturnType<typeof use${
|
|
722
|
+
const dataType = mutator?.isHook ? `ReturnType<typeof use${pascal(operationName)}Hook>` : `typeof ${operationName}`;
|
|
756
723
|
const definedInitialDataQueryArguments = generateQueryArguments({
|
|
757
724
|
operationName,
|
|
758
725
|
mutator,
|
|
@@ -828,7 +795,7 @@ const generateQueryImplementation = ({ queryOption: { name, queryParam, options,
|
|
|
828
795
|
type,
|
|
829
796
|
outputClient
|
|
830
797
|
});
|
|
831
|
-
const queryOptionsFnName =
|
|
798
|
+
const queryOptionsFnName = camel(queryKeyMutator || queryOptionsMutator || mutator?.isHook ? `use-${name}-queryOptions` : `get-${name}-queryOptions`);
|
|
832
799
|
const queryOptionsVarName = isRequestOptions ? "queryOptions" : "options";
|
|
833
800
|
const queryResultVarName = props.some((prop) => prop.name === "query") ? "_query" : "query";
|
|
834
801
|
const infiniteParam = queryParams && queryParam ? `, ${queryParams?.schema.name}['${queryParam}']` : "";
|
|
@@ -839,11 +806,11 @@ ${hookOptions}
|
|
|
839
806
|
|
|
840
807
|
const queryKey = ${queryKeyMutator ? `${queryKeyMutator.name}({ ${queryProperties} }${queryKeyMutator.hasSecondArg ? `, { url: \`${route}\`, queryOptions }` : ""});` : `${hasVueQueryV4 ? "" : "queryOptions?.queryKey ?? "}${queryKeyFnName}(${queryKeyProperties});`}
|
|
841
808
|
|
|
842
|
-
${mutator?.isHook ? `const ${operationName} = use${
|
|
809
|
+
${mutator?.isHook ? `const ${operationName} = use${pascal(operationName)}Hook();` : ""}
|
|
843
810
|
|
|
844
|
-
const queryFn: QueryFunction<Awaited<ReturnType<${mutator?.isHook ? `ReturnType<typeof use${
|
|
811
|
+
const queryFn: QueryFunction<Awaited<ReturnType<${mutator?.isHook ? `ReturnType<typeof use${pascal(operationName)}Hook>` : `typeof ${operationName}`}>>${hasQueryV5 && hasInfiniteQueryParam ? `, QueryKey, ${queryParams?.schema.name}['${queryParam}']` : ""}> = (${queryFnArguments}) => ${operationName}(${httpFunctionProps}${httpFunctionProps ? ", " : ""}${queryOptions});
|
|
845
812
|
|
|
846
|
-
${isVue(outputClient) ? vueUnRefParams(props.filter((prop) => prop.type ===
|
|
813
|
+
${isVue(outputClient) ? vueUnRefParams(props.filter((prop) => prop.type === GetterPropType.NAMED_PATH_PARAMS)) : ""}
|
|
847
814
|
|
|
848
815
|
${queryOptionsMutator ? `const customOptions = ${queryOptionsMutator.name}({...queryOptions, queryKey, queryFn}${queryOptionsMutator.hasSecondArg ? `, { ${queryProperties} }` : ""}${queryOptionsMutator.hasThirdArg ? `, { url: \`${route}\` }` : ""});` : ""}
|
|
849
816
|
|
|
@@ -851,7 +818,7 @@ ${hookOptions}
|
|
|
851
818
|
}`;
|
|
852
819
|
const operationPrefix = hasSvelteQueryV4 ? "create" : "use";
|
|
853
820
|
const optionalQueryClientArgument = hasQueryV5 ? ", queryClient?: QueryClient" : "";
|
|
854
|
-
const queryHookName =
|
|
821
|
+
const queryHookName = camel(`${operationPrefix}-${name}`);
|
|
855
822
|
const overrideTypes = `
|
|
856
823
|
export function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\n ${definedInitialDataQueryPropsDefinitions} ${definedInitialDataQueryArguments} ${optionalQueryClientArgument}\n ): ${definedInitialDataReturnType}
|
|
857
824
|
export function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\n ${queryPropDefinitions} ${undefinedInitialDataQueryArguments} ${optionalQueryClientArgument}\n ): ${returnType}
|
|
@@ -875,20 +842,20 @@ export function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\n ${q
|
|
|
875
842
|
doc
|
|
876
843
|
});
|
|
877
844
|
const shouldGenerateInvalidate = useInvalidate && (type === QueryType.QUERY || type === QueryType.INFINITE || type === QueryType.SUSPENSE_QUERY && !useQuery || type === QueryType.SUSPENSE_INFINITE && !useInfinite);
|
|
878
|
-
const invalidateFnName =
|
|
845
|
+
const invalidateFnName = camel(`invalidate-${operationName}`);
|
|
879
846
|
return `
|
|
880
847
|
${queryOptionsFn}
|
|
881
848
|
|
|
882
|
-
export type ${
|
|
883
|
-
export type ${
|
|
849
|
+
export type ${pascal(name)}QueryResult = NonNullable<Awaited<ReturnType<${dataType}>>>
|
|
850
|
+
export type ${pascal(name)}QueryError = ${errorType}
|
|
884
851
|
|
|
885
|
-
${hasQueryV5 &&
|
|
852
|
+
${hasQueryV5 && OutputClient.REACT_QUERY === outputClient ? overrideTypes : ""}
|
|
886
853
|
${doc}
|
|
887
854
|
export function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\n ${queryProps} ${queryArguments} ${optionalQueryClientArgument} \n ): ${returnType} {
|
|
888
855
|
|
|
889
856
|
const ${queryOptionsVarName} = ${queryOptionsFnName}(${queryProperties}${queryProperties ? "," : ""}${isRequestOptions ? "options" : "queryOptions"})
|
|
890
857
|
|
|
891
|
-
const ${queryResultVarName} = ${
|
|
858
|
+
const ${queryResultVarName} = ${camel(`${operationPrefix}-${type}`)}(${hasSvelteQueryV6 ? `() => ({ ...${queryOptionsVarName}${optionalQueryClientArgument ? ", queryClient" : ""} })` : `${queryOptionsVarName}${optionalQueryClientArgument ? ", queryClient" : ""}`}) as ${returnType};
|
|
892
859
|
|
|
893
860
|
${queryResultVarName}.queryKey = ${isVue(outputClient) ? `unref(${queryOptionsVarName})` : queryOptionsVarName}.queryKey ${isVue(outputClient) ? `as ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ", TError" : ""}>` : "QueryKey"}` : ""};
|
|
894
861
|
|
|
@@ -911,34 +878,34 @@ const generateQueryHook = async ({ queryParams, operationName, body, props: _pro
|
|
|
911
878
|
const operationQueryOptions = operations[operationId]?.query;
|
|
912
879
|
const isExactOptionalPropertyTypes = !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;
|
|
913
880
|
const queryVersion = override.query.version ?? query?.version;
|
|
914
|
-
const hasVueQueryV4 =
|
|
915
|
-
const hasSvelteQueryV4 =
|
|
916
|
-
const hasSvelteQueryV6 =
|
|
881
|
+
const hasVueQueryV4 = OutputClient.VUE_QUERY === outputClient && (!isVueQueryV3(context.output.packageJson) || queryVersion === 4);
|
|
882
|
+
const hasSvelteQueryV4 = OutputClient.SVELTE_QUERY === outputClient && (!isSvelteQueryV3(context.output.packageJson) || queryVersion === 4);
|
|
883
|
+
const hasSvelteQueryV6 = OutputClient.SVELTE_QUERY === outputClient && isSvelteQueryV6(context.output.packageJson);
|
|
917
884
|
const hasQueryV5 = queryVersion === 5 || isQueryV5(context.output.packageJson, outputClient);
|
|
918
885
|
const hasQueryV5WithDataTagError = queryVersion === 5 || isQueryV5WithDataTagError(context.output.packageJson, outputClient);
|
|
919
886
|
const hasQueryV5WithInfiniteQueryOptionsError = queryVersion === 5 || isQueryV5WithInfiniteQueryOptionsError(context.output.packageJson, outputClient);
|
|
920
887
|
const httpClient = context.output.httpClient;
|
|
921
|
-
const doc =
|
|
888
|
+
const doc = jsDoc({
|
|
922
889
|
summary,
|
|
923
890
|
deprecated
|
|
924
891
|
});
|
|
925
892
|
let implementation = "";
|
|
926
893
|
let mutators;
|
|
927
894
|
const hasOperationQueryOption = !!(operationQueryOptions && (operationQueryOptions.useQuery || operationQueryOptions.useSuspenseQuery || operationQueryOptions.useInfinite || operationQueryOptions.useSuspenseInfiniteQuery));
|
|
928
|
-
let isQuery =
|
|
929
|
-
let isMutation = override.query.useMutation && verb !==
|
|
895
|
+
let isQuery = Verbs.GET === verb && (override.query.useQuery || override.query.useSuspenseQuery || override.query.useInfinite || override.query.useSuspenseInfiniteQuery) || hasOperationQueryOption;
|
|
896
|
+
let isMutation = override.query.useMutation && verb !== Verbs.GET;
|
|
930
897
|
if (operationQueryOptions?.useMutation !== void 0) isMutation = operationQueryOptions.useMutation;
|
|
931
|
-
if (verb !==
|
|
932
|
-
if (verb ===
|
|
898
|
+
if (verb !== Verbs.GET && isQuery) isMutation = false;
|
|
899
|
+
if (verb === Verbs.GET && isMutation) isQuery = false;
|
|
933
900
|
if (isQuery) {
|
|
934
|
-
const queryKeyMutator = query.queryKey ? await
|
|
901
|
+
const queryKeyMutator = query.queryKey ? await generateMutator({
|
|
935
902
|
output,
|
|
936
903
|
mutator: query.queryKey,
|
|
937
904
|
name: `${operationName}QueryKey`,
|
|
938
905
|
workspace: context.workspace,
|
|
939
906
|
tsconfig: context.output.tsconfig
|
|
940
907
|
}) : void 0;
|
|
941
|
-
const queryOptionsMutator = query.queryOptions ? await
|
|
908
|
+
const queryOptionsMutator = query.queryOptions ? await generateMutator({
|
|
942
909
|
output,
|
|
943
910
|
mutator: query.queryOptions,
|
|
944
911
|
name: `${operationName}QueryOptions`,
|
|
@@ -946,39 +913,39 @@ const generateQueryHook = async ({ queryParams, operationName, body, props: _pro
|
|
|
946
913
|
tsconfig: context.output.tsconfig
|
|
947
914
|
}) : void 0;
|
|
948
915
|
const queryProperties = props.map((param) => {
|
|
949
|
-
if (param.type ===
|
|
950
|
-
return param.type ===
|
|
916
|
+
if (param.type === GetterPropType.NAMED_PATH_PARAMS && !isVue(outputClient)) return param.destructured;
|
|
917
|
+
return param.type === GetterPropType.BODY ? body.implementation : param.name;
|
|
951
918
|
}).join(",");
|
|
952
|
-
const queryKeyProperties = props.filter((prop) => prop.type !==
|
|
953
|
-
if (param.type ===
|
|
954
|
-
return param.type ===
|
|
919
|
+
const queryKeyProperties = props.filter((prop) => prop.type !== GetterPropType.HEADER).map((param) => {
|
|
920
|
+
if (param.type === GetterPropType.NAMED_PATH_PARAMS && !isVue(outputClient)) return param.destructured;
|
|
921
|
+
return param.type === GetterPropType.BODY ? body.implementation : param.name;
|
|
955
922
|
}).join(",");
|
|
956
923
|
const queries = [
|
|
957
924
|
...query?.useInfinite || operationQueryOptions?.useInfinite ? [{
|
|
958
|
-
name:
|
|
925
|
+
name: camel(`${operationName}-infinite`),
|
|
959
926
|
options: query?.options,
|
|
960
927
|
type: QueryType.INFINITE,
|
|
961
928
|
queryParam: query?.useInfiniteQueryParam,
|
|
962
|
-
queryKeyFnName:
|
|
929
|
+
queryKeyFnName: camel(`get-${operationName}-infinite-query-key`)
|
|
963
930
|
}] : [],
|
|
964
931
|
...query?.useQuery || operationQueryOptions?.useQuery ? [{
|
|
965
932
|
name: operationName,
|
|
966
933
|
options: query?.options,
|
|
967
934
|
type: QueryType.QUERY,
|
|
968
|
-
queryKeyFnName:
|
|
935
|
+
queryKeyFnName: camel(`get-${operationName}-query-key`)
|
|
969
936
|
}] : [],
|
|
970
937
|
...query?.useSuspenseQuery || operationQueryOptions?.useSuspenseQuery ? [{
|
|
971
|
-
name:
|
|
938
|
+
name: camel(`${operationName}-suspense`),
|
|
972
939
|
options: query?.options,
|
|
973
940
|
type: QueryType.SUSPENSE_QUERY,
|
|
974
|
-
queryKeyFnName:
|
|
941
|
+
queryKeyFnName: camel(`get-${operationName}-query-key`)
|
|
975
942
|
}] : [],
|
|
976
943
|
...query?.useSuspenseInfiniteQuery || operationQueryOptions?.useSuspenseInfiniteQuery ? [{
|
|
977
|
-
name:
|
|
944
|
+
name: camel(`${operationName}-suspense-infinite`),
|
|
978
945
|
options: query?.options,
|
|
979
946
|
type: QueryType.SUSPENSE_INFINITE,
|
|
980
947
|
queryParam: query?.useInfiniteQueryParam,
|
|
981
|
-
queryKeyFnName:
|
|
948
|
+
queryKeyFnName: camel(`get-${operationName}-infinite-query-key`)
|
|
982
949
|
}] : []
|
|
983
950
|
];
|
|
984
951
|
const makeParamsOptional = (params$1) => {
|
|
@@ -990,11 +957,11 @@ const generateQueryHook = async ({ queryParams, operationName, body, props: _pro
|
|
|
990
957
|
};
|
|
991
958
|
const uniqueQueryOptionsByKeys = queries.filter((obj, index, self) => index === self.findIndex((t) => t.queryKeyFnName === obj.queryKeyFnName));
|
|
992
959
|
implementation += `
|
|
993
|
-
${
|
|
994
|
-
const queryKeyProps = makeParamsOptional(
|
|
995
|
-
const routeString = isVue(outputClient) || override.query.shouldSplitQueryKey ?
|
|
960
|
+
${queryKeyMutator ? "" : uniqueQueryOptionsByKeys.reduce((acc, queryOption) => {
|
|
961
|
+
const queryKeyProps = makeParamsOptional(toObjectString(props.filter((prop) => prop.type !== GetterPropType.HEADER), "implementation"));
|
|
962
|
+
const routeString = isVue(outputClient) || override.query.shouldSplitQueryKey ? getRouteAsArray(route) : `\`${route}\``;
|
|
996
963
|
const queryKeyIdentifier = override.query.useOperationIdAsQueryKey ? `"${operationName}"` : routeString;
|
|
997
|
-
|
|
964
|
+
return acc + `
|
|
998
965
|
${override.query.shouldExportQueryKey ? "export " : ""}const ${queryOption.queryKeyFnName} = (${queryKeyProps}) => {
|
|
999
966
|
return [
|
|
1000
967
|
${[
|
|
@@ -1006,8 +973,7 @@ ${override.query.shouldExportQueryKey ? "export " : ""}const ${queryOption.query
|
|
|
1006
973
|
] as const;
|
|
1007
974
|
}
|
|
1008
975
|
`;
|
|
1009
|
-
|
|
1010
|
-
}, "") : ""}`;
|
|
976
|
+
}, "")}`;
|
|
1011
977
|
implementation += `
|
|
1012
978
|
${queries.reduce((acc, queryOption) => {
|
|
1013
979
|
return acc + generateQueryImplementation({
|
|
@@ -1048,17 +1014,17 @@ ${override.query.shouldExportQueryKey ? "export " : ""}const ${queryOption.query
|
|
|
1048
1014
|
mutators = queryOptionsMutator || queryKeyMutator ? [...queryOptionsMutator ? [queryOptionsMutator] : [], ...queryKeyMutator ? [queryKeyMutator] : []] : void 0;
|
|
1049
1015
|
}
|
|
1050
1016
|
if (isMutation) {
|
|
1051
|
-
const mutationOptionsMutator = query.mutationOptions ? await
|
|
1017
|
+
const mutationOptionsMutator = query.mutationOptions ? await generateMutator({
|
|
1052
1018
|
output,
|
|
1053
1019
|
mutator: query.mutationOptions,
|
|
1054
1020
|
name: `${operationName}MutationOptions`,
|
|
1055
1021
|
workspace: context.workspace,
|
|
1056
1022
|
tsconfig: context.output.tsconfig
|
|
1057
1023
|
}) : void 0;
|
|
1058
|
-
const definitions = props.map(({ definition, type }) => type ===
|
|
1059
|
-
const properties = props.map(({ name, type }) => type ===
|
|
1024
|
+
const definitions = props.map(({ definition, type }) => type === GetterPropType.BODY ? mutator?.bodyTypeName ? `data: ${mutator.bodyTypeName}<${body.definition}>` : `data: ${body.definition}` : definition).join(";");
|
|
1025
|
+
const properties = props.map(({ name, type }) => type === GetterPropType.BODY ? "data" : name).join(",");
|
|
1060
1026
|
const errorType = getQueryErrorType(operationName, response, httpClient, mutator);
|
|
1061
|
-
const dataType = mutator?.isHook ? `ReturnType<typeof use${
|
|
1027
|
+
const dataType = mutator?.isHook ? `ReturnType<typeof use${pascal(operationName)}Hook>` : `typeof ${operationName}`;
|
|
1062
1028
|
const mutationOptionFnReturnType = getQueryOptionsDefinition({
|
|
1063
1029
|
operationName,
|
|
1064
1030
|
mutator,
|
|
@@ -1078,15 +1044,14 @@ ${override.query.shouldExportQueryKey ? "export " : ""}const ${queryOption.query
|
|
|
1078
1044
|
hasQueryV5WithInfiniteQueryOptionsError,
|
|
1079
1045
|
httpClient
|
|
1080
1046
|
});
|
|
1081
|
-
const mutationOptionsFnName =
|
|
1047
|
+
const mutationOptionsFnName = camel(mutationOptionsMutator || mutator?.isHook ? `use-${operationName}-mutationOptions` : `get-${operationName}-mutationOptions`);
|
|
1082
1048
|
const mutationOptionsVarName = isRequestOptions ? "mutationOptions" : "options";
|
|
1083
|
-
const hooksOptionImplementation = getHooksOptionImplementation(isRequestOptions, httpClient, (0, __orval_core.camel)(operationName), mutator);
|
|
1084
1049
|
const mutationOptionsFn = `export const ${mutationOptionsFnName} = <TError = ${errorType},
|
|
1085
1050
|
TContext = unknown>(${mutationArguments}): ${mutationOptionFnReturnType} => {
|
|
1086
1051
|
|
|
1087
|
-
${
|
|
1052
|
+
${getHooksOptionImplementation(isRequestOptions, httpClient, camel(operationName), mutator)}
|
|
1088
1053
|
|
|
1089
|
-
${mutator?.isHook ? `const ${operationName} = use${
|
|
1054
|
+
${mutator?.isHook ? `const ${operationName} = use${pascal(operationName)}Hook()` : ""}
|
|
1090
1055
|
|
|
1091
1056
|
|
|
1092
1057
|
const mutationFn: MutationFunction<Awaited<ReturnType<${dataType}>>, ${definitions ? `{${definitions}}` : "void"}> = (${properties ? "props" : ""}) => {
|
|
@@ -1104,11 +1069,11 @@ ${hooksOptionImplementation}
|
|
|
1104
1069
|
implementation += `
|
|
1105
1070
|
${mutationOptionsFn}
|
|
1106
1071
|
|
|
1107
|
-
export type ${
|
|
1108
|
-
${body.definition ? `export type ${
|
|
1109
|
-
export type ${
|
|
1072
|
+
export type ${pascal(operationName)}MutationResult = NonNullable<Awaited<ReturnType<${dataType}>>>
|
|
1073
|
+
${body.definition ? `export type ${pascal(operationName)}MutationBody = ${mutator?.bodyTypeName ? `${mutator.bodyTypeName}<${body.definition}>` : body.definition}` : ""}
|
|
1074
|
+
export type ${pascal(operationName)}MutationError = ${errorType}
|
|
1110
1075
|
|
|
1111
|
-
${doc}export const ${
|
|
1076
|
+
${doc}export const ${camel(`${operationPrefix}-${operationName}`)} = <TError = ${errorType},
|
|
1112
1077
|
TContext = unknown>(${mutationArguments} ${optionalQueryClientArgument})${generateMutatorReturnType({
|
|
1113
1078
|
outputClient,
|
|
1114
1079
|
dataType,
|
|
@@ -1135,7 +1100,7 @@ ${getQueryHeader(params)}
|
|
|
1135
1100
|
`;
|
|
1136
1101
|
};
|
|
1137
1102
|
const generateQuery = async (verbOptions, options, outputClient) => {
|
|
1138
|
-
const imports =
|
|
1103
|
+
const imports = generateVerbImports(verbOptions);
|
|
1139
1104
|
const functionImplementation = generateQueryRequestFunction(verbOptions, options, isVue(outputClient));
|
|
1140
1105
|
const { implementation: hookImplementation, mutators } = await generateQueryHook(verbOptions, options, outputClient);
|
|
1141
1106
|
return {
|
|
@@ -1154,8 +1119,8 @@ const builder = ({ type = "react-query", options: queryOptions, output } = {}) =
|
|
|
1154
1119
|
if (options.override.useNamedParameters && (type === "vue-query" || outputClient === "vue-query")) throw new Error(`vue-query client does not support named parameters, and had broken reactivity previously, please set useNamedParameters to false; See for context: https://github.com/orval-labs/orval/pull/931#issuecomment-1752355686`);
|
|
1155
1120
|
if (queryOptions) {
|
|
1156
1121
|
const normalizedQueryOptions = normalizeQueryOptions(queryOptions, options.context.workspace);
|
|
1157
|
-
verbOptions.override.query =
|
|
1158
|
-
options.override.query =
|
|
1122
|
+
verbOptions.override.query = mergeDeep(normalizedQueryOptions, verbOptions.override.query);
|
|
1123
|
+
options.override.query = mergeDeep(normalizedQueryOptions, verbOptions.override.query);
|
|
1159
1124
|
}
|
|
1160
1125
|
return generateQuery(verbOptions, options, outputClient, output);
|
|
1161
1126
|
};
|
|
@@ -1168,11 +1133,5 @@ const builder = ({ type = "react-query", options: queryOptions, output } = {}) =
|
|
|
1168
1133
|
var src_default = builder;
|
|
1169
1134
|
|
|
1170
1135
|
//#endregion
|
|
1171
|
-
|
|
1172
|
-
exports.default = src_default;
|
|
1173
|
-
exports.generateQuery = generateQuery;
|
|
1174
|
-
exports.generateQueryHeader = generateQueryHeader;
|
|
1175
|
-
exports.getReactQueryDependencies = getReactQueryDependencies;
|
|
1176
|
-
exports.getSvelteQueryDependencies = getSvelteQueryDependencies;
|
|
1177
|
-
exports.getVueQueryDependencies = getVueQueryDependencies;
|
|
1136
|
+
export { builder, src_default as default, generateQuery, generateQueryHeader, getReactQueryDependencies, getSvelteQueryDependencies, getVueQueryDependencies };
|
|
1178
1137
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["upath","GetterPropType","TEMPLATE_TAG_REGEX","OutputClient","Verbs","AXIOS_DEPENDENCIES: GeneratorDependency[]","OutputHttpClient","isVue","getQueryHeader: ClientHeaderBuilder","REACT_DEPENDENCIES: GeneratorDependency[]","PARAMS_SERIALIZER_DEPENDENCIES: GeneratorDependency[]","SVELTE_QUERY_DEPENDENCIES_V3: GeneratorDependency[]","SVELTE_QUERY_DEPENDENCIES: GeneratorDependency[]","getSvelteQueryDependencies: ClientDependenciesBuilder","OutputHttpClient","REACT_QUERY_DEPENDENCIES_V3: GeneratorDependency[]","REACT_QUERY_DEPENDENCIES: GeneratorDependency[]","getReactQueryDependencies: ClientDependenciesBuilder","VUE_QUERY_DEPENDENCIES_V3: GeneratorDependency[]","VUE_QUERY_DEPENDENCIES: GeneratorDependency[]","getVueQueryDependencies: ClientDependenciesBuilder","OutputClient","GetterPropType","type","Verbs","params","generateQueryHeader: ClientHeaderBuilder","generateQuery: ClientBuilder","dependenciesBuilder: Record<\n 'react-query' | 'vue-query' | 'svelte-query',\n ClientDependenciesBuilder\n>","client: ClientBuilder"],"sources":["../src/utils.ts","../src/client.ts","../src/index.ts"],"sourcesContent":["import {\n getIsBodyVerb,\n GetterProps,\n GetterPropType,\n isObject,\n isString,\n Mutator,\n NormalizedMutator,\n NormalizedQueryOptions,\n OutputClient,\n OutputClientFunc,\n QueryOptions,\n TEMPLATE_TAG_REGEX,\n upath,\n Verbs,\n} from '@orval/core';\nimport chalk from 'chalk';\n\nexport const normalizeQueryOptions = (\n queryOptions: QueryOptions = {},\n outputWorkspace: string,\n): NormalizedQueryOptions => {\n return {\n ...(queryOptions.usePrefetch ? { usePrefetch: true } : {}),\n ...(queryOptions.useInvalidate ? { useInvalidate: true } : {}),\n ...(queryOptions.useQuery ? { useQuery: true } : {}),\n ...(queryOptions.useInfinite ? { useInfinite: true } : {}),\n ...(queryOptions.useInfiniteQueryParam\n ? { useInfiniteQueryParam: queryOptions.useInfiniteQueryParam }\n : {}),\n ...(queryOptions.options ? { options: queryOptions.options } : {}),\n ...(queryOptions?.queryKey\n ? {\n queryKey: normalizeMutator(outputWorkspace, queryOptions?.queryKey),\n }\n : {}),\n ...(queryOptions?.queryOptions\n ? {\n queryOptions: normalizeMutator(\n outputWorkspace,\n queryOptions?.queryOptions,\n ),\n }\n : {}),\n ...(queryOptions?.mutationOptions\n ? {\n mutationOptions: normalizeMutator(\n outputWorkspace,\n queryOptions?.mutationOptions,\n ),\n }\n : {}),\n ...(queryOptions.signal ? { signal: true } : {}),\n ...(queryOptions.shouldExportMutatorHooks\n ? { shouldExportMutatorHooks: true }\n : {}),\n ...(queryOptions.shouldExportQueryKey\n ? { shouldExportQueryKey: true }\n : {}),\n ...(queryOptions.shouldExportHttpClient\n ? { shouldExportHttpClient: true }\n : {}),\n ...(queryOptions.shouldSplitQueryKey ? { shouldSplitQueryKey: true } : {}),\n ...(queryOptions.useOperationIdAsQueryKey\n ? { useOperationIdAsQueryKey: true }\n : {}),\n };\n};\n\n// Temporary duplicate code before next major release\nconst normalizeMutator = (\n workspace: string,\n mutator?: Mutator,\n): NormalizedMutator | undefined => {\n if (isObject(mutator)) {\n if (!mutator.path) {\n throw new Error(chalk.red(`Mutator need a path`));\n }\n\n return {\n ...mutator,\n path: upath.resolve(workspace, mutator.path),\n default: (mutator.default || !mutator.name) ?? false,\n };\n }\n\n if (isString(mutator)) {\n return {\n path: upath.resolve(workspace, mutator),\n default: true,\n };\n }\n\n return mutator;\n};\n\nexport function vueWrapTypeWithMaybeRef(props: GetterProps): GetterProps {\n return props.map((prop) => {\n const [paramName, paramType] = prop.implementation.split(':');\n if (!paramType) return prop;\n const name =\n prop.type === GetterPropType.NAMED_PATH_PARAMS ? prop.name : paramName;\n\n const [type, defaultValue] = paramType.split('=');\n return {\n ...prop,\n implementation: `${name}: MaybeRef<${type.trim()}>${\n defaultValue ? ` = ${defaultValue}` : ''\n }`,\n };\n });\n}\n\nexport const vueUnRefParams = (props: GetterProps): string => {\n return props\n .map((prop) => {\n if (prop.type === GetterPropType.NAMED_PATH_PARAMS) {\n return `const ${prop.destructured} = unref(${prop.name});`;\n }\n return `${prop.name} = unref(${prop.name});`;\n })\n .join('\\n');\n};\n\nexport const wrapRouteParameters = (\n route: string,\n prepend: string,\n append: string,\n): string => route.replaceAll(TEMPLATE_TAG_REGEX, `\\${${prepend}$1${append}}`);\n\nexport const makeRouteSafe = (route: string): string =>\n wrapRouteParameters(route, 'encodeURIComponent(String(', '))');\n\nexport const isVue = (client: OutputClient | OutputClientFunc) =>\n OutputClient.VUE_QUERY === client;\n\nexport const getHasSignal = ({\n overrideQuerySignal = false,\n verb,\n}: {\n verb: Verbs;\n overrideQuerySignal?: boolean;\n}) => overrideQuerySignal && (!getIsBodyVerb(verb) || verb === Verbs.POST);\n","import {\n ClientHeaderBuilder,\n generateFormDataAndUrlEncodedFunction,\n generateMutatorConfig,\n generateMutatorRequestOptions,\n generateOptions,\n GeneratorDependency,\n GeneratorMutator,\n GeneratorOptions,\n GeneratorVerbOptions,\n GetterResponse,\n isSyntheticDefaultImportsAllow,\n OutputHttpClient,\n pascal,\n toObjectString,\n} from '@orval/core';\nimport {\n generateFetchHeader,\n generateRequestFunction as generateFetchRequestFunction,\n} from '@orval/fetch';\n\nimport {\n getHasSignal,\n makeRouteSafe,\n vueUnRefParams,\n vueWrapTypeWithMaybeRef,\n} from './utils';\n\nexport const AXIOS_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'axios',\n default: true,\n values: true,\n syntheticDefaultImport: true,\n },\n { name: 'AxiosRequestConfig' },\n { name: 'AxiosResponse' },\n { name: 'AxiosError' },\n ],\n dependency: 'axios',\n },\n];\n\nexport const generateQueryRequestFunction = (\n verbOptions: GeneratorVerbOptions,\n options: GeneratorOptions,\n isVue: boolean,\n) => {\n return options.context.output.httpClient === OutputHttpClient.AXIOS\n ? generateAxiosRequestFunction(verbOptions, options, isVue)\n : generateFetchRequestFunction(verbOptions, options);\n};\n\nexport const generateAxiosRequestFunction = (\n {\n headers,\n queryParams,\n operationName,\n response,\n mutator,\n body,\n props: _props,\n verb,\n formData,\n formUrlEncoded,\n override,\n paramsSerializer,\n }: GeneratorVerbOptions,\n { route: _route, context }: GeneratorOptions,\n isVue: boolean,\n) => {\n let props = _props;\n let route = _route;\n\n if (isVue) {\n props = vueWrapTypeWithMaybeRef(_props);\n }\n\n if (context.output?.urlEncodeParameters) {\n route = makeRouteSafe(route);\n }\n\n const isRequestOptions = override.requestOptions !== false;\n const isFormData = !override.formData.disabled;\n const isFormUrlEncoded = override.formUrlEncoded !== false;\n const hasSignal = getHasSignal({\n overrideQuerySignal: override.query.signal,\n verb,\n });\n\n const isExactOptionalPropertyTypes =\n !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;\n\n const bodyForm = generateFormDataAndUrlEncodedFunction({\n formData,\n formUrlEncoded,\n body,\n isFormData,\n isFormUrlEncoded,\n });\n\n if (mutator) {\n const mutatorConfig = generateMutatorConfig({\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n isFormData,\n isFormUrlEncoded,\n hasSignal,\n isExactOptionalPropertyTypes,\n isVue,\n });\n\n const bodyDefinition = body.definition.replace('[]', String.raw`\\[\\]`);\n const propsImplementation =\n mutator?.bodyTypeName && body.definition\n ? toObjectString(props, 'implementation').replace(\n new RegExp(`(\\\\w*):\\\\s?${bodyDefinition}`),\n `$1: ${mutator.bodyTypeName}<${body.definition}>`,\n )\n : toObjectString(props, 'implementation');\n\n const requestOptions = isRequestOptions\n ? generateMutatorRequestOptions(\n override.requestOptions,\n mutator.hasSecondArg,\n )\n : '';\n\n if (mutator.isHook) {\n const ret = `${\n override.query.shouldExportMutatorHooks ? 'export ' : ''\n }const use${pascal(operationName)}Hook = () => {\n const ${operationName} = ${mutator.name}<${\n response.definition.success || 'unknown'\n }>();\n\n return useCallback((\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasSecondArg\n ? `options${context.output.optionsParamRequired ? '' : '?'}: SecondParameter<ReturnType<typeof ${mutator.name}>>,`\n : ''\n }${hasSignal ? 'signal?: AbortSignal\\n' : ''}) => {${bodyForm}\n return ${operationName}(\n ${mutatorConfig},\n ${requestOptions});\n }, [${operationName}])\n }\n `;\n\n const vueRet = `${\n override.query.shouldExportMutatorHooks ? 'export ' : ''\n }const use${pascal(operationName)}Hook = () => {\n const ${operationName} = ${mutator.name}<${\n response.definition.success || 'unknown'\n }>();\n\n return (\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasSecondArg\n ? `options${context.output.optionsParamRequired ? '' : '?'}: SecondParameter<ReturnType<typeof ${mutator.name}>>,`\n : ''\n }${hasSignal ? 'signal?: AbortSignal\\n' : ''}) => {${bodyForm}\n return ${operationName}(\n ${mutatorConfig},\n ${requestOptions});\n }\n }\n `;\n\n return isVue ? vueRet : ret;\n }\n\n return `${override.query.shouldExportHttpClient ? 'export ' : ''}const ${operationName} = (\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasSecondArg\n ? `options${context.output.optionsParamRequired ? '' : '?'}: SecondParameter<typeof ${mutator.name}>,`\n : ''\n }${hasSignal ? 'signal?: AbortSignal\\n' : ''}) => {\n ${isVue ? vueUnRefParams(props) : ''}\n ${bodyForm}\n return ${mutator.name}<${response.definition.success || 'unknown'}>(\n ${mutatorConfig},\n ${requestOptions});\n }\n `;\n }\n\n const isSyntheticDefaultImportsAllowed = isSyntheticDefaultImportsAllow(\n context.output.tsconfig,\n );\n\n const options = generateOptions({\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n requestOptions: override?.requestOptions,\n isFormData,\n isFormUrlEncoded,\n paramsSerializer,\n paramsSerializerOptions: override?.paramsSerializerOptions,\n isExactOptionalPropertyTypes,\n hasSignal,\n isVue: isVue,\n });\n\n const optionsArgs = generateRequestOptionsArguments({\n isRequestOptions,\n hasSignal,\n });\n\n const queryProps = toObjectString(props, 'implementation');\n\n const httpRequestFunctionImplementation = `${override.query.shouldExportHttpClient ? 'export ' : ''}const ${operationName} = (\\n ${queryProps} ${optionsArgs} ): Promise<AxiosResponse<${\n response.definition.success || 'unknown'\n }>> => {\n ${isVue ? vueUnRefParams(props) : ''}\n ${bodyForm}\n return axios${\n isSyntheticDefaultImportsAllowed ? '' : '.default'\n }.${verb}(${options});\n }\n`;\n\n return httpRequestFunctionImplementation;\n};\n\nexport const generateRequestOptionsArguments = ({\n isRequestOptions,\n hasSignal,\n}: {\n isRequestOptions: boolean;\n hasSignal: boolean;\n}) => {\n if (isRequestOptions) {\n return 'options?: AxiosRequestConfig\\n';\n }\n\n return hasSignal ? 'signal?: AbortSignal\\n' : '';\n};\n\nexport const getQueryArgumentsRequestType = (\n httpClient: OutputHttpClient,\n mutator?: GeneratorMutator,\n) => {\n if (!mutator) {\n return httpClient === OutputHttpClient.AXIOS\n ? `axios?: AxiosRequestConfig`\n : 'fetch?: RequestInit';\n }\n\n if (mutator.hasSecondArg && !mutator.isHook) {\n return `request?: SecondParameter<typeof ${mutator.name}>`;\n }\n\n if (mutator.hasSecondArg && mutator.isHook) {\n return `request?: SecondParameter<ReturnType<typeof ${mutator.name}>>`;\n }\n\n return '';\n};\n\nexport const getQueryOptions = ({\n isRequestOptions,\n mutator,\n isExactOptionalPropertyTypes,\n hasSignal,\n httpClient,\n}: {\n isRequestOptions: boolean;\n mutator?: GeneratorMutator;\n isExactOptionalPropertyTypes: boolean;\n hasSignal: boolean;\n httpClient: OutputHttpClient;\n}) => {\n if (!mutator && isRequestOptions) {\n const options =\n httpClient === OutputHttpClient.AXIOS ? 'axiosOptions' : 'fetchOptions';\n\n if (!hasSignal) {\n return options;\n }\n\n return `{ ${\n isExactOptionalPropertyTypes ? '...(signal ? { signal } : {})' : 'signal'\n }, ...${options} }`;\n }\n\n if (mutator?.hasSecondArg && isRequestOptions) {\n if (!hasSignal) {\n return 'requestOptions';\n }\n\n return httpClient === OutputHttpClient.AXIOS\n ? 'requestOptions, signal'\n : '{ signal, ...requestOptions }';\n }\n\n if (hasSignal) {\n return 'signal';\n }\n\n return '';\n};\n\nexport const getHookOptions = ({\n isRequestOptions,\n httpClient,\n mutator,\n}: {\n isRequestOptions: boolean;\n httpClient: OutputHttpClient;\n mutator?: GeneratorMutator;\n}) => {\n if (!isRequestOptions) {\n return '';\n }\n\n let value = 'const {query: queryOptions';\n\n if (!mutator) {\n const options =\n httpClient === OutputHttpClient.AXIOS\n ? ', axios: axiosOptions'\n : ', fetch: fetchOptions';\n\n value += options;\n }\n\n if (mutator?.hasSecondArg) {\n value += ', request: requestOptions';\n }\n\n value += '} = options ?? {};';\n\n return value;\n};\n\n// Helper to deduplicate union type string: \"A | B | B\" -> \"A | B\"\nconst dedupeUnionTypes = (types: string): string => {\n if (!types) return types;\n // Split by '|', trim spaces, filter out empty, and dedupe using a Set\n const unique = [\n ...new Set(\n types\n .split('|')\n .map((t) => t.trim())\n .filter(Boolean),\n ),\n ];\n return unique.join(' | ');\n};\n\nexport const getQueryErrorType = (\n operationName: string,\n response: GetterResponse,\n httpClient: OutputHttpClient,\n mutator?: GeneratorMutator,\n) => {\n const errorsType = dedupeUnionTypes(response.definition.errors || 'unknown');\n\n if (mutator) {\n return mutator.hasErrorType\n ? `${mutator.default ? pascal(operationName) : ''}ErrorType<${errorsType}>`\n : errorsType;\n } else {\n return httpClient === OutputHttpClient.AXIOS\n ? `AxiosError<${errorsType}>`\n : errorsType;\n }\n};\n\nexport const getHooksOptionImplementation = (\n isRequestOptions: boolean,\n httpClient: OutputHttpClient,\n operationName: string,\n mutator?: GeneratorMutator,\n) => {\n const options =\n httpClient === OutputHttpClient.AXIOS\n ? ', axios: axiosOptions'\n : ', fetch: fetchOptions';\n\n return isRequestOptions\n ? `const mutationKey = ['${operationName}'];\nconst {mutation: mutationOptions${\n mutator\n ? mutator?.hasSecondArg\n ? ', request: requestOptions'\n : ''\n : options\n }} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }${mutator?.hasSecondArg ? ', request: undefined' : ''}${mutator ? '' : httpClient === OutputHttpClient.AXIOS ? ', axios: undefined' : ', fetch: undefined'}};`\n : '';\n};\n\nexport const getMutationRequestArgs = (\n isRequestOptions: boolean,\n httpClient: OutputHttpClient,\n mutator?: GeneratorMutator,\n) => {\n const options =\n httpClient === OutputHttpClient.AXIOS ? 'axiosOptions' : 'fetchOptions';\n\n return isRequestOptions\n ? mutator\n ? mutator?.hasSecondArg\n ? 'requestOptions'\n : ''\n : options\n : '';\n};\n\nexport const getHttpFunctionQueryProps = (\n isVue: boolean,\n httpClient: OutputHttpClient,\n queryProperties: string,\n) => {\n if (isVue && httpClient === OutputHttpClient.FETCH && queryProperties) {\n return queryProperties\n .split(',')\n .map((prop) => `unref(${prop})`)\n .join(',');\n }\n\n return queryProperties;\n};\n\nexport const getQueryHeader: ClientHeaderBuilder = (params) => {\n return params.output.httpClient === OutputHttpClient.FETCH\n ? generateFetchHeader(params)\n : '';\n};\n","import {\n camel,\n ClientBuilder,\n ClientDependenciesBuilder,\n ClientHeaderBuilder,\n compareVersions,\n generateMutator,\n generateVerbImports,\n GeneratorDependency,\n GeneratorMutator,\n GeneratorOptions,\n GeneratorVerbOptions,\n getRouteAsArray,\n GetterParams,\n GetterProp,\n GetterProps,\n GetterPropType,\n GetterQueryParam,\n GetterResponse,\n isObject,\n jsDoc,\n mergeDeep,\n NormalizedOutputOptions,\n OutputClient,\n OutputClientFunc,\n OutputHttpClient,\n PackageJson,\n pascal,\n QueryOptions,\n stringify,\n toObjectString,\n Verbs,\n} from '@orval/core';\nimport omitBy from 'lodash.omitby';\n\nimport {\n AXIOS_DEPENDENCIES,\n generateQueryRequestFunction,\n getHookOptions,\n getHooksOptionImplementation,\n getHttpFunctionQueryProps,\n getMutationRequestArgs,\n getQueryArgumentsRequestType,\n getQueryErrorType,\n getQueryHeader,\n getQueryOptions,\n} from './client';\nimport {\n getHasSignal,\n isVue,\n normalizeQueryOptions,\n vueUnRefParams,\n vueWrapTypeWithMaybeRef,\n} from './utils';\n\nconst REACT_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'useCallback',\n values: true,\n },\n ],\n dependency: 'react',\n },\n];\n\nconst PARAMS_SERIALIZER_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'qs',\n default: true,\n values: true,\n syntheticDefaultImport: true,\n },\n ],\n dependency: 'qs',\n },\n];\n\nconst SVELTE_QUERY_DEPENDENCIES_V3: GeneratorDependency[] = [\n {\n exports: [\n { name: 'useQuery', values: true },\n { name: 'useInfiniteQuery', values: true },\n { name: 'useMutation', values: true },\n { name: 'UseQueryOptions' },\n {\n name: 'UseInfiniteQueryOptions',\n },\n { name: 'UseMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'UseQueryStoreResult' },\n { name: 'UseInfiniteQueryStoreResult' },\n { name: 'QueryKey' },\n { name: 'CreateMutationResult' },\n { name: 'InvalidateOptions' },\n ],\n dependency: '@sveltestack/svelte-query',\n },\n];\nconst SVELTE_QUERY_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n { name: 'createQuery', values: true },\n { name: 'createInfiniteQuery', values: true },\n { name: 'createMutation', values: true },\n { name: 'CreateQueryOptions' },\n {\n name: 'CreateInfiniteQueryOptions',\n },\n { name: 'CreateMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'CreateQueryResult' },\n { name: 'CreateInfiniteQueryResult' },\n { name: 'QueryKey' },\n { name: 'InfiniteData' },\n { name: 'CreateMutationResult' },\n { name: 'DataTag' },\n { name: 'QueryClient' },\n { name: 'InvalidateOptions' },\n ],\n dependency: '@tanstack/svelte-query',\n },\n];\n\nconst isSvelteQueryV3 = (packageJson: PackageJson | undefined) => {\n const hasSvelteQuery =\n packageJson?.dependencies?.['@sveltestack/svelte-query'] ??\n packageJson?.devDependencies?.['@sveltestack/svelte-query'] ??\n packageJson?.peerDependencies?.['@sveltestack/svelte-query'];\n const hasSvelteQueryV4 =\n packageJson?.dependencies?.['@tanstack/svelte-query'] ??\n packageJson?.devDependencies?.['@tanstack/svelte-query'] ??\n packageJson?.peerDependencies?.['@tanstack/svelte-query'];\n\n return !!hasSvelteQuery && !hasSvelteQueryV4;\n};\n\nconst isSvelteQueryV6 = (packageJson: PackageJson | undefined) => {\n return isQueryV6(packageJson, 'svelte-query');\n};\n\nexport const getSvelteQueryDependencies: ClientDependenciesBuilder = (\n hasGlobalMutator,\n hasParamsSerializerOptions,\n packageJson,\n httpClient?: OutputHttpClient,\n) => {\n const hasSvelteQueryV3 = isSvelteQueryV3(packageJson);\n\n return [\n ...(!hasGlobalMutator && httpClient === OutputHttpClient.AXIOS\n ? AXIOS_DEPENDENCIES\n : []),\n ...(hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : []),\n ...(hasSvelteQueryV3\n ? SVELTE_QUERY_DEPENDENCIES_V3\n : SVELTE_QUERY_DEPENDENCIES),\n ];\n};\n\nconst REACT_QUERY_DEPENDENCIES_V3: GeneratorDependency[] = [\n {\n exports: [\n { name: 'useQuery', values: true },\n { name: 'useInfiniteQuery', values: true },\n { name: 'useMutation', values: true },\n { name: 'useQueryClient', values: true },\n { name: 'UseQueryOptions' },\n { name: 'UseInfiniteQueryOptions' },\n { name: 'UseMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'UseQueryResult' },\n { name: 'UseInfiniteQueryResult' },\n { name: 'QueryKey' },\n { name: 'QueryClient' },\n { name: 'UseMutationResult' },\n { name: 'InvalidateOptions' },\n ],\n dependency: 'react-query',\n },\n];\nconst REACT_QUERY_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n { name: 'useQuery', values: true },\n { name: 'useSuspenseQuery', values: true },\n { name: 'useInfiniteQuery', values: true },\n { name: 'useSuspenseInfiniteQuery', values: true },\n { name: 'useMutation', values: true },\n { name: 'useQueryClient', values: true },\n { name: 'UseQueryOptions' },\n { name: 'DefinedInitialDataOptions' },\n { name: 'UndefinedInitialDataOptions' },\n { name: 'UseSuspenseQueryOptions' },\n { name: 'UseInfiniteQueryOptions' },\n { name: 'UseSuspenseInfiniteQueryOptions' },\n { name: 'UseMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'UseQueryResult' },\n { name: 'DefinedUseQueryResult' },\n { name: 'UseSuspenseQueryResult' },\n { name: 'UseInfiniteQueryResult' },\n { name: 'DefinedUseInfiniteQueryResult' },\n { name: 'UseSuspenseInfiniteQueryResult' },\n { name: 'QueryKey' },\n { name: 'QueryClient' },\n { name: 'InfiniteData' },\n { name: 'UseMutationResult' },\n { name: 'DataTag' },\n { name: 'InvalidateOptions' },\n ],\n dependency: '@tanstack/react-query',\n },\n];\n\nexport const getReactQueryDependencies: ClientDependenciesBuilder = (\n hasGlobalMutator,\n hasParamsSerializerOptions,\n packageJson,\n httpClient,\n hasTagsMutator,\n override,\n) => {\n const hasReactQuery =\n packageJson?.dependencies?.['react-query'] ??\n packageJson?.devDependencies?.['react-query'] ??\n packageJson?.peerDependencies?.['react-query'];\n const hasReactQueryV4 =\n packageJson?.dependencies?.['@tanstack/react-query'] ??\n packageJson?.devDependencies?.['@tanstack/react-query'] ??\n packageJson?.peerDependencies?.['@tanstack/react-query'];\n\n const useReactQueryV3 =\n override?.query.version === undefined\n ? hasReactQuery && !hasReactQueryV4\n : override?.query.version <= 3;\n\n return [\n ...(hasGlobalMutator || hasTagsMutator ? REACT_DEPENDENCIES : []),\n ...(!hasGlobalMutator && httpClient === OutputHttpClient.AXIOS\n ? AXIOS_DEPENDENCIES\n : []),\n ...(hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : []),\n ...(useReactQueryV3\n ? REACT_QUERY_DEPENDENCIES_V3\n : REACT_QUERY_DEPENDENCIES),\n ];\n};\n\nconst VUE_QUERY_DEPENDENCIES_V3: GeneratorDependency[] = [\n {\n exports: [\n { name: 'useQuery', values: true },\n { name: 'useInfiniteQuery', values: true },\n { name: 'useMutation', values: true },\n ],\n dependency: 'vue-query',\n },\n {\n exports: [\n { name: 'UseQueryOptions' },\n { name: 'UseInfiniteQueryOptions' },\n { name: 'UseMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'UseQueryResult' },\n { name: 'UseInfiniteQueryResult' },\n { name: 'QueryKey' },\n { name: 'UseMutationReturnType' },\n { name: 'InvalidateOptions' },\n ],\n dependency: 'vue-query/types',\n },\n {\n exports: [\n { name: 'unref', values: true },\n { name: 'computed', values: true },\n ],\n dependency: 'vue',\n },\n {\n exports: [{ name: 'UseQueryReturnType' }],\n dependency: 'vue-query/lib/vue/useBaseQuery',\n },\n];\n\nconst VUE_QUERY_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n { name: 'useQuery', values: true },\n { name: 'useInfiniteQuery', values: true },\n { name: 'useMutation', values: true },\n { name: 'UseQueryOptions' },\n { name: 'UseInfiniteQueryOptions' },\n { name: 'UseMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'QueryKey' },\n { name: 'UseQueryReturnType' },\n { name: 'UseInfiniteQueryReturnType' },\n { name: 'InfiniteData' },\n { name: 'UseMutationReturnType' },\n { name: 'DataTag' },\n { name: 'QueryClient' },\n { name: 'InvalidateOptions' },\n ],\n dependency: '@tanstack/vue-query',\n },\n {\n exports: [\n { name: 'unref', values: true },\n { name: 'MaybeRef' },\n { name: 'computed', values: true },\n ],\n dependency: 'vue',\n },\n];\n\nconst isVueQueryV3 = (packageJson: PackageJson | undefined) => {\n const hasVueQuery =\n packageJson?.dependencies?.['vue-query'] ??\n packageJson?.devDependencies?.['vue-query'] ??\n packageJson?.peerDependencies?.['vue-query'];\n const hasVueQueryV4 =\n packageJson?.dependencies?.['@tanstack/vue-query'] ??\n packageJson?.devDependencies?.['@tanstack/vue-query'] ??\n packageJson?.peerDependencies?.['@tanstack/vue-query'];\n\n return !!hasVueQuery && !hasVueQueryV4;\n};\n\nexport const getVueQueryDependencies: ClientDependenciesBuilder = (\n hasGlobalMutator: boolean,\n hasParamsSerializerOptions: boolean,\n packageJson,\n httpClient?: OutputHttpClient,\n) => {\n const hasVueQueryV3 = isVueQueryV3(packageJson);\n\n return [\n ...(!hasGlobalMutator && httpClient === OutputHttpClient.AXIOS\n ? AXIOS_DEPENDENCIES\n : []),\n ...(hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : []),\n ...(hasVueQueryV3 ? VUE_QUERY_DEPENDENCIES_V3 : VUE_QUERY_DEPENDENCIES),\n ];\n};\n\nconst isQueryV5 = (\n packageJson: PackageJson | undefined,\n queryClient: 'react-query' | 'vue-query' | 'svelte-query',\n) => {\n const version = getPackageByQueryClient(packageJson, queryClient);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '5.0.0');\n};\n\nconst isQueryV6 = (\n packageJson: PackageJson | undefined,\n queryClient: 'react-query' | 'vue-query' | 'svelte-query',\n) => {\n const version = getPackageByQueryClient(packageJson, queryClient);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '6.0.0');\n};\n\nconst isQueryV5WithDataTagError = (\n packageJson: PackageJson | undefined,\n queryClient: 'react-query' | 'vue-query' | 'svelte-query',\n) => {\n const version = getPackageByQueryClient(packageJson, queryClient);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '5.62.0');\n};\n\nconst isQueryV5WithInfiniteQueryOptionsError = (\n packageJson: PackageJson | undefined,\n queryClient: 'react-query' | 'vue-query' | 'svelte-query',\n) => {\n const version = getPackageByQueryClient(packageJson, queryClient);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '5.80.0');\n};\n\nconst getPackageByQueryClient = (\n packageJson: PackageJson | undefined,\n queryClient: 'react-query' | 'vue-query' | 'svelte-query',\n) => {\n switch (queryClient) {\n case 'react-query': {\n return (\n packageJson?.dependencies?.['@tanstack/react-query'] ??\n packageJson?.devDependencies?.['@tanstack/react-query'] ??\n packageJson?.peerDependencies?.['@tanstack/react-query']\n );\n }\n case 'svelte-query': {\n return (\n packageJson?.dependencies?.['@tanstack/svelte-query'] ??\n packageJson?.devDependencies?.['@tanstack/svelte-query'] ??\n packageJson?.peerDependencies?.['@tanstack/svelte-query']\n );\n }\n case 'vue-query': {\n return (\n packageJson?.dependencies?.['@tanstack/vue-query'] ??\n packageJson?.devDependencies?.['@tanstack/vue-query'] ??\n packageJson?.peerDependencies?.['@tanstack/vue-query']\n );\n }\n }\n};\n\ntype QueryType = 'infiniteQuery' | 'query';\n\nconst QueryType = {\n INFINITE: 'infiniteQuery' as QueryType,\n QUERY: 'query' as QueryType,\n SUSPENSE_QUERY: 'suspenseQuery' as QueryType,\n SUSPENSE_INFINITE: 'suspenseInfiniteQuery' as QueryType,\n};\n\nconst INFINITE_QUERY_PROPERTIES = new Set([\n 'getNextPageParam',\n 'getPreviousPageParam',\n]);\n\nconst generateQueryOptions = ({\n params,\n options,\n type,\n outputClient,\n}: {\n params: GetterParams;\n options?: object | boolean;\n type: QueryType;\n outputClient: OutputClient | OutputClientFunc;\n}) => {\n if (options === false) {\n return '';\n }\n\n const queryConfig = isObject(options)\n ? ` ${stringify(\n omitBy(\n options,\n (_, key) =>\n (type !== QueryType.INFINITE ||\n type !== QueryType.SUSPENSE_INFINITE) &&\n INFINITE_QUERY_PROPERTIES.has(key),\n ),\n )?.slice(1, -1)}`\n : '';\n\n if (params.length === 0 || isSuspenseQuery(type)) {\n if (options) {\n return `${queryConfig} ...queryOptions`;\n }\n\n return '...queryOptions';\n }\n\n return `${\n !isObject(options) || !options.hasOwnProperty('enabled')\n ? isVue(outputClient)\n ? `enabled: computed(() => !!(${params\n .map(({ name }) => `unref(${name})`)\n .join(' && ')})),`\n : `enabled: !!(${params.map(({ name }) => name).join(' && ')}),`\n : ''\n }${queryConfig} ...queryOptions`;\n};\n\nconst isSuspenseQuery = (type: QueryType) => {\n return [QueryType.SUSPENSE_INFINITE, QueryType.SUSPENSE_QUERY].includes(type);\n};\n\nconst getQueryOptionsDefinition = ({\n operationName,\n mutator,\n definitions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n isReturnType,\n initialData,\n}: {\n operationName: string;\n mutator?: GeneratorMutator;\n definitions: string;\n type?: QueryType;\n hasSvelteQueryV4: boolean;\n hasQueryV5: boolean;\n hasQueryV5WithInfiniteQueryOptionsError: boolean;\n queryParams?: GetterQueryParam;\n queryParam?: string;\n isReturnType: boolean;\n initialData?: 'defined' | 'undefined';\n}) => {\n const isMutatorHook = mutator?.isHook;\n const prefix = hasSvelteQueryV4 ? 'Create' : 'Use';\n const partialOptions = !isReturnType && hasQueryV5;\n\n if (type) {\n const funcReturnType = `Awaited<ReturnType<${\n isMutatorHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`\n }>>`;\n\n const optionTypeInitialDataPostfix =\n initialData && !isSuspenseQuery(type)\n ? ` & Pick<\n ${pascal(initialData)}InitialDataOptions<\n ${funcReturnType},\n TError,\n ${funcReturnType}${\n hasQueryV5 &&\n (type === QueryType.INFINITE ||\n type === QueryType.SUSPENSE_INFINITE) &&\n queryParam &&\n queryParams\n ? `, QueryKey`\n : ''\n }\n > , 'initialData'\n >`\n : '';\n const optionType = `${prefix}${pascal(type)}Options<${funcReturnType}, TError, TData${\n hasQueryV5 &&\n (type === QueryType.INFINITE || type === QueryType.SUSPENSE_INFINITE) &&\n queryParam &&\n queryParams\n ? hasQueryV5WithInfiniteQueryOptionsError\n ? `, QueryKey, ${queryParams?.schema.name}['${queryParam}']`\n : `, ${funcReturnType}, QueryKey, ${queryParams?.schema.name}['${queryParam}']`\n : ''\n }>`;\n return `${partialOptions ? 'Partial<' : ''}${optionType}${\n partialOptions ? '>' : ''\n }${optionTypeInitialDataPostfix}`;\n }\n\n return `${prefix}MutationOptions<Awaited<ReturnType<${\n isMutatorHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`\n }>>, TError,${definitions ? `{${definitions}}` : 'void'}, TContext>`;\n};\n\nconst generateQueryArguments = ({\n operationName,\n definitions,\n mutator,\n isRequestOptions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n initialData,\n httpClient,\n}: {\n operationName: string;\n definitions: string;\n mutator?: GeneratorMutator;\n isRequestOptions: boolean;\n type?: QueryType;\n hasSvelteQueryV4: boolean;\n hasQueryV5: boolean;\n hasQueryV5WithInfiniteQueryOptionsError: boolean;\n queryParams?: GetterQueryParam;\n queryParam?: string;\n initialData?: 'defined' | 'undefined';\n httpClient: OutputHttpClient;\n}) => {\n const definition = getQueryOptionsDefinition({\n operationName,\n mutator,\n definitions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n isReturnType: false,\n initialData,\n });\n\n if (!isRequestOptions) {\n return `${type ? 'queryOptions' : 'mutationOptions'}${\n initialData === 'defined' ? '' : '?'\n }: ${definition}`;\n }\n\n const requestType = getQueryArgumentsRequestType(httpClient, mutator);\n\n const isQueryRequired = initialData === 'defined';\n return `options${isQueryRequired ? '' : '?'}: { ${\n type ? 'query' : 'mutation'\n }${isQueryRequired ? '' : '?'}:${definition}, ${requestType}}\\n`;\n};\n\nconst generateQueryReturnType = ({\n outputClient,\n type,\n isMutatorHook,\n operationName,\n hasVueQueryV4,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithDataTagError,\n isInitialDataDefined,\n}: {\n outputClient: OutputClient | OutputClientFunc;\n type: QueryType;\n isMutatorHook?: boolean;\n operationName: string;\n hasVueQueryV4: boolean;\n hasSvelteQueryV4: boolean;\n hasQueryV5: boolean;\n hasQueryV5WithDataTagError: boolean;\n isInitialDataDefined?: boolean;\n}) => {\n switch (outputClient) {\n case OutputClient.SVELTE_QUERY: {\n if (!hasSvelteQueryV4) {\n return `Use${pascal(type)}StoreResult<Awaited<ReturnType<${\n isMutatorHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`\n }>>, TError, TData, QueryKey> & { queryKey: QueryKey} }`;\n }\n\n return `Create${pascal(\n type,\n )}Result<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'} }`;\n }\n case OutputClient.VUE_QUERY: {\n if (!hasVueQueryV4) {\n return ` UseQueryReturnType<TData, TError, Use${pascal(\n type,\n )}Result<TData, TError>> & { queryKey: QueryKey} }`;\n }\n\n if (type !== QueryType.INFINITE && type !== QueryType.SUSPENSE_INFINITE) {\n return `UseQueryReturnType<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'} }`;\n }\n\n return `UseInfiniteQueryReturnType<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'} }`;\n }\n case OutputClient.REACT_QUERY:\n default: {\n return ` ${\n isInitialDataDefined && !isSuspenseQuery(type) ? 'Defined' : ''\n }Use${pascal(type)}Result<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'} }`;\n }\n }\n};\n\nconst generateMutatorReturnType = ({\n outputClient,\n dataType,\n variableType,\n}: {\n outputClient: OutputClient | OutputClientFunc;\n dataType: unknown;\n variableType: unknown;\n}) => {\n if (outputClient === OutputClient.REACT_QUERY) {\n return `: UseMutationResult<\n Awaited<ReturnType<${dataType}>>,\n TError,\n ${variableType},\n TContext\n >`;\n }\n if (outputClient === OutputClient.SVELTE_QUERY) {\n return `: CreateMutationResult<\n Awaited<ReturnType<${dataType}>>,\n TError,\n ${variableType},\n TContext\n >`;\n }\n if (outputClient === OutputClient.VUE_QUERY) {\n return `: UseMutationReturnType<\n Awaited<ReturnType<${dataType}>>,\n TError,\n ${variableType},\n TContext\n >`;\n }\n return '';\n};\n\nconst getQueryFnArguments = ({\n hasQueryParam,\n hasSignal,\n}: {\n hasQueryParam: boolean;\n hasSignal: boolean;\n}) => {\n if (!hasQueryParam && !hasSignal) {\n return '';\n }\n\n if (hasQueryParam) {\n if (hasSignal) {\n return '{ signal, pageParam }';\n }\n\n return '{ pageParam }';\n }\n\n return '{ signal }';\n};\n\nconst generatePrefetch = ({\n usePrefetch,\n type,\n useQuery,\n useInfinite,\n operationName,\n mutator,\n doc,\n queryProps,\n dataType,\n errorType,\n queryArguments,\n queryOptionsVarName,\n queryOptionsFnName,\n queryProperties,\n isRequestOptions,\n hasSvelteQueryV6,\n}: {\n operationName: string;\n mutator?: GeneratorMutator;\n type: QueryType;\n usePrefetch?: boolean;\n useQuery?: boolean;\n useInfinite?: boolean;\n doc?: string;\n queryProps: string;\n dataType: string;\n errorType: string;\n queryArguments: string;\n queryOptionsVarName: string;\n queryOptionsFnName: string;\n queryProperties: string;\n isRequestOptions: boolean;\n hasSvelteQueryV6: boolean;\n}) => {\n const shouldGeneratePrefetch =\n usePrefetch &&\n (type === QueryType.QUERY ||\n type === QueryType.INFINITE ||\n (type === QueryType.SUSPENSE_QUERY && !useQuery) ||\n (type === QueryType.SUSPENSE_INFINITE && !useInfinite));\n\n if (!shouldGeneratePrefetch) {\n return '';\n }\n\n const prefetchType =\n type === QueryType.QUERY || type === QueryType.SUSPENSE_QUERY\n ? 'query'\n : 'infinite-query';\n const prefetchFnName = camel(`prefetch-${prefetchType}`);\n\n if (mutator?.isHook) {\n const prefetchVarName = camel(\n `use-prefetch-${operationName}-${prefetchType}`,\n );\n return `${doc}export const ${prefetchVarName} = <TData = Awaited<ReturnType<${dataType}>>, TError = ${errorType}>(${queryProps} ${queryArguments}) => {\n const queryClient = useQueryClient();\n const ${queryOptionsVarName} = ${queryOptionsFnName}(${queryProperties}${\n queryProperties ? ',' : ''\n }${isRequestOptions ? 'options' : 'queryOptions'})\n return useCallback(async (): Promise<QueryClient> => {\n await queryClient.${prefetchFnName}(${queryOptionsVarName})\n return queryClient;\n },[queryClient, ${queryOptionsVarName}]);\n};\\n`;\n } else {\n const prefetchVarName = camel(`prefetch-${operationName}-${prefetchType}`);\n return `${doc}export const ${prefetchVarName} = async <TData = Awaited<ReturnType<${dataType}>>, TError = ${errorType}>(\\n queryClient: QueryClient, ${queryProps} ${queryArguments}\\n ): Promise<QueryClient> => {\n\n const ${queryOptionsVarName} = ${queryOptionsFnName}(${queryProperties}${\n queryProperties ? ',' : ''\n }${isRequestOptions ? 'options' : 'queryOptions'})\n\n await queryClient.${prefetchFnName}(${\n hasSvelteQueryV6\n ? `() => ({ ...${queryOptionsVarName} })`\n : queryOptionsVarName\n });\n\n return queryClient;\n}\\n`;\n }\n};\n\nconst generateQueryImplementation = ({\n queryOption: { name, queryParam, options, type, queryKeyFnName },\n operationName,\n queryProperties,\n queryKeyProperties,\n queryParams,\n params,\n props,\n mutator,\n queryOptionsMutator,\n queryKeyMutator,\n isRequestOptions,\n response,\n outputClient,\n httpClient,\n isExactOptionalPropertyTypes,\n hasSignal,\n route,\n hasVueQueryV4,\n hasSvelteQueryV4,\n hasSvelteQueryV6,\n hasQueryV5,\n hasQueryV5WithDataTagError,\n hasQueryV5WithInfiniteQueryOptionsError,\n doc,\n usePrefetch,\n useQuery,\n useInfinite,\n useInvalidate,\n}: {\n queryOption: {\n name: string;\n options?: object | boolean;\n type: QueryType;\n queryParam?: string;\n queryKeyFnName: string;\n };\n isRequestOptions: boolean;\n operationName: string;\n queryProperties: string;\n queryKeyProperties: string;\n params: GetterParams;\n props: GetterProps;\n response: GetterResponse;\n queryParams?: GetterQueryParam;\n mutator?: GeneratorMutator;\n queryOptionsMutator?: GeneratorMutator;\n queryKeyMutator?: GeneratorMutator;\n outputClient: OutputClient | OutputClientFunc;\n httpClient: OutputHttpClient;\n isExactOptionalPropertyTypes: boolean;\n hasSignal: boolean;\n route: string;\n hasVueQueryV4: boolean;\n hasSvelteQueryV4: boolean;\n hasSvelteQueryV6: boolean;\n hasQueryV5: boolean;\n hasQueryV5WithDataTagError: boolean;\n hasQueryV5WithInfiniteQueryOptionsError: boolean;\n doc?: string;\n usePrefetch?: boolean;\n useQuery?: boolean;\n useInfinite?: boolean;\n useInvalidate?: boolean;\n}) => {\n const queryPropDefinitions = toObjectString(props, 'definition');\n const definedInitialDataQueryPropsDefinitions = toObjectString(\n props.map((prop) => {\n const regex = new RegExp(`^${prop.name}\\\\s*\\\\?:`);\n\n if (!regex.test(prop.definition)) {\n return prop;\n }\n\n const definitionWithUndefined = prop.definition.replace(\n regex,\n `${prop.name}: undefined | `,\n );\n return {\n ...prop,\n definition: definitionWithUndefined,\n };\n }),\n 'definition',\n );\n const queryProps = toObjectString(props, 'implementation');\n\n const hasInfiniteQueryParam = queryParam && queryParams?.schema.name;\n\n const httpFunctionProps = queryParam\n ? props\n .map((param) => {\n if (\n param.type === GetterPropType.NAMED_PATH_PARAMS &&\n !isVue(outputClient)\n )\n return param.destructured;\n return param.name === 'params'\n ? `{...${\n isVue(outputClient) ? `unref(params)` : 'params'\n }, '${queryParam}': pageParam || ${\n isVue(outputClient)\n ? `unref(params)?.['${queryParam}']`\n : `params?.['${queryParam}']`\n }}`\n : param.name;\n })\n .join(',')\n : getHttpFunctionQueryProps(\n isVue(outputClient),\n httpClient,\n queryProperties,\n );\n\n const definedInitialDataReturnType = generateQueryReturnType({\n outputClient,\n type,\n isMutatorHook: mutator?.isHook,\n operationName,\n hasVueQueryV4,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithDataTagError,\n isInitialDataDefined: true,\n });\n const returnType = generateQueryReturnType({\n outputClient,\n type,\n isMutatorHook: mutator?.isHook,\n operationName,\n hasVueQueryV4,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithDataTagError,\n });\n\n const errorType = getQueryErrorType(\n operationName,\n response,\n httpClient,\n mutator,\n );\n\n const dataType = mutator?.isHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`;\n\n const definedInitialDataQueryArguments = generateQueryArguments({\n operationName,\n mutator,\n definitions: '',\n isRequestOptions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n initialData: 'defined',\n httpClient,\n });\n const undefinedInitialDataQueryArguments = generateQueryArguments({\n operationName,\n definitions: '',\n mutator,\n isRequestOptions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n initialData: 'undefined',\n httpClient,\n });\n const queryArguments = generateQueryArguments({\n operationName,\n definitions: '',\n mutator,\n isRequestOptions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n httpClient,\n });\n\n const queryOptions = getQueryOptions({\n isRequestOptions,\n isExactOptionalPropertyTypes,\n mutator,\n hasSignal,\n httpClient,\n });\n\n const hookOptions = getHookOptions({\n isRequestOptions,\n httpClient,\n mutator,\n });\n\n const queryFnArguments = getQueryFnArguments({\n hasQueryParam:\n !!queryParam && props.some(({ type }) => type === 'queryParam'),\n hasSignal,\n });\n\n const queryOptionFnReturnType = getQueryOptionsDefinition({\n operationName,\n mutator,\n definitions: '',\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n isReturnType: true,\n });\n\n const queryOptionsImp = generateQueryOptions({\n params,\n options,\n type,\n outputClient,\n });\n\n const queryOptionsFnName = camel(\n queryKeyMutator || queryOptionsMutator || mutator?.isHook\n ? `use-${name}-queryOptions`\n : `get-${name}-queryOptions`,\n );\n\n const queryOptionsVarName = isRequestOptions ? 'queryOptions' : 'options';\n\n const hasParamReservedWord = props.some(\n (prop: GetterProp) => prop.name === 'query',\n );\n const queryResultVarName = hasParamReservedWord ? '_query' : 'query';\n\n const infiniteParam =\n queryParams && queryParam\n ? `, ${queryParams?.schema.name}['${queryParam}']`\n : '';\n const TData =\n hasQueryV5 &&\n (type === QueryType.INFINITE || type === QueryType.SUSPENSE_INFINITE)\n ? `InfiniteData<Awaited<ReturnType<${dataType}>>${infiniteParam}>`\n : `Awaited<ReturnType<${dataType}>>`;\n\n const queryOptionsFn = `export const ${queryOptionsFnName} = <TData = ${TData}, TError = ${errorType}>(${queryProps} ${queryArguments}) => {\n\n${hookOptions}\n\n const queryKey = ${\n queryKeyMutator\n ? `${queryKeyMutator.name}({ ${queryProperties} }${\n queryKeyMutator.hasSecondArg\n ? `, { url: \\`${route}\\`, queryOptions }`\n : ''\n });`\n : `${\n hasVueQueryV4 ? '' : 'queryOptions?.queryKey ?? '\n }${queryKeyFnName}(${queryKeyProperties});`\n }\n\n ${\n mutator?.isHook\n ? `const ${operationName} = use${pascal(operationName)}Hook();`\n : ''\n }\n\n const queryFn: QueryFunction<Awaited<ReturnType<${\n mutator?.isHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`\n }>>${\n hasQueryV5 && hasInfiniteQueryParam\n ? `, QueryKey, ${queryParams?.schema.name}['${queryParam}']`\n : ''\n }> = (${queryFnArguments}) => ${operationName}(${httpFunctionProps}${\n httpFunctionProps ? ', ' : ''\n }${queryOptions});\n\n ${\n isVue(outputClient)\n ? vueUnRefParams(\n props.filter(\n (prop) => prop.type === GetterPropType.NAMED_PATH_PARAMS,\n ),\n )\n : ''\n }\n\n ${\n queryOptionsMutator\n ? `const customOptions = ${\n queryOptionsMutator.name\n }({...queryOptions, queryKey, queryFn}${\n queryOptionsMutator.hasSecondArg ? `, { ${queryProperties} }` : ''\n }${\n queryOptionsMutator.hasThirdArg ? `, { url: \\`${route}\\` }` : ''\n });`\n : ''\n }\n\n return ${\n queryOptionsMutator\n ? 'customOptions'\n : `{ queryKey, queryFn, ${queryOptionsImp}}`\n } as ${queryOptionFnReturnType} ${\n isVue(outputClient)\n ? ''\n : `& { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'} }`\n }\n}`;\n\n const operationPrefix = hasSvelteQueryV4 ? 'create' : 'use';\n const optionalQueryClientArgument = hasQueryV5\n ? ', queryClient?: QueryClient'\n : '';\n\n const queryHookName = camel(`${operationPrefix}-${name}`);\n\n const overrideTypes = `\nexport function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\\n ${definedInitialDataQueryPropsDefinitions} ${definedInitialDataQueryArguments} ${optionalQueryClientArgument}\\n ): ${definedInitialDataReturnType}\nexport function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\\n ${queryPropDefinitions} ${undefinedInitialDataQueryArguments} ${optionalQueryClientArgument}\\n ): ${returnType}\nexport function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\\n ${queryPropDefinitions} ${queryArguments} ${optionalQueryClientArgument}\\n ): ${returnType}`;\n\n const prefetch = generatePrefetch({\n usePrefetch,\n type,\n useQuery,\n useInfinite,\n operationName,\n mutator,\n queryProps,\n dataType,\n errorType,\n hasSvelteQueryV6,\n queryArguments,\n queryOptionsVarName,\n queryOptionsFnName,\n queryProperties,\n isRequestOptions,\n doc,\n });\n\n const shouldGenerateInvalidate =\n useInvalidate &&\n (type === QueryType.QUERY ||\n type === QueryType.INFINITE ||\n (type === QueryType.SUSPENSE_QUERY && !useQuery) ||\n (type === QueryType.SUSPENSE_INFINITE && !useInfinite));\n const invalidateFnName = camel(`invalidate-${operationName}`);\n\n return `\n${queryOptionsFn}\n\nexport type ${pascal(\n name,\n )}QueryResult = NonNullable<Awaited<ReturnType<${dataType}>>>\nexport type ${pascal(name)}QueryError = ${errorType}\n\n${hasQueryV5 && OutputClient.REACT_QUERY === outputClient ? overrideTypes : ''}\n${doc}\nexport function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\\n ${queryProps} ${queryArguments} ${optionalQueryClientArgument} \\n ): ${returnType} {\n\n const ${queryOptionsVarName} = ${queryOptionsFnName}(${queryProperties}${\n queryProperties ? ',' : ''\n }${isRequestOptions ? 'options' : 'queryOptions'})\n\n const ${queryResultVarName} = ${camel(`${operationPrefix}-${type}`)}(${\n hasSvelteQueryV6\n ? `() => ({ ...${queryOptionsVarName}${optionalQueryClientArgument ? ', queryClient' : ''} })`\n : `${queryOptionsVarName}${optionalQueryClientArgument ? ', queryClient' : ''}`\n }) as ${returnType};\n\n ${queryResultVarName}.queryKey = ${\n isVue(outputClient) ? `unref(${queryOptionsVarName})` : queryOptionsVarName\n }.queryKey ${isVue(outputClient) ? `as ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'}` : ''};\n\n return ${queryResultVarName};\n}\\n\n${prefetch}\n${\n shouldGenerateInvalidate\n ? `${doc}export const ${invalidateFnName} = async (\\n queryClient: QueryClient, ${queryProps} options?: InvalidateOptions\\n ): Promise<QueryClient> => {\n\n await queryClient.invalidateQueries({ queryKey: ${queryKeyFnName}(${queryKeyProperties}) }, options);\n\n return queryClient;\n}\\n`\n : ''\n}\n`;\n};\n\nconst generateQueryHook = async (\n {\n queryParams,\n operationName,\n body,\n props: _props,\n verb,\n params,\n override,\n mutator,\n response,\n operationId,\n summary,\n deprecated,\n }: GeneratorVerbOptions,\n { route, override: { operations = {} }, context, output }: GeneratorOptions,\n outputClient: OutputClient | OutputClientFunc,\n) => {\n let props = _props;\n if (isVue(outputClient)) {\n props = vueWrapTypeWithMaybeRef(_props);\n }\n const query = override?.query;\n const isRequestOptions = override?.requestOptions !== false;\n const operationQueryOptions = operations[operationId]?.query;\n const isExactOptionalPropertyTypes =\n !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;\n const queryVersion = override.query.version ?? query?.version;\n\n const hasVueQueryV4 =\n OutputClient.VUE_QUERY === outputClient &&\n (!isVueQueryV3(context.output.packageJson) || queryVersion === 4);\n const hasSvelteQueryV4 =\n OutputClient.SVELTE_QUERY === outputClient &&\n (!isSvelteQueryV3(context.output.packageJson) || queryVersion === 4);\n const hasSvelteQueryV6 =\n OutputClient.SVELTE_QUERY === outputClient &&\n isSvelteQueryV6(context.output.packageJson);\n\n const hasQueryV5 =\n queryVersion === 5 ||\n isQueryV5(\n context.output.packageJson,\n outputClient as 'react-query' | 'vue-query' | 'svelte-query',\n );\n\n const hasQueryV5WithDataTagError =\n queryVersion === 5 ||\n isQueryV5WithDataTagError(\n context.output.packageJson,\n outputClient as 'react-query' | 'vue-query' | 'svelte-query',\n );\n\n const hasQueryV5WithInfiniteQueryOptionsError =\n queryVersion === 5 ||\n isQueryV5WithInfiniteQueryOptionsError(\n context.output.packageJson,\n outputClient as 'react-query' | 'vue-query' | 'svelte-query',\n );\n\n const httpClient = context.output.httpClient;\n const doc = jsDoc({ summary, deprecated });\n\n let implementation = '';\n let mutators;\n\n // Allows operationQueryOptions (which is the Orval config override for the operationId)\n // to override non-GET verbs\n const hasOperationQueryOption = !!(\n operationQueryOptions &&\n (operationQueryOptions.useQuery ||\n operationQueryOptions.useSuspenseQuery ||\n operationQueryOptions.useInfinite ||\n operationQueryOptions.useSuspenseInfiniteQuery)\n );\n\n let isQuery =\n (Verbs.GET === verb &&\n (override.query.useQuery ||\n override.query.useSuspenseQuery ||\n override.query.useInfinite ||\n override.query.useSuspenseInfiniteQuery)) ||\n hasOperationQueryOption;\n\n let isMutation = override.query.useMutation && verb !== Verbs.GET;\n\n if (operationQueryOptions?.useMutation !== undefined) {\n isMutation = operationQueryOptions.useMutation;\n }\n\n // If both query and mutation are true for a non-GET operation, prioritize query\n if (verb !== Verbs.GET && isQuery) {\n isMutation = false;\n }\n\n // If both query and mutation are true for a GET operation, prioritize mutation\n if (verb === Verbs.GET && isMutation) {\n isQuery = false;\n }\n\n if (isQuery) {\n const queryKeyMutator = query.queryKey\n ? await generateMutator({\n output,\n mutator: query.queryKey,\n name: `${operationName}QueryKey`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const queryOptionsMutator = query.queryOptions\n ? await generateMutator({\n output,\n mutator: query.queryOptions,\n name: `${operationName}QueryOptions`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const queryProperties = props\n .map((param) => {\n if (\n param.type === GetterPropType.NAMED_PATH_PARAMS &&\n !isVue(outputClient)\n )\n return param.destructured;\n return param.type === GetterPropType.BODY\n ? body.implementation\n : param.name;\n })\n .join(',');\n\n const queryKeyProperties = props\n .filter((prop) => prop.type !== GetterPropType.HEADER)\n .map((param) => {\n if (\n param.type === GetterPropType.NAMED_PATH_PARAMS &&\n !isVue(outputClient)\n )\n return param.destructured;\n return param.type === GetterPropType.BODY\n ? body.implementation\n : param.name;\n })\n .join(',');\n\n const queries = [\n ...(query?.useInfinite || operationQueryOptions?.useInfinite\n ? [\n {\n name: camel(`${operationName}-infinite`),\n options: query?.options,\n type: QueryType.INFINITE,\n queryParam: query?.useInfiniteQueryParam,\n queryKeyFnName: camel(`get-${operationName}-infinite-query-key`),\n },\n ]\n : []),\n ...(query?.useQuery || operationQueryOptions?.useQuery\n ? [\n {\n name: operationName,\n options: query?.options,\n type: QueryType.QUERY,\n queryKeyFnName: camel(`get-${operationName}-query-key`),\n },\n ]\n : []),\n ...(query?.useSuspenseQuery || operationQueryOptions?.useSuspenseQuery\n ? [\n {\n name: camel(`${operationName}-suspense`),\n options: query?.options,\n type: QueryType.SUSPENSE_QUERY,\n queryKeyFnName: camel(`get-${operationName}-query-key`),\n },\n ]\n : []),\n ...(query?.useSuspenseInfiniteQuery ||\n operationQueryOptions?.useSuspenseInfiniteQuery\n ? [\n {\n name: camel(`${operationName}-suspense-infinite`),\n options: query?.options,\n type: QueryType.SUSPENSE_INFINITE,\n queryParam: query?.useInfiniteQueryParam,\n queryKeyFnName: camel(`get-${operationName}-infinite-query-key`),\n },\n ]\n : []),\n ];\n\n // Convert \"param: Type\" to \"param?: Type\" for queryKey functions\n // to enable cache invalidation without type assertion\n const makeParamsOptional = (params: string) => {\n if (!params) return '';\n // Handle parameters with default values: \"param?: Type = value\" -> \"param: Type = value\" (remove optional marker)\n // Handle regular parameters: \"param: Type\" -> \"param?: Type\"\n return params.replaceAll(\n /(\\w+)(\\?)?:\\s*([^=,}]*?)\\s*(=\\s*[^,}]*)?([,}]|$)/g,\n (match, paramName, optionalMarker, type, defaultValue, suffix) => {\n // If parameter has a default value, don't add '?' (it's already effectively optional)\n if (defaultValue) {\n return `${paramName}: ${type.trim()}${defaultValue}${suffix}`;\n }\n // Otherwise, make it optional\n return `${paramName}?: ${type.trim()}${suffix}`;\n },\n );\n };\n\n const uniqueQueryOptionsByKeys = queries.filter(\n (obj, index, self) =>\n index ===\n self.findIndex((t) => t.queryKeyFnName === obj.queryKeyFnName),\n );\n\n implementation += `\n${\n !queryKeyMutator\n ? uniqueQueryOptionsByKeys.reduce((acc, queryOption) => {\n const queryKeyProps = makeParamsOptional(\n toObjectString(\n props.filter((prop) => prop.type !== GetterPropType.HEADER),\n 'implementation',\n ),\n );\n\n const routeString =\n isVue(outputClient) || override.query.shouldSplitQueryKey\n ? getRouteAsArray(route) // Note: this is required for reactivity to work, we will lose it if route params are converted into string, only as array they will be tracked // TODO: add tests for this\n : `\\`${route}\\``;\n\n // Use operation ID as query key if enabled, otherwise use route string\n const queryKeyIdentifier = override.query.useOperationIdAsQueryKey\n ? `\"${operationName}\"`\n : routeString;\n\n // Note: do not unref() params in Vue - this will make key lose reactivity\n const queryKeyFn = `\n${override.query.shouldExportQueryKey ? 'export ' : ''}const ${queryOption.queryKeyFnName} = (${queryKeyProps}) => {\n return [\n ${[\n queryOption.type === QueryType.INFINITE ||\n queryOption.type === QueryType.SUSPENSE_INFINITE\n ? `'infinite'`\n : '',\n queryKeyIdentifier,\n queryParams ? '...(params ? [params]: [])' : '',\n body.implementation,\n ]\n .filter((x) => !!x)\n .join(', ')}\n ] as const;\n }\n`;\n return acc + queryKeyFn;\n }, '')\n : ''\n}`;\n\n implementation += `\n ${queries.reduce((acc, queryOption) => {\n return (\n acc +\n generateQueryImplementation({\n queryOption,\n operationName,\n queryProperties,\n queryKeyProperties,\n params,\n props,\n mutator,\n isRequestOptions,\n queryParams,\n response,\n outputClient,\n httpClient,\n isExactOptionalPropertyTypes,\n hasSignal: getHasSignal({\n overrideQuerySignal: override.query.signal,\n verb,\n }),\n queryOptionsMutator,\n queryKeyMutator,\n route,\n hasVueQueryV4,\n hasSvelteQueryV4,\n hasSvelteQueryV6,\n hasQueryV5,\n hasQueryV5WithDataTagError,\n hasQueryV5WithInfiniteQueryOptionsError,\n doc,\n usePrefetch: query.usePrefetch,\n useQuery: query.useQuery,\n useInfinite: query.useInfinite,\n useInvalidate: query.useInvalidate,\n })\n );\n }, '')}\n`;\n\n mutators =\n queryOptionsMutator || queryKeyMutator\n ? [\n ...(queryOptionsMutator ? [queryOptionsMutator] : []),\n ...(queryKeyMutator ? [queryKeyMutator] : []),\n ]\n : undefined;\n }\n\n if (isMutation) {\n const mutationOptionsMutator = query.mutationOptions\n ? await generateMutator({\n output,\n mutator: query.mutationOptions,\n name: `${operationName}MutationOptions`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const definitions = props\n .map(({ definition, type }) =>\n type === GetterPropType.BODY\n ? mutator?.bodyTypeName\n ? `data: ${mutator.bodyTypeName}<${body.definition}>`\n : `data: ${body.definition}`\n : definition,\n )\n .join(';');\n\n const properties = props\n .map(({ name, type }) => (type === GetterPropType.BODY ? 'data' : name))\n .join(',');\n\n const errorType = getQueryErrorType(\n operationName,\n response,\n httpClient,\n mutator,\n );\n\n const dataType = mutator?.isHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`;\n\n const mutationOptionFnReturnType = getQueryOptionsDefinition({\n operationName,\n mutator,\n definitions,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n isReturnType: true,\n });\n\n const mutationArguments = generateQueryArguments({\n operationName,\n definitions,\n mutator,\n isRequestOptions,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n httpClient,\n });\n\n const mutationOptionsFnName = camel(\n mutationOptionsMutator || mutator?.isHook\n ? `use-${operationName}-mutationOptions`\n : `get-${operationName}-mutationOptions`,\n );\n\n const mutationOptionsVarName = isRequestOptions\n ? 'mutationOptions'\n : 'options';\n\n const hooksOptionImplementation = getHooksOptionImplementation(\n isRequestOptions,\n httpClient,\n camel(operationName),\n mutator,\n );\n\n const mutationOptionsFn = `export const ${mutationOptionsFnName} = <TError = ${errorType},\n TContext = unknown>(${mutationArguments}): ${mutationOptionFnReturnType} => {\n\n${hooksOptionImplementation}\n\n ${\n mutator?.isHook\n ? `const ${operationName} = use${pascal(operationName)}Hook()`\n : ''\n }\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<${dataType}>>, ${\n definitions ? `{${definitions}}` : 'void'\n }> = (${properties ? 'props' : ''}) => {\n ${properties ? `const {${properties}} = props ?? {};` : ''}\n\n return ${operationName}(${properties}${\n properties ? ',' : ''\n }${getMutationRequestArgs(isRequestOptions, httpClient, mutator)})\n }\n\n ${\n mutationOptionsMutator\n ? `const customOptions = ${\n mutationOptionsMutator.name\n }({...mutationOptions, mutationFn}${\n mutationOptionsMutator.hasSecondArg\n ? `, { url: \\`${route.replaceAll('/${', '/{')}\\` }`\n : ''\n }${\n mutationOptionsMutator.hasThirdArg\n ? `, { operationId: '${operationId}', operationName: '${operationName}' }`\n : ''\n });`\n : ''\n }\n\n\n return ${\n mutationOptionsMutator\n ? 'customOptions'\n : '{ mutationFn, ...mutationOptions }'\n }}`;\n\n const operationPrefix = hasSvelteQueryV4 ? 'create' : 'use';\n const optionalQueryClientArgument = hasQueryV5\n ? ', queryClient?: QueryClient'\n : '';\n\n implementation += `\n${mutationOptionsFn}\n\n export type ${pascal(\n operationName,\n )}MutationResult = NonNullable<Awaited<ReturnType<${dataType}>>>\n ${\n body.definition\n ? `export type ${pascal(operationName)}MutationBody = ${\n mutator?.bodyTypeName\n ? `${mutator.bodyTypeName}<${body.definition}>`\n : body.definition\n }`\n : ''\n }\n export type ${pascal(operationName)}MutationError = ${errorType}\n\n ${doc}export const ${camel(\n `${operationPrefix}-${operationName}`,\n )} = <TError = ${errorType},\n TContext = unknown>(${mutationArguments} ${optionalQueryClientArgument})${generateMutatorReturnType(\n {\n outputClient,\n dataType,\n variableType: definitions ? `{${definitions}}` : 'void',\n },\n )} => {\n\n const ${mutationOptionsVarName} = ${mutationOptionsFnName}(${\n isRequestOptions ? 'options' : 'mutationOptions'\n });\n\n return ${operationPrefix}Mutation(${\n hasSvelteQueryV6\n ? `() => ({ ...${mutationOptionsVarName}${optionalQueryClientArgument ? ', queryClient' : ''} })`\n : `${mutationOptionsVarName}${optionalQueryClientArgument ? ', queryClient' : ''}`\n });\n }\n `;\n\n mutators = mutationOptionsMutator\n ? [...(mutators ?? []), mutationOptionsMutator]\n : mutators;\n }\n\n return {\n implementation,\n mutators,\n };\n};\n\nexport const generateQueryHeader: ClientHeaderBuilder = (params) => {\n return `${\n params.hasAwaitedType\n ? ''\n : `type AwaitedInput<T> = PromiseLike<T> | T;\\n\n type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\\n\\n`\n }\n${\n params.isRequestOptions && params.isMutator\n ? `type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\\n\\n`\n : ''\n}\n${getQueryHeader(params)}\n`;\n};\n\nexport const generateQuery: ClientBuilder = async (\n verbOptions,\n options,\n outputClient,\n) => {\n const imports = generateVerbImports(verbOptions);\n const functionImplementation = generateQueryRequestFunction(\n verbOptions,\n options,\n isVue(outputClient),\n );\n const { implementation: hookImplementation, mutators } =\n await generateQueryHook(verbOptions, options, outputClient);\n\n return {\n implementation: `${functionImplementation}\\n\\n${hookImplementation}`,\n imports,\n mutators,\n };\n};\n\nconst dependenciesBuilder: Record<\n 'react-query' | 'vue-query' | 'svelte-query',\n ClientDependenciesBuilder\n> = {\n 'react-query': getReactQueryDependencies,\n 'vue-query': getVueQueryDependencies,\n 'svelte-query': getSvelteQueryDependencies,\n};\n\nexport const builder =\n ({\n type = 'react-query',\n options: queryOptions,\n output,\n }: {\n type?: 'react-query' | 'vue-query' | 'svelte-query';\n options?: QueryOptions;\n output?: NormalizedOutputOptions;\n } = {}) =>\n () => {\n const client: ClientBuilder = (verbOptions, options, outputClient) => {\n if (\n options.override.useNamedParameters &&\n (type === 'vue-query' || outputClient === 'vue-query')\n ) {\n throw new Error(\n `vue-query client does not support named parameters, and had broken reactivity previously, please set useNamedParameters to false; See for context: https://github.com/orval-labs/orval/pull/931#issuecomment-1752355686`,\n );\n }\n\n if (queryOptions) {\n const normalizedQueryOptions = normalizeQueryOptions(\n queryOptions,\n options.context.workspace,\n );\n verbOptions.override.query = mergeDeep(\n normalizedQueryOptions,\n verbOptions.override.query,\n );\n options.override.query = mergeDeep(\n normalizedQueryOptions,\n verbOptions.override.query,\n );\n }\n return generateQuery(verbOptions, options, outputClient, output);\n };\n\n return {\n client: client,\n header: generateQueryHeader,\n dependencies: dependenciesBuilder[type],\n };\n };\n\nexport default builder;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAa,yBACX,eAA6B,EAAE,EAC/B,oBAC2B;AAC3B,QAAO;EACL,GAAI,aAAa,cAAc,EAAE,aAAa,MAAM,GAAG,EAAE;EACzD,GAAI,aAAa,gBAAgB,EAAE,eAAe,MAAM,GAAG,EAAE;EAC7D,GAAI,aAAa,WAAW,EAAE,UAAU,MAAM,GAAG,EAAE;EACnD,GAAI,aAAa,cAAc,EAAE,aAAa,MAAM,GAAG,EAAE;EACzD,GAAI,aAAa,wBACb,EAAE,uBAAuB,aAAa,uBA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7B,aACA,SACA,MAAM,aAAa,CACpB;CACD,MAAM,EAAE,gBAAgB,oBAAoB,aAC1C,MAAM,kBAAkB,aAAa,SAAS,aAAa;AAE7D,QAAO;EACL,gBAAgB,GAAG,uBAAuB,MAAM;EAChD;EACA;EACD;;AAGH,MAAMC,sBAGF;CACF,eAAe;CACf,aAAa;CACb,gBAAgB;CACjB;AAED,MAAa,WACV,EACC,OAAO,eACP,SAAS,cACT,WAKE,EAAE,WACA;CACJ,MAAMC,UAAyB,aAAa,SAAS,iBAAiB;AACpE,MACE,QAAQ,SAAS,uBAChB,SAAS,eAAe,iBAAiB,aAE1C,OAAM,IAAI,MACR,0NACD;AAGH,MAAI,cAAc;GAChB,MAAM,yBAAyB,sBAC7B,cACA,QAAQ,QAAQ,UACjB;AACD,eAAY,SAAS,oCACnB,wBACA,YAAY,SAAS,MACtB;AACD,WAAQ,SAAS,oCACf,wBACA,YAAY,SAAS,MACtB;;AAEH,SAAO,cAAc,aAAa,SAAS,cAAc,OAAO;;AAGlE,QAAO;EACG;EACR,QAAQ;EACR,cAAc,oBAAoB;EACnC;;AAGL,kBAAe"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["AXIOS_DEPENDENCIES: GeneratorDependency[]","isVue","generateFetchRequestFunction","getQueryHeader: ClientHeaderBuilder","REACT_DEPENDENCIES: GeneratorDependency[]","PARAMS_SERIALIZER_DEPENDENCIES: GeneratorDependency[]","SVELTE_QUERY_DEPENDENCIES_V3: GeneratorDependency[]","SVELTE_QUERY_DEPENDENCIES: GeneratorDependency[]","getSvelteQueryDependencies: ClientDependenciesBuilder","REACT_QUERY_DEPENDENCIES_V3: GeneratorDependency[]","REACT_QUERY_DEPENDENCIES: GeneratorDependency[]","getReactQueryDependencies: ClientDependenciesBuilder","VUE_QUERY_DEPENDENCIES_V3: GeneratorDependency[]","VUE_QUERY_DEPENDENCIES: GeneratorDependency[]","getVueQueryDependencies: ClientDependenciesBuilder","type","params","generateQueryHeader: ClientHeaderBuilder","generateQuery: ClientBuilder","dependenciesBuilder: Record<\n 'react-query' | 'vue-query' | 'svelte-query',\n ClientDependenciesBuilder\n>","client: ClientBuilder"],"sources":["../src/utils.ts","../src/client.ts","../src/index.ts"],"sourcesContent":["import {\n getIsBodyVerb,\n type GetterProps,\n GetterPropType,\n isObject,\n isString,\n type Mutator,\n type NormalizedMutator,\n type NormalizedQueryOptions,\n OutputClient,\n type OutputClientFunc,\n type QueryOptions,\n TEMPLATE_TAG_REGEX,\n upath,\n Verbs,\n} from '@orval/core';\nimport chalk from 'chalk';\n\nexport const normalizeQueryOptions = (\n queryOptions: QueryOptions = {},\n outputWorkspace: string,\n): NormalizedQueryOptions => {\n return {\n ...(queryOptions.usePrefetch ? { usePrefetch: true } : {}),\n ...(queryOptions.useInvalidate ? { useInvalidate: true } : {}),\n ...(queryOptions.useQuery ? { useQuery: true } : {}),\n ...(queryOptions.useInfinite ? { useInfinite: true } : {}),\n ...(queryOptions.useInfiniteQueryParam\n ? { useInfiniteQueryParam: queryOptions.useInfiniteQueryParam }\n : {}),\n ...(queryOptions.options ? { options: queryOptions.options } : {}),\n ...(queryOptions?.queryKey\n ? {\n queryKey: normalizeMutator(outputWorkspace, queryOptions?.queryKey),\n }\n : {}),\n ...(queryOptions?.queryOptions\n ? {\n queryOptions: normalizeMutator(\n outputWorkspace,\n queryOptions?.queryOptions,\n ),\n }\n : {}),\n ...(queryOptions?.mutationOptions\n ? {\n mutationOptions: normalizeMutator(\n outputWorkspace,\n queryOptions?.mutationOptions,\n ),\n }\n : {}),\n ...(queryOptions.signal ? { signal: true } : {}),\n ...(queryOptions.shouldExportMutatorHooks\n ? { shouldExportMutatorHooks: true }\n : {}),\n ...(queryOptions.shouldExportQueryKey\n ? { shouldExportQueryKey: true }\n : {}),\n ...(queryOptions.shouldExportHttpClient\n ? { shouldExportHttpClient: true }\n : {}),\n ...(queryOptions.shouldSplitQueryKey ? { shouldSplitQueryKey: true } : {}),\n ...(queryOptions.useOperationIdAsQueryKey\n ? { useOperationIdAsQueryKey: true }\n : {}),\n };\n};\n\n// Temporary duplicate code before next major release\nconst normalizeMutator = (\n workspace: string,\n mutator?: Mutator,\n): NormalizedMutator | undefined => {\n if (isObject(mutator)) {\n if (!mutator.path) {\n throw new Error(chalk.red(`Mutator need a path`));\n }\n\n return {\n ...mutator,\n path: upath.resolve(workspace, mutator.path),\n default: (mutator.default || !mutator.name) ?? false,\n };\n }\n\n if (isString(mutator)) {\n return {\n path: upath.resolve(workspace, mutator),\n default: true,\n };\n }\n\n return mutator;\n};\n\nexport function vueWrapTypeWithMaybeRef(props: GetterProps): GetterProps {\n return props.map((prop) => {\n const [paramName, paramType] = prop.implementation.split(':');\n if (!paramType) return prop;\n const name =\n prop.type === GetterPropType.NAMED_PATH_PARAMS ? prop.name : paramName;\n\n const [type, defaultValue] = paramType.split('=');\n return {\n ...prop,\n implementation: `${name}: MaybeRef<${type.trim()}>${\n defaultValue ? ` = ${defaultValue}` : ''\n }`,\n };\n });\n}\n\nexport const vueUnRefParams = (props: GetterProps): string => {\n return props\n .map((prop) => {\n if (prop.type === GetterPropType.NAMED_PATH_PARAMS) {\n return `const ${prop.destructured} = unref(${prop.name});`;\n }\n return `${prop.name} = unref(${prop.name});`;\n })\n .join('\\n');\n};\n\nexport const wrapRouteParameters = (\n route: string,\n prepend: string,\n append: string,\n): string => route.replaceAll(TEMPLATE_TAG_REGEX, `\\${${prepend}$1${append}}`);\n\nexport const makeRouteSafe = (route: string): string =>\n wrapRouteParameters(route, 'encodeURIComponent(String(', '))');\n\nexport const isVue = (client: OutputClient | OutputClientFunc) =>\n OutputClient.VUE_QUERY === client;\n\nexport const getHasSignal = ({\n overrideQuerySignal = false,\n verb,\n}: {\n verb: Verbs;\n overrideQuerySignal?: boolean;\n}) => overrideQuerySignal && (!getIsBodyVerb(verb) || verb === Verbs.POST);\n","import {\n type ClientHeaderBuilder,\n generateFormDataAndUrlEncodedFunction,\n generateMutatorConfig,\n generateMutatorRequestOptions,\n generateOptions,\n type GeneratorDependency,\n type GeneratorMutator,\n type GeneratorOptions,\n type GeneratorVerbOptions,\n type GetterResponse,\n isSyntheticDefaultImportsAllow,\n OutputHttpClient,\n pascal,\n toObjectString,\n} from '@orval/core';\nimport {\n generateFetchHeader,\n generateRequestFunction as generateFetchRequestFunction,\n} from '@orval/fetch';\n\nimport {\n getHasSignal,\n makeRouteSafe,\n vueUnRefParams,\n vueWrapTypeWithMaybeRef,\n} from './utils';\n\nexport const AXIOS_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'axios',\n default: true,\n values: true,\n syntheticDefaultImport: true,\n },\n { name: 'AxiosRequestConfig' },\n { name: 'AxiosResponse' },\n { name: 'AxiosError' },\n ],\n dependency: 'axios',\n },\n];\n\nexport const generateQueryRequestFunction = (\n verbOptions: GeneratorVerbOptions,\n options: GeneratorOptions,\n isVue: boolean,\n) => {\n return options.context.output.httpClient === OutputHttpClient.AXIOS\n ? generateAxiosRequestFunction(verbOptions, options, isVue)\n : generateFetchRequestFunction(verbOptions, options);\n};\n\nexport const generateAxiosRequestFunction = (\n {\n headers,\n queryParams,\n operationName,\n response,\n mutator,\n body,\n props: _props,\n verb,\n formData,\n formUrlEncoded,\n override,\n paramsSerializer,\n }: GeneratorVerbOptions,\n { route: _route, context }: GeneratorOptions,\n isVue: boolean,\n) => {\n let props = _props;\n let route = _route;\n\n if (isVue) {\n props = vueWrapTypeWithMaybeRef(_props);\n }\n\n if (context.output?.urlEncodeParameters) {\n route = makeRouteSafe(route);\n }\n\n const isRequestOptions = override.requestOptions !== false;\n const isFormData = !override.formData.disabled;\n const isFormUrlEncoded = override.formUrlEncoded !== false;\n const hasSignal = getHasSignal({\n overrideQuerySignal: override.query.signal,\n verb,\n });\n\n const isExactOptionalPropertyTypes =\n !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;\n\n const bodyForm = generateFormDataAndUrlEncodedFunction({\n formData,\n formUrlEncoded,\n body,\n isFormData,\n isFormUrlEncoded,\n });\n\n if (mutator) {\n const mutatorConfig = generateMutatorConfig({\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n isFormData,\n isFormUrlEncoded,\n hasSignal,\n isExactOptionalPropertyTypes,\n isVue,\n });\n\n const bodyDefinition = body.definition.replace('[]', String.raw`\\[\\]`);\n const propsImplementation =\n mutator?.bodyTypeName && body.definition\n ? toObjectString(props, 'implementation').replace(\n new RegExp(`(\\\\w*):\\\\s?${bodyDefinition}`),\n `$1: ${mutator.bodyTypeName}<${body.definition}>`,\n )\n : toObjectString(props, 'implementation');\n\n const requestOptions = isRequestOptions\n ? generateMutatorRequestOptions(\n override.requestOptions,\n mutator.hasSecondArg,\n )\n : '';\n\n if (mutator.isHook) {\n const ret = `${\n override.query.shouldExportMutatorHooks ? 'export ' : ''\n }const use${pascal(operationName)}Hook = () => {\n const ${operationName} = ${mutator.name}<${\n response.definition.success || 'unknown'\n }>();\n\n return useCallback((\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasSecondArg\n ? `options${context.output.optionsParamRequired ? '' : '?'}: SecondParameter<ReturnType<typeof ${mutator.name}>>,`\n : ''\n }${hasSignal ? 'signal?: AbortSignal\\n' : ''}) => {${bodyForm}\n return ${operationName}(\n ${mutatorConfig},\n ${requestOptions});\n }, [${operationName}])\n }\n `;\n\n const vueRet = `${\n override.query.shouldExportMutatorHooks ? 'export ' : ''\n }const use${pascal(operationName)}Hook = () => {\n const ${operationName} = ${mutator.name}<${\n response.definition.success || 'unknown'\n }>();\n\n return (\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasSecondArg\n ? `options${context.output.optionsParamRequired ? '' : '?'}: SecondParameter<ReturnType<typeof ${mutator.name}>>,`\n : ''\n }${hasSignal ? 'signal?: AbortSignal\\n' : ''}) => {${bodyForm}\n return ${operationName}(\n ${mutatorConfig},\n ${requestOptions});\n }\n }\n `;\n\n return isVue ? vueRet : ret;\n }\n\n return `${override.query.shouldExportHttpClient ? 'export ' : ''}const ${operationName} = (\\n ${propsImplementation}\\n ${\n isRequestOptions && mutator.hasSecondArg\n ? `options${context.output.optionsParamRequired ? '' : '?'}: SecondParameter<typeof ${mutator.name}>,`\n : ''\n }${hasSignal ? 'signal?: AbortSignal\\n' : ''}) => {\n ${isVue ? vueUnRefParams(props) : ''}\n ${bodyForm}\n return ${mutator.name}<${response.definition.success || 'unknown'}>(\n ${mutatorConfig},\n ${requestOptions});\n }\n `;\n }\n\n const isSyntheticDefaultImportsAllowed = isSyntheticDefaultImportsAllow(\n context.output.tsconfig,\n );\n\n const options = generateOptions({\n route,\n body,\n headers,\n queryParams,\n response,\n verb,\n requestOptions: override?.requestOptions,\n isFormData,\n isFormUrlEncoded,\n paramsSerializer,\n paramsSerializerOptions: override?.paramsSerializerOptions,\n isExactOptionalPropertyTypes,\n hasSignal,\n isVue: isVue,\n });\n\n const optionsArgs = generateRequestOptionsArguments({\n isRequestOptions,\n hasSignal,\n });\n\n const queryProps = toObjectString(props, 'implementation');\n\n const httpRequestFunctionImplementation = `${override.query.shouldExportHttpClient ? 'export ' : ''}const ${operationName} = (\\n ${queryProps} ${optionsArgs} ): Promise<AxiosResponse<${\n response.definition.success || 'unknown'\n }>> => {\n ${isVue ? vueUnRefParams(props) : ''}\n ${bodyForm}\n return axios${\n isSyntheticDefaultImportsAllowed ? '' : '.default'\n }.${verb}(${options});\n }\n`;\n\n return httpRequestFunctionImplementation;\n};\n\nexport const generateRequestOptionsArguments = ({\n isRequestOptions,\n hasSignal,\n}: {\n isRequestOptions: boolean;\n hasSignal: boolean;\n}) => {\n if (isRequestOptions) {\n return 'options?: AxiosRequestConfig\\n';\n }\n\n return hasSignal ? 'signal?: AbortSignal\\n' : '';\n};\n\nexport const getQueryArgumentsRequestType = (\n httpClient: OutputHttpClient,\n mutator?: GeneratorMutator,\n) => {\n if (!mutator) {\n return httpClient === OutputHttpClient.AXIOS\n ? `axios?: AxiosRequestConfig`\n : 'fetch?: RequestInit';\n }\n\n if (mutator.hasSecondArg && !mutator.isHook) {\n return `request?: SecondParameter<typeof ${mutator.name}>`;\n }\n\n if (mutator.hasSecondArg && mutator.isHook) {\n return `request?: SecondParameter<ReturnType<typeof ${mutator.name}>>`;\n }\n\n return '';\n};\n\nexport const getQueryOptions = ({\n isRequestOptions,\n mutator,\n isExactOptionalPropertyTypes,\n hasSignal,\n httpClient,\n}: {\n isRequestOptions: boolean;\n mutator?: GeneratorMutator;\n isExactOptionalPropertyTypes: boolean;\n hasSignal: boolean;\n httpClient: OutputHttpClient;\n}) => {\n if (!mutator && isRequestOptions) {\n const options =\n httpClient === OutputHttpClient.AXIOS ? 'axiosOptions' : 'fetchOptions';\n\n if (!hasSignal) {\n return options;\n }\n\n return `{ ${\n isExactOptionalPropertyTypes ? '...(signal ? { signal } : {})' : 'signal'\n }, ...${options} }`;\n }\n\n if (mutator?.hasSecondArg && isRequestOptions) {\n if (!hasSignal) {\n return 'requestOptions';\n }\n\n return httpClient === OutputHttpClient.AXIOS\n ? 'requestOptions, signal'\n : '{ signal, ...requestOptions }';\n }\n\n if (hasSignal) {\n return 'signal';\n }\n\n return '';\n};\n\nexport const getHookOptions = ({\n isRequestOptions,\n httpClient,\n mutator,\n}: {\n isRequestOptions: boolean;\n httpClient: OutputHttpClient;\n mutator?: GeneratorMutator;\n}) => {\n if (!isRequestOptions) {\n return '';\n }\n\n let value = 'const {query: queryOptions';\n\n if (!mutator) {\n const options =\n httpClient === OutputHttpClient.AXIOS\n ? ', axios: axiosOptions'\n : ', fetch: fetchOptions';\n\n value += options;\n }\n\n if (mutator?.hasSecondArg) {\n value += ', request: requestOptions';\n }\n\n value += '} = options ?? {};';\n\n return value;\n};\n\n// Helper to deduplicate union type string: \"A | B | B\" -> \"A | B\"\nconst dedupeUnionTypes = (types: string): string => {\n if (!types) return types;\n // Split by '|', trim spaces, filter out empty, and dedupe using a Set\n const unique = [\n ...new Set(\n types\n .split('|')\n .map((t) => t.trim())\n .filter(Boolean),\n ),\n ];\n return unique.join(' | ');\n};\n\nexport const getQueryErrorType = (\n operationName: string,\n response: GetterResponse,\n httpClient: OutputHttpClient,\n mutator?: GeneratorMutator,\n) => {\n const errorsType = dedupeUnionTypes(response.definition.errors || 'unknown');\n\n if (mutator) {\n return mutator.hasErrorType\n ? `${mutator.default ? pascal(operationName) : ''}ErrorType<${errorsType}>`\n : errorsType;\n } else {\n return httpClient === OutputHttpClient.AXIOS\n ? `AxiosError<${errorsType}>`\n : errorsType;\n }\n};\n\nexport const getHooksOptionImplementation = (\n isRequestOptions: boolean,\n httpClient: OutputHttpClient,\n operationName: string,\n mutator?: GeneratorMutator,\n) => {\n const options =\n httpClient === OutputHttpClient.AXIOS\n ? ', axios: axiosOptions'\n : ', fetch: fetchOptions';\n\n return isRequestOptions\n ? `const mutationKey = ['${operationName}'];\nconst {mutation: mutationOptions${\n mutator\n ? mutator?.hasSecondArg\n ? ', request: requestOptions'\n : ''\n : options\n }} = options ?\n options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?\n options\n : {...options, mutation: {...options.mutation, mutationKey}}\n : {mutation: { mutationKey, }${mutator?.hasSecondArg ? ', request: undefined' : ''}${mutator ? '' : httpClient === OutputHttpClient.AXIOS ? ', axios: undefined' : ', fetch: undefined'}};`\n : '';\n};\n\nexport const getMutationRequestArgs = (\n isRequestOptions: boolean,\n httpClient: OutputHttpClient,\n mutator?: GeneratorMutator,\n) => {\n const options =\n httpClient === OutputHttpClient.AXIOS ? 'axiosOptions' : 'fetchOptions';\n\n return isRequestOptions\n ? mutator\n ? mutator?.hasSecondArg\n ? 'requestOptions'\n : ''\n : options\n : '';\n};\n\nexport const getHttpFunctionQueryProps = (\n isVue: boolean,\n httpClient: OutputHttpClient,\n queryProperties: string,\n) => {\n if (isVue && httpClient === OutputHttpClient.FETCH && queryProperties) {\n return queryProperties\n .split(',')\n .map((prop) => `unref(${prop})`)\n .join(',');\n }\n\n return queryProperties;\n};\n\nexport const getQueryHeader: ClientHeaderBuilder = (params) => {\n return params.output.httpClient === OutputHttpClient.FETCH\n ? generateFetchHeader(params)\n : '';\n};\n","import {\n camel,\n type ClientBuilder,\n type ClientDependenciesBuilder,\n type ClientHeaderBuilder,\n compareVersions,\n generateMutator,\n generateVerbImports,\n type GeneratorDependency,\n type GeneratorMutator,\n type GeneratorOptions,\n type GeneratorVerbOptions,\n getRouteAsArray,\n type GetterParams,\n type GetterProp,\n type GetterProps,\n GetterPropType,\n type GetterQueryParam,\n type GetterResponse,\n isObject,\n jsDoc,\n mergeDeep,\n type NormalizedOutputOptions,\n OutputClient,\n type OutputClientFunc,\n OutputHttpClient,\n type PackageJson,\n pascal,\n type QueryOptions,\n stringify,\n toObjectString,\n Verbs,\n} from '@orval/core';\nimport { omitBy } from 'remeda';\n\nimport {\n AXIOS_DEPENDENCIES,\n generateQueryRequestFunction,\n getHookOptions,\n getHooksOptionImplementation,\n getHttpFunctionQueryProps,\n getMutationRequestArgs,\n getQueryArgumentsRequestType,\n getQueryErrorType,\n getQueryHeader,\n getQueryOptions,\n} from './client';\nimport {\n getHasSignal,\n isVue,\n normalizeQueryOptions,\n vueUnRefParams,\n vueWrapTypeWithMaybeRef,\n} from './utils';\n\nconst REACT_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'useCallback',\n values: true,\n },\n ],\n dependency: 'react',\n },\n];\n\nconst PARAMS_SERIALIZER_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n name: 'qs',\n default: true,\n values: true,\n syntheticDefaultImport: true,\n },\n ],\n dependency: 'qs',\n },\n];\n\nconst SVELTE_QUERY_DEPENDENCIES_V3: GeneratorDependency[] = [\n {\n exports: [\n { name: 'useQuery', values: true },\n { name: 'useInfiniteQuery', values: true },\n { name: 'useMutation', values: true },\n { name: 'UseQueryOptions' },\n {\n name: 'UseInfiniteQueryOptions',\n },\n { name: 'UseMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'UseQueryStoreResult' },\n { name: 'UseInfiniteQueryStoreResult' },\n { name: 'QueryKey' },\n { name: 'CreateMutationResult' },\n { name: 'InvalidateOptions' },\n ],\n dependency: '@sveltestack/svelte-query',\n },\n];\nconst SVELTE_QUERY_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n { name: 'createQuery', values: true },\n { name: 'createInfiniteQuery', values: true },\n { name: 'createMutation', values: true },\n { name: 'CreateQueryOptions' },\n {\n name: 'CreateInfiniteQueryOptions',\n },\n { name: 'CreateMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'CreateQueryResult' },\n { name: 'CreateInfiniteQueryResult' },\n { name: 'QueryKey' },\n { name: 'InfiniteData' },\n { name: 'CreateMutationResult' },\n { name: 'DataTag' },\n { name: 'QueryClient' },\n { name: 'InvalidateOptions' },\n ],\n dependency: '@tanstack/svelte-query',\n },\n];\n\nconst isSvelteQueryV3 = (packageJson: PackageJson | undefined) => {\n const hasSvelteQuery =\n packageJson?.dependencies?.['@sveltestack/svelte-query'] ??\n packageJson?.devDependencies?.['@sveltestack/svelte-query'] ??\n packageJson?.peerDependencies?.['@sveltestack/svelte-query'];\n const hasSvelteQueryV4 =\n packageJson?.dependencies?.['@tanstack/svelte-query'] ??\n packageJson?.devDependencies?.['@tanstack/svelte-query'] ??\n packageJson?.peerDependencies?.['@tanstack/svelte-query'];\n\n return !!hasSvelteQuery && !hasSvelteQueryV4;\n};\n\nconst isSvelteQueryV6 = (packageJson: PackageJson | undefined) => {\n return isQueryV6(packageJson, 'svelte-query');\n};\n\nexport const getSvelteQueryDependencies: ClientDependenciesBuilder = (\n hasGlobalMutator,\n hasParamsSerializerOptions,\n packageJson,\n httpClient?: OutputHttpClient,\n) => {\n const hasSvelteQueryV3 = isSvelteQueryV3(packageJson);\n\n return [\n ...(!hasGlobalMutator && httpClient === OutputHttpClient.AXIOS\n ? AXIOS_DEPENDENCIES\n : []),\n ...(hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : []),\n ...(hasSvelteQueryV3\n ? SVELTE_QUERY_DEPENDENCIES_V3\n : SVELTE_QUERY_DEPENDENCIES),\n ];\n};\n\nconst REACT_QUERY_DEPENDENCIES_V3: GeneratorDependency[] = [\n {\n exports: [\n { name: 'useQuery', values: true },\n { name: 'useInfiniteQuery', values: true },\n { name: 'useMutation', values: true },\n { name: 'useQueryClient', values: true },\n { name: 'UseQueryOptions' },\n { name: 'UseInfiniteQueryOptions' },\n { name: 'UseMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'UseQueryResult' },\n { name: 'UseInfiniteQueryResult' },\n { name: 'QueryKey' },\n { name: 'QueryClient' },\n { name: 'UseMutationResult' },\n { name: 'InvalidateOptions' },\n ],\n dependency: 'react-query',\n },\n];\nconst REACT_QUERY_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n { name: 'useQuery', values: true },\n { name: 'useSuspenseQuery', values: true },\n { name: 'useInfiniteQuery', values: true },\n { name: 'useSuspenseInfiniteQuery', values: true },\n { name: 'useMutation', values: true },\n { name: 'useQueryClient', values: true },\n { name: 'UseQueryOptions' },\n { name: 'DefinedInitialDataOptions' },\n { name: 'UndefinedInitialDataOptions' },\n { name: 'UseSuspenseQueryOptions' },\n { name: 'UseInfiniteQueryOptions' },\n { name: 'UseSuspenseInfiniteQueryOptions' },\n { name: 'UseMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'UseQueryResult' },\n { name: 'DefinedUseQueryResult' },\n { name: 'UseSuspenseQueryResult' },\n { name: 'UseInfiniteQueryResult' },\n { name: 'DefinedUseInfiniteQueryResult' },\n { name: 'UseSuspenseInfiniteQueryResult' },\n { name: 'QueryKey' },\n { name: 'QueryClient' },\n { name: 'InfiniteData' },\n { name: 'UseMutationResult' },\n { name: 'DataTag' },\n { name: 'InvalidateOptions' },\n ],\n dependency: '@tanstack/react-query',\n },\n];\n\nexport const getReactQueryDependencies: ClientDependenciesBuilder = (\n hasGlobalMutator,\n hasParamsSerializerOptions,\n packageJson,\n httpClient,\n hasTagsMutator,\n override,\n) => {\n const hasReactQuery =\n packageJson?.dependencies?.['react-query'] ??\n packageJson?.devDependencies?.['react-query'] ??\n packageJson?.peerDependencies?.['react-query'];\n const hasReactQueryV4 =\n packageJson?.dependencies?.['@tanstack/react-query'] ??\n packageJson?.devDependencies?.['@tanstack/react-query'] ??\n packageJson?.peerDependencies?.['@tanstack/react-query'];\n\n const useReactQueryV3 =\n override?.query.version === undefined\n ? hasReactQuery && !hasReactQueryV4\n : override?.query.version <= 3;\n\n return [\n ...(hasGlobalMutator || hasTagsMutator ? REACT_DEPENDENCIES : []),\n ...(!hasGlobalMutator && httpClient === OutputHttpClient.AXIOS\n ? AXIOS_DEPENDENCIES\n : []),\n ...(hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : []),\n ...(useReactQueryV3\n ? REACT_QUERY_DEPENDENCIES_V3\n : REACT_QUERY_DEPENDENCIES),\n ];\n};\n\nconst VUE_QUERY_DEPENDENCIES_V3: GeneratorDependency[] = [\n {\n exports: [\n { name: 'useQuery', values: true },\n { name: 'useInfiniteQuery', values: true },\n { name: 'useMutation', values: true },\n ],\n dependency: 'vue-query',\n },\n {\n exports: [\n { name: 'UseQueryOptions' },\n { name: 'UseInfiniteQueryOptions' },\n { name: 'UseMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'UseQueryResult' },\n { name: 'UseInfiniteQueryResult' },\n { name: 'QueryKey' },\n { name: 'UseMutationReturnType' },\n { name: 'InvalidateOptions' },\n ],\n dependency: 'vue-query/types',\n },\n {\n exports: [\n { name: 'unref', values: true },\n { name: 'computed', values: true },\n ],\n dependency: 'vue',\n },\n {\n exports: [{ name: 'UseQueryReturnType' }],\n dependency: 'vue-query/lib/vue/useBaseQuery',\n },\n];\n\nconst VUE_QUERY_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n { name: 'useQuery', values: true },\n { name: 'useInfiniteQuery', values: true },\n { name: 'useMutation', values: true },\n { name: 'UseQueryOptions' },\n { name: 'UseInfiniteQueryOptions' },\n { name: 'UseMutationOptions' },\n { name: 'QueryFunction' },\n { name: 'MutationFunction' },\n { name: 'QueryKey' },\n { name: 'UseQueryReturnType' },\n { name: 'UseInfiniteQueryReturnType' },\n { name: 'InfiniteData' },\n { name: 'UseMutationReturnType' },\n { name: 'DataTag' },\n { name: 'QueryClient' },\n { name: 'InvalidateOptions' },\n ],\n dependency: '@tanstack/vue-query',\n },\n {\n exports: [\n { name: 'unref', values: true },\n { name: 'MaybeRef' },\n { name: 'computed', values: true },\n ],\n dependency: 'vue',\n },\n];\n\nconst isVueQueryV3 = (packageJson: PackageJson | undefined) => {\n const hasVueQuery =\n packageJson?.dependencies?.['vue-query'] ??\n packageJson?.devDependencies?.['vue-query'] ??\n packageJson?.peerDependencies?.['vue-query'];\n const hasVueQueryV4 =\n packageJson?.dependencies?.['@tanstack/vue-query'] ??\n packageJson?.devDependencies?.['@tanstack/vue-query'] ??\n packageJson?.peerDependencies?.['@tanstack/vue-query'];\n\n return !!hasVueQuery && !hasVueQueryV4;\n};\n\nexport const getVueQueryDependencies: ClientDependenciesBuilder = (\n hasGlobalMutator: boolean,\n hasParamsSerializerOptions: boolean,\n packageJson,\n httpClient?: OutputHttpClient,\n) => {\n const hasVueQueryV3 = isVueQueryV3(packageJson);\n\n return [\n ...(!hasGlobalMutator && httpClient === OutputHttpClient.AXIOS\n ? AXIOS_DEPENDENCIES\n : []),\n ...(hasParamsSerializerOptions ? PARAMS_SERIALIZER_DEPENDENCIES : []),\n ...(hasVueQueryV3 ? VUE_QUERY_DEPENDENCIES_V3 : VUE_QUERY_DEPENDENCIES),\n ];\n};\n\nconst isQueryV5 = (\n packageJson: PackageJson | undefined,\n queryClient: 'react-query' | 'vue-query' | 'svelte-query',\n) => {\n const version = getPackageByQueryClient(packageJson, queryClient);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '5.0.0');\n};\n\nconst isQueryV6 = (\n packageJson: PackageJson | undefined,\n queryClient: 'react-query' | 'vue-query' | 'svelte-query',\n) => {\n const version = getPackageByQueryClient(packageJson, queryClient);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '6.0.0');\n};\n\nconst isQueryV5WithDataTagError = (\n packageJson: PackageJson | undefined,\n queryClient: 'react-query' | 'vue-query' | 'svelte-query',\n) => {\n const version = getPackageByQueryClient(packageJson, queryClient);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '5.62.0');\n};\n\nconst isQueryV5WithInfiniteQueryOptionsError = (\n packageJson: PackageJson | undefined,\n queryClient: 'react-query' | 'vue-query' | 'svelte-query',\n) => {\n const version = getPackageByQueryClient(packageJson, queryClient);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '5.80.0');\n};\n\nconst getPackageByQueryClient = (\n packageJson: PackageJson | undefined,\n queryClient: 'react-query' | 'vue-query' | 'svelte-query',\n) => {\n switch (queryClient) {\n case 'react-query': {\n return (\n packageJson?.dependencies?.['@tanstack/react-query'] ??\n packageJson?.devDependencies?.['@tanstack/react-query'] ??\n packageJson?.peerDependencies?.['@tanstack/react-query']\n );\n }\n case 'svelte-query': {\n return (\n packageJson?.dependencies?.['@tanstack/svelte-query'] ??\n packageJson?.devDependencies?.['@tanstack/svelte-query'] ??\n packageJson?.peerDependencies?.['@tanstack/svelte-query']\n );\n }\n case 'vue-query': {\n return (\n packageJson?.dependencies?.['@tanstack/vue-query'] ??\n packageJson?.devDependencies?.['@tanstack/vue-query'] ??\n packageJson?.peerDependencies?.['@tanstack/vue-query']\n );\n }\n }\n};\n\ntype QueryType = 'infiniteQuery' | 'query';\n\nconst QueryType = {\n INFINITE: 'infiniteQuery' as QueryType,\n QUERY: 'query' as QueryType,\n SUSPENSE_QUERY: 'suspenseQuery' as QueryType,\n SUSPENSE_INFINITE: 'suspenseInfiniteQuery' as QueryType,\n};\n\nconst INFINITE_QUERY_PROPERTIES = new Set([\n 'getNextPageParam',\n 'getPreviousPageParam',\n]);\n\nconst generateQueryOptions = ({\n params,\n options,\n type,\n outputClient,\n}: {\n params: GetterParams;\n options?: object | boolean;\n type: QueryType;\n outputClient: OutputClient | OutputClientFunc;\n}) => {\n if (options === false) {\n return '';\n }\n\n const queryConfig = isObject(options)\n ? ` ${stringify(\n omitBy(\n options,\n (_, key) =>\n (type !== QueryType.INFINITE ||\n type !== QueryType.SUSPENSE_INFINITE) &&\n INFINITE_QUERY_PROPERTIES.has(key),\n ),\n )?.slice(1, -1)}`\n : '';\n\n if (params.length === 0 || isSuspenseQuery(type)) {\n if (options) {\n return `${queryConfig} ...queryOptions`;\n }\n\n return '...queryOptions';\n }\n\n return `${\n !isObject(options) || !options.hasOwnProperty('enabled')\n ? isVue(outputClient)\n ? `enabled: computed(() => !!(${params\n .map(({ name }) => `unref(${name})`)\n .join(' && ')})),`\n : `enabled: !!(${params.map(({ name }) => name).join(' && ')}),`\n : ''\n }${queryConfig} ...queryOptions`;\n};\n\nconst isSuspenseQuery = (type: QueryType) => {\n return [QueryType.SUSPENSE_INFINITE, QueryType.SUSPENSE_QUERY].includes(type);\n};\n\nconst getQueryOptionsDefinition = ({\n operationName,\n mutator,\n definitions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n isReturnType,\n initialData,\n}: {\n operationName: string;\n mutator?: GeneratorMutator;\n definitions: string;\n type?: QueryType;\n hasSvelteQueryV4: boolean;\n hasQueryV5: boolean;\n hasQueryV5WithInfiniteQueryOptionsError: boolean;\n queryParams?: GetterQueryParam;\n queryParam?: string;\n isReturnType: boolean;\n initialData?: 'defined' | 'undefined';\n}) => {\n const isMutatorHook = mutator?.isHook;\n const prefix = hasSvelteQueryV4 ? 'Create' : 'Use';\n const partialOptions = !isReturnType && hasQueryV5;\n\n if (type) {\n const funcReturnType = `Awaited<ReturnType<${\n isMutatorHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`\n }>>`;\n\n const optionTypeInitialDataPostfix =\n initialData && !isSuspenseQuery(type)\n ? ` & Pick<\n ${pascal(initialData)}InitialDataOptions<\n ${funcReturnType},\n TError,\n ${funcReturnType}${\n hasQueryV5 &&\n (type === QueryType.INFINITE ||\n type === QueryType.SUSPENSE_INFINITE) &&\n queryParam &&\n queryParams\n ? `, QueryKey`\n : ''\n }\n > , 'initialData'\n >`\n : '';\n const optionType = `${prefix}${pascal(type)}Options<${funcReturnType}, TError, TData${\n hasQueryV5 &&\n (type === QueryType.INFINITE || type === QueryType.SUSPENSE_INFINITE) &&\n queryParam &&\n queryParams\n ? hasQueryV5WithInfiniteQueryOptionsError\n ? `, QueryKey, ${queryParams?.schema.name}['${queryParam}']`\n : `, ${funcReturnType}, QueryKey, ${queryParams?.schema.name}['${queryParam}']`\n : ''\n }>`;\n return `${partialOptions ? 'Partial<' : ''}${optionType}${\n partialOptions ? '>' : ''\n }${optionTypeInitialDataPostfix}`;\n }\n\n return `${prefix}MutationOptions<Awaited<ReturnType<${\n isMutatorHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`\n }>>, TError,${definitions ? `{${definitions}}` : 'void'}, TContext>`;\n};\n\nconst generateQueryArguments = ({\n operationName,\n definitions,\n mutator,\n isRequestOptions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n initialData,\n httpClient,\n}: {\n operationName: string;\n definitions: string;\n mutator?: GeneratorMutator;\n isRequestOptions: boolean;\n type?: QueryType;\n hasSvelteQueryV4: boolean;\n hasQueryV5: boolean;\n hasQueryV5WithInfiniteQueryOptionsError: boolean;\n queryParams?: GetterQueryParam;\n queryParam?: string;\n initialData?: 'defined' | 'undefined';\n httpClient: OutputHttpClient;\n}) => {\n const definition = getQueryOptionsDefinition({\n operationName,\n mutator,\n definitions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n isReturnType: false,\n initialData,\n });\n\n if (!isRequestOptions) {\n return `${type ? 'queryOptions' : 'mutationOptions'}${\n initialData === 'defined' ? '' : '?'\n }: ${definition}`;\n }\n\n const requestType = getQueryArgumentsRequestType(httpClient, mutator);\n\n const isQueryRequired = initialData === 'defined';\n return `options${isQueryRequired ? '' : '?'}: { ${\n type ? 'query' : 'mutation'\n }${isQueryRequired ? '' : '?'}:${definition}, ${requestType}}\\n`;\n};\n\nconst generateQueryReturnType = ({\n outputClient,\n type,\n isMutatorHook,\n operationName,\n hasVueQueryV4,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithDataTagError,\n isInitialDataDefined,\n}: {\n outputClient: OutputClient | OutputClientFunc;\n type: QueryType;\n isMutatorHook?: boolean;\n operationName: string;\n hasVueQueryV4: boolean;\n hasSvelteQueryV4: boolean;\n hasQueryV5: boolean;\n hasQueryV5WithDataTagError: boolean;\n isInitialDataDefined?: boolean;\n}) => {\n switch (outputClient) {\n case OutputClient.SVELTE_QUERY: {\n if (!hasSvelteQueryV4) {\n return `Use${pascal(type)}StoreResult<Awaited<ReturnType<${\n isMutatorHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`\n }>>, TError, TData, QueryKey> & { queryKey: QueryKey} }`;\n }\n\n return `Create${pascal(\n type,\n )}Result<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'} }`;\n }\n case OutputClient.VUE_QUERY: {\n if (!hasVueQueryV4) {\n return ` UseQueryReturnType<TData, TError, Use${pascal(\n type,\n )}Result<TData, TError>> & { queryKey: QueryKey} }`;\n }\n\n if (type !== QueryType.INFINITE && type !== QueryType.SUSPENSE_INFINITE) {\n return `UseQueryReturnType<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'} }`;\n }\n\n return `UseInfiniteQueryReturnType<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'} }`;\n }\n case OutputClient.REACT_QUERY:\n default: {\n return ` ${\n isInitialDataDefined && !isSuspenseQuery(type) ? 'Defined' : ''\n }Use${pascal(type)}Result<TData, TError> & { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'} }`;\n }\n }\n};\n\nconst generateMutatorReturnType = ({\n outputClient,\n dataType,\n variableType,\n}: {\n outputClient: OutputClient | OutputClientFunc;\n dataType: unknown;\n variableType: unknown;\n}) => {\n if (outputClient === OutputClient.REACT_QUERY) {\n return `: UseMutationResult<\n Awaited<ReturnType<${dataType}>>,\n TError,\n ${variableType},\n TContext\n >`;\n }\n if (outputClient === OutputClient.SVELTE_QUERY) {\n return `: CreateMutationResult<\n Awaited<ReturnType<${dataType}>>,\n TError,\n ${variableType},\n TContext\n >`;\n }\n if (outputClient === OutputClient.VUE_QUERY) {\n return `: UseMutationReturnType<\n Awaited<ReturnType<${dataType}>>,\n TError,\n ${variableType},\n TContext\n >`;\n }\n return '';\n};\n\nconst getQueryFnArguments = ({\n hasQueryParam,\n hasSignal,\n}: {\n hasQueryParam: boolean;\n hasSignal: boolean;\n}) => {\n if (!hasQueryParam && !hasSignal) {\n return '';\n }\n\n if (hasQueryParam) {\n if (hasSignal) {\n return '{ signal, pageParam }';\n }\n\n return '{ pageParam }';\n }\n\n return '{ signal }';\n};\n\nconst generatePrefetch = ({\n usePrefetch,\n type,\n useQuery,\n useInfinite,\n operationName,\n mutator,\n doc,\n queryProps,\n dataType,\n errorType,\n queryArguments,\n queryOptionsVarName,\n queryOptionsFnName,\n queryProperties,\n isRequestOptions,\n hasSvelteQueryV6,\n}: {\n operationName: string;\n mutator?: GeneratorMutator;\n type: QueryType;\n usePrefetch?: boolean;\n useQuery?: boolean;\n useInfinite?: boolean;\n doc?: string;\n queryProps: string;\n dataType: string;\n errorType: string;\n queryArguments: string;\n queryOptionsVarName: string;\n queryOptionsFnName: string;\n queryProperties: string;\n isRequestOptions: boolean;\n hasSvelteQueryV6: boolean;\n}) => {\n const shouldGeneratePrefetch =\n usePrefetch &&\n (type === QueryType.QUERY ||\n type === QueryType.INFINITE ||\n (type === QueryType.SUSPENSE_QUERY && !useQuery) ||\n (type === QueryType.SUSPENSE_INFINITE && !useInfinite));\n\n if (!shouldGeneratePrefetch) {\n return '';\n }\n\n const prefetchType =\n type === QueryType.QUERY || type === QueryType.SUSPENSE_QUERY\n ? 'query'\n : 'infinite-query';\n const prefetchFnName = camel(`prefetch-${prefetchType}`);\n\n if (mutator?.isHook) {\n const prefetchVarName = camel(\n `use-prefetch-${operationName}-${prefetchType}`,\n );\n return `${doc}export const ${prefetchVarName} = <TData = Awaited<ReturnType<${dataType}>>, TError = ${errorType}>(${queryProps} ${queryArguments}) => {\n const queryClient = useQueryClient();\n const ${queryOptionsVarName} = ${queryOptionsFnName}(${queryProperties}${\n queryProperties ? ',' : ''\n }${isRequestOptions ? 'options' : 'queryOptions'})\n return useCallback(async (): Promise<QueryClient> => {\n await queryClient.${prefetchFnName}(${queryOptionsVarName})\n return queryClient;\n },[queryClient, ${queryOptionsVarName}]);\n};\\n`;\n } else {\n const prefetchVarName = camel(`prefetch-${operationName}-${prefetchType}`);\n return `${doc}export const ${prefetchVarName} = async <TData = Awaited<ReturnType<${dataType}>>, TError = ${errorType}>(\\n queryClient: QueryClient, ${queryProps} ${queryArguments}\\n ): Promise<QueryClient> => {\n\n const ${queryOptionsVarName} = ${queryOptionsFnName}(${queryProperties}${\n queryProperties ? ',' : ''\n }${isRequestOptions ? 'options' : 'queryOptions'})\n\n await queryClient.${prefetchFnName}(${\n hasSvelteQueryV6\n ? `() => ({ ...${queryOptionsVarName} })`\n : queryOptionsVarName\n });\n\n return queryClient;\n}\\n`;\n }\n};\n\nconst generateQueryImplementation = ({\n queryOption: { name, queryParam, options, type, queryKeyFnName },\n operationName,\n queryProperties,\n queryKeyProperties,\n queryParams,\n params,\n props,\n mutator,\n queryOptionsMutator,\n queryKeyMutator,\n isRequestOptions,\n response,\n outputClient,\n httpClient,\n isExactOptionalPropertyTypes,\n hasSignal,\n route,\n hasVueQueryV4,\n hasSvelteQueryV4,\n hasSvelteQueryV6,\n hasQueryV5,\n hasQueryV5WithDataTagError,\n hasQueryV5WithInfiniteQueryOptionsError,\n doc,\n usePrefetch,\n useQuery,\n useInfinite,\n useInvalidate,\n}: {\n queryOption: {\n name: string;\n options?: object | boolean;\n type: QueryType;\n queryParam?: string;\n queryKeyFnName: string;\n };\n isRequestOptions: boolean;\n operationName: string;\n queryProperties: string;\n queryKeyProperties: string;\n params: GetterParams;\n props: GetterProps;\n response: GetterResponse;\n queryParams?: GetterQueryParam;\n mutator?: GeneratorMutator;\n queryOptionsMutator?: GeneratorMutator;\n queryKeyMutator?: GeneratorMutator;\n outputClient: OutputClient | OutputClientFunc;\n httpClient: OutputHttpClient;\n isExactOptionalPropertyTypes: boolean;\n hasSignal: boolean;\n route: string;\n hasVueQueryV4: boolean;\n hasSvelteQueryV4: boolean;\n hasSvelteQueryV6: boolean;\n hasQueryV5: boolean;\n hasQueryV5WithDataTagError: boolean;\n hasQueryV5WithInfiniteQueryOptionsError: boolean;\n doc?: string;\n usePrefetch?: boolean;\n useQuery?: boolean;\n useInfinite?: boolean;\n useInvalidate?: boolean;\n}) => {\n const queryPropDefinitions = toObjectString(props, 'definition');\n const definedInitialDataQueryPropsDefinitions = toObjectString(\n props.map((prop) => {\n const regex = new RegExp(`^${prop.name}\\\\s*\\\\?:`);\n\n if (!regex.test(prop.definition)) {\n return prop;\n }\n\n const definitionWithUndefined = prop.definition.replace(\n regex,\n `${prop.name}: undefined | `,\n );\n return {\n ...prop,\n definition: definitionWithUndefined,\n };\n }),\n 'definition',\n );\n const queryProps = toObjectString(props, 'implementation');\n\n const hasInfiniteQueryParam = queryParam && queryParams?.schema.name;\n\n const httpFunctionProps = queryParam\n ? props\n .map((param) => {\n if (\n param.type === GetterPropType.NAMED_PATH_PARAMS &&\n !isVue(outputClient)\n )\n return param.destructured;\n return param.name === 'params'\n ? `{...${\n isVue(outputClient) ? `unref(params)` : 'params'\n }, '${queryParam}': pageParam || ${\n isVue(outputClient)\n ? `unref(params)?.['${queryParam}']`\n : `params?.['${queryParam}']`\n }}`\n : param.name;\n })\n .join(',')\n : getHttpFunctionQueryProps(\n isVue(outputClient),\n httpClient,\n queryProperties,\n );\n\n const definedInitialDataReturnType = generateQueryReturnType({\n outputClient,\n type,\n isMutatorHook: mutator?.isHook,\n operationName,\n hasVueQueryV4,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithDataTagError,\n isInitialDataDefined: true,\n });\n const returnType = generateQueryReturnType({\n outputClient,\n type,\n isMutatorHook: mutator?.isHook,\n operationName,\n hasVueQueryV4,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithDataTagError,\n });\n\n const errorType = getQueryErrorType(\n operationName,\n response,\n httpClient,\n mutator,\n );\n\n const dataType = mutator?.isHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`;\n\n const definedInitialDataQueryArguments = generateQueryArguments({\n operationName,\n mutator,\n definitions: '',\n isRequestOptions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n initialData: 'defined',\n httpClient,\n });\n const undefinedInitialDataQueryArguments = generateQueryArguments({\n operationName,\n definitions: '',\n mutator,\n isRequestOptions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n initialData: 'undefined',\n httpClient,\n });\n const queryArguments = generateQueryArguments({\n operationName,\n definitions: '',\n mutator,\n isRequestOptions,\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n httpClient,\n });\n\n const queryOptions = getQueryOptions({\n isRequestOptions,\n isExactOptionalPropertyTypes,\n mutator,\n hasSignal,\n httpClient,\n });\n\n const hookOptions = getHookOptions({\n isRequestOptions,\n httpClient,\n mutator,\n });\n\n const queryFnArguments = getQueryFnArguments({\n hasQueryParam:\n !!queryParam && props.some(({ type }) => type === 'queryParam'),\n hasSignal,\n });\n\n const queryOptionFnReturnType = getQueryOptionsDefinition({\n operationName,\n mutator,\n definitions: '',\n type,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n queryParams,\n queryParam,\n isReturnType: true,\n });\n\n const queryOptionsImp = generateQueryOptions({\n params,\n options,\n type,\n outputClient,\n });\n\n const queryOptionsFnName = camel(\n queryKeyMutator || queryOptionsMutator || mutator?.isHook\n ? `use-${name}-queryOptions`\n : `get-${name}-queryOptions`,\n );\n\n const queryOptionsVarName = isRequestOptions ? 'queryOptions' : 'options';\n\n const hasParamReservedWord = props.some(\n (prop: GetterProp) => prop.name === 'query',\n );\n const queryResultVarName = hasParamReservedWord ? '_query' : 'query';\n\n const infiniteParam =\n queryParams && queryParam\n ? `, ${queryParams?.schema.name}['${queryParam}']`\n : '';\n const TData =\n hasQueryV5 &&\n (type === QueryType.INFINITE || type === QueryType.SUSPENSE_INFINITE)\n ? `InfiniteData<Awaited<ReturnType<${dataType}>>${infiniteParam}>`\n : `Awaited<ReturnType<${dataType}>>`;\n\n const queryOptionsFn = `export const ${queryOptionsFnName} = <TData = ${TData}, TError = ${errorType}>(${queryProps} ${queryArguments}) => {\n\n${hookOptions}\n\n const queryKey = ${\n queryKeyMutator\n ? `${queryKeyMutator.name}({ ${queryProperties} }${\n queryKeyMutator.hasSecondArg\n ? `, { url: \\`${route}\\`, queryOptions }`\n : ''\n });`\n : `${\n hasVueQueryV4 ? '' : 'queryOptions?.queryKey ?? '\n }${queryKeyFnName}(${queryKeyProperties});`\n }\n\n ${\n mutator?.isHook\n ? `const ${operationName} = use${pascal(operationName)}Hook();`\n : ''\n }\n\n const queryFn: QueryFunction<Awaited<ReturnType<${\n mutator?.isHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`\n }>>${\n hasQueryV5 && hasInfiniteQueryParam\n ? `, QueryKey, ${queryParams?.schema.name}['${queryParam}']`\n : ''\n }> = (${queryFnArguments}) => ${operationName}(${httpFunctionProps}${\n httpFunctionProps ? ', ' : ''\n }${queryOptions});\n\n ${\n isVue(outputClient)\n ? vueUnRefParams(\n props.filter(\n (prop) => prop.type === GetterPropType.NAMED_PATH_PARAMS,\n ),\n )\n : ''\n }\n\n ${\n queryOptionsMutator\n ? `const customOptions = ${\n queryOptionsMutator.name\n }({...queryOptions, queryKey, queryFn}${\n queryOptionsMutator.hasSecondArg ? `, { ${queryProperties} }` : ''\n }${\n queryOptionsMutator.hasThirdArg ? `, { url: \\`${route}\\` }` : ''\n });`\n : ''\n }\n\n return ${\n queryOptionsMutator\n ? 'customOptions'\n : `{ queryKey, queryFn, ${queryOptionsImp}}`\n } as ${queryOptionFnReturnType} ${\n isVue(outputClient)\n ? ''\n : `& { queryKey: ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'} }`\n }\n}`;\n\n const operationPrefix = hasSvelteQueryV4 ? 'create' : 'use';\n const optionalQueryClientArgument = hasQueryV5\n ? ', queryClient?: QueryClient'\n : '';\n\n const queryHookName = camel(`${operationPrefix}-${name}`);\n\n const overrideTypes = `\nexport function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\\n ${definedInitialDataQueryPropsDefinitions} ${definedInitialDataQueryArguments} ${optionalQueryClientArgument}\\n ): ${definedInitialDataReturnType}\nexport function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\\n ${queryPropDefinitions} ${undefinedInitialDataQueryArguments} ${optionalQueryClientArgument}\\n ): ${returnType}\nexport function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\\n ${queryPropDefinitions} ${queryArguments} ${optionalQueryClientArgument}\\n ): ${returnType}`;\n\n const prefetch = generatePrefetch({\n usePrefetch,\n type,\n useQuery,\n useInfinite,\n operationName,\n mutator,\n queryProps,\n dataType,\n errorType,\n hasSvelteQueryV6,\n queryArguments,\n queryOptionsVarName,\n queryOptionsFnName,\n queryProperties,\n isRequestOptions,\n doc,\n });\n\n const shouldGenerateInvalidate =\n useInvalidate &&\n (type === QueryType.QUERY ||\n type === QueryType.INFINITE ||\n (type === QueryType.SUSPENSE_QUERY && !useQuery) ||\n (type === QueryType.SUSPENSE_INFINITE && !useInfinite));\n const invalidateFnName = camel(`invalidate-${operationName}`);\n\n return `\n${queryOptionsFn}\n\nexport type ${pascal(\n name,\n )}QueryResult = NonNullable<Awaited<ReturnType<${dataType}>>>\nexport type ${pascal(name)}QueryError = ${errorType}\n\n${hasQueryV5 && OutputClient.REACT_QUERY === outputClient ? overrideTypes : ''}\n${doc}\nexport function ${queryHookName}<TData = ${TData}, TError = ${errorType}>(\\n ${queryProps} ${queryArguments} ${optionalQueryClientArgument} \\n ): ${returnType} {\n\n const ${queryOptionsVarName} = ${queryOptionsFnName}(${queryProperties}${\n queryProperties ? ',' : ''\n }${isRequestOptions ? 'options' : 'queryOptions'})\n\n const ${queryResultVarName} = ${camel(`${operationPrefix}-${type}`)}(${\n hasSvelteQueryV6\n ? `() => ({ ...${queryOptionsVarName}${optionalQueryClientArgument ? ', queryClient' : ''} })`\n : `${queryOptionsVarName}${optionalQueryClientArgument ? ', queryClient' : ''}`\n }) as ${returnType};\n\n ${queryResultVarName}.queryKey = ${\n isVue(outputClient) ? `unref(${queryOptionsVarName})` : queryOptionsVarName\n }.queryKey ${isVue(outputClient) ? `as ${hasQueryV5 ? `DataTag<QueryKey, TData${hasQueryV5WithDataTagError ? ', TError' : ''}>` : 'QueryKey'}` : ''};\n\n return ${queryResultVarName};\n}\\n\n${prefetch}\n${\n shouldGenerateInvalidate\n ? `${doc}export const ${invalidateFnName} = async (\\n queryClient: QueryClient, ${queryProps} options?: InvalidateOptions\\n ): Promise<QueryClient> => {\n\n await queryClient.invalidateQueries({ queryKey: ${queryKeyFnName}(${queryKeyProperties}) }, options);\n\n return queryClient;\n}\\n`\n : ''\n}\n`;\n};\n\nconst generateQueryHook = async (\n {\n queryParams,\n operationName,\n body,\n props: _props,\n verb,\n params,\n override,\n mutator,\n response,\n operationId,\n summary,\n deprecated,\n }: GeneratorVerbOptions,\n { route, override: { operations = {} }, context, output }: GeneratorOptions,\n outputClient: OutputClient | OutputClientFunc,\n) => {\n let props = _props;\n if (isVue(outputClient)) {\n props = vueWrapTypeWithMaybeRef(_props);\n }\n const query = override?.query;\n const isRequestOptions = override?.requestOptions !== false;\n const operationQueryOptions = operations[operationId]?.query;\n const isExactOptionalPropertyTypes =\n !!context.output.tsconfig?.compilerOptions?.exactOptionalPropertyTypes;\n const queryVersion = override.query.version ?? query?.version;\n\n const hasVueQueryV4 =\n OutputClient.VUE_QUERY === outputClient &&\n (!isVueQueryV3(context.output.packageJson) || queryVersion === 4);\n const hasSvelteQueryV4 =\n OutputClient.SVELTE_QUERY === outputClient &&\n (!isSvelteQueryV3(context.output.packageJson) || queryVersion === 4);\n const hasSvelteQueryV6 =\n OutputClient.SVELTE_QUERY === outputClient &&\n isSvelteQueryV6(context.output.packageJson);\n\n const hasQueryV5 =\n queryVersion === 5 ||\n isQueryV5(\n context.output.packageJson,\n outputClient as 'react-query' | 'vue-query' | 'svelte-query',\n );\n\n const hasQueryV5WithDataTagError =\n queryVersion === 5 ||\n isQueryV5WithDataTagError(\n context.output.packageJson,\n outputClient as 'react-query' | 'vue-query' | 'svelte-query',\n );\n\n const hasQueryV5WithInfiniteQueryOptionsError =\n queryVersion === 5 ||\n isQueryV5WithInfiniteQueryOptionsError(\n context.output.packageJson,\n outputClient as 'react-query' | 'vue-query' | 'svelte-query',\n );\n\n const httpClient = context.output.httpClient;\n const doc = jsDoc({ summary, deprecated });\n\n let implementation = '';\n let mutators;\n\n // Allows operationQueryOptions (which is the Orval config override for the operationId)\n // to override non-GET verbs\n const hasOperationQueryOption = !!(\n operationQueryOptions &&\n (operationQueryOptions.useQuery ||\n operationQueryOptions.useSuspenseQuery ||\n operationQueryOptions.useInfinite ||\n operationQueryOptions.useSuspenseInfiniteQuery)\n );\n\n let isQuery =\n (Verbs.GET === verb &&\n (override.query.useQuery ||\n override.query.useSuspenseQuery ||\n override.query.useInfinite ||\n override.query.useSuspenseInfiniteQuery)) ||\n hasOperationQueryOption;\n\n let isMutation = override.query.useMutation && verb !== Verbs.GET;\n\n if (operationQueryOptions?.useMutation !== undefined) {\n isMutation = operationQueryOptions.useMutation;\n }\n\n // If both query and mutation are true for a non-GET operation, prioritize query\n if (verb !== Verbs.GET && isQuery) {\n isMutation = false;\n }\n\n // If both query and mutation are true for a GET operation, prioritize mutation\n if (verb === Verbs.GET && isMutation) {\n isQuery = false;\n }\n\n if (isQuery) {\n const queryKeyMutator = query.queryKey\n ? await generateMutator({\n output,\n mutator: query.queryKey,\n name: `${operationName}QueryKey`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const queryOptionsMutator = query.queryOptions\n ? await generateMutator({\n output,\n mutator: query.queryOptions,\n name: `${operationName}QueryOptions`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const queryProperties = props\n .map((param) => {\n if (\n param.type === GetterPropType.NAMED_PATH_PARAMS &&\n !isVue(outputClient)\n )\n return param.destructured;\n return param.type === GetterPropType.BODY\n ? body.implementation\n : param.name;\n })\n .join(',');\n\n const queryKeyProperties = props\n .filter((prop) => prop.type !== GetterPropType.HEADER)\n .map((param) => {\n if (\n param.type === GetterPropType.NAMED_PATH_PARAMS &&\n !isVue(outputClient)\n )\n return param.destructured;\n return param.type === GetterPropType.BODY\n ? body.implementation\n : param.name;\n })\n .join(',');\n\n const queries = [\n ...(query?.useInfinite || operationQueryOptions?.useInfinite\n ? [\n {\n name: camel(`${operationName}-infinite`),\n options: query?.options,\n type: QueryType.INFINITE,\n queryParam: query?.useInfiniteQueryParam,\n queryKeyFnName: camel(`get-${operationName}-infinite-query-key`),\n },\n ]\n : []),\n ...(query?.useQuery || operationQueryOptions?.useQuery\n ? [\n {\n name: operationName,\n options: query?.options,\n type: QueryType.QUERY,\n queryKeyFnName: camel(`get-${operationName}-query-key`),\n },\n ]\n : []),\n ...(query?.useSuspenseQuery || operationQueryOptions?.useSuspenseQuery\n ? [\n {\n name: camel(`${operationName}-suspense`),\n options: query?.options,\n type: QueryType.SUSPENSE_QUERY,\n queryKeyFnName: camel(`get-${operationName}-query-key`),\n },\n ]\n : []),\n ...(query?.useSuspenseInfiniteQuery ||\n operationQueryOptions?.useSuspenseInfiniteQuery\n ? [\n {\n name: camel(`${operationName}-suspense-infinite`),\n options: query?.options,\n type: QueryType.SUSPENSE_INFINITE,\n queryParam: query?.useInfiniteQueryParam,\n queryKeyFnName: camel(`get-${operationName}-infinite-query-key`),\n },\n ]\n : []),\n ];\n\n // Convert \"param: Type\" to \"param?: Type\" for queryKey functions\n // to enable cache invalidation without type assertion\n const makeParamsOptional = (params: string) => {\n if (!params) return '';\n // Handle parameters with default values: \"param?: Type = value\" -> \"param: Type = value\" (remove optional marker)\n // Handle regular parameters: \"param: Type\" -> \"param?: Type\"\n return params.replaceAll(\n /(\\w+)(\\?)?:\\s*([^=,}]*?)\\s*(=\\s*[^,}]*)?([,}]|$)/g,\n (match, paramName, optionalMarker, type, defaultValue, suffix) => {\n // If parameter has a default value, don't add '?' (it's already effectively optional)\n if (defaultValue) {\n return `${paramName}: ${type.trim()}${defaultValue}${suffix}`;\n }\n // Otherwise, make it optional\n return `${paramName}?: ${type.trim()}${suffix}`;\n },\n );\n };\n\n const uniqueQueryOptionsByKeys = queries.filter(\n (obj, index, self) =>\n index ===\n self.findIndex((t) => t.queryKeyFnName === obj.queryKeyFnName),\n );\n\n implementation += `\n${\n queryKeyMutator\n ? ''\n : uniqueQueryOptionsByKeys.reduce((acc, queryOption) => {\n const queryKeyProps = makeParamsOptional(\n toObjectString(\n props.filter((prop) => prop.type !== GetterPropType.HEADER),\n 'implementation',\n ),\n );\n\n const routeString =\n isVue(outputClient) || override.query.shouldSplitQueryKey\n ? getRouteAsArray(route) // Note: this is required for reactivity to work, we will lose it if route params are converted into string, only as array they will be tracked // TODO: add tests for this\n : `\\`${route}\\``;\n\n // Use operation ID as query key if enabled, otherwise use route string\n const queryKeyIdentifier = override.query.useOperationIdAsQueryKey\n ? `\"${operationName}\"`\n : routeString;\n\n // Note: do not unref() params in Vue - this will make key lose reactivity\n const queryKeyFn = `\n${override.query.shouldExportQueryKey ? 'export ' : ''}const ${queryOption.queryKeyFnName} = (${queryKeyProps}) => {\n return [\n ${[\n queryOption.type === QueryType.INFINITE ||\n queryOption.type === QueryType.SUSPENSE_INFINITE\n ? `'infinite'`\n : '',\n queryKeyIdentifier,\n queryParams ? '...(params ? [params]: [])' : '',\n body.implementation,\n ]\n .filter((x) => !!x)\n .join(', ')}\n ] as const;\n }\n`;\n return acc + queryKeyFn;\n }, '')\n}`;\n\n implementation += `\n ${queries.reduce((acc, queryOption) => {\n return (\n acc +\n generateQueryImplementation({\n queryOption,\n operationName,\n queryProperties,\n queryKeyProperties,\n params,\n props,\n mutator,\n isRequestOptions,\n queryParams,\n response,\n outputClient,\n httpClient,\n isExactOptionalPropertyTypes,\n hasSignal: getHasSignal({\n overrideQuerySignal: override.query.signal,\n verb,\n }),\n queryOptionsMutator,\n queryKeyMutator,\n route,\n hasVueQueryV4,\n hasSvelteQueryV4,\n hasSvelteQueryV6,\n hasQueryV5,\n hasQueryV5WithDataTagError,\n hasQueryV5WithInfiniteQueryOptionsError,\n doc,\n usePrefetch: query.usePrefetch,\n useQuery: query.useQuery,\n useInfinite: query.useInfinite,\n useInvalidate: query.useInvalidate,\n })\n );\n }, '')}\n`;\n\n mutators =\n queryOptionsMutator || queryKeyMutator\n ? [\n ...(queryOptionsMutator ? [queryOptionsMutator] : []),\n ...(queryKeyMutator ? [queryKeyMutator] : []),\n ]\n : undefined;\n }\n\n if (isMutation) {\n const mutationOptionsMutator = query.mutationOptions\n ? await generateMutator({\n output,\n mutator: query.mutationOptions,\n name: `${operationName}MutationOptions`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const definitions = props\n .map(({ definition, type }) =>\n type === GetterPropType.BODY\n ? mutator?.bodyTypeName\n ? `data: ${mutator.bodyTypeName}<${body.definition}>`\n : `data: ${body.definition}`\n : definition,\n )\n .join(';');\n\n const properties = props\n .map(({ name, type }) => (type === GetterPropType.BODY ? 'data' : name))\n .join(',');\n\n const errorType = getQueryErrorType(\n operationName,\n response,\n httpClient,\n mutator,\n );\n\n const dataType = mutator?.isHook\n ? `ReturnType<typeof use${pascal(operationName)}Hook>`\n : `typeof ${operationName}`;\n\n const mutationOptionFnReturnType = getQueryOptionsDefinition({\n operationName,\n mutator,\n definitions,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n isReturnType: true,\n });\n\n const mutationArguments = generateQueryArguments({\n operationName,\n definitions,\n mutator,\n isRequestOptions,\n hasSvelteQueryV4,\n hasQueryV5,\n hasQueryV5WithInfiniteQueryOptionsError,\n httpClient,\n });\n\n const mutationOptionsFnName = camel(\n mutationOptionsMutator || mutator?.isHook\n ? `use-${operationName}-mutationOptions`\n : `get-${operationName}-mutationOptions`,\n );\n\n const mutationOptionsVarName = isRequestOptions\n ? 'mutationOptions'\n : 'options';\n\n const hooksOptionImplementation = getHooksOptionImplementation(\n isRequestOptions,\n httpClient,\n camel(operationName),\n mutator,\n );\n\n const mutationOptionsFn = `export const ${mutationOptionsFnName} = <TError = ${errorType},\n TContext = unknown>(${mutationArguments}): ${mutationOptionFnReturnType} => {\n\n${hooksOptionImplementation}\n\n ${\n mutator?.isHook\n ? `const ${operationName} = use${pascal(operationName)}Hook()`\n : ''\n }\n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<${dataType}>>, ${\n definitions ? `{${definitions}}` : 'void'\n }> = (${properties ? 'props' : ''}) => {\n ${properties ? `const {${properties}} = props ?? {};` : ''}\n\n return ${operationName}(${properties}${\n properties ? ',' : ''\n }${getMutationRequestArgs(isRequestOptions, httpClient, mutator)})\n }\n\n ${\n mutationOptionsMutator\n ? `const customOptions = ${\n mutationOptionsMutator.name\n }({...mutationOptions, mutationFn}${\n mutationOptionsMutator.hasSecondArg\n ? `, { url: \\`${route.replaceAll('/${', '/{')}\\` }`\n : ''\n }${\n mutationOptionsMutator.hasThirdArg\n ? `, { operationId: '${operationId}', operationName: '${operationName}' }`\n : ''\n });`\n : ''\n }\n\n\n return ${\n mutationOptionsMutator\n ? 'customOptions'\n : '{ mutationFn, ...mutationOptions }'\n }}`;\n\n const operationPrefix = hasSvelteQueryV4 ? 'create' : 'use';\n const optionalQueryClientArgument = hasQueryV5\n ? ', queryClient?: QueryClient'\n : '';\n\n implementation += `\n${mutationOptionsFn}\n\n export type ${pascal(\n operationName,\n )}MutationResult = NonNullable<Awaited<ReturnType<${dataType}>>>\n ${\n body.definition\n ? `export type ${pascal(operationName)}MutationBody = ${\n mutator?.bodyTypeName\n ? `${mutator.bodyTypeName}<${body.definition}>`\n : body.definition\n }`\n : ''\n }\n export type ${pascal(operationName)}MutationError = ${errorType}\n\n ${doc}export const ${camel(\n `${operationPrefix}-${operationName}`,\n )} = <TError = ${errorType},\n TContext = unknown>(${mutationArguments} ${optionalQueryClientArgument})${generateMutatorReturnType(\n {\n outputClient,\n dataType,\n variableType: definitions ? `{${definitions}}` : 'void',\n },\n )} => {\n\n const ${mutationOptionsVarName} = ${mutationOptionsFnName}(${\n isRequestOptions ? 'options' : 'mutationOptions'\n });\n\n return ${operationPrefix}Mutation(${\n hasSvelteQueryV6\n ? `() => ({ ...${mutationOptionsVarName}${optionalQueryClientArgument ? ', queryClient' : ''} })`\n : `${mutationOptionsVarName}${optionalQueryClientArgument ? ', queryClient' : ''}`\n });\n }\n `;\n\n mutators = mutationOptionsMutator\n ? [...(mutators ?? []), mutationOptionsMutator]\n : mutators;\n }\n\n return {\n implementation,\n mutators,\n };\n};\n\nexport const generateQueryHeader: ClientHeaderBuilder = (params) => {\n return `${\n params.hasAwaitedType\n ? ''\n : `type AwaitedInput<T> = PromiseLike<T> | T;\\n\n type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\\n\\n`\n }\n${\n params.isRequestOptions && params.isMutator\n ? `type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\\n\\n`\n : ''\n}\n${getQueryHeader(params)}\n`;\n};\n\nexport const generateQuery: ClientBuilder = async (\n verbOptions,\n options,\n outputClient,\n) => {\n const imports = generateVerbImports(verbOptions);\n const functionImplementation = generateQueryRequestFunction(\n verbOptions,\n options,\n isVue(outputClient),\n );\n const { implementation: hookImplementation, mutators } =\n await generateQueryHook(verbOptions, options, outputClient);\n\n return {\n implementation: `${functionImplementation}\\n\\n${hookImplementation}`,\n imports,\n mutators,\n };\n};\n\nconst dependenciesBuilder: Record<\n 'react-query' | 'vue-query' | 'svelte-query',\n ClientDependenciesBuilder\n> = {\n 'react-query': getReactQueryDependencies,\n 'vue-query': getVueQueryDependencies,\n 'svelte-query': getSvelteQueryDependencies,\n};\n\nexport const builder =\n ({\n type = 'react-query',\n options: queryOptions,\n output,\n }: {\n type?: 'react-query' | 'vue-query' | 'svelte-query';\n options?: QueryOptions;\n output?: NormalizedOutputOptions;\n } = {}) =>\n () => {\n const client: ClientBuilder = (verbOptions, options, outputClient) => {\n if (\n options.override.useNamedParameters &&\n (type === 'vue-query' || outputClient === 'vue-query')\n ) {\n throw new Error(\n `vue-query client does not support named parameters, and had broken reactivity previously, please set useNamedParameters to false; See for context: https://github.com/orval-labs/orval/pull/931#issuecomment-1752355686`,\n );\n }\n\n if (queryOptions) {\n const normalizedQueryOptions = normalizeQueryOptions(\n queryOptions,\n options.context.workspace,\n );\n verbOptions.override.query = mergeDeep(\n normalizedQueryOptions,\n verbOptions.override.query,\n );\n options.override.query = mergeDeep(\n normalizedQueryOptions,\n verbOptions.override.query,\n );\n }\n return generateQuery(verbOptions, options, outputClient, output);\n };\n\n return {\n client: client,\n header: generateQueryHeader,\n dependencies: dependenciesBuilder[type],\n };\n };\n\nexport default builder;\n"],"mappings":";;;;;;AAkBA,MAAa,yBACX,eAA6B,EAAE,EAC/B,oBAC2B;AAC3B,QAAO;EACL,GAAI,aAAa,cAAc,EAAE,aAAa,MAAM,GAAG,EAAE;EACzD,GAAI,aAAa,gBAAgB,EAAE,eAAe,MAAM,GAAG,EAAE;EAC7D,GAAI,aAAa,WAAW,EAAE,UAAU,MAAM,GAAG,EAAE;EACnD,GAAI,aAAa,cAAc,EAAE,aAAa,MAAM,GAAG,EAAE;EACzD,GAAI,aAAa,wBACb,EAAE,uBAAuB,aAAa,uBAAuB,GAC7D,EAAE;EACN,GAAI,aAAa,UAAU,EAAE,SAAS,aAAa,SAAS,GAAG,EAAE;EACjE,GAAI,cAAc,WACd,EACE,UAAU,iBAAiB,iBAAiB,cAAc,SAAS,EACpE,GACD,EAAE;EACN,GAAI,cAAc,eACd,EACE,cAAc,iBACZ,iBACA,cAAc,aACf,EACF,GACD,EAAE;EACN,GAAI,cAAc,kBACd,EACE,iBAAiB,iBACf,iBACA,cAAc,gBACf,EACF,GACD,EAAE;EACN,GAAI,aAAa,SAAS,EAAE,QAAQ,MAAM,GAAG,EAAE;EAC/C,GAAI,aAAa,2BACb,EAAE,0BAA0B,MAAM,GAClC,EAAE;EACN,GAAI,aAAa,uBACb,EAAE,sBAAsB,MAAM,GAC9B,EAAE;EACN,GAAI,aAAa,yBACb,EAAE,wBAAwB,MAAM,GAChC,EAAE;EACN,GAAI,aAAa,sBAAsB,EAAE,qBAAqB,MAAM,GAAG,EAAE;EACzE,GAAI,aAAa,2BACb,EAAE,0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,MACR,0NACD;AAGH,MAAI,cAAc;GAChB,MAAM,yBAAyB,sBAC7B,cACA,QAAQ,QAAQ,UACjB;AACD,eAAY,SAAS,QAAQ,UAC3B,wBACA,YAAY,SAAS,MACtB;AACD,WAAQ,SAAS,QAAQ,UACvB,wBACA,YAAY,SAAS,MACtB;;AAEH,SAAO,cAAc,aAAa,SAAS,cAAc,OAAO;;AAGlE,QAAO;EACG;EACR,QAAQ;EACR,cAAc,oBAAoB;EACnC;;AAGL,kBAAe"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orval/query",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"exports": {
|
|
6
|
-
"
|
|
7
|
+
"import": {
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
8
|
-
"
|
|
9
|
+
"import": "./dist/index.js"
|
|
9
10
|
}
|
|
10
11
|
},
|
|
11
12
|
"files": [
|
|
@@ -21,16 +22,16 @@
|
|
|
21
22
|
"nuke": "rimraf .turbo dist node_modules"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"@orval/core": "
|
|
25
|
-
"@orval/fetch": "
|
|
26
|
-
"chalk": "^
|
|
27
|
-
"
|
|
25
|
+
"@orval/core": "8.0.0-rc.1",
|
|
26
|
+
"@orval/fetch": "8.0.0-rc.1",
|
|
27
|
+
"chalk": "^5.6.2",
|
|
28
|
+
"remeda": "^2.32.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"@types/lodash.omitby": "^4.6.9",
|
|
31
31
|
"eslint": "^9.38.0",
|
|
32
32
|
"rimraf": "^6.0.1",
|
|
33
|
-
"tsdown": "^0.15.
|
|
34
|
-
"vitest": "^
|
|
35
|
-
}
|
|
33
|
+
"tsdown": "^0.15.9",
|
|
34
|
+
"vitest": "^4.0.3"
|
|
35
|
+
},
|
|
36
|
+
"stableVersion": "8.0.0-rc.0"
|
|
36
37
|
}
|