@kubb/plugin-cypress 4.4.0 → 4.5.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.
@@ -1,4 +1,4 @@
1
- import { n as PluginCypress, o as HttpMethod, r as OperationSchemas } from "./types-BOoil2LF.cjs";
1
+ import { i as OperationSchemas, n as PluginCypress, o as HttpMethod } from "./types-C36mkyaA.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 { n as PluginCypress, o as HttpMethod, r as OperationSchemas } from "./types-D6SVPqai.js";
1
+ import { i as OperationSchemas, n as PluginCypress, o as HttpMethod } from "./types-Da3VNOH7.js";
2
2
  import { KubbNode } from "@kubb/react-fabric/types";
3
3
 
4
4
  //#region src/components/Request.d.ts
@@ -1,8 +1,8 @@
1
1
  import { t as Request } from "./components-Cs-85WSv.js";
2
- import { createReactGenerator } from "@kubb/plugin-oas";
3
2
  import { pluginTsName } from "@kubb/plugin-ts";
4
- import { usePlugin, usePluginManager } from "@kubb/core/hooks";
3
+ import { usePluginManager } from "@kubb/core/hooks";
5
4
  import { URLPath } from "@kubb/core/utils";
5
+ import { createReactGenerator } from "@kubb/plugin-oas/generators";
6
6
  import { useOas, useOperationManager } from "@kubb/plugin-oas/hooks";
7
7
  import { getBanner, getFooter } from "@kubb/plugin-oas/utils";
8
8
  import { File } from "@kubb/react-fabric";
@@ -11,11 +11,11 @@ import { jsx, jsxs } from "@kubb/react-fabric/jsx-runtime";
11
11
  //#region src/generators/cypressGenerator.tsx
