@kubb/plugin-react-query 3.6.0 → 3.6.2
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/{chunk-24QUS4FB.js → chunk-3HATQDSG.js} +75 -76
- package/dist/chunk-3HATQDSG.js.map +1 -0
- package/dist/{chunk-RPWSQAN7.cjs → chunk-4WFEGLYQ.cjs} +75 -76
- package/dist/chunk-4WFEGLYQ.cjs.map +1 -0
- package/dist/{chunk-GV5NZIXE.js → chunk-DIM4VLBE.js} +14 -31
- package/dist/chunk-DIM4VLBE.js.map +1 -0
- package/dist/{chunk-FBXEPKAE.cjs → chunk-MFB4FCMF.cjs} +30 -47
- package/dist/chunk-MFB4FCMF.cjs.map +1 -0
- package/dist/components.cjs +9 -9
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/generators.cjs +6 -6
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/{types-BBUEQBBf.d.cts → types-CQseu_km.d.cts} +1 -1
- package/dist/{types-BBUEQBBf.d.ts → types-CQseu_km.d.ts} +1 -1
- package/package.json +13 -13
- package/src/generators/__snapshots__/clientPostImportPath.ts +1 -1
- package/src/generators/__snapshots__/postAsQuery.ts +1 -1
- package/src/generators/__snapshots__/updatePetById.ts +1 -1
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +1 -1
- package/src/generators/infiniteQueryGenerator.tsx +3 -1
- package/src/generators/mutationGenerator.tsx +3 -1
- package/src/generators/queryGenerator.tsx +4 -17
- package/src/generators/suspenseQueryGenerator.tsx +3 -1
- package/dist/chunk-24QUS4FB.js.map +0 -1
- package/dist/chunk-FBXEPKAE.cjs.map +0 -1
- package/dist/chunk-GV5NZIXE.js.map +0 -1
- package/dist/chunk-RPWSQAN7.cjs.map +0 -1
|
@@ -21,7 +21,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
21
21
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
22
22
|
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
23
23
|
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
24
|
-
} :
|
|
24
|
+
} : void 0
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
function Url({ name, isExportable = true, isIndexable = true, typeSchemas, baseURL, paramsType, paramsCasing, pathParamsType, operation }) {
|
|
@@ -40,15 +40,15 @@ function getParams2({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
40
40
|
data: typeSchemas.request?.name ? {
|
|
41
41
|
type: typeSchemas.request?.name,
|
|
42
42
|
optional: isOptional(typeSchemas.request?.schema)
|
|
43
|
-
} :
|
|
43
|
+
} : void 0,
|
|
44
44
|
params: typeSchemas.queryParams?.name ? {
|
|
45
45
|
type: typeSchemas.queryParams?.name,
|
|
46
46
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
47
|
-
} :
|
|
47
|
+
} : void 0,
|
|
48
48
|
headers: typeSchemas.headerParams?.name ? {
|
|
49
49
|
type: typeSchemas.headerParams?.name,
|
|
50
50
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
51
|
-
} :
|
|
51
|
+
} : void 0
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
config: {
|
|
@@ -62,19 +62,19 @@ function getParams2({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
62
62
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
63
63
|
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
64
64
|
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
65
|
-
} :
|
|
65
|
+
} : void 0,
|
|
66
66
|
data: typeSchemas.request?.name ? {
|
|
67
67
|
type: typeSchemas.request?.name,
|
|
68
68
|
optional: isOptional(typeSchemas.request?.schema)
|
|
69
|
-
} :
|
|
69
|
+
} : void 0,
|
|
70
70
|
params: typeSchemas.queryParams?.name ? {
|
|
71
71
|
type: typeSchemas.queryParams?.name,
|
|
72
72
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
73
|
-
} :
|
|
73
|
+
} : void 0,
|
|
74
74
|
headers: typeSchemas.headerParams?.name ? {
|
|
75
75
|
type: typeSchemas.headerParams?.name,
|
|
76
76
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
77
|
-
} :
|
|
77
|
+
} : void 0,
|
|
78
78
|
config: {
|
|
79
79
|
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : "Partial<RequestConfig> & { client?: typeof client }",
|
|
80
80
|
default: "{}"
|
|
@@ -100,8 +100,8 @@ function Client({
|
|
|
100
100
|
const contentType = operation.getContentType();
|
|
101
101
|
const isFormData = contentType === "multipart/form-data";
|
|
102
102
|
const headers = [
|
|
103
|
-
contentType !== "application/json" ? `'Content-Type': '${contentType}'` :
|
|
104
|
-
typeSchemas.headerParams?.name ? "...headers" :
|
|
103
|
+
contentType !== "application/json" ? `'Content-Type': '${contentType}'` : void 0,
|
|
104
|
+
typeSchemas.headerParams?.name ? "...headers" : void 0
|
|
105
105
|
].filter(Boolean);
|
|
106
106
|
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
107
107
|
const generics = [typeSchemas.response.name, TError, typeSchemas.request?.name || "unknown"].filter(Boolean);
|
|
@@ -124,17 +124,17 @@ function Client({
|
|
|
124
124
|
},
|
|
125
125
|
baseURL: baseURL && !urlName ? {
|
|
126
126
|
value: JSON.stringify(baseURL)
|
|
127
|
-
} :
|
|
128
|
-
params: typeSchemas.queryParams?.name ? {} :
|
|
127
|
+
} : void 0,
|
|
128
|
+
params: typeSchemas.queryParams?.name ? {} : void 0,
|
|
129
129
|
data: typeSchemas.request?.name ? {
|
|
130
|
-
value: isFormData ? "formData" :
|
|
131
|
-
} :
|
|
130
|
+
value: parser === "zod" && zodSchemas ? `${zodSchemas.request?.name}.parse(${isFormData ? "formData" : "data"})` : isFormData ? "formData" : void 0
|
|
131
|
+
} : void 0,
|
|
132
132
|
requestConfig: {
|
|
133
133
|
mode: "inlineSpread"
|
|
134
134
|
},
|
|
135
135
|
headers: headers.length ? {
|
|
136
|
-
value: headers.length ? `{ ${headers.join(", ")}, ...requestConfig.headers }` :
|
|
137
|
-
} :
|
|
136
|
+
value: headers.length ? `{ ${headers.join(", ")}, ...requestConfig.headers }` : void 0
|
|
137
|
+
} : void 0
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
});
|
|
@@ -183,7 +183,7 @@ function Operations({ name, operations }) {
|
|
|
183
183
|
method: operation.method
|
|
184
184
|
};
|
|
185
185
|
});
|
|
186
|
-
return /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Const, { name, export: true, asConst: true, children: JSON.stringify(operationsObject,
|
|
186
|
+
return /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Const, { name, export: true, asConst: true, children: JSON.stringify(operationsObject, void 0, 2) }) });
|
|
187
187
|
}
|
|
188
188
|
function getParams3({}) {
|
|
189
189
|
return FunctionParams.factory({});
|
|
@@ -193,7 +193,7 @@ var getTransformer = ({ operation, casing }) => {
|
|
|
193
193
|
return [JSON.stringify({ url: path.path })].filter(Boolean);
|
|
194
194
|
};
|
|
195
195
|
function MutationKey({ name, typeSchemas, pathParamsType, paramsCasing, operation, typeName, transformer = getTransformer }) {
|
|
196
|
-
const params = getParams3({
|
|
196
|
+
const params = getParams3({ });
|
|
197
197
|
const keys = transformer({ operation, schemas: typeSchemas, casing: paramsCasing });
|
|
198
198
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
199
199
|
/* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Function.Arrow, { name, export: true, params: params.toConstructor(), singleLine: true, children: `[${keys.join(", ")}] as const` }) }),
|
|
@@ -209,19 +209,19 @@ function getParams4({ paramsCasing, dataReturnType, typeSchemas }) {
|
|
|
209
209
|
data: typeSchemas.request?.name ? {
|
|
210
210
|
type: typeSchemas.request?.name,
|
|
211
211
|
optional: isOptional(typeSchemas.request?.schema)
|
|
212
|
-
} :
|
|
212
|
+
} : void 0,
|
|
213
213
|
params: typeSchemas.queryParams?.name ? {
|
|
214
214
|
type: typeSchemas.queryParams?.name,
|
|
215
215
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
216
|
-
} :
|
|
216
|
+
} : void 0,
|
|
217
217
|
headers: typeSchemas.headerParams?.name ? {
|
|
218
218
|
type: typeSchemas.headerParams?.name,
|
|
219
219
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
220
|
-
} :
|
|
220
|
+
} : void 0
|
|
221
221
|
});
|
|
222
222
|
const TRequest = mutationParams.toConstructor({ valueAsType: true });
|
|
223
223
|
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
224
|
-
const generics = [TData, TError, TRequest ? `{${TRequest}}` :
|
|
224
|
+
const generics = [TData, TError, TRequest ? `{${TRequest}}` : void 0].filter(Boolean).join(", ");
|
|
225
225
|
return FunctionParams.factory({
|
|
226
226
|
options: {
|
|
227
227
|
type: `
|
|
@@ -251,7 +251,6 @@ function Mutation({
|
|
|
251
251
|
});
|
|
252
252
|
const params = getParams4({
|
|
253
253
|
paramsCasing,
|
|
254
|
-
pathParamsType,
|
|
255
254
|
dataReturnType,
|
|
256
255
|
typeSchemas
|
|
257
256
|
});
|
|
@@ -266,15 +265,15 @@ function Mutation({
|
|
|
266
265
|
data: typeSchemas.request?.name ? {
|
|
267
266
|
type: typeSchemas.request?.name,
|
|
268
267
|
optional: isOptional(typeSchemas.request?.schema)
|
|
269
|
-
} :
|
|
268
|
+
} : void 0,
|
|
270
269
|
params: typeSchemas.queryParams?.name ? {
|
|
271
270
|
type: typeSchemas.queryParams?.name,
|
|
272
271
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
273
|
-
} :
|
|
272
|
+
} : void 0,
|
|
274
273
|
headers: typeSchemas.headerParams?.name ? {
|
|
275
274
|
type: typeSchemas.headerParams?.name,
|
|
276
275
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
277
|
-
} :
|
|
276
|
+
} : void 0
|
|
278
277
|
});
|
|
279
278
|
const dataParams = FunctionParams.factory({
|
|
280
279
|
data: {
|
|
@@ -285,7 +284,7 @@ function Mutation({
|
|
|
285
284
|
if (value) {
|
|
286
285
|
acc[key] = {
|
|
287
286
|
...value,
|
|
288
|
-
type:
|
|
287
|
+
type: void 0
|
|
289
288
|
};
|
|
290
289
|
}
|
|
291
290
|
return acc;
|
|
@@ -295,7 +294,7 @@ function Mutation({
|
|
|
295
294
|
const TRequest = mutationParams.toConstructor({ valueAsType: true });
|
|
296
295
|
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
297
296
|
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
298
|
-
const generics = [TData, TError, TRequest ? `{${TRequest}}` :
|
|
297
|
+
const generics = [TData, TError, TRequest ? `{${TRequest}}` : void 0].filter(Boolean).join(", ");
|
|
299
298
|
return /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(
|
|
300
299
|
Function,
|
|
301
300
|
{
|
|
@@ -329,11 +328,11 @@ function getParams5({ pathParamsType, paramsCasing, typeSchemas }) {
|
|
|
329
328
|
data: typeSchemas.request?.name ? {
|
|
330
329
|
type: typeSchemas.request?.name,
|
|
331
330
|
optional: isOptional(typeSchemas.request?.schema)
|
|
332
|
-
} :
|
|
331
|
+
} : void 0,
|
|
333
332
|
params: typeSchemas.queryParams?.name ? {
|
|
334
333
|
type: typeSchemas.queryParams?.name,
|
|
335
334
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
336
|
-
} :
|
|
335
|
+
} : void 0
|
|
337
336
|
});
|
|
338
337
|
}
|
|
339
338
|
var getTransformer2 = ({ operation, schemas, casing }) => {
|
|
@@ -343,8 +342,8 @@ var getTransformer2 = ({ operation, schemas, casing }) => {
|
|
|
343
342
|
type: "path",
|
|
344
343
|
stringify: true
|
|
345
344
|
}),
|
|
346
|
-
schemas.queryParams?.name ? "...(params ? [params] : [])" :
|
|
347
|
-
schemas.request?.name ? "...(data ? [data] : [])" :
|
|
345
|
+
schemas.queryParams?.name ? "...(params ? [params] : [])" : void 0,
|
|
346
|
+
schemas.request?.name ? "...(data ? [data] : [])" : void 0
|
|
348
347
|
].filter(Boolean);
|
|
349
348
|
return keys;
|
|
350
349
|
};
|
|
@@ -372,15 +371,15 @@ function getParams6({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
372
371
|
data: typeSchemas.request?.name ? {
|
|
373
372
|
type: typeSchemas.request?.name,
|
|
374
373
|
optional: isOptional(typeSchemas.request?.schema)
|
|
375
|
-
} :
|
|
374
|
+
} : void 0,
|
|
376
375
|
params: typeSchemas.queryParams?.name ? {
|
|
377
376
|
type: typeSchemas.queryParams?.name,
|
|
378
377
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
379
|
-
} :
|
|
378
|
+
} : void 0,
|
|
380
379
|
headers: typeSchemas.headerParams?.name ? {
|
|
381
380
|
type: typeSchemas.headerParams?.name,
|
|
382
381
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
383
|
-
} :
|
|
382
|
+
} : void 0
|
|
384
383
|
}
|
|
385
384
|
},
|
|
386
385
|
config: {
|
|
@@ -394,19 +393,19 @@ function getParams6({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
394
393
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
395
394
|
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
396
395
|
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
397
|
-
} :
|
|
396
|
+
} : void 0,
|
|
398
397
|
data: typeSchemas.request?.name ? {
|
|
399
398
|
type: typeSchemas.request?.name,
|
|
400
399
|
optional: isOptional(typeSchemas.request?.schema)
|
|
401
|
-
} :
|
|
400
|
+
} : void 0,
|
|
402
401
|
params: typeSchemas.queryParams?.name ? {
|
|
403
402
|
type: typeSchemas.queryParams?.name,
|
|
404
403
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
405
|
-
} :
|
|
404
|
+
} : void 0,
|
|
406
405
|
headers: typeSchemas.headerParams?.name ? {
|
|
407
406
|
type: typeSchemas.headerParams?.name,
|
|
408
407
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
409
|
-
} :
|
|
408
|
+
} : void 0,
|
|
410
409
|
config: {
|
|
411
410
|
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : "Partial<RequestConfig> & { client?: typeof client }",
|
|
412
411
|
default: "{}"
|
|
@@ -428,7 +427,7 @@ function QueryOptions({ name, clientName, dataReturnType, typeSchemas, paramsCas
|
|
|
428
427
|
typeSchemas,
|
|
429
428
|
paramsCasing
|
|
430
429
|
});
|
|
431
|
-
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key :
|
|
430
|
+
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
|
|
432
431
|
const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
|
|
433
432
|
return /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Function, { name, export: true, params: params.toConstructor(), children: `
|
|
434
433
|
const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})
|
|
@@ -455,15 +454,15 @@ function getParams7({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
455
454
|
data: typeSchemas.request?.name ? {
|
|
456
455
|
type: typeSchemas.request?.name,
|
|
457
456
|
optional: isOptional(typeSchemas.request?.schema)
|
|
458
|
-
} :
|
|
457
|
+
} : void 0,
|
|
459
458
|
params: typeSchemas.queryParams?.name ? {
|
|
460
459
|
type: typeSchemas.queryParams?.name,
|
|
461
460
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
462
|
-
} :
|
|
461
|
+
} : void 0,
|
|
463
462
|
headers: typeSchemas.headerParams?.name ? {
|
|
464
463
|
type: typeSchemas.headerParams?.name,
|
|
465
464
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
466
|
-
} :
|
|
465
|
+
} : void 0
|
|
467
466
|
}
|
|
468
467
|
},
|
|
469
468
|
options: {
|
|
@@ -482,19 +481,19 @@ function getParams7({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
482
481
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
483
482
|
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
484
483
|
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
485
|
-
} :
|
|
484
|
+
} : void 0,
|
|
486
485
|
data: typeSchemas.request?.name ? {
|
|
487
486
|
type: typeSchemas.request?.name,
|
|
488
487
|
optional: isOptional(typeSchemas.request?.schema)
|
|
489
|
-
} :
|
|
488
|
+
} : void 0,
|
|
490
489
|
params: typeSchemas.queryParams?.name ? {
|
|
491
490
|
type: typeSchemas.queryParams?.name,
|
|
492
491
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
493
|
-
} :
|
|
492
|
+
} : void 0,
|
|
494
493
|
headers: typeSchemas.headerParams?.name ? {
|
|
495
494
|
type: typeSchemas.headerParams?.name,
|
|
496
495
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
497
|
-
} :
|
|
496
|
+
} : void 0,
|
|
498
497
|
options: {
|
|
499
498
|
type: `
|
|
500
499
|
{
|
|
@@ -579,15 +578,15 @@ function getParams8({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
579
578
|
data: typeSchemas.request?.name ? {
|
|
580
579
|
type: typeSchemas.request?.name,
|
|
581
580
|
optional: isOptional(typeSchemas.request?.schema)
|
|
582
|
-
} :
|
|
581
|
+
} : void 0,
|
|
583
582
|
params: typeSchemas.queryParams?.name ? {
|
|
584
583
|
type: typeSchemas.queryParams?.name,
|
|
585
584
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
586
|
-
} :
|
|
585
|
+
} : void 0,
|
|
587
586
|
headers: typeSchemas.headerParams?.name ? {
|
|
588
587
|
type: typeSchemas.headerParams?.name,
|
|
589
588
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
590
|
-
} :
|
|
589
|
+
} : void 0
|
|
591
590
|
}
|
|
592
591
|
},
|
|
593
592
|
config: {
|
|
@@ -601,19 +600,19 @@ function getParams8({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
601
600
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
602
601
|
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
603
602
|
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
604
|
-
} :
|
|
603
|
+
} : void 0,
|
|
605
604
|
data: typeSchemas.request?.name ? {
|
|
606
605
|
type: typeSchemas.request?.name,
|
|
607
606
|
optional: isOptional(typeSchemas.request?.schema)
|
|
608
|
-
} :
|
|
607
|
+
} : void 0,
|
|
609
608
|
params: typeSchemas.queryParams?.name ? {
|
|
610
609
|
type: typeSchemas.queryParams?.name,
|
|
611
610
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
612
|
-
} :
|
|
611
|
+
} : void 0,
|
|
613
612
|
headers: typeSchemas.headerParams?.name ? {
|
|
614
613
|
type: typeSchemas.headerParams?.name,
|
|
615
614
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
616
|
-
} :
|
|
615
|
+
} : void 0,
|
|
617
616
|
config: {
|
|
618
617
|
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : "Partial<RequestConfig> & { client?: typeof client }",
|
|
619
618
|
default: "{}"
|
|
@@ -649,17 +648,17 @@ function InfiniteQueryOptions({
|
|
|
649
648
|
});
|
|
650
649
|
const queryOptions = [
|
|
651
650
|
`initialPageParam: ${typeof initialPageParam === "string" ? JSON.stringify(initialPageParam) : initialPageParam}`,
|
|
652
|
-
cursorParam ? `getNextPageParam: (lastPage) => lastPage['${cursorParam}']` :
|
|
653
|
-
cursorParam ? `getPreviousPageParam: (firstPage) => firstPage['${cursorParam}']` :
|
|
654
|
-
!cursorParam && dataReturnType === "full" ? "getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage.data) && lastPage.data.length === 0 ? undefined : lastPageParam + 1" :
|
|
655
|
-
!cursorParam && dataReturnType === "data" ? "getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage) && lastPage.length === 0 ? undefined : lastPageParam + 1" :
|
|
656
|
-
!cursorParam ? "getPreviousPageParam: (_firstPage, _allPages, firstPageParam) => firstPageParam <= 1 ? undefined : firstPageParam - 1" :
|
|
651
|
+
cursorParam ? `getNextPageParam: (lastPage) => lastPage['${cursorParam}']` : void 0,
|
|
652
|
+
cursorParam ? `getPreviousPageParam: (firstPage) => firstPage['${cursorParam}']` : void 0,
|
|
653
|
+
!cursorParam && dataReturnType === "full" ? "getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage.data) && lastPage.data.length === 0 ? undefined : lastPageParam + 1" : void 0,
|
|
654
|
+
!cursorParam && dataReturnType === "data" ? "getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage) && lastPage.length === 0 ? undefined : lastPageParam + 1" : void 0,
|
|
655
|
+
!cursorParam ? "getPreviousPageParam: (_firstPage, _allPages, firstPageParam) => firstPageParam <= 1 ? undefined : firstPageParam - 1" : void 0
|
|
657
656
|
].filter(Boolean);
|
|
658
657
|
const infiniteOverrideParams = queryParam && typeSchemas.queryParams?.name ? `
|
|
659
658
|
if(params) {
|
|
660
659
|
params['${queryParam}'] = pageParam as unknown as ${typeSchemas.queryParams?.name}['${queryParam}']
|
|
661
660
|
}` : "";
|
|
662
|
-
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key :
|
|
661
|
+
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
|
|
663
662
|
const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
|
|
664
663
|
if (infiniteOverrideParams) {
|
|
665
664
|
return /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Function, { name, export: true, params: params.toConstructor(), children: `
|
|
@@ -702,15 +701,15 @@ function getParams9({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
702
701
|
data: typeSchemas.request?.name ? {
|
|
703
702
|
type: typeSchemas.request?.name,
|
|
704
703
|
optional: isOptional(typeSchemas.request?.schema)
|
|
705
|
-
} :
|
|
704
|
+
} : void 0,
|
|
706
705
|
params: typeSchemas.queryParams?.name ? {
|
|
707
706
|
type: typeSchemas.queryParams?.name,
|
|
708
707
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
709
|
-
} :
|
|
708
|
+
} : void 0,
|
|
710
709
|
headers: typeSchemas.headerParams?.name ? {
|
|
711
710
|
type: typeSchemas.headerParams?.name,
|
|
712
711
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
713
|
-
} :
|
|
712
|
+
} : void 0
|
|
714
713
|
}
|
|
715
714
|
},
|
|
716
715
|
options: {
|
|
@@ -729,19 +728,19 @@ function getParams9({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
729
728
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
730
729
|
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
731
730
|
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
732
|
-
} :
|
|
731
|
+
} : void 0,
|
|
733
732
|
data: typeSchemas.request?.name ? {
|
|
734
733
|
type: typeSchemas.request?.name,
|
|
735
734
|
optional: isOptional(typeSchemas.request?.schema)
|
|
736
|
-
} :
|
|
735
|
+
} : void 0,
|
|
737
736
|
params: typeSchemas.queryParams?.name ? {
|
|
738
737
|
type: typeSchemas.queryParams?.name,
|
|
739
738
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
740
|
-
} :
|
|
739
|
+
} : void 0,
|
|
741
740
|
headers: typeSchemas.headerParams?.name ? {
|
|
742
741
|
type: typeSchemas.headerParams?.name,
|
|
743
742
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
744
|
-
} :
|
|
743
|
+
} : void 0,
|
|
745
744
|
options: {
|
|
746
745
|
type: `
|
|
747
746
|
{
|
|
@@ -828,15 +827,15 @@ function getParams10({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
828
827
|
data: typeSchemas.request?.name ? {
|
|
829
828
|
type: typeSchemas.request?.name,
|
|
830
829
|
optional: isOptional(typeSchemas.request?.schema)
|
|
831
|
-
} :
|
|
830
|
+
} : void 0,
|
|
832
831
|
params: typeSchemas.queryParams?.name ? {
|
|
833
832
|
type: typeSchemas.queryParams?.name,
|
|
834
833
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
835
|
-
} :
|
|
834
|
+
} : void 0,
|
|
836
835
|
headers: typeSchemas.headerParams?.name ? {
|
|
837
836
|
type: typeSchemas.headerParams?.name,
|
|
838
837
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
839
|
-
} :
|
|
838
|
+
} : void 0
|
|
840
839
|
}
|
|
841
840
|
},
|
|
842
841
|
options: {
|
|
@@ -855,19 +854,19 @@ function getParams10({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
855
854
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
856
855
|
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
857
856
|
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
858
|
-
} :
|
|
857
|
+
} : void 0,
|
|
859
858
|
data: typeSchemas.request?.name ? {
|
|
860
859
|
type: typeSchemas.request?.name,
|
|
861
860
|
optional: isOptional(typeSchemas.request?.schema)
|
|
862
|
-
} :
|
|
861
|
+
} : void 0,
|
|
863
862
|
params: typeSchemas.queryParams?.name ? {
|
|
864
863
|
type: typeSchemas.queryParams?.name,
|
|
865
864
|
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
866
|
-
} :
|
|
865
|
+
} : void 0,
|
|
867
866
|
headers: typeSchemas.headerParams?.name ? {
|
|
868
867
|
type: typeSchemas.headerParams?.name,
|
|
869
868
|
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
870
|
-
} :
|
|
869
|
+
} : void 0,
|
|
871
870
|
options: {
|
|
872
871
|
type: `
|
|
873
872
|
{
|
|
@@ -944,5 +943,5 @@ function SuspenseQuery({
|
|
|
944
943
|
SuspenseQuery.getParams = getParams10;
|
|
945
944
|
|
|
946
945
|
export { Client, InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Operations, Query, QueryKey, QueryOptions, SuspenseQuery, Url };
|
|
947
|
-
//# sourceMappingURL=chunk-
|
|
948
|
-
//# sourceMappingURL=chunk-
|
|
946
|
+
//# sourceMappingURL=chunk-3HATQDSG.js.map
|
|
947
|
+
//# sourceMappingURL=chunk-3HATQDSG.js.map
|