@kubb/plugin-cypress 4.1.3 → 4.2.0

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/README.md CHANGED
@@ -1,29 +1,29 @@
1
1
  <div align="center">
2
+ <h1>Plugin Cypress</h1>
3
+ <a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
4
+ <img width="180" src="https://raw.githubusercontent.com/kubb-labs/kubb/main/assets/logo.png" alt="Kubb logo">
5
+ </a>
2
6
 
3
- <!-- <img src="assets/logo.png" alt="logo" width="200" height="auto" /> -->
4
- <h1>@kubb/plugin-cypress</h1>
5
-
6
- <p>
7
- Swagger integration to create Cypress requests commands.
8
- </p>
9
- <img src="https://raw.githubusercontent.com/kubb-labs/kubb/main/assets/banner.png" alt="logo" height="auto" />
10
7
 
11
8
  [![npm version][npm-version-src]][npm-version-href]
12
9
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
13
10
  [![Coverage][coverage-src]][coverage-href]
14
11
  [![License][license-src]][license-href]
15
-
12
+ [![Sponsors][sponsors-src]][sponsors-href]
16
13
  <h4>
17
- <a href="https://codesandbox.io/s/github/kubb-labs/kubb/tree/main//examples/typescript" target="_blank">View Demo</a>
18
- <span> · </span>
19
- <a href="https://kubb.dev/" target="_blank">Documentation</a>
20
- <span> · </span>
21
- <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
22
- <span> · </span>
23
- <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Request Feature</a>
24
- </h4>
14
+ <a href="https://codesandbox.io/s/github/kubb-labs/kubb/tree/main//examples/typescript" target="_blank">View Demo</a>
15
+ <span> · </span>
16
+ <a href="https://kubb.dev/" target="_blank">Documentation</a>
17
+ <span> · </span>
18
+ <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
19
+ <span> · </span>
20
+ <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Request Feature</a>
21
+ </h4>
25
22
  </div>
26
23
 
24
+ Swagger integration to create Cypress requests commands.
25
+
26
+
27
27
  ## Supporting Kubb
28
28
 
29
29
  Kubb uses an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider:
@@ -51,3 +51,5 @@ Kubb uses an MIT-licensed open source project with its ongoing development made
51
51
  [minified-href]: https://www.npmjs.com/package/@kubb/plugin-cypress
52
52
  [coverage-src]: https://img.shields.io/codecov/c/github/kubb-labs/kubb?style=flat&colorA=18181B&colorB=f58517
53
53
  [coverage-href]: https://www.npmjs.com/package/@kubb/plugin-cypress
54
+ [sponsors-src]: https://img.shields.io/github/sponsors/stijnvanhulle?style=flat&colorA=18181B&colorB=f58517
55
+ [sponsors-href]: https://github.com/sponsors/stijnvanhulle/
@@ -1 +1 @@
1
- {"version":3,"file":"components-B-t6gvpJ.cjs","names":["FunctionParams","File","Function","URLPath"],"sources":["../src/components/Request.tsx"],"sourcesContent":["import { File, Function, FunctionParams } from '@kubb/react'\n\nimport { type HttpMethod, isOptional } from '@kubb/oas'\nimport type { ReactNode } from 'react'\nimport { URLPath } from '@kubb/core/utils'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\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 method: HttpMethod\n}\n\nexport function Request({ baseURL = '', name, dataReturnType, typeSchemas, url, method }: Props): ReactNode {\n const params = FunctionParams.factory({\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n })\n\n const returnType =\n dataReturnType === 'data' ? `Cypress.Chainable<${typeSchemas.response.name}>` : `Cypress.Chainable<Cypress.Response<${typeSchemas.response.name}>>`\n\n const body = typeSchemas.request?.name ? 'data' : undefined\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('${method}', '${baseURL ?? ''}${new URLPath(url).toURLPath().replace(/([^/]):/g, '$1\\\\\\\\:')}', ${body}).then((res: Cypress.Response<${typeSchemas.response.name}>) => res.body)`}\n {dataReturnType === 'full' && `return cy.request('${method}', '${new URLPath(`${baseURL ?? ''}${url}`).toURLPath()}', ${body})`}\n </Function>\n </File.Source>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,QAAQ,EAAE,UAAU,IAAI,MAAM,gBAAgB,aAAa,KAAK,UAA4B;CAC1G,MAAM,SAASA,4BAAe,QAAQ,EACpC,MAAM,YAAY,SAAS,OACvB;EACE,MAAM,YAAY,SAAS;EAC3B,qCAAqB,YAAY,SAAS,OAAO;EAClD,GACD,QACL,CAAC;CAEF,MAAM,aACJ,mBAAmB,SAAS,qBAAqB,YAAY,SAAS,KAAK,KAAK,sCAAsC,YAAY,SAAS,KAAK;CAElJ,MAAM,OAAO,YAAY,SAAS,OAAO,SAAS;AAElD,QACE,kDAACC,kBAAK;EAAa;EAAM;EAAY;YACnC,mDAACC;GAAe;GAAM;GAAO,QAAQ,OAAO,eAAe;GAAc;cACtE,mBAAmB,UAClB,sBAAsB,OAAO,MAAM,WAAW,KAAK,IAAIC,0BAAQ,IAAI,CAAC,WAAW,CAAC,QAAQ,YAAY,UAAU,CAAC,KAAK,KAAK,gCAAgC,YAAY,SAAS,KAAK,kBACpL,mBAAmB,UAAU,sBAAsB,OAAO,MAAM,IAAIA,0BAAQ,GAAG,WAAW,KAAK,MAAM,CAAC,WAAW,CAAC,KAAK,KAAK;IACpH;GACC"}
1
+ {"version":3,"file":"components-B-t6gvpJ.cjs","names":["FunctionParams","File","Function","URLPath"],"sources":["../src/components/Request.tsx"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\n\nimport { type HttpMethod, isOptional } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { File, Function, FunctionParams } from '@kubb/react'\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 method: HttpMethod\n}\n\nexport function Request({ baseURL = '', name, dataReturnType, typeSchemas, url, method }: Props) {\n const params = FunctionParams.factory({\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n })\n\n const returnType =\n dataReturnType === 'data' ? `Cypress.Chainable<${typeSchemas.response.name}>` : `Cypress.Chainable<Cypress.Response<${typeSchemas.response.name}>>`\n\n const body = typeSchemas.request?.name ? 'data' : undefined\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('${method}', '${baseURL ?? ''}${new URLPath(url).toURLPath().replace(/([^/]):/g, '$1\\\\\\\\:')}', ${body}).then((res: Cypress.Response<${typeSchemas.response.name}>) => res.body)`}\n {dataReturnType === 'full' && `return cy.request('${method}', '${new URLPath(`${baseURL ?? ''}${url}`).toURLPath()}', ${body})`}\n </Function>\n </File.Source>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,QAAQ,EAAE,UAAU,IAAI,MAAM,gBAAgB,aAAa,KAAK,UAAiB;CAC/F,MAAM,SAASA,4BAAe,QAAQ,EACpC,MAAM,YAAY,SAAS,OACvB;EACE,MAAM,YAAY,SAAS;EAC3B,qCAAqB,YAAY,SAAS,OAAO;EAClD,GACD,QACL,CAAC;CAEF,MAAM,aACJ,mBAAmB,SAAS,qBAAqB,YAAY,SAAS,KAAK,KAAK,sCAAsC,YAAY,SAAS,KAAK;CAElJ,MAAM,OAAO,YAAY,SAAS,OAAO,SAAS;AAElD,QACE,kDAACC,kBAAK;EAAa;EAAM;EAAY;YACnC,mDAACC;GAAe;GAAM;GAAO,QAAQ,OAAO,eAAe;GAAc;cACtE,mBAAmB,UAClB,sBAAsB,OAAO,MAAM,WAAW,KAAK,IAAIC,0BAAQ,IAAI,CAAC,WAAW,CAAC,QAAQ,YAAY,UAAU,CAAC,KAAK,KAAK,gCAAgC,YAAY,SAAS,KAAK,kBACpL,mBAAmB,UAAU,sBAAsB,OAAO,MAAM,IAAIA,0BAAQ,GAAG,WAAW,KAAK,MAAM,CAAC,WAAW,CAAC,KAAK,KAAK;IACpH;GACC"}
@@ -26,5 +26,5 @@ function Request({ baseURL = "", name, dataReturnType, typeSchemas, url, method
26
26
  }
27
27
 
28
28
  //#endregion
29
- export { Request };
30
- //# sourceMappingURL=components-jRFHC_sv.js.map
29
+ export { Request as t };
30
+ //# sourceMappingURL=components-CkuOZl8o.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-CkuOZl8o.js","names":[],"sources":["../src/components/Request.tsx"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\n\nimport { type HttpMethod, isOptional } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { File, Function, FunctionParams } from '@kubb/react'\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 method: HttpMethod\n}\n\nexport function Request({ baseURL = '', name, dataReturnType, typeSchemas, url, method }: Props) {\n const params = FunctionParams.factory({\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n })\n\n const returnType =\n dataReturnType === 'data' ? `Cypress.Chainable<${typeSchemas.response.name}>` : `Cypress.Chainable<Cypress.Response<${typeSchemas.response.name}>>`\n\n const body = typeSchemas.request?.name ? 'data' : undefined\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('${method}', '${baseURL ?? ''}${new URLPath(url).toURLPath().replace(/([^/]):/g, '$1\\\\\\\\:')}', ${body}).then((res: Cypress.Response<${typeSchemas.response.name}>) => res.body)`}\n {dataReturnType === 'full' && `return cy.request('${method}', '${new URLPath(`${baseURL ?? ''}${url}`).toURLPath()}', ${body})`}\n </Function>\n </File.Source>\n )\n}\n"],"mappings":";;;;;;AAmBA,SAAgB,QAAQ,EAAE,UAAU,IAAI,MAAM,gBAAgB,aAAa,KAAK,UAAiB;CAC/F,MAAM,SAAS,eAAe,QAAQ,EACpC,MAAM,YAAY,SAAS,OACvB;EACE,MAAM,YAAY,SAAS;EAC3B,UAAU,WAAW,YAAY,SAAS,OAAO;EAClD,GACD,QACL,CAAC;CAEF,MAAM,aACJ,mBAAmB,SAAS,qBAAqB,YAAY,SAAS,KAAK,KAAK,sCAAsC,YAAY,SAAS,KAAK;CAElJ,MAAM,OAAO,YAAY,SAAS,OAAO,SAAS;AAElD,QACE,oBAAC,KAAK;EAAa;EAAM;EAAY;YACnC,qBAAC;GAAe;GAAM;GAAO,QAAQ,OAAO,eAAe;GAAc;cACtE,mBAAmB,UAClB,sBAAsB,OAAO,MAAM,WAAW,KAAK,IAAI,QAAQ,IAAI,CAAC,WAAW,CAAC,QAAQ,YAAY,UAAU,CAAC,KAAK,KAAK,gCAAgC,YAAY,SAAS,KAAK,kBACpL,mBAAmB,UAAU,sBAAsB,OAAO,MAAM,IAAI,QAAQ,GAAG,WAAW,KAAK,MAAM,CAAC,WAAW,CAAC,KAAK,KAAK;IACpH;GACC"}
@@ -1,5 +1,4 @@
1
- import { HttpMethod, OperationSchemas, PluginCypress } from "./types-rlD4akES.cjs";
2
- import { ReactNode } from "react";
1
+ import { i as OperationSchemas, n as PluginCypress, o as HttpMethod } from "./types-CpA-hLRj.cjs";
3
2
 
