@kubb/plugin-cypress 5.0.0-alpha.3 → 5.0.0-alpha.31
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/index.cjs +465 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +206 -4
- package/dist/index.js +463 -60
- package/dist/index.js.map +1 -1
- package/package.json +6 -30
- package/src/components/Request.tsx +72 -108
- package/src/generators/cypressGenerator.tsx +48 -43
- package/src/index.ts +8 -1
- package/src/plugin.ts +81 -91
- package/src/presets.ts +23 -0
- package/src/resolvers/resolverCypress.ts +26 -0
- package/src/types.ts +105 -38
- package/dist/components-BK_6GU4v.js +0 -257
- package/dist/components-BK_6GU4v.js.map +0 -1
- package/dist/components-Drg_gLu2.cjs +0 -305
- package/dist/components-Drg_gLu2.cjs.map +0 -1
- package/dist/components.cjs +0 -3
- package/dist/components.d.ts +0 -50
- package/dist/components.js +0 -2
- package/dist/generators-BImGfp9Q.js +0 -71
- package/dist/generators-BImGfp9Q.js.map +0 -1
- package/dist/generators-DdeGa-zp.cjs +0 -75
- package/dist/generators-DdeGa-zp.cjs.map +0 -1
- package/dist/generators.cjs +0 -3
- package/dist/generators.d.ts +0 -500
- package/dist/generators.js +0 -2
- package/dist/types-BzXXi6dv.d.ts +0 -85
- package/src/components/index.ts +0 -1
- package/src/generators/index.ts +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,81 +1,487 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
node_path = require_components.__toESM(node_path);
|
|
6
|
-
let _kubb_core = require("@kubb/core");
|
|
7
|
-
let _kubb_plugin_oas = require("@kubb/plugin-oas");
|
|
2
|
+
//#endregion
|
|
3
|
+
let _kubb_ast = require("@kubb/ast");
|
|
8
4
|
let _kubb_plugin_ts = require("@kubb/plugin-ts");
|
|
5
|
+
let _kubb_react_fabric = require("@kubb/react-fabric");
|
|
6
|
+
let _kubb_react_fabric_jsx_runtime = require("@kubb/react-fabric/jsx-runtime");
|
|
7
|
+
let _kubb_core = require("@kubb/core");
|
|
8
|
+
//#region ../../internals/utils/src/casing.ts
|
|
9
|
+
/**
|
|
10
|
+
* Shared implementation for camelCase and PascalCase conversion.
|
|
11
|
+
* Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
|
|
12
|
+
* and capitalizes each word according to `pascal`.
|
|
13
|
+
*
|
|
14
|
+
* When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
|
|
15
|
+
*/
|
|
16
|
+
function toCamelOrPascal(text, pascal) {
|
|
17
|
+
return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
|
|
18
|
+
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
19
|
+
if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1);
|
|
20
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
21
|
+
}).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Splits `text` on `.` and applies `transformPart` to each segment.
|
|
25
|
+
* The last segment receives `isLast = true`, all earlier segments receive `false`.
|
|
26
|
+
* Segments are joined with `/` to form a file path.
|
|
27
|
+
*
|
|
28
|
+
* Only splits on dots followed by a letter so that version numbers
|
|
29
|
+
* embedded in operationIds (e.g. `v2025.0`) are kept intact.
|
|
30
|
+
*/
|
|
31
|
+
function applyToFileParts(text, transformPart) {
|
|
32
|
+
const parts = text.split(/\.(?=[a-zA-Z])/);
|
|
33
|
+
return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Converts `text` to camelCase.
|
|
37
|
+
* When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* camelCase('hello-world') // 'helloWorld'
|
|
41
|
+
* camelCase('pet.petId', { isFile: true }) // 'pet/petId'
|
|
42
|
+
*/
|
|
43
|
+
function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
44
|
+
if (isFile) return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? {
|
|
45
|
+
prefix,
|
|
46
|
+
suffix
|
|
47
|
+
} : {}));
|
|
48
|
+
return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false);
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region ../../internals/utils/src/reserved.ts
|
|
52
|
+
/**
|
|
53
|
+
* Returns `true` when `name` is a syntactically valid JavaScript variable name.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* isValidVarName('status') // true
|
|
58
|
+
* isValidVarName('class') // false (reserved word)
|
|
59
|
+
* isValidVarName('42foo') // false (starts with digit)
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
function isValidVarName(name) {
|
|
63
|
+
try {
|
|
64
|
+
new Function(`var ${name}`);
|
|
65
|
+
} catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region ../../internals/utils/src/urlPath.ts
|
|
72
|
+
/**
|
|
73
|
+
* Parses and transforms an OpenAPI/Swagger path string into various URL formats.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const p = new URLPath('/pet/{petId}')
|
|
77
|
+
* p.URL // '/pet/:petId'
|
|
78
|
+
* p.template // '`/pet/${petId}`'
|
|
79
|
+
*/
|
|
80
|
+
var URLPath = class {
|
|
81
|
+
/**
|
|
82
|
+
* The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.
|
|
83
|
+
*/
|
|
84
|
+
path;
|
|
85
|
+
#options;
|
|
86
|
+
constructor(path, options = {}) {
|
|
87
|
+
this.path = path;
|
|
88
|
+
this.#options = options;
|
|
89
|
+
}
|
|
90
|
+
/** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* new URLPath('/pet/{petId}').URL // '/pet/:petId'
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
get URL() {
|
|
98
|
+
return this.toURLPath();
|
|
99
|
+
}
|
|
100
|
+
/** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* new URLPath('https://petstore.swagger.io/v2/pet').isURL // true
|
|
105
|
+
* new URLPath('/pet/{petId}').isURL // false
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
get isURL() {
|
|
109
|
+
try {
|
|
110
|
+
return !!new URL(this.path).href;
|
|
111
|
+
} catch {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Converts the OpenAPI path to a TypeScript template literal string.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* new URLPath('/pet/{petId}').template // '`/pet/${petId}`'
|
|
120
|
+
* new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'
|
|
121
|
+
*/
|
|
122
|
+
get template() {
|
|
123
|
+
return this.toTemplateString();
|
|
124
|
+
}
|
|
125
|
+
/** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* new URLPath('/pet/{petId}').object
|
|
130
|
+
* // { url: '/pet/:petId', params: { petId: 'petId' } }
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
get object() {
|
|
134
|
+
return this.toObject();
|
|
135
|
+
}
|
|
136
|
+
/** Returns a map of path parameter names, or `undefined` when the path has no parameters.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* new URLPath('/pet/{petId}').params // { petId: 'petId' }
|
|
141
|
+
* new URLPath('/pet').params // undefined
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
get params() {
|
|
145
|
+
return this.getParams();
|
|
146
|
+
}
|
|
147
|
+
#transformParam(raw) {
|
|
148
|
+
const param = isValidVarName(raw) ? raw : camelCase(raw);
|
|
149
|
+
return this.#options.casing === "camelcase" ? camelCase(param) : param;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.
|
|
153
|
+
*/
|
|
154
|
+
#eachParam(fn) {
|
|
155
|
+
for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
|
|
156
|
+
const raw = match[1];
|
|
157
|
+
fn(raw, this.#transformParam(raw));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
toObject({ type = "path", replacer, stringify } = {}) {
|
|
161
|
+
const object = {
|
|
162
|
+
url: type === "path" ? this.toURLPath() : this.toTemplateString({ replacer }),
|
|
163
|
+
params: this.getParams()
|
|
164
|
+
};
|
|
165
|
+
if (stringify) {
|
|
166
|
+
if (type === "template") return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
|
|
167
|
+
if (object.params) return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
|
|
168
|
+
return `{ url: '${object.url}' }`;
|
|
169
|
+
}
|
|
170
|
+
return object;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Converts the OpenAPI path to a TypeScript template literal string.
|
|
174
|
+
* An optional `replacer` can transform each extracted parameter name before interpolation.
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'
|
|
178
|
+
*/
|
|
179
|
+
toTemplateString({ prefix = "", replacer } = {}) {
|
|
180
|
+
return `\`${prefix}${this.path.split(/\{([^}]+)\}/).map((part, i) => {
|
|
181
|
+
if (i % 2 === 0) return part;
|
|
182
|
+
const param = this.#transformParam(part);
|
|
183
|
+
return `\${${replacer ? replacer(param) : param}}`;
|
|
184
|
+
}).join("")}\``;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Extracts all `{param}` segments from the path and returns them as a key-value map.
|
|
188
|
+
* An optional `replacer` transforms each parameter name in both key and value positions.
|
|
189
|
+
* Returns `undefined` when no path parameters are found.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```ts
|
|
193
|
+
* new URLPath('/pet/{petId}/tag/{tagId}').getParams()
|
|
194
|
+
* // { petId: 'petId', tagId: 'tagId' }
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
getParams(replacer) {
|
|
198
|
+
const params = {};
|
|
199
|
+
this.#eachParam((_raw, param) => {
|
|
200
|
+
const key = replacer ? replacer(param) : param;
|
|
201
|
+
params[key] = key;
|
|
202
|
+
});
|
|
203
|
+
return Object.keys(params).length > 0 ? params : void 0;
|
|
204
|
+
}
|
|
205
|
+
/** Converts the OpenAPI path to Express-style colon syntax.
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```ts
|
|
209
|
+
* new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
toURLPath() {
|
|
213
|
+
return this.path.replace(/\{([^}]+)\}/g, ":$1");
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/components/Request.tsx
|
|
218
|
+
const declarationPrinter = (0, _kubb_plugin_ts.functionPrinter)({ mode: "declaration" });
|
|
219
|
+
function Request({ baseURL = "", name, dataReturnType, resolver, node, paramsType, pathParamsType, paramsCasing }) {
|
|
220
|
+
const paramsNode = (0, _kubb_ast.createOperationParams)(node, {
|
|
221
|
+
paramsType,
|
|
222
|
+
pathParamsType,
|
|
223
|
+
paramsCasing,
|
|
224
|
+
resolver,
|
|
225
|
+
extraParams: [(0, _kubb_ast.createFunctionParameter)({
|
|
226
|
+
name: "options",
|
|
227
|
+
type: (0, _kubb_ast.createTypeNode)({
|
|
228
|
+
variant: "reference",
|
|
229
|
+
name: "Partial<Cypress.RequestOptions>"
|
|
230
|
+
}),
|
|
231
|
+
default: "{}"
|
|
232
|
+
})]
|
|
233
|
+
});
|
|
234
|
+
const paramsSignature = declarationPrinter.print(paramsNode) ?? "";
|
|
235
|
+
const responseType = resolver.resolveResponseName(node);
|
|
236
|
+
const returnType = dataReturnType === "data" ? `Cypress.Chainable<${responseType}>` : `Cypress.Chainable<Cypress.Response<${responseType}>>`;
|
|
237
|
+
const casedPathParams = (0, _kubb_ast.caseParams)(node.parameters.filter((p) => p.in === "path"), paramsCasing);
|
|
238
|
+
const pathParamNameMap = new Map(casedPathParams.map((p) => [camelCase(p.name), p.name]));
|
|
239
|
+
const urlTemplate = new URLPath(node.path, { casing: paramsCasing }).toTemplateString({
|
|
240
|
+
prefix: baseURL,
|
|
241
|
+
replacer: (param) => pathParamNameMap.get(camelCase(param)) ?? param
|
|
242
|
+
});
|
|
243
|
+
const requestOptions = [`method: '${node.method}'`, `url: ${urlTemplate}`];
|
|
244
|
+
const queryParams = node.parameters.filter((p) => p.in === "query");
|
|
245
|
+
if (queryParams.length > 0) {
|
|
246
|
+
const casedQueryParams = (0, _kubb_ast.caseParams)(queryParams, paramsCasing);
|
|
247
|
+
if (casedQueryParams.some((p, i) => p.name !== queryParams[i].name)) {
|
|
248
|
+
const pairs = queryParams.map((orig, i) => `${orig.name}: params.${casedQueryParams[i].name}`).join(", ");
|
|
249
|
+
requestOptions.push(`qs: params ? { ${pairs} } : undefined`);
|
|
250
|
+
} else requestOptions.push("qs: params");
|
|
251
|
+
}
|
|
252
|
+
const headerParams = node.parameters.filter((p) => p.in === "header");
|
|
253
|
+
if (headerParams.length > 0) {
|
|
254
|
+
const casedHeaderParams = (0, _kubb_ast.caseParams)(headerParams, paramsCasing);
|
|
255
|
+
if (casedHeaderParams.some((p, i) => p.name !== headerParams[i].name)) {
|
|
256
|
+
const pairs = headerParams.map((orig, i) => `'${orig.name}': headers.${casedHeaderParams[i].name}`).join(", ");
|
|
257
|
+
requestOptions.push(`headers: headers ? { ${pairs} } : undefined`);
|
|
258
|
+
} else requestOptions.push("headers");
|
|
259
|
+
}
|
|
260
|
+
if (node.requestBody?.schema) requestOptions.push("body: data");
|
|
261
|
+
requestOptions.push("...options");
|
|
262
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Source, {
|
|
263
|
+
name,
|
|
264
|
+
isIndexable: true,
|
|
265
|
+
isExportable: true,
|
|
266
|
+
children: /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.Function, {
|
|
267
|
+
name,
|
|
268
|
+
export: true,
|
|
269
|
+
params: paramsSignature,
|
|
270
|
+
returnType,
|
|
271
|
+
children: dataReturnType === "data" ? `return cy.request<${responseType}>({
|
|
272
|
+
${requestOptions.join(",\n ")}
|
|
273
|
+
}).then((res) => res.body)` : `return cy.request<${responseType}>({
|
|
274
|
+
${requestOptions.join(",\n ")}
|
|
275
|
+
})`
|
|
276
|
+
})
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region src/generators/cypressGenerator.tsx
|
|
281
|
+
const cypressGenerator = (0, _kubb_core.defineGenerator)({
|
|
282
|
+
name: "cypress",
|
|
283
|
+
operation(node, options) {
|
|
284
|
+
const { adapter, config, resolver, driver, root } = this;
|
|
285
|
+
const { output, baseURL, dataReturnType, paramsCasing, paramsType, pathParamsType, group } = options;
|
|
286
|
+
const pluginTs = driver.getPlugin(_kubb_plugin_ts.pluginTsName);
|
|
287
|
+
if (!pluginTs?.resolver) return null;
|
|
288
|
+
const casedParams = (0, _kubb_ast.caseParams)(node.parameters, paramsCasing);
|
|
289
|
+
const pathParams = casedParams.filter((p) => p.in === "path");
|
|
290
|
+
const queryParams = casedParams.filter((p) => p.in === "query");
|
|
291
|
+
const headerParams = casedParams.filter((p) => p.in === "header");
|
|
292
|
+
const importedTypeNames = [
|
|
293
|
+
...pathParams.map((p) => pluginTs.resolver.resolvePathParamsName(node, p)),
|
|
294
|
+
...queryParams.map((p) => pluginTs.resolver.resolveQueryParamsName(node, p)),
|
|
295
|
+
...headerParams.map((p) => pluginTs.resolver.resolveHeaderParamsName(node, p)),
|
|
296
|
+
node.requestBody?.schema ? pluginTs.resolver.resolveDataName(node) : void 0,
|
|
297
|
+
pluginTs.resolver.resolveResponseName(node)
|
|
298
|
+
].filter(Boolean);
|
|
299
|
+
const meta = {
|
|
300
|
+
name: resolver.resolveName(node.operationId),
|
|
301
|
+
file: resolver.resolveFile({
|
|
302
|
+
name: node.operationId,
|
|
303
|
+
extname: ".ts",
|
|
304
|
+
tag: node.tags[0] ?? "default",
|
|
305
|
+
path: node.path
|
|
306
|
+
}, {
|
|
307
|
+
root,
|
|
308
|
+
output,
|
|
309
|
+
group
|
|
310
|
+
}),
|
|
311
|
+
fileTs: pluginTs.resolver.resolveFile({
|
|
312
|
+
name: node.operationId,
|
|
313
|
+
extname: ".ts",
|
|
314
|
+
tag: node.tags[0] ?? "default",
|
|
315
|
+
path: node.path
|
|
316
|
+
}, {
|
|
317
|
+
root,
|
|
318
|
+
output: pluginTs.options?.output ?? output,
|
|
319
|
+
group: pluginTs.options?.group
|
|
320
|
+
})
|
|
321
|
+
};
|
|
322
|
+
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric.File, {
|
|
323
|
+
baseName: meta.file.baseName,
|
|
324
|
+
path: meta.file.path,
|
|
325
|
+
meta: meta.file.meta,
|
|
326
|
+
banner: resolver.resolveBanner(adapter.rootNode, {
|
|
327
|
+
output,
|
|
328
|
+
config
|
|
329
|
+
}),
|
|
330
|
+
footer: resolver.resolveFooter(adapter.rootNode, {
|
|
331
|
+
output,
|
|
332
|
+
config
|
|
333
|
+
}),
|
|
334
|
+
children: [meta.fileTs && importedTypeNames.length > 0 && /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(_kubb_react_fabric.File.Import, {
|
|
335
|
+
name: Array.from(new Set(importedTypeNames)),
|
|
336
|
+
root: meta.file.path,
|
|
337
|
+
path: meta.fileTs.path,
|
|
338
|
+
isTypeOnly: true
|
|
339
|
+
}), /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsx)(Request, {
|
|
340
|
+
name: meta.name,
|
|
341
|
+
node,
|
|
342
|
+
resolver: pluginTs.resolver,
|
|
343
|
+
dataReturnType,
|
|
344
|
+
paramsCasing,
|
|
345
|
+
paramsType,
|
|
346
|
+
pathParamsType,
|
|
347
|
+
baseURL
|
|
348
|
+
})]
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region package.json
|
|
354
|
+
var version = "5.0.0-alpha.31";
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/resolvers/resolverCypress.ts
|
|
357
|
+
/**
|
|
358
|
+
* Resolver for `@kubb/plugin-cypress` that provides the default naming
|
|
359
|
+
* and path-resolution helpers used by the plugin.
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
* ```ts
|
|
363
|
+
* import { resolverCypress } from '@kubb/plugin-cypress'
|
|
364
|
+
*
|
|
365
|
+
* resolverCypress.default('list pets', 'function') // -> 'listPets'
|
|
366
|
+
* resolverCypress.resolveName('show pet by id') // -> 'showPetById'
|
|
367
|
+
* ```
|
|
368
|
+
*/
|
|
369
|
+
const resolverCypress = (0, _kubb_core.defineResolver)(() => ({
|
|
370
|
+
name: "default",
|
|
371
|
+
pluginName: "plugin-cypress",
|
|
372
|
+
default(name, type) {
|
|
373
|
+
return camelCase(name, { isFile: type === "file" });
|
|
374
|
+
},
|
|
375
|
+
resolveName(name) {
|
|
376
|
+
return this.default(name, "function");
|
|
377
|
+
}
|
|
378
|
+
}));
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region src/presets.ts
|
|
381
|
+
/**
|
|
382
|
+
* Built-in preset registry for `@kubb/plugin-cypress`.
|
|
383
|
+
*
|
|
384
|
+
* - `default` — uses `resolverCypress` and `cypressGenerator`.
|
|
385
|
+
* - `kubbV4` — uses `resolverCypress` and `cypressGenerator`.
|
|
386
|
+
*/
|
|
387
|
+
const presets = (0, _kubb_core.definePresets)({
|
|
388
|
+
default: {
|
|
389
|
+
name: "default",
|
|
390
|
+
resolver: resolverCypress,
|
|
391
|
+
generators: [cypressGenerator]
|
|
392
|
+
},
|
|
393
|
+
kubbV4: {
|
|
394
|
+
name: "kubbV4",
|
|
395
|
+
resolver: resolverCypress,
|
|
396
|
+
generators: [cypressGenerator]
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
//#endregion
|
|
9
400
|
//#region src/plugin.ts
|
|
401
|
+
/**
|
|
402
|
+
* Canonical plugin name for `@kubb/plugin-cypress`, used to identify the plugin
|
|
403
|
+
* in driver lookups and warnings.
|
|
404
|
+
*/
|
|
10
405
|
const pluginCypressName = "plugin-cypress";
|
|
11
|
-
|
|
406
|
+
/**
|
|
407
|
+
* The `@kubb/plugin-cypress` plugin factory.
|
|
408
|
+
*
|
|
409
|
+
* Generates Cypress `cy.request()` test functions from an OpenAPI/AST `RootNode`.
|
|
410
|
+
* Walks operations, delegates rendering to the active generators,
|
|
411
|
+
* and writes barrel files based on `output.barrelType`.
|
|
412
|
+
*
|
|
413
|
+
* @example
|
|
414
|
+
* ```ts
|
|
415
|
+
* import { pluginCypress } from '@kubb/plugin-cypress'
|
|
416
|
+
*
|
|
417
|
+
* export default defineConfig({
|
|
418
|
+
* plugins: [pluginCypress({ output: { path: 'cypress' } })],
|
|
419
|
+
* })
|
|
420
|
+
* ```
|
|
421
|
+
*/
|
|
422
|
+
const pluginCypress = (0, _kubb_core.createPlugin)((options) => {
|
|
12
423
|
const { output = {
|
|
13
424
|
path: "cypress",
|
|
14
425
|
barrelType: "named"
|
|
15
|
-
}, group,
|
|
426
|
+
}, group, exclude = [], include, override = [], dataReturnType = "data", baseURL, paramsCasing, paramsType = "inline", pathParamsType = paramsType === "object" ? "object" : options.pathParamsType || "inline", compatibilityPreset = "default", resolver: userResolver, transformer: userTransformer, generators: userGenerators = [] } = options;
|
|
427
|
+
const preset = (0, _kubb_core.getPreset)({
|
|
428
|
+
preset: compatibilityPreset,
|
|
429
|
+
presets,
|
|
430
|
+
resolver: userResolver,
|
|
431
|
+
transformer: userTransformer,
|
|
432
|
+
generators: userGenerators
|
|
433
|
+
});
|
|
434
|
+
const mergedGenerator = (0, _kubb_core.mergeGenerators)(preset.generators ?? []);
|
|
16
435
|
return {
|
|
17
436
|
name: pluginCypressName,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
group,
|
|
22
|
-
baseURL,
|
|
23
|
-
paramsCasing,
|
|
24
|
-
paramsType,
|
|
25
|
-
pathParamsType
|
|
26
|
-
},
|
|
27
|
-
pre: [_kubb_plugin_oas.pluginOasName, _kubb_plugin_ts.pluginTsName].filter(Boolean),
|
|
28
|
-
resolvePath(baseName, pathMode, options) {
|
|
29
|
-
const root = node_path.default.resolve(this.config.root, this.config.output.path);
|
|
30
|
-
if ((pathMode ?? (0, _kubb_core.getMode)(node_path.default.resolve(root, output.path))) === "single")
|
|
31
|
-
/**
|
|
32
|
-
* when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend
|
|
33
|
-
* Other plugins then need to call addOrAppend instead of just add from the fileManager class
|
|
34
|
-
*/
|
|
35
|
-
return node_path.default.resolve(root, output.path);
|
|
36
|
-
if (group && (options?.group?.path || options?.group?.tag)) {
|
|
37
|
-
const groupName = group?.name ? group.name : (ctx) => {
|
|
38
|
-
if (group?.type === "path") return `${ctx.group.split("/")[1]}`;
|
|
39
|
-
return `${require_components.camelCase(ctx.group)}Requests`;
|
|
40
|
-
};
|
|
41
|
-
return node_path.default.resolve(root, output.path, groupName({ group: group.type === "path" ? options.group.path : options.group.tag }), baseName);
|
|
42
|
-
}
|
|
43
|
-
return node_path.default.resolve(root, output.path, baseName);
|
|
437
|
+
version,
|
|
438
|
+
get resolver() {
|
|
439
|
+
return preset.resolver;
|
|
44
440
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (type) return transformers?.name?.(resolvedName, type) || resolvedName;
|
|
48
|
-
return resolvedName;
|
|
441
|
+
get transformer() {
|
|
442
|
+
return preset.transformer;
|
|
49
443
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const oas = await this.getOas();
|
|
54
|
-
const files = await new _kubb_plugin_oas.OperationGenerator(this.plugin.options, {
|
|
55
|
-
fabric: this.fabric,
|
|
56
|
-
oas,
|
|
57
|
-
pluginManager: this.pluginManager,
|
|
58
|
-
events: this.events,
|
|
59
|
-
plugin: this.plugin,
|
|
60
|
-
contentType,
|
|
444
|
+
get options() {
|
|
445
|
+
return {
|
|
446
|
+
output,
|
|
61
447
|
exclude,
|
|
62
448
|
include,
|
|
63
449
|
override,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
450
|
+
dataReturnType,
|
|
451
|
+
group: group ? {
|
|
452
|
+
...group,
|
|
453
|
+
name: group.name ? group.name : (ctx) => {
|
|
454
|
+
if (group.type === "path") return `${ctx.group.split("/")[1]}`;
|
|
455
|
+
return `${camelCase(ctx.group)}Requests`;
|
|
456
|
+
}
|
|
457
|
+
} : void 0,
|
|
458
|
+
baseURL,
|
|
459
|
+
paramsCasing,
|
|
460
|
+
paramsType,
|
|
461
|
+
pathParamsType,
|
|
462
|
+
resolver: preset.resolver
|
|
463
|
+
};
|
|
464
|
+
},
|
|
465
|
+
pre: [_kubb_plugin_ts.pluginTsName].filter(Boolean),
|
|
466
|
+
async schema(node, options) {
|
|
467
|
+
return mergedGenerator.schema?.call(this, node, options);
|
|
468
|
+
},
|
|
469
|
+
async operation(node, options) {
|
|
470
|
+
return mergedGenerator.operation?.call(this, node, options);
|
|
471
|
+
},
|
|
472
|
+
async operations(nodes, options) {
|
|
473
|
+
return mergedGenerator.operations?.call(this, nodes, options);
|
|
474
|
+
},
|
|
475
|
+
async buildStart() {
|
|
476
|
+
await this.openInStudio({ ast: true });
|
|
74
477
|
}
|
|
75
478
|
};
|
|
76
479
|
});
|
|
77
480
|
//#endregion
|
|
481
|
+
exports.Request = Request;
|
|
482
|
+
exports.cypressGenerator = cypressGenerator;
|
|
78
483
|
exports.pluginCypress = pluginCypress;
|
|
79
484
|
exports.pluginCypressName = pluginCypressName;
|
|
485
|
+
exports.resolverCypress = resolverCypress;
|
|
80
486
|
|
|
81
487
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["cypressGenerator","pluginOasName","pluginTsName","path","camelCase","OperationGenerator"],"sources":["../src/plugin.ts"],"sourcesContent":["import path from 'node:path'\nimport { camelCase } from '@internals/utils'\nimport { definePlugin, type Group, getBarrelFiles, getMode } from '@kubb/core'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { cypressGenerator } from './generators'\nimport type { PluginCypress } from './types.ts'\n\nexport const pluginCypressName = 'plugin-cypress' satisfies PluginCypress['name']\n\nexport const pluginCypress = definePlugin<PluginCypress>((options) => {\n const {\n output = { path: 'cypress', barrelType: 'named' },\n group,\n dataReturnType = 'data',\n exclude = [],\n include,\n override = [],\n transformers = {},\n generators = [cypressGenerator].filter(Boolean),\n contentType,\n baseURL,\n paramsCasing,\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n } = options\n\n return {\n name: pluginCypressName,\n options: {\n output,\n dataReturnType,\n group,\n baseURL,\n\n paramsCasing,\n paramsType,\n pathParamsType,\n },\n pre: [pluginOasName, pluginTsName].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (group && (options?.group?.path || options?.group?.tag)) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Requests`\n }\n\n return path.resolve(\n root,\n output.path,\n groupName({\n group: group.type === 'path' ? options.group.path! : options.group.tag!,\n }),\n baseName,\n )\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n const resolvedName = camelCase(name, {\n isFile: type === 'file',\n })\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async install() {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n const oas = await this.getOas()\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n fabric: this.fabric,\n oas,\n pluginManager: this.pluginManager,\n events: this.events,\n plugin: this.plugin,\n contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const files = await operationGenerator.build(...generators)\n await this.upsertFile(...files)\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginName: this.plugin.name,\n },\n })\n\n await this.upsertFile(...barrelFiles)\n },\n }\n})\n"],"mappings":";;;;;;;;;AAQA,MAAa,oBA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QAClB,CAAC;AAEF,OAAI,KACF,QAAO,cAAc,OAAO,cAAc,KAAK,IAAI;AAGrD,UAAO;;EAET,MAAM,UAAU;GACd,MAAM,OAAOD,UAAAA,QAAK,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,OAAO,KAAK;GACpE,MAAM,QAAA,GAAA,WAAA,SAAeA,UAAAA,QAAK,QAAQ,MAAM,OAAO,KAAK,CAAC;GACrD,MAAM,MAAM,MAAM,KAAK,QAAQ;GAe/B,MAAM,QAAQ,MAba,IAAIE,iBAAAA,mBAAmB,KAAK,OAAO,SAAS;IACrE,QAAQ,KAAK;IACb;IACA,eAAe,KAAK;IACpB,QAAQ,KAAK;IACb,QAAQ,KAAK;IACb;IACA;IACA;IACA;IACA;IACD,CAAC,CAEqC,MAAM,GAAG,WAAW;AAC3D,SAAM,KAAK,WAAW,GAAG,MAAM;GAE/B,MAAM,cAAc,OAAA,GAAA,WAAA,gBAAqB,KAAK,OAAO,OAAO;IAC1D,MAAM,OAAO,cAAc;IAC3B;IACA;IACA,MAAM,EACJ,YAAY,KAAK,OAAO,MACzB;IACF,CAAC;AAEF,SAAM,KAAK,WAAW,GAAG,YAAY;;EAExC;EACD"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["#options","#transformParam","#eachParam","File","Function","pluginTsName","File","pluginTsName"],"sources":["../../../internals/utils/src/casing.ts","../../../internals/utils/src/reserved.ts","../../../internals/utils/src/urlPath.ts","../src/components/Request.tsx","../src/generators/cypressGenerator.tsx","../package.json","../src/resolvers/resolverCypress.ts","../src/presets.ts","../src/plugin.ts"],"sourcesContent":["type Options = {\n /**\n * When `true`, dot-separated segments are split on `.` and joined with `/` after casing.\n */\n isFile?: boolean\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const normalized = text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n\n const words = normalized.split(/[\\s\\-_./\\\\:]+/).filter(Boolean)\n\n return words\n .map((word, i) => {\n const allUpper = word.length > 1 && word === word.toUpperCase()\n if (allUpper) return word\n if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1)\n return word.charAt(0).toUpperCase() + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n/**\n * Splits `text` on `.` and applies `transformPart` to each segment.\n * The last segment receives `isLast = true`, all earlier segments receive `false`.\n * Segments are joined with `/` to form a file path.\n *\n * Only splits on dots followed by a letter so that version numbers\n * embedded in operationIds (e.g. `v2025.0`) are kept intact.\n */\nfunction applyToFileParts(text: string, transformPart: (part: string, isLast: boolean) => string): string {\n const parts = text.split(/\\.(?=[a-zA-Z])/)\n return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join('/')\n}\n\n/**\n * Converts `text` to camelCase.\n * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.\n *\n * @example\n * camelCase('hello-world') // 'helloWorld'\n * camelCase('pet.petId', { isFile: true }) // 'pet/petId'\n */\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? { prefix, suffix } : {}))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.\n *\n * @example\n * pascalCase('hello-world') // 'HelloWorld'\n * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'\n */\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => (isLast ? pascalCase(part, { prefix, suffix }) : camelCase(part)))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n\n/**\n * Converts `text` to snake_case.\n *\n * @example\n * snakeCase('helloWorld') // 'hello_world'\n * snakeCase('Hello-World') // 'hello_world'\n */\nexport function snakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n const processed = `${prefix} ${text} ${suffix}`.trim()\n return processed\n .replace(/([a-z])([A-Z])/g, '$1_$2')\n .replace(/[\\s\\-.]+/g, '_')\n .replace(/[^a-zA-Z0-9_]/g, '')\n .toLowerCase()\n .split('_')\n .filter(Boolean)\n .join('_')\n}\n\n/**\n * Converts `text` to SCREAMING_SNAKE_CASE.\n *\n * @example\n * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'\n */\nexport function screamingSnakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n return snakeCase(text, { prefix, suffix }).toUpperCase()\n}\n","/**\n * JavaScript and Java reserved words.\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = new Set([\n 'abstract',\n 'arguments',\n 'boolean',\n 'break',\n 'byte',\n 'case',\n 'catch',\n 'char',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'double',\n 'else',\n 'enum',\n 'eval',\n 'export',\n 'extends',\n 'false',\n 'final',\n 'finally',\n 'float',\n 'for',\n 'function',\n 'goto',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'int',\n 'interface',\n 'let',\n 'long',\n 'native',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'short',\n 'static',\n 'super',\n 'switch',\n 'synchronized',\n 'this',\n 'throw',\n 'throws',\n 'transient',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'volatile',\n 'while',\n 'with',\n 'yield',\n 'Array',\n 'Date',\n 'hasOwnProperty',\n 'Infinity',\n 'isFinite',\n 'isNaN',\n 'isPrototypeOf',\n 'length',\n 'Math',\n 'name',\n 'NaN',\n 'Number',\n 'Object',\n 'prototype',\n 'String',\n 'toString',\n 'undefined',\n 'valueOf',\n] as const)\n\n/**\n * Prefixes `word` with `_` when it is a reserved JavaScript/Java identifier or starts with a digit.\n *\n * @example\n * ```ts\n * transformReservedWord('class') // '_class'\n * transformReservedWord('42foo') // '_42foo'\n * transformReservedWord('status') // 'status'\n * ```\n */\nexport function transformReservedWord(word: string): string {\n const firstChar = word.charCodeAt(0)\n if (word && (reservedWords.has(word as 'valueOf') || (firstChar >= 48 && firstChar <= 57))) {\n return `_${word}`\n }\n return word\n}\n\n/**\n * Returns `true` when `name` is a syntactically valid JavaScript variable name.\n *\n * @example\n * ```ts\n * isValidVarName('status') // true\n * isValidVarName('class') // false (reserved word)\n * isValidVarName('42foo') // false (starts with digit)\n * ```\n */\nexport function isValidVarName(name: string): boolean {\n try {\n new Function(`var ${name}`)\n } catch {\n return false\n }\n return true\n}\n","import { camelCase } from './casing.ts'\nimport { isValidVarName } from './reserved.ts'\n\nexport type URLObject = {\n /**\n * The resolved URL string (Express-style or template literal, depending on context).\n */\n url: string\n /**\n * Extracted path parameters as a key-value map, or `undefined` when the path has none.\n */\n params?: Record<string, string>\n}\n\ntype ObjectOptions = {\n /**\n * Controls whether the `url` is rendered as an Express path or a template literal.\n * @default 'path'\n */\n type?: 'path' | 'template'\n /**\n * Optional transform applied to each extracted parameter name.\n */\n replacer?: (pathParam: string) => string\n /**\n * When `true`, the result is serialized to a string expression instead of a plain object.\n */\n stringify?: boolean\n}\n\n/**\n * Supported identifier casing strategies for path parameters.\n */\ntype PathCasing = 'camelcase'\n\ntype Options = {\n /**\n * Casing strategy applied to path parameter names.\n * @default undefined (original identifier preserved)\n */\n casing?: PathCasing\n}\n\n/**\n * Parses and transforms an OpenAPI/Swagger path string into various URL formats.\n *\n * @example\n * const p = new URLPath('/pet/{petId}')\n * p.URL // '/pet/:petId'\n * p.template // '`/pet/${petId}`'\n */\nexport class URLPath {\n /**\n * The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.\n */\n path: string\n\n #options: Options\n\n constructor(path: string, options: Options = {}) {\n this.path = path\n this.#options = options\n }\n\n /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').URL // '/pet/:petId'\n * ```\n */\n get URL(): string {\n return this.toURLPath()\n }\n\n /** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).\n *\n * @example\n * ```ts\n * new URLPath('https://petstore.swagger.io/v2/pet').isURL // true\n * new URLPath('/pet/{petId}').isURL // false\n * ```\n */\n get isURL(): boolean {\n try {\n return !!new URL(this.path).href\n } catch {\n return false\n }\n }\n\n /**\n * Converts the OpenAPI path to a TypeScript template literal string.\n *\n * @example\n * new URLPath('/pet/{petId}').template // '`/pet/${petId}`'\n * new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'\n */\n get template(): string {\n return this.toTemplateString()\n }\n\n /** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').object\n * // { url: '/pet/:petId', params: { petId: 'petId' } }\n * ```\n */\n get object(): URLObject | string {\n return this.toObject()\n }\n\n /** Returns a map of path parameter names, or `undefined` when the path has no parameters.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').params // { petId: 'petId' }\n * new URLPath('/pet').params // undefined\n * ```\n */\n get params(): Record<string, string> | undefined {\n return this.getParams()\n }\n\n #transformParam(raw: string): string {\n const param = isValidVarName(raw) ? raw : camelCase(raw)\n return this.#options.casing === 'camelcase' ? camelCase(param) : param\n }\n\n /**\n * Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.\n */\n #eachParam(fn: (raw: string, param: string) => void): void {\n for (const match of this.path.matchAll(/\\{([^}]+)\\}/g)) {\n const raw = match[1]!\n fn(raw, this.#transformParam(raw))\n }\n }\n\n toObject({ type = 'path', replacer, stringify }: ObjectOptions = {}): URLObject | string {\n const object = {\n url: type === 'path' ? this.toURLPath() : this.toTemplateString({ replacer }),\n params: this.getParams(),\n }\n\n if (stringify) {\n if (type === 'template') {\n return JSON.stringify(object).replaceAll(\"'\", '').replaceAll(`\"`, '')\n }\n\n if (object.params) {\n return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll(\"'\", '').replaceAll(`\"`, '')} }`\n }\n\n return `{ url: '${object.url}' }`\n }\n\n return object\n }\n\n /**\n * Converts the OpenAPI path to a TypeScript template literal string.\n * An optional `replacer` can transform each extracted parameter name before interpolation.\n *\n * @example\n * new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'\n */\n toTemplateString({ prefix = '', replacer }: { prefix?: string; replacer?: (pathParam: string) => string } = {}): string {\n const parts = this.path.split(/\\{([^}]+)\\}/)\n const result = parts\n .map((part, i) => {\n if (i % 2 === 0) return part\n const param = this.#transformParam(part)\n return `\\${${replacer ? replacer(param) : param}}`\n })\n .join('')\n\n return `\\`${prefix}${result}\\``\n }\n\n /**\n * Extracts all `{param}` segments from the path and returns them as a key-value map.\n * An optional `replacer` transforms each parameter name in both key and value positions.\n * Returns `undefined` when no path parameters are found.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}/tag/{tagId}').getParams()\n * // { petId: 'petId', tagId: 'tagId' }\n * ```\n */\n getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined {\n const params: Record<string, string> = {}\n\n this.#eachParam((_raw, param) => {\n const key = replacer ? replacer(param) : param\n params[key] = key\n })\n\n return Object.keys(params).length > 0 ? params : undefined\n }\n\n /** Converts the OpenAPI path to Express-style colon syntax.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'\n * ```\n */\n toURLPath(): string {\n return this.path.replace(/\\{([^}]+)\\}/g, ':$1')\n }\n}\n","import { camelCase, URLPath } from '@internals/utils'\nimport { caseParams, createFunctionParameter, createOperationParams, createTypeNode } from '@kubb/ast'\nimport type { OperationNode } from '@kubb/ast/types'\nimport type { ResolverTs } from '@kubb/plugin-ts'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { File, Function } from '@kubb/react-fabric'\nimport type { FabricReactNode } from '@kubb/react-fabric/types'\nimport type { PluginCypress } from '../types.ts'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n /**\n * AST operation node\n */\n node: OperationNode\n /**\n * TypeScript resolver for resolving param/data/response type names\n */\n resolver: ResolverTs\n baseURL: string | undefined\n dataReturnType: PluginCypress['resolvedOptions']['dataReturnType']\n paramsCasing: PluginCypress['resolvedOptions']['paramsCasing']\n paramsType: PluginCypress['resolvedOptions']['paramsType']\n pathParamsType: PluginCypress['resolvedOptions']['pathParamsType']\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\n\nexport function Request({ baseURL = '', name, dataReturnType, resolver, node, paramsType, pathParamsType, paramsCasing }: Props): FabricReactNode {\n const paramsNode = createOperationParams(node, {\n paramsType,\n pathParamsType,\n paramsCasing,\n resolver,\n extraParams: [\n createFunctionParameter({ name: 'options', type: createTypeNode({ variant: 'reference', name: 'Partial<Cypress.RequestOptions>' }), default: '{}' }),\n ],\n })\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n\n const responseType = resolver.resolveResponseName(node)\n const returnType = dataReturnType === 'data' ? `Cypress.Chainable<${responseType}>` : `Cypress.Chainable<Cypress.Response<${responseType}>>`\n\n const casedPathParams = caseParams(\n node.parameters.filter((p) => p.in === 'path'),\n paramsCasing,\n )\n // Build a lookup keyed by camelCase-normalized name so that path-template names\n // (e.g. `{pet_id}`) correctly resolve to the function-parameter name (`petId`)\n // even when the OpenAPI spec has inconsistent casing between the two.\n const pathParamNameMap = new Map(casedPathParams.map((p) => [camelCase(p.name), p.name]))\n\n const urlPath = new URLPath(node.path, { casing: paramsCasing })\n const urlTemplate = urlPath.toTemplateString({\n prefix: baseURL,\n replacer: (param) => pathParamNameMap.get(camelCase(param)) ?? param,\n })\n\n const requestOptions: string[] = [`method: '${node.method}'`, `url: ${urlTemplate}`]\n\n const queryParams = node.parameters.filter((p) => p.in === 'query')\n if (queryParams.length > 0) {\n const casedQueryParams = caseParams(queryParams, paramsCasing)\n // When paramsCasing renames query params (e.g. page_size → pageSize), we must remap\n // the camelCase keys back to the original API names before passing them to `qs`.\n const needsQsTransform = casedQueryParams.some((p, i) => p.name !== queryParams[i]!.name)\n if (needsQsTransform) {\n const pairs = queryParams.map((orig, i) => `${orig.name}: params.${casedQueryParams[i]!.name}`).join(', ')\n requestOptions.push(`qs: params ? { ${pairs} } : undefined`)\n } else {\n requestOptions.push('qs: params')\n }\n }\n\n const headerParams = node.parameters.filter((p) => p.in === 'header')\n if (headerParams.length > 0) {\n const casedHeaderParams = caseParams(headerParams, paramsCasing)\n // When paramsCasing renames header params (e.g. x-api-key → xApiKey), we must remap\n // the camelCase keys back to the original API names before passing them to `headers`.\n const needsHeaderTransform = casedHeaderParams.some((p, i) => p.name !== headerParams[i]!.name)\n if (needsHeaderTransform) {\n const pairs = headerParams.map((orig, i) => `'${orig.name}': headers.${casedHeaderParams[i]!.name}`).join(', ')\n requestOptions.push(`headers: headers ? { ${pairs} } : undefined`)\n } else {\n requestOptions.push('headers')\n }\n }\n\n if (node.requestBody?.schema) {\n requestOptions.push('body: data')\n }\n\n requestOptions.push('...options')\n\n return (\n <File.Source name={name} isIndexable isExportable>\n <Function name={name} export params={paramsSignature} returnType={returnType}>\n {dataReturnType === 'data'\n ? `return cy.request<${responseType}>({\n ${requestOptions.join(',\\n ')}\n}).then((res) => res.body)`\n : `return cy.request<${responseType}>({\n ${requestOptions.join(',\\n ')}\n})`}\n </Function>\n </File.Source>\n )\n}\n","import { caseParams } from '@kubb/ast'\nimport { defineGenerator } from '@kubb/core'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File } from '@kubb/react-fabric'\nimport { Request } from '../components/Request.tsx'\nimport type { PluginCypress } from '../types.ts'\n\nexport const cypressGenerator = defineGenerator<PluginCypress>({\n name: 'cypress',\n operation(node, options) {\n const { adapter, config, resolver, driver, root } = this\n const { output, baseURL, dataReturnType, paramsCasing, paramsType, pathParamsType, group } = options\n\n const pluginTs = driver.getPlugin(pluginTsName)\n\n if (!pluginTs?.resolver) {\n return null\n }\n\n const casedParams = caseParams(node.parameters, paramsCasing)\n\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) => pluginTs.resolver.resolvePathParamsName(node, p)),\n ...queryParams.map((p) => pluginTs.resolver.resolveQueryParamsName(node, p)),\n ...headerParams.map((p) => pluginTs.resolver.resolveHeaderParamsName(node, p)),\n node.requestBody?.schema ? pluginTs.resolver.resolveDataName(node) : undefined,\n pluginTs.resolver.resolveResponseName(node),\n ].filter(Boolean)\n\n const meta = {\n name: resolver.resolveName(node.operationId),\n file: resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group }),\n fileTs: pluginTs.resolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: pluginTs.options?.output ?? output,\n group: pluginTs.options?.group,\n },\n ),\n } as const\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.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\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 <Request\n name={meta.name}\n node={node}\n resolver={pluginTs.resolver}\n dataReturnType={dataReturnType}\n paramsCasing={paramsCasing}\n paramsType={paramsType}\n pathParamsType={pathParamsType}\n baseURL={baseURL}\n />\n </File>\n )\n },\n})\n","","import { camelCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginCypress } from '../types.ts'\n\n/**\n * Resolver for `@kubb/plugin-cypress` that provides the default naming\n * and path-resolution helpers used by the plugin.\n *\n * @example\n * ```ts\n * import { resolverCypress } from '@kubb/plugin-cypress'\n *\n * resolverCypress.default('list pets', 'function') // -> 'listPets'\n * resolverCypress.resolveName('show pet by id') // -> 'showPetById'\n * ```\n */\nexport const resolverCypress = defineResolver<PluginCypress>(() => ({\n name: 'default',\n pluginName: 'plugin-cypress',\n default(name, type) {\n return camelCase(name, { isFile: type === 'file' })\n },\n resolveName(name) {\n return this.default(name, 'function')\n },\n}))\n","import { definePresets } from '@kubb/core'\nimport { cypressGenerator } from './generators/cypressGenerator.tsx'\nimport { resolverCypress } from './resolvers/resolverCypress.ts'\nimport type { ResolverCypress } from './types.ts'\n\n/**\n * Built-in preset registry for `@kubb/plugin-cypress`.\n *\n * - `default` — uses `resolverCypress` and `cypressGenerator`.\n * - `kubbV4` — uses `resolverCypress` and `cypressGenerator`.\n */\nexport const presets = definePresets<ResolverCypress>({\n default: {\n name: 'default',\n resolver: resolverCypress,\n generators: [cypressGenerator],\n },\n kubbV4: {\n name: 'kubbV4',\n resolver: resolverCypress,\n generators: [cypressGenerator],\n },\n})\n","import { camelCase } from '@internals/utils'\nimport { createPlugin, type Group, getPreset, mergeGenerators } from '@kubb/core'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { version } from '../package.json'\nimport { presets } from './presets.ts'\nimport type { PluginCypress } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-cypress`, used to identify the plugin\n * in driver lookups and warnings.\n */\nexport const pluginCypressName = 'plugin-cypress' satisfies PluginCypress['name']\n\n/**\n * The `@kubb/plugin-cypress` plugin factory.\n *\n * Generates Cypress `cy.request()` test functions from an OpenAPI/AST `RootNode`.\n * Walks operations, delegates rendering to the active generators,\n * and writes barrel files based on `output.barrelType`.\n *\n * @example\n * ```ts\n * import { pluginCypress } from '@kubb/plugin-cypress'\n *\n * export default defineConfig({\n * plugins: [pluginCypress({ output: { path: 'cypress' } })],\n * })\n * ```\n */\nexport const pluginCypress = createPlugin<PluginCypress>((options) => {\n const {\n output = { path: 'cypress', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n dataReturnType = 'data',\n baseURL,\n paramsCasing,\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n compatibilityPreset = 'default',\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators = [],\n } = options\n\n const preset = getPreset({\n preset: compatibilityPreset,\n presets,\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators,\n })\n\n const generators = preset.generators ?? []\n const mergedGenerator = mergeGenerators(generators)\n\n return {\n name: pluginCypressName,\n version,\n get resolver() {\n return preset.resolver\n },\n get transformer() {\n return preset.transformer\n },\n get options() {\n return {\n output,\n exclude,\n include,\n override,\n dataReturnType,\n group: group\n ? ({\n ...group,\n name: group.name\n ? group.name\n : (ctx: { group: string }) => {\n if (group.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Requests`\n },\n } satisfies Group)\n : undefined,\n baseURL,\n paramsCasing,\n paramsType,\n pathParamsType,\n resolver: preset.resolver,\n }\n },\n pre: [pluginTsName].filter(Boolean),\n async schema(node, options) {\n return mergedGenerator.schema?.call(this, node, options)\n },\n async operation(node, options) {\n return mergedGenerator.operation?.call(this, node, options)\n },\n async operations(nodes, options) {\n return mergedGenerator.operations?.call(this, nodes, options)\n },\n async buildStart() {\n await this.openInStudio({ ast: true })\n },\n }\n})\n"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAAS,gBAAgB,MAAc,QAAyB;AAS9D,QARmB,KAChB,MAAM,CACN,QAAQ,qBAAqB,QAAQ,CACrC,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