msw 2.7.1 → 2.7.2

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 (49) hide show
  1. package/lib/core/{GraphQLHandler-DYshTG2D.d.mts → GraphQLHandler-D4_CxZQj.d.mts} +1 -1
  2. package/lib/core/{GraphQLHandler-B2C8S1zW.d.ts → GraphQLHandler-Pox7fIFM.d.ts} +1 -1
  3. package/lib/core/{HttpResponse-3ReBq-Rf.d.mts → HttpResponse-BRDnWbjc.d.mts} +3 -2
  4. package/lib/core/{HttpResponse-BPOVeNkE.d.ts → HttpResponse-Cy7ytzUn.d.ts} +3 -2
  5. package/lib/core/HttpResponse.d.mts +1 -1
  6. package/lib/core/HttpResponse.d.ts +1 -1
  7. package/lib/core/HttpResponse.js +2 -0
  8. package/lib/core/HttpResponse.js.map +1 -1
  9. package/lib/core/HttpResponse.mjs +2 -0
  10. package/lib/core/HttpResponse.mjs.map +1 -1
  11. package/lib/core/SetupApi.d.mts +1 -1
  12. package/lib/core/SetupApi.d.ts +1 -1
  13. package/lib/core/getResponse.d.mts +1 -1
  14. package/lib/core/getResponse.d.ts +1 -1
  15. package/lib/core/graphql.d.mts +2 -2
  16. package/lib/core/graphql.d.ts +2 -2
  17. package/lib/core/handlers/GraphQLHandler.d.mts +2 -2
  18. package/lib/core/handlers/GraphQLHandler.d.ts +2 -2
  19. package/lib/core/handlers/HttpHandler.d.mts +1 -1
  20. package/lib/core/handlers/HttpHandler.d.ts +1 -1
  21. package/lib/core/handlers/RequestHandler.d.mts +1 -1
  22. package/lib/core/handlers/RequestHandler.d.ts +1 -1
  23. package/lib/core/http.d.mts +1 -1
  24. package/lib/core/http.d.ts +1 -1
  25. package/lib/core/index.d.mts +2 -2
  26. package/lib/core/index.d.ts +2 -2
  27. package/lib/core/passthrough.d.mts +1 -1
  28. package/lib/core/passthrough.d.ts +1 -1
  29. package/lib/core/utils/HttpResponse/decorators.d.mts +1 -1
  30. package/lib/core/utils/HttpResponse/decorators.d.ts +1 -1
  31. package/lib/core/utils/executeHandlers.d.mts +1 -1
  32. package/lib/core/utils/executeHandlers.d.ts +1 -1
  33. package/lib/core/utils/handleRequest.d.mts +1 -1
  34. package/lib/core/utils/handleRequest.d.ts +1 -1
  35. package/lib/core/utils/internal/isHandlerKind.d.mts +1 -1
  36. package/lib/core/utils/internal/isHandlerKind.d.ts +1 -1
  37. package/lib/core/utils/internal/parseGraphQLRequest.d.mts +2 -2
  38. package/lib/core/utils/internal/parseGraphQLRequest.d.ts +2 -2
  39. package/lib/core/utils/internal/parseMultipartData.d.mts +1 -1
  40. package/lib/core/utils/internal/parseMultipartData.d.ts +1 -1
  41. package/lib/core/utils/internal/requestHandlerUtils.d.mts +1 -1
  42. package/lib/core/utils/internal/requestHandlerUtils.d.ts +1 -1
  43. package/lib/core/ws/handleWebSocketEvent.d.mts +1 -1
  44. package/lib/core/ws/handleWebSocketEvent.d.ts +1 -1
  45. package/lib/iife/index.js +2 -0
  46. package/lib/iife/index.js.map +1 -1
  47. package/lib/mockServiceWorker.js +1 -1
  48. package/package.json +1 -1
  49. package/src/core/HttpResponse.ts +4 -2
@@ -8,7 +8,7 @@
8
8
  * - Please do NOT serve this file on production.
9
9
  */
10
10
 
11
- const PACKAGE_VERSION = '2.7.1'
11
+ const PACKAGE_VERSION = '2.7.2'
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.7.1",
3
+ "version": "2.7.2",
4
4
  "description": "Seamless REST/GraphQL API mocking library for browser and Node.js.",
5
5
  "main": "./lib/core/index.js",
6
6
  "module": "./lib/core/index.mjs",
@@ -6,12 +6,12 @@ import {
6
6
  normalizeResponseInit,
7
7
  } from './utils/HttpResponse/decorators'
8
8
 
9
+ const bodyType = Symbol('bodyType')
10
+
9
11
  export interface HttpResponseInit extends ResponseInit {
10
12
  type?: ResponseType
11
13
  }
12
14
 
13
- declare const bodyType: unique symbol
14
-
15
15
  export interface StrictRequest<BodyType extends DefaultBodyType>
16
16
  extends Request {
17
17
  json(): Promise<BodyType>
@@ -37,6 +37,8 @@ export interface StrictResponse<BodyType extends DefaultBodyType>
37
37
  * @see {@link https://mswjs.io/docs/api/http-response `HttpResponse` API reference}
38
38
  */
39
39
  export class HttpResponse extends FetchResponse {
40
+ readonly [bodyType]: any
41
+
40
42
  constructor(body?: BodyInit | null, init?: HttpResponseInit) {
41
43
  const responseInit = normalizeResponseInit(init)
42
44
  super(body, responseInit)