@kubb/plugin-react-query 4.12.3 → 4.12.4
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/{components-BI1cqI0Q.cjs → components-CO636qn3.cjs} +153 -153
- package/dist/{components-BI1cqI0Q.cjs.map → components-CO636qn3.cjs.map} +1 -1
- package/dist/components.cjs +1 -1
- package/dist/{generators-72yCvzWQ.cjs → generators-BNtUetHy.cjs} +186 -186
- package/dist/{generators-72yCvzWQ.cjs.map → generators-BNtUetHy.cjs.map} +1 -1
- package/dist/generators.cjs +1 -1
- package/dist/index.cjs +24 -24
- package/dist/index.cjs.map +1 -1
- package/package.json +8 -8
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
const require_generators = require('./generators-
|
|
2
|
-
let
|
|
3
|
-
let
|
|
4
|
-
let
|
|
5
|
-
let
|
|
6
|
-
let
|
|
7
|
-
let
|
|
1
|
+
const require_generators = require('./generators-BNtUetHy.cjs');
|
|
2
|
+
let _kubb_core_utils = require("@kubb/core/utils");
|
|
3
|
+
let _kubb_oas = require("@kubb/oas");
|
|
4
|
+
let _kubb_plugin_oas_utils = require("@kubb/plugin-oas/utils");
|
|
5
|
+
let _kubb_react_fabric = require("@kubb/react-fabric");
|
|
6
|
+
let _kubb_react_fabric_jsx_runtime = require("@kubb/react-fabric/jsx-runtime");
|
|
7
|
+
let _kubb_plugin_client_components = require("@kubb/plugin-client/components");
|
|
8
8
|
|
|
9
9
|
//#region src/components/QueryKey.tsx
|
|
10
10
|
function getParams$10({ pathParamsType, paramsCasing, typeSchemas }) {
|
|
11
|
-
return
|
|
11
|
+
return _kubb_react_fabric.FunctionParams.factory({
|
|
12
12
|
pathParams: {
|
|
13
13
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
14
|
-
children: (0,
|
|
14
|
+
children: (0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
15
15
|
typed: true,
|
|
16
16
|
casing: paramsCasing
|
|
17
17
|
})
|
|
18
18
|
},
|
|
19
19
|
data: typeSchemas.request?.name ? {
|
|
20
20
|
type: typeSchemas.request?.name,
|
|
21
|
-
optional: (0,
|
|
21
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
22
22
|
} : void 0,
|
|
23
23
|
params: typeSchemas.queryParams?.name ? {
|
|
24
24
|
type: typeSchemas.queryParams?.name,
|
|
25
|
-
optional: (0,
|
|
25
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
26
26
|
} : void 0
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
const getTransformer$1 = ({ operation, schemas, casing }) => {
|
|
30
30
|
return [
|
|
31
|
-
new
|
|
31
|
+
new _kubb_core_utils.URLPath(operation.path, { casing }).toObject({
|
|
32
32
|
type: "path",
|
|
33
33
|
stringify: true
|
|
34
34
|
}),
|
|
@@ -47,23 +47,23 @@ function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation,
|
|
|
47
47
|
schemas: typeSchemas,
|
|
48
48
|
casing: paramsCasing
|
|
49
49
|
});
|
|
50
|
-
return /* @__PURE__ */ (0,
|
|
50
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
51
51
|
name,
|
|
52
52
|
isExportable: true,
|
|
53
53
|
isIndexable: true,
|
|
54
|
-
children: /* @__PURE__ */ (0,
|
|
54
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function.Arrow, {
|
|
55
55
|
name,
|
|
56
56
|
export: true,
|
|
57
57
|
params: params.toConstructor(),
|
|
58
58
|
singleLine: true,
|
|
59
59
|
children: `[${keys.join(", ")}] as const`
|
|
60
60
|
})
|
|
61
|
-
}), /* @__PURE__ */ (0,
|
|
61
|
+
}), /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
62
62
|
name: typeName,
|
|
63
63
|
isExportable: true,
|
|
64
64
|
isIndexable: true,
|
|
65
65
|
isTypeOnly: true,
|
|
66
|
-
children: /* @__PURE__ */ (0,
|
|
66
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Type, {
|
|
67
67
|
name: typeName,
|
|
68
68
|
export: true,
|
|
69
69
|
children: `ReturnType<typeof ${name}>`
|
|
@@ -76,25 +76,25 @@ QueryKey.getTransformer = getTransformer$1;
|
|
|
76
76
|
//#endregion
|
|
77
77
|
//#region src/components/QueryOptions.tsx
|
|
78
78
|
function getParams$9({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
79
|
-
if (paramsType === "object") return
|
|
79
|
+
if (paramsType === "object") return _kubb_react_fabric.FunctionParams.factory({
|
|
80
80
|
data: {
|
|
81
81
|
mode: "object",
|
|
82
82
|
children: {
|
|
83
|
-
...(0,
|
|
83
|
+
...(0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
84
84
|
typed: true,
|
|
85
85
|
casing: paramsCasing
|
|
86
86
|
}),
|
|
87
87
|
data: typeSchemas.request?.name ? {
|
|
88
88
|
type: typeSchemas.request?.name,
|
|
89
|
-
optional: (0,
|
|
89
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
90
90
|
} : void 0,
|
|
91
91
|
params: typeSchemas.queryParams?.name ? {
|
|
92
92
|
type: typeSchemas.queryParams?.name,
|
|
93
|
-
optional: (0,
|
|
93
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
94
94
|
} : void 0,
|
|
95
95
|
headers: typeSchemas.headerParams?.name ? {
|
|
96
96
|
type: typeSchemas.headerParams?.name,
|
|
97
|
-
optional: (0,
|
|
97
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
98
98
|
} : void 0
|
|
99
99
|
}
|
|
100
100
|
},
|
|
@@ -103,26 +103,26 @@ function getParams$9({ paramsType, paramsCasing, pathParamsType, typeSchemas })
|
|
|
103
103
|
default: "{}"
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
|
-
return
|
|
106
|
+
return _kubb_react_fabric.FunctionParams.factory({
|
|
107
107
|
pathParams: typeSchemas.pathParams?.name ? {
|
|
108
108
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
109
|
-
children: (0,
|
|
109
|
+
children: (0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
110
110
|
typed: true,
|
|
111
111
|
casing: paramsCasing
|
|
112
112
|
}),
|
|
113
|
-
optional: (0,
|
|
113
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.pathParams?.schema)
|
|
114
114
|
} : void 0,
|
|
115
115
|
data: typeSchemas.request?.name ? {
|
|
116
116
|
type: typeSchemas.request?.name,
|
|
117
|
-
optional: (0,
|
|
117
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
118
118
|
} : void 0,
|
|
119
119
|
params: typeSchemas.queryParams?.name ? {
|
|
120
120
|
type: typeSchemas.queryParams?.name,
|
|
121
|
-
optional: (0,
|
|
121
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
122
122
|
} : void 0,
|
|
123
123
|
headers: typeSchemas.headerParams?.name ? {
|
|
124
124
|
type: typeSchemas.headerParams?.name,
|
|
125
|
-
optional: (0,
|
|
125
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
126
126
|
} : void 0,
|
|
127
127
|
config: {
|
|
128
128
|
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : "Partial<RequestConfig> & { client?: typeof fetch }",
|
|
@@ -139,7 +139,7 @@ function QueryOptions({ name, clientName, dataReturnType, typeSchemas, paramsCas
|
|
|
139
139
|
});
|
|
140
140
|
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
141
141
|
const TError = typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error";
|
|
142
|
-
const clientParams =
|
|
142
|
+
const clientParams = _kubb_plugin_client_components.Client.getParams({
|
|
143
143
|
typeSchemas,
|
|
144
144
|
paramsCasing,
|
|
145
145
|
paramsType,
|
|
@@ -153,11 +153,11 @@ function QueryOptions({ name, clientName, dataReturnType, typeSchemas, paramsCas
|
|
|
153
153
|
});
|
|
154
154
|
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
|
|
155
155
|
const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
|
|
156
|
-
return /* @__PURE__ */ (0,
|
|
156
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
157
157
|
name,
|
|
158
158
|
isExportable: true,
|
|
159
159
|
isIndexable: true,
|
|
160
|
-
children: /* @__PURE__ */ (0,
|
|
160
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
161
161
|
name,
|
|
162
162
|
export: true,
|
|
163
163
|
params: params.toConstructor(),
|
|
@@ -180,25 +180,25 @@ QueryOptions.getParams = getParams$9;
|
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region src/components/InfiniteQuery.tsx
|
|
182
182
|
function getParams$8({ paramsType, paramsCasing, pathParamsType, typeSchemas, pageParamGeneric }) {
|
|
183
|
-
if (paramsType === "object") return
|
|
183
|
+
if (paramsType === "object") return _kubb_react_fabric.FunctionParams.factory({
|
|
184
184
|
data: {
|
|
185
185
|
mode: "object",
|
|
186
186
|
children: {
|
|
187
|
-
...(0,
|
|
187
|
+
...(0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
188
188
|
typed: true,
|
|
189
189
|
casing: paramsCasing
|
|
190
190
|
}),
|
|
191
191
|
data: typeSchemas.request?.name ? {
|
|
192
192
|
type: typeSchemas.request?.name,
|
|
193
|
-
optional: (0,
|
|
193
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
194
194
|
} : void 0,
|
|
195
195
|
params: typeSchemas.queryParams?.name ? {
|
|
196
196
|
type: typeSchemas.queryParams?.name,
|
|
197
|
-
optional: (0,
|
|
197
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
198
198
|
} : void 0,
|
|
199
199
|
headers: typeSchemas.headerParams?.name ? {
|
|
200
200
|
type: typeSchemas.headerParams?.name,
|
|
201
|
-
optional: (0,
|
|
201
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
202
202
|
} : void 0
|
|
203
203
|
}
|
|
204
204
|
},
|
|
@@ -212,26 +212,26 @@ function getParams$8({ paramsType, paramsCasing, pathParamsType, typeSchemas, pa
|
|
|
212
212
|
default: "{}"
|
|
213
213
|
}
|
|
214
214
|
});
|
|
215
|
-
return
|
|
215
|
+
return _kubb_react_fabric.FunctionParams.factory({
|
|
216
216
|
pathParams: typeSchemas.pathParams?.name ? {
|
|
217
217
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
218
|
-
children: (0,
|
|
218
|
+
children: (0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
219
219
|
typed: true,
|
|
220
220
|
casing: paramsCasing
|
|
221
221
|
}),
|
|
222
|
-
optional: (0,
|
|
222
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.pathParams?.schema)
|
|
223
223
|
} : void 0,
|
|
224
224
|
data: typeSchemas.request?.name ? {
|
|
225
225
|
type: typeSchemas.request?.name,
|
|
226
|
-
optional: (0,
|
|
226
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
227
227
|
} : void 0,
|
|
228
228
|
params: typeSchemas.queryParams?.name ? {
|
|
229
229
|
type: typeSchemas.queryParams?.name,
|
|
230
|
-
optional: (0,
|
|
230
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
231
231
|
} : void 0,
|
|
232
232
|
headers: typeSchemas.headerParams?.name ? {
|
|
233
233
|
type: typeSchemas.headerParams?.name,
|
|
234
|
-
optional: (0,
|
|
234
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
235
235
|
} : void 0,
|
|
236
236
|
options: {
|
|
237
237
|
type: `
|
|
@@ -281,16 +281,16 @@ function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName,
|
|
|
281
281
|
pageParamGeneric: "TPageParam"
|
|
282
282
|
});
|
|
283
283
|
const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`;
|
|
284
|
-
return /* @__PURE__ */ (0,
|
|
284
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
285
285
|
name,
|
|
286
286
|
isExportable: true,
|
|
287
287
|
isIndexable: true,
|
|
288
|
-
children: /* @__PURE__ */ (0,
|
|
288
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
289
289
|
name,
|
|
290
290
|
export: true,
|
|
291
291
|
generics: generics.join(", "),
|
|
292
292
|
params: params.toConstructor(),
|
|
293
|
-
JSDoc: { comments: (0,
|
|
293
|
+
JSDoc: { comments: (0, _kubb_plugin_oas_utils.getComments)(operation) },
|
|
294
294
|
children: `
|
|
295
295
|
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
296
296
|
const { client: queryClient, ...queryOptions } = queryConfig
|
|
@@ -314,25 +314,25 @@ InfiniteQuery.getParams = getParams$8;
|
|
|
314
314
|
//#endregion
|
|
315
315
|
//#region src/components/InfiniteQueryOptions.tsx
|
|
316
316
|
function getParams$7({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
317
|
-
if (paramsType === "object") return
|
|
317
|
+
if (paramsType === "object") return _kubb_react_fabric.FunctionParams.factory({
|
|
318
318
|
data: {
|
|
319
319
|
mode: "object",
|
|
320
320
|
children: {
|
|
321
|
-
...(0,
|
|
321
|
+
...(0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
322
322
|
typed: true,
|
|
323
323
|
casing: paramsCasing
|
|
324
324
|
}),
|
|
325
325
|
data: typeSchemas.request?.name ? {
|
|
326
326
|
type: typeSchemas.request?.name,
|
|
327
|
-
optional: (0,
|
|
327
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
328
328
|
} : void 0,
|
|
329
329
|
params: typeSchemas.queryParams?.name ? {
|
|
330
330
|
type: typeSchemas.queryParams?.name,
|
|
331
|
-
optional: (0,
|
|
331
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
332
332
|
} : void 0,
|
|
333
333
|
headers: typeSchemas.headerParams?.name ? {
|
|
334
334
|
type: typeSchemas.headerParams?.name,
|
|
335
|
-
optional: (0,
|
|
335
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
336
336
|
} : void 0
|
|
337
337
|
}
|
|
338
338
|
},
|
|
@@ -341,26 +341,26 @@ function getParams$7({ paramsType, paramsCasing, pathParamsType, typeSchemas })
|
|
|
341
341
|
default: "{}"
|
|
342
342
|
}
|
|
343
343
|
});
|
|
344
|
-
return
|
|
344
|
+
return _kubb_react_fabric.FunctionParams.factory({
|
|
345
345
|
pathParams: typeSchemas.pathParams?.name ? {
|
|
346
346
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
347
|
-
children: (0,
|
|
347
|
+
children: (0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
348
348
|
typed: true,
|
|
349
349
|
casing: paramsCasing
|
|
350
350
|
}),
|
|
351
|
-
optional: (0,
|
|
351
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.pathParams?.schema)
|
|
352
352
|
} : void 0,
|
|
353
353
|
data: typeSchemas.request?.name ? {
|
|
354
354
|
type: typeSchemas.request?.name,
|
|
355
|
-
optional: (0,
|
|
355
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
356
356
|
} : void 0,
|
|
357
357
|
params: typeSchemas.queryParams?.name ? {
|
|
358
358
|
type: typeSchemas.queryParams?.name,
|
|
359
|
-
optional: (0,
|
|
359
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
360
360
|
} : void 0,
|
|
361
361
|
headers: typeSchemas.headerParams?.name ? {
|
|
362
362
|
type: typeSchemas.headerParams?.name,
|
|
363
|
-
optional: (0,
|
|
363
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
364
364
|
} : void 0,
|
|
365
365
|
config: {
|
|
366
366
|
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : "Partial<RequestConfig> & { client?: typeof fetch }",
|
|
@@ -384,7 +384,7 @@ function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam,
|
|
|
384
384
|
pathParamsType,
|
|
385
385
|
typeSchemas
|
|
386
386
|
});
|
|
387
|
-
const clientParams =
|
|
387
|
+
const clientParams = _kubb_plugin_client_components.Client.getParams({
|
|
388
388
|
paramsCasing,
|
|
389
389
|
typeSchemas,
|
|
390
390
|
paramsType,
|
|
@@ -401,11 +401,11 @@ function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam,
|
|
|
401
401
|
let getPreviousPageParamExpr;
|
|
402
402
|
if (hasNewParams) {
|
|
403
403
|
if (nextParam) {
|
|
404
|
-
const accessor = (0,
|
|
404
|
+
const accessor = (0, _kubb_core_utils.getNestedAccessor)(nextParam, "lastPage");
|
|
405
405
|
if (accessor) getNextPageParamExpr = `getNextPageParam: (lastPage) => ${accessor}`;
|
|
406
406
|
}
|
|
407
407
|
if (previousParam) {
|
|
408
|
-
const accessor = (0,
|
|
408
|
+
const accessor = (0, _kubb_core_utils.getNestedAccessor)(previousParam, "firstPage");
|
|
409
409
|
if (accessor) getPreviousPageParamExpr = `getPreviousPageParam: (firstPage) => ${accessor}`;
|
|
410
410
|
}
|
|
411
411
|
} else if (cursorParam) {
|
|
@@ -428,11 +428,11 @@ function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam,
|
|
|
428
428
|
} as ${typeSchemas.queryParams?.name}` : "";
|
|
429
429
|
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
|
|
430
430
|
const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
|
|
431
|
-
if (infiniteOverrideParams) return /* @__PURE__ */ (0,
|
|
431
|
+
if (infiniteOverrideParams) return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
432
432
|
name,
|
|
433
433
|
isExportable: true,
|
|
434
434
|
isIndexable: true,
|
|
435
|
-
children: /* @__PURE__ */ (0,
|
|
435
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
436
436
|
name,
|
|
437
437
|
export: true,
|
|
438
438
|
params: params.toConstructor(),
|
|
@@ -451,11 +451,11 @@ function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam,
|
|
|
451
451
|
`
|
|
452
452
|
})
|
|
453
453
|
});
|
|
454
|
-
return /* @__PURE__ */ (0,
|
|
454
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
455
455
|
name,
|
|
456
456
|
isExportable: true,
|
|
457
457
|
isIndexable: true,
|
|
458
|
-
children: /* @__PURE__ */ (0,
|
|
458
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
459
459
|
name,
|
|
460
460
|
export: true,
|
|
461
461
|
params: params.toConstructor(),
|
|
@@ -479,10 +479,10 @@ InfiniteQueryOptions.getParams = getParams$7;
|
|
|
479
479
|
//#endregion
|
|
480
480
|
//#region src/components/MutationKey.tsx
|
|
481
481
|
function getParams$6({}) {
|
|
482
|
-
return
|
|
482
|
+
return _kubb_react_fabric.FunctionParams.factory({});
|
|
483
483
|
}
|
|
484
484
|
const getTransformer = ({ operation, casing }) => {
|
|
485
|
-
return [`{ url: '${new
|
|
485
|
+
return [`{ url: '${new _kubb_core_utils.URLPath(operation.path, { casing }).toURLPath()}' }`];
|
|
486
486
|
};
|
|
487
487
|
function MutationKey({ name, typeSchemas, pathParamsType, paramsCasing, operation, typeName, transformer = getTransformer }) {
|
|
488
488
|
const params = getParams$6({
|
|
@@ -494,23 +494,23 @@ function MutationKey({ name, typeSchemas, pathParamsType, paramsCasing, operatio
|
|
|
494
494
|
schemas: typeSchemas,
|
|
495
495
|
casing: paramsCasing
|
|
496
496
|
});
|
|
497
|
-
return /* @__PURE__ */ (0,
|
|
497
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
498
498
|
name,
|
|
499
499
|
isExportable: true,
|
|
500
500
|
isIndexable: true,
|
|
501
|
-
children: /* @__PURE__ */ (0,
|
|
501
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function.Arrow, {
|
|
502
502
|
name,
|
|
503
503
|
export: true,
|
|
504
504
|
params: params.toConstructor(),
|
|
505
505
|
singleLine: true,
|
|
506
506
|
children: `[${keys.join(", ")}] as const`
|
|
507
507
|
})
|
|
508
|
-
}), /* @__PURE__ */ (0,
|
|
508
|
+
}), /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
509
509
|
name: typeName,
|
|
510
510
|
isExportable: true,
|
|
511
511
|
isIndexable: true,
|
|
512
512
|
isTypeOnly: true,
|
|
513
|
-
children: /* @__PURE__ */ (0,
|
|
513
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Type, {
|
|
514
514
|
name: typeName,
|
|
515
515
|
export: true,
|
|
516
516
|
children: `ReturnType<typeof ${name}>`
|
|
@@ -523,7 +523,7 @@ MutationKey.getTransformer = getTransformer;
|
|
|
523
523
|
//#endregion
|
|
524
524
|
//#region src/components/MutationOptions.tsx
|
|
525
525
|
function getParams$5({ typeSchemas }) {
|
|
526
|
-
return
|
|
526
|
+
return _kubb_react_fabric.FunctionParams.factory({ config: {
|
|
527
527
|
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : "Partial<RequestConfig> & { client?: typeof fetch }",
|
|
528
528
|
default: "{}"
|
|
529
529
|
} });
|
|
@@ -532,7 +532,7 @@ function MutationOptions({ name, clientName, dataReturnType, typeSchemas, params
|
|
|
532
532
|
const params = getParams$5({ typeSchemas });
|
|
533
533
|
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
534
534
|
const TError = typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error";
|
|
535
|
-
const clientParams =
|
|
535
|
+
const clientParams = _kubb_plugin_client_components.Client.getParams({
|
|
536
536
|
typeSchemas,
|
|
537
537
|
paramsCasing,
|
|
538
538
|
paramsType,
|
|
@@ -543,25 +543,25 @@ function MutationOptions({ name, clientName, dataReturnType, typeSchemas, params
|
|
|
543
543
|
pathParamsType,
|
|
544
544
|
typeSchemas
|
|
545
545
|
});
|
|
546
|
-
const mutationParams =
|
|
547
|
-
...(0,
|
|
546
|
+
const mutationParams = _kubb_react_fabric.FunctionParams.factory({
|
|
547
|
+
...(0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
548
548
|
typed: true,
|
|
549
549
|
casing: paramsCasing
|
|
550
550
|
}),
|
|
551
551
|
data: typeSchemas.request?.name ? {
|
|
552
552
|
type: typeSchemas.request?.name,
|
|
553
|
-
optional: (0,
|
|
553
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
554
554
|
} : void 0,
|
|
555
555
|
params: typeSchemas.queryParams?.name ? {
|
|
556
556
|
type: typeSchemas.queryParams?.name,
|
|
557
|
-
optional: (0,
|
|
557
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
558
558
|
} : void 0,
|
|
559
559
|
headers: typeSchemas.headerParams?.name ? {
|
|
560
560
|
type: typeSchemas.headerParams?.name,
|
|
561
|
-
optional: (0,
|
|
561
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
562
562
|
} : void 0
|
|
563
563
|
});
|
|
564
|
-
const dataParams =
|
|
564
|
+
const dataParams = _kubb_react_fabric.FunctionParams.factory({ data: {
|
|
565
565
|
mode: "object",
|
|
566
566
|
children: Object.entries(mutationParams.params).reduce((acc, [key, value]) => {
|
|
567
567
|
if (value) acc[key] = {
|
|
@@ -572,11 +572,11 @@ function MutationOptions({ name, clientName, dataReturnType, typeSchemas, params
|
|
|
572
572
|
}, {})
|
|
573
573
|
} });
|
|
574
574
|
const TRequest = mutationParams.toConstructor();
|
|
575
|
-
return /* @__PURE__ */ (0,
|
|
575
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
576
576
|
name,
|
|
577
577
|
isExportable: true,
|
|
578
578
|
isIndexable: true,
|
|
579
|
-
children: /* @__PURE__ */ (0,
|
|
579
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
580
580
|
name,
|
|
581
581
|
export: true,
|
|
582
582
|
params: params.toConstructor(),
|
|
@@ -598,22 +598,22 @@ MutationOptions.getParams = getParams$5;
|
|
|
598
598
|
//#region src/components/Mutation.tsx
|
|
599
599
|
function getParams$4({ paramsCasing, dataReturnType, typeSchemas }) {
|
|
600
600
|
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
601
|
-
const TRequest =
|
|
602
|
-
...(0,
|
|
601
|
+
const TRequest = _kubb_react_fabric.FunctionParams.factory({
|
|
602
|
+
...(0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
603
603
|
typed: true,
|
|
604
604
|
casing: paramsCasing
|
|
605
605
|
}),
|
|
606
606
|
data: typeSchemas.request?.name ? {
|
|
607
607
|
type: typeSchemas.request?.name,
|
|
608
|
-
optional: (0,
|
|
608
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
609
609
|
} : void 0,
|
|
610
610
|
params: typeSchemas.queryParams?.name ? {
|
|
611
611
|
type: typeSchemas.queryParams?.name,
|
|
612
|
-
optional: (0,
|
|
612
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
613
613
|
} : void 0,
|
|
614
614
|
headers: typeSchemas.headerParams?.name ? {
|
|
615
615
|
type: typeSchemas.headerParams?.name,
|
|
616
|
-
optional: (0,
|
|
616
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
617
617
|
} : void 0
|
|
618
618
|
}).toConstructor();
|
|
619
619
|
const generics = [
|
|
@@ -622,7 +622,7 @@ function getParams$4({ paramsCasing, dataReturnType, typeSchemas }) {
|
|
|
622
622
|
TRequest ? `{${TRequest}}` : "void",
|
|
623
623
|
"TContext"
|
|
624
624
|
].join(", ");
|
|
625
|
-
return
|
|
625
|
+
return _kubb_react_fabric.FunctionParams.factory({ options: {
|
|
626
626
|
type: `
|
|
627
627
|
{
|
|
628
628
|
mutation?: UseMutationOptions<${generics}> & { client?: QueryClient },
|
|
@@ -643,22 +643,22 @@ function Mutation({ name, mutationOptionsName, paramsCasing, pathParamsType, dat
|
|
|
643
643
|
dataReturnType,
|
|
644
644
|
typeSchemas
|
|
645
645
|
});
|
|
646
|
-
const mutationParams =
|
|
647
|
-
...(0,
|
|
646
|
+
const mutationParams = _kubb_react_fabric.FunctionParams.factory({
|
|
647
|
+
...(0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
648
648
|
typed: true,
|
|
649
649
|
casing: paramsCasing
|
|
650
650
|
}),
|
|
651
651
|
data: typeSchemas.request?.name ? {
|
|
652
652
|
type: typeSchemas.request?.name,
|
|
653
|
-
optional: (0,
|
|
653
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
654
654
|
} : void 0,
|
|
655
655
|
params: typeSchemas.queryParams?.name ? {
|
|
656
656
|
type: typeSchemas.queryParams?.name,
|
|
657
|
-
optional: (0,
|
|
657
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
658
658
|
} : void 0,
|
|
659
659
|
headers: typeSchemas.headerParams?.name ? {
|
|
660
660
|
type: typeSchemas.headerParams?.name,
|
|
661
|
-
optional: (0,
|
|
661
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
662
662
|
} : void 0
|
|
663
663
|
});
|
|
664
664
|
const mutationOptionsParams = MutationOptions.getParams({ typeSchemas });
|
|
@@ -671,15 +671,15 @@ function Mutation({ name, mutationOptionsName, paramsCasing, pathParamsType, dat
|
|
|
671
671
|
].join(", ");
|
|
672
672
|
const returnType = `UseMutationResult<${generics}>`;
|
|
673
673
|
const mutationOptions = `${mutationOptionsName}(${mutationOptionsParams.toCall()})`;
|
|
674
|
-
return /* @__PURE__ */ (0,
|
|
674
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
675
675
|
name,
|
|
676
676
|
isExportable: true,
|
|
677
677
|
isIndexable: true,
|
|
678
|
-
children: /* @__PURE__ */ (0,
|
|
678
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
679
679
|
name,
|
|
680
680
|
export: true,
|
|
681
681
|
params: params.toConstructor(),
|
|
682
|
-
JSDoc: { comments: (0,
|
|
682
|
+
JSDoc: { comments: (0, _kubb_plugin_oas_utils.getComments)(operation) },
|
|
683
683
|
generics: ["TContext"],
|
|
684
684
|
children: `
|
|
685
685
|
const { mutation = {}, client: config = {} } = options ?? {}
|
|
@@ -703,25 +703,25 @@ function Mutation({ name, mutationOptionsName, paramsCasing, pathParamsType, dat
|
|
|
703
703
|
function getParams$3({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }) {
|
|
704
704
|
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
705
705
|
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
706
|
-
if (paramsType === "object") return
|
|
706
|
+
if (paramsType === "object") return _kubb_react_fabric.FunctionParams.factory({
|
|
707
707
|
data: {
|
|
708
708
|
mode: "object",
|
|
709
709
|
children: {
|
|
710
|
-
...(0,
|
|
710
|
+
...(0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
711
711
|
typed: true,
|
|
712
712
|
casing: paramsCasing
|
|
713
713
|
}),
|
|
714
714
|
data: typeSchemas.request?.name ? {
|
|
715
715
|
type: typeSchemas.request?.name,
|
|
716
|
-
optional: (0,
|
|
716
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
717
717
|
} : void 0,
|
|
718
718
|
params: typeSchemas.queryParams?.name ? {
|
|
719
719
|
type: typeSchemas.queryParams?.name,
|
|
720
|
-
optional: (0,
|
|
720
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
721
721
|
} : void 0,
|
|
722
722
|
headers: typeSchemas.headerParams?.name ? {
|
|
723
723
|
type: typeSchemas.headerParams?.name,
|
|
724
|
-
optional: (0,
|
|
724
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
725
725
|
} : void 0
|
|
726
726
|
}
|
|
727
727
|
},
|
|
@@ -741,26 +741,26 @@ function getParams$3({ paramsType, paramsCasing, pathParamsType, dataReturnType,
|
|
|
741
741
|
default: "{}"
|
|
742
742
|
}
|
|
743
743
|
});
|
|
744
|
-
return
|
|
744
|
+
return _kubb_react_fabric.FunctionParams.factory({
|
|
745
745
|
pathParams: typeSchemas.pathParams?.name ? {
|
|
746
746
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
747
|
-
children: (0,
|
|
747
|
+
children: (0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
748
748
|
typed: true,
|
|
749
749
|
casing: paramsCasing
|
|
750
750
|
}),
|
|
751
|
-
optional: (0,
|
|
751
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.pathParams?.schema)
|
|
752
752
|
} : void 0,
|
|
753
753
|
data: typeSchemas.request?.name ? {
|
|
754
754
|
type: typeSchemas.request?.name,
|
|
755
|
-
optional: (0,
|
|
755
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
756
756
|
} : void 0,
|
|
757
757
|
params: typeSchemas.queryParams?.name ? {
|
|
758
758
|
type: typeSchemas.queryParams?.name,
|
|
759
|
-
optional: (0,
|
|
759
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
760
760
|
} : void 0,
|
|
761
761
|
headers: typeSchemas.headerParams?.name ? {
|
|
762
762
|
type: typeSchemas.headerParams?.name,
|
|
763
|
-
optional: (0,
|
|
763
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
764
764
|
} : void 0,
|
|
765
765
|
options: {
|
|
766
766
|
type: `
|
|
@@ -806,16 +806,16 @@ function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsT
|
|
|
806
806
|
typeSchemas
|
|
807
807
|
});
|
|
808
808
|
const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`;
|
|
809
|
-
return /* @__PURE__ */ (0,
|
|
809
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
810
810
|
name,
|
|
811
811
|
isExportable: true,
|
|
812
812
|
isIndexable: true,
|
|
813
|
-
children: /* @__PURE__ */ (0,
|
|
813
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
814
814
|
name,
|
|
815
815
|
export: true,
|
|
816
816
|
generics: generics.join(", "),
|
|
817
817
|
params: params.toConstructor(),
|
|
818
|
-
JSDoc: { comments: (0,
|
|
818
|
+
JSDoc: { comments: (0, _kubb_plugin_oas_utils.getComments)(operation) },
|
|
819
819
|
children: `
|
|
820
820
|
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
821
821
|
const { client: queryClient, ...queryOptions } = queryConfig
|
|
@@ -839,25 +839,25 @@ Query.getParams = getParams$3;
|
|
|
839
839
|
//#endregion
|
|
840
840
|
//#region src/components/SuspenseInfiniteQuery.tsx
|
|
841
841
|
function getParams$2({ paramsType, paramsCasing, pathParamsType, typeSchemas, pageParamGeneric }) {
|
|
842
|
-
if (paramsType === "object") return
|
|
842
|
+
if (paramsType === "object") return _kubb_react_fabric.FunctionParams.factory({
|
|
843
843
|
data: {
|
|
844
844
|
mode: "object",
|
|
845
845
|
children: {
|
|
846
|
-
...(0,
|
|
846
|
+
...(0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
847
847
|
typed: true,
|
|
848
848
|
casing: paramsCasing
|
|
849
849
|
}),
|
|
850
850
|
data: typeSchemas.request?.name ? {
|
|
851
851
|
type: typeSchemas.request?.name,
|
|
852
|
-
optional: (0,
|
|
852
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
853
853
|
} : void 0,
|
|
854
854
|
params: typeSchemas.queryParams?.name ? {
|
|
855
855
|
type: typeSchemas.queryParams?.name,
|
|
856
|
-
optional: (0,
|
|
856
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
857
857
|
} : void 0,
|
|
858
858
|
headers: typeSchemas.headerParams?.name ? {
|
|
859
859
|
type: typeSchemas.headerParams?.name,
|
|
860
|
-
optional: (0,
|
|
860
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
861
861
|
} : void 0
|
|
862
862
|
}
|
|
863
863
|
},
|
|
@@ -871,26 +871,26 @@ function getParams$2({ paramsType, paramsCasing, pathParamsType, typeSchemas, pa
|
|
|
871
871
|
default: "{}"
|
|
872
872
|
}
|
|
873
873
|
});
|
|
874
|
-
return
|
|
874
|
+
return _kubb_react_fabric.FunctionParams.factory({
|
|
875
875
|
pathParams: typeSchemas.pathParams?.name ? {
|
|
876
876
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
877
|
-
children: (0,
|
|
877
|
+
children: (0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
878
878
|
typed: true,
|
|
879
879
|
casing: paramsCasing
|
|
880
880
|
}),
|
|
881
|
-
optional: (0,
|
|
881
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.pathParams?.schema)
|
|
882
882
|
} : void 0,
|
|
883
883
|
data: typeSchemas.request?.name ? {
|
|
884
884
|
type: typeSchemas.request?.name,
|
|
885
|
-
optional: (0,
|
|
885
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
886
886
|
} : void 0,
|
|
887
887
|
params: typeSchemas.queryParams?.name ? {
|
|
888
888
|
type: typeSchemas.queryParams?.name,
|
|
889
|
-
optional: (0,
|
|
889
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
890
890
|
} : void 0,
|
|
891
891
|
headers: typeSchemas.headerParams?.name ? {
|
|
892
892
|
type: typeSchemas.headerParams?.name,
|
|
893
|
-
optional: (0,
|
|
893
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
894
894
|
} : void 0,
|
|
895
895
|
options: {
|
|
896
896
|
type: `
|
|
@@ -940,16 +940,16 @@ function SuspenseInfiniteQuery({ name, queryKeyTypeName, queryOptionsName, query
|
|
|
940
940
|
pageParamGeneric: "TPageParam"
|
|
941
941
|
});
|
|
942
942
|
const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`;
|
|
943
|
-
return /* @__PURE__ */ (0,
|
|
943
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
944
944
|
name,
|
|
945
945
|
isExportable: true,
|
|
946
946
|
isIndexable: true,
|
|
947
|
-
children: /* @__PURE__ */ (0,
|
|
947
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
948
948
|
name,
|
|
949
949
|
export: true,
|
|
950
950
|
generics: generics.join(", "),
|
|
951
951
|
params: params.toConstructor(),
|
|
952
|
-
JSDoc: { comments: (0,
|
|
952
|
+
JSDoc: { comments: (0, _kubb_plugin_oas_utils.getComments)(operation) },
|
|
953
953
|
children: `
|
|
954
954
|
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
955
955
|
const { client: queryClient, ...queryOptions } = queryConfig
|
|
@@ -973,25 +973,25 @@ SuspenseInfiniteQuery.getParams = getParams$2;
|
|
|
973
973
|
//#endregion
|
|
974
974
|
//#region src/components/SuspenseInfiniteQueryOptions.tsx
|
|
975
975
|
function getParams$1({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
976
|
-
if (paramsType === "object") return
|
|
976
|
+
if (paramsType === "object") return _kubb_react_fabric.FunctionParams.factory({
|
|
977
977
|
data: {
|
|
978
978
|
mode: "object",
|
|
979
979
|
children: {
|
|
980
|
-
...(0,
|
|
980
|
+
...(0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
981
981
|
typed: true,
|
|
982
982
|
casing: paramsCasing
|
|
983
983
|
}),
|
|
984
984
|
data: typeSchemas.request?.name ? {
|
|
985
985
|
type: typeSchemas.request?.name,
|
|
986
|
-
optional: (0,
|
|
986
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
987
987
|
} : void 0,
|
|
988
988
|
params: typeSchemas.queryParams?.name ? {
|
|
989
989
|
type: typeSchemas.queryParams?.name,
|
|
990
|
-
optional: (0,
|
|
990
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
991
991
|
} : void 0,
|
|
992
992
|
headers: typeSchemas.headerParams?.name ? {
|
|
993
993
|
type: typeSchemas.headerParams?.name,
|
|
994
|
-
optional: (0,
|
|
994
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
995
995
|
} : void 0
|
|
996
996
|
}
|
|
997
997
|
},
|
|
@@ -1000,26 +1000,26 @@ function getParams$1({ paramsType, paramsCasing, pathParamsType, typeSchemas })
|
|
|
1000
1000
|
default: "{}"
|
|
1001
1001
|
}
|
|
1002
1002
|
});
|
|
1003
|
-
return
|
|
1003
|
+
return _kubb_react_fabric.FunctionParams.factory({
|
|
1004
1004
|
pathParams: typeSchemas.pathParams?.name ? {
|
|
1005
1005
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
1006
|
-
children: (0,
|
|
1006
|
+
children: (0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
1007
1007
|
typed: true,
|
|
1008
1008
|
casing: paramsCasing
|
|
1009
1009
|
}),
|
|
1010
|
-
optional: (0,
|
|
1010
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.pathParams?.schema)
|
|
1011
1011
|
} : void 0,
|
|
1012
1012
|
data: typeSchemas.request?.name ? {
|
|
1013
1013
|
type: typeSchemas.request?.name,
|
|
1014
|
-
optional: (0,
|
|
1014
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
1015
1015
|
} : void 0,
|
|
1016
1016
|
params: typeSchemas.queryParams?.name ? {
|
|
1017
1017
|
type: typeSchemas.queryParams?.name,
|
|
1018
|
-
optional: (0,
|
|
1018
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
1019
1019
|
} : void 0,
|
|
1020
1020
|
headers: typeSchemas.headerParams?.name ? {
|
|
1021
1021
|
type: typeSchemas.headerParams?.name,
|
|
1022
|
-
optional: (0,
|
|
1022
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
1023
1023
|
} : void 0,
|
|
1024
1024
|
config: {
|
|
1025
1025
|
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : "Partial<RequestConfig> & { client?: typeof fetch }",
|
|
@@ -1043,7 +1043,7 @@ function SuspenseInfiniteQueryOptions({ name, clientName, initialPageParam, curs
|
|
|
1043
1043
|
pathParamsType,
|
|
1044
1044
|
typeSchemas
|
|
1045
1045
|
});
|
|
1046
|
-
const clientParams =
|
|
1046
|
+
const clientParams = _kubb_plugin_client_components.Client.getParams({
|
|
1047
1047
|
paramsCasing,
|
|
1048
1048
|
typeSchemas,
|
|
1049
1049
|
paramsType,
|
|
@@ -1060,11 +1060,11 @@ function SuspenseInfiniteQueryOptions({ name, clientName, initialPageParam, curs
|
|
|
1060
1060
|
let getPreviousPageParamExpr;
|
|
1061
1061
|
if (hasNewParams) {
|
|
1062
1062
|
if (nextParam) {
|
|
1063
|
-
const accessor = (0,
|
|
1063
|
+
const accessor = (0, _kubb_core_utils.getNestedAccessor)(nextParam, "lastPage");
|
|
1064
1064
|
if (accessor) getNextPageParamExpr = `getNextPageParam: (lastPage) => ${accessor}`;
|
|
1065
1065
|
}
|
|
1066
1066
|
if (previousParam) {
|
|
1067
|
-
const accessor = (0,
|
|
1067
|
+
const accessor = (0, _kubb_core_utils.getNestedAccessor)(previousParam, "firstPage");
|
|
1068
1068
|
if (accessor) getPreviousPageParamExpr = `getPreviousPageParam: (firstPage) => ${accessor}`;
|
|
1069
1069
|
}
|
|
1070
1070
|
} else if (cursorParam) {
|
|
@@ -1087,11 +1087,11 @@ function SuspenseInfiniteQueryOptions({ name, clientName, initialPageParam, curs
|
|
|
1087
1087
|
} as ${typeSchemas.queryParams?.name}` : "";
|
|
1088
1088
|
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
|
|
1089
1089
|
const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
|
|
1090
|
-
if (infiniteOverrideParams) return /* @__PURE__ */ (0,
|
|
1090
|
+
if (infiniteOverrideParams) return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
1091
1091
|
name,
|
|
1092
1092
|
isExportable: true,
|
|
1093
1093
|
isIndexable: true,
|
|
1094
|
-
children: /* @__PURE__ */ (0,
|
|
1094
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
1095
1095
|
name,
|
|
1096
1096
|
export: true,
|
|
1097
1097
|
params: params.toConstructor(),
|
|
@@ -1110,11 +1110,11 @@ function SuspenseInfiniteQueryOptions({ name, clientName, initialPageParam, curs
|
|
|
1110
1110
|
`
|
|
1111
1111
|
})
|
|
1112
1112
|
});
|
|
1113
|
-
return /* @__PURE__ */ (0,
|
|
1113
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
1114
1114
|
name,
|
|
1115
1115
|
isExportable: true,
|
|
1116
1116
|
isIndexable: true,
|
|
1117
|
-
children: /* @__PURE__ */ (0,
|
|
1117
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
1118
1118
|
name,
|
|
1119
1119
|
export: true,
|
|
1120
1120
|
params: params.toConstructor(),
|
|
@@ -1140,25 +1140,25 @@ SuspenseInfiniteQueryOptions.getParams = getParams$1;
|
|
|
1140
1140
|
function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }) {
|
|
1141
1141
|
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
1142
1142
|
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
1143
|
-
if (paramsType === "object") return
|
|
1143
|
+
if (paramsType === "object") return _kubb_react_fabric.FunctionParams.factory({
|
|
1144
1144
|
data: {
|
|
1145
1145
|
mode: "object",
|
|
1146
1146
|
children: {
|
|
1147
|
-
...(0,
|
|
1147
|
+
...(0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
1148
1148
|
typed: true,
|
|
1149
1149
|
casing: paramsCasing
|
|
1150
1150
|
}),
|
|
1151
1151
|
data: typeSchemas.request?.name ? {
|
|
1152
1152
|
type: typeSchemas.request?.name,
|
|
1153
|
-
optional: (0,
|
|
1153
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
1154
1154
|
} : void 0,
|
|
1155
1155
|
params: typeSchemas.queryParams?.name ? {
|
|
1156
1156
|
type: typeSchemas.queryParams?.name,
|
|
1157
|
-
optional: (0,
|
|
1157
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
1158
1158
|
} : void 0,
|
|
1159
1159
|
headers: typeSchemas.headerParams?.name ? {
|
|
1160
1160
|
type: typeSchemas.headerParams?.name,
|
|
1161
|
-
optional: (0,
|
|
1161
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
1162
1162
|
} : void 0
|
|
1163
1163
|
}
|
|
1164
1164
|
},
|
|
@@ -1177,26 +1177,26 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
|
|
|
1177
1177
|
default: "{}"
|
|
1178
1178
|
}
|
|
1179
1179
|
});
|
|
1180
|
-
return
|
|
1180
|
+
return _kubb_react_fabric.FunctionParams.factory({
|
|
1181
1181
|
pathParams: typeSchemas.pathParams?.name ? {
|
|
1182
1182
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
1183
|
-
children: (0,
|
|
1183
|
+
children: (0, _kubb_plugin_oas_utils.getPathParams)(typeSchemas.pathParams, {
|
|
1184
1184
|
typed: true,
|
|
1185
1185
|
casing: paramsCasing
|
|
1186
1186
|
}),
|
|
1187
|
-
optional: (0,
|
|
1187
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.pathParams?.schema)
|
|
1188
1188
|
} : void 0,
|
|
1189
1189
|
data: typeSchemas.request?.name ? {
|
|
1190
1190
|
type: typeSchemas.request?.name,
|
|
1191
|
-
optional: (0,
|
|
1191
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.request?.schema)
|
|
1192
1192
|
} : void 0,
|
|
1193
1193
|
params: typeSchemas.queryParams?.name ? {
|
|
1194
1194
|
type: typeSchemas.queryParams?.name,
|
|
1195
|
-
optional: (0,
|
|
1195
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.queryParams?.schema)
|
|
1196
1196
|
} : void 0,
|
|
1197
1197
|
headers: typeSchemas.headerParams?.name ? {
|
|
1198
1198
|
type: typeSchemas.headerParams?.name,
|
|
1199
|
-
optional: (0,
|
|
1199
|
+
optional: (0, _kubb_oas.isOptional)(typeSchemas.headerParams?.schema)
|
|
1200
1200
|
} : void 0,
|
|
1201
1201
|
options: {
|
|
1202
1202
|
type: `
|
|
@@ -1244,16 +1244,16 @@ function SuspenseQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName,
|
|
|
1244
1244
|
typeSchemas
|
|
1245
1245
|
});
|
|
1246
1246
|
const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()})`;
|
|
1247
|
-
return /* @__PURE__ */ (0,
|
|
1247
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
1248
1248
|
name,
|
|
1249
1249
|
isExportable: true,
|
|
1250
1250
|
isIndexable: true,
|
|
1251
|
-
children: /* @__PURE__ */ (0,
|
|
1251
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
1252
1252
|
name,
|
|
1253
1253
|
export: true,
|
|
1254
1254
|
generics: generics.join(", "),
|
|
1255
1255
|
params: params.toConstructor(),
|
|
1256
|
-
JSDoc: { comments: (0,
|
|
1256
|
+
JSDoc: { comments: (0, _kubb_plugin_oas_utils.getComments)(operation) },
|
|
1257
1257
|
children: `
|
|
1258
1258
|
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
1259
1259
|
const { client: queryClient, ...queryOptions } = queryConfig
|
|
@@ -1341,4 +1341,4 @@ Object.defineProperty(exports, 'SuspenseQuery', {
|
|
|
1341
1341
|
return SuspenseQuery;
|
|
1342
1342
|
}
|
|
1343
1343
|
});
|
|
1344
|
-
//# sourceMappingURL=components-
|
|
1344
|
+
//# sourceMappingURL=components-CO636qn3.cjs.map
|