@kubb/plugin-msw 4.7.2 → 4.7.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.
- package/dist/{components-Q92J_gRn.js → components-DK6Olrp_.js} +1 -1
- package/dist/{components-Q92J_gRn.js.map → components-DK6Olrp_.js.map} +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/{generators-DrKAAS_E.js → generators-DmpieAeS.js} +2 -2
- package/dist/{generators-DrKAAS_E.js.map → generators-DmpieAeS.js.map} +1 -1
- package/dist/generators.d.ts +2 -2
- package/dist/generators.js +2 -2
- package/dist/{index-BiQTw5w9.d.ts → index-h4uz5Q5r.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{types-BEp4ktc0.d.ts → types-D7y8D-LQ.d.ts} +2 -2
- package/package.json +6 -6
- package/dist/chunk-CT0EDfkp.js +0 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-
|
|
1
|
+
{"version":3,"file":"components-DK6Olrp_.js","names":[],"sources":["../src/components/Handlers.tsx","../src/components/Mock.tsx","../src/components/MockWithFaker.tsx","../src/components/Response.tsx"],"sourcesContent":["import { File } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\n\ntype HandlersProps = {\n /**\n * Name of the function\n */\n name: string\n // custom\n handlers: string[]\n}\n\nexport function Handlers({ name, handlers }: HandlersProps): KubbNode {\n return (\n <File.Source name={name} isIndexable isExportable>\n {`export const ${name} = ${JSON.stringify(handlers).replaceAll(`\"`, '')} as const`}\n </File.Source>\n )\n}\n","import { URLPath } from '@kubb/core/utils'\nimport type { OasTypes, Operation } from '@kubb/oas'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n fakerName: string\n baseURL: string | undefined\n operation: Operation\n}\n\nexport function Mock({ baseURL = '', name, typeName, operation }: Props): KubbNode {\n const method = operation.method\n const successStatusCodes = operation.getResponseStatusCodes().filter((code) => code.startsWith('2'))\n const statusCode = successStatusCodes.length > 0 ? Number(successStatusCodes[0]) : 200\n\n const responseObject = operation.getResponseByStatusCode(statusCode) as OasTypes.ResponseObject\n const contentType = Object.keys(responseObject.content || {})?.[0]\n const url = new URLPath(operation.path).toURLPath().replace(/([^/]):/g, '$1\\\\\\\\:')\n\n const headers = [contentType ? `'Content-Type': '${contentType}'` : undefined].filter(Boolean)\n\n const hasResponseSchema = contentType && responseObject?.content?.[contentType]?.schema !== undefined\n\n // If no response schema, uses any type but function to avoid overriding callback\n const dataType = hasResponseSchema ? typeName : 'string | number | boolean | null | object'\n\n const params = FunctionParams.factory({\n data: {\n type: `${dataType} | ((\n info: Parameters<Parameters<typeof http.${method}>[1]>[0],\n ) => Response | Promise<Response>)`,\n optional: true,\n },\n })\n\n return (\n <File.Source name={name} isIndexable isExportable>\n <Function name={name} export params={params.toConstructor()}>\n {`return http.${method}('${baseURL}${url.replace(/([^/]):/g, '$1\\\\\\\\:')}', function handler(info) {\n if(typeof data === 'function') return data(info)\n\n return new Response(JSON.stringify(data), {\n status: ${statusCode},\n ${\n headers.length\n ? ` headers: {\n ${headers.join(', \\n')}\n },`\n : ''\n }\n })\n })`}\n </Function>\n </File.Source>\n )\n}\n","import { URLPath } from '@kubb/core/utils'\n\nimport type { OasTypes, Operation } from '@kubb/oas'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n typeName: string\n fakerName: string\n baseURL: string | undefined\n operation: Operation\n}\n\nexport function MockWithFaker({ baseURL = '', name, fakerName, typeName, operation }: Props): KubbNode {\n const method = operation.method\n const successStatusCodes = operation.getResponseStatusCodes().filter((code) => code.startsWith('2'))\n const statusCode = successStatusCodes.length > 0 ? Number(successStatusCodes[0]) : 200\n\n const responseObject = operation.getResponseByStatusCode(statusCode) as OasTypes.ResponseObject\n const contentType = Object.keys(responseObject.content || {})?.[0]\n const url = new URLPath(operation.path).toURLPath().replace(/([^/]):/g, '$1\\\\\\\\:')\n\n const headers = [contentType ? `'Content-Type': '${contentType}'` : undefined].filter(Boolean)\n\n const params = FunctionParams.factory({\n data: {\n type: `${typeName} | ((\n info: Parameters<Parameters<typeof http.${method}>[1]>[0],\n ) => Response | Promise<Response>)`,\n optional: true,\n },\n })\n\n return (\n <File.Source name={name} isIndexable isExportable>\n <Function name={name} export params={params.toConstructor()}>\n {`return http.${method}('${baseURL}${url.replace(/([^/]):/g, '$1\\\\\\\\:')}', function handler(info) {\n if(typeof data === 'function') return data(info)\n\n return new Response(JSON.stringify(data || ${fakerName}(data)), {\n status: ${statusCode},\n ${\n headers.length\n ? ` headers: {\n ${headers.join(', \\n')}\n },`\n : ''\n }\n })\n })`}\n </Function>\n </File.Source>\n )\n}\n","import type { OasTypes, Operation } from '@kubb/oas'\nimport { File, Function, FunctionParams } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\n\ntype Props = {\n typeName: string\n operation: Operation\n name: string\n statusCode: number\n}\n\nexport function Response({ name, typeName, operation, statusCode }: Props): KubbNode {\n const responseObject = operation.getResponseByStatusCode(statusCode) as OasTypes.ResponseObject\n const contentType = Object.keys(responseObject.content || {})?.[0]\n\n const headers = [contentType ? `'Content-Type': '${contentType}'` : undefined].filter(Boolean)\n\n const hasResponseSchema = contentType && responseObject?.content?.[contentType]?.schema !== undefined\n\n const params = FunctionParams.factory({\n data: {\n type: `${typeName}`,\n optional: !hasResponseSchema,\n },\n })\n\n const responseName = `${name}Response${statusCode}`\n\n return (\n <File.Source name={responseName} isIndexable isExportable>\n <Function name={responseName} export params={params.toConstructor()}>\n {`\n return new Response(JSON.stringify(data), {\n status: ${statusCode},\n ${\n headers.length\n ? ` headers: {\n ${headers.join(', \\n')}\n },`\n : ''\n }\n })`}\n </Function>\n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;GAAS,MAAM;GAAc;GAAO,QAAQ,OAAO,eAAe;aAChE;;gBAEO,WAAW;QAEnB,QAAQ,SACJ;UACF,QAAQ,KAAK,OAAO,CAAC;YAEnB,GACL;;IAEU;GACC"}
|
package/dist/components.d.ts
CHANGED
package/dist/components.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as Handlers, n as MockWithFaker, r as Mock, t as Response } from "./components-
|
|
1
|
+
import { i as Handlers, n as MockWithFaker, r as Mock, t as Response } from "./components-DK6Olrp_.js";
|
|
2
2
|
import { pluginFakerName } from "@kubb/plugin-faker";
|
|
3
3
|
import { pluginTsName } from "@kubb/plugin-ts";
|
|
4
4
|
import { usePluginManager } from "@kubb/core/hooks";
|
|
@@ -159,4 +159,4 @@ const mswGenerator = createReactGenerator({
|
|
|
159
159
|
|
|
160
160
|
//#endregion
|
|
161
161
|
export { handlersGenerator as n, mswGenerator as t };
|
|
162
|
-
//# sourceMappingURL=generators-
|
|
162
|
+
//# sourceMappingURL=generators-DmpieAeS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators-
|
|
1
|
+
{"version":3,"file":"generators-DmpieAeS.js","names":["types: [statusCode: number | 'default', typeName: string][]"],"sources":["../src/generators/handlersGenerator.tsx","../src/generators/mswGenerator.tsx"],"sourcesContent":["import { usePluginManager } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File } from '@kubb/react-fabric'\nimport { Handlers } from '../components/Handlers.tsx'\nimport type { PluginMsw } from '../types'\n\nexport const handlersGenerator = createReactGenerator<PluginMsw>({\n name: 'plugin-msw',\n Operations({ operations, generator, plugin }) {\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getName, getFile } = useOperationManager(generator)\n\n const file = pluginManager.getFile({ name: 'handlers', extname: '.ts', pluginKey: plugin.key })\n\n const imports = operations.map((operation) => {\n const operationFile = getFile(operation, { pluginKey: plugin.key })\n const operationName = getName(operation, { pluginKey: plugin.key, type: 'function' })\n\n return <File.Import key={operationFile.path} name={[operationName]} root={file.path} path={operationFile.path} />\n })\n\n const handlers = operations.map((operation) => `${getName(operation, { type: 'function', pluginKey: plugin.key })}()`)\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: plugin.options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: plugin.options.output })}\n >\n {imports}\n <Handlers name={'handlers'} handlers={handlers} />\n </File>\n )\n },\n})\n","import { usePluginManager } from '@kubb/core/hooks'\nimport { pluginFakerName } from '@kubb/plugin-faker'\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 { Mock, MockWithFaker, Response } from '../components'\nimport type { PluginMsw } from '../types'\n\nexport const mswGenerator = createReactGenerator<PluginMsw>({\n name: 'msw',\n Operation({ operation, generator, plugin }) {\n const {\n options: { output, parser, baseURL },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\n\n const mock = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const faker = {\n file: getFile(operation, { pluginKey: [pluginFakerName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginFakerName], type: 'function' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const responseStatusCodes = operation.getResponseStatusCodes()\n\n const types: [statusCode: number | 'default', typeName: string][] = []\n\n for (const code of responseStatusCodes) {\n if (code === 'default') {\n types.push(['default', type.schemas.response.name])\n continue\n }\n\n if (code.startsWith('2')) {\n types.push([Number(code), type.schemas.response.name])\n continue\n }\n\n const codeType = type.schemas.errors?.find((err) => err.statusCode === Number(code))\n if (codeType) types.push([Number(code), codeType.name])\n }\n\n return (\n <File\n baseName={mock.file.baseName}\n path={mock.file.path}\n meta={mock.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import name={['http']} path=\"msw\" />\n <File.Import name={['ResponseResolver']} isTypeOnly path=\"msw\" />\n <File.Import\n name={Array.from(new Set([type.schemas.response.name, ...types.map((t) => t[1])]))}\n path={type.file.path}\n root={mock.file.path}\n isTypeOnly\n />\n {parser === 'faker' && faker.file && faker.schemas.response && (\n <File.Import name={[faker.schemas.response.name]} root={mock.file.path} path={faker.file.path} />\n )}\n\n {types\n .filter(([code]) => code !== 'default')\n .map(([code, typeName]) => (\n <Response typeName={typeName} operation={operation} name={mock.name} statusCode={code as number} />\n ))}\n {parser === 'faker' && (\n <MockWithFaker\n name={mock.name}\n typeName={type.schemas.response.name}\n fakerName={faker.schemas.response.name}\n operation={operation}\n baseURL={baseURL}\n />\n )}\n {parser === 'data' && (\n <Mock name={mock.name} typeName={type.schemas.response.name} fakerName={faker.schemas.response.name} operation={operation} baseURL={baseURL} />\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,oBAAoB,qBAAgC;CAC/D,MAAM;CACN,WAAW,EAAE,YAAY,WAAW,UAAU;EAC5C,MAAM,gBAAgB,kBAAkB;EAExC,MAAM,MAAM,QAAQ;EACpB,MAAM,EAAE,SAAS,YAAY,oBAAoB,UAAU;EAE3D,MAAM,OAAO,cAAc,QAAQ;GAAE,MAAM;GAAY,SAAS;GAAO,WAAW,OAAO;GAAK,CAAC;EAE/F,MAAM,UAAU,WAAW,KAAK,cAAc;GAC5C,MAAM,gBAAgB,QAAQ,WAAW,EAAE,WAAW,OAAO,KAAK,CAAC;GACnE,MAAM,gBAAgB,QAAQ,WAAW;IAAE,WAAW,O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AM,YAAY;MAAkB,CACnG;IACH,WAAW,WACV,oBAAC;KACC,MAAM,KAAK;KACX,UAAU,KAAK,QAAQ,SAAS;KAChC,WAAW,MAAM,QAAQ,SAAS;KACvB;KACF;MACT;IAEH,WAAW,UACV,oBAAC;KAAK,MAAM,KAAK;KAAM,UAAU,KAAK,QAAQ,SAAS;KAAM,WAAW,MAAM,QAAQ,SAAS;KAAiB;KAAoB;MAAW;;IAE5I;;CAGZ,CAAC"}
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { n as PluginMsw, r as ReactGenerator } from "./types-
|
|
1
|
+
import "./index-h4uz5Q5r.js";
|
|
2
|
+
import { n as PluginMsw, r as ReactGenerator } from "./types-D7y8D-LQ.js";
|
|
3
3
|
|
|
4
4
|
//#region src/generators/handlersGenerator.d.ts
|
|
5
5
|
declare const handlersGenerator: ReactGenerator<PluginMsw>;
|
package/dist/generators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./components-
|
|
2
|
-
import { n as handlersGenerator, t as mswGenerator } from "./generators-
|
|
1
|
+
import "./components-DK6Olrp_.js";
|
|
2
|
+
import { n as handlersGenerator, t as mswGenerator } from "./generators-DmpieAeS.js";
|
|
3
3
|
|
|
4
4
|
export { handlersGenerator, mswGenerator };
|
|
@@ -561,4 +561,4 @@ type FileMetaBase = {
|
|
|
561
561
|
};
|
|
562
562
|
//#endregion
|
|
563
563
|
export { Output as a, ResolveNameParams as c, Oas as d, HttpMethod as f, contentType as h, Group as i, UserPluginWithLifeCycle as l, SchemaObject$1 as m, PluginManager as n, Plugin as o, Operation$1 as p, Config as r, PluginFactoryOptions as s, FileMetaBase as t, BaseGenerator as u };
|
|
564
|
-
//# sourceMappingURL=index-
|
|
564
|
+
//# sourceMappingURL=index-h4uz5Q5r.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as UserPluginWithLifeCycle } from "./index-
|
|
2
|
-
import { n as PluginMsw, t as Options } from "./types-
|
|
1
|
+
import { l as UserPluginWithLifeCycle } from "./index-h4uz5Q5r.js";
|
|
2
|
+
import { n as PluginMsw, t as Options } from "./types-D7y8D-LQ.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin.d.ts
|
|
5
5
|
declare const pluginMswName = "plugin-msw";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./components-
|
|
2
|
-
import { n as handlersGenerator, t as mswGenerator } from "./generators-
|
|
1
|
+
import "./components-DK6Olrp_.js";
|
|
2
|
+
import { n as handlersGenerator, t as mswGenerator } from "./generators-DmpieAeS.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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Output, c as ResolveNameParams, d as Oas, f as HttpMethod, h as contentType, i as Group, m as SchemaObject, n as PluginManager, o as Plugin, p as Operation, r as Config, s as PluginFactoryOptions, t as FileMetaBase, u as BaseGenerator } from "./index-
|
|
1
|
+
import { a as Output, c as ResolveNameParams, d as Oas, f as HttpMethod, h as contentType, i as Group, m as SchemaObject, n as PluginManager, o as Plugin, p as Operation, r as Config, s as PluginFactoryOptions, t as FileMetaBase, u as BaseGenerator } from "./index-h4uz5Q5r.js";
|
|
2
2
|
import { Fabric } from "@kubb/react-fabric";
|
|
3
3
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
4
4
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
@@ -508,4 +508,4 @@ type ResolvedOptions = {
|
|
|
508
508
|
type PluginMsw = PluginFactoryOptions<'plugin-msw', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
509
509
|
//#endregion
|
|
510
510
|
export { PluginMsw as n, ReactGenerator as r, Options$1 as t };
|
|
511
|
-
//# sourceMappingURL=types-
|
|
511
|
+
//# sourceMappingURL=types-D7y8D-LQ.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-msw",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.3",
|
|
4
4
|
"description": "Mock Service Worker (MSW) handlers generator plugin for Kubb, creating API mocks from OpenAPI specifications for frontend development and testing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"msw",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
],
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@kubb/react-fabric": "0.5.2",
|
|
77
|
-
"@kubb/core": "4.7.
|
|
78
|
-
"@kubb/oas": "4.7.
|
|
79
|
-
"@kubb/plugin-faker": "4.7.
|
|
80
|
-
"@kubb/plugin-oas": "4.7.
|
|
81
|
-
"@kubb/plugin-ts": "4.7.
|
|
77
|
+
"@kubb/core": "4.7.3",
|
|
78
|
+
"@kubb/oas": "4.7.3",
|
|
79
|
+
"@kubb/plugin-faker": "4.7.3",
|
|
80
|
+
"@kubb/plugin-oas": "4.7.3",
|
|
81
|
+
"@kubb/plugin-ts": "4.7.3"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {},
|
|
84
84
|
"engines": {
|
package/dist/chunk-CT0EDfkp.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
|
-
key = keys[i];
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
15
|
-
__defProp(to, key, {
|
|
16
|
-
get: ((k) => from[k]).bind(null, key),
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
-
value: mod,
|
|
26
|
-
enumerable: true
|
|
27
|
-
}) : target, mod));
|
|
28
|
-
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
export { };
|