12
12
  const cypressGenerator = createReactGenerator({
13
13
  name: "cypress",
14
- Operation({ operation }) {
15
- const { options: { output, baseURL, dataReturnType } } = usePlugin();
14
+ Operation({ operation, generator, plugin }) {
15
+ const { options: { output, baseURL, dataReturnType } } = plugin;
16
16
  const pluginManager = usePluginManager();
17
17
  const oas = useOas();
18
- const { getSchemas, getName, getFile } = useOperationManager();
18
+ const { getSchemas, getName, getFile } = useOperationManager(generator);
19
19
  const request = {
20
20
  name: getName(operation, { type: "function" }),
21
21
  file: getFile(operation)
@@ -66,4 +66,4 @@ const cypressGenerator = createReactGenerator({
66
66
 
67
67
  //#endregion
68
68
  export { cypressGenerator as t };
69
- //# sourceMappingURL=generators-CfF-r6zR.js.map
69
+ //# sourceMappingURL=generators-CRS7mkLj.js.map
@@ -0,0 +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,12 +1,12 @@
1
1
  const require_components = require('./components-CDWcq6eX.cjs');
2
- let __kubb_plugin_oas = require("@kubb/plugin-oas");
3
- __kubb_plugin_oas = require_components.__toESM(__kubb_plugin_oas);
4
2
  let __kubb_plugin_ts = require("@kubb/plugin-ts");
5
3
  __kubb_plugin_ts = require_components.__toESM(__kubb_plugin_ts);
6
4
  let __kubb_core_hooks = require("@kubb/core/hooks");
7
5
  __kubb_core_hooks = require_components.__toESM(__kubb_core_hooks);
8
6
  let __kubb_core_utils = require("@kubb/core/utils");
9
7
  __kubb_core_utils = require_components.__toESM(__kubb_core_utils);
8
+ let __kubb_plugin_oas_generators = require("@kubb/plugin-oas/generators");
9
+ __kubb_plugin_oas_generators = require_components.__toESM(__kubb_plugin_oas_generators);
10
10
  let __kubb_plugin_oas_hooks = require("@kubb/plugin-oas/hooks");
11
11
  __kubb_plugin_oas_hooks = require_components.__toESM(__kubb_plugin_oas_hooks);
12
12
  let __kubb_plugin_oas_utils = require("@kubb/plugin-oas/utils");
@@ -17,13 +17,13 @@ let __kubb_react_fabric_jsx_runtime = require("@kubb/react-fabric/jsx-runtime");
17
17
  __kubb_react_fabric_jsx_runtime = require_components.__toESM(__kubb_react_fabric_jsx_runtime);
18
18
 
19
19
  //#region src/generators/cypressGenerator.tsx
20
- const cypressGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
20
+ const cypressGenerator = (0, __kubb_plugin_oas_generators.createReactGenerator)({
21
21
  name: "cypress",
22
- Operation({ operation }) {
23
- const { options: { output, baseURL, dataReturnType } } = (0, __kubb_core_hooks.usePlugin)();
22
+ Operation({ operation, generator, plugin }) {
23
+ const { options: { output, baseURL, dataReturnType } } = plugin;
24
24
  const pluginManager = (0, __kubb_core_hooks.usePluginManager)();
25
25
  const oas = (0, __kubb_plugin_oas_hooks.useOas)();
26
- const { getSchemas, getName, getFile } = (0, __kubb_plugin_oas_hooks.useOperationManager)();
26
+ const { getSchemas, getName, getFile } = (0, __kubb_plugin_oas_hooks.useOperationManager)(generator);
27
27
  const request = {
28
28
  name: getName(operation, { type: "function" }),
29
29
  file: getFile(operation)
@@ -79,4 +79,4 @@ Object.defineProperty(exports, 'cypressGenerator', {
79
79
  return cypressGenerator;
80
80
  }
81
81
  });
82
- //# sourceMappingURL=generators-CKKLK5ah.cjs.map
82
+ //# sourceMappingURL=generators-UzSX0BDU.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generators-UzSX0BDU.cjs","names":["pluginTsName","File","Request","URLPath"],"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,0EAAuD;CAClE,MAAM;CACN,UAAU,EAAE,WAAW,WAAW,UAAU;EAC1C,MAAM,EACJ,SAAS,EAAE,QAAQ,SAAS,qBAC1B;EACJ,MAAM,yDAAkC;EAExC,MAAM,2CAAc;EACpB,MAAM,EAAE,YAAY,SAAS,6DAAgC,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,CAACA,8BAAa,EAAE,CAAC;GACvD,SAAS,WAAW,WAAW;IAAE,WAAW,CAACA,8BAAa;IAAE,MAAM;IAAQ,CAAC;GAC5E;AAED,SACE,0DAACC;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,yDAACA,yBAAK;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,yDAACC;IACC,MAAM,QAAQ;IACE;IAChB,aAAa,KAAK;IAClB,QAAQ,UAAU;IACT;IACT,KAAK,IAAIC,0BAAQ,UAAU,KAAK,CAAC,WAAW;KAC5C;IACG;;CAGZ,CAAC"}
@@ -1,4 +1,4 @@
1
1
  require('./components-CDWcq6eX.cjs');
2
- const require_generators = require('./generators-CKKLK5ah.cjs');
2
+ const require_generators = require('./generators-UzSX0BDU.cjs');
3
3
 
4
4
  exports.cypressGenerator = require_generators.cypressGenerator;
@@ -1,4 +1,4 @@
1
- import { i as ReactGenerator, n as PluginCypress } from "./types-BOoil2LF.cjs";
1
+ import { n as PluginCypress, r as ReactGenerator } from "./types-C36mkyaA.cjs";
2
2
 
3
3
  //#region src/generators/cypressGenerator.d.ts
4
4
  declare const cypressGenerator: ReactGenerator<PluginCypress>;
@@ -1,4 +1,4 @@
1
- import { i as ReactGenerator, n as PluginCypress } from "./types-D6SVPqai.js";
1
+ import { n as PluginCypress, r as ReactGenerator } from "./types-Da3VNOH7.js";
2
2
 
3
3
  //#region src/generators/cypressGenerator.d.ts
4
4
  declare const cypressGenerator: ReactGenerator<PluginCypress>;
@@ -1,4 +1,4 @@
1
1
  import "./components-Cs-85WSv.js";
2
- import { t as cypressGenerator } from "./generators-CfF-r6zR.js";
2
+ import { t as cypressGenerator } from "./generators-CRS7mkLj.js";
3
3
 
4
4
  export { cypressGenerator };
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const require_components = require('./components-CDWcq6eX.cjs');
2
- const require_generators = require('./generators-CKKLK5ah.cjs');
2
+ const require_generators = require('./generators-UzSX0BDU.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 { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-BOoil2LF.cjs";
1
+ import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-C36mkyaA.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-D6SVPqai.js";
1
+ import { a as UserPluginWithLifeCycle, n as PluginCypress, t as Options } from "./types-Da3VNOH7.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
1
  import "./components-Cs-85WSv.js";
2
- import { t as cypressGenerator } from "./generators-CfF-r6zR.js";
2
+ import { t as cypressGenerator } from "./generators-CRS7mkLj.js";
3
3
  import path from "node:path";
4
4
  import { PluginManager, createPlugin, getBarrelFiles, getMode } from "@kubb/core";
5
5
  import { camelCase } from "@kubb/core/transformers";