msw 0.34.0 → 0.36.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/esm/RequestHandler-deps.js +391 -66
  2. package/lib/esm/errors-deps.js +15 -1
  3. package/lib/esm/fetch-deps.js +9 -5
  4. package/lib/esm/graphql-deps.js +10 -6
  5. package/lib/esm/graphql.js +1 -0
  6. package/lib/esm/index-deps.js +2 -1
  7. package/lib/esm/index.js +102 -3893
  8. package/lib/esm/index2.js +1 -1
  9. package/lib/esm/mockServiceWorker.js +5 -5
  10. package/lib/esm/rest-deps.js +7 -15
  11. package/lib/esm/rest.js +1 -0
  12. package/lib/iife/index.js +3 -3
  13. package/lib/iife/mockServiceWorker.js +5 -5
  14. package/lib/types/context/data.d.ts +2 -3
  15. package/lib/types/context/extensions.d.ts +8 -0
  16. package/lib/types/context/index.d.ts +1 -0
  17. package/lib/types/graphql.d.ts +2 -1
  18. package/lib/types/handlers/GraphQLHandler.d.ts +7 -6
  19. package/lib/types/handlers/RequestHandler.d.ts +8 -8
  20. package/lib/types/handlers/RestHandler.d.ts +10 -12
  21. package/lib/types/index.d.ts +17 -7
  22. package/lib/types/native/index.d.ts +1 -1
  23. package/lib/types/node/glossary.d.ts +4 -14
  24. package/lib/types/node/index.d.ts +1 -1
  25. package/lib/types/node/setupServer.d.ts +1 -1
  26. package/lib/types/rest.d.ts +10 -9
  27. package/lib/types/setupWorker/glossary.d.ts +16 -26
  28. package/lib/types/setupWorker/start/utils/prepareStartHandler.d.ts +3 -3
  29. package/lib/types/sharedOptions.d.ts +12 -1
  30. package/lib/types/typeUtils.d.ts +5 -3
  31. package/lib/types/utils/getResponse.d.ts +1 -1
  32. package/lib/types/utils/handleRequest.d.ts +4 -4
  33. package/lib/types/utils/internal/getCallFrame.d.ts +1 -1
  34. package/lib/types/utils/internal/jsonParse.d.ts +2 -2
  35. package/lib/types/utils/internal/pipeEvents.d.ts +6 -0
  36. package/lib/types/utils/internal/requestHandlerUtils.d.ts +1 -1
  37. package/lib/types/utils/logging/prepareResponse.d.ts +1 -1
  38. package/lib/types/utils/matching/matchRequestUrl.d.ts +12 -2
  39. package/lib/types/utils/matching/normalizePath.d.ts +1 -1
  40. package/lib/types/utils/request/onUnhandledRequest.d.ts +1 -2
  41. package/lib/types/utils/request/parseBody.d.ts +2 -2
  42. package/lib/types/utils/request/parseWorkerRequest.d.ts +2 -2
  43. package/lib/types/utils/worker/createFallbackRequestListener.d.ts +2 -1
  44. package/lib/types/utils/worker/createRequestListener.d.ts +2 -1
  45. package/lib/umd/index.js +1070 -243
  46. package/lib/umd/mockServiceWorker.js +5 -5
  47. package/native/lib/index.js +501 -501
  48. package/node/lib/index.js +503 -503
  49. package/package.json +19 -19
@@ -2,13 +2,13 @@
2
2
  /* tslint:disable */
3
3
 
4
4
  /**
5
- * Mock Service Worker (0.34.0).
5
+ * Mock Service Worker (0.36.2).
6
6
  * @see https://github.com/mswjs/msw
7
7
  * - Please do NOT modify this file.
8
8
  * - Please do NOT serve this file on production.
9
9
  */
10
10
 
11
- const INTEGRITY_CHECKSUM = 'f0a916b13c8acc2b526a03a6d26df85f'
11
+ const INTEGRITY_CHECKSUM = '02f4ad4a2797f85668baf196e553d929'
12
12
  const bypassHeaderName = 'x-msw-bypass'
13
13
  const activeClientIds = new Set()
14
14
 
@@ -83,11 +83,11 @@ self.addEventListener('message', async function (event) {
83
83
  }
84
84
  })
85
85
 
86
- // Resolve the "master" client for the given event.
86
+ // Resolve the "main" client for the given event.
87
87
  // Client that issues a request doesn't necessarily equal the client
88
88
  // that registered the worker. It's with the latter the worker should
89
89
  // communicate with during the response resolving phase.
90
- async function resolveMasterClient(event) {
90
+ async function resolveMainClient(event) {
91
91
  const client = await self.clients.get(event.clientId)
92
92
 
93
93
  if (client.frameType === 'top-level') {
@@ -109,7 +109,7 @@ async function resolveMasterClient(event) {
109
109
  }
110
110
 
111
111
  async function handleRequest(event, requestId) {
112
- const client = await resolveMasterClient(event)
112
+ const client = await resolveMainClient(event)
113
113
  const response = await getResponse(event, client, requestId)
114
114
 
115
115
  // Send back the response clone for the "response:*" life-cycle events.