@kubb/plugin-react-query 3.5.13 → 3.6.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/{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-FBXEPKAE.cjs → chunk-CFRJWAIJ.cjs} +30 -30
- package/dist/chunk-CFRJWAIJ.cjs.map +1 -0
- package/dist/{chunk-GV5NZIXE.js → chunk-JCDQO4LP.js} +13 -13
- package/dist/chunk-JCDQO4LP.js.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 +12 -12
- 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 +3 -1
- 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
|
@@ -23,7 +23,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
23
23
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
24
24
|
children: utils$1.getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
25
25
|
optional: oas.isOptional(typeSchemas.pathParams?.schema)
|
|
26
|
-
} :
|
|
26
|
+
} : void 0
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
function Url({ name, isExportable = true, isIndexable = true, typeSchemas, baseURL, paramsType, paramsCasing, pathParamsType, operation }) {
|
|
@@ -42,15 +42,15 @@ function getParams2({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
42
42
|
data: typeSchemas.request?.name ? {
|
|
43
43
|
type: typeSchemas.request?.name,
|
|
44
44
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
45
|
-
} :
|
|
45
|
+
} : void 0,
|
|
46
46
|
params: typeSchemas.queryParams?.name ? {
|
|
47
47
|
type: typeSchemas.queryParams?.name,
|
|
48
48
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
49
|
-
} :
|
|
49
|
+
} : void 0,
|
|
50
50
|
headers: typeSchemas.headerParams?.name ? {
|
|
51
51
|
type: typeSchemas.headerParams?.name,
|
|
52
52
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
53
|
-
} :
|
|
53
|
+
} : void 0
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
config: {
|
|
@@ -64,19 +64,19 @@ function getParams2({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
64
64
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
65
65
|
children: utils$1.getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
66
66
|
optional: oas.isOptional(typeSchemas.pathParams?.schema)
|
|
67
|
-
} :
|
|
67
|
+
} : void 0,
|
|
68
68
|
data: typeSchemas.request?.name ? {
|
|
69
69
|
type: typeSchemas.request?.name,
|
|
70
70
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
71
|
-
} :
|
|
71
|
+
} : void 0,
|
|
72
72
|
params: typeSchemas.queryParams?.name ? {
|
|
73
73
|
type: typeSchemas.queryParams?.name,
|
|
74
74
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
75
|
-
} :
|
|
75
|
+
} : void 0,
|
|
76
76
|
headers: typeSchemas.headerParams?.name ? {
|
|
77
77
|
type: typeSchemas.headerParams?.name,
|
|
78
78
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
79
|
-
} :
|
|
79
|
+
} : void 0,
|
|
80
80
|
config: {
|
|
81
81
|
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : "Partial<RequestConfig> & { client?: typeof client }",
|
|
82
82
|
default: "{}"
|
|
@@ -102,8 +102,8 @@ function Client({
|
|
|
102
102
|
const contentType = operation.getContentType();
|
|
103
103
|
const isFormData = contentType === "multipart/form-data";
|
|
104
104
|
const headers = [
|
|
105
|
-
contentType !== "application/json" ? `'Content-Type': '${contentType}'` :
|
|
106
|
-
typeSchemas.headerParams?.name ? "...headers" :
|
|
105
|
+
contentType !== "application/json" ? `'Content-Type': '${contentType}'` : void 0,
|
|
106
|
+
typeSchemas.headerParams?.name ? "...headers" : void 0
|
|
107
107
|
].filter(Boolean);
|
|
108
108
|
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
109
109
|
const generics = [typeSchemas.response.name, TError, typeSchemas.request?.name || "unknown"].filter(Boolean);
|
|
@@ -126,17 +126,17 @@ function Client({
|
|
|
126
126
|
},
|
|
127
127
|
baseURL: baseURL && !urlName ? {
|
|
128
128
|
value: JSON.stringify(baseURL)
|
|
129
|
-
} :
|
|
130
|
-
params: typeSchemas.queryParams?.name ? {} :
|
|
129
|
+
} : void 0,
|
|
130
|
+
params: typeSchemas.queryParams?.name ? {} : void 0,
|
|
131
131
|
data: typeSchemas.request?.name ? {
|
|
132
|
-
value: isFormData ? "formData" :
|
|
133
|
-
} :
|
|
132
|
+
value: parser === "zod" && zodSchemas ? `${zodSchemas.request?.name}.parse(${isFormData ? "formData" : "data"})` : isFormData ? "formData" : void 0
|
|
133
|
+
} : void 0,
|
|
134
134
|
requestConfig: {
|
|
135
135
|
mode: "inlineSpread"
|
|
136
136
|
},
|
|
137
137
|
headers: headers.length ? {
|
|
138
|
-
value: headers.length ? `{ ${headers.join(", ")}, ...requestConfig.headers }` :
|
|
139
|
-
} :
|
|
138
|
+
value: headers.length ? `{ ${headers.join(", ")}, ...requestConfig.headers }` : void 0
|
|
139
|
+
} : void 0
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
});
|
|
@@ -185,7 +185,7 @@ function Operations({ name, operations }) {
|
|
|
185
185
|
method: operation.method
|
|
186
186
|
};
|
|
187
187
|
});
|
|
188
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Const, { name, export: true, asConst: true, children: JSON.stringify(operationsObject,
|
|
188
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Const, { name, export: true, asConst: true, children: JSON.stringify(operationsObject, void 0, 2) }) });
|
|
189
189
|
}
|
|
190
190
|
function getParams3({}) {
|
|
191
191
|
return react.FunctionParams.factory({});
|
|
@@ -195,7 +195,7 @@ var getTransformer = ({ operation, casing }) => {
|
|
|
195
195
|
return [JSON.stringify({ url: path.path })].filter(Boolean);
|
|
196
196
|
};
|
|
197
197
|
function MutationKey({ name, typeSchemas, pathParamsType, paramsCasing, operation, typeName, transformer = getTransformer }) {
|
|
198
|
-
const params = getParams3({
|
|
198
|
+
const params = getParams3({ });
|
|
199
199
|
const keys = transformer({ operation, schemas: typeSchemas, casing: paramsCasing });
|
|
200
200
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
201
201
|
/* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function.Arrow, { name, export: true, params: params.toConstructor(), singleLine: true, children: `[${keys.join(", ")}] as const` }) }),
|
|
@@ -211,19 +211,19 @@ function getParams4({ paramsCasing, dataReturnType, typeSchemas }) {
|
|
|
211
211
|
data: typeSchemas.request?.name ? {
|
|
212
212
|
type: typeSchemas.request?.name,
|
|
213
213
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
214
|
-
} :
|
|
214
|
+
} : void 0,
|
|
215
215
|
params: typeSchemas.queryParams?.name ? {
|
|
216
216
|
type: typeSchemas.queryParams?.name,
|
|
217
217
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
218
|
-
} :
|
|
218
|
+
} : void 0,
|
|
219
219
|
headers: typeSchemas.headerParams?.name ? {
|
|
220
220
|
type: typeSchemas.headerParams?.name,
|
|
221
221
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
222
|
-
} :
|
|
222
|
+
} : void 0
|
|
223
223
|
});
|
|
224
224
|
const TRequest = mutationParams.toConstructor({ valueAsType: true });
|
|
225
225
|
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
226
|
-
const generics = [TData, TError, TRequest ? `{${TRequest}}` :
|
|
226
|
+
const generics = [TData, TError, TRequest ? `{${TRequest}}` : void 0].filter(Boolean).join(", ");
|
|
227
227
|
return react.FunctionParams.factory({
|
|
228
228
|
options: {
|
|
229
229
|
type: `
|
|
@@ -253,7 +253,6 @@ function Mutation({
|
|
|
253
253
|
});
|
|
254
254
|
const params = getParams4({
|
|
255
255
|
paramsCasing,
|
|
256
|
-
pathParamsType,
|
|
257
256
|
dataReturnType,
|
|
258
257
|
typeSchemas
|
|
259
258
|
});
|
|
@@ -268,15 +267,15 @@ function Mutation({
|
|
|
268
267
|
data: typeSchemas.request?.name ? {
|
|
269
268
|
type: typeSchemas.request?.name,
|
|
270
269
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
271
|
-
} :
|
|
270
|
+
} : void 0,
|
|
272
271
|
params: typeSchemas.queryParams?.name ? {
|
|
273
272
|
type: typeSchemas.queryParams?.name,
|
|
274
273
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
275
|
-
} :
|
|
274
|
+
} : void 0,
|
|
276
275
|
headers: typeSchemas.headerParams?.name ? {
|
|
277
276
|
type: typeSchemas.headerParams?.name,
|
|
278
277
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
279
|
-
} :
|
|
278
|
+
} : void 0
|
|
280
279
|
});
|
|
281
280
|
const dataParams = react.FunctionParams.factory({
|
|
282
281
|
data: {
|
|
@@ -287,7 +286,7 @@ function Mutation({
|
|
|
287
286
|
if (value) {
|
|
288
287
|
acc[key] = {
|
|
289
288
|
...value,
|
|
290
|
-
type:
|
|
289
|
+
type: void 0
|
|
291
290
|
};
|
|
292
291
|
}
|
|
293
292
|
return acc;
|
|
@@ -297,7 +296,7 @@ function Mutation({
|
|
|
297
296
|
const TRequest = mutationParams.toConstructor({ valueAsType: true });
|
|
298
297
|
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
299
298
|
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
300
|
-
const generics = [TData, TError, TRequest ? `{${TRequest}}` :
|
|
299
|
+
const generics = [TData, TError, TRequest ? `{${TRequest}}` : void 0].filter(Boolean).join(", ");
|
|
301
300
|
return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
302
301
|
react.Function,
|
|
303
302
|
{
|
|
@@ -331,11 +330,11 @@ function getParams5({ pathParamsType, paramsCasing, typeSchemas }) {
|
|
|
331
330
|
data: typeSchemas.request?.name ? {
|
|
332
331
|
type: typeSchemas.request?.name,
|
|
333
332
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
334
|
-
} :
|
|
333
|
+
} : void 0,
|
|
335
334
|
params: typeSchemas.queryParams?.name ? {
|
|
336
335
|
type: typeSchemas.queryParams?.name,
|
|
337
336
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
338
|
-
} :
|
|
337
|
+
} : void 0
|
|
339
338
|
});
|
|
340
339
|
}
|
|
341
340
|
var getTransformer2 = ({ operation, schemas, casing }) => {
|
|
@@ -345,8 +344,8 @@ var getTransformer2 = ({ operation, schemas, casing }) => {
|
|
|
345
344
|
type: "path",
|
|
346
345
|
stringify: true
|
|
347
346
|
}),
|
|
348
|
-
schemas.queryParams?.name ? "...(params ? [params] : [])" :
|
|
349
|
-
schemas.request?.name ? "...(data ? [data] : [])" :
|
|
347
|
+
schemas.queryParams?.name ? "...(params ? [params] : [])" : void 0,
|
|
348
|
+
schemas.request?.name ? "...(data ? [data] : [])" : void 0
|
|
350
349
|
].filter(Boolean);
|
|
351
350
|
return keys;
|
|
352
351
|
};
|
|
@@ -374,15 +373,15 @@ function getParams6({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
374
373
|
data: typeSchemas.request?.name ? {
|
|
375
374
|
type: typeSchemas.request?.name,
|
|
376
375
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
377
|
-
} :
|
|
376
|
+
} : void 0,
|
|
378
377
|
params: typeSchemas.queryParams?.name ? {
|
|
379
378
|
type: typeSchemas.queryParams?.name,
|
|
380
379
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
381
|
-
} :
|
|
380
|
+
} : void 0,
|
|
382
381
|
headers: typeSchemas.headerParams?.name ? {
|
|
383
382
|
type: typeSchemas.headerParams?.name,
|
|
384
383
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
385
|
-
} :
|
|
384
|
+
} : void 0
|
|
386
385
|
}
|
|
387
386
|
},
|
|
388
387
|
config: {
|
|
@@ -396,19 +395,19 @@ function getParams6({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
396
395
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
397
396
|
children: utils$1.getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
398
397
|
optional: oas.isOptional(typeSchemas.pathParams?.schema)
|
|
399
|
-
} :
|
|
398
|
+
} : void 0,
|
|
400
399
|
data: typeSchemas.request?.name ? {
|
|
401
400
|
type: typeSchemas.request?.name,
|
|
402
401
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
403
|
-
} :
|
|
402
|
+
} : void 0,
|
|
404
403
|
params: typeSchemas.queryParams?.name ? {
|
|
405
404
|
type: typeSchemas.queryParams?.name,
|
|
406
405
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
407
|
-
} :
|
|
406
|
+
} : void 0,
|
|
408
407
|
headers: typeSchemas.headerParams?.name ? {
|
|
409
408
|
type: typeSchemas.headerParams?.name,
|
|
410
409
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
411
|
-
} :
|
|
410
|
+
} : void 0,
|
|
412
411
|
config: {
|
|
413
412
|
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : "Partial<RequestConfig> & { client?: typeof client }",
|
|
414
413
|
default: "{}"
|
|
@@ -430,7 +429,7 @@ function QueryOptions({ name, clientName, dataReturnType, typeSchemas, paramsCas
|
|
|
430
429
|
typeSchemas,
|
|
431
430
|
paramsCasing
|
|
432
431
|
});
|
|
433
|
-
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key :
|
|
432
|
+
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
|
|
434
433
|
const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
|
|
435
434
|
return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { name, export: true, params: params.toConstructor(), children: `
|
|
436
435
|
const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})
|
|
@@ -457,15 +456,15 @@ function getParams7({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
457
456
|
data: typeSchemas.request?.name ? {
|
|
458
457
|
type: typeSchemas.request?.name,
|
|
459
458
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
460
|
-
} :
|
|
459
|
+
} : void 0,
|
|
461
460
|
params: typeSchemas.queryParams?.name ? {
|
|
462
461
|
type: typeSchemas.queryParams?.name,
|
|
463
462
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
464
|
-
} :
|
|
463
|
+
} : void 0,
|
|
465
464
|
headers: typeSchemas.headerParams?.name ? {
|
|
466
465
|
type: typeSchemas.headerParams?.name,
|
|
467
466
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
468
|
-
} :
|
|
467
|
+
} : void 0
|
|
469
468
|
}
|
|
470
469
|
},
|
|
471
470
|
options: {
|
|
@@ -484,19 +483,19 @@ function getParams7({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
484
483
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
485
484
|
children: utils$1.getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
486
485
|
optional: oas.isOptional(typeSchemas.pathParams?.schema)
|
|
487
|
-
} :
|
|
486
|
+
} : void 0,
|
|
488
487
|
data: typeSchemas.request?.name ? {
|
|
489
488
|
type: typeSchemas.request?.name,
|
|
490
489
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
491
|
-
} :
|
|
490
|
+
} : void 0,
|
|
492
491
|
params: typeSchemas.queryParams?.name ? {
|
|
493
492
|
type: typeSchemas.queryParams?.name,
|
|
494
493
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
495
|
-
} :
|
|
494
|
+
} : void 0,
|
|
496
495
|
headers: typeSchemas.headerParams?.name ? {
|
|
497
496
|
type: typeSchemas.headerParams?.name,
|
|
498
497
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
499
|
-
} :
|
|
498
|
+
} : void 0,
|
|
500
499
|
options: {
|
|
501
500
|
type: `
|
|
502
501
|
{
|
|
@@ -581,15 +580,15 @@ function getParams8({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
581
580
|
data: typeSchemas.request?.name ? {
|
|
582
581
|
type: typeSchemas.request?.name,
|
|
583
582
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
584
|
-
} :
|
|
583
|
+
} : void 0,
|
|
585
584
|
params: typeSchemas.queryParams?.name ? {
|
|
586
585
|
type: typeSchemas.queryParams?.name,
|
|
587
586
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
588
|
-
} :
|
|
587
|
+
} : void 0,
|
|
589
588
|
headers: typeSchemas.headerParams?.name ? {
|
|
590
589
|
type: typeSchemas.headerParams?.name,
|
|
591
590
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
592
|
-
} :
|
|
591
|
+
} : void 0
|
|
593
592
|
}
|
|
594
593
|
},
|
|
595
594
|
config: {
|
|
@@ -603,19 +602,19 @@ function getParams8({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
|
603
602
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
604
603
|
children: utils$1.getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
605
604
|
optional: oas.isOptional(typeSchemas.pathParams?.schema)
|
|
606
|
-
} :
|
|
605
|
+
} : void 0,
|
|
607
606
|
data: typeSchemas.request?.name ? {
|
|
608
607
|
type: typeSchemas.request?.name,
|
|
609
608
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
610
|
-
} :
|
|
609
|
+
} : void 0,
|
|
611
610
|
params: typeSchemas.queryParams?.name ? {
|
|
612
611
|
type: typeSchemas.queryParams?.name,
|
|
613
612
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
614
|
-
} :
|
|
613
|
+
} : void 0,
|
|
615
614
|
headers: typeSchemas.headerParams?.name ? {
|
|
616
615
|
type: typeSchemas.headerParams?.name,
|
|
617
616
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
618
|
-
} :
|
|
617
|
+
} : void 0,
|
|
619
618
|
config: {
|
|
620
619
|
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : "Partial<RequestConfig> & { client?: typeof client }",
|
|
621
620
|
default: "{}"
|
|
@@ -651,17 +650,17 @@ function InfiniteQueryOptions({
|
|
|
651
650
|
});
|
|
652
651
|
const queryOptions = [
|
|
653
652
|
`initialPageParam: ${typeof initialPageParam === "string" ? JSON.stringify(initialPageParam) : initialPageParam}`,
|
|
654
|
-
cursorParam ? `getNextPageParam: (lastPage) => lastPage['${cursorParam}']` :
|
|
655
|
-
cursorParam ? `getPreviousPageParam: (firstPage) => firstPage['${cursorParam}']` :
|
|
656
|
-
!cursorParam && dataReturnType === "full" ? "getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage.data) && lastPage.data.length === 0 ? undefined : lastPageParam + 1" :
|
|
657
|
-
!cursorParam && dataReturnType === "data" ? "getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage) && lastPage.length === 0 ? undefined : lastPageParam + 1" :
|
|
658
|
-
!cursorParam ? "getPreviousPageParam: (_firstPage, _allPages, firstPageParam) => firstPageParam <= 1 ? undefined : firstPageParam - 1" :
|
|
653
|
+
cursorParam ? `getNextPageParam: (lastPage) => lastPage['${cursorParam}']` : void 0,
|
|
654
|
+
cursorParam ? `getPreviousPageParam: (firstPage) => firstPage['${cursorParam}']` : void 0,
|
|
655
|
+
!cursorParam && dataReturnType === "full" ? "getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage.data) && lastPage.data.length === 0 ? undefined : lastPageParam + 1" : void 0,
|
|
656
|
+
!cursorParam && dataReturnType === "data" ? "getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage) && lastPage.length === 0 ? undefined : lastPageParam + 1" : void 0,
|
|
657
|
+
!cursorParam ? "getPreviousPageParam: (_firstPage, _allPages, firstPageParam) => firstPageParam <= 1 ? undefined : firstPageParam - 1" : void 0
|
|
659
658
|
].filter(Boolean);
|
|
660
659
|
const infiniteOverrideParams = queryParam && typeSchemas.queryParams?.name ? `
|
|
661
660
|
if(params) {
|
|
662
661
|
params['${queryParam}'] = pageParam as unknown as ${typeSchemas.queryParams?.name}['${queryParam}']
|
|
663
662
|
}` : "";
|
|
664
|
-
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key :
|
|
663
|
+
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
|
|
665
664
|
const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
|
|
666
665
|
if (infiniteOverrideParams) {
|
|
667
666
|
return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { name, export: true, params: params.toConstructor(), children: `
|
|
@@ -704,15 +703,15 @@ function getParams9({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
704
703
|
data: typeSchemas.request?.name ? {
|
|
705
704
|
type: typeSchemas.request?.name,
|
|
706
705
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
707
|
-
} :
|
|
706
|
+
} : void 0,
|
|
708
707
|
params: typeSchemas.queryParams?.name ? {
|
|
709
708
|
type: typeSchemas.queryParams?.name,
|
|
710
709
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
711
|
-
} :
|
|
710
|
+
} : void 0,
|
|
712
711
|
headers: typeSchemas.headerParams?.name ? {
|
|
713
712
|
type: typeSchemas.headerParams?.name,
|
|
714
713
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
715
|
-
} :
|
|
714
|
+
} : void 0
|
|
716
715
|
}
|
|
717
716
|
},
|
|
718
717
|
options: {
|
|
@@ -731,19 +730,19 @@ function getParams9({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
731
730
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
732
731
|
children: utils$1.getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
733
732
|
optional: oas.isOptional(typeSchemas.pathParams?.schema)
|
|
734
|
-
} :
|
|
733
|
+
} : void 0,
|
|
735
734
|
data: typeSchemas.request?.name ? {
|
|
736
735
|
type: typeSchemas.request?.name,
|
|
737
736
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
738
|
-
} :
|
|
737
|
+
} : void 0,
|
|
739
738
|
params: typeSchemas.queryParams?.name ? {
|
|
740
739
|
type: typeSchemas.queryParams?.name,
|
|
741
740
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
742
|
-
} :
|
|
741
|
+
} : void 0,
|
|
743
742
|
headers: typeSchemas.headerParams?.name ? {
|
|
744
743
|
type: typeSchemas.headerParams?.name,
|
|
745
744
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
746
|
-
} :
|
|
745
|
+
} : void 0,
|
|
747
746
|
options: {
|
|
748
747
|
type: `
|
|
749
748
|
{
|
|
@@ -830,15 +829,15 @@ function getParams10({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
830
829
|
data: typeSchemas.request?.name ? {
|
|
831
830
|
type: typeSchemas.request?.name,
|
|
832
831
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
833
|
-
} :
|
|
832
|
+
} : void 0,
|
|
834
833
|
params: typeSchemas.queryParams?.name ? {
|
|
835
834
|
type: typeSchemas.queryParams?.name,
|
|
836
835
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
837
|
-
} :
|
|
836
|
+
} : void 0,
|
|
838
837
|
headers: typeSchemas.headerParams?.name ? {
|
|
839
838
|
type: typeSchemas.headerParams?.name,
|
|
840
839
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
841
|
-
} :
|
|
840
|
+
} : void 0
|
|
842
841
|
}
|
|
843
842
|
},
|
|
844
843
|
options: {
|
|
@@ -857,19 +856,19 @@ function getParams10({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
857
856
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
858
857
|
children: utils$1.getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
859
858
|
optional: oas.isOptional(typeSchemas.pathParams?.schema)
|
|
860
|
-
} :
|
|
859
|
+
} : void 0,
|
|
861
860
|
data: typeSchemas.request?.name ? {
|
|
862
861
|
type: typeSchemas.request?.name,
|
|
863
862
|
optional: oas.isOptional(typeSchemas.request?.schema)
|
|
864
|
-
} :
|
|
863
|
+
} : void 0,
|
|
865
864
|
params: typeSchemas.queryParams?.name ? {
|
|
866
865
|
type: typeSchemas.queryParams?.name,
|
|
867
866
|
optional: oas.isOptional(typeSchemas.queryParams?.schema)
|
|
868
|
-
} :
|
|
867
|
+
} : void 0,
|
|
869
868
|
headers: typeSchemas.headerParams?.name ? {
|
|
870
869
|
type: typeSchemas.headerParams?.name,
|
|
871
870
|
optional: oas.isOptional(typeSchemas.headerParams?.schema)
|
|
872
|
-
} :
|
|
871
|
+
} : void 0,
|
|
873
872
|
options: {
|
|
874
873
|
type: `
|
|
875
874
|
{
|
|
@@ -956,5 +955,5 @@ exports.QueryKey = QueryKey;
|
|
|
956
955
|
exports.QueryOptions = QueryOptions;
|
|
957
956
|
exports.SuspenseQuery = SuspenseQuery;
|
|
958
957
|
exports.Url = Url;
|
|
959
|
-
//# sourceMappingURL=chunk-
|
|
960
|
-
//# sourceMappingURL=chunk-
|
|
958
|
+
//# sourceMappingURL=chunk-4WFEGLYQ.cjs.map
|
|
959
|
+
//# sourceMappingURL=chunk-4WFEGLYQ.cjs.map
|