@kubb/plugin-cypress 4.5.7 → 4.5.9

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.
@@ -27,4 +27,4 @@ function Request({ baseURL = "", name, dataReturnType, typeSchemas, url, method
27
27
 
28
28
  //#endregion
29
29
  export { Request as t };
30
- //# sourceMappingURL=components-Cs-85WSv.js.map
30
+ //# sourceMappingURL=components-ymS8Xg61.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components-Cs-85WSv.js","names":[],"sources":["../src/components/Request.tsx"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport { type HttpMethod, isOptional } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } 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 method: HttpMethod\n}\n\nexport function Request({ baseURL = '', name, dataReturnType, typeSchemas, url, method }: Props): KubbNode {\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,UAA2B;CACzG,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
+ {"version":3,"file":"components-ymS8Xg61.js","names":[],"sources":["../src/components/Request.tsx"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\nimport { type HttpMethod, isOptional } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } 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 method: HttpMethod\n}\n\nexport function Request({ baseURL = '', name, dataReturnType, typeSchemas, url, method }: Props): KubbNode {\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,UAA2B;CACzG,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,4 +1,4 @@
1
- import { i as OperationSchemas, n as PluginCypress, o as HttpMethod } from "./types-DVje6w9z.cjs";
1
+ import { i as OperationSchemas, n as PluginCypress, o as HttpMethod } from "./types-pv7xIlug.cjs";
2
2
  import { KubbNode } from "@kubb/react-fabric/types";
3
3
 
4
4
  //#region src/components/Request.d.ts
@@ -1,4 +1,4 @@
1
- import { i as OperationSchemas, n as PluginCypress, o as HttpMethod } from "./types-DbU-_Igx.js";
1
+ import { i as OperationSchemas, n as PluginCypress, o as HttpMethod } from "./types-BQqMO_rX.js";
2
2
  import { KubbNode } from "@kubb/react-fabric/types";
3
3
 
4
4
  //#region src/components/Request.d.ts
@@ -1,3 +1,3 @@
1
- import { t as Request } from "./components-Cs-85WSv.js";
1
+ import { t as Request } from "./components-ymS8Xg61.js";
2
2
 
3
3
  export { Request };
@@ -1,4 +1,4 @@
1
- import { t as Request } from "./components-Cs-85WSv.js";
1
+ import { t as Request } from "./components-ymS8Xg61.js";
2
2
  import { pluginTsName } from "@kubb/plugin-ts";
3
3
  import { usePluginManager } from "@kubb/core/hooks";
4
4
  import { URLPath } from "@kubb/core/utils";
@@ -66,4 +66,4 @@ const cypressGenerator = createReactGenerator({
66
66
 
67
67
  //#endregion
68
68
  export { cypressGenerator as t };
69
- //# sourceMappingURL=generators-CRS7mkLj.js.map
69
+ //# sourceMappingURL=generators-CM2ebFNm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generators-CRS7mkLj.js","names":[],"sources":["../src/generators/cypressGenerator.tsx"],"sourcesContent":["import { usePluginManager } from '@kubb/core/hooks'\nimport { URLPath } from '@kubb/core/utils'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\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-fabric'\nimport { Request } from '../components'\nimport type { PluginCypress } from '../types'\n\nexport const cypressGenerator = createReactGenerator<PluginCypress>({\n name: 'cypress',\n Operation({ operation, generator, plugin }) {\n const {\n options: { output, baseURL, dataReturnType },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\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,WAAW,WAAW,UAAU;EAC1C,MAAM,EACJ,SAAS,EAAE,QAAQ,SAAS,qBAC1B;EACJ,MAAM,gBAAgB,kBAAkB;EAExC,MAAM,MAAM,QAAQ;EACpB,MAAM,EAAE,YAAY,SAAS,YAAY,oBAAoB,UAAU;EAEvE,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
+ {"version":3,"file":"generators-CM2ebFNm.js","names":[],"sources":["../src/generators/cypressGenerator.tsx"],"sourcesContent":["import { usePluginManager } from '@kubb/core/hooks'\nimport { URLPath } from '@kubb/core/utils'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\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-fabric'\nimport { Request } from '../components'\nimport type { PluginCypress } from '../types'\n\nexport const cypressGenerator = createReactGenerator<PluginCypress>({\n name: 'cypress',\n Operation({ operation, generator, plugin }) {\n const {\n options: { output, baseURL, dataReturnType },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\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,WAAW,WAAW,UAAU;EAC1C,MAAM,EACJ,SAAS,EAAE,QAAQ,SAAS,qBAC1B;EACJ,MAAM,gBAAgB,kBAAkB;EAExC,MAAM,MAAM,QAAQ;EACpB,MAAM,EAAE,YAAY,SAAS,YAAY,oBAAoB,UAAU;EAEvE,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
- import { n as PluginCypress, r as ReactGenerator } from "./types-DVje6w9z.cjs";
1
+ import { n as PluginCypress, r as ReactGenerator } from "./types-pv7xIlug.cjs";
2
2
 
3
3
  //#region src/generators/cypressGenerator.d.ts
4
4
  declare const cypressGenerator: ReactGenerator<PluginCypress>;
@@ -1,4 +1,4 @@
1
- import { n as PluginCypress, r as ReactGenerator } from "./types-DbU-_Igx.js";
1
+ import { n as PluginCypress, r as ReactGenerator } from "./types-BQqMO_rX.js";
2
2
 
3
3
  //#region src/generators/cypressGenerator.d.ts
4
4
  declare const cypressGenerator: ReactGenerator<PluginCypress>;
@@ -1,4 +1,4 @@
1
- import "./components-Cs-85WSv.js";
2
- import { t as cypressGenerator } from "./generators-CRS7mkLj.js";
1
+ import "./components-ymS8Xg61.js";
2
+ import { t as cypressGenerator } from "./generators-CM2ebFNm.js";
3
3
 
4
4
  export { cypressGenerator };
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-DVje6w9z.cjs";
1
+ import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-pv7xIlug.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 { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-DbU-_Igx.js";
1
+ import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-BQqMO_rX.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-Cs-85WSv.js";
2
- import { t as cypressGenerator } from "./generators-CRS7mkLj.js";
1
+ import "./components-ymS8Xg61.js";
2
+ import { t as cypressGenerator } from "./generators-CM2ebFNm.js";
3
3
  import path from "node:path";
4
4
  import { definePlugin, getBarrelFiles, getMode } from "@kubb/core";
5
5
  import { camelCase } from "@kubb/core/transformers";
@@ -1054,4 +1054,4 @@ type ResolvedOptions = {
1054
1054
  type PluginCypress = PluginFactoryOptions<'plugin-cypress', Options$1, ResolvedOptions, never, ResolvePathOptions>;
1055
1055
  //#endregion
1056
1056
  export { UserPluginWithLifeCycle as a, OperationSchemas as i, PluginCypress as n, HttpMethod as o, ReactGenerator as r, Options$1 as t };
1057
- //# sourceMappingURL=types-DbU-_Igx.d.ts.map
1057
+ //# sourceMappingURL=types-BQqMO_rX.d.ts.map
@@ -1054,4 +1054,4 @@ type ResolvedOptions = {
1054
1054
  type PluginCypress = PluginFactoryOptions<'plugin-cypress', Options$1, ResolvedOptions, never, ResolvePathOptions>;
1055
1055
  //#endregion
1056
1056
  export { UserPluginWithLifeCycle as a, OperationSchemas as i, PluginCypress as n, HttpMethod as o, ReactGenerator as r, Options$1 as t };
1057
- //# sourceMappingURL=types-DVje6w9z.d.cts.map
1057
+ //# sourceMappingURL=types-pv7xIlug.d.cts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-cypress",
3
- "version": "4.5.7",
3
+ "version": "4.5.9",
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",
@@ -74,11 +74,11 @@
74
74
  }
75
75
  ],
76
76
  "dependencies": {
77
- "@kubb/react-fabric": "0.2.19",
78
- "@kubb/core": "4.5.7",
79
- "@kubb/oas": "4.5.7",
80
- "@kubb/plugin-oas": "4.5.7",
81
- "@kubb/plugin-ts": "4.5.7"
77
+ "@kubb/react-fabric": "0.3.1",
78
+ "@kubb/core": "4.5.9",
79
+ "@kubb/oas": "4.5.9",
80
+ "@kubb/plugin-oas": "4.5.9",
81
+ "@kubb/plugin-ts": "4.5.9"
82
82
  },
83
83
  "engines": {
84
84
  "node": ">=20"
File without changes