@kubb/plugin-cypress 5.0.0-alpha.8 → 5.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/plugin.ts CHANGED
@@ -1,119 +1,95 @@
1
- import path from 'node:path'
2
1
  import { camelCase } from '@internals/utils'
3
- import { createPlugin, type Group, getBarrelFiles, getMode } from '@kubb/core'
4
- import { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'
2
+ import { definePlugin, type Group } from '@kubb/core'
5
3
  import { pluginTsName } from '@kubb/plugin-ts'
6
- import { cypressGenerator } from './generators'
4
+ import { cypressGenerator } from './generators/cypressGenerator.tsx'
5
+ import { resolverCypress } from './resolvers/resolverCypress.ts'
7
6
  import type { PluginCypress } from './types.ts'
8
7
 
8
+ /**
9
+ * Canonical plugin name for `@kubb/plugin-cypress`, used to identify the plugin
10
+ * in driver lookups and warnings.
11
+ */
9
12
  export const pluginCypressName = 'plugin-cypress' satisfies PluginCypress['name']
10
13
 
11
- export const pluginCypress = createPlugin<PluginCypress>((options) => {
14
+ /**
15
+ * The `@kubb/plugin-cypress` plugin factory.
16
+ *
17
+ * Generates Cypress `cy.request()` test functions from an OpenAPI/AST `RootNode`.
18
+ * Walks operations, delegates rendering to the active generators,
19
+ * and writes barrel files based on `output.barrelType`.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * import pluginCypress from '@kubb/plugin-cypress'
24
+ *
25
+ * export default defineConfig({
26
+ * plugins: [pluginCypress({ output: { path: 'cypress' } })],
27
+ * })
28
+ * ```
29
+ */
30
+ export const pluginCypress = definePlugin<PluginCypress>((options) => {
12
31
  const {
13
32
  output = { path: 'cypress', barrelType: 'named' },
14
33
  group,
15
- dataReturnType = 'data',
16
34
  exclude = [],
17
35
  include,
18
36
  override = [],
19
- transformers = {},
20
- generators = [cypressGenerator].filter(Boolean),
21
- contentType,
37
+ dataReturnType = 'data',
22
38
  baseURL,
23
39
  paramsCasing,
24
40
  paramsType = 'inline',
25
41
  pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',
42
+ resolver: userResolver,
43
+ transformer: userTransformer,
44
+ generators: userGenerators = [],
26
45
  } = options
27
46
 
28
- return {
29
- name: pluginCypressName,
30
- options: {
31
- output,
32
- dataReturnType,
33
- group,
34
- baseURL,
35
-
36
- paramsCasing,
37
- paramsType,
38
- pathParamsType,
39
- },
40
- pre: [pluginOasName, pluginTsName].filter(Boolean),
41
- resolvePath(baseName, pathMode, options) {
42
- const root = path.resolve(this.config.root, this.config.output.path)
43
- const mode = pathMode ?? getMode(path.resolve(root, output.path))
44
-
45
- if (mode === 'single') {
46
- /**
47
- * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend
48
- * Other plugins then need to call addOrAppend instead of just add from the fileManager class
49
- */
50
- return path.resolve(root, output.path)
51
- }
52
-
53
- if (group && (options?.group?.path || options?.group?.tag)) {
54
- const groupName: Group['name'] = group?.name
47
+ const groupConfig = group
48
+ ? ({
49
+ ...group,
50
+ name: group.name
55
51
  ? group.name
56
- : (ctx) => {
57
- if (group?.type === 'path') {
52
+ : (ctx: { group: string }) => {
53
+ if (group.type === 'path') {
58
54
  return `${ctx.group.split('/')[1]}`
59
55
  }
60
56
  return `${camelCase(ctx.group)}Requests`
61
- }
57
+ },
58
+ } satisfies Group)
59
+ : undefined
62
60
 
63
- return path.resolve(
64
- root,
65
- output.path,
66
- groupName({
67
- group: group.type === 'path' ? options.group.path! : options.group.tag!,
68
- }),
69
- baseName,
70
- )
71
- }
72
-
73
- return path.resolve(root, output.path, baseName)
74
- },
75
- resolveName(name, type) {
76
- const resolvedName = camelCase(name, {
77
- isFile: type === 'file',
78
- })
79
-
80
- if (type) {
81
- return transformers?.name?.(resolvedName, type) || resolvedName
82
- }
83
-
84
- return resolvedName
85
- },
86
- async install() {
87
- const root = path.resolve(this.config.root, this.config.output.path)
88
- const mode = getMode(path.resolve(root, output.path))
89
- const oas = await this.getOas()
90
-
91
- const operationGenerator = new OperationGenerator(this.plugin.options, {
92
- fabric: this.fabric,
93
- oas,
94
- driver: this.driver,
95
- events: this.events,
96
- plugin: this.plugin,
97
- contentType,
98
- exclude,
99
- include,
100
- override,
101
- mode,
102
- })
103
-
104
- const files = await operationGenerator.build(...generators)
105
- await this.upsertFile(...files)
106
-
107
- const barrelFiles = await getBarrelFiles(this.fabric.files, {
108
- type: output.barrelType ?? 'named',
109
- root,
110
- output,
111
- meta: {
112
- pluginName: this.plugin.name,
113
- },
114
- })
61
+ return {
62
+ name: pluginCypressName,
63
+ options,
64
+ dependencies: [pluginTsName],
65
+ hooks: {
66
+ 'kubb:plugin:setup'(ctx) {
67
+ const resolver = userResolver ? { ...resolverCypress, ...userResolver } : resolverCypress
115
68
 
116
- await this.upsertFile(...barrelFiles)
69
+ ctx.setOptions({
70
+ output,
71
+ exclude,
72
+ include,
73
+ override,
74
+ dataReturnType,
75
+ group: groupConfig,
76
+ baseURL,
77
+ paramsCasing,
78
+ paramsType,
79
+ pathParamsType,
80
+ resolver,
81
+ })
82
+ ctx.setResolver(resolver)
83
+ if (userTransformer) {
84
+ ctx.setTransformer(userTransformer)
85
+ }
86
+ ctx.addGenerator(cypressGenerator)
87
+ for (const gen of userGenerators) {
88
+ ctx.addGenerator(gen)
89
+ }
90
+ },
117
91
  },
118
92
  }
119
93
  })
94
+
95
+ export default pluginCypress
@@ -0,0 +1,22 @@
1
+ import { camelCase } from '@internals/utils'
2
+ import { defineResolver } from '@kubb/core'
3
+ import type { PluginCypress } from '../types.ts'
4
+
5
+ /**
6
+ * Naming convention resolver for Cypress plugin.
7
+ *
8
+ * Provides default naming helpers using camelCase for functions and file paths.
9
+ *
10
+ * @example
11
+ * `resolverCypress.default('list pets', 'function') // → 'listPets'`
12
+ */
13
+ export const resolverCypress = defineResolver<PluginCypress>((ctx) => ({
14
+ name: 'default',
15
+ pluginName: 'plugin-cypress',
16
+ default(name, type) {
17
+ return camelCase(name, { isFile: type === 'file' })
18
+ },
19
+ resolveName(name) {
20
+ return ctx.default(name, 'function')
21
+ },
22
+ }))
package/src/types.ts CHANGED
@@ -1,83 +1,115 @@
1
- import type { Group, Output, PluginFactoryOptions, ResolveNameParams } from '@kubb/core'
1
+ import type { ast, Exclude, Generator, Group, Include, Output, Override, PluginFactoryOptions, Resolver } from '@kubb/core'
2
2
 
3
- import type { contentType, Oas } from '@kubb/oas'
4
- import type { Exclude, Include, Override, ResolvePathOptions } from '@kubb/plugin-oas'
5
- import type { Generator } from '@kubb/plugin-oas/generators'
3
+ /**
4
+ * Resolver for Cypress that provides naming methods for test functions.
5
+ */
6
+ export type ResolverCypress = Resolver & {
7
+ /**
8
+ * Resolves the function name for an operation.
9
+ *
10
+ * @example Resolving function names
11
+ * `resolver.resolveName('show pet by id') // -> 'showPetById'`
12
+ */
13
+ resolveName(this: ResolverCypress, name: string): string
14
+ }
15
+
16
+ /**
17
+ * Parameter handling mode that determines how path params and query/body params are arranged in function signatures.
18
+ */
19
+ type ParamsTypeOptions =
20
+ | {
21
+ /**
22
+ * All parameters merged into a single destructured object.
23
+ */
24
+ paramsType: 'object'
25
+ /**
26
+ * Not applicable when all parameters are merged into a single object.
27
+ */
28
+ pathParamsType?: never
29
+ }
30
+ | {
31
+ /**
32
+ * Each parameter group emitted as a separate function argument.
33
+ */
34
+ paramsType?: 'inline'
35
+ /**
36
+ * How path parameters are arranged: grouped in an object or spread inline.
37
+ *
38
+ * @default 'inline'
39
+ */
40
+ pathParamsType?: 'object' | 'inline'
41
+ }
6
42
 
7
43
  export type Options = {
8
44
  /**
9
- * Specify the export location for the files and define the behavior of the output
45
+ * Specify the export location for the files and define the behavior of the output.
10
46
  * @default { path: 'cypress', barrelType: 'named' }
11
47
  */
12
- output?: Output<Oas>
48
+ output?: Output
13
49
  /**
14
- * Define which contentType should be used.
15
- * By default, the first JSON valid mediaType is used
16
- */
17
- contentType?: contentType
18
- /**
19
- * Return type when calling cy.request.
20
- * - 'data' returns ResponseConfig[data].
21
- * - 'full' returns ResponseConfig.
50
+ * Return type when calling cy.request: response data only or full response.
51
+ *
22
52
  * @default 'data'
23
53
  */
24
54
  dataReturnType?: 'data' | 'full'
25
55
  /**
26
- * How to style your params, by default no casing is applied
27
- * - 'camelcase' uses camelcase for the params names
56
+ * Apply casing to parameter names.
28
57
  */
29
58
  paramsCasing?: 'camelcase'
30
59
  /**
31
- * How to pass your params.
32
- * - 'object' returns the params and pathParams as an object.
33
- * - 'inline' returns the params as comma separated params.
34
- * @default 'inline'
35
- */
36
- paramsType?: 'object' | 'inline'
37
- /**
38
- * How to pass your pathParams.
39
- * - 'object' returns the pathParams as an object.
40
- * - 'inline' returns the pathParams as comma separated params.
41
- * @default 'inline'
60
+ * Base URL prepended to every generated request URL.
42
61
  */
43
- pathParamsType?: 'object' | 'inline'
44
62
  baseURL?: string
45
63
  /**
46
64
  * Group the Cypress requests based on the provided name.
47
65
  */
48
66
  group?: Group
49
67
  /**
50
- * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
68
+ * Tags, operations, or paths to exclude from generation.
51
69
  */
52
70
  exclude?: Array<Exclude>
53
71
  /**
54
- * Array containing include parameters to include tags/operations/methods/paths.
72
+ * Tags, operations, or paths to include in generation.
55
73
  */
56
74
  include?: Array<Include>
57
75
  /**
58
- * Array containing override parameters to override `options` based on tags/operations/methods/paths.
76
+ * Override options for specific tags, operations, or paths.
59
77
  */
60
78
  override?: Array<Override<ResolvedOptions>>
61
- transformers?: {
62
- /**
63
- * Customize the names based on the type that is provided by the plugin.
64
- */
65
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string
66
- }
67
79
  /**
68
- * Define some generators next to the Cypress generators.
80
+ * Override naming conventions for function names and types.
81
+ */
82
+ resolver?: Partial<ResolverCypress> & ThisType<ResolverCypress>
83
+ /**
84
+ * AST visitor to transform generated nodes.
85
+ */
86
+ transformer?: ast.Visitor
87
+ /**
88
+ * Additional generators alongside the default generators.
69
89
  */
70
90
  generators?: Array<Generator<PluginCypress>>
71
- }
91
+ } & ParamsTypeOptions
72
92
 
73
93
  type ResolvedOptions = {
74
- output: Output<Oas>
75
- group: Options['group']
94
+ output: Output
95
+ exclude: Array<Exclude>
96
+ include: Array<Include> | undefined
97
+ override: Array<Override<ResolvedOptions>>
98
+ group: Group | undefined
76
99
  baseURL: Options['baseURL'] | undefined
77
100
  dataReturnType: NonNullable<Options['dataReturnType']>
78
- pathParamsType: NonNullable<Options['pathParamsType']>
101
+ pathParamsType: NonNullable<NonNullable<Options['pathParamsType']>>
79
102
  paramsType: NonNullable<Options['paramsType']>
80
103
  paramsCasing: Options['paramsCasing']
104
+ resolver: ResolverCypress
81
105
  }
82
106
 
83
- export type PluginCypress = PluginFactoryOptions<'plugin-cypress', Options, ResolvedOptions, never, ResolvePathOptions>
107
+ export type PluginCypress = PluginFactoryOptions<'plugin-cypress', Options, ResolvedOptions, ResolverCypress>
108
+
109
+ declare global {
110
+ namespace Kubb {
111
+ interface PluginRegistry {
112
+ 'plugin-cypress': PluginCypress
113
+ }
114
+ }
115
+ }
@@ -1,257 +0,0 @@
1
- import "./chunk--u3MIqq1.js";
2
- import { getPathParams } from "@kubb/plugin-oas/utils";
3
- import { File, Function as Function$1, FunctionParams } from "@kubb/react-fabric";
4
- import { isAllOptional, isOptional } from "@kubb/oas";
5
- import { jsx } from "@kubb/react-fabric/jsx-runtime";
6
- //#region ../../internals/utils/src/casing.ts
7
- /**
8
- * Shared implementation for camelCase and PascalCase conversion.
9
- * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
10
- * and capitalizes each word according to `pascal`.
11
- *
12
- * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
13
- */
14
- function toCamelOrPascal(text, pascal) {
15
- 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) => {
16
- if (word.length > 1 && word === word.toUpperCase()) return word;
17
- if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1);
18
- return word.charAt(0).toUpperCase() + word.slice(1);
19
- }).join("").replace(/[^a-zA-Z0-9]/g, "");
20
- }
21
- /**
22
- * Splits `text` on `.` and applies `transformPart` to each segment.
23
- * The last segment receives `isLast = true`, all earlier segments receive `false`.
24
- * Segments are joined with `/` to form a file path.
25
- */
26
- function applyToFileParts(text, transformPart) {
27
- const parts = text.split(".");
28
- return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
29
- }
30
- /**
31
- * Converts `text` to camelCase.
32
- * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.
33
- *
34
- * @example
35
- * camelCase('hello-world') // 'helloWorld'
36
- * camelCase('pet.petId', { isFile: true }) // 'pet/petId'
37
- */
38
- function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
39
- if (isFile) return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? {
40
- prefix,
41
- suffix
42
- } : {}));
43
- return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false);
44
- }
45
- //#endregion
46
- //#region ../../internals/utils/src/reserved.ts
47
- /**
48
- * Returns `true` when `name` is a syntactically valid JavaScript variable name.
49
- */
50
- function isValidVarName(name) {
51
- try {
52
- new Function(`var ${name}`);
53
- } catch {
54
- return false;
55
- }
56
- return true;
57
- }
58
- //#endregion
59
- //#region ../../internals/utils/src/urlPath.ts
60
- /**
61
- * Parses and transforms an OpenAPI/Swagger path string into various URL formats.
62
- *
63
- * @example
64
- * const p = new URLPath('/pet/{petId}')
65
- * p.URL // '/pet/:petId'
66
- * p.template // '`/pet/${petId}`'
67
- */
68
- var URLPath = class {
69
- /** The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`. */
70
- path;
71
- #options;
72
- constructor(path, options = {}) {
73
- this.path = path;
74
- this.#options = options;
75
- }
76
- /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`. */
77
- get URL() {
78
- return this.toURLPath();
79
- }
80
- /** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`). */
81
- get isURL() {
82
- try {
83
- return !!new URL(this.path).href;
84
- } catch {
85
- return false;
86
- }
87
- }
88
- /**
89
- * Converts the OpenAPI path to a TypeScript template literal string.
90
- *
91
- * @example
92
- * new URLPath('/pet/{petId}').template // '`/pet/${petId}`'
93
- * new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'
94
- */
95
- get template() {
96
- return this.toTemplateString();
97
- }
98
- /** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set. */
99
- get object() {
100
- return this.toObject();
101
- }
102
- /** Returns a map of path parameter names, or `undefined` when the path has no parameters. */
103
- get params() {
104
- return this.getParams();
105
- }
106
- #transformParam(raw) {
107
- const param = isValidVarName(raw) ? raw : camelCase(raw);
108
- return this.#options.casing === "camelcase" ? camelCase(param) : param;
109
- }
110
- /** Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name. */
111
- #eachParam(fn) {
112
- for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
113
- const raw = match[1];
114
- fn(raw, this.#transformParam(raw));
115
- }
116
- }
117
- toObject({ type = "path", replacer, stringify } = {}) {
118
- const object = {
119
- url: type === "path" ? this.toURLPath() : this.toTemplateString({ replacer }),
120
- params: this.getParams()
121
- };
122
- if (stringify) {
123
- if (type === "template") return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
124
- if (object.params) return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
125
- return `{ url: '${object.url}' }`;
126
- }
127
- return object;
128
- }
129
- /**
130
- * Converts the OpenAPI path to a TypeScript template literal string.
131
- * An optional `replacer` can transform each extracted parameter name before interpolation.
132
- *
133
- * @example
134
- * new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'
135
- */
136
- toTemplateString({ prefix = "", replacer } = {}) {
137
- return `\`${prefix}${this.path.split(/\{([^}]+)\}/).map((part, i) => {
138
- if (i % 2 === 0) return part;
139
- const param = this.#transformParam(part);
140
- return `\${${replacer ? replacer(param) : param}}`;
141
- }).join("")}\``;
142
- }
143
- /**
144
- * Extracts all `{param}` segments from the path and returns them as a key-value map.
145
- * An optional `replacer` transforms each parameter name in both key and value positions.
146
- * Returns `undefined` when no path parameters are found.
147
- */
148
- getParams(replacer) {
149
- const params = {};
150
- this.#eachParam((_raw, param) => {
151
- const key = replacer ? replacer(param) : param;
152
- params[key] = key;
153
- });
154
- return Object.keys(params).length > 0 ? params : void 0;
155
- }
156
- /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`. */
157
- toURLPath() {
158
- return this.path.replace(/\{([^}]+)\}/g, ":$1");
159
- }
160
- };
161
- //#endregion
162
- //#region src/components/Request.tsx
163
- function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
164
- if (paramsType === "object") {
165
- const pathParams = getPathParams(typeSchemas.pathParams, {
166
- typed: true,
167
- casing: paramsCasing
168
- });
169
- return FunctionParams.factory({
170
- data: {
171
- mode: "object",
172
- children: {
173
- ...pathParams,
174
- data: typeSchemas.request?.name ? {
175
- type: typeSchemas.request?.name,
176
- optional: isOptional(typeSchemas.request?.schema)
177
- } : void 0,
178
- params: typeSchemas.queryParams?.name ? {
179
- type: typeSchemas.queryParams?.name,
180
- optional: isOptional(typeSchemas.queryParams?.schema)
181
- } : void 0,
182
- headers: typeSchemas.headerParams?.name ? {
183
- type: typeSchemas.headerParams?.name,
184
- optional: isOptional(typeSchemas.headerParams?.schema)
185
- } : void 0
186
- }
187
- },
188
- options: {
189
- type: "Partial<Cypress.RequestOptions>",
190
- default: "{}"
191
- }
192
- });
193
- }
194
- return FunctionParams.factory({
195
- pathParams: typeSchemas.pathParams?.name ? {
196
- mode: pathParamsType === "object" ? "object" : "inlineSpread",
197
- children: getPathParams(typeSchemas.pathParams, {
198
- typed: true,
199
- casing: paramsCasing
200
- }),
201
- default: isAllOptional(typeSchemas.pathParams?.schema) ? "{}" : void 0
202
- } : void 0,
203
- data: typeSchemas.request?.name ? {
204
- type: typeSchemas.request?.name,
205
- optional: isOptional(typeSchemas.request?.schema)
206
- } : void 0,
207
- params: typeSchemas.queryParams?.name ? {
208
- type: typeSchemas.queryParams?.name,
209
- optional: isOptional(typeSchemas.queryParams?.schema)
210
- } : void 0,
211
- headers: typeSchemas.headerParams?.name ? {
212
- type: typeSchemas.headerParams?.name,
213
- optional: isOptional(typeSchemas.headerParams?.schema)
214
- } : void 0,
215
- options: {
216
- type: "Partial<Cypress.RequestOptions>",
217
- default: "{}"
218
- }
219
- });
220
- }
221
- function Request({ baseURL = "", name, dataReturnType, typeSchemas, url, method, paramsType, paramsCasing, pathParamsType }) {
222
- const path = new URLPath(url, { casing: paramsCasing });
223
- const params = getParams({
224
- paramsType,
225
- paramsCasing,
226
- pathParamsType,
227
- typeSchemas
228
- });
229
- const returnType = dataReturnType === "data" ? `Cypress.Chainable<${typeSchemas.response.name}>` : `Cypress.Chainable<Cypress.Response<${typeSchemas.response.name}>>`;
230
- const urlTemplate = path.toTemplateString({ prefix: baseURL });
231
- const requestOptions = [`method: '${method}'`, `url: ${urlTemplate}`];
232
- if (typeSchemas.queryParams?.name) requestOptions.push("qs: params");
233
- if (typeSchemas.headerParams?.name) requestOptions.push("headers");
234
- if (typeSchemas.request?.name) requestOptions.push("body: data");
235
- requestOptions.push("...options");
236
- return /* @__PURE__ */ jsx(File.Source, {
237
- name,
238
- isIndexable: true,
239
- isExportable: true,
240
- children: /* @__PURE__ */ jsx(Function$1, {
241
- name,
242
- export: true,
243
- params: params.toConstructor(),
244
- returnType,
245
- children: dataReturnType === "data" ? `return cy.request<${typeSchemas.response.name}>({
246
- ${requestOptions.join(",\n ")}
247
- }).then((res) => res.body)` : `return cy.request<${typeSchemas.response.name}>({
248
- ${requestOptions.join(",\n ")}
249
- })`
250
- })
251
- });
252
- }
253
- Request.getParams = getParams;
254
- //#endregion
255
- export { camelCase as n, Request as t };
256
-
257
- //# sourceMappingURL=components-BK_6GU4v.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components-BK_6GU4v.js","names":["#options","#transformParam","#eachParam","Function"],"sources":["../../../internals/utils/src/casing.ts","../../../internals/utils/src/reserved.ts","../../../internals/utils/src/urlPath.ts","../src/components/Request.tsx"],"sourcesContent":["type Options = {\n /** When `true`, dot-separated segments are split on `.` and joined with `/` after casing. */\n isFile?: boolean\n /** Text prepended before casing is applied. */\n prefix?: string\n /** Text appended before casing is applied. */\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 */\nfunction applyToFileParts(text: string, transformPart: (part: string, isLast: boolean) => string): string {\n const parts = text.split('.')\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 = [\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]\n\n/**\n * Prefixes a word with `_` when it is a reserved JavaScript/Java identifier\n * or starts with a digit.\n */\nexport function transformReservedWord(word: string): string {\n const firstChar = word.charCodeAt(0)\n if (word && (reservedWords.includes(word) || (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 */\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 /** The resolved URL string (Express-style or template literal, depending on context). */\n url: string\n /** Extracted path parameters as a key-value map, or `undefined` when the path has none. */\n params?: Record<string, string>\n}\n\ntype ObjectOptions = {\n /** Controls whether the `url` is rendered as an Express path or a template literal. Defaults to `'path'`. */\n type?: 'path' | 'template'\n /** Optional transform applied to each extracted parameter name. */\n replacer?: (pathParam: string) => string\n /** When `true`, the result is serialized to a string expression instead of a plain object. */\n stringify?: boolean\n}\n\n/** Supported identifier casing strategies for path parameters. */\ntype PathCasing = 'camelcase'\n\ntype Options = {\n /** Casing strategy applied to path parameter names. Defaults to the original identifier. */\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 /** The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`. */\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 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 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 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 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 /** Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name. */\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 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, e.g. `/pet/{petId}` → `/pet/:petId`. */\n toURLPath(): string {\n return this.path.replace(/\\{([^}]+)\\}/g, ':$1')\n }\n}\n","import { URLPath } from '@internals/utils'\nimport { type HttpMethod, isAllOptional, isOptional } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, FunctionParams } 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 typeSchemas: OperationSchemas\n url: string\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 method: HttpMethod\n}\n\ntype GetParamsProps = {\n paramsCasing: PluginCypress['resolvedOptions']['paramsCasing']\n paramsType: PluginCypress['resolvedOptions']['paramsType']\n pathParamsType: PluginCypress['resolvedOptions']['pathParamsType']\n typeSchemas: OperationSchemas\n}\n\nfunction getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) {\n if (paramsType === 'object') {\n const pathParams = getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing })\n\n return FunctionParams.factory({\n data: {\n mode: 'object',\n children: {\n ...pathParams,\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: typeSchemas.queryParams?.name,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: typeSchemas.headerParams?.name,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n },\n },\n options: {\n type: 'Partial<Cypress.RequestOptions>',\n default: '{}',\n },\n })\n }\n\n return FunctionParams.factory({\n pathParams: typeSchemas.pathParams?.name\n ? {\n mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),\n default: isAllOptional(typeSchemas.pathParams?.schema) ? '{}' : undefined,\n }\n : undefined,\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n params: typeSchemas.queryParams?.name\n ? {\n type: typeSchemas.queryParams?.name,\n optional: isOptional(typeSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typeSchemas.headerParams?.name\n ? {\n type: typeSchemas.headerParams?.name,\n optional: isOptional(typeSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: 'Partial<Cypress.RequestOptions>',\n default: '{}',\n },\n })\n}\n\nexport function Request({ baseURL = '', name, dataReturnType, typeSchemas, url, method, paramsType, paramsCasing, pathParamsType }: Props): FabricReactNode {\n const path = new URLPath(url, { casing: paramsCasing })\n\n const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas })\n\n const returnType =\n dataReturnType === 'data' ? `Cypress.Chainable<${typeSchemas.response.name}>` : `Cypress.Chainable<Cypress.Response<${typeSchemas.response.name}>>`\n\n // Build the URL template string - this will convert /pets/:petId to /pets/${petId}\n const urlTemplate = path.toTemplateString({ prefix: baseURL })\n\n // Build request options object\n const requestOptions: string[] = [`method: '${method}'`, `url: ${urlTemplate}`]\n\n // Add query params if they exist\n if (typeSchemas.queryParams?.name) {\n requestOptions.push('qs: params')\n }\n\n // Add headers if they exist\n if (typeSchemas.headerParams?.name) {\n requestOptions.push('headers')\n }\n\n // Add body if request schema exists\n if (typeSchemas.request?.name) {\n requestOptions.push('body: data')\n }\n\n // Spread additional Cypress options\n requestOptions.push('...options')\n\n return (\n <File.Source name={name} isIndexable isExportable>\n <Function name={name} export params={params.toConstructor()} returnType={returnType}>\n {dataReturnType === 'data'\n ? `return cy.request<${typeSchemas.response.name}>({\n ${requestOptions.join(',\\n ')}\n}).then((res) => res.body)`\n : `return cy.request<${typeSchemas.response.name}>({\n ${requestOptions.join(',\\n ')}\n})`}\n </Function>\n </File.Source>\n )\n}\n\nRequest.getParams = getParams\n"],"mappings":";;;;;;;;;;;;;AAgBA,SAAS,gBAAgB,MAAc,QAAyB;AAS9D,QARmB,KAChB,MAAM,CACN,QAAQ,qBAAqB,QAAQ,CACrC,QAAQ,yBAAyB,QAAQ,CACzC,QAAQ,gBAAgB,QAAQ,CAEV,MAAM,gBAAgB,CAAC,OAAO,QAAQ,CAG5D,KAAK,MAAM,MAAM;AAEhB,MADiB,K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