@kubb/plugin-swr 5.0.0-alpha.34 → 5.0.0-alpha.35
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-BJSzUg7M.cjs +955 -0
- package/dist/components-BJSzUg7M.cjs.map +1 -0
- package/dist/components-JQ2KRFCa.js +877 -0
- package/dist/components-JQ2KRFCa.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +77 -37
- package/dist/components.js +1 -1
- package/dist/generators-17ulS9mu.cjs +537 -0
- package/dist/generators-17ulS9mu.cjs.map +1 -0
- package/dist/generators-Cl7nr-FB.js +526 -0
- package/dist/generators-Cl7nr-FB.js.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.ts +4 -4
- package/dist/generators.js +1 -1
- package/dist/index.cjs +132 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +22 -2
- package/dist/index.js +132 -110
- package/dist/index.js.map +1 -1
- package/dist/{types-BVDtH9S7.d.ts → types-FA5mH9Ch.d.ts} +46 -90
- package/package.json +7 -11
- package/src/components/Mutation.tsx +165 -170
- package/src/components/MutationKey.tsx +50 -1
- package/src/components/Query.tsx +122 -126
- package/src/components/QueryKey.tsx +65 -1
- package/src/components/QueryOptions.tsx +38 -93
- package/src/generators/mutationGenerator.tsx +194 -117
- package/src/generators/queryGenerator.tsx +205 -139
- package/src/plugin.ts +117 -152
- package/src/resolvers/resolverSwr.ts +26 -0
- package/src/resolvers/resolverSwrLegacy.ts +17 -0
- package/src/types.ts +55 -18
- package/src/utils.ts +209 -0
- package/dist/components-DaCTPplv.js +0 -756
- package/dist/components-DaCTPplv.js.map +0 -1
- package/dist/components-Qs8_faOt.cjs +0 -834
- package/dist/components-Qs8_faOt.cjs.map +0 -1
- package/dist/generators-0YayIrse.js +0 -400
- package/dist/generators-0YayIrse.js.map +0 -1
- package/dist/generators-Bd4rCa3l.cjs +0 -411
- package/dist/generators-Bd4rCa3l.cjs.map +0 -1
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
+
import { a as Mutation, i as MutationKey, n as QueryOptions, o as transformName, r as QueryKey, t as Query } from "./components-JQ2KRFCa.js";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { ast, defineGenerator } from "@kubb/core";
|
|
5
|
+
import { ClientLegacy, pluginClientName } from "@kubb/plugin-client";
|
|
6
|
+
import { pluginTsName } from "@kubb/plugin-ts";
|
|
7
|
+
import { pluginZodName } from "@kubb/plugin-zod";
|
|
8
|
+
import { File, jsxRenderer } from "@kubb/renderer-jsx";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "@kubb/renderer-jsx/jsx-runtime";
|
|
10
|
+
import { difference } from "remeda";
|
|
11
|
+
//#region src/generators/mutationGenerator.tsx
|
|
12
|
+
const mutationGenerator = defineGenerator({
|
|
13
|
+
name: "swr-mutation",
|
|
14
|
+
renderer: jsxRenderer,
|
|
15
|
+
operation(node, ctx) {
|
|
16
|
+
const { adapter, config, driver, resolver, root } = ctx;
|
|
17
|
+
const { output, query, mutation, paramsCasing, paramsType, pathParamsType, parser, client: clientOptions, group, transformers } = ctx.options;
|
|
18
|
+
const pluginTs = driver.getPlugin(pluginTsName);
|
|
19
|
+
if (!pluginTs?.resolver) return null;
|
|
20
|
+
const tsResolver = pluginTs.resolver;
|
|
21
|
+
const isQuery = !!query && query.methods.some((method) => node.method.toLowerCase() === method.toLowerCase());
|
|
22
|
+
if (!(mutation !== false && !isQuery && difference(mutation ? mutation.methods : [], query ? query.methods : []).some((method) => node.method.toLowerCase() === method.toLowerCase()))) return null;
|
|
23
|
+
const importPath = mutation ? mutation.importPath : "swr/mutation";
|
|
24
|
+
const baseName = resolver.resolveName(node.operationId);
|
|
25
|
+
const mutationHookName = transformName(`use${baseName.charAt(0).toUpperCase()}${baseName.slice(1)}`, "function", transformers);
|
|
26
|
+
const mutationTypeName = transformName(`${baseName.charAt(0).toUpperCase()}${baseName.slice(1)}`, "type", transformers);
|
|
27
|
+
const mutationKeyName = transformName(`${baseName}MutationKey`, "const", transformers);
|
|
28
|
+
const mutationKeyTypeName = transformName(`${baseName.charAt(0).toUpperCase()}${baseName.slice(1)}MutationKey`, "type", transformers);
|
|
29
|
+
const clientName = baseName;
|
|
30
|
+
const meta = {
|
|
31
|
+
file: resolver.resolveFile({
|
|
32
|
+
name: mutationHookName,
|
|
33
|
+
extname: ".ts",
|
|
34
|
+
tag: node.tags[0] ?? "default",
|
|
35
|
+
path: node.path
|
|
36
|
+
}, {
|
|
37
|
+
root,
|
|
38
|
+
output,
|
|
39
|
+
group
|
|
40
|
+
}),
|
|
41
|
+
fileTs: tsResolver.resolveFile({
|
|
42
|
+
name: node.operationId,
|
|
43
|
+
extname: ".ts",
|
|
44
|
+
tag: node.tags[0] ?? "default",
|
|
45
|
+
path: node.path
|
|
46
|
+
}, {
|
|
47
|
+
root,
|
|
48
|
+
output: pluginTs.options?.output ?? output,
|
|
49
|
+
group: pluginTs.options?.group
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
const casedParams = ast.caseParams(node.parameters, paramsCasing);
|
|
53
|
+
const pathParams = casedParams.filter((p) => p.in === "path");
|
|
54
|
+
const queryParams = casedParams.filter((p) => p.in === "query");
|
|
55
|
+
const headerParams = casedParams.filter((p) => p.in === "header");
|
|
56
|
+
const importedTypeNames = [
|
|
57
|
+
...pathParams.map((p) => tsResolver.resolvePathParamsName(node, p)),
|
|
58
|
+
...queryParams.map((p) => tsResolver.resolveQueryParamsName(node, p)),
|
|
59
|
+
...headerParams.map((p) => tsResolver.resolveHeaderParamsName(node, p)),
|
|
60
|
+
node.requestBody?.schema ? tsResolver.resolveDataName(node) : void 0,
|
|
61
|
+
tsResolver.resolveResponseName(node),
|
|
62
|
+
...node.responses.map((res) => tsResolver.resolveResponseStatusName(node, res.statusCode))
|
|
63
|
+
].filter(Boolean);
|
|
64
|
+
const pluginZodRaw = parser === "zod" ? driver.getPlugin(pluginZodName) : void 0;
|
|
65
|
+
const pluginZod = pluginZodRaw?.name === pluginZodName ? pluginZodRaw : void 0;
|
|
66
|
+
const zodResolver = pluginZod?.resolver;
|
|
67
|
+
const fileZod = zodResolver ? zodResolver.resolveFile({
|
|
68
|
+
name: node.operationId,
|
|
69
|
+
extname: ".ts",
|
|
70
|
+
tag: node.tags[0] ?? "default",
|
|
71
|
+
path: node.path
|
|
72
|
+
}, {
|
|
73
|
+
root,
|
|
74
|
+
output: pluginZod?.options?.output ?? output,
|
|
75
|
+
group: pluginZod?.options?.group
|
|
76
|
+
}) : void 0;
|
|
77
|
+
const zodSchemaNames = zodResolver && parser === "zod" ? [zodResolver.resolveResponseName?.(node), node.requestBody?.schema ? zodResolver.resolveDataName?.(node) : void 0].filter(Boolean) : [];
|
|
78
|
+
const clientPlugin = driver.getPlugin(pluginClientName);
|
|
79
|
+
const shouldUseClientPlugin = clientPlugin?.name === pluginClientName && clientOptions.clientType !== "class";
|
|
80
|
+
const clientFile = shouldUseClientPlugin ? clientPlugin?.resolver?.resolveFile({
|
|
81
|
+
name: node.operationId,
|
|
82
|
+
extname: ".ts",
|
|
83
|
+
tag: node.tags[0] ?? "default",
|
|
84
|
+
path: node.path
|
|
85
|
+
}, {
|
|
86
|
+
root,
|
|
87
|
+
output: clientPlugin?.options?.output ?? output,
|
|
88
|
+
group: clientPlugin?.options?.group
|
|
89
|
+
}) : void 0;
|
|
90
|
+
const resolvedClientName = shouldUseClientPlugin ? clientPlugin?.resolver?.resolveName(node.operationId) ?? clientName : clientName;
|
|
91
|
+
return /* @__PURE__ */ jsxs(File, {
|
|
92
|
+
baseName: meta.file.baseName,
|
|
93
|
+
path: meta.file.path,
|
|
94
|
+
meta: meta.file.meta,
|
|
95
|
+
banner: resolver.resolveBanner(adapter.inputNode, {
|
|
96
|
+
output,
|
|
97
|
+
config
|
|
98
|
+
}),
|
|
99
|
+
footer: resolver.resolveFooter(adapter.inputNode, {
|
|
100
|
+
output,
|
|
101
|
+
config
|
|
102
|
+
}),
|
|
103
|
+
children: [
|
|
104
|
+
parser === "zod" && fileZod && zodSchemaNames.length > 0 && /* @__PURE__ */ jsx(File.Import, {
|
|
105
|
+
name: zodSchemaNames,
|
|
106
|
+
root: meta.file.path,
|
|
107
|
+
path: fileZod.path
|
|
108
|
+
}),
|
|
109
|
+
clientOptions.importPath ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
110
|
+
!shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
|
|
111
|
+
name: "fetch",
|
|
112
|
+
path: clientOptions.importPath
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
115
|
+
name: [
|
|
116
|
+
"Client",
|
|
117
|
+
"RequestConfig",
|
|
118
|
+
"ResponseErrorConfig"
|
|
119
|
+
],
|
|
120
|
+
path: clientOptions.importPath,
|
|
121
|
+
isTypeOnly: true
|
|
122
|
+
}),
|
|
123
|
+
clientOptions.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
124
|
+
name: ["ResponseConfig"],
|
|
125
|
+
path: clientOptions.importPath,
|
|
126
|
+
isTypeOnly: true
|
|
127
|
+
})
|
|
128
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
129
|
+
!shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
|
|
130
|
+
name: ["fetch"],
|
|
131
|
+
root: meta.file.path,
|
|
132
|
+
path: path.resolve(root, ".kubb/fetch.ts")
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
135
|
+
name: [
|
|
136
|
+
"Client",
|
|
137
|
+
"RequestConfig",
|
|
138
|
+
"ResponseErrorConfig"
|
|
139
|
+
],
|
|
140
|
+
root: meta.file.path,
|
|
141
|
+
path: path.resolve(root, ".kubb/fetch.ts"),
|
|
142
|
+
isTypeOnly: true
|
|
143
|
+
}),
|
|
144
|
+
clientOptions.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
145
|
+
name: ["ResponseConfig"],
|
|
146
|
+
root: meta.file.path,
|
|
147
|
+
path: path.resolve(root, ".kubb/fetch.ts"),
|
|
148
|
+
isTypeOnly: true
|
|
149
|
+
})
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
152
|
+
name: "useSWRMutation",
|
|
153
|
+
path: importPath
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
156
|
+
name: ["SWRMutationConfiguration", "SWRMutationResponse"],
|
|
157
|
+
path: importPath,
|
|
158
|
+
isTypeOnly: true
|
|
159
|
+
}),
|
|
160
|
+
shouldUseClientPlugin && clientFile && /* @__PURE__ */ jsx(File.Import, {
|
|
161
|
+
name: [resolvedClientName],
|
|
162
|
+
root: meta.file.path,
|
|
163
|
+
path: clientFile.path
|
|
164
|
+
}),
|
|
165
|
+
!shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
|
|
166
|
+
name: ["buildFormData"],
|
|
167
|
+
root: meta.file.path,
|
|
168
|
+
path: path.resolve(root, ".kubb/config.ts")
|
|
169
|
+
}),
|
|
170
|
+
meta.fileTs && importedTypeNames.length > 0 && /* @__PURE__ */ jsx(File.Import, {
|
|
171
|
+
name: Array.from(new Set(importedTypeNames)),
|
|
172
|
+
root: meta.file.path,
|
|
173
|
+
path: meta.fileTs.path,
|
|
174
|
+
isTypeOnly: true
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ jsx(MutationKey, {
|
|
177
|
+
name: mutationKeyName,
|
|
178
|
+
typeName: mutationKeyTypeName,
|
|
179
|
+
node,
|
|
180
|
+
pathParamsType,
|
|
181
|
+
paramsCasing,
|
|
182
|
+
transformer: ctx.options.mutationKey
|
|
183
|
+
}),
|
|
184
|
+
!shouldUseClientPlugin && /* @__PURE__ */ jsx(ClientLegacy, {
|
|
185
|
+
name: resolvedClientName,
|
|
186
|
+
baseURL: clientOptions.baseURL,
|
|
187
|
+
operation: {
|
|
188
|
+
path: node.path,
|
|
189
|
+
method: node.method,
|
|
190
|
+
getDescription: () => node.description,
|
|
191
|
+
getSummary: () => node.summary,
|
|
192
|
+
isDeprecated: () => node.deprecated ?? false,
|
|
193
|
+
getContentType: () => node.requestBody?.contentType ?? "application/json"
|
|
194
|
+
},
|
|
195
|
+
typeSchemas: buildLegacyTypeSchemas$1(node, tsResolver),
|
|
196
|
+
zodSchemas: zodResolver ? buildLegacyTypeSchemas$1(node, zodResolver) : void 0,
|
|
197
|
+
dataReturnType: clientOptions.dataReturnType || "data",
|
|
198
|
+
paramsCasing: clientOptions.paramsCasing || paramsCasing,
|
|
199
|
+
paramsType,
|
|
200
|
+
pathParamsType,
|
|
201
|
+
parser
|
|
202
|
+
}),
|
|
203
|
+
mutation && /* @__PURE__ */ jsx(Mutation, {
|
|
204
|
+
name: mutationHookName,
|
|
205
|
+
clientName: resolvedClientName,
|
|
206
|
+
typeName: mutationTypeName,
|
|
207
|
+
node,
|
|
208
|
+
tsResolver,
|
|
209
|
+
dataReturnType: clientOptions.dataReturnType || "data",
|
|
210
|
+
paramsType,
|
|
211
|
+
paramsCasing,
|
|
212
|
+
pathParamsType,
|
|
213
|
+
mutationKeyName,
|
|
214
|
+
mutationKeyTypeName,
|
|
215
|
+
paramsToTrigger: mutation.paramsToTrigger
|
|
216
|
+
})
|
|
217
|
+
]
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
/**
|
|
222
|
+
* Builds a legacy-compatible OperationSchemas object from OperationNode + resolver.
|
|
223
|
+
* Used for the ClientLegacy component which still expects the old format.
|
|
224
|
+
*/
|
|
225
|
+
function buildLegacyTypeSchemas$1(node, resolver) {
|
|
226
|
+
const pathParams = node.parameters.filter((p) => p.in === "path");
|
|
227
|
+
const queryParams = node.parameters.filter((p) => p.in === "query");
|
|
228
|
+
const headerParams = node.parameters.filter((p) => p.in === "header");
|
|
229
|
+
const buildSchemaProps = (params) => {
|
|
230
|
+
const properties = {};
|
|
231
|
+
const required = [];
|
|
232
|
+
for (const p of params) {
|
|
233
|
+
properties[p.name] = { type: p.schema?.primitive ?? "unknown" };
|
|
234
|
+
if (p.required) required.push(p.name);
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
properties,
|
|
238
|
+
required
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
return {
|
|
242
|
+
response: { name: resolver.resolveResponseName(node) },
|
|
243
|
+
request: node.requestBody?.schema ? {
|
|
244
|
+
name: resolver.resolveDataName(node),
|
|
245
|
+
schema: { required: node.requestBody.required ? ["body"] : [] }
|
|
246
|
+
} : void 0,
|
|
247
|
+
pathParams: pathParams.length > 0 && resolver.resolvePathParamsName ? {
|
|
248
|
+
name: resolver.resolvePathParamsName(node, pathParams[0]),
|
|
249
|
+
schema: buildSchemaProps(pathParams)
|
|
250
|
+
} : void 0,
|
|
251
|
+
queryParams: queryParams.length > 0 && resolver.resolveQueryParamsName ? {
|
|
252
|
+
name: resolver.resolveQueryParamsName(node, queryParams[0]),
|
|
253
|
+
schema: buildSchemaProps(queryParams)
|
|
254
|
+
} : void 0,
|
|
255
|
+
headerParams: headerParams.length > 0 && resolver.resolveHeaderParamsName ? {
|
|
256
|
+
name: resolver.resolveHeaderParamsName(node, headerParams[0]),
|
|
257
|
+
schema: buildSchemaProps(headerParams)
|
|
258
|
+
} : void 0,
|
|
259
|
+
errors: node.responses.filter((r) => {
|
|
260
|
+
return Number.parseInt(r.statusCode, 10) >= 400 || r.statusCode === "default";
|
|
261
|
+
}).map((r) => ({ name: resolver.resolveResponseStatusName(node, r.statusCode) })),
|
|
262
|
+
statusCodes: node.responses.map((r) => ({ name: resolver.resolveResponseStatusName(node, r.statusCode) }))
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
__name(buildLegacyTypeSchemas$1, "buildLegacyTypeSchemas");
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region src/generators/queryGenerator.tsx
|
|
268
|
+
const queryGenerator = defineGenerator({
|
|
269
|
+
name: "swr-query",
|
|
270
|
+
renderer: jsxRenderer,
|
|
271
|
+
operation(node, ctx) {
|
|
272
|
+
const { adapter, config, driver, resolver, root } = ctx;
|
|
273
|
+
const { output, query, paramsCasing, paramsType, pathParamsType, parser, client: clientOptions, group, transformers } = ctx.options;
|
|
274
|
+
const pluginTs = driver.getPlugin(pluginTsName);
|
|
275
|
+
if (!pluginTs?.resolver) return null;
|
|
276
|
+
const tsResolver = pluginTs.resolver;
|
|
277
|
+
if (!(!!query && query.methods.some((method) => node.method.toLowerCase() === method.toLowerCase()))) return null;
|
|
278
|
+
const importPath = query ? query.importPath : "swr";
|
|
279
|
+
const baseName = resolver.resolveName(node.operationId);
|
|
280
|
+
const queryName = transformName(`use${baseName.charAt(0).toUpperCase()}${baseName.slice(1)}`, "function", transformers);
|
|
281
|
+
const queryOptionsName = transformName(`${baseName}QueryOptions`, "function", transformers);
|
|
282
|
+
const queryKeyName = transformName(`${baseName}QueryKey`, "const", transformers);
|
|
283
|
+
const queryKeyTypeName = transformName(`${baseName.charAt(0).toUpperCase()}${baseName.slice(1)}QueryKey`, "type", transformers);
|
|
284
|
+
const clientName = baseName;
|
|
285
|
+
const meta = {
|
|
286
|
+
file: resolver.resolveFile({
|
|
287
|
+
name: queryName,
|
|
288
|
+
extname: ".ts",
|
|
289
|
+
tag: node.tags[0] ?? "default",
|
|
290
|
+
path: node.path
|
|
291
|
+
}, {
|
|
292
|
+
root,
|
|
293
|
+
output,
|
|
294
|
+
group
|
|
295
|
+
}),
|
|
296
|
+
fileTs: tsResolver.resolveFile({
|
|
297
|
+
name: node.operationId,
|
|
298
|
+
extname: ".ts",
|
|
299
|
+
tag: node.tags[0] ?? "default",
|
|
300
|
+
path: node.path
|
|
301
|
+
}, {
|
|
302
|
+
root,
|
|
303
|
+
output: pluginTs.options?.output ?? output,
|
|
304
|
+
group: pluginTs.options?.group
|
|
305
|
+
})
|
|
306
|
+
};
|
|
307
|
+
const casedParams = ast.caseParams(node.parameters, paramsCasing);
|
|
308
|
+
const pathParams = casedParams.filter((p) => p.in === "path");
|
|
309
|
+
const queryParams = casedParams.filter((p) => p.in === "query");
|
|
310
|
+
const headerParams = casedParams.filter((p) => p.in === "header");
|
|
311
|
+
const importedTypeNames = [
|
|
312
|
+
...pathParams.map((p) => tsResolver.resolvePathParamsName(node, p)),
|
|
313
|
+
...queryParams.map((p) => tsResolver.resolveQueryParamsName(node, p)),
|
|
314
|
+
...headerParams.map((p) => tsResolver.resolveHeaderParamsName(node, p)),
|
|
315
|
+
node.requestBody?.schema ? tsResolver.resolveDataName(node) : void 0,
|
|
316
|
+
tsResolver.resolveResponseName(node),
|
|
317
|
+
...node.responses.map((res) => tsResolver.resolveResponseStatusName(node, res.statusCode))
|
|
318
|
+
].filter(Boolean);
|
|
319
|
+
const pluginZodRaw = parser === "zod" ? driver.getPlugin(pluginZodName) : void 0;
|
|
320
|
+
const pluginZod = pluginZodRaw?.name === pluginZodName ? pluginZodRaw : void 0;
|
|
321
|
+
const zodResolver = pluginZod?.resolver;
|
|
322
|
+
const fileZod = zodResolver ? zodResolver.resolveFile({
|
|
323
|
+
name: node.operationId,
|
|
324
|
+
extname: ".ts",
|
|
325
|
+
tag: node.tags[0] ?? "default",
|
|
326
|
+
path: node.path
|
|
327
|
+
}, {
|
|
328
|
+
root,
|
|
329
|
+
output: pluginZod?.options?.output ?? output,
|
|
330
|
+
group: pluginZod?.options?.group
|
|
331
|
+
}) : void 0;
|
|
332
|
+
const zodSchemaNames = zodResolver && parser === "zod" ? [zodResolver.resolveResponseName?.(node), node.requestBody?.schema ? zodResolver.resolveDataName?.(node) : void 0].filter(Boolean) : [];
|
|
333
|
+
const clientPlugin = driver.getPlugin(pluginClientName);
|
|
334
|
+
const shouldUseClientPlugin = clientPlugin?.name === pluginClientName && clientOptions.clientType !== "class";
|
|
335
|
+
const clientFile = shouldUseClientPlugin ? clientPlugin?.resolver?.resolveFile({
|
|
336
|
+
name: node.operationId,
|
|
337
|
+
extname: ".ts",
|
|
338
|
+
tag: node.tags[0] ?? "default",
|
|
339
|
+
path: node.path
|
|
340
|
+
}, {
|
|
341
|
+
root,
|
|
342
|
+
output: clientPlugin?.options?.output ?? output,
|
|
343
|
+
group: clientPlugin?.options?.group
|
|
344
|
+
}) : void 0;
|
|
345
|
+
const resolvedClientName = shouldUseClientPlugin ? clientPlugin?.resolver?.resolveName(node.operationId) ?? clientName : clientName;
|
|
346
|
+
return /* @__PURE__ */ jsxs(File, {
|
|
347
|
+
baseName: meta.file.baseName,
|
|
348
|
+
path: meta.file.path,
|
|
349
|
+
meta: meta.file.meta,
|
|
350
|
+
banner: resolver.resolveBanner(adapter.inputNode, {
|
|
351
|
+
output,
|
|
352
|
+
config
|
|
353
|
+
}),
|
|
354
|
+
footer: resolver.resolveFooter(adapter.inputNode, {
|
|
355
|
+
output,
|
|
356
|
+
config
|
|
357
|
+
}),
|
|
358
|
+
children: [
|
|
359
|
+
parser === "zod" && fileZod && zodSchemaNames.length > 0 && /* @__PURE__ */ jsx(File.Import, {
|
|
360
|
+
name: zodSchemaNames,
|
|
361
|
+
root: meta.file.path,
|
|
362
|
+
path: fileZod.path
|
|
363
|
+
}),
|
|
364
|
+
clientOptions.importPath ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
365
|
+
!shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
|
|
366
|
+
name: "fetch",
|
|
367
|
+
path: clientOptions.importPath
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
370
|
+
name: [
|
|
371
|
+
"Client",
|
|
372
|
+
"RequestConfig",
|
|
373
|
+
"ResponseErrorConfig"
|
|
374
|
+
],
|
|
375
|
+
path: clientOptions.importPath,
|
|
376
|
+
isTypeOnly: true
|
|
377
|
+
}),
|
|
378
|
+
clientOptions.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
379
|
+
name: ["ResponseConfig"],
|
|
380
|
+
path: clientOptions.importPath,
|
|
381
|
+
isTypeOnly: true
|
|
382
|
+
})
|
|
383
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
384
|
+
!shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
|
|
385
|
+
name: ["fetch"],
|
|
386
|
+
root: meta.file.path,
|
|
387
|
+
path: path.resolve(root, ".kubb/fetch.ts")
|
|
388
|
+
}),
|
|
389
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
390
|
+
name: [
|
|
391
|
+
"Client",
|
|
392
|
+
"RequestConfig",
|
|
393
|
+
"ResponseErrorConfig"
|
|
394
|
+
],
|
|
395
|
+
root: meta.file.path,
|
|
396
|
+
path: path.resolve(root, ".kubb/fetch.ts"),
|
|
397
|
+
isTypeOnly: true
|
|
398
|
+
}),
|
|
399
|
+
clientOptions.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
400
|
+
name: ["ResponseConfig"],
|
|
401
|
+
root: meta.file.path,
|
|
402
|
+
path: path.resolve(root, ".kubb/fetch.ts"),
|
|
403
|
+
isTypeOnly: true
|
|
404
|
+
})
|
|
405
|
+
] }),
|
|
406
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
407
|
+
name: "useSWR",
|
|
408
|
+
path: importPath
|
|
409
|
+
}),
|
|
410
|
+
shouldUseClientPlugin && clientFile && /* @__PURE__ */ jsx(File.Import, {
|
|
411
|
+
name: [resolvedClientName],
|
|
412
|
+
root: meta.file.path,
|
|
413
|
+
path: clientFile.path
|
|
414
|
+
}),
|
|
415
|
+
!shouldUseClientPlugin && /* @__PURE__ */ jsx(File.Import, {
|
|
416
|
+
name: ["buildFormData"],
|
|
417
|
+
root: meta.file.path,
|
|
418
|
+
path: path.resolve(root, ".kubb/config.ts")
|
|
419
|
+
}),
|
|
420
|
+
meta.fileTs && importedTypeNames.length > 0 && /* @__PURE__ */ jsx(File.Import, {
|
|
421
|
+
name: Array.from(new Set(importedTypeNames)),
|
|
422
|
+
root: meta.file.path,
|
|
423
|
+
path: meta.fileTs.path,
|
|
424
|
+
isTypeOnly: true
|
|
425
|
+
}),
|
|
426
|
+
/* @__PURE__ */ jsx(QueryKey, {
|
|
427
|
+
name: queryKeyName,
|
|
428
|
+
typeName: queryKeyTypeName,
|
|
429
|
+
node,
|
|
430
|
+
tsResolver,
|
|
431
|
+
pathParamsType,
|
|
432
|
+
paramsCasing,
|
|
433
|
+
transformer: ctx.options.queryKey
|
|
434
|
+
}),
|
|
435
|
+
!shouldUseClientPlugin && /* @__PURE__ */ jsx(ClientLegacy, {
|
|
436
|
+
name: resolvedClientName,
|
|
437
|
+
baseURL: clientOptions.baseURL,
|
|
438
|
+
operation: {
|
|
439
|
+
path: node.path,
|
|
440
|
+
method: node.method,
|
|
441
|
+
getDescription: () => node.description,
|
|
442
|
+
getSummary: () => node.summary,
|
|
443
|
+
isDeprecated: () => node.deprecated ?? false,
|
|
444
|
+
getContentType: () => node.requestBody?.contentType ?? "application/json"
|
|
445
|
+
},
|
|
446
|
+
typeSchemas: buildLegacyTypeSchemas(node, tsResolver),
|
|
447
|
+
zodSchemas: zodResolver ? buildLegacyTypeSchemas(node, zodResolver) : void 0,
|
|
448
|
+
dataReturnType: clientOptions.dataReturnType || "data",
|
|
449
|
+
paramsCasing: clientOptions.paramsCasing || paramsCasing,
|
|
450
|
+
paramsType,
|
|
451
|
+
pathParamsType,
|
|
452
|
+
parser
|
|
453
|
+
}),
|
|
454
|
+
/* @__PURE__ */ jsx(QueryOptions, {
|
|
455
|
+
name: queryOptionsName,
|
|
456
|
+
clientName: resolvedClientName,
|
|
457
|
+
node,
|
|
458
|
+
tsResolver,
|
|
459
|
+
paramsCasing,
|
|
460
|
+
paramsType,
|
|
461
|
+
pathParamsType
|
|
462
|
+
}),
|
|
463
|
+
query && /* @__PURE__ */ jsx(Query, {
|
|
464
|
+
name: queryName,
|
|
465
|
+
queryOptionsName,
|
|
466
|
+
queryKeyName,
|
|
467
|
+
queryKeyTypeName,
|
|
468
|
+
node,
|
|
469
|
+
tsResolver,
|
|
470
|
+
dataReturnType: clientOptions.dataReturnType || "data",
|
|
471
|
+
paramsType,
|
|
472
|
+
paramsCasing,
|
|
473
|
+
pathParamsType
|
|
474
|
+
})
|
|
475
|
+
]
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
/**
|
|
480
|
+
* Builds a legacy-compatible OperationSchemas object from OperationNode + resolver.
|
|
481
|
+
* Used for the ClientLegacy component which still expects the old format.
|
|
482
|
+
*/
|
|
483
|
+
function buildLegacyTypeSchemas(node, resolver) {
|
|
484
|
+
const pathParams = node.parameters.filter((p) => p.in === "path");
|
|
485
|
+
const queryParams = node.parameters.filter((p) => p.in === "query");
|
|
486
|
+
const headerParams = node.parameters.filter((p) => p.in === "header");
|
|
487
|
+
const buildSchemaProps = (params) => {
|
|
488
|
+
const properties = {};
|
|
489
|
+
const required = [];
|
|
490
|
+
for (const p of params) {
|
|
491
|
+
properties[p.name] = { type: p.schema?.primitive ?? "unknown" };
|
|
492
|
+
if (p.required) required.push(p.name);
|
|
493
|
+
}
|
|
494
|
+
return {
|
|
495
|
+
properties,
|
|
496
|
+
required
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
return {
|
|
500
|
+
response: { name: resolver.resolveResponseName(node) },
|
|
501
|
+
request: node.requestBody?.schema ? {
|
|
502
|
+
name: resolver.resolveDataName(node),
|
|
503
|
+
schema: { required: node.requestBody.required ? ["body"] : [] }
|
|
504
|
+
} : void 0,
|
|
505
|
+
pathParams: pathParams.length > 0 && resolver.resolvePathParamsName ? {
|
|
506
|
+
name: resolver.resolvePathParamsName(node, pathParams[0]),
|
|
507
|
+
schema: buildSchemaProps(pathParams)
|
|
508
|
+
} : void 0,
|
|
509
|
+
queryParams: queryParams.length > 0 && resolver.resolveQueryParamsName ? {
|
|
510
|
+
name: resolver.resolveQueryParamsName(node, queryParams[0]),
|
|
511
|
+
schema: buildSchemaProps(queryParams)
|
|
512
|
+
} : void 0,
|
|
513
|
+
headerParams: headerParams.length > 0 && resolver.resolveHeaderParamsName ? {
|
|
514
|
+
name: resolver.resolveHeaderParamsName(node, headerParams[0]),
|
|
515
|
+
schema: buildSchemaProps(headerParams)
|
|
516
|
+
} : void 0,
|
|
517
|
+
errors: node.responses.filter((r) => {
|
|
518
|
+
return Number.parseInt(r.statusCode, 10) >= 400 || r.statusCode === "default";
|
|
519
|
+
}).map((r) => ({ name: resolver.resolveResponseStatusName(node, r.statusCode) })),
|
|
520
|
+
statusCodes: node.responses.map((r) => ({ name: resolver.resolveResponseStatusName(node, r.statusCode) }))
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
//#endregion
|
|
524
|
+
export { mutationGenerator as n, queryGenerator as t };
|
|
525
|
+
|
|
526
|
+
//# sourceMappingURL=generators-Cl7nr-FB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators-Cl7nr-FB.js","names":["ClientLegacyComponent","buildLegacyTypeSchemas","ClientLegacyComponent"],"sources":["../src/generators/mutationGenerator.tsx","../src/generators/queryGenerator.tsx"],"sourcesContent":["import path from 'node:path'\n\nimport { ast, defineGenerator } from '@kubb/core'\nimport { ClientLegacy as ClientLegacyComponent, pluginClientName } from '@kubb/plugin-client'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, jsxRenderer } from '@kubb/renderer-jsx'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginSwr } from '../types'\nimport { transformName } from '../utils.ts'\n\nexport const mutationGenerator = defineGenerator<PluginSwr>({\n name: 'swr-mutation',\n renderer: jsxRenderer,\n operation(node, ctx) {\n const { adapter, config, driver, resolver, root } = ctx\n const { output, query, mutation, paramsCasing, paramsType, pathParamsType, parser, client: clientOptions, group, transformers } = ctx.options\n\n const pluginTs = driver.getPlugin(pluginTsName)\n if (!pluginTs?.resolver) return null\n const tsResolver = pluginTs.resolver\n\n // Check if this operation is a mutation\n const isQuery = !!query && query.methods.some((method) => node.method.toLowerCase() === method.toLowerCase())\n const isMutation =\n mutation !== false &&\n !isQuery &&\n difference(mutation ? mutation.methods : [], query ? query.methods : []).some((method) => node.method.toLowerCase() === method.toLowerCase())\n\n if (!isMutation) return null\n\n const importPath = mutation ? mutation.importPath : 'swr/mutation'\n\n // Resolve names — apply transformers.name to each constructed name to match the old\n // createPlugin resolveName lifecycle (e.g. `addPetMutationKey` → `addPetMutationKeySWR`)\n const baseName = resolver.resolveName(node.operationId)\n const mutationHookName = transformName(`use${baseName.charAt(0).toUpperCase()}${baseName.slice(1)}`, 'function', transformers)\n const mutationTypeName = transformName(`${baseName.charAt(0).toUpperCase()}${baseName.slice(1)}`, 'type', transformers)\n const mutationKeyName = transformName(`${baseName}MutationKey`, 'const', transformers)\n const mutationKeyTypeName = transformName(`${baseName.charAt(0).toUpperCase()}${baseName.slice(1)}MutationKey`, 'type', transformers)\n const clientName = baseName\n\n const meta = {\n file: resolver.resolveFile({ name: mutationHookName, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group }),\n fileTs: tsResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginTs.options?.output ?? output, group: pluginTs.options?.group },\n ),\n }\n\n const casedParams = ast.caseParams(node.parameters, paramsCasing)\n const pathParams = casedParams.filter((p) => p.in === 'path')\n const queryParams = casedParams.filter((p) => p.in === 'query')\n const headerParams = casedParams.filter((p) => p.in === 'header')\n\n const importedTypeNames = [\n ...pathParams.map((p) => tsResolver.resolvePathParamsName(node, p)),\n ...queryParams.map((p) => tsResolver.resolveQueryParamsName(node, p)),\n ...headerParams.map((p) => tsResolver.resolveHeaderParamsName(node, p)),\n node.requestBody?.schema ? tsResolver.resolveDataName(node) : undefined,\n tsResolver.resolveResponseName(node),\n ...node.responses.map((res) => tsResolver.resolveResponseStatusName(node, res.statusCode)),\n ].filter(Boolean)\n\n const pluginZodRaw = parser === 'zod' ? driver.getPlugin(pluginZodName) : undefined\n const pluginZod = pluginZodRaw?.name === pluginZodName ? pluginZodRaw : undefined\n const zodResolver = pluginZod?.resolver\n const fileZod = zodResolver\n ? zodResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginZod?.options?.output ?? output, group: pluginZod?.options?.group },\n )\n : undefined\n const zodSchemaNames =\n zodResolver && parser === 'zod'\n ? [zodResolver.resolveResponseName?.(node), node.requestBody?.schema ? zodResolver.resolveDataName?.(node) : undefined].filter(Boolean)\n : []\n\n const clientPlugin = driver.getPlugin(pluginClientName)\n const hasClientPlugin = clientPlugin?.name === pluginClientName\n const shouldUseClientPlugin = hasClientPlugin && clientOptions.clientType !== 'class'\n\n const clientFile = shouldUseClientPlugin\n ? clientPlugin?.resolver?.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: clientPlugin?.options?.output ?? output,\n group: clientPlugin?.options?.group,\n },\n )\n : undefined\n\n const resolvedClientName = shouldUseClientPlugin ? (clientPlugin?.resolver?.resolveName(node.operationId) ?? clientName) : clientName\n\n return (\n <File\n baseName={meta.file.baseName}\n path={meta.file.path}\n meta={meta.file.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n {parser === 'zod' && fileZod && zodSchemaNames.length > 0 && (\n <File.Import name={zodSchemaNames as string[]} root={meta.file.path} path={fileZod.path} />\n )}\n {clientOptions.importPath ? (\n <>\n {!shouldUseClientPlugin && <File.Import name={'fetch'} path={clientOptions.importPath} />}\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={clientOptions.importPath} isTypeOnly />\n {clientOptions.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={clientOptions.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n {!shouldUseClientPlugin && <File.Import name={['fetch']} root={meta.file.path} path={path.resolve(root, '.kubb/fetch.ts')} />}\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={meta.file.path}\n path={path.resolve(root, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {clientOptions.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={meta.file.path} path={path.resolve(root, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n <File.Import name=\"useSWRMutation\" path={importPath} />\n <File.Import name={['SWRMutationConfiguration', 'SWRMutationResponse']} path={importPath} isTypeOnly />\n {shouldUseClientPlugin && clientFile && <File.Import name={[resolvedClientName]} root={meta.file.path} path={clientFile.path} />}\n {!shouldUseClientPlugin && <File.Import name={['buildFormData']} root={meta.file.path} path={path.resolve(root, '.kubb/config.ts')} />}\n {meta.fileTs && importedTypeNames.length > 0 && (\n <File.Import name={Array.from(new Set(importedTypeNames))} root={meta.file.path} path={meta.fileTs.path} isTypeOnly />\n )}\n\n <MutationKey\n name={mutationKeyName}\n typeName={mutationKeyTypeName}\n node={node}\n pathParamsType={pathParamsType}\n paramsCasing={paramsCasing}\n transformer={ctx.options.mutationKey}\n />\n\n {!shouldUseClientPlugin && (\n <ClientLegacyComponent\n name={resolvedClientName}\n baseURL={clientOptions.baseURL}\n operation={{\n path: node.path,\n method: node.method,\n getDescription: () => node.description,\n getSummary: () => node.summary,\n isDeprecated: () => node.deprecated ?? false,\n getContentType: () => node.requestBody?.contentType ?? 'application/json',\n }}\n typeSchemas={buildLegacyTypeSchemas(node, tsResolver)}\n zodSchemas={zodResolver ? buildLegacyTypeSchemas(node, zodResolver) : undefined}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n paramsCasing={clientOptions.paramsCasing || paramsCasing}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n parser={parser}\n />\n )}\n\n {mutation && (\n <Mutation\n name={mutationHookName}\n clientName={resolvedClientName}\n typeName={mutationTypeName}\n node={node}\n tsResolver={tsResolver}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n paramsType={paramsType}\n paramsCasing={paramsCasing}\n pathParamsType={pathParamsType}\n mutationKeyName={mutationKeyName}\n mutationKeyTypeName={mutationKeyTypeName}\n paramsToTrigger={mutation.paramsToTrigger}\n />\n )}\n </File>\n )\n },\n})\n\n/**\n * Builds a legacy-compatible OperationSchemas object from OperationNode + resolver.\n * Used for the ClientLegacy component which still expects the old format.\n */\n// biome-ignore lint/suspicious/noExplicitAny: bridge between v5 resolver types and legacy OperationSchemas format\nfunction buildLegacyTypeSchemas(node: ast.OperationNode, resolver: any) {\n const pathParams = node.parameters.filter((p) => p.in === 'path')\n const queryParams = node.parameters.filter((p) => p.in === 'query')\n const headerParams = node.parameters.filter((p) => p.in === 'header')\n\n const buildSchemaProps = (params: typeof pathParams) => {\n const properties: Record<string, { type: string }> = {}\n const required: string[] = []\n for (const p of params) {\n properties[p.name] = { type: p.schema?.primitive ?? 'unknown' }\n if (p.required) required.push(p.name)\n }\n return { properties, required }\n }\n\n return {\n response: { name: resolver.resolveResponseName(node) },\n request: node.requestBody?.schema\n ? {\n name: resolver.resolveDataName(node),\n schema: { required: node.requestBody.required ? ['body'] : [] },\n }\n : undefined,\n pathParams:\n pathParams.length > 0 && resolver.resolvePathParamsName\n ? {\n name: resolver.resolvePathParamsName(node, pathParams[0]!),\n schema: buildSchemaProps(pathParams),\n }\n : undefined,\n queryParams:\n queryParams.length > 0 && resolver.resolveQueryParamsName\n ? {\n name: resolver.resolveQueryParamsName(node, queryParams[0]!),\n schema: buildSchemaProps(queryParams),\n }\n : undefined,\n headerParams:\n headerParams.length > 0 && resolver.resolveHeaderParamsName\n ? {\n name: resolver.resolveHeaderParamsName(node, headerParams[0]!),\n schema: buildSchemaProps(headerParams),\n }\n : undefined,\n errors: node.responses\n .filter((r) => {\n const code = Number.parseInt(r.statusCode, 10)\n return code >= 400 || r.statusCode === 'default'\n })\n .map((r) => ({ name: resolver.resolveResponseStatusName(node, r.statusCode) })),\n statusCodes: node.responses.map((r) => ({ name: resolver.resolveResponseStatusName(node, r.statusCode) })),\n }\n}\n","import path from 'node:path'\n\nimport { ast, defineGenerator } from '@kubb/core'\nimport { ClientLegacy as ClientLegacyComponent, pluginClientName } from '@kubb/plugin-client'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, jsxRenderer } from '@kubb/renderer-jsx'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginSwr } from '../types'\nimport { transformName } from '../utils.ts'\n\nexport const queryGenerator = defineGenerator<PluginSwr>({\n name: 'swr-query',\n renderer: jsxRenderer,\n operation(node, ctx) {\n const { adapter, config, driver, resolver, root } = ctx\n const { output, query, paramsCasing, paramsType, pathParamsType, parser, client: clientOptions, group, transformers } = ctx.options\n\n const pluginTs = driver.getPlugin(pluginTsName)\n if (!pluginTs?.resolver) return null\n const tsResolver = pluginTs.resolver\n\n // Determine if this operation is a query\n const isQuery = !!query && query.methods.some((method) => node.method.toLowerCase() === method.toLowerCase())\n\n if (!isQuery) return null\n\n const importPath = query ? query.importPath : 'swr'\n\n // Resolve names — apply transformers.name to each constructed name to match the old\n // createPlugin resolveName lifecycle (e.g. `findPetsByTagsQueryKey` → `findPetsByTagsQueryKeySWR`)\n const baseName = resolver.resolveName(node.operationId)\n const queryName = transformName(`use${baseName.charAt(0).toUpperCase()}${baseName.slice(1)}`, 'function', transformers)\n const queryOptionsName = transformName(`${baseName}QueryOptions`, 'function', transformers)\n const queryKeyName = transformName(`${baseName}QueryKey`, 'const', transformers)\n const queryKeyTypeName = transformName(`${baseName.charAt(0).toUpperCase()}${baseName.slice(1)}QueryKey`, 'type', transformers)\n const clientName = baseName\n\n const meta = {\n file: resolver.resolveFile({ name: queryName, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group }),\n fileTs: tsResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginTs.options?.output ?? output, group: pluginTs.options?.group },\n ),\n }\n\n const casedParams = ast.caseParams(node.parameters, paramsCasing)\n const pathParams = casedParams.filter((p) => p.in === 'path')\n const queryParams = casedParams.filter((p) => p.in === 'query')\n const headerParams = casedParams.filter((p) => p.in === 'header')\n\n const importedTypeNames = [\n ...pathParams.map((p) => tsResolver.resolvePathParamsName(node, p)),\n ...queryParams.map((p) => tsResolver.resolveQueryParamsName(node, p)),\n ...headerParams.map((p) => tsResolver.resolveHeaderParamsName(node, p)),\n node.requestBody?.schema ? tsResolver.resolveDataName(node) : undefined,\n tsResolver.resolveResponseName(node),\n ...node.responses.map((res) => tsResolver.resolveResponseStatusName(node, res.statusCode)),\n ].filter(Boolean)\n\n const pluginZodRaw = parser === 'zod' ? driver.getPlugin(pluginZodName) : undefined\n const pluginZod = pluginZodRaw?.name === pluginZodName ? pluginZodRaw : undefined\n const zodResolver = pluginZod?.resolver\n const fileZod = zodResolver\n ? zodResolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output: pluginZod?.options?.output ?? output, group: pluginZod?.options?.group },\n )\n : undefined\n const zodSchemaNames =\n zodResolver && parser === 'zod'\n ? [zodResolver.resolveResponseName?.(node), node.requestBody?.schema ? zodResolver.resolveDataName?.(node) : undefined].filter(Boolean)\n : []\n\n const clientPlugin = driver.getPlugin(pluginClientName)\n const hasClientPlugin = clientPlugin?.name === pluginClientName\n const shouldUseClientPlugin = hasClientPlugin && clientOptions.clientType !== 'class'\n\n const clientFile = shouldUseClientPlugin\n ? clientPlugin?.resolver?.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: clientPlugin?.options?.output ?? output,\n group: clientPlugin?.options?.group,\n },\n )\n : undefined\n\n const resolvedClientName = shouldUseClientPlugin ? (clientPlugin?.resolver?.resolveName(node.operationId) ?? clientName) : clientName\n\n return (\n <File\n baseName={meta.file.baseName}\n path={meta.file.path}\n meta={meta.file.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n {parser === 'zod' && fileZod && zodSchemaNames.length > 0 && (\n <File.Import name={zodSchemaNames as string[]} root={meta.file.path} path={fileZod.path} />\n )}\n {clientOptions.importPath ? (\n <>\n {!shouldUseClientPlugin && <File.Import name={'fetch'} path={clientOptions.importPath} />}\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={clientOptions.importPath} isTypeOnly />\n {clientOptions.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={clientOptions.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n {!shouldUseClientPlugin && <File.Import name={['fetch']} root={meta.file.path} path={path.resolve(root, '.kubb/fetch.ts')} />}\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={meta.file.path}\n path={path.resolve(root, '.kubb/fetch.ts')}\n isTypeOnly\n />\n {clientOptions.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={meta.file.path} path={path.resolve(root, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n <File.Import name=\"useSWR\" path={importPath} />\n {shouldUseClientPlugin && clientFile && <File.Import name={[resolvedClientName]} root={meta.file.path} path={clientFile.path} />}\n {!shouldUseClientPlugin && <File.Import name={['buildFormData']} root={meta.file.path} path={path.resolve(root, '.kubb/config.ts')} />}\n {meta.fileTs && importedTypeNames.length > 0 && (\n <File.Import name={Array.from(new Set(importedTypeNames))} root={meta.file.path} path={meta.fileTs.path} isTypeOnly />\n )}\n\n <QueryKey\n name={queryKeyName}\n typeName={queryKeyTypeName}\n node={node}\n tsResolver={tsResolver}\n pathParamsType={pathParamsType}\n paramsCasing={paramsCasing}\n transformer={ctx.options.queryKey}\n />\n\n {!shouldUseClientPlugin && (\n <ClientLegacyComponent\n name={resolvedClientName}\n baseURL={clientOptions.baseURL}\n operation={{\n path: node.path,\n method: node.method,\n getDescription: () => node.description,\n getSummary: () => node.summary,\n isDeprecated: () => node.deprecated ?? false,\n getContentType: () => node.requestBody?.contentType ?? 'application/json',\n }}\n typeSchemas={buildLegacyTypeSchemas(node, tsResolver)}\n zodSchemas={zodResolver ? buildLegacyTypeSchemas(node, zodResolver) : undefined}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n paramsCasing={clientOptions.paramsCasing || paramsCasing}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n parser={parser}\n />\n )}\n\n <QueryOptions\n name={queryOptionsName}\n clientName={resolvedClientName}\n node={node}\n tsResolver={tsResolver}\n paramsCasing={paramsCasing}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n />\n\n {query && (\n <Query\n name={queryName}\n queryOptionsName={queryOptionsName}\n queryKeyName={queryKeyName}\n queryKeyTypeName={queryKeyTypeName}\n node={node}\n tsResolver={tsResolver}\n dataReturnType={clientOptions.dataReturnType || 'data'}\n paramsType={paramsType}\n paramsCasing={paramsCasing}\n pathParamsType={pathParamsType}\n />\n )}\n </File>\n )\n },\n})\n\n/**\n * Builds a legacy-compatible OperationSchemas object from OperationNode + resolver.\n * Used for the ClientLegacy component which still expects the old format.\n */\n// biome-ignore lint/suspicious/noExplicitAny: bridge between v5 resolver types and legacy OperationSchemas format\nfunction buildLegacyTypeSchemas(node: ast.OperationNode, resolver: any) {\n const pathParams = node.parameters.filter((p) => p.in === 'path')\n const queryParams = node.parameters.filter((p) => p.in === 'query')\n const headerParams = node.parameters.filter((p) => p.in === 'header')\n\n const buildSchemaProps = (params: typeof pathParams) => {\n const properties: Record<string, { type: string }> = {}\n const required: string[] = []\n for (const p of params) {\n properties[p.name] = { type: p.schema?.primitive ?? 'unknown' }\n if (p.required) required.push(p.name)\n }\n return { properties, required }\n }\n\n return {\n response: { name: resolver.resolveResponseName(node) },\n request: node.requestBody?.schema\n ? {\n name: resolver.resolveDataName(node),\n schema: { required: node.requestBody.required ? ['body'] : [] },\n }\n : undefined,\n pathParams:\n pathParams.length > 0 && resolver.resolvePathParamsName\n ? {\n name: resolver.resolvePathParamsName(node, pathParams[0]!),\n schema: buildSchemaProps(pathParams),\n }\n : undefined,\n queryParams:\n queryParams.length > 0 && resolver.resolveQueryParamsName\n ? {\n name: resolver.resolveQueryParamsName(node, queryParams[0]!),\n schema: buildSchemaProps(queryParams),\n }\n : undefined,\n headerParams:\n headerParams.length > 0 && resolver.resolveHeaderParamsName\n ? {\n name: resolver.resolveHeaderParamsName(node, headerParams[0]!),\n schema: buildSchemaProps(headerParams),\n }\n : undefined,\n errors: node.responses\n .filter((r) => {\n const code = Number.parseInt(r.statusCode, 10)\n return code >= 400 || r.statusCode === 'default'\n })\n .map((r) => ({ name: resolver.resolveResponseStatusName(node, r.statusCode) })),\n statusCodes: node.responses.map((r) => ({ name: resolver.resolveResponseStatusName(node, r.statusCode) })),\n }\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAa,oBAAoB,gBAA2B;CAC1D,MAAM;CACN,UAAU;CACV,UAAU,MAAM,KAAK;EACnB,MAAM,EAAE,SAAS,QAAQ,QAAQ,UAAU,SAAS;EACpD,MAAM,EAAE,QAAQ,OAAO,UAAU,cAAc,YAAY,gBAAgB,QAAQ,QAAQ,eAAe,OAAO,iBAAiB,IAAI;EAEtI,MAAM,WAAW,OAAO,UAAU,aAAa;AAC/C,MAAI,CAAC,UAAU,SAAU,QAAO;EAChC,MAAM,aAAa,SAAS;EAG5B,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,QAAQ,MAAM,WAAW,KAAK,OAAO,aAAa,KAAK,OAAO,aAAa,CAAC;AAM7G,MAAI,EAJF,aAAa,SACb,CAAC,WACD,WAAW,WAAW,SAAS,UAAU,EAAE,EAAE,QAAQ,MAAM,UAAU,EAAE,CAAC,CAAC,MAAM,WAAW,KAAK,OAAO,aAAa,KAAK,OAAO,aAAa,CAAC,EAE9H,QAAO;EAExB,MAAM,aAAa,WAAW,SAAS,aAAa;EAIpD,MAAM,WAAW,SAAS,YAAY,KAAK,YAAY;EACvD,MAAM,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ACN,QAAQ,KAAK,UACV,QAAQ,MAAM;AAEb,UADa,OAAO,SAAS,EAAE,YAAY,GAAG,IAC/B,OAAO,EAAE,eAAe;IACvC,CACD,KAAK,OAAO,EAAE,MAAM,SAAS,0BAA0B,MAAM,EAAE,WAAW,EAAE,EAAE;EACjF,aAAa,KAAK,UAAU,KAAK,OAAO,EAAE,MAAM,SAAS,0BAA0B,MAAM,EAAE,WAAW,EAAE,EAAE;EAC3G"}
|
package/dist/generators.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generators = require("./generators-
|
|
2
|
+
const require_generators = require("./generators-17ulS9mu.cjs");
|
|
3
3
|
exports.mutationGenerator = require_generators.mutationGenerator;
|
|
4
4
|
exports.queryGenerator = require_generators.queryGenerator;
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
-
import { n as PluginSwr } from "./types-
|
|
3
|
-
import * as _$
|
|
2
|
+
import { n as PluginSwr } from "./types-FA5mH9Ch.js";
|
|
3
|
+
import * as _$_kubb_core0 from "@kubb/core";
|
|
4
4
|
|
|
5
5
|
//#region src/generators/mutationGenerator.d.ts
|
|
6
|
-
declare const mutationGenerator: _$
|
|
6
|
+
declare const mutationGenerator: _$_kubb_core0.Generator<PluginSwr, unknown>;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/generators/queryGenerator.d.ts
|
|
9
|
-
declare const queryGenerator: _$
|
|
9
|
+
declare const queryGenerator: _$_kubb_core0.Generator<PluginSwr, unknown>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { mutationGenerator, queryGenerator };
|
|
12
12
|
//# sourceMappingURL=generators.d.ts.map
|
package/dist/generators.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as mutationGenerator, t as queryGenerator } from "./generators-
|
|
1
|
+
import { n as mutationGenerator, t as queryGenerator } from "./generators-Cl7nr-FB.js";
|
|
2
2
|
export { mutationGenerator, queryGenerator };
|