msw 2.8.2 → 2.8.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/lib/core/{GraphQLHandler-GA1kyXQ7.d.mts → GraphQLHandler-CZ1KkkXH.d.mts} +1 -1
- package/lib/core/{GraphQLHandler-DOfinX9J.d.ts → GraphQLHandler-D9s3a7Hb.d.ts} +1 -1
- package/lib/core/{HttpResponse-DQOloMJy.d.ts → HttpResponse-CSWX6ahe.d.ts} +6 -6
- package/lib/core/{HttpResponse-Bls5AXtT.d.mts → HttpResponse-DAxViIqi.d.mts} +6 -6
- 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/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.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +2 -2
- package/src/core/HttpResponse.ts +8 -8
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.3'
|
|
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.3",
|
|
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",
|
|
@@ -279,7 +279,7 @@
|
|
|
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.3"
|
|
283
283
|
},
|
|
284
284
|
"peerDependencies": {
|
|
285
285
|
"typescript": ">= 4.8.x"
|
package/src/core/HttpResponse.ts
CHANGED
|
@@ -18,10 +18,11 @@ export interface StrictRequest<BodyType extends JsonBodyType> extends Request {
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Opaque `Response` type that supports strict body type.
|
|
21
|
+
*
|
|
22
|
+
* @deprecated Please use {@link HttpResponse} instead.
|
|
21
23
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
24
|
+
export type StrictResponse<BodyType extends DefaultBodyType> =
|
|
25
|
+
HttpResponse<BodyType>
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* A drop-in replacement for the standard `Response` class
|
|
@@ -34,11 +35,10 @@ interface StrictResponse<BodyType extends DefaultBodyType> extends Response {
|
|
|
34
35
|
*
|
|
35
36
|
* @see {@link https://mswjs.io/docs/api/http-response `HttpResponse` API reference}
|
|
36
37
|
*/
|
|
37
|
-
export class HttpResponse<
|
|
38
|
-
extends
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
[bodyType]: BodyType = null as any
|
|
38
|
+
export class HttpResponse<
|
|
39
|
+
BodyType extends DefaultBodyType,
|
|
40
|
+
> extends FetchResponse {
|
|
41
|
+
readonly [bodyType]: BodyType = null as any
|
|
42
42
|
|
|
43
43
|
constructor(body?: NoInfer<BodyType> | null, init?: HttpResponseInit) {
|
|
44
44
|
const responseInit = normalizeResponseInit(init)
|