@kubb/plugin-react-query 4.0.2 → 4.1.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/{components-CQAsEApg.cjs → components-DkiO4xNZ.cjs} +294 -231
- package/dist/components-DkiO4xNZ.cjs.map +1 -0
- package/dist/{components-BRLaeCYI.js → components-Dz_s6t75.js} +287 -230
- package/dist/components-Dz_s6t75.js.map +1 -0
- package/dist/components.cjs +2 -1
- package/dist/components.d.cts +137 -109
- package/dist/components.d.ts +137 -109
- package/dist/components.js +2 -2
- package/dist/{generators-DZJ_SWwE.cjs → generators-BiW_MevM.cjs} +25 -8
- package/dist/generators-BiW_MevM.cjs.map +1 -0
- package/dist/{generators-DrSq5cK7.js → generators-ByqomtgH.js} +23 -6
- package/dist/generators-ByqomtgH.js.map +1 -0
- package/dist/generators.cjs +2 -2
- package/dist/generators.js +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +8 -8
- package/src/components/Mutation.tsx +12 -40
- package/src/components/MutationOptions.tsx +113 -0
- package/src/components/index.ts +4 -3
- package/src/generators/__snapshots__/clientPostImportPath.ts +25 -12
- package/src/generators/__snapshots__/updatePetById.ts +25 -12
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +25 -12
- package/src/generators/mutationGenerator.tsx +18 -2
- package/dist/components-BRLaeCYI.js.map +0 -1
- package/dist/components-CQAsEApg.cjs.map +0 -1
- package/dist/generators-DZJ_SWwE.cjs.map +0 -1
- package/dist/generators-DrSq5cK7.js.map +0 -1
package/dist/components.d.ts
CHANGED
|
@@ -45,80 +45,122 @@ declare class FunctionParams {
|
|
|
45
45
|
toConstructor(): string;
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region src/components/
|
|
49
|
-
type Props$
|
|
48
|
+
//#region src/components/InfiniteQuery.d.ts
|
|
49
|
+
type Props$8 = {
|
|
50
50
|
/**
|
|
51
51
|
* Name of the function
|
|
52
52
|
*/
|
|
53
53
|
name: string;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
queryOptionsName: string;
|
|
55
|
+
queryKeyName: string;
|
|
56
|
+
queryKeyTypeName: string;
|
|
57
57
|
typeSchemas: OperationSchemas;
|
|
58
58
|
operation: Operation;
|
|
59
|
-
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
60
59
|
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
61
60
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
62
61
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
62
|
+
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
63
|
+
queryParam?: Infinite['queryParam'];
|
|
63
64
|
};
|
|
64
|
-
|
|
65
|
+
type GetParamsProps$7 = {
|
|
66
|
+
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
67
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
68
|
+
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
69
|
+
typeSchemas: OperationSchemas;
|
|
70
|
+
pageParamGeneric: string;
|
|
71
|
+
};
|
|
72
|
+
declare function InfiniteQuery({
|
|
65
73
|
name,
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
queryKeyTypeName,
|
|
75
|
+
queryOptionsName,
|
|
76
|
+
queryKeyName,
|
|
68
77
|
paramsType,
|
|
78
|
+
paramsCasing,
|
|
69
79
|
pathParamsType,
|
|
70
80
|
dataReturnType,
|
|
71
81
|
typeSchemas,
|
|
72
82
|
operation,
|
|
73
|
-
|
|
74
|
-
}: Props$
|
|
83
|
+
queryParam
|
|
84
|
+
}: Props$8): ReactNode;
|
|
85
|
+
declare namespace InfiniteQuery {
|
|
86
|
+
var getParams: ({
|
|
87
|
+
paramsType,
|
|
88
|
+
paramsCasing,
|
|
89
|
+
pathParamsType,
|
|
90
|
+
typeSchemas,
|
|
91
|
+
pageParamGeneric
|
|
92
|
+
}: GetParamsProps$7) => FunctionParams;
|
|
93
|
+
}
|
|
75
94
|
//#endregion
|
|
76
|
-
//#region src/components/
|
|
77
|
-
type Props$
|
|
78
|
-
/**
|
|
79
|
-
* Name of the function
|
|
80
|
-
*/
|
|
95
|
+
//#region src/components/InfiniteQueryOptions.d.ts
|
|
96
|
+
type Props$7 = {
|
|
81
97
|
name: string;
|
|
82
|
-
|
|
98
|
+
clientName: string;
|
|
83
99
|
queryKeyName: string;
|
|
84
|
-
queryKeyTypeName: string;
|
|
85
100
|
typeSchemas: OperationSchemas;
|
|
86
|
-
operation: Operation;
|
|
87
101
|
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
88
102
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
89
103
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
90
104
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
105
|
+
initialPageParam: Infinite['initialPageParam'];
|
|
106
|
+
cursorParam: Infinite['cursorParam'];
|
|
107
|
+
queryParam: Infinite['queryParam'];
|
|
91
108
|
};
|
|
92
109
|
type GetParamsProps$6 = {
|
|
93
110
|
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
94
111
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
95
112
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
96
|
-
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
97
113
|
typeSchemas: OperationSchemas;
|
|
98
114
|
};
|
|
99
|
-
declare function
|
|
115
|
+
declare function InfiniteQueryOptions({
|
|
100
116
|
name,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
117
|
+
clientName,
|
|
118
|
+
initialPageParam,
|
|
119
|
+
cursorParam,
|
|
120
|
+
typeSchemas,
|
|
105
121
|
paramsCasing,
|
|
106
|
-
|
|
122
|
+
paramsType,
|
|
107
123
|
dataReturnType,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
124
|
+
pathParamsType,
|
|
125
|
+
queryParam,
|
|
126
|
+
queryKeyName
|
|
127
|
+
}: Props$7): ReactNode;
|
|
128
|
+
declare namespace InfiniteQueryOptions {
|
|
112
129
|
var getParams: ({
|
|
113
130
|
paramsType,
|
|
114
131
|
paramsCasing,
|
|
115
132
|
pathParamsType,
|
|
116
|
-
dataReturnType,
|
|
117
133
|
typeSchemas
|
|
118
134
|
}: GetParamsProps$6) => FunctionParams;
|
|
119
135
|
}
|
|
120
136
|
//#endregion
|
|
121
|
-
//#region src/components/
|
|
137
|
+
//#region src/components/Mutation.d.ts
|
|
138
|
+
type Props$6 = {
|
|
139
|
+
/**
|
|
140
|
+
* Name of the function
|
|
141
|
+
*/
|
|
142
|
+
name: string;
|
|
143
|
+
typeName: string;
|
|
144
|
+
mutationOptionsName: string;
|
|
145
|
+
mutationKeyName: string;
|
|
146
|
+
typeSchemas: OperationSchemas;
|
|
147
|
+
operation: Operation;
|
|
148
|
+
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
149
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
150
|
+
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
151
|
+
};
|
|
152
|
+
declare function Mutation({
|
|
153
|
+
name,
|
|
154
|
+
mutationOptionsName,
|
|
155
|
+
paramsCasing,
|
|
156
|
+
pathParamsType,
|
|
157
|
+
dataReturnType,
|
|
158
|
+
typeSchemas,
|
|
159
|
+
operation,
|
|
160
|
+
mutationKeyName
|
|
161
|
+
}: Props$6): ReactNode;
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/components/MutationKey.d.ts
|
|
122
164
|
type Props$5 = {
|
|
123
165
|
name: string;
|
|
124
166
|
typeName: string;
|
|
@@ -129,62 +171,64 @@ type Props$5 = {
|
|
|
129
171
|
transformer: Transformer | undefined;
|
|
130
172
|
};
|
|
131
173
|
type GetParamsProps$5 = {
|
|
132
|
-
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
133
174
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
134
175
|
typeSchemas: OperationSchemas;
|
|
135
176
|
};
|
|
136
|
-
declare function
|
|
177
|
+
declare function MutationKey({
|
|
137
178
|
name,
|
|
138
179
|
typeSchemas,
|
|
139
|
-
paramsCasing,
|
|
140
180
|
pathParamsType,
|
|
181
|
+
paramsCasing,
|
|
141
182
|
operation,
|
|
142
183
|
typeName,
|
|
143
184
|
transformer
|
|
144
185
|
}: Props$5): ReactNode;
|
|
145
|
-
declare namespace
|
|
146
|
-
var getParams: ({
|
|
147
|
-
pathParamsType,
|
|
148
|
-
paramsCasing,
|
|
149
|
-
typeSchemas
|
|
150
|
-
}: GetParamsProps$5) => FunctionParams;
|
|
186
|
+
declare namespace MutationKey {
|
|
187
|
+
var getParams: ({}: GetParamsProps$5) => FunctionParams;
|
|
151
188
|
var getTransformer: Transformer;
|
|
152
189
|
}
|
|
153
190
|
//#endregion
|
|
154
|
-
//#region src/components/
|
|
191
|
+
//#region src/components/MutationOptions.d.ts
|
|
155
192
|
type Props$4 = {
|
|
156
193
|
name: string;
|
|
157
|
-
|
|
194
|
+
clientName: string;
|
|
195
|
+
mutationKeyName: string;
|
|
158
196
|
typeSchemas: OperationSchemas;
|
|
159
|
-
operation: Operation;
|
|
160
197
|
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
198
|
+
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
161
199
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
162
|
-
|
|
200
|
+
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
163
201
|
};
|
|
164
202
|
type GetParamsProps$4 = {
|
|
165
|
-
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
166
203
|
typeSchemas: OperationSchemas;
|
|
167
204
|
};
|
|
168
|
-
declare function
|
|
205
|
+
declare function MutationOptions({
|
|
169
206
|
name,
|
|
207
|
+
clientName,
|
|
208
|
+
dataReturnType,
|
|
170
209
|
typeSchemas,
|
|
171
|
-
pathParamsType,
|
|
172
210
|
paramsCasing,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}: Props$4):
|
|
177
|
-
declare namespace
|
|
178
|
-
var getParams: ({
|
|
179
|
-
|
|
211
|
+
paramsType,
|
|
212
|
+
pathParamsType,
|
|
213
|
+
mutationKeyName
|
|
214
|
+
}: Props$4): any;
|
|
215
|
+
declare namespace MutationOptions {
|
|
216
|
+
var getParams: ({
|
|
217
|
+
typeSchemas
|
|
218
|
+
}: GetParamsProps$4) => FunctionParams;
|
|
180
219
|
}
|
|
181
220
|
//#endregion
|
|
182
|
-
//#region src/components/
|
|
221
|
+
//#region src/components/Query.d.ts
|
|
183
222
|
type Props$3 = {
|
|
223
|
+
/**
|
|
224
|
+
* Name of the function
|
|
225
|
+
*/
|
|
184
226
|
name: string;
|
|
185
|
-
|
|
227
|
+
queryOptionsName: string;
|
|
186
228
|
queryKeyName: string;
|
|
229
|
+
queryKeyTypeName: string;
|
|
187
230
|
typeSchemas: OperationSchemas;
|
|
231
|
+
operation: Operation;
|
|
188
232
|
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
189
233
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
190
234
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
@@ -194,113 +238,97 @@ type GetParamsProps$3 = {
|
|
|
194
238
|
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
195
239
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
196
240
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
241
|
+
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
197
242
|
typeSchemas: OperationSchemas;
|
|
198
243
|
};
|
|
199
|
-
declare function
|
|
244
|
+
declare function Query({
|
|
200
245
|
name,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
paramsCasing,
|
|
246
|
+
queryKeyTypeName,
|
|
247
|
+
queryOptionsName,
|
|
248
|
+
queryKeyName,
|
|
205
249
|
paramsType,
|
|
250
|
+
paramsCasing,
|
|
206
251
|
pathParamsType,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
252
|
+
dataReturnType,
|
|
253
|
+
typeSchemas,
|
|
254
|
+
operation
|
|
255
|
+
}: Props$3): ReactNode;
|
|
256
|
+
declare namespace Query {
|
|
210
257
|
var getParams: ({
|
|
211
258
|
paramsType,
|
|
212
259
|
paramsCasing,
|
|
213
260
|
pathParamsType,
|
|
261
|
+
dataReturnType,
|
|
214
262
|
typeSchemas
|
|
215
263
|
}: GetParamsProps$3) => FunctionParams;
|
|
216
264
|
}
|
|
217
265
|
//#endregion
|
|
218
|
-
//#region src/components/
|
|
266
|
+
//#region src/components/QueryKey.d.ts
|
|
219
267
|
type Props$2 = {
|
|
220
268
|
name: string;
|
|
221
|
-
|
|
222
|
-
queryKeyName: string;
|
|
269
|
+
typeName: string;
|
|
223
270
|
typeSchemas: OperationSchemas;
|
|
271
|
+
operation: Operation;
|
|
224
272
|
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
225
|
-
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
226
273
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
227
|
-
|
|
228
|
-
initialPageParam: Infinite['initialPageParam'];
|
|
229
|
-
cursorParam: Infinite['cursorParam'];
|
|
230
|
-
queryParam: Infinite['queryParam'];
|
|
274
|
+
transformer: Transformer | undefined;
|
|
231
275
|
};
|
|
232
276
|
type GetParamsProps$2 = {
|
|
233
277
|
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
234
|
-
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
235
278
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
236
279
|
typeSchemas: OperationSchemas;
|
|
237
280
|
};
|
|
238
|
-
declare function
|
|
281
|
+
declare function QueryKey({
|
|
239
282
|
name,
|
|
240
|
-
clientName,
|
|
241
|
-
initialPageParam,
|
|
242
|
-
cursorParam,
|
|
243
283
|
typeSchemas,
|
|
244
284
|
paramsCasing,
|
|
245
|
-
paramsType,
|
|
246
|
-
dataReturnType,
|
|
247
285
|
pathParamsType,
|
|
248
|
-
|
|
249
|
-
|
|
286
|
+
operation,
|
|
287
|
+
typeName,
|
|
288
|
+
transformer
|
|
250
289
|
}: Props$2): ReactNode;
|
|
251
|
-
declare namespace
|
|
290
|
+
declare namespace QueryKey {
|
|
252
291
|
var getParams: ({
|
|
253
|
-
paramsType,
|
|
254
|
-
paramsCasing,
|
|
255
292
|
pathParamsType,
|
|
293
|
+
paramsCasing,
|
|
256
294
|
typeSchemas
|
|
257
295
|
}: GetParamsProps$2) => FunctionParams;
|
|
296
|
+
var getTransformer: Transformer;
|
|
258
297
|
}
|
|
259
298
|
//#endregion
|
|
260
|
-
//#region src/components/
|
|
299
|
+
//#region src/components/QueryOptions.d.ts
|
|
261
300
|
type Props$1 = {
|
|
262
|
-
/**
|
|
263
|
-
* Name of the function
|
|
264
|
-
*/
|
|
265
301
|
name: string;
|
|
266
|
-
|
|
302
|
+
clientName: string;
|
|
267
303
|
queryKeyName: string;
|
|
268
|
-
queryKeyTypeName: string;
|
|
269
304
|
typeSchemas: OperationSchemas;
|
|
270
|
-
operation: Operation;
|
|
271
305
|
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
272
306
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
273
307
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
274
308
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
275
|
-
queryParam?: Infinite['queryParam'];
|
|
276
309
|
};
|
|
277
310
|
type GetParamsProps$1 = {
|
|
278
|
-
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
279
311
|
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
312
|
+
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
280
313
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
281
314
|
typeSchemas: OperationSchemas;
|
|
282
|
-
pageParamGeneric: string;
|
|
283
315
|
};
|
|
284
|
-
declare function
|
|
316
|
+
declare function QueryOptions({
|
|
285
317
|
name,
|
|
286
|
-
|
|
287
|
-
queryOptionsName,
|
|
288
|
-
queryKeyName,
|
|
289
|
-
paramsType,
|
|
290
|
-
paramsCasing,
|
|
291
|
-
pathParamsType,
|
|
318
|
+
clientName,
|
|
292
319
|
dataReturnType,
|
|
293
320
|
typeSchemas,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
321
|
+
paramsCasing,
|
|
322
|
+
paramsType,
|
|
323
|
+
pathParamsType,
|
|
324
|
+
queryKeyName
|
|
325
|
+
}: Props$1): any;
|
|
326
|
+
declare namespace QueryOptions {
|
|
298
327
|
var getParams: ({
|
|
299
328
|
paramsType,
|
|
300
329
|
paramsCasing,
|
|
301
330
|
pathParamsType,
|
|
302
|
-
typeSchemas
|
|
303
|
-
pageParamGeneric
|
|
331
|
+
typeSchemas
|
|
304
332
|
}: GetParamsProps$1) => FunctionParams;
|
|
305
333
|
}
|
|
306
334
|
//#endregion
|
|
@@ -356,5 +384,5 @@ declare namespace SuspenseQuery {
|
|
|
356
384
|
}: GetParamsProps) => FunctionParams;
|
|
357
385
|
}
|
|
358
386
|
//#endregion
|
|
359
|
-
export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions, SuspenseQuery };
|
|
387
|
+
export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, MutationOptions, Query, QueryKey, QueryOptions, SuspenseQuery };
|
|
360
388
|
//# sourceMappingURL=components.d.ts.map
|
package/dist/components.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions, SuspenseQuery } from "./components-
|
|
1
|
+
import { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, MutationOptions, Query, QueryKey, QueryOptions, SuspenseQuery } from "./components-Dz_s6t75.js";
|
|
2
2
|
|
|
3
|
-
export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions, SuspenseQuery };
|
|
3
|
+
export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, MutationOptions, Query, QueryKey, QueryOptions, SuspenseQuery };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const require_components = require('./components-
|
|
1
|
+
const require_components = require('./components-DkiO4xNZ.cjs');
|
|
2
2
|
let __kubb_plugin_oas = require("@kubb/plugin-oas");
|
|
3
3
|
__kubb_plugin_oas = require_components.__toESM(__kubb_plugin_oas);
|
|
4
4
|
let __kubb_plugin_ts = require("@kubb/plugin-ts");
|
|
5
5
|
__kubb_plugin_ts = require_components.__toESM(__kubb_plugin_ts);
|
|
6
6
|
let __kubb_plugin_zod = require("@kubb/plugin-zod");
|
|
7
7
|
__kubb_plugin_zod = require_components.__toESM(__kubb_plugin_zod);
|
|
8
|
-
let __kubb_react = require("@kubb/react");
|
|
9
|
-
__kubb_react = require_components.__toESM(__kubb_react);
|
|
10
|
-
let __kubb_plugin_client_components = require("@kubb/plugin-client/components");
|
|
11
|
-
__kubb_plugin_client_components = require_components.__toESM(__kubb_plugin_client_components);
|
|
12
8
|
let __kubb_plugin_oas_utils = require("@kubb/plugin-oas/utils");
|
|
13
9
|
__kubb_plugin_oas_utils = require_components.__toESM(__kubb_plugin_oas_utils);
|
|
10
|
+
let __kubb_react = require("@kubb/react");
|
|
11
|
+
__kubb_react = require_components.__toESM(__kubb_react);
|
|
14
12
|
let __kubb_react_jsx_runtime = require("@kubb/react/jsx-runtime");
|
|
15
13
|
__kubb_react_jsx_runtime = require_components.__toESM(__kubb_react_jsx_runtime);
|
|
14
|
+
let __kubb_plugin_client_components = require("@kubb/plugin-client/components");
|
|
15
|
+
__kubb_plugin_client_components = require_components.__toESM(__kubb_plugin_client_components);
|
|
16
16
|
let __kubb_plugin_client = require("@kubb/plugin-client");
|
|
17
17
|
__kubb_plugin_client = require_components.__toESM(__kubb_plugin_client);
|
|
18
18
|
let __kubb_plugin_oas_hooks = require("@kubb/plugin-oas/hooks");
|
|
@@ -235,6 +235,10 @@ const mutationGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
235
235
|
}) : getName(operation, { type: "function" }),
|
|
236
236
|
file: getFile(operation, { pluginKey: [__kubb_plugin_client.pluginClientName] })
|
|
237
237
|
};
|
|
238
|
+
const mutationOptions = { name: getName(operation, {
|
|
239
|
+
type: "function",
|
|
240
|
+
suffix: "MutationOptions"
|
|
241
|
+
}) };
|
|
238
242
|
const mutationKey = {
|
|
239
243
|
name: getName(operation, {
|
|
240
244
|
type: "const",
|
|
@@ -317,6 +321,20 @@ const mutationGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
317
321
|
pathParamsType: options.pathParamsType,
|
|
318
322
|
parser: options.parser
|
|
319
323
|
}),
|
|
324
|
+
/* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
|
|
325
|
+
name: ["mutationOptions"],
|
|
326
|
+
path: importPath
|
|
327
|
+
}),
|
|
328
|
+
/* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(require_components.MutationOptions, {
|
|
329
|
+
name: mutationOptions.name,
|
|
330
|
+
clientName: client.name,
|
|
331
|
+
mutationKeyName: mutationKey.name,
|
|
332
|
+
typeSchemas: type.schemas,
|
|
333
|
+
paramsCasing: options.paramsCasing,
|
|
334
|
+
paramsType: options.paramsType,
|
|
335
|
+
pathParamsType: options.pathParamsType,
|
|
336
|
+
dataReturnType: options.client.dataReturnType
|
|
337
|
+
}),
|
|
320
338
|
options.mutation && /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react_jsx_runtime.Fragment, { children: [
|
|
321
339
|
/* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
|
|
322
340
|
name: ["useMutation"],
|
|
@@ -329,13 +347,12 @@ const mutationGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
|
|
|
329
347
|
}),
|
|
330
348
|
/* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(require_components.Mutation, {
|
|
331
349
|
name: mutation.name,
|
|
332
|
-
|
|
350
|
+
mutationOptionsName: mutationOptions.name,
|
|
333
351
|
typeName: mutation.typeName,
|
|
334
352
|
typeSchemas: type.schemas,
|
|
335
353
|
operation,
|
|
336
354
|
dataReturnType: options.client.dataReturnType,
|
|
337
355
|
paramsCasing: options.paramsCasing,
|
|
338
|
-
paramsType: options.paramsType,
|
|
339
356
|
pathParamsType: options.pathParamsType,
|
|
340
357
|
mutationKeyName: mutationKey.name
|
|
341
358
|
})
|
|
@@ -752,4 +769,4 @@ Object.defineProperty(exports, 'suspenseQueryGenerator', {
|
|
|
752
769
|
return suspenseQueryGenerator;
|
|
753
770
|
}
|
|
754
771
|
});
|
|
755
|
-
//# sourceMappingURL=generators-
|
|
772
|
+
//# sourceMappingURL=generators-BiW_MevM.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators-BiW_MevM.cjs","names":["pluginClientName","pluginTsName","pluginZodName","File","QueryKey","Client","QueryOptions","Query","pluginTsName","pluginZodName","pluginClientName","File","MutationKey","Client","MutationOptions","Mutation","pluginClientName","pluginTsName","pluginZodName","File","QueryKey","Client","InfiniteQueryOptions","InfiniteQuery","pluginClientName","pluginTsName","pluginZodName","File","QueryKey","Client","QueryOptions","SuspenseQuery"],"sources":["../src/generators/queryGenerator.tsx","../src/generators/mutationGenerator.tsx","../src/generators/infiniteQueryGenerator.tsx","../src/generators/suspenseQueryGenerator.tsx"],"sourcesContent":["import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginReactQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginReactQuery>({\n name: 'react-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginReactQuery>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n\n const importPath = options.query ? options.query.importPath : '@tanstack/react-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'QueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'QueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'QueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n // grouping is coming from react-query instead of zod option, we need to pass the options of zod instead\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n if (!isQuery || isMutation) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n <File.Import name={'fetch'} path={options.client.importPath} />\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n transformer={options.queryKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsType={options.paramsType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n <File.Import name={['queryOptions']} path={importPath} />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType}\n />\n {options.query && (\n <>\n <File.Import name={['useQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'QueryObserverOptions', 'UseQueryResult', 'QueryClient']} path={importPath} isTypeOnly />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport { MutationOptions } from '../components/MutationOptions.tsx'\nimport type { PluginReactQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginReactQuery>({\n name: 'react-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginReactQuery>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method)\n const isMutation =\n !isQuery &&\n difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method)\n\n const importPath = options.mutation ? options.mutation.importPath : '@tanstack/react-query'\n\n const mutation = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const mutationOptions = {\n name: getName(operation, { type: 'function', suffix: 'MutationOptions' }),\n }\n\n const mutationKey = {\n name: getName(operation, { type: 'const', suffix: 'MutationKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'MutationKey' }),\n }\n\n if (!isMutation) {\n return null\n }\n\n return (\n <File\n baseName={mutation.file.baseName}\n path={mutation.file.path}\n meta={mutation.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={mutation.file.path} path={zod.file.path} />\n )}\n <File.Import name={'fetch'} path={options.client.importPath} />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={mutation.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n transformer={options.mutationKey}\n />\n\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n <File.Import name={['mutationOptions']} path={importPath} />\n\n <MutationOptions\n name={mutationOptions.name}\n clientName={client.name}\n mutationKeyName={mutationKey.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType}\n />\n {options.mutation && (\n <>\n <File.Import name={['useMutation']} path={importPath} />\n <File.Import name={['UseMutationOptions', 'QueryClient']} path={importPath} isTypeOnly />\n <Mutation\n name={mutation.name}\n mutationOptionsName={mutationOptions.name}\n typeName={mutation.typeName}\n typeSchemas={type.schemas}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { InfiniteQuery, InfiniteQueryOptions, QueryKey } from '../components'\nimport type { PluginReactQuery } from '../types'\n\nexport const infiniteQueryGenerator = createReactGenerator<PluginReactQuery>({\n name: 'react-infinite-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginReactQuery>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n const isInfinite = !!options.infinite\n\n const importPath = options.query ? options.query.importPath : '@tanstack/react-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use', suffix: 'infinite' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use', suffix: 'infinite' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n suffix: 'infinite',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'InfiniteQueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'InfiniteQueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'InfiniteQueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n if (!isQuery || isMutation || !isInfinite) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n {<File.Import name={'fetch'} path={options.client.importPath} />}\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.queryKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n {options.infinite && (\n <>\n <File.Import name={['InfiniteData']} isTypeOnly path={importPath} />\n <File.Import name={['infiniteQueryOptions']} path={importPath} />\n <InfiniteQueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType}\n cursorParam={options.infinite.cursorParam}\n initialPageParam={options.infinite.initialPageParam}\n queryParam={options.infinite.queryParam}\n />\n </>\n )}\n {options.infinite && (\n <>\n <File.Import name={['useInfiniteQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'InfiniteQueryObserverOptions', 'UseInfiniteQueryResult']} path={importPath} isTypeOnly />\n <InfiniteQuery\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n queryParam={options.infinite.queryParam}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { QueryKey, QueryOptions, SuspenseQuery } from '../components'\nimport type { PluginReactQuery } from '../types'\n\nexport const suspenseQueryGenerator = createReactGenerator<PluginReactQuery>({\n name: 'react-suspense-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginReactQuery>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n\n const isSuspense = !!options.suspense\n\n const importPath = options.query ? options.query.importPath : '@tanstack/react-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use', suffix: 'suspense' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use', suffix: 'suspense' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n suffix: 'suspense',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'SuspenseQueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'SuspenseQueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'SuspenseQueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n if (!isQuery || isMutation || !isSuspense) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n <File.Import name={'fetch'} path={options.client.importPath} />\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.queryKey}\n />\n\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n <File.Import name={['queryOptions']} path={importPath} />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType}\n />\n {options.suspense && (\n <>\n <File.Import name={['useSuspenseQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'UseSuspenseQueryOptions', 'UseSuspenseQueryResult']} path={importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n\n <SuspenseQuery\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAa,6DAAwD;CACnE,MAAM;CACN,UAAU,EAAE,SAAS,aAAa;EAChC,MAAM,EACJ,QAAQ,EACN,SAAS,EAAE,YAEb,4CAC4B;EAC9B,MAAM,2CAAc;EACpB,MAAM,EAAE,YAAY,SAAS,8DAAiC;EAE9D,MAAM,UAAU,OAAO,QAAQ,UAAU,YAAY,OAAO,QAAQ,OAAO,QAAQ,MAAM,WAAW,UAAU,WAAW,OAAO;EAChI,MAAM,oCAAwB,QAAQ,WAAW,QAAQ,SAAS,UAAU,EAAE,EAAE,QAAQ,QAAQ,QAAQ,MAAM,UAAU,EAAE,CAAC,CAAC,MACzH,WA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B,QAAQ,OAAO;KAC/B,cAAc,QAAQ;KACtB,YAAY,QAAQ;KACpB,gBAAgB,QAAQ;KACxB,QAAQ,QAAQ;MAChB;IAEJ,kDAACF,kBAAK;KAAO,MAAM,CAAC,eAAe;KAAE,MAAM;MAAc;IACzD,kDAACG;KACC,MAAM,aAAa;KACnB,YAAY,OAAO;KACnB,cAAc,SAAS;KACvB,aAAa,KAAK;KAClB,cAAc,QAAQ;KACtB,YAAY,QAAQ;KACpB,gBAAgB,QAAQ;KACxB,gBAAgB,QAAQ,OAAO;MAC/B;IACD,QAAQ,YACP;KACE,kDAACH,kBAAK;MAAO,MAAM,CAAC,mBAAmB;MAAE,MAAM;OAAc;KAC7D,kDAACA,kBAAK;MAAO,MAAM;OAAC;OAAY;OAAe;OAA2B;OAAyB;MAAE,MAAM;MAAY;OAAa;KACnI,QAAQ,OAAO,mBAAmB,UAAU,kDAACA,kBAAK;MAAO,MAAM,CAAC,iBAAiB;MAAE,MAAM,QAAQ,OAAO;MAAY;OAAa;KAElI,kDAACI;MACC,MAAM,MAAM;MACZ,kBAAkB,aAAa;MAC/B,aAAa,KAAK;MAClB,YAAY,QAAQ;MACpB,cAAc,QAAQ;MACtB,gBAAgB,QAAQ;MACb;MACX,gBAAgB,QAAQ,OAAO;MAC/B,cAAc,SAAS;MACvB,kBAAkB,SAAS;OAC3B;QACD;;IAEA;;CAGZ,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions, SuspenseQuery } from "./components-
|
|
1
|
+
import { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, MutationOptions, Query, QueryKey, QueryOptions, SuspenseQuery } from "./components-Dz_s6t75.js";
|
|
2
2
|
import { createReactGenerator } from "@kubb/plugin-oas";
|
|
3
3
|
import { pluginTsName } from "@kubb/plugin-ts";
|
|
4
4
|
import { pluginZodName } from "@kubb/plugin-zod";
|
|
5
|
-
import { File, useApp } from "@kubb/react";
|
|
6
|
-
import { Client } from "@kubb/plugin-client/components";
|
|
7
5
|
import { getBanner, getFooter } from "@kubb/plugin-oas/utils";
|
|
6
|
+
import { File, useApp } from "@kubb/react";
|
|
8
7
|
import { Fragment, jsx, jsxs } from "@kubb/react/jsx-runtime";
|
|
8
|
+
import { Client } from "@kubb/plugin-client/components";
|
|
9
9
|
import { pluginClientName } from "@kubb/plugin-client";
|
|
10
10
|
import { useOas, useOperationManager } from "@kubb/plugin-oas/hooks";
|
|
11
11
|
import { difference } from "remeda";
|
|
@@ -225,6 +225,10 @@ const mutationGenerator = createReactGenerator({
|
|
|
225
225
|
}) : getName(operation, { type: "function" }),
|
|
226
226
|
file: getFile(operation, { pluginKey: [pluginClientName] })
|
|
227
227
|
};
|
|
228
|
+
const mutationOptions = { name: getName(operation, {
|
|
229
|
+
type: "function",
|
|
230
|
+
suffix: "MutationOptions"
|
|
231
|
+
}) };
|
|
228
232
|
const mutationKey = {
|
|
229
233
|
name: getName(operation, {
|
|
230
234
|
type: "const",
|
|
@@ -307,6 +311,20 @@ const mutationGenerator = createReactGenerator({
|
|
|
307
311
|
pathParamsType: options.pathParamsType,
|
|
308
312
|
parser: options.parser
|
|
309
313
|
}),
|
|
314
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
315
|
+
name: ["mutationOptions"],
|
|
316
|
+
path: importPath
|
|
317
|
+
}),
|
|
318
|
+
/* @__PURE__ */ jsx(MutationOptions, {
|
|
319
|
+
name: mutationOptions.name,
|
|
320
|
+
clientName: client.name,
|
|
321
|
+
mutationKeyName: mutationKey.name,
|
|
322
|
+
typeSchemas: type.schemas,
|
|
323
|
+
paramsCasing: options.paramsCasing,
|
|
324
|
+
paramsType: options.paramsType,
|
|
325
|
+
pathParamsType: options.pathParamsType,
|
|
326
|
+
dataReturnType: options.client.dataReturnType
|
|
327
|
+
}),
|
|
310
328
|
options.mutation && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
311
329
|
/* @__PURE__ */ jsx(File.Import, {
|
|
312
330
|
name: ["useMutation"],
|
|
@@ -319,13 +337,12 @@ const mutationGenerator = createReactGenerator({
|
|
|
319
337
|
}),
|
|
320
338
|
/* @__PURE__ */ jsx(Mutation, {
|
|
321
339
|
name: mutation.name,
|
|
322
|
-
|
|
340
|
+
mutationOptionsName: mutationOptions.name,
|
|
323
341
|
typeName: mutation.typeName,
|
|
324
342
|
typeSchemas: type.schemas,
|
|
325
343
|
operation,
|
|
326
344
|
dataReturnType: options.client.dataReturnType,
|
|
327
345
|
paramsCasing: options.paramsCasing,
|
|
328
|
-
paramsType: options.paramsType,
|
|
329
346
|
pathParamsType: options.pathParamsType,
|
|
330
347
|
mutationKeyName: mutationKey.name
|
|
331
348
|
})
|
|
@@ -719,4 +736,4 @@ const suspenseQueryGenerator = createReactGenerator({
|
|
|
719
736
|
|
|
720
737
|
//#endregion
|
|
721
738
|
export { infiniteQueryGenerator, mutationGenerator, queryGenerator, suspenseQueryGenerator };
|
|
722
|
-
//# sourceMappingURL=generators-
|
|
739
|
+
//# sourceMappingURL=generators-ByqomtgH.js.map
|