4
3
  //#region src/components/Request.d.ts
5
4
  type Props = {
@@ -20,7 +19,7 @@ declare function Request({
20
19
  typeSchemas,
21
20
  url,
22
21
  method
23
- }: Props): ReactNode;
22
+ }: Props): any;
24
23
  //#endregion
25
24
  export { Request };
26
25
  //# sourceMappingURL=components.d.cts.map
@@ -1,5 +1,4 @@
1
- import { HttpMethod, OperationSchemas, PluginCypress } from "./types-B8kwRVN5.js";
2
- import { ReactNode } from "react";
1
+ import { i as OperationSchemas, n as PluginCypress, o as HttpMethod } from "./types-C0s4sqJf.js";
3
2
 
4
3
  //#region src/components/Request.d.ts
5
4
  type Props = {
@@ -20,7 +19,7 @@ declare function Request({
20
19
  typeSchemas,
21
20
  url,
22
21
  method
23
- }: Props): ReactNode;
22
+ }: Props): any;
24
23
  //#endregion
25
24
  export { Request };
26
25
  //# sourceMappingURL=components.d.ts.map
@@ -1,3 +1,3 @@
1
- import { Request } from "./components-jRFHC_sv.js";
1
+ import { t as Request } from "./components-CkuOZl8o.js";
2
2
 
3
3
  export { Request };
@@ -3,6 +3,8 @@ let __kubb_plugin_oas = require("@kubb/plugin-oas");
3
3
  __kubb_plugin_oas = require_components.__toESM(__kubb_plugin_oas);
4
4
  let __kubb_plugin_ts = require("@kubb/plugin-ts");
5
5
  __kubb_plugin_ts = require_components.__toESM(__kubb_plugin_ts);
6
+ let __kubb_core_hooks = require("@kubb/core/hooks");
7
+ __kubb_core_hooks = require_components.__toESM(__kubb_core_hooks);
6
8
  let __kubb_core_utils = require("@kubb/core/utils");
7
9
  __kubb_core_utils = require_components.__toESM(__kubb_core_utils);
8
10
  let __kubb_plugin_oas_hooks = require("@kubb/plugin-oas/hooks");
@@ -18,7 +20,8 @@ __kubb_react_jsx_runtime = require_components.__toESM(__kubb_react_jsx_runtime);
18
20
  const cypressGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
19
21
  name: "cypress",
