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.
Files changed (46) hide show
  1. package/lib/core/{GraphQLHandler-GA1kyXQ7.d.mts → GraphQLHandler-CZ1KkkXH.d.mts} +1 -1
  2. package/lib/core/{GraphQLHandler-DOfinX9J.d.ts → GraphQLHandler-D9s3a7Hb.d.ts} +1 -1
  3. package/lib/core/{HttpResponse-DQOloMJy.d.ts → HttpResponse-CSWX6ahe.d.ts} +6 -6
  4. package/lib/core/{HttpResponse-Bls5AXtT.d.mts → HttpResponse-DAxViIqi.d.mts} +6 -6
  5. package/lib/core/HttpResponse.d.mts +1 -1
  6. package/lib/core/HttpResponse.d.ts +1 -1
  7. package/lib/core/HttpResponse.js.map +1 -1
  8. package/lib/core/HttpResponse.mjs.map +1 -1
  9. package/lib/core/SetupApi.d.mts +1 -1
  10. package/lib/core/SetupApi.d.ts +1 -1
  11. package/lib/core/getResponse.d.mts +1 -1
  12. package/lib/core/getResponse.d.ts +1 -1
  13. package/lib/core/graphql.d.mts +2 -2
  14. package/lib/core/graphql.d.ts +2 -2
  15. package/lib/core/handlers/GraphQLHandler.d.mts +2 -2
  16. package/lib/core/handlers/GraphQLHandler.d.ts +2 -2
  17. package/lib/core/handlers/HttpHandler.d.mts +1 -1
  18. package/lib/core/handlers/HttpHandler.d.ts +1 -1
  19. package/lib/core/handlers/RequestHandler.d.mts +1 -1
  20. package/lib/core/handlers/RequestHandler.d.ts +1 -1
  21. package/lib/core/http.d.mts +1 -1
  22. package/lib/core/http.d.ts +1 -1
  23. package/lib/core/index.d.mts +2 -2
  24. package/lib/core/index.d.ts +2 -2
  25. package/lib/core/passthrough.d.mts +1 -1
  26. package/lib/core/passthrough.d.ts +1 -1
  27. package/lib/core/utils/HttpResponse/decorators.d.mts +1 -1
  28. package/lib/core/utils/HttpResponse/decorators.d.ts +1 -1
  29. package/lib/core/utils/executeHandlers.d.mts +1 -1
  30. package/lib/core/utils/executeHandlers.d.ts +1 -1
  31. package/lib/core/utils/handleRequest.d.mts +1 -1
  32. package/lib/core/utils/handleRequest.d.ts +1 -1
  33. package/lib/core/utils/internal/isHandlerKind.d.mts +1 -1
  34. package/lib/core/utils/internal/isHandlerKind.d.ts +1 -1
  35. package/lib/core/utils/internal/parseGraphQLRequest.d.mts +2 -2
  36. package/lib/core/utils/internal/parseGraphQLRequest.d.ts +2 -2
  37. package/lib/core/utils/internal/parseMultipartData.d.mts +1 -1
  38. package/lib/core/utils/internal/parseMultipartData.d.ts +1 -1
  39. package/lib/core/utils/internal/requestHandlerUtils.d.mts +1 -1
  40. package/lib/core/utils/internal/requestHandlerUtils.d.ts +1 -1
  41. package/lib/core/ws/handleWebSocketEvent.d.mts +1 -1
  42. package/lib/core/ws/handleWebSocketEvent.d.ts +1 -1
  43. package/lib/iife/index.js.map +1 -1
  44. package/lib/mockServiceWorker.js +1 -1
  45. package/package.json +2 -2
  46. package/src/core/HttpResponse.ts +8 -8
@@ -8,7 +8,7 @@
8
8
  * - Please do NOT serve this file on production.
9
9
  */
10
10
 
11
- const PACKAGE_VERSION = '2.8.2'
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.2",
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.2"
282
+ "msw": "2.8.3"
283
283
  },
284
284
  "peerDependencies": {
285
285
  "typescript": ">= 4.8.x"
@@ -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
- interface StrictResponse<BodyType extends DefaultBodyType> extends Response {
23
- readonly [bodyType]: BodyType
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<BodyType extends DefaultBodyType>
38
- extends FetchResponse
39
- implements StrictResponse<BodyType>
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)