msw 2.8.3 → 2.8.5
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 +91 -46
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/index.mjs +91 -46
- package/lib/browser/index.mjs.map +1 -1
- package/lib/core/{GraphQLHandler-CZ1KkkXH.d.mts → GraphQLHandler-DOXAygvT.d.mts} +2 -2
- package/lib/core/{GraphQLHandler-D9s3a7Hb.d.ts → GraphQLHandler-noP9MRWa.d.ts} +2 -2
- package/lib/core/{HttpResponse-DAxViIqi.d.mts → HttpResponse-BOGtXZ-B.d.mts} +4 -4
- package/lib/core/{HttpResponse-CSWX6ahe.d.ts → HttpResponse-DzeJL_i8.d.ts} +4 -4
- package/lib/core/HttpResponse.d.mts +1 -1
- package/lib/core/HttpResponse.d.ts +1 -1
- package/lib/core/HttpResponse.js.map +1 -1
- package/lib/core/HttpResponse.mjs.map +1 -1
- package/lib/core/SetupApi.d.mts +1 -1
- package/lib/core/SetupApi.d.ts +1 -1
- package/lib/core/getResponse.d.mts +1 -1
- package/lib/core/getResponse.d.ts +1 -1
- package/lib/core/graphql.d.mts +2 -2
- package/lib/core/graphql.d.ts +2 -2
- package/lib/core/handlers/GraphQLHandler.d.mts +2 -2
- package/lib/core/handlers/GraphQLHandler.d.ts +2 -2
- package/lib/core/handlers/GraphQLHandler.js.map +1 -1
- package/lib/core/handlers/GraphQLHandler.mjs.map +1 -1
- package/lib/core/handlers/HttpHandler.d.mts +1 -1
- package/lib/core/handlers/HttpHandler.d.ts +1 -1
- package/lib/core/handlers/RequestHandler.d.mts +1 -1
- package/lib/core/handlers/RequestHandler.d.ts +1 -1
- package/lib/core/http.d.mts +1 -1
- package/lib/core/http.d.ts +1 -1
- package/lib/core/index.d.mts +2 -2
- package/lib/core/index.d.ts +2 -2
- package/lib/core/passthrough.d.mts +1 -1
- package/lib/core/passthrough.d.ts +1 -1
- package/lib/core/utils/HttpResponse/decorators.d.mts +1 -1
- package/lib/core/utils/HttpResponse/decorators.d.ts +1 -1
- package/lib/core/utils/executeHandlers.d.mts +1 -1
- package/lib/core/utils/executeHandlers.d.ts +1 -1
- package/lib/core/utils/handleRequest.d.mts +1 -1
- package/lib/core/utils/handleRequest.d.ts +1 -1
- package/lib/core/utils/internal/isHandlerKind.d.mts +1 -1
- package/lib/core/utils/internal/isHandlerKind.d.ts +1 -1
- package/lib/core/utils/internal/parseGraphQLRequest.d.mts +2 -2
- package/lib/core/utils/internal/parseGraphQLRequest.d.ts +2 -2
- package/lib/core/utils/internal/parseMultipartData.d.mts +1 -1
- package/lib/core/utils/internal/parseMultipartData.d.ts +1 -1
- package/lib/core/utils/internal/requestHandlerUtils.d.mts +1 -1
- package/lib/core/utils/internal/requestHandlerUtils.d.ts +1 -1
- package/lib/core/ws/handleWebSocketEvent.d.mts +1 -1
- package/lib/core/ws/handleWebSocketEvent.d.ts +1 -1
- package/lib/iife/index.js +96 -51
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +4 -4
- package/src/core/HttpResponse.ts +8 -5
- package/src/core/handlers/GraphQLHandler.ts +1 -1
package/lib/mockServiceWorker.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Please do NOT serve this file on production.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
const PACKAGE_VERSION = '2.8.
|
|
11
|
+
const PACKAGE_VERSION = '2.8.5'
|
|
12
12
|
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'
|
|
13
13
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
14
14
|
const activeClientIds = new Set()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "msw",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.5",
|
|
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",
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
"@bundled-es-modules/statuses": "^1.0.1",
|
|
219
219
|
"@bundled-es-modules/tough-cookie": "^0.1.6",
|
|
220
220
|
"@inquirer/confirm": "^5.0.0",
|
|
221
|
-
"@mswjs/interceptors": "^0.
|
|
221
|
+
"@mswjs/interceptors": "^0.38.7",
|
|
222
222
|
"@open-draft/deferred-promise": "^2.2.0",
|
|
223
223
|
"@open-draft/until": "^2.1.0",
|
|
224
224
|
"@types/cookie": "^0.6.0",
|
|
@@ -275,11 +275,11 @@
|
|
|
275
275
|
"typescript": "^5.5.2",
|
|
276
276
|
"undici": "^6.20.0",
|
|
277
277
|
"url-loader": "^4.1.1",
|
|
278
|
-
"vitest": "^3.1.
|
|
278
|
+
"vitest": "^3.1.4",
|
|
279
279
|
"vitest-environment-miniflare": "^2.14.4",
|
|
280
280
|
"webpack": "^5.95.0",
|
|
281
281
|
"webpack-http-server": "^0.5.0",
|
|
282
|
-
"msw": "2.8.
|
|
282
|
+
"msw": "2.8.5"
|
|
283
283
|
},
|
|
284
284
|
"peerDependencies": {
|
|
285
285
|
"typescript": ">= 4.8.x"
|
package/src/core/HttpResponse.ts
CHANGED
|
@@ -116,7 +116,7 @@ export class HttpResponse<
|
|
|
116
116
|
static xml<BodyType extends string>(
|
|
117
117
|
body?: BodyType | null,
|
|
118
118
|
init?: HttpResponseInit,
|
|
119
|
-
):
|
|
119
|
+
): HttpResponse<BodyType> {
|
|
120
120
|
const responseInit = normalizeResponseInit(init)
|
|
121
121
|
|
|
122
122
|
if (!responseInit.headers.has('Content-Type')) {
|
|
@@ -135,7 +135,7 @@ export class HttpResponse<
|
|
|
135
135
|
static html<BodyType extends string>(
|
|
136
136
|
body?: BodyType | null,
|
|
137
137
|
init?: HttpResponseInit,
|
|
138
|
-
):
|
|
138
|
+
): HttpResponse<BodyType> {
|
|
139
139
|
const responseInit = normalizeResponseInit(init)
|
|
140
140
|
|
|
141
141
|
if (!responseInit.headers.has('Content-Type')) {
|
|
@@ -157,7 +157,7 @@ export class HttpResponse<
|
|
|
157
157
|
static arrayBuffer(
|
|
158
158
|
body?: ArrayBuffer | SharedArrayBuffer,
|
|
159
159
|
init?: HttpResponseInit,
|
|
160
|
-
):
|
|
160
|
+
): HttpResponse<ArrayBuffer | SharedArrayBuffer> {
|
|
161
161
|
const responseInit = normalizeResponseInit(init)
|
|
162
162
|
|
|
163
163
|
if (!responseInit.headers.has('Content-Type')) {
|
|
@@ -168,7 +168,7 @@ export class HttpResponse<
|
|
|
168
168
|
responseInit.headers.set('Content-Length', body.byteLength.toString())
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
return new HttpResponse(body
|
|
171
|
+
return new HttpResponse(body, responseInit)
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
/**
|
|
@@ -179,7 +179,10 @@ export class HttpResponse<
|
|
|
179
179
|
*
|
|
180
180
|
* HttpResponse.formData(data)
|
|
181
181
|
*/
|
|
182
|
-
static formData(
|
|
182
|
+
static formData(
|
|
183
|
+
body?: FormData,
|
|
184
|
+
init?: HttpResponseInit,
|
|
185
|
+
): HttpResponse<FormData> {
|
|
183
186
|
return new HttpResponse(body, normalizeResponseInit(init))
|
|
184
187
|
}
|
|
185
188
|
}
|
|
@@ -24,7 +24,7 @@ import { getAllRequestCookies } from '../utils/request/getRequestCookies'
|
|
|
24
24
|
export type ExpectedOperationTypeNode = OperationTypeNode | 'all'
|
|
25
25
|
export type GraphQLHandlerNameSelector = DocumentNode | RegExp | string
|
|
26
26
|
|
|
27
|
-
export type GraphQLQuery = Record<string, any>
|
|
27
|
+
export type GraphQLQuery = Record<string, any> | null
|
|
28
28
|
export type GraphQLVariables = Record<string, any>
|
|
29
29
|
|
|
30
30
|
export interface GraphQLHandlerInfo extends RequestHandlerDefaultInfo {
|