@kubb/plugin-msw 3.1.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-msw",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "Generator swagger",
5
5
  "keywords": [
6
6
  "typescript",
@@ -74,21 +74,21 @@
74
74
  "!/**/__tests__/**"
75
75
  ],
76
76
  "dependencies": {
77
- "@kubb/core": "3.1.0",
78
- "@kubb/fs": "3.1.0",
79
- "@kubb/oas": "3.1.0",
80
- "@kubb/plugin-faker": "3.1.0",
81
- "@kubb/plugin-oas": "3.1.0",
82
- "@kubb/plugin-ts": "3.1.0",
83
- "@kubb/react": "3.1.0"
77
+ "@kubb/core": "3.3.0",
78
+ "@kubb/fs": "3.3.0",
79
+ "@kubb/oas": "3.3.0",
80
+ "@kubb/plugin-faker": "3.3.0",
81
+ "@kubb/plugin-oas": "3.3.0",
82
+ "@kubb/plugin-ts": "3.3.0",
83
+ "@kubb/react": "3.3.0"
84
84
  },
85
85
  "devDependencies": {
86
- "@types/react": "^18.3.13",
86
+ "@types/react": "^18.3.16",
87
87
  "react": "^18.3.1",
88
88
  "tsup": "^8.3.5",
89
89
  "typescript": "^5.7.2",
90
- "@kubb/config-ts": "3.1.0",
91
- "@kubb/config-tsup": "3.1.0"
90
+ "@kubb/config-ts": "3.3.0",
91
+ "@kubb/config-tsup": "3.3.0"
92
92
  },
93
93
  "peerDependencies": {
94
94
  "@kubb/react": "^3.0.0"
@@ -1,13 +1,13 @@
1
- import { http } from "msw";
1
+ import { http } from 'msw'
2
2
 
3
- export function createPets(data?: CreatePetsMutationResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Response)) {
4
- return http.post("*/pets", function handler(info) {
5
- if (typeof data === "function")
6
- return data(info);
7
- return new Response(JSON.stringify(data), {
8
- headers: {
9
- "Content-Type": "application/json",
10
- },
11
- });
12
- });
3
+ export function createPets(data?: CreatePetsMutationResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Response)) {
4
+ return http.post('*/pets', function handler(info) {
5
+ if (typeof data === 'function') return data(info)
6
+
7
+ return new Response(JSON.stringify(data), {
8
+ headers: {
9
+ 'Content-Type': 'application/json',
10
+ },
11
+ })
12
+ })
13
13
  }
@@ -1,13 +1,13 @@
1
- import { http } from "msw";
1
+ import { http } from 'msw'
2
2
 
3
- export function deletePetsPetid(data?: DeletePetsPetidMutationResponse | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Response)) {
4
- return http.delete("*/pets/:petId", function handler(info) {
5
- if (typeof data === "function")
6
- return data(info);
7
- return new Response(JSON.stringify(data), {
8
- headers: {
9
- "Content-Type": "application/json",
10
- },
11
- });
12
- });
3
+ export function deletePetsPetid(data?: DeletePetsPetidMutationResponse | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Response)) {
4
+ return http.delete('*/pets/:petId', function handler(info) {
5
+ if (typeof data === 'function') return data(info)
6
+
7
+ return new Response(JSON.stringify(data), {
8
+ headers: {
9
+ 'Content-Type': 'application/json',
10
+ },
11
+ })
12
+ })
13
13
  }
@@ -1,13 +1,13 @@
1
- import { http } from "msw";
1
+ import { http } from 'msw'
2
2
 
3
- export function listPets(data?: ListPetsQueryResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)) {
4
- return http.get("*/pets", function handler(info) {
5
- if (typeof data === "function")
6
- return data(info);
7
- return new Response(JSON.stringify(data), {
8
- headers: {
9
- "Content-Type": "application/json",
10
- },
11
- });
12
- });
3
+ export function listPets(data?: ListPetsQueryResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)) {
4
+ return http.get('*/pets', function handler(info) {
5
+ if (typeof data === 'function') return data(info)
6
+
7
+ return new Response(JSON.stringify(data), {
8
+ headers: {
9
+ 'Content-Type': 'application/json',
10
+ },
11
+ })
12
+ })
13
13
  }
@@ -1,13 +1,13 @@
1
- import { http } from "msw";
1
+ import { http } from 'msw'
2
2
 
3
- export function listPets(data?: ListPetsQueryResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)) {
4
- return http.get("*/pets", function handler(info) {
5
- if (typeof data === "function")
6
- return data(info);
7
- return new Response(JSON.stringify(data || listPetsQueryResponse(data)), {
8
- headers: {
9
- "Content-Type": "application/json",
10
- },
11
- });
12
- });
3
+ export function listPets(data?: ListPetsQueryResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)) {
4
+ return http.get('*/pets', function handler(info) {
5
+ if (typeof data === 'function') return data(info)
6
+
7
+ return new Response(JSON.stringify(data || listPetsQueryResponse(data)), {
8
+ headers: {
9
+ 'Content-Type': 'application/json',
10
+ },
11
+ })
12
+ })
13
13
  }
@@ -1,3 +1,3 @@
1
- import { listPets, createPets, showPetById } from "./findByTags";
1
+ import { listPets, createPets, showPetById } from './findByTags'
2
2
 
3
- export const handlers = [listPets(), createPets(), showPetById()] as const;
3
+ export const handlers = [listPets(), createPets(), showPetById()] as const
@@ -1,13 +1,13 @@
1
- import { http } from "msw";
1
+ import { http } from 'msw'
2
2
 
3
- export function showPetById(data?: ShowPetByIdQueryResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)) {
4
- return http.get("*/pets/:petId", function handler(info) {
5
- if (typeof data === "function")
6
- return data(info);
7
- return new Response(JSON.stringify(data), {
8
- headers: {
9
- "Content-Type": "application/json",
10
- },
11
- });
12
- });
3
+ export function showPetById(data?: ShowPetByIdQueryResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)) {
4
+ return http.get('*/pets/:petId', function handler(info) {
5
+ if (typeof data === 'function') return data(info)
6
+
7
+ return new Response(JSON.stringify(data), {
8
+ headers: {
9
+ 'Content-Type': 'application/json',
10
+ },
11
+ })
12
+ })
13
13
  }