@kubb/plugin-cypress 5.0.0-beta.56 → 5.0.0-beta.73

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/types.ts DELETED
@@ -1,123 +0,0 @@
1
- import type { ast, Exclude, Generator, Group, Include, Output, OutputOptions, Override, PluginFactoryOptions, Resolver } from '@kubb/core'
2
-
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
- * Resolves the output file name for a Cypress request module.
16
- */
17
- resolvePathName(this: ResolverCypress, name: string, type?: 'file' | 'function' | 'type' | 'const'): string
18
- }
19
-
20
- /**
21
- * Parameter handling mode that determines how path params and query/body params are arranged in function signatures.
22
- */
23
- type ParamsTypeOptions =
24
- | {
25
- /**
26
- * Every operation parameter is wrapped in a single destructured object argument.
27
- */
28
- paramsType: 'object'
29
- /**
30
- * `pathParamsType` has no effect when `paramsType` is `'object'`.
31
- */
32
- pathParamsType?: never
33
- }
34
- | {
35
- /**
36
- * Each parameter group is emitted as a separate positional function argument.
37
- */
38
- paramsType?: 'inline'
39
- /**
40
- * How URL path parameters are arranged inside the inline argument list.
41
- * - `'object'` groups them into one destructured object.
42
- * - `'inline'` emits each path param as its own argument.
43
- *
44
- * @default 'inline'
45
- */
46
- pathParamsType?: 'object' | 'inline'
47
- }
48
-
49
- /**
50
- * Where the generated Cypress helpers are written and how they are exported, plus the optional
51
- * `group` strategy. The `group` option organizes `output.mode: 'directory'` output into per-tag or per-path subdirectories.
52
- *
53
- * @default { path: 'cypress', barrel: { type: 'named' } }
54
- */
55
- export type Options = OutputOptions & {
56
- /**
57
- * Shape of the value returned from each helper.
58
- * - `'data'` — only the response body.
59
- * - `'full'` — the full Cypress response object (headers, status, body).
60
- *
61
- * @default 'data'
62
- */
63
- dataReturnType?: 'data' | 'full'
64
- /**
65
- * Rename parameter properties in the generated helpers (path, query, headers).
66
- *
67
- * @note Must match the value of `paramsCasing` on `@kubb/plugin-ts`.
68
- */
69
- paramsCasing?: 'camelcase'
70
- /**
71
- * Base URL prepended to every request URL. When omitted, falls back to the
72
- * adapter's server URL (typically `servers[0].url`).
73
- */
74
- baseURL?: string
75
- /**
76
- * Skip operations matching at least one entry in the list.
77
- */
78
- exclude?: Array<Exclude>
79
- /**
80
- * Restrict generation to operations matching at least one entry in the list.
81
- */
82
- include?: Array<Include>
83
- /**
84
- * Apply a different options object to operations matching a pattern.
85
- */
86
- override?: Array<Override<ResolvedOptions>>
87
- /**
88
- * Override how helper names and file paths are built.
89
- */
90
- resolver?: Partial<ResolverCypress> & ThisType<ResolverCypress>
91
- /**
92
- * AST visitor applied to each operation node before printing.
93
- */
94
- transformer?: ast.Visitor
95
- /**
96
- * Custom generators that run alongside the built-in Cypress generators.
97
- */
98
- generators?: Array<Generator<PluginCypress>>
99
- } & ParamsTypeOptions
100
-
101
- type ResolvedOptions = {
102
- output: Output
103
- exclude: Array<Exclude>
104
- include: Array<Include> | undefined
105
- override: Array<Override<ResolvedOptions>>
106
- group: Group | null
107
- baseURL: Options['baseURL'] | undefined
108
- dataReturnType: NonNullable<Options['dataReturnType']>
109
- pathParamsType: NonNullable<NonNullable<Options['pathParamsType']>>
110
- paramsType: NonNullable<Options['paramsType']>
111
- paramsCasing: Options['paramsCasing']
112
- resolver: ResolverCypress
113
- }
114
-
115
- export type PluginCypress = PluginFactoryOptions<'plugin-cypress', Options, ResolvedOptions, ResolverCypress>
116
-
117
- declare global {
118
- namespace Kubb {
119
- interface PluginRegistry {
120
- 'plugin-cypress': PluginCypress
121
- }
122
- }
123
- }