@kubb/plugin-cypress 3.16.2 → 3.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/components-C8-e6KqF.cjs +64 -0
  2. package/dist/components-C8-e6KqF.cjs.map +1 -0
  3. package/dist/components-jRFHC_sv.js +30 -0
  4. package/dist/components-jRFHC_sv.js.map +1 -0
  5. package/dist/components.cjs +2 -11
  6. package/dist/components.d.cts +22 -16
  7. package/dist/components.d.ts +22 -16
  8. package/dist/components.js +3 -3
  9. package/dist/generators-Ct16r8RK.cjs +72 -0
  10. package/dist/{chunk-PIJKOKJD.js.map → generators-Ct16r8RK.cjs.map} +1 -1
  11. package/dist/generators-aYB5ZkVA.js +67 -0
  12. package/dist/generators-aYB5ZkVA.js.map +1 -0
  13. package/dist/generators.cjs +3 -12
  14. package/dist/generators.d.cts +5 -6
  15. package/dist/generators.d.ts +5 -6
  16. package/dist/generators.js +4 -4
  17. package/dist/index.cjs +74 -99
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +6 -7
  20. package/dist/index.d.ts +6 -7
  21. package/dist/index.js +74 -93
  22. package/dist/index.js.map +1 -1
  23. package/dist/types-BNTHk264.d.ts +1166 -0
  24. package/dist/types-Rl0-mzsN.d.cts +1166 -0
  25. package/package.json +18 -33
  26. package/dist/chunk-AQ3NKEYB.cjs +0 -75
  27. package/dist/chunk-AQ3NKEYB.cjs.map +0 -1
  28. package/dist/chunk-LJ3OQYCX.cjs +0 -26
  29. package/dist/chunk-LJ3OQYCX.cjs.map +0 -1
  30. package/dist/chunk-NEMUYKDD.js +0 -24
  31. package/dist/chunk-NEMUYKDD.js.map +0 -1
  32. package/dist/chunk-PIJKOKJD.js +0 -73
  33. package/dist/components.cjs.map +0 -1
  34. package/dist/components.js.map +0 -1
  35. package/dist/generators.cjs.map +0 -1
  36. package/dist/generators.js.map +0 -1
  37. package/dist/types-C2ke2hnU.d.cts +0 -59
  38. package/dist/types-C2ke2hnU.d.ts +0 -59