20
22
  Operation({ operation }) {
21
- const { pluginManager, plugin: { options: { output, baseURL, dataReturnType } } } = (0, __kubb_react.useApp)();
23
+ const { options: { output, baseURL, dataReturnType } } = (0, __kubb_core_hooks.usePlugin)();
24
+ const pluginManager = (0, __kubb_core_hooks.usePluginManager)();
22
25
  const oas = (0, __kubb_plugin_oas_hooks.useOas)();
23
26
  const { getSchemas, getName, getFile } = (0, __kubb_plugin_oas_hooks.useOperationManager)();
24
27
  const request = {
@@ -76,4 +79,4 @@ Object.defineProperty(exports, 'cypressGenerator', {
76
79
  return cypressGenerator;
77
80
  }
78
81
  });
79
- //# sourceMappingURL=generators-Dg1pCFZB.cjs.map
82
+ //# sourceMappingURL=generators-Dcm7kTBP.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generators-Dcm7kTBP.cjs","names":["pluginTsName","File","Request","URLPath"],"sources":["../src/generators/cypressGenerator.tsx"],"sourcesContent":["import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { URLPath } from '@kubb/core/utils'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File } from '@kubb/react'\nimport { Request } from '../components'\nimport type { PluginCypress } from '../types'\n\nexport const cypressGenerator = createReactGenerator<PluginCypress>({\n name: 'cypress',\n Operation({ operation }) {\n const {\n options: { output, baseURL, dataReturnType },\n } = usePlugin<PluginCypress>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const request = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n return (\n <File\n baseName={request.file.baseName}\n path={request.file.path}\n meta={request.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={request.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <Request\n name={request.name}\n dataReturnType={dataReturnType}\n typeSchemas={type.schemas}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,MAAa,+DAAuD;CAClE,MAAM;CACN,UAAU,EAAE,aAAa;EACvB,MAAM,EACJ,SAAS,EAAE,QAAQ,SAAS,uDACA;EAC9B,MAAM,yDAAkC;EAExC,MAAM,2CAAc;EACpB,MAAM,EAAE,YAAY,SAAS,8DAAiC;EAE9D,MAAM,UAAU;GACd,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;GAC9C,MAAM,QAAQ,UAAU;GACzB;EAED,MAAM,OAAO;GACX,MAAM,QAAQ,WAAW,EAAE,WAAW,CAACA,8BAAa,EAAE,CAAC;GACvD,SAAS,WAAW,WAAW;IAAE,WAAW,CAACA,8BAAa;IAAE,MAAM;IAAQ,CAAC;GAC5E;AAED,SACE,mDAACC;GACC,UAAU,QAAQ,KAAK;GACvB,MAAM,QAAQ,KAAK;GACnB,MAAM,QAAQ,KAAK;GACnB,+CAAkB;IAAE;IAAK;IAAQ,QAAQ,cAAc;IAAQ,CAAC;GAChE,+CAAkB;IAAE;IAAK;IAAQ,CAAC;cAElC,kDAACA,kBAAK;IACJ,MAAM;KACJ,KAAK,QAAQ,SAAS;KACtB,KAAK,QAAQ,SAAS;KACtB,KAAK,QAAQ,YAAY;KACzB,KAAK,QAAQ,aAAa;KAC1B,KAAK,QAAQ,cAAc;KAC3B,GAAI,KAAK,QAAQ,aAAa,KAAK,SAAS,KAAK,KAAK,IAAI,EAAE;KAC7D,CAAC,OAAO,QAAQ;IACjB,MAAM,QAAQ,KAAK;IACnB,MAAM,KAAK,KAAK;IAChB;KACA,EACF,kDAACC;IACC,MAAM,QAAQ;IACE;IAChB,aAAa,KAAK;IAClB,QAAQ,UAAU;IACT;IACT,KAAK,IAAIC,0BAAQ,UAAU,KAAK,CAAC,WAAW;KAC5C;IACG;;CAGZ,CAAC"}
@@ -1,17 +1,19 @@
1
- import { Request } from "./components-jRFHC_sv.js";
1
+ import { t as Request } from "./components-CkuOZl8o.js";
2
2
  import { createReactGenerator } from "@kubb/plugin-oas";
3
3
  import { pluginTsName } from "@kubb/plugin-ts";
4
+ import { usePlugin, usePluginManager } from "@kubb/core/hooks";
4
5
  import { URLPath } from "@kubb/core/utils";
5
6
  import { useOas, useOperationManager } from "@kubb/plugin-oas/hooks";
6
7
  import { getBanner, getFooter } from "@kubb/plugin-oas/utils";
7
- import { File, useApp } from "@kubb/react";
8
+ import { File } from "@kubb/react";
8
9
  import { jsx, jsxs } from "@kubb/react/jsx-runtime";
9
10
 
10
11
  //#region src/generators/cypressGenerator.tsx
11
12
  const cypressGenerator = createReactGenerator({
12
13
  name: "cypress",
13
14
  Operation({ operation }) {
14
- const { pluginManager, plugin: { options: { output, baseURL, dataReturnType } } } = useApp();
15
+ const { options: { output, baseURL, dataReturnType } } = usePlugin();
16
+ const pluginManager = usePluginManager();
15
17
  const oas = useOas();
16
18
  const { getSchemas, getName, getFile } = useOperationManager();
17
19
  const request = {
@@ -63,5 +65,5 @@ const cypressGenerator = createReactGenerator({
63
65
  });
64
66
 
65
67
  //#endregion
66
- export { cypressGenerator };
67
- //# sourceMappingURL=generators-aYB5ZkVA.js.map
68
+ export { cypressGenerator as t };
69
+ //# sourceMappingURL=generators-v4Wf70NJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generators-v4Wf70NJ.js","names":[],"sources":["../src/generators/cypressGenerator.tsx"],"sourcesContent":["import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { URLPath } from '@kubb/core/utils'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File } from '@kubb/react'\nimport { Request } from '../components'\nimport type { PluginCypress } from '../types'\n\nexport const cypressGenerator = createReactGenerator<PluginCypress>({\n name: 'cypress',\n Operation({ operation }) {\n const {\n options: { output, baseURL, dataReturnType },\n } = usePlugin<PluginCypress>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const request = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n return (\n <File\n baseName={request.file.baseName}\n path={request.file.path}\n meta={request.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={request.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <Request\n name={request.name}\n dataReturnType={dataReturnType}\n typeSchemas={type.schemas}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,mBAAmB,qBAAoC;CAClE,MAAM;CACN,UAAU,EAAE,aAAa;EACvB,MAAM,EACJ,SAAS,EAAE,QAAQ,SAAS,qBAC1B,WAA0B;EAC9B,MAAM,gBAAgB,kBAAkB;EAExC,MAAM,MAAM,QAAQ;EACpB,MAAM,EAAE,YAAY,SAAS,YAAY,qBAAqB;EAE9D,MAAM,UAAU;GACd,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;GAC9C,MAAM,QAAQ,UAAU;GACzB;EAED,MAAM,OAAO;GACX,MAAM,QAAQ,WAAW,EAAE,WAAW,CAAC,aAAa,EAAE,CAAC;GACvD,SAAS,WAAW,WAAW;IAAE,WAAW,CAAC,aAAa;IAAE,MAAM;IAAQ,CAAC;GAC5E;AAED,SACE,qBAAC;GACC,UAAU,QAAQ,KAAK;GACvB,MAAM,QAAQ,KAAK;GACnB,MAAM,QAAQ,KAAK;GACnB,QAAQ,UAAU;IAAE;IAAK;IAAQ,QAAQ,cAAc;IAAQ,CAAC;GAChE,QAAQ,UAAU;IAAE;IAAK;IAAQ,CAAC;cAElC,oBAAC,KAAK;IACJ,MAAM;KACJ,KAAK,QAAQ,SAAS;KACtB,KAAK,QAAQ,SAAS;KACtB,KAAK,QAAQ,YAAY;KACzB,KAAK,QAAQ,aAAa;KAC1B,KAAK,QAAQ,cAAc;KAC3B,GAAI,KAAK,QAAQ,aAAa,KAAK,SAAS,KAAK,KAAK,IAAI,EAAE;KAC7D,CAAC,OAAO,QAAQ;IACjB,MAAM,QAAQ,KAAK;IACnB,MAAM,KAAK,KAAK;IAChB;KACA,EACF,oBAAC;IACC,MAAM,QAAQ;IACE;IAChB,aAAa,KAAK;IAClB,QAAQ,UAAU;IACT;IACT,KAAK,IAAI,QAAQ,UAAU,KAAK,CAAC,WAAW;KAC5C;IACG;;CAGZ,CAAC"}
@@ -1,4 +1,4 @@
1
1
  require('./components-B-t6gvpJ.cjs');
2
- const require_generators = require('./generators-Dg1pCFZB.cjs');
2
+ const require_generators = require('./generators-Dcm7kTBP.cjs');
3
3
 
4
4
  exports.cypressGenerator = require_generators.cypressGenerator;
@@ -1,4 +1,4 @@
1
- import { Generator, PluginCypress } from "./types-rlD4akES.cjs";
1
+ import { n as PluginCypress, r as Generator } from "./types-CpA-hLRj.cjs";
2
2
 
3
3
  //#region src/generators/cypressGenerator.d.ts
4
4
  declare const cypressGenerator: Generator<PluginCypress>;
@@ -1,4 +1,4 @@
1
- import { Generator, PluginCypress } from "./types-B8kwRVN5.js";
1
+ import { n as PluginCypress, r as Generator } from "./types-C0s4sqJf.js";
2
2
 
3
3
  //#region src/generators/cypressGenerator.d.ts
4
4
  declare const cypressGenerator: Generator<PluginCypress>;
@@ -1,4 +1,4 @@
1
- import "./components-jRFHC_sv.js";
2
- import { cypressGenerator } from "./generators-aYB5ZkVA.js";
1
+ import "./components-CkuOZl8o.js";
2
+ import { t as cypressGenerator } from "./generators-v4Wf70NJ.js";
3
3
 
4
4
  export { cypressGenerator };
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const require_components = require('./components-B-t6gvpJ.cjs');
2
- const require_generators = require('./generators-Dg1pCFZB.cjs');
2
+ const require_generators = require('./generators-Dcm7kTBP.cjs');
3
3
  let node_path = require("node:path");
4
4
  node_path = require_components.__toESM(node_path);
5
5
  let __kubb_core = require("@kubb/core");
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options, PluginCypress, UserPluginWithLifeCycle } from "./types-rlD4akES.cjs";
1
+ import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-CpA-hLRj.cjs";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const pluginCypressName = "plugin-cypress";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options, PluginCypress, UserPluginWithLifeCycle } from "./types-B8kwRVN5.js";
1
+ import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-C0s4sqJf.js";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const pluginCypressName = "plugin-cypress";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./components-jRFHC_sv.js";
2
- import { cypressGenerator } from "./generators-aYB5ZkVA.js";
1
+ import "./components-CkuOZl8o.js";
2
+ import { t as cypressGenerator } from "./generators-v4Wf70NJ.js";
3
3
  import path from "node:path";
4
4
  import { FileManager, PluginManager, createPlugin } from "@kubb/core";
5
5
  import { camelCase } from "@kubb/core/transformers";
@@ -46,17 +46,17 @@ declare class Oas<const TOAS = unknown> extends BaseOas {
46
46
  * Abstract class that contains the building blocks for plugins to create their own Generator
47
47
  * @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137
48
48
  */
49
- declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
49
+ declare abstract class BaseGenerator<TOptions$1 = unknown, TContext = unknown> {
50
50
  #private;
51
- constructor(options?: TOptions, context?: TContext);
52
- get options(): TOptions;
51
+ constructor(options?: TOptions$1, context?: TContext);
52
+ get options(): TOptions$1;
53
53
  get context(): TContext;
54
- set options(options: TOptions);
54
+ set options(options: TOptions$1);
55
55
  abstract build(...params: unknown[]): unknown;
56
56
  }
57
57
  //#endregion
58
58
  //#region ../core/src/fs/types.d.ts
59
- type BasePath<T extends string = string> = `${T}/`;
59
+ type BasePath<T$1 extends string = string> = `${T$1}/`;
60
60
  type Import = {
61
61
  /**
62
62
  * Import name to be used
@@ -130,7 +130,7 @@ type BaseName = `${string}.${string}`;
130
130
  * Path will be full qualified path to a specified file
131
131
  */
132
132
  type Path = string;
133
- type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
133
+ type AdvancedPath<T$1 extends BaseName = BaseName> = `${BasePath}${T$1}`;
134
134
  type OptionalPath = Path | undefined | null;
135
135
  type File<TMeta extends object = object> = {
136
136
  /**
@@ -219,9 +219,9 @@ type Logger = {
219
219
  };
220
220
  //#endregion
221
221
  //#region ../core/src/utils/types.d.ts
222
- type PossiblePromise<T> = Promise<T> | T;
223
- type ArrayWithLength<T extends number, U extends any[] = []> = U['length'] extends T ? U : ArrayWithLength<T, [true, ...U]>;
224
- type GreaterThan<T extends number, U extends number> = ArrayWithLength<U> extends [...ArrayWithLength<T>, ...infer _] ? false : true;
222
+ type PossiblePromise<T$1> = Promise<T$1> | T$1;
223
+ type ArrayWithLength<T$1 extends number, U extends any[] = []> = U['length'] extends T$1 ? U : ArrayWithLength<T$1, [true, ...U]>;
224
+ type GreaterThan<T$1 extends number, U extends number> = ArrayWithLength<U> extends [...ArrayWithLength<T$1>, ...infer _] ? false : true;
225
225
  //#endregion
226
226
  //#region ../core/src/types.d.ts
227
227
  type InputPath = {
@@ -334,11 +334,11 @@ TName extends string = string,
334
334
  /**
335
335
  * Options of the plugin.
336
336
  */
337
- TOptions extends object = object,
337
+ TOptions$1 extends object = object,
338
338
  /**
339
339
  * Options of the plugin that can be used later on, see `options` inside your plugin config.
340
340
  */
341
- TResolvedOptions extends object = TOptions,
341
+ TResolvedOptions extends object = TOptions$1,
342
342
  /**
343
343
  * Context that you want to expose to other plugins.
344
344
  */
@@ -352,23 +352,23 @@ TResolvePathOptions extends object = object> = {
352
352
  * Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
353
353
  */
354
354
  key: PluginKey<TName | string>;
355
- options: TOptions;
355
+ options: TOptions$1;
356
356
  resolvedOptions: TResolvedOptions;
357
357
  context: TContext;
358
358
  resolvePathOptions: TResolvePathOptions;
359
359
  };
360
360
  type PluginKey<TName> = [name: TName, identifier?: string | number];
361
- type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
361
+ type UserPlugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
362
362
  /**
363
363
  * Unique name used for the plugin
364
364
  * The name of the plugin follows the format scope:foo-bar or foo-bar, adding scope: can avoid naming conflicts with other plugins.
365
365
  * @example @kubb/typescript
366
366
  */
367
- name: TOptions['name'];
367
+ name: TOptions$1['name'];
368
368
  /**
369
369
  * Options set for a specific plugin(see kubb.config.js), passthrough of options.
370
370
  */
371
- options: TOptions['resolvedOptions'];
371
+ options: TOptions$1['resolvedOptions'];
372
372
  /**
373
373
  * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
374
374
  * Can be used to validate dependent plugins.
@@ -378,23 +378,23 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
378
378
  * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin will be executed before these plugins.
379
379
  */
380
380
  post?: Array<string>;
381
- } & (TOptions['context'] extends never ? {
381
+ } & (TOptions$1['context'] extends never ? {
382
382
  context?: never;
383
383
  } : {
384
- context: (this: TOptions['name'] extends 'core' ? null : Omit<PluginContext<TOptions>, 'addFile'>) => TOptions['context'];
384
+ context: (this: TOptions$1['name'] extends 'core' ? null : Omit<PluginContext<TOptions$1>, 'addFile'>) => TOptions$1['context'];
385
385
  });
386
- type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>;
387
- type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
386
+ type UserPluginWithLifeCycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions$1> & PluginLifecycle<TOptions$1>;
387
+ type Plugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
388
388
  /**
389
389
  * Unique name used for the plugin
390
390
  * @example @kubb/typescript
391
391
  */
392
- name: TOptions['name'];
392
+ name: TOptions$1['name'];
393
393
  /**
394
394
  * Internal key used when a developer uses more than one of the same plugin
395
395
  * @private
396
396
  */
397
- key: TOptions['key'];
397
+ key: TOptions$1['key'];
398
398
  /**
399
399
  * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
400
400
  * Can be used to validate dependent plugins.
@@ -407,49 +407,49 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
407
407
  /**
408
408
  * Options set for a specific plugin(see kubb.config.js), passthrough of options.
409
409
  */
410
- options: TOptions['resolvedOptions'];
411
- } & (TOptions['context'] extends never ? {
410
+ options: TOptions$1['resolvedOptions'];
411
+ } & (TOptions$1['context'] extends never ? {
412
412
  context?: never;
413
413
  } : {
414
- context: TOptions['context'];
414
+ context: TOptions$1['context'];
415
415
  });
416
- type PluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions> & PluginLifecycle<TOptions>;
417
- type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
416
+ type PluginWithLifeCycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions$1> & PluginLifecycle<TOptions$1>;
417
+ type PluginLifecycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
418
418
  /**
419
419
  * Start of the lifecycle of a plugin.
420
420
  * @type hookParallel
421
421
  */
422
- buildStart?: (this: PluginContext<TOptions>, Config: Config) => PossiblePromise<void>;
422
+ buildStart?: (this: PluginContext<TOptions$1>, Config: Config) => PossiblePromise<void>;
423
423
  /**
424
424
  * Resolve to a Path based on a baseName(example: `./Pet.ts`) and directory(example: `./models`).
425
425
  * Options can als be included.
426
426
  * @type hookFirst
427
427
  * @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
428
428
  */
429
- resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
429
+ resolvePath?: (this: PluginContext<TOptions$1>, baseName: BaseName, mode?: Mode, options?: TOptions$1['resolvePathOptions']) => OptionalPath;
430
430
  /**
431
431
  * Resolve to a name based on a string.
432
432
  * Useful when converting to PascalCase or camelCase.
433
433
  * @type hookFirst
434
434
  * @example ('pet') => 'Pet'
435
435
  */
436
- resolveName?: (this: PluginContext<TOptions>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
436
+ resolveName?: (this: PluginContext<TOptions$1>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
437
437
  /**
438
438
  * End of the plugin lifecycle.
439
439
  * @type hookParallel
440
440
  */
441
- buildEnd?: (this: PluginContext<TOptions>) => PossiblePromise<void>;
441
+ buildEnd?: (this: PluginContext<TOptions$1>) => PossiblePromise<void>;
442
442
  };
443
443
  type PluginLifecycleHooks = keyof PluginLifecycle;
444
- type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
445
- type ResolvePathParams<TOptions = object> = {
444
+ type PluginParameter<H$1 extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H$1]>;
445
+ type ResolvePathParams<TOptions$1 = object> = {
446
446
  pluginKey?: Plugin['key'];
447
447
  baseName: BaseName;
448
448
  mode?: Mode;
449
449
  /**
450
450
  * Options to be passed to 'resolvePath' 3th parameter
451
451
  */
452
- options?: TOptions;
452
+ options?: TOptions$1;
453
453
  };
454
454
  type ResolveNameParams = {
455
455
  name: string;
@@ -462,12 +462,12 @@ type ResolveNameParams = {
462
462
  */
463
463
  type?: 'file' | 'function' | 'type' | 'const';
464
464
  };
465
- type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
465
+ type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
466
466
  config: Config;
467
467
  fileManager: FileManager;
468
468
  pluginManager: PluginManager;
469
469
  addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
470
- resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
470
+ resolvePath: (params: ResolvePathParams<TOptions$1['resolvePathOptions']>) => OptionalPath;
471
471
  resolveName: (params: ResolveNameParams) => string;
472
472
  logger: Logger;
473
473
  /**
@@ -477,12 +477,12 @@ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
477
477
  /**
478
478
  * Current plugin
479
479
  */
480
- plugin: Plugin<TOptions>;
480
+ plugin: Plugin<TOptions$1>;
481
481
  };
482
482
  /**
483
483
  * Specify the export location for the files and define the behavior of the output
484
484
  */
485
- type Output<TOptions> = {
485
+ type Output<TOptions$1> = {
486
486
  /**
487
487
  * Path to the output folder or file that will contain the generated code
488
488
  */
@@ -495,11 +495,11 @@ type Output<TOptions> = {
495
495
  /**
496
496
  * Add a banner text in the beginning of every file
497
497
  */
498
- banner?: string | ((options: TOptions) => string);
498
+ banner?: string | ((options: TOptions$1) => string);
499
499
  /**
500
500
  * Add a footer text in the beginning of every file
501
501
  */
502
- footer?: string | ((options: TOptions) => string);
502
+ footer?: string | ((options: TOptions$1) => string);
503
503
  };
504
504
  type GroupContext = {
505
505
  group: string;
@@ -519,7 +519,7 @@ type Group = {
519
519
  type FileMetaBase = {
520
520
  pluginKey?: Plugin['key'];
521
521
  };
522
- type AddResult<T extends Array<File>> = Promise<Awaited<GreaterThan<T['length'], 1> extends true ? Promise<ResolvedFile[]> : Promise<ResolvedFile>>>;
522
+ type AddResult<T$1 extends Array<File>> = Promise<Awaited<GreaterThan<T$1['length'], 1> extends true ? Promise<ResolvedFile[]> : Promise<ResolvedFile>>>;
523
523
  type AddIndexesProps = {
524
524
  type: BarrelType | false | undefined;
525
525
  /**
@@ -572,16 +572,16 @@ declare class FileManager {
572
572
  //#region ../core/src/PluginManager.d.ts
573
573
  type RequiredPluginLifecycle = Required<PluginLifecycle>;
574
574
  type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
575
- type Executer<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
575
+ type Executer<H$1 extends PluginLifecycleHooks = PluginLifecycleHooks> = {
576
576
  message: string;
577
577
  strategy: Strategy;
578
- hookName: H;
578
+ hookName: H$1;
579
579
  plugin: Plugin;
580
580
  parameters?: unknown[] | undefined;
581
581
  output?: unknown;
582
582
  };
583
- type ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H];
584
- type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {
583
+ type ParseResult<H$1 extends PluginLifecycleHooks> = RequiredPluginLifecycle[H$1];
584
+ type SafeParseResult<H$1 extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H$1>>> = {
585
585
  result: Result;
586
586
  plugin: Plugin;
587
587
  };
@@ -597,12 +597,12 @@ type Events = {
597
597
  executed: [executer: Executer];
598
598
  error: [error: Error];
599
599
  };
600
- type GetFileProps<TOptions = object> = {
600
+ type GetFileProps<TOptions$1 = object> = {
601
601
  name: string;
602
602
  mode?: Mode;
603
603
  extname: Extname;
604
604
  pluginKey: Plugin['key'];
605
- options?: TOptions;
605
+ options?: TOptions$1;
606
606
  };
607
607
  declare class PluginManager {
608
608
  #private;
@@ -1008,12 +1008,12 @@ type ByContentType = {
1008
1008
  };
1009
1009
  type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
1010
1010
  type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
1011
- type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
1012
- options: Partial<TOptions>;
1011
+ type Override<TOptions$1> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
1012
+ options: Partial<TOptions$1>;
1013
1013
  };
1014
1014
  //#endregion
1015
1015
  //#region ../plugin-oas/src/SchemaGenerator.d.ts
1016
- type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
1016
+ type Context$1<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
1017
1017
  oas: Oas;
1018
1018
  pluginManager: PluginManager;
1019
1019
  /**
@@ -1022,7 +1022,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
1022
1022
  plugin: Plugin<TPluginOptions>;
1023
1023
  mode: Mode;
1024
1024
  include?: Array<'schemas' | 'responses' | 'requestBodies'>;
1025
- override: Array<Override<TOptions>> | undefined;
1025
+ override: Array<Override<TOptions$1>> | undefined;
1026
1026
  contentType?: contentType;
1027
1027
  output?: string;
1028
1028
  };
@@ -1053,7 +1053,7 @@ type SchemaProps$1 = {
1053
1053
  name?: string;
1054
1054
  parentName?: string;
1055
1055
  };
1056
- declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context$1<TOptions, TPluginOptions>> {
1056
+ declare class SchemaGenerator<TOptions$1 extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions$1, Context$1<TOptions$1, TPluginOptions>> {
1057
1057
  #private;
1058
1058
  refs: Refs;
1059
1059
  /**
@@ -1072,39 +1072,39 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
1072
1072
  }
1073
1073
  //#endregion
1074
1074
  //#region ../plugin-oas/src/generator.d.ts
1075
- type OperationsProps<TOptions extends PluginFactoryOptions> = {
1076
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
1077
- options: TOptions['resolvedOptions'];
1075
+ type OperationsProps<TOptions$1 extends PluginFactoryOptions> = {
1076
+ instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
1077
+ options: TOptions$1['resolvedOptions'];
1078
1078
  operations: Array<Operation$1>;
1079
1079
  };
1080
- type OperationProps<TOptions extends PluginFactoryOptions> = {
1081
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
1082
- options: TOptions['resolvedOptions'];
1080
+ type OperationProps<TOptions$1 extends PluginFactoryOptions> = {
1081
+ instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
1082
+ options: TOptions$1['resolvedOptions'];
1083
1083
  operation: Operation$1;
1084
1084
  };
1085
- type SchemaProps<TOptions extends PluginFactoryOptions> = {
1086
- instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
1087
- options: TOptions['resolvedOptions'];
1085
+ type SchemaProps<TOptions$1 extends PluginFactoryOptions> = {
1086
+ instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions$1>, 'build'>;
1087
+ options: TOptions$1['resolvedOptions'];
1088
1088
  schema: {
1089
1089
  name: string;
1090
1090
  tree: Array<Schema>;
1091
1091
  value: SchemaObject$1;
1092
1092
  };
1093
1093
  };
1094
- type GeneratorOptions<TOptions extends PluginFactoryOptions> = {
1094
+ type GeneratorOptions<TOptions$1 extends PluginFactoryOptions> = {
1095
1095
  name: string;
1096
- operations?: (this: GeneratorOptions<TOptions>, props: OperationsProps<TOptions>) => Promise<File[]>;
1097
- operation?: (this: GeneratorOptions<TOptions>, props: OperationProps<TOptions>) => Promise<File[]>;
1098
- schema?: (this: GeneratorOptions<TOptions>, props: SchemaProps<TOptions>) => Promise<File[]>;
1096
+ operations?: (this: GeneratorOptions<TOptions$1>, props: OperationsProps<TOptions$1>) => Promise<File[]>;
1097
+ operation?: (this: GeneratorOptions<TOptions$1>, props: OperationProps<TOptions$1>) => Promise<File[]>;
1098
+ schema?: (this: GeneratorOptions<TOptions$1>, props: SchemaProps<TOptions$1>) => Promise<File[]>;
1099
1099
  };
1100
- type Generator<TOptions extends PluginFactoryOptions> = GeneratorOptions<TOptions>;
1100
+ type Generator<TOptions$1 extends PluginFactoryOptions> = GeneratorOptions<TOptions$1>;
1101
1101
  //#endregion
1102
1102
  //#region ../plugin-oas/src/OperationGenerator.d.ts
1103
- type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
1103
+ type Context<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
1104
1104
  oas: Oas;
1105
1105
  exclude: Array<Exclude$1> | undefined;
1106
1106
  include: Array<Include> | undefined;
1107
- override: Array<Override<TOptions>> | undefined;
1107
+ override: Array<Override<TOptions$1>> | undefined;
1108
1108
  contentType: contentType | undefined;
1109
1109
  pluginManager: PluginManager;
1110
1110
  /**
@@ -1183,5 +1183,5 @@ type ResolvedOptions = {
1183
1183
  };
1184
1184
  type PluginCypress = PluginFactoryOptions<'plugin-cypress', Options$1, ResolvedOptions, never, ResolvePathOptions>;
1185
1185
  //#endregion
1186
- export { Generator, type HttpMethod, OperationSchemas, Options$1 as Options, PluginCypress, UserPluginWithLifeCycle };
1187
- //# sourceMappingURL=types-B8kwRVN5.d.ts.map
1186
+ export { UserPluginWithLifeCycle as a, OperationSchemas as i, PluginCypress as n, HttpMethod as o, Generator as r, Options$1 as t };
1187
+ //# sourceMappingURL=types-C0s4sqJf.d.ts.map
@@ -46,17 +46,17 @@ declare class Oas<const TOAS = unknown> extends BaseOas {
46
46
  * Abstract class that contains the building blocks for plugins to create their own Generator
47
47
  * @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137
48
48
  */
49
- declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
49
+ declare abstract class BaseGenerator<TOptions$1 = unknown, TContext = unknown> {
50
50
  #private;
51
- constructor(options?: TOptions, context?: TContext);
52
- get options(): TOptions;
51
+ constructor(options?: TOptions$1, context?: TContext);
52
+ get options(): TOptions$1;
53
53
  get context(): TContext;
54
- set options(options: TOptions);
54
+ set options(options: TOptions$1);
55
55
  abstract build(...params: unknown[]): unknown;
56
56
  }
57
57
  //#endregion
58
58
  //#region ../core/src/fs/types.d.ts
59
- type BasePath<T extends string = string> = `${T}/`;
59
+ type BasePath<T$1 extends string = string> = `${T$1}/`;
60
60
  type Import = {
61
61
  /**
62
62
  * Import name to be used
@@ -130,7 +130,7 @@ type BaseName = `${string}.${string}`;
130
130
  * Path will be full qualified path to a specified file
131
131
  */
132
132
  type Path = string;
133
- type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
133
+ type AdvancedPath<T$1 extends BaseName = BaseName> = `${BasePath}${T$1}`;
134
134
  type OptionalPath = Path | undefined | null;
135
135
  type File<TMeta extends object = object> = {
136
136
  /**
@@ -219,9 +219,9 @@ type Logger = {
219
219
  };
220
220
  //#endregion
221
221
  //#region ../core/src/utils/types.d.ts
222
- type PossiblePromise<T> = Promise<T> | T;
223
- type ArrayWithLength<T extends number, U extends any[] = []> = U['length'] extends T ? U : ArrayWithLength<T, [true, ...U]>;
224
- type GreaterThan<T extends number, U extends number> = ArrayWithLength<U> extends [...ArrayWithLength<T>, ...infer _] ? false : true;
222
+ type PossiblePromise<T$1> = Promise<T$1> | T$1;
223
+ type ArrayWithLength<T$1 extends number, U extends any[] = []> = U['length'] extends T$1 ? U : ArrayWithLength<T$1, [true, ...U]>;
224
+ type GreaterThan<T$1 extends number, U extends number> = ArrayWithLength<U> extends [...ArrayWithLength<T$1>, ...infer _] ? false : true;
225
225
  //#endregion
226
226
  //#region ../core/src/types.d.ts
227
227
  type InputPath = {
@@ -334,11 +334,11 @@ TName extends string = string,
334
334
  /**
335
335
  * Options of the plugin.
336
336
  */
337
- TOptions extends object = object,
337
+ TOptions$1 extends object = object,
338
338
  /**
339
339
  * Options of the plugin that can be used later on, see `options` inside your plugin config.
340
340
  */
341
- TResolvedOptions extends object = TOptions,
341
+ TResolvedOptions extends object = TOptions$1,
342
342
  /**
343
343
  * Context that you want to expose to other plugins.
344
344
  */
@@ -352,23 +352,23 @@ TResolvePathOptions extends object = object> = {
352
352
  * Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
353
353
  */
354
354
  key: PluginKey<TName | string>;
355
- options: TOptions;
355
+ options: TOptions$1;
356
356
  resolvedOptions: TResolvedOptions;
357
357
  context: TContext;
358
358
  resolvePathOptions: TResolvePathOptions;
359
359
  };
360
360
  type PluginKey<TName> = [name: TName, identifier?: string | number];
361
- type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
361
+ type UserPlugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
362
362
  /**
363
363
  * Unique name used for the plugin
364
364
  * The name of the plugin follows the format scope:foo-bar or foo-bar, adding scope: can avoid naming conflicts with other plugins.
365
365
  * @example @kubb/typescript
366
366
  */
367
- name: TOptions['name'];
367
+ name: TOptions$1['name'];
368
368
  /**
369
369
  * Options set for a specific plugin(see kubb.config.js), passthrough of options.
370
370
  */
371
- options: TOptions['resolvedOptions'];
371
+ options: TOptions$1['resolvedOptions'];
372
372
  /**
373
373
  * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
374
374
  * Can be used to validate dependent plugins.
@@ -378,23 +378,23 @@ type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> =
378
378
  * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin will be executed before these plugins.
379
379
  */
380
380
  post?: Array<string>;
381
- } & (TOptions['context'] extends never ? {
381
+ } & (TOptions$1['context'] extends never ? {
382
382
  context?: never;
383
383
  } : {
384
- context: (this: TOptions['name'] extends 'core' ? null : Omit<PluginContext<TOptions>, 'addFile'>) => TOptions['context'];
384
+ context: (this: TOptions$1['name'] extends 'core' ? null : Omit<PluginContext<TOptions$1>, 'addFile'>) => TOptions$1['context'];
385
385
  });
386
- type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>;
387
- type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
386
+ type UserPluginWithLifeCycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions$1> & PluginLifecycle<TOptions$1>;
387
+ type Plugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
388
388
  /**
389
389
  * Unique name used for the plugin
390
390
  * @example @kubb/typescript
391
391
  */
392
- name: TOptions['name'];
392
+ name: TOptions$1['name'];
393
393
  /**
394
394
  * Internal key used when a developer uses more than one of the same plugin
395
395
  * @private
396
396
  */
397
- key: TOptions['key'];
397
+ key: TOptions$1['key'];
398
398
  /**
399
399
  * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
400
400
  * Can be used to validate dependent plugins.
@@ -407,49 +407,49 @@ type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
407
407
  /**
408
408
  * Options set for a specific plugin(see kubb.config.js), passthrough of options.
409
409
  */
410
- options: TOptions['resolvedOptions'];
411
- } & (TOptions['context'] extends never ? {
410
+ options: TOptions$1['resolvedOptions'];
411
+ } & (TOptions$1['context'] extends never ? {
412
412
  context?: never;
413
413
  } : {
414
- context: TOptions['context'];
414
+ context: TOptions$1['context'];
415
415
  });
416
- type PluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions> & PluginLifecycle<TOptions>;
417
- type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
416
+ type PluginWithLifeCycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions$1> & PluginLifecycle<TOptions$1>;
417
+ type PluginLifecycle<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
418
418
  /**
419
419
  * Start of the lifecycle of a plugin.
420
420
  * @type hookParallel
421
421
  */
422
- buildStart?: (this: PluginContext<TOptions>, Config: Config) => PossiblePromise<void>;
422
+ buildStart?: (this: PluginContext<TOptions$1>, Config: Config) => PossiblePromise<void>;
423
423
  /**
424
424
  * Resolve to a Path based on a baseName(example: `./Pet.ts`) and directory(example: `./models`).
425
425
  * Options can als be included.
426
426
  * @type hookFirst
427
427
  * @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
428
428
  */
429
- resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
429
+ resolvePath?: (this: PluginContext<TOptions$1>, baseName: BaseName, mode?: Mode, options?: TOptions$1['resolvePathOptions']) => OptionalPath;
430
430
  /**
431
431
  * Resolve to a name based on a string.
432
432
  * Useful when converting to PascalCase or camelCase.
433
433
  * @type hookFirst
434
434
  * @example ('pet') => 'Pet'
435
435
  */
436
- resolveName?: (this: PluginContext<TOptions>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
436
+ resolveName?: (this: PluginContext<TOptions$1>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
437
437
  /**
438
438
  * End of the plugin lifecycle.
439
439
  * @type hookParallel
440
440
  */
441
- buildEnd?: (this: PluginContext<TOptions>) => PossiblePromise<void>;
441
+ buildEnd?: (this: PluginContext<TOptions$1>) => PossiblePromise<void>;
442
442
  };
443
443
  type PluginLifecycleHooks = keyof PluginLifecycle;
444
- type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
445
- type ResolvePathParams<TOptions = object> = {
444
+ type PluginParameter<H$1 extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H$1]>;
445
+ type ResolvePathParams<TOptions$1 = object> = {
446
446
  pluginKey?: Plugin['key'];
447
447
  baseName: BaseName;
448
448
  mode?: Mode;
449
449
  /**
450
450
  * Options to be passed to 'resolvePath' 3th parameter
451
451
  */
452
- options?: TOptions;
452
+ options?: TOptions$1;
453
453
  };
454
454
  type ResolveNameParams = {
455
455
  name: string;
@@ -462,12 +462,12 @@ type ResolveNameParams = {
462
462
  */
463
463
  type?: 'file' | 'function' | 'type' | 'const';
464
464
  };
465
- type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
465
+ type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
466
466
  config: Config;
467
467
  fileManager: FileManager;
468
468
  pluginManager: PluginManager;
469
469
  addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
470
- resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
470
+ resolvePath: (params: ResolvePathParams<TOptions$1['resolvePathOptions']>) => OptionalPath;
471
471
  resolveName: (params: ResolveNameParams) => string;
472
472
  logger: Logger;
473
473
  /**
@@ -477,12 +477,12 @@ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
477
477
  /**
478
478
  * Current plugin
479
479
  */
480
- plugin: Plugin<TOptions>;
480
+ plugin: Plugin<TOptions$1>;
481
481
  };
482
482
  /**
483
483
  * Specify the export location for the files and define the behavior of the output
484
484
  */
485
- type Output<TOptions> = {
485
+ type Output<TOptions$1> = {
486
486
  /**
487
487
  * Path to the output folder or file that will contain the generated code
488
488
  */
@@ -495,11 +495,11 @@ type Output<TOptions> = {
495
495
  /**
496
496
  * Add a banner text in the beginning of every file
497
497
  */
498
- banner?: string | ((options: TOptions) => string);
498
+ banner?: string | ((options: TOptions$1) => string);
499
499
  /**
500
500
  * Add a footer text in the beginning of every file
501
501
  */
502
- footer?: string | ((options: TOptions) => string);
502
+ footer?: string | ((options: TOptions$1) => string);
503
503
  };
504
504
  type GroupContext = {
505
505
  group: string;
@@ -519,7 +519,7 @@ type Group = {
519
519
  type FileMetaBase = {
520
520
  pluginKey?: Plugin['key'];
521
521
  };
522
- type AddResult<T extends Array<File>> = Promise<Awaited<GreaterThan<T['length'], 1> extends true ? Promise<ResolvedFile[]> : Promise<ResolvedFile>>>;
522
+ type AddResult<T$1 extends Array<File>> = Promise<Awaited<GreaterThan<T$1['length'], 1> extends true ? Promise<ResolvedFile[]> : Promise<ResolvedFile>>>;
523
523
  type AddIndexesProps = {
524
524
  type: BarrelType | false | undefined;
525
525
  /**
@@ -572,16 +572,16 @@ declare class FileManager {
572
572
  //#region ../core/src/PluginManager.d.ts
573
573
  type RequiredPluginLifecycle = Required<PluginLifecycle>;
574
574
  type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
575
- type Executer<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
575
+ type Executer<H$1 extends PluginLifecycleHooks = PluginLifecycleHooks> = {
576
576
  message: string;
577
577
  strategy: Strategy;
578
- hookName: H;
578
+ hookName: H$1;
579
579
  plugin: Plugin;
580
580
  parameters?: unknown[] | undefined;
581
581
  output?: unknown;
582
582
  };
583
- type ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H];
584
- type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {
583
+ type ParseResult<H$1 extends PluginLifecycleHooks> = RequiredPluginLifecycle[H$1];
584
+ type SafeParseResult<H$1 extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H$1>>> = {
585
585
  result: Result;
586
586
  plugin: Plugin;
587
587
  };
@@ -597,12 +597,12 @@ type Events = {
597
597
  executed: [executer: Executer];
598
598
  error: [error: Error];
599
599
  };
600
- type GetFileProps<TOptions = object> = {
600
+ type GetFileProps<TOptions$1 = object> = {
601
601
  name: string;
602
602
  mode?: Mode;
603
603
  extname: Extname;
604
604
  pluginKey: Plugin['key'];
605
- options?: TOptions;
605
+ options?: TOptions$1;
606
606
  };
607
607
  declare class PluginManager {
608
608
  #private;
@@ -1008,12 +1008,12 @@ type ByContentType = {
1008
1008
  };
1009
1009
  type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
1010
1010
  type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
1011
- type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
1012
- options: Partial<TOptions>;
1011
+ type Override<TOptions$1> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
1012
+ options: Partial<TOptions$1>;
1013
1013
  };
1014
1014
  //#endregion
1015
1015
  //#region ../plugin-oas/src/SchemaGenerator.d.ts
1016
- type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
1016
+ type Context$1<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
1017
1017
  oas: Oas;
1018
1018
  pluginManager: PluginManager;
1019
1019
  /**
@@ -1022,7 +1022,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
1022
1022
  plugin: Plugin<TPluginOptions>;
1023
1023
  mode: Mode;
1024
1024
  include?: Array<'schemas' | 'responses' | 'requestBodies'>;
1025
- override: Array<Override<TOptions>> | undefined;
1025
+ override: Array<Override<TOptions$1>> | undefined;
1026
1026
  contentType?: contentType;
1027
1027
  output?: string;
1028
1028
  };
@@ -1053,7 +1053,7 @@ type SchemaProps$1 = {
1053
1053
  name?: string;
1054
1054
  parentName?: string;
1055
1055
  };
1056
- declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context$1<TOptions, TPluginOptions>> {
1056
+ declare class SchemaGenerator<TOptions$1 extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions$1, Context$1<TOptions$1, TPluginOptions>> {
1057
1057
  #private;
1058
1058
  refs: Refs;
1059
1059
  /**
@@ -1072,39 +1072,39 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
1072
1072
  }
1073
1073
  //#endregion
1074
1074
  //#region ../plugin-oas/src/generator.d.ts
1075
- type OperationsProps<TOptions extends PluginFactoryOptions> = {
1076
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
1077
- options: TOptions['resolvedOptions'];
1075
+ type OperationsProps<TOptions$1 extends PluginFactoryOptions> = {
1076
+ instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
1077
+ options: TOptions$1['resolvedOptions'];
1078
1078
  operations: Array<Operation$1>;
1079
1079
  };
1080
- type OperationProps<TOptions extends PluginFactoryOptions> = {
1081
- instance: Omit<OperationGenerator<TOptions>, 'build'>;
1082
- options: TOptions['resolvedOptions'];
1080
+ type OperationProps<TOptions$1 extends PluginFactoryOptions> = {
1081
+ instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
1082
+ options: TOptions$1['resolvedOptions'];
1083
1083
  operation: Operation$1;
1084
1084
  };
1085
- type SchemaProps<TOptions extends PluginFactoryOptions> = {
1086
- instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
1087
- options: TOptions['resolvedOptions'];
1085
+ type SchemaProps<TOptions$1 extends PluginFactoryOptions> = {
1086
+ instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions$1>, 'build'>;
1087
+ options: TOptions$1['resolvedOptions'];
1088
1088
  schema: {
1089
1089
  name: string;
1090
1090
  tree: Array<Schema>;
1091
1091
  value: SchemaObject$1;
1092
1092
  };
1093
1093
  };
1094
- type GeneratorOptions<TOptions extends PluginFactoryOptions> = {
1094
+ type GeneratorOptions<TOptions$1 extends PluginFactoryOptions> = {
1095
1095
  name: string;
1096
- operations?: (this: GeneratorOptions<TOptions>, props: OperationsProps<TOptions>) => Promise<File[]>;
1097
- operation?: (this: GeneratorOptions<TOptions>, props: OperationProps<TOptions>) => Promise<File[]>;
1098
- schema?: (this: GeneratorOptions<TOptions>, props: SchemaProps<TOptions>) => Promise<File[]>;
1096
+ operations?: (this: GeneratorOptions<TOptions$1>, props: OperationsProps<TOptions$1>) => Promise<File[]>;
1097
+ operation?: (this: GeneratorOptions<TOptions$1>, props: OperationProps<TOptions$1>) => Promise<File[]>;
1098
+ schema?: (this: GeneratorOptions<TOptions$1>, props: SchemaProps<TOptions$1>) => Promise<File[]>;
1099
1099
  };
1100
- type Generator<TOptions extends PluginFactoryOptions> = GeneratorOptions<TOptions>;
1100
+ type Generator<TOptions$1 extends PluginFactoryOptions> = GeneratorOptions<TOptions$1>;
1101
1101
  //#endregion
1102
1102
  //#region ../plugin-oas/src/OperationGenerator.d.ts
1103
- type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
1103
+ type Context<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
1104
1104
  oas: Oas;
1105
1105
  exclude: Array<Exclude$1> | undefined;
1106
1106
  include: Array<Include> | undefined;
1107
- override: Array<Override<TOptions>> | undefined;
1107
+ override: Array<Override<TOptions$1>> | undefined;
1108
1108
  contentType: contentType | undefined;
1109
1109
  pluginManager: PluginManager;
1110
1110
  /**
@@ -1183,5 +1183,5 @@ type ResolvedOptions = {
1183
1183
  };
1184
1184
  type PluginCypress = PluginFactoryOptions<'plugin-cypress', Options$1, ResolvedOptions, never, ResolvePathOptions>;
1185
1185
  //#endregion
1186
- export { Generator, type HttpMethod, OperationSchemas, Options$1 as Options, PluginCypress, UserPluginWithLifeCycle };
1187
- //# sourceMappingURL=types-rlD4akES.d.cts.map
1186
+ export { UserPluginWithLifeCycle as a, OperationSchemas as i, PluginCypress as n, HttpMethod as o, Generator as r, Options$1 as t };
1187
+ //# sourceMappingURL=types-CpA-hLRj.d.cts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-cypress",
3
- "version": "4.1.3",
3
+ "version": "4.2.0",
4
4
  "description": "Cypress test generator plugin for Kubb, creating end-to-end tests from OpenAPI specifications for automated API testing.",
5
5
  "keywords": [
6
6
  "cypress",
@@ -67,16 +67,14 @@
67
67
  "!/**/__tests__/**"
68
68
  ],
69
69
  "dependencies": {
70
- "@kubb/core": "4.1.3",
71
- "@kubb/oas": "4.1.3",
72
- "@kubb/plugin-oas": "4.1.3",
73
- "@kubb/plugin-ts": "4.1.3",
74
- "@kubb/react": "4.1.3"
70
+ "@kubb/core": "4.2.0",
71
+ "@kubb/oas": "4.2.0",
72
+ "@kubb/plugin-oas": "4.2.0",
73
+ "@kubb/plugin-ts": "4.2.0",
74
+ "@kubb/react": "4.2.0"
75
75
  },
76
76
  "devDependencies": {
77
- "@types/react": "^18.3.26",
78
- "react": "^18.3.1",
79
- "tsdown": "^0.15.7",
77
+ "tsdown": "^0.15.9",
80
78
  "typescript": "^5.9.3"
81
79
  },
82
80
  "peerDependencies": {
@@ -1,9 +1,8 @@
1
- import { File, Function, FunctionParams } from '@kubb/react'
1
+ import { URLPath } from '@kubb/core/utils'
2
2
 
3
3
  import { type HttpMethod, isOptional } from '@kubb/oas'
4
- import type { ReactNode } from 'react'
5
- import { URLPath } from '@kubb/core/utils'
6
4
  import type { OperationSchemas } from '@kubb/plugin-oas'
5
+ import { File, Function, FunctionParams } from '@kubb/react'
7
6
  import type { PluginCypress } from '../types.ts'
8
7
 
9
8
  type Props = {
@@ -18,7 +17,7 @@ type Props = {
18
17
  method: HttpMethod
19
18
  }
20
19
 
21
- export function Request({ baseURL = '', name, dataReturnType, typeSchemas, url, method }: Props): ReactNode {
20
+ export function Request({ baseURL = '', name, dataReturnType, typeSchemas, url, method }: Props) {
22
21
  const params = FunctionParams.factory({
23
22
  data: typeSchemas.request?.name
24
23
  ? {
@@ -1,9 +1,10 @@
1
+ import { usePlugin, usePluginManager } from '@kubb/core/hooks'
1
2
  import { URLPath } from '@kubb/core/utils'
2
3
  import { createReactGenerator } from '@kubb/plugin-oas'
3
4
  import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'
4
5
  import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
5
6
  import { pluginTsName } from '@kubb/plugin-ts'
6
- import { File, useApp } from '@kubb/react'
7
+ import { File } from '@kubb/react'
7
8
  import { Request } from '../components'
8
9
  import type { PluginCypress } from '../types'
9
10
 
@@ -11,11 +12,10 @@ export const cypressGenerator = createReactGenerator<PluginCypress>({
11
12
  name: 'cypress',
12
13
  Operation({ operation }) {
13
14
  const {
14
- pluginManager,
15
- plugin: {
16
- options: { output, baseURL, dataReturnType },
17
- },
18
- } = useApp<PluginCypress>()
15
+ options: { output, baseURL, dataReturnType },
16
+ } = usePlugin<PluginCypress>()
17
+ const pluginManager = usePluginManager()
18
+
19
19
  const oas = useOas()
20
20
  const { getSchemas, getName, getFile } = useOperationManager()
21
21
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"components-jRFHC_sv.js","names":[],"sources":["../src/components/Request.tsx"],"sourcesContent":["import { File, Function, FunctionParams } from '@kubb/react'\n\nimport { type HttpMethod, isOptional } from '@kubb/oas'\nimport type { ReactNode } from 'react'\nimport { URLPath } from '@kubb/core/utils'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\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 method: HttpMethod\n}\n\nexport function Request({ baseURL = '', name, dataReturnType, typeSchemas, url, method }: Props): ReactNode {\n const params = FunctionParams.factory({\n data: typeSchemas.request?.name\n ? {\n type: typeSchemas.request?.name,\n optional: isOptional(typeSchemas.request?.schema),\n }\n : undefined,\n })\n\n const returnType =\n dataReturnType === 'data' ? `Cypress.Chainable<${typeSchemas.response.name}>` : `Cypress.Chainable<Cypress.Response<${typeSchemas.response.name}>>`\n\n const body = typeSchemas.request?.name ? 'data' : undefined\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('${method}', '${baseURL ?? ''}${new URLPath(url).toURLPath().replace(/([^/]):/g, '$1\\\\\\\\:')}', ${body}).then((res: Cypress.Response<${typeSchemas.response.name}>) => res.body)`}\n {dataReturnType === 'full' && `return cy.request('${method}', '${new URLPath(`${baseURL ?? ''}${url}`).toURLPath()}', ${body})`}\n </Function>\n </File.Source>\n )\n}\n"],"mappings":";;;;;;AAoBA,SAAgB,QAAQ,EAAE,UAAU,IAAI,MAAM,gBAAgB,aAAa,KAAK,UAA4B;CAC1G,MAAM,SAAS,eAAe,QAAQ,EACpC,MAAM,YAAY,SAAS,OACvB;EACE,MAAM,YAAY,SAAS;EAC3B,UAAU,WAAW,YAAY,SAAS,OAAO;EAClD,GACD,QACL,CAAC;CAEF,MAAM,aACJ,mBAAmB,SAAS,qBAAqB,YAAY,SAAS,KAAK,KAAK,sCAAsC,YAAY,SAAS,KAAK;CAElJ,MAAM,OAAO,YAAY,SAAS,OAAO,SAAS;AAElD,QACE,oBAAC,KAAK;EAAa;EAAM;EAAY;YACnC,qBAAC;GAAe;GAAM;GAAO,QAAQ,OAAO,eAAe;GAAc;cACtE,mBAAmB,UAClB,sBAAsB,OAAO,MAAM,WAAW,KAAK,IAAI,QAAQ,IAAI,CAAC,WAAW,CAAC,QAAQ,YAAY,UAAU,CAAC,KAAK,KAAK,gCAAgC,YAAY,SAAS,KAAK,kBACpL,mBAAmB,UAAU,sBAAsB,OAAO,MAAM,IAAI,QAAQ,GAAG,WAAW,KAAK,MAAM,CAAC,WAAW,CAAC,KAAK,KAAK;IACpH;GACC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"generators-Dg1pCFZB.cjs","names":["pluginTsName","File","Request","URLPath"],"sources":["../src/generators/cypressGenerator.tsx"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport { Request } from '../components'\nimport type { PluginCypress } from '../types'\n\nexport const cypressGenerator = createReactGenerator<PluginCypress>({\n name: 'cypress',\n Operation({ operation }) {\n const {\n pluginManager,\n plugin: {\n options: { output, baseURL, dataReturnType },\n },\n } = useApp<PluginCypress>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const request = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n return (\n <File\n baseName={request.file.baseName}\n path={request.file.path}\n meta={request.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={request.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <Request\n name={request.name}\n dataReturnType={dataReturnType}\n typeSchemas={type.schemas}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;AASA,MAAa,+DAAuD;CAClE,MAAM;CACN,UAAU,EAAE,aAAa;EACvB,MAAM,EACJ,eACA,QAAQ,EACN,SAAS,EAAE,QAAQ,SAAS,iDAEL;EAC3B,MAAM,2CAAc;EACpB,MAAM,EAAE,YAAY,SAAS,8DAAiC;EAE9D,MAAM,UAAU;GACd,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;GAC9C,MAAM,QAAQ,UAAU;GACzB;EAED,MAAM,OAAO;GACX,MAAM,QAAQ,WAAW,EAAE,WAAW,CAACA,8BAAa,EAAE,CAAC;GACvD,SAAS,WAAW,WAAW;IAAE,WAAW,CAACA,8BAAa;IAAE,MAAM;IAAQ,CAAC;GAC5E;AAED,SACE,mDAACC;GACC,UAAU,QAAQ,KAAK;GACvB,MAAM,QAAQ,KAAK;GACnB,MAAM,QAAQ,KAAK;GACnB,+CAAkB;IAAE;IAAK;IAAQ,QAAQ,cAAc;IAAQ,CAAC;GAChE,+CAAkB;IAAE;IAAK;IAAQ,CAAC;cAElC,kDAACA,kBAAK;IACJ,MAAM;KACJ,KAAK,QAAQ,SAAS;KACtB,KAAK,QAAQ,SAAS;KACtB,KAAK,QAAQ,YAAY;KACzB,KAAK,QAAQ,aAAa;KAC1B,KAAK,QAAQ,cAAc;KAC3B,GAAI,KAAK,QAAQ,aAAa,KAAK,SAAS,KAAK,KAAK,IAAI,EAAE;KAC7D,CAAC,OAAO,QAAQ;IACjB,MAAM,QAAQ,KAAK;IACnB,MAAM,KAAK,KAAK;IAChB;KACA,EACF,kDAACC;IACC,MAAM,QAAQ;IACE;IAChB,aAAa,KAAK;IAClB,QAAQ,UAAU;IACT;IACT,KAAK,IAAIC,0BAAQ,UAAU,KAAK,CAAC,WAAW;KAC5C;IACG;;CAGZ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"generators-aYB5ZkVA.js","names":[],"sources":["../src/generators/cypressGenerator.tsx"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport { Request } from '../components'\nimport type { PluginCypress } from '../types'\n\nexport const cypressGenerator = createReactGenerator<PluginCypress>({\n name: 'cypress',\n Operation({ operation }) {\n const {\n pluginManager,\n plugin: {\n options: { output, baseURL, dataReturnType },\n },\n } = useApp<PluginCypress>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const request = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n return (\n <File\n baseName={request.file.baseName}\n path={request.file.path}\n meta={request.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={request.file.path}\n path={type.file.path}\n isTypeOnly\n />\n <Request\n name={request.name}\n dataReturnType={dataReturnType}\n typeSchemas={type.schemas}\n method={operation.method}\n baseURL={baseURL}\n url={new URLPath(operation.path).toURLPath()}\n />\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;AASA,MAAa,mBAAmB,qBAAoC;CAClE,MAAM;CACN,UAAU,EAAE,aAAa;EACvB,MAAM,EACJ,eACA,QAAQ,EACN,SAAS,EAAE,QAAQ,SAAS,uBAE5B,QAAuB;EAC3B,MAAM,MAAM,QAAQ;EACpB,MAAM,EAAE,YAAY,SAAS,YAAY,qBAAqB;EAE9D,MAAM,UAAU;GACd,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;GAC9C,MAAM,QAAQ,UAAU;GACzB;EAED,MAAM,OAAO;GACX,MAAM,QAAQ,WAAW,EAAE,WAAW,CAAC,aAAa,EAAE,CAAC;GACvD,SAAS,WAAW,WAAW;IAAE,WAAW,CAAC,aAAa;IAAE,MAAM;IAAQ,CAAC;GAC5E;AAED,SACE,qBAAC;GACC,UAAU,QAAQ,KAAK;GACvB,MAAM,QAAQ,KAAK;GACnB,MAAM,QAAQ,KAAK;GACnB,QAAQ,UAAU;IAAE;IAAK;IAAQ,QAAQ,cAAc;IAAQ,CAAC;GAChE,QAAQ,UAAU;IAAE;IAAK;IAAQ,CAAC;cAElC,oBAAC,KAAK;IACJ,MAAM;KACJ,KAAK,QAAQ,SAAS;KACtB,KAAK,QAAQ,SAAS;KACtB,KAAK,QAAQ,YAAY;KACzB,KAAK,QAAQ,aAAa;KAC1B,KAAK,QAAQ,cAAc;KAC3B,GAAI,KAAK,QAAQ,aAAa,KAAK,SAAS,KAAK,KAAK,IAAI,EAAE;KAC7D,CAAC,OAAO,QAAQ;IACjB,MAAM,QAAQ,KAAK;IACnB,MAAM,KAAK,KAAK;IAChB;KACA,EACF,oBAAC;IACC,MAAM,QAAQ;IACE;IAChB,aAAa,KAAK;IAClB,QAAQ,UAAU;IACT;IACT,KAAK,IAAI,QAAQ,UAAU,KAAK,CAAC,WAAW;KAC5C;IACG;;CAGZ,CAAC"}