@kubb/plugin-swr 3.16.1 → 3.16.3
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-BQIcQmn3.js +435 -0
- package/dist/components-BQIcQmn3.js.map +1 -0
- package/dist/components-Zv6v8ZAm.cjs +493 -0
- package/dist/components-Zv6v8ZAm.cjs.map +1 -0
- package/dist/components.cjs +6 -27
- package/dist/components.d.cts +177 -78
- package/dist/components.d.ts +177 -78
- package/dist/components.js +3 -3
- package/dist/generators-B-fWjDXL.js +328 -0
- package/dist/generators-B-fWjDXL.js.map +1 -0
- package/dist/generators-ByyKDjyt.cjs +339 -0
- package/dist/generators-ByyKDjyt.cjs.map +1 -0
- package/dist/generators.cjs +4 -16
- package/dist/generators.d.cts +8 -9
- package/dist/generators.d.ts +8 -9
- package/dist/generators.js +4 -4
- package/dist/index.cjs +107 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -8
- package/dist/index.d.ts +6 -8
- package/dist/index.js +107 -130
- package/dist/index.js.map +1 -1
- package/dist/types-CSnGy9Uj.d.ts +1355 -0
- package/dist/types-CjDGkyWH.d.cts +1355 -0
- package/package.json +25 -30
- package/dist/chunk-2N4Q32XH.cjs +0 -285
- package/dist/chunk-2N4Q32XH.cjs.map +0 -1
- package/dist/chunk-GWLPXHRE.js +0 -282
- package/dist/chunk-GWLPXHRE.js.map +0 -1
- package/dist/chunk-MNOTKHSE.cjs +0 -367
- package/dist/chunk-MNOTKHSE.cjs.map +0 -1
- package/dist/chunk-RZTUH4QW.js +0 -361
- package/dist/chunk-RZTUH4QW.js.map +0 -1
- package/dist/components.cjs.map +0 -1
- package/dist/components.js.map +0 -1
- package/dist/generators.cjs.map +0 -1
- package/dist/generators.js.map +0 -1
- package/dist/types-DVQ2siUx.d.cts +0 -134
- package/dist/types-DVQ2siUx.d.ts +0 -134
package/dist/chunk-RZTUH4QW.js
DELETED
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
import { File, Function, Type, FunctionParams } from '@kubb/react';
|
|
2
|
-
import { isOptional } from '@kubb/oas';
|
|
3
|
-
import { Client } from '@kubb/plugin-client/components';
|
|
4
|
-
import { getComments, getPathParams } from '@kubb/plugin-oas/utils';
|
|
5
|
-
import { URLPath } from '@kubb/core/utils';
|
|
6
|
-
import { jsxs, Fragment, jsx } from '@kubb/react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
// src/components/Mutation.tsx
|
|
9
|
-
function getParams({}) {
|
|
10
|
-
return FunctionParams.factory({});
|
|
11
|
-
}
|
|
12
|
-
var getTransformer = ({ operation, casing }) => {
|
|
13
|
-
const path = new URLPath(operation.path, { casing });
|
|
14
|
-
return [JSON.stringify({ url: path.path })].filter(Boolean);
|
|
15
|
-
};
|
|
16
|
-
function MutationKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }) {
|
|
17
|
-
const params = getParams({ });
|
|
18
|
-
const keys = transformer({ operation, schemas: typeSchemas, casing: paramsCasing });
|
|
19
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
|
-
/* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Function.Arrow, { name, export: true, params: params.toConstructor(), singleLine: true, children: `[${keys.join(", ")}] as const` }) }),
|
|
21
|
-
/* @__PURE__ */ jsx(File.Source, { name: typeName, isExportable: true, isIndexable: true, isTypeOnly: true, children: /* @__PURE__ */ jsx(Type, { name: typeName, export: true, children: `ReturnType<typeof ${name}>` }) })
|
|
22
|
-
] });
|
|
23
|
-
}
|
|
24
|
-
MutationKey.getParams = getParams;
|
|
25
|
-
MutationKey.getTransformer = getTransformer;
|
|
26
|
-
function getParams2({ pathParamsType, paramsCasing, dataReturnType, typeSchemas, mutationKeyTypeName }) {
|
|
27
|
-
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
28
|
-
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
29
|
-
return FunctionParams.factory({
|
|
30
|
-
pathParams: {
|
|
31
|
-
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
32
|
-
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing })
|
|
33
|
-
},
|
|
34
|
-
params: typeSchemas.queryParams?.name ? {
|
|
35
|
-
type: typeSchemas.queryParams?.name,
|
|
36
|
-
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
37
|
-
} : void 0,
|
|
38
|
-
headers: typeSchemas.headerParams?.name ? {
|
|
39
|
-
type: typeSchemas.headerParams?.name,
|
|
40
|
-
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
41
|
-
} : void 0,
|
|
42
|
-
options: {
|
|
43
|
-
type: `
|
|
44
|
-
{
|
|
45
|
-
mutation?: Parameters<typeof useSWRMutation<${[TData, TError, mutationKeyTypeName, typeSchemas.request?.name].join(", ")}>>[2],
|
|
46
|
-
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : "Partial<RequestConfig> & { client?: typeof fetch }"},
|
|
47
|
-
shouldFetch?: boolean,
|
|
48
|
-
}
|
|
49
|
-
`,
|
|
50
|
-
default: "{}"
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function Mutation({
|
|
55
|
-
name,
|
|
56
|
-
clientName,
|
|
57
|
-
mutationKeyName,
|
|
58
|
-
mutationKeyTypeName,
|
|
59
|
-
paramsType,
|
|
60
|
-
paramsCasing,
|
|
61
|
-
pathParamsType,
|
|
62
|
-
dataReturnType,
|
|
63
|
-
typeSchemas,
|
|
64
|
-
operation
|
|
65
|
-
}) {
|
|
66
|
-
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
67
|
-
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
68
|
-
const generics = [
|
|
69
|
-
TData,
|
|
70
|
-
TError,
|
|
71
|
-
`${mutationKeyTypeName} | null`,
|
|
72
|
-
typeSchemas.request?.name
|
|
73
|
-
//arg: data
|
|
74
|
-
].filter(Boolean);
|
|
75
|
-
const mutationKeyParams = MutationKey.getParams({
|
|
76
|
-
pathParamsType,
|
|
77
|
-
typeSchemas
|
|
78
|
-
});
|
|
79
|
-
const params = getParams2({
|
|
80
|
-
paramsCasing,
|
|
81
|
-
pathParamsType,
|
|
82
|
-
dataReturnType,
|
|
83
|
-
typeSchemas,
|
|
84
|
-
mutationKeyTypeName
|
|
85
|
-
});
|
|
86
|
-
const clientParams = Client.getParams({
|
|
87
|
-
paramsCasing,
|
|
88
|
-
paramsType,
|
|
89
|
-
typeSchemas,
|
|
90
|
-
pathParamsType,
|
|
91
|
-
isConfigurable: true
|
|
92
|
-
});
|
|
93
|
-
return /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(
|
|
94
|
-
Function,
|
|
95
|
-
{
|
|
96
|
-
name,
|
|
97
|
-
export: true,
|
|
98
|
-
params: params.toConstructor(),
|
|
99
|
-
JSDoc: {
|
|
100
|
-
comments: getComments(operation)
|
|
101
|
-
},
|
|
102
|
-
children: `
|
|
103
|
-
const { mutation: mutationOptions, client: config = {}, shouldFetch = true } = options ?? {}
|
|
104
|
-
const mutationKey = ${mutationKeyName}(${mutationKeyParams.toCall()})
|
|
105
|
-
|
|
106
|
-
return useSWRMutation<${generics}>(
|
|
107
|
-
shouldFetch ? mutationKey : null,
|
|
108
|
-
async (_url${typeSchemas.request?.name ? ", { arg: data }" : ""}) => {
|
|
109
|
-
return ${clientName}(${clientParams.toCall()})
|
|
110
|
-
},
|
|
111
|
-
mutationOptions
|
|
112
|
-
)
|
|
113
|
-
`
|
|
114
|
-
}
|
|
115
|
-
) });
|
|
116
|
-
}
|
|
117
|
-
function getParams3({ pathParamsType, paramsCasing, typeSchemas }) {
|
|
118
|
-
return FunctionParams.factory({
|
|
119
|
-
pathParams: {
|
|
120
|
-
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
121
|
-
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing })
|
|
122
|
-
},
|
|
123
|
-
data: typeSchemas.request?.name ? {
|
|
124
|
-
type: typeSchemas.request?.name,
|
|
125
|
-
optional: isOptional(typeSchemas.request?.schema)
|
|
126
|
-
} : void 0,
|
|
127
|
-
params: typeSchemas.queryParams?.name ? {
|
|
128
|
-
type: typeSchemas.queryParams?.name,
|
|
129
|
-
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
130
|
-
} : void 0
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
var getTransformer2 = ({ operation, schemas, casing }) => {
|
|
134
|
-
const path = new URLPath(operation.path, { casing });
|
|
135
|
-
const keys = [
|
|
136
|
-
path.toObject({
|
|
137
|
-
type: "path",
|
|
138
|
-
stringify: true
|
|
139
|
-
}),
|
|
140
|
-
schemas.queryParams?.name ? "...(params ? [params] : [])" : void 0,
|
|
141
|
-
schemas.request?.name ? "...(data ? [data] : [])" : void 0
|
|
142
|
-
].filter(Boolean);
|
|
143
|
-
return keys;
|
|
144
|
-
};
|
|
145
|
-
function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer2 }) {
|
|
146
|
-
const params = getParams3({ pathParamsType, paramsCasing, typeSchemas });
|
|
147
|
-
const keys = transformer({
|
|
148
|
-
operation,
|
|
149
|
-
schemas: typeSchemas,
|
|
150
|
-
casing: paramsCasing
|
|
151
|
-
});
|
|
152
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
153
|
-
/* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Function.Arrow, { name, export: true, params: params.toConstructor(), singleLine: true, children: `[${keys.join(", ")}] as const` }) }),
|
|
154
|
-
/* @__PURE__ */ jsx(File.Source, { name: typeName, isExportable: true, isIndexable: true, isTypeOnly: true, children: /* @__PURE__ */ jsx(Type, { name: typeName, export: true, children: `ReturnType<typeof ${name}>` }) })
|
|
155
|
-
] });
|
|
156
|
-
}
|
|
157
|
-
QueryKey.getParams = getParams3;
|
|
158
|
-
QueryKey.getTransformer = getTransformer2;
|
|
159
|
-
function getParams4({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
160
|
-
if (paramsType === "object") {
|
|
161
|
-
return FunctionParams.factory({
|
|
162
|
-
data: {
|
|
163
|
-
mode: "object",
|
|
164
|
-
children: {
|
|
165
|
-
...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
166
|
-
data: typeSchemas.request?.name ? {
|
|
167
|
-
type: typeSchemas.request?.name,
|
|
168
|
-
optional: isOptional(typeSchemas.request?.schema)
|
|
169
|
-
} : void 0,
|
|
170
|
-
params: typeSchemas.queryParams?.name ? {
|
|
171
|
-
type: typeSchemas.queryParams?.name,
|
|
172
|
-
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
173
|
-
} : void 0,
|
|
174
|
-
headers: typeSchemas.headerParams?.name ? {
|
|
175
|
-
type: typeSchemas.headerParams?.name,
|
|
176
|
-
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
177
|
-
} : void 0
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
config: {
|
|
181
|
-
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : "Partial<RequestConfig> & { client?: typeof fetch }",
|
|
182
|
-
default: "{}"
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
return FunctionParams.factory({
|
|
187
|
-
pathParams: typeSchemas.pathParams?.name ? {
|
|
188
|
-
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
189
|
-
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
190
|
-
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
191
|
-
} : void 0,
|
|
192
|
-
data: typeSchemas.request?.name ? {
|
|
193
|
-
type: typeSchemas.request?.name,
|
|
194
|
-
optional: isOptional(typeSchemas.request?.schema)
|
|
195
|
-
} : void 0,
|
|
196
|
-
params: typeSchemas.queryParams?.name ? {
|
|
197
|
-
type: typeSchemas.queryParams?.name,
|
|
198
|
-
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
199
|
-
} : void 0,
|
|
200
|
-
headers: typeSchemas.headerParams?.name ? {
|
|
201
|
-
type: typeSchemas.headerParams?.name,
|
|
202
|
-
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
203
|
-
} : void 0,
|
|
204
|
-
config: {
|
|
205
|
-
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : "Partial<RequestConfig> & { client?: typeof fetch }",
|
|
206
|
-
default: "{}"
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, pathParamsType }) {
|
|
211
|
-
const params = getParams4({ paramsType, paramsCasing, pathParamsType, typeSchemas });
|
|
212
|
-
const clientParams = Client.getParams({
|
|
213
|
-
paramsCasing,
|
|
214
|
-
paramsType,
|
|
215
|
-
typeSchemas,
|
|
216
|
-
pathParamsType,
|
|
217
|
-
isConfigurable: true
|
|
218
|
-
});
|
|
219
|
-
return /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Function, { name, export: true, params: params.toConstructor(), children: `
|
|
220
|
-
return {
|
|
221
|
-
fetcher: async () => {
|
|
222
|
-
return ${clientName}(${clientParams.toCall()})
|
|
223
|
-
},
|
|
224
|
-
}
|
|
225
|
-
` }) });
|
|
226
|
-
}
|
|
227
|
-
QueryOptions.getParams = getParams4;
|
|
228
|
-
function getParams5({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }) {
|
|
229
|
-
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
230
|
-
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
231
|
-
if (paramsType === "object") {
|
|
232
|
-
return FunctionParams.factory({
|
|
233
|
-
data: {
|
|
234
|
-
mode: "object",
|
|
235
|
-
children: {
|
|
236
|
-
...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
237
|
-
data: typeSchemas.request?.name ? {
|
|
238
|
-
type: typeSchemas.request?.name,
|
|
239
|
-
optional: isOptional(typeSchemas.request?.schema)
|
|
240
|
-
} : void 0,
|
|
241
|
-
params: typeSchemas.queryParams?.name ? {
|
|
242
|
-
type: typeSchemas.queryParams?.name,
|
|
243
|
-
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
244
|
-
} : void 0,
|
|
245
|
-
headers: typeSchemas.headerParams?.name ? {
|
|
246
|
-
type: typeSchemas.headerParams?.name,
|
|
247
|
-
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
248
|
-
} : void 0
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
options: {
|
|
252
|
-
type: `
|
|
253
|
-
{
|
|
254
|
-
query?: Parameters<typeof useSWR<${[TData, TError].join(", ")}>>[2],
|
|
255
|
-
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : "Partial<RequestConfig> & { client?: typeof fetch }"},
|
|
256
|
-
shouldFetch?: boolean,
|
|
257
|
-
immutable?: boolean
|
|
258
|
-
}
|
|
259
|
-
`,
|
|
260
|
-
default: "{}"
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
return FunctionParams.factory({
|
|
265
|
-
pathParams: typeSchemas.pathParams?.name ? {
|
|
266
|
-
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
267
|
-
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
268
|
-
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
269
|
-
} : void 0,
|
|
270
|
-
data: typeSchemas.request?.name ? {
|
|
271
|
-
type: typeSchemas.request?.name,
|
|
272
|
-
optional: isOptional(typeSchemas.request?.schema)
|
|
273
|
-
} : void 0,
|
|
274
|
-
params: typeSchemas.queryParams?.name ? {
|
|
275
|
-
type: typeSchemas.queryParams?.name,
|
|
276
|
-
optional: isOptional(typeSchemas.queryParams?.schema)
|
|
277
|
-
} : void 0,
|
|
278
|
-
headers: typeSchemas.headerParams?.name ? {
|
|
279
|
-
type: typeSchemas.headerParams?.name,
|
|
280
|
-
optional: isOptional(typeSchemas.headerParams?.schema)
|
|
281
|
-
} : void 0,
|
|
282
|
-
options: {
|
|
283
|
-
type: `
|
|
284
|
-
{
|
|
285
|
-
query?: Parameters<typeof useSWR<${[TData, TError].join(", ")}>>[2],
|
|
286
|
-
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : "Partial<RequestConfig> & { client?: typeof fetch }"},
|
|
287
|
-
shouldFetch?: boolean,
|
|
288
|
-
immutable?: boolean
|
|
289
|
-
}
|
|
290
|
-
`,
|
|
291
|
-
default: "{}"
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
function Query({
|
|
296
|
-
name,
|
|
297
|
-
typeSchemas,
|
|
298
|
-
queryKeyName,
|
|
299
|
-
queryKeyTypeName,
|
|
300
|
-
queryOptionsName,
|
|
301
|
-
operation,
|
|
302
|
-
dataReturnType,
|
|
303
|
-
paramsType,
|
|
304
|
-
paramsCasing,
|
|
305
|
-
pathParamsType
|
|
306
|
-
}) {
|
|
307
|
-
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
308
|
-
const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
|
|
309
|
-
const generics = [TData, TError, `${queryKeyTypeName} | null`];
|
|
310
|
-
const queryKeyParams = QueryKey.getParams({
|
|
311
|
-
pathParamsType,
|
|
312
|
-
typeSchemas,
|
|
313
|
-
paramsCasing
|
|
314
|
-
});
|
|
315
|
-
const params = getParams5({
|
|
316
|
-
paramsCasing,
|
|
317
|
-
paramsType,
|
|
318
|
-
pathParamsType,
|
|
319
|
-
dataReturnType,
|
|
320
|
-
typeSchemas
|
|
321
|
-
});
|
|
322
|
-
const queryOptionsParams = QueryOptions.getParams({
|
|
323
|
-
paramsCasing,
|
|
324
|
-
paramsType,
|
|
325
|
-
pathParamsType,
|
|
326
|
-
typeSchemas
|
|
327
|
-
});
|
|
328
|
-
return /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(
|
|
329
|
-
Function,
|
|
330
|
-
{
|
|
331
|
-
name,
|
|
332
|
-
export: true,
|
|
333
|
-
params: params.toConstructor(),
|
|
334
|
-
JSDoc: {
|
|
335
|
-
comments: getComments(operation)
|
|
336
|
-
},
|
|
337
|
-
children: `
|
|
338
|
-
const { query: queryOptions, client: config = {}, shouldFetch = true, immutable } = options ?? {}
|
|
339
|
-
|
|
340
|
-
const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})
|
|
341
|
-
|
|
342
|
-
return useSWR<${generics.join(", ")}>(
|
|
343
|
-
shouldFetch ? queryKey : null,
|
|
344
|
-
{
|
|
345
|
-
...${queryOptionsName}(${queryOptionsParams.toCall()}),
|
|
346
|
-
...(immutable ? {
|
|
347
|
-
revalidateIfStale: false,
|
|
348
|
-
revalidateOnFocus: false,
|
|
349
|
-
revalidateOnReconnect: false
|
|
350
|
-
} : { }),
|
|
351
|
-
...queryOptions
|
|
352
|
-
}
|
|
353
|
-
)
|
|
354
|
-
`
|
|
355
|
-
}
|
|
356
|
-
) });
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
export { Mutation, MutationKey, Query, QueryKey, QueryOptions };
|
|
360
|
-
//# sourceMappingURL=chunk-RZTUH4QW.js.map
|
|
361
|
-
//# sourceMappingURL=chunk-RZTUH4QW.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/MutationKey.tsx","../src/components/Mutation.tsx","../src/components/QueryKey.tsx","../src/components/QueryOptions.tsx","../src/components/Query.tsx"],"names":["getParams","FunctionParams","jsx","File","Function","getPathParams","isOptional","getTransformer","URLPath","jsxs","Fragment","Type","Client","getComments"],"mappings":";;;;;;;;AAuBA,SAAS,SAAA,CAAU,EAAoB,EAAA;AACrC,EAAO,OAAA,cAAA,CAAe,OAAQ,CAAA,EAAE,CAAA;AAClC;AAEA,IAAM,cAA8B,GAAA,CAAC,EAAE,SAAA,EAAW,QAAa,KAAA;AAC7D,EAAA,MAAM,OAAO,IAAI,OAAA,CAAQ,UAAU,IAAM,EAAA,EAAE,QAAQ,CAAA;AAEnD,EAAO,OAAA,CAAC,IAAK,CAAA,SAAA,CAAU,EAAE,GAAA,EAAK,IAAK,CAAA,IAAA,EAAM,CAAC,CAAE,CAAA,MAAA,CAAO,OAAO,CAAA;AAC5D,CAAA;AAEO,SAAS,WAAA,CAAY,EAAE,IAAA,EAAM,WAAa,EAAA,YAAA,EAAc,gBAAgB,SAAW,EAAA,QAAA,EAAU,WAAc,GAAA,cAAA,EAAoC,EAAA;AACpJ,EAAA,MAAM,MAAS,GAAA,SAAA,CAAU,EAA8B,CAAC,CAAA;AACxD,EAAM,MAAA,IAAA,GAAO,YAAY,EAAE,SAAA,EAAW,SAAS,WAAa,EAAA,MAAA,EAAQ,cAAc,CAAA;AAElF,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,IAAA,CAAK,MAAL,EAAA,EAAY,IAAY,EAAA,YAAA,EAAY,IAAC,EAAA,WAAA,EAAW,IAC/C,EAAA,QAAA,kBAAA,GAAA,CAAC,QAAS,CAAA,KAAA,EAA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AAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,MAAM,EAAA,IAAA;AAAA,MACN,MAAA,EAAQ,OAAO,aAAc,EAAA;AAAA,MAC7B,KAAO,EAAA;AAAA,QACL,QAAA,EAAUS,YAAY,SAAS;AAAA,OACjC;AAAA,MAEC,QAAA,EAAA;AAAA;;AAAA,wBAAA,EAGiB,YAAY,CAAA,CAAA,EAAI,cAAe,CAAA,MAAA,EAAQ,CAAA;;AAAA,qBAE1C,EAAA,QAAA,CAAS,IAAK,CAAA,IAAI,CAAC,CAAA;AAAA;AAAA;AAAA,aAAA,EAG3B,gBAAgB,CAAA,CAAA,EAAI,kBAAmB,CAAA,MAAA,EAAQ,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAA;AAAA;AAAA,GAW1D,EAAA,CAAA;AAEJ","file":"chunk-RZTUH4QW.js","sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport { File, Function, FunctionParams, Type } from '@kubb/react'\n\nimport type { Operation } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport type { ReactNode } from 'react'\nimport type { PluginSwr, Transformer } from '../types'\n\ntype Props = {\n name: string\n typeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n transformer: Transformer | undefined\n}\n\ntype GetParamsProps = {\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({}: GetParamsProps) {\n return FunctionParams.factory({})\n}\n\nconst getTransformer: Transformer = ({ operation, casing }) => {\n const path = new URLPath(operation.path, { casing })\n\n return [JSON.stringify({ url: path.path })].filter(Boolean)\n}\n\nexport function MutationKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }: Props): ReactNode {\n const params = getParams({ pathParamsType, typeSchemas })\n const keys = transformer({ operation, schemas: typeSchemas, casing: paramsCasing })\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Function.Arrow name={name} export params={params.toConstructor()} singleLine>\n {`[${keys.join(', ')}] as const`}\n </Function.Arrow>\n </File.Source>\n <File.Source name={typeName} isExportable isIndexable isTypeOnly>\n <Type name={typeName} export>\n {`ReturnType<typeof ${name}>`}\n </Type>\n </File.Source>\n </>\n )\n}\n\nMutationKey.getParams = getParams\nMutationKey.getTransformer = getTransformer\n","import { File, Function, FunctionParams } from '@kubb/react'\n\nimport { type Operation, isOptional } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport type { ReactNode } from 'react'\nimport type { PluginSwr } from '../types.ts'\nimport { MutationKey } from './MutationKey.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n clientName: string\n mutationKeyName: string\n mutationKeyTypeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n paramsType: PluginSwr['resolvedOptions']['paramsType']\n dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType']\n typeSchemas: OperationSchemas\n mutationKeyTypeName: string\n}\n// TODO add same logic as being done for react-query mutations\nfunction getParams({ pathParamsType, paramsCasing, dataReturnType, typeSchemas, mutationKeyTypeName }: GetParamsProps) {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n },\n params: typeSchemas.queryParams?.name\n ? {\n type: typeSchemas.queryParams?.name,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: typeSchemas.headerParams?.name,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: `\n{\n mutation?: Parameters<typeof useSWRMutation<${[TData, TError, mutationKeyTypeName, typeSchemas.request?.name].join(', ')}>>[2],\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'},\n shouldFetch?: boolean,\n}\n`,\n default: '{}',\n },\n })\n}\n\nexport function Mutation({\n name,\n clientName,\n mutationKeyName,\n mutationKeyTypeName,\n paramsType,\n paramsCasing,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n operation,\n}: Props): ReactNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n const generics = [\n TData,\n TError,\n `${mutationKeyTypeName} | null`,\n typeSchemas.request?.name, //arg: data\n ].filter(Boolean)\n\n const mutationKeyParams = MutationKey.getParams({\n pathParamsType,\n typeSchemas,\n })\n\n const params = getParams({\n paramsCasing,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n mutationKeyTypeName,\n })\n\n const clientParams = Client.getParams({\n paramsCasing,\n paramsType,\n typeSchemas,\n pathParamsType,\n isConfigurable: true,\n })\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n params={params.toConstructor()}\n JSDoc={{\n comments: getComments(operation),\n }}\n >\n {`\n const { mutation: mutationOptions, client: config = {}, shouldFetch = true } = options ?? {}\n const mutationKey = ${mutationKeyName}(${mutationKeyParams.toCall()})\n\n return useSWRMutation<${generics}>(\n shouldFetch ? mutationKey : null,\n async (_url${typeSchemas.request?.name ? ', { arg: data }' : ''}) => {\n return ${clientName}(${clientParams.toCall()})\n },\n mutationOptions\n )\n `}\n </Function>\n </File.Source>\n )\n}\n","import { URLPath } from '@kubb/core/utils'\nimport { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams, Type } from '@kubb/react'\n\nimport { type Operation, isOptional } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport type { ReactNode } from 'react'\nimport type { PluginSwr, Transformer } from '../types'\n\ntype Props = {\n name: string\n typeName: string\n typeSchemas: OperationSchemas\n operation: Operation\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n transformer: Transformer | undefined\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ pathParamsType, paramsCasing, typeSchemas }: GetParamsProps) {\n return FunctionParams.factory({\n pathParams: {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n },\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: typeSchemas.queryParams?.name,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n })\n}\n\nconst getTransformer: Transformer = ({ operation, schemas, casing }) => {\n const path = new URLPath(operation.path, { casing })\n const keys = [\n path.toObject({\n type: 'path',\n stringify: true,\n }),\n schemas.queryParams?.name ? '...(params ? [params] : [])' : undefined,\n schemas.request?.name ? '...(data ? [data] : [])' : undefined,\n ].filter(Boolean)\n\n return keys\n}\n\nexport function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }: Props): ReactNode {\n const params = getParams({ pathParamsType, paramsCasing, typeSchemas })\n const keys = transformer({\n operation,\n schemas: typeSchemas,\n casing: paramsCasing,\n })\n\n return (\n <>\n <File.Source name={name} isExportable isIndexable>\n <Function.Arrow name={name} export params={params.toConstructor()} singleLine>\n {`[${keys.join(', ')}] as const`}\n </Function.Arrow>\n </File.Source>\n <File.Source name={typeName} isExportable isIndexable isTypeOnly>\n <Type name={typeName} export>\n {`ReturnType<typeof ${name}>`}\n </Type>\n </File.Source>\n </>\n )\n}\n\nQueryKey.getParams = getParams\nQueryKey.getTransformer = getTransformer\n","import { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } from '@kubb/react'\n\nimport type { ReactNode } from 'react'\nimport type { PluginSwr } from '../types.ts'\n\nimport { isOptional } from '@kubb/oas'\nimport { Client } from '@kubb/plugin-client/components'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\n\ntype Props = {\n name: string\n clientName: string\n typeSchemas: OperationSchemas\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n paramsType: PluginSwr['resolvedOptions']['paramsType']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n}\n\ntype GetParamsProps = {\n paramsType: PluginSwr['resolvedOptions']['paramsType']\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) {\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: typeSchemas.queryParams?.name,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: typeSchemas.headerParams?.name,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: typeSchemas.pathParams?.name\n ? {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n optional: isOptional(typeSchemas.pathParams?.schema),\n }\n : undefined,\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: typeSchemas.queryParams?.name,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: typeSchemas.headerParams?.name,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n config: {\n type: typeSchemas.request?.name\n ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }`\n : 'Partial<RequestConfig> & { client?: typeof fetch }',\n default: '{}',\n },\n })\n}\n\nexport function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, pathParamsType }: Props): ReactNode {\n const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })\n const clientParams = Client.getParams({\n paramsCasing,\n paramsType,\n typeSchemas,\n pathParamsType,\n isConfigurable: true,\n })\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function name={name} export params={params.toConstructor()}>\n {`\n return {\n fetcher: async () => {\n return ${clientName}(${clientParams.toCall()})\n },\n }\n `}\n </Function>\n </File.Source>\n )\n}\n\nQueryOptions.getParams = getParams\n","import { File, Function, FunctionParams } from '@kubb/react'\n\nimport { type Operation, isOptional } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport type { ReactNode } from 'react'\nimport type { PluginSwr } from '../types.ts'\nimport { QueryKey } from './QueryKey.tsx'\nimport { QueryOptions } from './QueryOptions.tsx'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n queryOptionsName: string\n queryKeyName: string\n queryKeyTypeName: string\n typeSchemas: OperationSchemas\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n paramsType: PluginSwr['resolvedOptions']['paramsType']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType']\n operation: Operation\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginSwr['resolvedOptions']['paramsCasing']\n paramsType: PluginSwr['resolvedOptions']['paramsType']\n pathParamsType: PluginSwr['resolvedOptions']['pathParamsType']\n dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n\n if (paramsType === 'object') {\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: typeSchemas.queryParams?.name,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: typeSchemas.headerParams?.name,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n options: {\n type: `\n{\n query?: Parameters<typeof useSWR<${[TData, TError].join(', ')}>>[2],\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'},\n shouldFetch?: boolean,\n immutable?: boolean\n}\n`,\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: typeSchemas.pathParams?.name\n ? {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n optional: isOptional(typeSchemas.pathParams?.schema),\n }\n : undefined,\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: typeSchemas.queryParams?.name,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: typeSchemas.headerParams?.name,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: `\n{\n query?: Parameters<typeof useSWR<${[TData, TError].join(', ')}>>[2],\n client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof fetch }` : 'Partial<RequestConfig> & { client?: typeof fetch }'},\n shouldFetch?: boolean,\n immutable?: boolean\n}\n`,\n default: '{}',\n },\n })\n}\n\nexport function Query({\n name,\n typeSchemas,\n queryKeyName,\n queryKeyTypeName,\n queryOptionsName,\n operation,\n dataReturnType,\n paramsType,\n paramsCasing,\n pathParamsType,\n}: Props): ReactNode {\n const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`\n const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'}>`\n const generics = [TData, TError, `${queryKeyTypeName} | null`]\n\n const queryKeyParams = QueryKey.getParams({\n pathParamsType,\n typeSchemas,\n paramsCasing,\n })\n const params = getParams({\n paramsCasing,\n paramsType,\n pathParamsType,\n dataReturnType,\n typeSchemas,\n })\n\n const queryOptionsParams = QueryOptions.getParams({\n paramsCasing,\n paramsType,\n pathParamsType,\n typeSchemas,\n })\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n export\n params={params.toConstructor()}\n JSDoc={{\n comments: getComments(operation),\n }}\n >\n {`\n const { query: queryOptions, client: config = {}, shouldFetch = true, immutable } = options ?? {}\n\n const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})\n\n return useSWR<${generics.join(', ')}>(\n shouldFetch ? queryKey : null,\n {\n ...${queryOptionsName}(${queryOptionsParams.toCall()}),\n ...(immutable ? {\n revalidateIfStale: false,\n revalidateOnFocus: false,\n revalidateOnReconnect: false\n } : { }),\n ...queryOptions\n }\n )\n `}\n </Function>\n </File.Source>\n )\n}\n"]}
|
package/dist/components.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"components.cjs"}
|
package/dist/components.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"components.js"}
|
package/dist/generators.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"generators.cjs"}
|
package/dist/generators.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"generators.js"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { Output, Group, PluginFactoryOptions, ResolveNameParams } from '@kubb/core';
|
|
2
|
-
import { Oas, contentType, Operation, HttpMethod } from '@kubb/oas';
|
|
3
|
-
import { PluginClient } from '@kubb/plugin-client';
|
|
4
|
-
import { Exclude, Include, Override, ResolvePathOptions, OperationSchemas, Generator } from '@kubb/plugin-oas';
|
|
5
|
-
|
|
6
|
-
type TransformerProps = {
|
|
7
|
-
operation: Operation;
|
|
8
|
-
schemas: OperationSchemas;
|
|
9
|
-
casing: 'camelcase' | undefined;
|
|
10
|
-
};
|
|
11
|
-
type Transformer = (props: TransformerProps) => unknown[];
|
|
12
|
-
/**
|
|
13
|
-
* Customize the queryKey
|
|
14
|
-
*/
|
|
15
|
-
type QueryKey = Transformer;
|
|
16
|
-
/**
|
|
17
|
-
* Customize the mutationKey
|
|
18
|
-
*/
|
|
19
|
-
type MutationKey = Transformer;
|
|
20
|
-
type Query = {
|
|
21
|
-
/**
|
|
22
|
-
* Define which HttpMethods can be used for queries
|
|
23
|
-
* @default ['get']
|
|
24
|
-
*/
|
|
25
|
-
methods?: Array<HttpMethod>;
|
|
26
|
-
/**
|
|
27
|
-
* Path to the useQuery that will be used to do the useQuery functionality.
|
|
28
|
-
* It will be used as `import { useQuery } from '${importPath}'`.
|
|
29
|
-
* It allows both relative and absolute path.
|
|
30
|
-
* the path will be applied as is, so relative path should be based on the file being generated.
|
|
31
|
-
* @default 'swr'
|
|
32
|
-
*/
|
|
33
|
-
importPath?: string;
|
|
34
|
-
};
|
|
35
|
-
type Mutation = {
|
|
36
|
-
/**
|
|
37
|
-
* Define which HttpMethods can be used for queries
|
|
38
|
-
* @default ['post', 'put', 'delete', 'patch']
|
|
39
|
-
*/
|
|
40
|
-
methods?: Array<HttpMethod>;
|
|
41
|
-
/**
|
|
42
|
-
* Path to the useQuery that will be used to do the useQuery functionality.
|
|
43
|
-
* It will be used as `import { useQuery } from '${importPath}'`.
|
|
44
|
-
* It allows both relative and absolute path.
|
|
45
|
-
* the path will be applied as is, so relative path should be based on the file being generated.
|
|
46
|
-
* @default 'swr/mutation'
|
|
47
|
-
*/
|
|
48
|
-
importPath?: string;
|
|
49
|
-
};
|
|
50
|
-
type Options = {
|
|
51
|
-
/**
|
|
52
|
-
* Specify the export location for the files and define the behavior of the output
|
|
53
|
-
* @default { path: 'hooks', barrelType: 'named' }
|
|
54
|
-
*/
|
|
55
|
-
output?: Output<Oas>;
|
|
56
|
-
/**
|
|
57
|
-
* Define which contentType should be used.
|
|
58
|
-
* By default, the first JSON valid mediaType will be used
|
|
59
|
-
*/
|
|
60
|
-
contentType?: contentType;
|
|
61
|
-
/**
|
|
62
|
-
* Group the SWR hooks based on the provided name.
|
|
63
|
-
*/
|
|
64
|
-
group?: Group;
|
|
65
|
-
/**
|
|
66
|
-
* Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
|
|
67
|
-
*/
|
|
68
|
-
exclude?: Array<Exclude>;
|
|
69
|
-
/**
|
|
70
|
-
* Array containing include parameters to include tags/operations/methods/paths.
|
|
71
|
-
*/
|
|
72
|
-
include?: Array<Include>;
|
|
73
|
-
/**
|
|
74
|
-
* Array containing override parameters to override `options` based on tags/operations/methods/paths.
|
|
75
|
-
*/
|
|
76
|
-
override?: Array<Override<ResolvedOptions>>;
|
|
77
|
-
client?: Pick<PluginClient['options'], 'dataReturnType' | 'importPath' | 'baseURL'>;
|
|
78
|
-
queryKey?: QueryKey;
|
|
79
|
-
query?: Query | false;
|
|
80
|
-
mutationKey?: MutationKey;
|
|
81
|
-
mutation?: Mutation | false;
|
|
82
|
-
/**
|
|
83
|
-
* How to style your params, by default no casing is applied
|
|
84
|
-
* - 'camelcase' will use camelcase for the params names
|
|
85
|
-
*/
|
|
86
|
-
paramsCasing?: 'camelcase';
|
|
87
|
-
/**
|
|
88
|
-
* How to pass your params
|
|
89
|
-
* - 'object' will return the params and pathParams as an object.
|
|
90
|
-
* - 'inline' will return the params as comma separated params.
|
|
91
|
-
* @default 'inline'
|
|
92
|
-
*/
|
|
93
|
-
paramsType?: 'object' | 'inline';
|
|
94
|
-
/**
|
|
95
|
-
* How to pass your pathParams.
|
|
96
|
-
* - 'object' will return the pathParams as an object.
|
|
97
|
-
* - 'inline' will return the pathParams as comma separated params.
|
|
98
|
-
* @default 'inline'
|
|
99
|
-
*/
|
|
100
|
-
pathParamsType?: PluginClient['options']['pathParamsType'];
|
|
101
|
-
/**
|
|
102
|
-
* Which parser should be used before returning the data to `swr`.
|
|
103
|
-
* `'zod'` will use `@kubb/plugin-zod` to parse the data.
|
|
104
|
-
*/
|
|
105
|
-
parser?: PluginClient['options']['parser'];
|
|
106
|
-
transformers?: {
|
|
107
|
-
/**
|
|
108
|
-
* Customize the names based on the type that is provided by the plugin.
|
|
109
|
-
*/
|
|
110
|
-
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* Define some generators next to the swr generators
|
|
114
|
-
*/
|
|
115
|
-
generators?: Array<Generator<PluginSwr>>;
|
|
116
|
-
};
|
|
117
|
-
type ResolvedOptions = {
|
|
118
|
-
output: Output<Oas>;
|
|
119
|
-
client: Required<Omit<NonNullable<PluginSwr['options']['client']>, 'baseURL'>> & {
|
|
120
|
-
baseURL?: string;
|
|
121
|
-
};
|
|
122
|
-
parser: Required<NonNullable<Options['parser']>>;
|
|
123
|
-
queryKey: QueryKey | undefined;
|
|
124
|
-
query: NonNullable<Required<Query>> | false;
|
|
125
|
-
mutationKey: MutationKey | undefined;
|
|
126
|
-
mutation: NonNullable<Required<Mutation>> | false;
|
|
127
|
-
paramsCasing: Options['paramsCasing'];
|
|
128
|
-
paramsType: NonNullable<Options['paramsType']>;
|
|
129
|
-
pathParamsType: NonNullable<Options['pathParamsType']>;
|
|
130
|
-
group: Options['group'];
|
|
131
|
-
};
|
|
132
|
-
type PluginSwr = PluginFactoryOptions<'plugin-swr', Options, ResolvedOptions, never, ResolvePathOptions>;
|
|
133
|
-
|
|
134
|
-
export type { Options as O, PluginSwr as P, Transformer as T };
|