@@ -0,0 +1,64 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+
23
+ //#endregion
24
+ const __kubb_core_utils = __toESM(require("@kubb/core/utils"));
25
+ const __kubb_react = __toESM(require("@kubb/react"));
26
+ const __kubb_oas = __toESM(require("@kubb/oas"));
27
+ const __kubb_react_jsx_runtime = __toESM(require("@kubb/react/jsx-runtime"));
28
+
29
+ //#region src/components/Request.tsx
30
+ function Request({ baseURL = "", name, dataReturnType, typeSchemas, url, method }) {
31
+ const params = __kubb_react.FunctionParams.factory({ data: typeSchemas.request?.name ? {
32
+ type: typeSchemas.request?.name,
33
+ optional: (0, __kubb_oas.isOptional)(typeSchemas.request?.schema)
34
+ } : void 0 });
35
+ const returnType = dataReturnType === "data" ? `Cypress.Chainable<${typeSchemas.response.name}>` : `Cypress.Chainable<Cypress.Response<${typeSchemas.response.name}>>`;
36
+ const body = typeSchemas.request?.name ? "data" : void 0;
37
+ return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Source, {
38
+ name,
39
+ isIndexable: true,
40
+ isExportable: true,
41
+ children: /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react.Function, {
42
+ name,
43
+ export: true,
44
+ params: params.toConstructor(),
45
+ returnType,
46
+ children: [dataReturnType === "data" && `return cy.request('${method}', '${baseURL ?? ""}${new __kubb_core_utils.URLPath(url).toURLPath().replace(/([^/]):/g, "$1\\\\:")}', ${body}).then((res: Cypress.Response<${typeSchemas.response.name}>) => res.body)`, dataReturnType === "full" && `return cy.request('${method}', '${new __kubb_core_utils.URLPath(`${baseURL ?? ""}${url}`).toURLPath()}', ${body})`]
47
+ })
48
+ });
49
+ }
50
+
51
+ //#endregion
52
+ Object.defineProperty(exports, 'Request', {
53
+ enumerable: true,
54
+ get: function () {
55
+ return Request;
56
+ }
57
+ });
58
+ Object.defineProperty(exports, '__toESM', {
59
+ enumerable: true,
60
+ get: function () {
61
+ return __toESM;
62
+ }
63
+ });
64
+ //# sourceMappingURL=components-C8-e6KqF.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-C8-e6KqF.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,QAAe,EAAa;CAC1G,MAAM,SAASA,4BAAe,QAAQ,EACpC,MAAM,YAAY,SAAS,OACvB;EACE,MAAM,YAAY,SAAS;EAC3B,qCAAqB,YAAY,SAAS,OAAO;CAClD,IACD,OACL,EAAC;CAEF,MAAM,aACJ,mBAAmB,SAAS,CAAC,kBAAkB,EAAE,YAAY,SAAS,KAAK,CAAC,CAAC,GAAG,CAAC,mCAAmC,EAAE,YAAY,SAAS,KAAK,EAAE,CAAC;CAErJ,MAAM,OAAO,YAAY,SAAS,OAAO,SAAS;AAElD,0DACGC,kBAAK;EAAa;EAAM;EAAY;+DAClCC;GAAe;GAAM;GAAO,QAAQ,OAAO,eAAe;GAAc;cACtE,mBAAmB,UAClB,CAAC,mBAAmB,EAAE,OAAO,IAAI,EAAE,WAAW,KAAK,IAAIC,0BAAQ,KAAK,WAAW,CAAC,QAAQ,YAAY,UAAU,CAAC,GAAG,EAAE,KAAK,8BAA8B,EAAE,YAAY,SAAS,KAAK,eAAe,CAAC,EACpM,mBAAmB,UAAU,CAAC,mBAAmB,EAAE,OAAO,IAAI,EAAE,IAAIA,0BAAQ,GAAG,WAAW,KAAK,KAAK,EAAE,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtH;GACC;AAEjB"}
@@ -0,0 +1,30 @@
1
+ import { URLPath } from "@kubb/core/utils";
2
+ import { File, Function, FunctionParams } from "@kubb/react";
3
+ import { isOptional } from "@kubb/oas";
4
+ import { jsx, jsxs } from "@kubb/react/jsx-runtime";
5
+
6
+ //#region src/components/Request.tsx
7
+ function Request({ baseURL = "", name, dataReturnType, typeSchemas, url, method }) {
8
+ const params = FunctionParams.factory({ data: typeSchemas.request?.name ? {
9
+ type: typeSchemas.request?.name,
10
+ optional: isOptional(typeSchemas.request?.schema)
11
+ } : void 0 });
12
+ const returnType = dataReturnType === "data" ? `Cypress.Chainable<${typeSchemas.response.name}>` : `Cypress.Chainable<Cypress.Response<${typeSchemas.response.name}>>`;
13
+ const body = typeSchemas.request?.name ? "data" : void 0;
14
+ return /* @__PURE__ */ jsx(File.Source, {
15
+ name,
16
+ isIndexable: true,
17
+ isExportable: true,
18
+ children: /* @__PURE__ */ jsxs(Function, {
19
+ name,
20
+ export: true,
21
+ params: params.toConstructor(),
22
+ returnType,
23
+ children: [dataReturnType === "data" && `return cy.request('${method}', '${baseURL ?? ""}${new URLPath(url).toURLPath().replace(/([^/]):/g, "$1\\\\:")}', ${body}).then((res: Cypress.Response<${typeSchemas.response.name}>) => res.body)`, dataReturnType === "full" && `return cy.request('${method}', '${new URLPath(`${baseURL ?? ""}${url}`).toURLPath()}', ${body})`]
24
+ })
25
+ });
26
+ }
27
+
28
+ //#endregion
29
+ export { Request };
30
+ //# sourceMappingURL=components-jRFHC_sv.js.map
@@ -0,0 +1 @@
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,QAAe,EAAa;CAC1G,MAAM,SAAS,eAAe,QAAQ,EACpC,MAAM,YAAY,SAAS,OACvB;EACE,MAAM,YAAY,SAAS;EAC3B,UAAU,WAAW,YAAY,SAAS,OAAO;CAClD,IACD,OACL,EAAC;CAEF,MAAM,aACJ,mBAAmB,SAAS,CAAC,kBAAkB,EAAE,YAAY,SAAS,KAAK,CAAC,CAAC,GAAG,CAAC,mCAAmC,EAAE,YAAY,SAAS,KAAK,EAAE,CAAC;CAErJ,MAAM,OAAO,YAAY,SAAS,OAAO,SAAS;AAElD,4BACG,KAAK;EAAa;EAAM;EAAY;iCAClC;GAAe;GAAM;GAAO,QAAQ,OAAO,eAAe;GAAc;cACtE,mBAAmB,UAClB,CAAC,mBAAmB,EAAE,OAAO,IAAI,EAAE,WAAW,KAAK,IAAI,QAAQ,KAAK,WAAW,CAAC,QAAQ,YAAY,UAAU,CAAC,GAAG,EAAE,KAAK,8BAA8B,EAAE,YAAY,SAAS,KAAK,eAAe,CAAC,EACpM,mBAAmB,UAAU,CAAC,mBAAmB,EAAE,OAAO,IAAI,EAAE,IAAI,QAAQ,GAAG,WAAW,KAAK,KAAK,EAAE,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtH;GACC;AAEjB"}
@@ -1,12 +1,3 @@
1
- 'use strict';
1
+ const require_components = require('./components-C8-e6KqF.cjs');
2
2
 
