@kubb/plugin-cypress 3.16.2 → 3.16.4
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/dist/components-C8-e6KqF.cjs +64 -0
- package/dist/components-C8-e6KqF.cjs.map +1 -0
- package/dist/components-jRFHC_sv.js +30 -0
- package/dist/components-jRFHC_sv.js.map +1 -0
- package/dist/components.cjs +2 -11
- package/dist/components.d.cts +22 -16
- package/dist/components.d.ts +22 -16
- package/dist/components.js +3 -3
- package/dist/generators-Ct16r8RK.cjs +72 -0
- package/dist/{chunk-PIJKOKJD.js.map → generators-Ct16r8RK.cjs.map} +1 -1
- package/dist/generators-aYB5ZkVA.js +67 -0
- package/dist/generators-aYB5ZkVA.js.map +1 -0
- package/dist/generators.cjs +3 -12
- package/dist/generators.d.cts +5 -6
- package/dist/generators.d.ts +5 -6
- package/dist/generators.js +4 -4
- package/dist/index.cjs +74 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -7
- package/dist/index.d.ts +6 -7
- package/dist/index.js +74 -93
- package/dist/index.js.map +1 -1
- package/dist/types-BNTHk264.d.ts +1166 -0
- package/dist/types-Rl0-mzsN.d.cts +1166 -0
- package/package.json +18 -33
- package/dist/chunk-AQ3NKEYB.cjs +0 -75
- package/dist/chunk-AQ3NKEYB.cjs.map +0 -1
- package/dist/chunk-LJ3OQYCX.cjs +0 -26
- package/dist/chunk-LJ3OQYCX.cjs.map +0 -1
- package/dist/chunk-NEMUYKDD.js +0 -24
- package/dist/chunk-NEMUYKDD.js.map +0 -1
- package/dist/chunk-PIJKOKJD.js +0 -73
- package/dist/components.cjs.map +0 -1
- package/dist/components.js.map +0 -1
- package/dist/generators.cjs.map +0 -1
- package/dist/generators.js.map +0 -1
- package/dist/types-C2ke2hnU.d.cts +0 -59
- 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"}
|
package/dist/components.cjs
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
const require_components = require('./components-C8-e6KqF.cjs');
|
|
2
2
|
|
|
3
|
-
|
|
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;
|
package/dist/components.d.cts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import { HttpMethod } from
|
|
2
|
-
import { ReactNode } from
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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({
|
|
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
|
package/dist/components.d.ts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import { HttpMethod } from
|
|
2
|
-
import { ReactNode } from
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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({
|
|
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
|
package/dist/components.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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,"
|
|
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"}
|
package/dist/generators.cjs
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
'
|
|
1
|
+
require('./components-C8-e6KqF.cjs');
|
|
2
|
+
const require_generators = require('./generators-Ct16r8RK.cjs');
|
|
2
3
|
|
|
3
|
-
|
|
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;
|
package/dist/generators.d.cts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
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
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
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
|
package/dist/generators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|