msw 2.11.5 → 2.12.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/lib/browser/index.js +365 -308
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/index.mjs +365 -308
- package/lib/browser/index.mjs.map +1 -1
- package/lib/core/index.d.mts +1 -0
- package/lib/core/index.d.ts +1 -0
- package/lib/core/index.js +2 -0
- package/lib/core/index.js.map +1 -1
- package/lib/core/index.mjs +4 -0
- package/lib/core/index.mjs.map +1 -1
- package/lib/core/sse.d.mts +116 -0
- package/lib/core/sse.d.ts +116 -0
- package/lib/core/sse.js +599 -0
- package/lib/core/sse.js.map +1 -0
- package/lib/core/sse.mjs +581 -0
- package/lib/core/sse.mjs.map +1 -0
- package/lib/core/utils/internal/isObject.d.mts +1 -1
- package/lib/core/utils/internal/isObject.d.ts +1 -1
- package/lib/core/utils/internal/isObject.js.map +1 -1
- package/lib/core/utils/internal/isObject.mjs.map +1 -1
- package/lib/core/ws/utils/attachWebSocketLogger.d.mts +7 -1
- package/lib/core/ws/utils/attachWebSocketLogger.d.ts +7 -1
- package/lib/core/ws/utils/attachWebSocketLogger.js +1 -0
- package/lib/core/ws/utils/attachWebSocketLogger.js.map +1 -1
- package/lib/core/ws/utils/attachWebSocketLogger.mjs +1 -0
- package/lib/core/ws/utils/attachWebSocketLogger.mjs.map +1 -1
- package/lib/core/ws/utils/getMessageLength.js +2 -1
- package/lib/core/ws/utils/getMessageLength.js.map +1 -1
- package/lib/core/ws/utils/getMessageLength.mjs +2 -1
- package/lib/core/ws/utils/getMessageLength.mjs.map +1 -1
- package/lib/core/ws/utils/getPublicData.js +2 -1
- package/lib/core/ws/utils/getPublicData.js.map +1 -1
- package/lib/core/ws/utils/getPublicData.mjs +2 -1
- package/lib/core/ws/utils/getPublicData.mjs.map +1 -1
- package/lib/iife/index.js +1367 -746
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +6 -4
- package/src/browser/tsconfig.browser.json +1 -1
- package/src/core/index.ts +9 -0
- package/src/core/sse.ts +897 -0
- package/src/core/utils/internal/isObject.ts +1 -1
- package/src/core/ws/utils/attachWebSocketLogger.ts +1 -1
- package/src/core/ws/utils/getMessageLength.ts +2 -1
- package/src/core/ws/utils/getPublicData.ts +3 -2
package/lib/mockServiceWorker.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - Please do NOT modify this file.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
const PACKAGE_VERSION = '2.
|
|
10
|
+
const PACKAGE_VERSION = '2.12.0'
|
|
11
11
|
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
|
|
12
12
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
13
13
|
const activeClientIds = new Set()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "msw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Seamless REST/GraphQL API mocking library for browser and Node.js.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./lib/core/index.js",
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
"sideEffects": false,
|
|
216
216
|
"dependencies": {
|
|
217
217
|
"@inquirer/confirm": "^5.0.0",
|
|
218
|
-
"@mswjs/interceptors": "^0.
|
|
218
|
+
"@mswjs/interceptors": "^0.40.0",
|
|
219
219
|
"@open-draft/deferred-promise": "^2.2.0",
|
|
220
220
|
"@types/statuses": "^2.0.4",
|
|
221
221
|
"cookie": "^1.0.2",
|
|
@@ -236,18 +236,20 @@
|
|
|
236
236
|
"devDependencies": {
|
|
237
237
|
"@commitlint/cli": "^18.4.4",
|
|
238
238
|
"@commitlint/config-conventional": "^18.4.4",
|
|
239
|
+
"@epic-web/test-server": "^0.1.6",
|
|
239
240
|
"@eslint/eslintrc": "^3.3.1",
|
|
240
241
|
"@eslint/js": "^9.34.0",
|
|
241
242
|
"@fastify/websocket": "^8.3.1",
|
|
242
243
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
243
244
|
"@open-draft/test-server": "^0.4.2",
|
|
245
|
+
"@playwright/test": "^1.50.1",
|
|
244
246
|
"@ossjs/release": "^0.10.0",
|
|
245
|
-
"@playwright/test": "^1.48.0",
|
|
246
247
|
"@swc/core": "^1.13.5",
|
|
247
248
|
"@types/eslint__js": "^8.42.3",
|
|
248
249
|
"@types/express": "^4.17.21",
|
|
249
250
|
"@types/json-bigint": "^1.0.4",
|
|
250
251
|
"@types/node": "18.x",
|
|
252
|
+
"@types/serviceworker": "^0.0.158",
|
|
251
253
|
"@typescript-eslint/eslint-plugin": "^8.42.0",
|
|
252
254
|
"@typescript-eslint/parser": "^8.42.0",
|
|
253
255
|
"@web/dev-server": "^0.1.38",
|
|
@@ -286,7 +288,7 @@
|
|
|
286
288
|
"vitest-environment-miniflare": "^2.14.4",
|
|
287
289
|
"webpack": "^5.95.0",
|
|
288
290
|
"webpack-http-server": "^0.5.0",
|
|
289
|
-
"msw": "2.
|
|
291
|
+
"msw": "2.12.0"
|
|
290
292
|
},
|
|
291
293
|
"peerDependencies": {
|
|
292
294
|
"typescript": ">= 4.8.x"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
// Expose browser-specific libraries only for the
|
|
5
5
|
// source code under the "src/browser" directory.
|
|
6
|
-
"lib": ["DOM", "WebWorker"]
|
|
6
|
+
"lib": ["DOM", "WebWorker", "DOM.Iterable"]
|
|
7
7
|
},
|
|
8
8
|
"include": ["../../global.d.ts", "./global.browser.d.ts", "./**/*.ts"]
|
|
9
9
|
}
|
package/src/core/index.ts
CHANGED
|
@@ -17,6 +17,15 @@ export {
|
|
|
17
17
|
type WebSocketHandlerConnection,
|
|
18
18
|
} from './handlers/WebSocketHandler'
|
|
19
19
|
|
|
20
|
+
/* Server-Sent Events */
|
|
21
|
+
export {
|
|
22
|
+
sse,
|
|
23
|
+
type ServerSentEventRequestHandler,
|
|
24
|
+
type ServerSentEventResolver,
|
|
25
|
+
type ServerSentEventResolverExtras,
|
|
26
|
+
type ServerSentEventMessage,
|
|
27
|
+
} from './sse'
|
|
28
|
+
|
|
20
29
|
/* Utils */
|
|
21
30
|
export { matchRequestUrl } from './utils/matching/matchRequestUrl'
|
|
22
31
|
export * from './utils/handleRequest'
|