3
- var chunkLJ3OQYCX_cjs = require('./chunk-LJ3OQYCX.cjs');
4
-
5
-
6
-
7
- Object.defineProperty(exports, "Request", {
8
- enumerable: true,
9
- get: function () { return chunkLJ3OQYCX_cjs.Request; }
10
- });
11
- //# sourceMappingURL=components.cjs.map
12
- //# sourceMappingURL=components.cjs.map
3
+ exports.Request = require_components.Request;
@@ -1,20 +1,26 @@
1
- import { HttpMethod } from '@kubb/oas';
2
- import { ReactNode } from 'react';
3
- import { OperationSchemas } from '@kubb/plugin-oas';
4
- import { P as PluginCypress } from './types-C2ke2hnU.cjs';
5
- import '@kubb/core';
1
+ import { HttpMethod, OperationSchemas, PluginCypress } from "./types-Rl0-mzsN.cjs";
2
+ import { ReactNode } from "react";
6
3
 
4
+ //#region src/components/Request.d.ts
7
5
  type Props = {
8
- /**
9
- * Name of the function
10
- */
11
- name: string;
12
- typeSchemas: OperationSchemas;
13
- url: string;
14
- baseURL: string | undefined;
15
- dataReturnType: PluginCypress['resolvedOptions']['dataReturnType'];
16
- method: HttpMethod;
6
+ /**
7
+ * Name of the function
8
+ */
9
+ name: string;
10
+ typeSchemas: OperationSchemas;
11
+ url: string;
12
+ baseURL: string | undefined;
13
+ dataReturnType: PluginCypress['resolvedOptions']['dataReturnType'];
14
+ method: HttpMethod;
17
15
  };
18
- declare function Request({ baseURL, name, dataReturnType, typeSchemas, url, method }: Props): ReactNode;
19
-
16
+ declare function Request({
17
+ baseURL,
18
+ name,
19
+ dataReturnType,
20
+ typeSchemas,
21
+ url,
22
+ method
23
+ }: Props): ReactNode;
24
+ //#endregion
20
25
  export { Request };
26
+ //# sourceMappingURL=components.d.cts.map
@@ -1,20 +1,26 @@
1
- import { HttpMethod } from '@kubb/oas';
2
- import { ReactNode } from 'react';
3
- import { OperationSchemas } from '@kubb/plugin-oas';
4
- import { P as PluginCypress } from './types-C2ke2hnU.js';
5
- import '@kubb/core';
1
+ import { HttpMethod, OperationSchemas, PluginCypress } from "./types-BNTHk264.js";
2
+ import { ReactNode } from "react";
6
3
 
4
+ //#region src/components/Request.d.ts
7
5
  type Props = {
8
- /**
9
- * Name of the function
10
- */
11
- name: string;
12
- typeSchemas: OperationSchemas;
13
- url: string;
14
- baseURL: string | undefined;
15
- dataReturnType: PluginCypress['resolvedOptions']['dataReturnType'];
16
- method: HttpMethod;
6
+ /**
7
+ * Name of the function
8
+ */
9
+ name: string;
10
+ typeSchemas: OperationSchemas;
11
+ url: string;
12
+ baseURL: string | undefined;
13
+ dataReturnType: PluginCypress['resolvedOptions']['dataReturnType'];
14
+ method: HttpMethod;
17
15
  };
18
- declare function Request({ baseURL, name, dataReturnType, typeSchemas, url, method }: Props): ReactNode;
19
-
16
+ declare function Request({
17
+ baseURL,
18
+ name,
19
+ dataReturnType,
20
+ typeSchemas,
21
+ url,
22
+ method
23
+ }: Props): ReactNode;
24
+ //#endregion
20
25
  export { Request };
26
+ //# sourceMappingURL=components.d.ts.map
@@ -1,3 +1,3 @@
1
- export { Request } from './chunk-NEMUYKDD.js';
2
- //# sourceMappingURL=components.js.map
3
- //# sourceMappingURL=components.js.map
1
+ import { Request } from "./components-jRFHC_sv.js";
2
+
3
+ export { Request };
@@ -0,0 +1,72 @@
1
+ const require_components = require('./components-C8-e6KqF.cjs');
2
+ const __kubb_plugin_oas = require_components.__toESM(require("@kubb/plugin-oas"));
3
+ const __kubb_plugin_ts = require_components.__toESM(require("@kubb/plugin-ts"));
4
+ const __kubb_core_utils = require_components.__toESM(require("@kubb/core/utils"));
5
+ const __kubb_plugin_oas_hooks = require_components.__toESM(require("@kubb/plugin-oas/hooks"));
6
+ const __kubb_plugin_oas_utils = require_components.__toESM(require("@kubb/plugin-oas/utils"));
7
+ const __kubb_react = require_components.__toESM(require("@kubb/react"));
8
+ const __kubb_react_jsx_runtime = require_components.__toESM(require("@kubb/react/jsx-runtime"));
9
+
10
+ //#region src/generators/cypressGenerator.tsx
11
+ const cypressGenerator = (0, __kubb_plugin_oas.createReactGenerator)({
12
+ name: "cypress",
13
+ Operation({ operation }) {
14
+ const { pluginManager, plugin: { options: { output, baseURL, dataReturnType } } } = (0, __kubb_react.useApp)();
15
+ const oas = (0, __kubb_plugin_oas_hooks.useOas)();
16
+ const { getSchemas, getName, getFile } = (0, __kubb_plugin_oas_hooks.useOperationManager)();
17
+ const request = {
18
+ name: getName(operation, { type: "function" }),
19
+ file: getFile(operation)
20
+ };
21
+ const type = {
22
+ file: getFile(operation, { pluginKey: [__kubb_plugin_ts.pluginTsName] }),
23
+ schemas: getSchemas(operation, {
24
+ pluginKey: [__kubb_plugin_ts.pluginTsName],
25
+ type: "type"
26
+ })
27
+ };
28
+ return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsxs)(__kubb_react.File, {
29
+ baseName: request.file.baseName,
30
+ path: request.file.path,
31
+ meta: request.file.meta,
32
+ banner: (0, __kubb_plugin_oas_utils.getBanner)({
33
+ oas,
34
+ output,
35
+ config: pluginManager.config
36
+ }),
37
+ footer: (0, __kubb_plugin_oas_utils.getFooter)({
38
+ oas,
39
+ output
40
+ }),
41
+ children: [/* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(__kubb_react.File.Import, {
42
+ name: [
43
+ type.schemas.request?.name,
44
+ type.schemas.response.name,
45
+ type.schemas.pathParams?.name,
46
+ type.schemas.queryParams?.name,
47
+ type.schemas.headerParams?.name,
48
+ ...type.schemas.statusCodes?.map((item) => item.name) || []
49
+ ].filter(Boolean),
50
+ root: request.file.path,
51
+ path: type.file.path,
52
+ isTypeOnly: true
53
+ }), /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(require_components.Request, {
54
+ name: request.name,
55
+ dataReturnType,
56
+ typeSchemas: type.schemas,
57
+ method: operation.method,
58
+ baseURL,
59
+ url: new __kubb_core_utils.URLPath(operation.path).toURLPath()
60
+ })]
61
+ });
62
+ }
63
+ });
64
+
65
+ //#endregion
66
+ Object.defineProperty(exports, 'cypressGenerator', {
67
+ enumerable: true,
68
+ get: function () {
69
+ return cypressGenerator;
70
+ }
71
+ });
72
+ //# sourceMappingURL=generators-Ct16r8RK.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/generators/cypressGenerator.tsx"],"names":[],"mappings":";;;;;;;;;AASO,IAAM,mBAAmB,oBAAoC,CAAA;AAAA,EAClE,IAAM,EAAA,SAAA;AAAA,EACN,SAAA,CAAU,EAAE,SAAA,EAAa,EAAA;AACvB,IAAM,MAAA;AAAA,MACJ,aAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,OAAS,EAAA,EAAE,MAAQ,EAAA,OAAA,EAAS,cAAe;AAAA;AAC7C,QACE,MAAsB,EAAA;AAC1B,IAAA,MAAM,MAAM,MAAO,EAAA;AACnB,IAAA,MAAM,EAAE,UAAA,EAAY,OAAS,EAAA,OAAA,KAAY,mBAAoB,EAAA;AAE7D,IAAA,MAAM,OAAU,GAAA;AAAA,MACd,MAAM,OAAQ,CAAA,SAAA,EAAW,EAAE,IAAA,EAAM,YAAY,CAAA;AAAA,MAC7C,IAAA,EAAM,QAAQ,SAAS;AAAA,KACzB;AAEA,IAAA,MAAM,IAAO,GAAA;AAAA,MACX,IAAA,EAAM,QAAQ,SAAW,EAAA,EAAE,WAAW,CAAC,YAAY,GAAG,CAAA;AAAA,MACtD,OAAA,EAAS,UAAW,CAAA,SAAA,EAAW,EAAE,SAAA,EAAW,CAAC,YAAY,CAAA,EAAG,IAAM,EAAA,MAAA,EAAQ;AAAA,KAC5E;AAEA,IACE,uBAAA,IAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,QAAA,EAAU,QAAQ,IAAK,CAAA,QAAA;AAAA,QACvB,IAAA,EAAM,QAAQ,IAAK,CAAA,IAAA;AAAA,QACnB,IAAA,EAAM,QAAQ,IAAK,CAAA,IAAA;AAAA,QACnB,MAAA,EAAQ,UAAU,EAAE,GAAA,EAAK,QAAQ,MAAQ,EAAA,aAAA,CAAc,QAAQ,CAAA;AAAA,QAC/D,MAAQ,EAAA,SAAA,CAAU,EAAE,GAAA,EAAK,QAAQ,CAAA;AAAA,QAEjC,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,IAAK,CAAA,MAAA;AAAA,YAAL;AAAA,cACC,IAAM,EAAA;AAAA,gBACJ,IAAA,CAAK,QAAQ,OAAS,EAAA,IAAA;AAAA,gBACtB,IAAA,CAAK,QAAQ,QAAS,CAAA,IAAA;AAAA,gBACtB,IAAA,CAAK,QAAQ,UAAY,EAAA,IAAA;AAAA,gBACzB,IAAA,CAAK,QAAQ,WAAa,EAAA,IAAA;AAAA,gBAC1B,IAAA,CAAK,QAAQ,YAAc,EAAA,IAAA;AAAA,gBAC3B,GAAI,IAAK,CAAA,OAAA,CAAQ,WAAa,EAAA,GAAA,CAAI,CAAC,IAAS,KAAA,IAAA,CAAK,IAAI,CAAA,IAAK;AAAC,eAC7D,CAAE,OAAO,OAAO,CAAA;AAAA,cAChB,IAAA,EAAM,QAAQ,IAAK,CAAA,IAAA;AAAA,cACnB,IAAA,EAAM,KAAK,IAAK,CAAA,IAAA;AAAA,cAChB,UAAU,EAAA;AAAA;AAAA,WACZ;AAAA,0BACA,GAAA;AAAA,YAAC,OAAA;AAAA,YAAA;AAAA,cACC,MAAM,OAAQ,CAAA,IAAA;AAAA,cACd,cAAA;AAAA,cACA,aAAa,IAAK,CAAA,OAAA;AAAA,cAClB,QAAQ,SAAU,CAAA,MAAA;AAAA,cAClB,OAAA;AAAA,cACA,KAAK,IAAI,OAAA,CAAQ,SAAU,CAAA,IAAI,EAAE,SAAU;AAAA;AAAA;AAC7C;AAAA;AAAA,KACF;AAAA;AAGN,CAAC","file":"chunk-PIJKOKJD.js","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"]}
1
+ {"version":3,"file":"generators-Ct16r8RK.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,WAAW,EAAE;EACvB,MAAM,EACJ,eACA,QAAQ,EACN,SAAS,EAAE,QAAQ,SAAS,gBAAgB,EAC7C,EACF,6BAA0B;EAC3B,MAAM,2CAAc;EACpB,MAAM,EAAE,YAAY,SAAS,SAAS,qDAAwB;EAE9D,MAAM,UAAU;GACd,MAAM,QAAQ,WAAW,EAAE,MAAM,WAAY,EAAC;GAC9C,MAAM,QAAQ,UAAU;EACzB;EAED,MAAM,OAAO;GACX,MAAM,QAAQ,WAAW,EAAE,WAAW,CAACA,6BAAa,EAAE,EAAC;GACvD,SAAS,WAAW,WAAW;IAAE,WAAW,CAACA,6BAAa;IAAE,MAAM;GAAQ,EAAC;EAC5E;AAED,4DACGC;GACC,UAAU,QAAQ,KAAK;GACvB,MAAM,QAAQ,KAAK;GACnB,MAAM,QAAQ,KAAK;GACnB,+CAAkB;IAAE;IAAK;IAAQ,QAAQ,cAAc;GAAQ,EAAC;GAChE,+CAAkB;IAAE;IAAK;GAAQ,EAAC;gEAEjCA,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,IAAI,CAAC,SAAS,KAAK,KAAK,IAAI,CAAE;IAC7D,EAAC,OAAO,QAAQ;IACjB,MAAM,QAAQ,KAAK;IACnB,MAAM,KAAK,KAAK;IAChB;KACA,oDACDC;IACC,MAAM,QAAQ;IACE;IAChB,aAAa,KAAK;IAClB,QAAQ,UAAU;IACT;IACT,KAAK,IAAIC,0BAAQ,UAAU,MAAM,WAAW;KAC5C;IACG;CAEV;AACF,EAAC"}
@@ -0,0 +1,67 @@
1
+ import { Request } from "./components-jRFHC_sv.js";
2
+ import { createReactGenerator } from "@kubb/plugin-oas";
3
+ import { pluginTsName } from "@kubb/plugin-ts";
4
+ import { URLPath } from "@kubb/core/utils";
5
+ import { useOas, useOperationManager } from "@kubb/plugin-oas/hooks";
6
+ import { getBanner, getFooter } from "@kubb/plugin-oas/utils";
7
+ import { File, useApp } from "@kubb/react";
8
+ import { jsx, jsxs } from "@kubb/react/jsx-runtime";
9
+
10
+ //#region src/generators/cypressGenerator.tsx
11
+ const cypressGenerator = createReactGenerator({
12
+ name: "cypress",
13
+ Operation({ operation }) {
14
+ const { pluginManager, plugin: { options: { output, baseURL, dataReturnType } } } = useApp();
15
+ const oas = useOas();
16
+ const { getSchemas, getName, getFile } = useOperationManager();
17
+ const request = {
18
+ name: getName(operation, { type: "function" }),
19
+ file: getFile(operation)
20
+ };
21
+ const type = {
22
+ file: getFile(operation, { pluginKey: [pluginTsName] }),
23
+ schemas: getSchemas(operation, {
24
+ pluginKey: [pluginTsName],
25
+ type: "type"
26
+ })
27
+ };
28
+ return /* @__PURE__ */ jsxs(File, {
29
+ baseName: request.file.baseName,
30
+ path: request.file.path,
31
+ meta: request.file.meta,
32
+ banner: getBanner({
33
+ oas,
34
+ output,
35
+ config: pluginManager.config
36
+ }),
37
+ footer: getFooter({
38
+ oas,
39
+ output
40
+ }),
41
+ children: [/* @__PURE__ */ jsx(File.Import, {
42
+ name: [
43
+ type.schemas.request?.name,
44
+ type.schemas.response.name,
45
+ type.schemas.pathParams?.name,
46
+ type.schemas.queryParams?.name,
47
+ type.schemas.headerParams?.name,
48
+ ...type.schemas.statusCodes?.map((item) => item.name) || []
49
+ ].filter(Boolean),
50
+ root: request.file.path,
51
+ path: type.file.path,
52
+ isTypeOnly: true
53
+ }), /* @__PURE__ */ jsx(Request, {
54
+ name: request.name,
55
+ dataReturnType,
56
+ typeSchemas: type.schemas,
57
+ method: operation.method,
58
+ baseURL,
59
+ url: new URLPath(operation.path).toURLPath()
60
+ })]
61
+ });
62
+ }
63
+ });
64
+
65
+ //#endregion
66
+ export { cypressGenerator };
67
+ //# sourceMappingURL=generators-aYB5ZkVA.js.map
@@ -0,0 +1 @@
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,WAAW,EAAE;EACvB,MAAM,EACJ,eACA,QAAQ,EACN,SAAS,EAAE,QAAQ,SAAS,gBAAgB,EAC7C,EACF,GAAG,QAAuB;EAC3B,MAAM,MAAM,QAAQ;EACpB,MAAM,EAAE,YAAY,SAAS,SAAS,GAAG,qBAAqB;EAE9D,MAAM,UAAU;GACd,MAAM,QAAQ,WAAW,EAAE,MAAM,WAAY,EAAC;GAC9C,MAAM,QAAQ,UAAU;EACzB;EAED,MAAM,OAAO;GACX,MAAM,QAAQ,WAAW,EAAE,WAAW,CAAC,YAAa,EAAE,EAAC;GACvD,SAAS,WAAW,WAAW;IAAE,WAAW,CAAC,YAAa;IAAE,MAAM;GAAQ,EAAC;EAC5E;AAED,8BACG;GACC,UAAU,QAAQ,KAAK;GACvB,MAAM,QAAQ,KAAK;GACnB,MAAM,QAAQ,KAAK;GACnB,QAAQ,UAAU;IAAE;IAAK;IAAQ,QAAQ,cAAc;GAAQ,EAAC;GAChE,QAAQ,UAAU;IAAE;IAAK;GAAQ,EAAC;kCAEjC,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,IAAI,CAAC,SAAS,KAAK,KAAK,IAAI,CAAE;IAC7D,EAAC,OAAO,QAAQ;IACjB,MAAM,QAAQ,KAAK;IACnB,MAAM,KAAK,KAAK;IAChB;KACA,sBACD;IACC,MAAM,QAAQ;IACE;IAChB,aAAa,KAAK;IAClB,QAAQ,UAAU;IACT;IACT,KAAK,IAAI,QAAQ,UAAU,MAAM,WAAW;KAC5C;IACG;CAEV;AACF,EAAC"}
@@ -1,13 +1,4 @@
1
- 'use strict';
1
+ require('./components-C8-e6KqF.cjs');
2
+ const require_generators = require('./generators-Ct16r8RK.cjs');
2
3
 
3
- var chunkAQ3NKEYB_cjs = require('./chunk-AQ3NKEYB.cjs');
4
- require('./chunk-LJ3OQYCX.cjs');
5
-
6
-
7
-
8
- Object.defineProperty(exports, "cypressGenerator", {
9
- enumerable: true,
10
- get: function () { return chunkAQ3NKEYB_cjs.cypressGenerator; }
11
- });
12
- //# sourceMappingURL=generators.cjs.map
13
- //# sourceMappingURL=generators.cjs.map
4
+ exports.cypressGenerator = require_generators.cypressGenerator;
@@ -1,8 +1,7 @@
1
- import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
- import { P as PluginCypress } from './types-C2ke2hnU.cjs';
3
- import '@kubb/core';
4
- import '@kubb/oas';
5
-
6
- declare const cypressGenerator: _kubb_plugin_oas.Generator<PluginCypress>;
1
+ import { Generator, PluginCypress } from "./types-Rl0-mzsN.cjs";
7
2
 
3
+ //#region src/generators/cypressGenerator.d.ts
4
+ declare const cypressGenerator: Generator<PluginCypress>;
5
+ //#endregion
8
6
  export { cypressGenerator };
7
+ //# sourceMappingURL=generators.d.cts.map
@@ -1,8 +1,7 @@
1
- import * as _kubb_plugin_oas from '@kubb/plugin-oas';
2
- import { P as PluginCypress } from './types-C2ke2hnU.js';
3
- import '@kubb/core';
4
- import '@kubb/oas';
5
-
6
- declare const cypressGenerator: _kubb_plugin_oas.Generator<PluginCypress>;
1
+ import { Generator, PluginCypress } from "./types-BNTHk264.js";
7
2
 
3
+ //#region src/generators/cypressGenerator.d.ts
4
+ declare const cypressGenerator: Generator<PluginCypress>;
5
+ //#endregion
8
6
  export { cypressGenerator };
7
+ //# sourceMappingURL=generators.d.ts.map
@@ -1,4 +1,4 @@
1
- export { cypressGenerator } from './chunk-PIJKOKJD.js';
2
- import './chunk-NEMUYKDD.js';
3
- //# sourceMappingURL=generators.js.map
4
- //# sourceMappingURL=generators.js.map
1
+ import "./components-jRFHC_sv.js";
2
+ import { cypressGenerator } from "./generators-aYB5ZkVA.js";
3
+
4
+ export { cypressGenerator };
package/dist/index.cjs CHANGED
@@ -1,105 +1,80 @@
1
- 'use strict';
1
+ const require_components = require('./components-C8-e6KqF.cjs');
2
+ const require_generators = require('./generators-Ct16r8RK.cjs');
3
+ const node_path = require_components.__toESM(require("node:path"));
4
+ const __kubb_core = require_components.__toESM(require("@kubb/core"));
5
+ const __kubb_core_transformers = require_components.__toESM(require("@kubb/core/transformers"));
6
+ const __kubb_plugin_oas = require_components.__toESM(require("@kubb/plugin-oas"));
7
+ const __kubb_plugin_ts = require_components.__toESM(require("@kubb/plugin-ts"));
2
8
 
3
- var chunkAQ3NKEYB_cjs = require('./chunk-AQ3NKEYB.cjs');
4
- require('./chunk-LJ3OQYCX.cjs');
5
- var path = require('path');
6
- var core = require('@kubb/core');
7
- var transformers = require('@kubb/core/transformers');
8
- var pluginOas = require('@kubb/plugin-oas');
9
- var pluginTs = require('@kubb/plugin-ts');
10
-
11
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
-
13
- var path__default = /*#__PURE__*/_interopDefault(path);
14
-
15
- var pluginCypressName = "plugin-cypress";
16
- var pluginCypress = core.createPlugin((options) => {
17
- const {
18
- output = { path: "cypress", barrelType: "named" },
19
- group,
20
- dataReturnType = "data",
21
- exclude = [],
22
- include,
23
- override = [],
24
- transformers: transformers$1 = {},
25
- generators = [chunkAQ3NKEYB_cjs.cypressGenerator].filter(Boolean),
26
- contentType,
27
- baseURL
28
- } = options;
29
- return {
30
- name: pluginCypressName,
31
- options: {
32
- output,
33
- dataReturnType,
34
- group,
35
- baseURL
36
- },
37
- pre: [pluginOas.pluginOasName, pluginTs.pluginTsName].filter(Boolean),
38
- resolvePath(baseName, pathMode, options2) {
39
- const root = path__default.default.resolve(this.config.root, this.config.output.path);
40
- const mode = pathMode ?? core.FileManager.getMode(path__default.default.resolve(root, output.path));
41
- if (mode === "single") {
42
- return path__default.default.resolve(root, output.path);
43
- }
44
- if (group && (options2?.group?.path || options2?.group?.tag)) {
45
- const groupName = group?.name ? group.name : (ctx) => {
46
- if (group?.type === "path") {
47
- return `${ctx.group.split("/")[1]}`;
48
- }
49
- return `${transformers.camelCase(ctx.group)}Requests`;
50
- };
51
- return path__default.default.resolve(
52
- root,
53
- output.path,
54
- groupName({
55
- group: group.type === "path" ? options2.group.path : options2.group.tag
56
- }),
57
- baseName
58
- );
59
- }
60
- return path__default.default.resolve(root, output.path, baseName);
61
- },
62
- resolveName(name, type) {
63
- const resolvedName = transformers.camelCase(name, {
64
- isFile: type === "file"
65
- });
66
- if (type) {
67
- return transformers$1?.name?.(resolvedName, type) || resolvedName;
68
- }
69
- return resolvedName;
70
- },
71
- async buildStart() {
72
- const [swaggerPlugin] = core.PluginManager.getDependedPlugins(this.plugins, [pluginOas.pluginOasName]);
73
- const oas = await swaggerPlugin.context.getOas();
74
- const root = path__default.default.resolve(this.config.root, this.config.output.path);
75
- const mode = core.FileManager.getMode(path__default.default.resolve(root, output.path));
76
- const operationGenerator = new pluginOas.OperationGenerator(this.plugin.options, {
77
- oas,
78
- pluginManager: this.pluginManager,
79
- plugin: this.plugin,
80
- contentType,
81
- exclude,
82
- include,
83
- override,
84
- mode
85
- });
86
- const files = await operationGenerator.build(...generators);
87
- await this.addFile(...files);
88
- const barrelFiles = await this.fileManager.getBarrelFiles({
89
- type: output.barrelType ?? "named",
90
- root,
91
- output,
92
- meta: {
93
- pluginKey: this.plugin.key
94
- },
95
- logger: this.logger
96
- });
97
- await this.addFile(...barrelFiles);
98
- }
99
- };
9
+ //#region src/plugin.ts
10
+ const pluginCypressName = "plugin-cypress";
11
+ const pluginCypress = (0, __kubb_core.createPlugin)((options) => {
12
+ const { output = {
13
+ path: "cypress",
14
+ barrelType: "named"
15
+ }, group, dataReturnType = "data", exclude = [], include, override = [], transformers = {}, generators = [require_generators.cypressGenerator].filter(Boolean), contentType, baseURL } = options;
16
+ return {
17
+ name: pluginCypressName,
18
+ options: {
19
+ output,
20
+ dataReturnType,
21
+ group,
22
+ baseURL
23
+ },
24
+ pre: [__kubb_plugin_oas.pluginOasName, __kubb_plugin_ts.pluginTsName].filter(Boolean),
25
+ resolvePath(baseName, pathMode, options$1) {
26
+ const root = node_path.default.resolve(this.config.root, this.config.output.path);
27
+ const mode = pathMode ?? __kubb_core.FileManager.getMode(node_path.default.resolve(root, output.path));
28
+ if (mode === "single")
29
+ /**
30
+ * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend
31
+ * Other plugins then need to call addOrAppend instead of just add from the fileManager class
32
+ */
33
+ return node_path.default.resolve(root, output.path);
34
+ if (group && (options$1?.group?.path || options$1?.group?.tag)) {
35
+ const groupName = group?.name ? group.name : (ctx) => {
36
+ if (group?.type === "path") return `${ctx.group.split("/")[1]}`;
37
+ return `${(0, __kubb_core_transformers.camelCase)(ctx.group)}Requests`;
38
+ };
39
+ return node_path.default.resolve(root, output.path, groupName({ group: group.type === "path" ? options$1.group.path : options$1.group.tag }), baseName);
40
+ }
41
+ return node_path.default.resolve(root, output.path, baseName);
42
+ },
43
+ resolveName(name, type) {
44
+ const resolvedName = (0, __kubb_core_transformers.camelCase)(name, { isFile: type === "file" });
45
+ if (type) return transformers?.name?.(resolvedName, type) || resolvedName;
46
+ return resolvedName;
47
+ },
48
+ async buildStart() {
49
+ const [swaggerPlugin] = __kubb_core.PluginManager.getDependedPlugins(this.plugins, [__kubb_plugin_oas.pluginOasName]);
50
+ const oas = await swaggerPlugin.context.getOas();
51
+ const root = node_path.default.resolve(this.config.root, this.config.output.path);
52
+ const mode = __kubb_core.FileManager.getMode(node_path.default.resolve(root, output.path));
53
+ const operationGenerator = new __kubb_plugin_oas.OperationGenerator(this.plugin.options, {
54
+ oas,
55
+ pluginManager: this.pluginManager,
56
+ plugin: this.plugin,
57
+ contentType,
58
+ exclude,
59
+ include,
60
+ override,
61
+ mode
62
+ });
63
+ const files = await operationGenerator.build(...generators);
64
+ await this.addFile(...files);
65
+ const barrelFiles = await this.fileManager.getBarrelFiles({
66
+ type: output.barrelType ?? "named",
67
+ root,
68
+ output,
69
+ meta: { pluginKey: this.plugin.key },
70
+ logger: this.logger
71
+ });
72
+ await this.addFile(...barrelFiles);
73
+ }
74
+ };
100
75
  });
101
76
 
77
+ //#endregion
102
78
  exports.pluginCypress = pluginCypress;
103
79
  exports.pluginCypressName = pluginCypressName;
104
- //# sourceMappingURL=index.cjs.map
105
80
  //# sourceMappingURL=index.cjs.map