msw 0.27.2 → 0.29.0
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/cli/init.js +14 -6
- package/lib/esm/RequestHandler-deps.js +128 -136
- package/lib/esm/fetch-deps.js +405 -118
- package/lib/esm/graphql-deps.js +11 -11
- package/lib/esm/index.js +4123 -660
- package/lib/esm/mockServiceWorker.js +5 -4
- package/lib/esm/rest-deps.js +2 -2
- package/lib/iife/index.js +4 -4
- package/lib/iife/mockServiceWorker.js +5 -4
- package/lib/types/handlers/GraphQLHandler.d.ts +2 -2
- package/lib/types/handlers/RequestHandler.d.ts +1 -1
- package/lib/types/handlers/RestHandler.d.ts +2 -2
- package/lib/types/node/createSetupServer.d.ts +1 -1
- package/lib/types/node/glossary.d.ts +5 -4
- package/lib/types/setupWorker/glossary.d.ts +21 -16
- package/lib/types/setupWorker/start/createFallbackStart.d.ts +2 -0
- package/lib/types/setupWorker/start/createStartHandler.d.ts +2 -0
- package/lib/types/setupWorker/start/utils/enableMocking.d.ts +5 -0
- package/lib/types/setupWorker/start/utils/prepareStartHandler.d.ts +9 -0
- package/lib/types/setupWorker/start/utils/printStartMessage.d.ts +7 -0
- package/lib/types/setupWorker/stop/createFallbackStop.d.ts +2 -0
- package/lib/types/setupWorker/stop/createStop.d.ts +2 -2
- package/lib/types/setupWorker/stop/utils/printStopMessage.d.ts +3 -0
- package/lib/types/sharedOptions.d.ts +3 -2
- package/lib/types/utils/getResponse.d.ts +2 -3
- package/lib/types/utils/handleRequest.d.ts +27 -0
- package/lib/types/utils/logging/prepareResponse.d.ts +3 -3
- package/lib/types/utils/request/parseIsomorphicRequest.d.ts +6 -0
- package/lib/types/utils/request/parseWorkerRequest.d.ts +4 -0
- package/lib/types/utils/worker/createFallbackRequestListener.d.ts +3 -0
- package/lib/umd/index.js +26209 -5348
- package/lib/umd/mockServiceWorker.js +5 -4
- package/native/lib/index.js +2456 -2108
- package/node/lib/index.js +2461 -2110
- package/package.json +34 -37
- package/lib/types/setupWorker/start/createStart.d.ts +0 -2
- package/lib/types/setupWorker/start/utils/activateMocking.d.ts +0 -2
package/lib/esm/graphql-deps.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { j as jsonParse, a as set, s as status, d as delay, f as fetch } from './fetch-deps.js';
|
|
2
2
|
import { d as data, e as errors } from './errors-deps.js';
|
|
3
|
-
import { g as getPublicUrlFromRequest,
|
|
3
|
+
import { g as getPublicUrlFromRequest, l as __rest, R as RequestHandler, m as matchRequestUrl, h as prepareRequest, i as prepareResponse, j as getTimestamp, k as getStatusCodeColor } from './RequestHandler-deps.js';
|
|
4
4
|
|
|
5
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
5
|
+
function _typeof$2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$2 = function _typeof(obj) { return typeof obj; }; } else { _typeof$2 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$2(obj); }
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Return true if `value` is object-like. A value is object-like if it's not
|
|
9
9
|
* `null` and has a `typeof` result of "object".
|
|
10
10
|
*/
|
|
11
11
|
function isObjectLike(value) {
|
|
12
|
-
return _typeof(value) == 'object' && value !== null;
|
|
12
|
+
return _typeof$2(value) == 'object' && value !== null;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator
|
|
@@ -111,9 +111,9 @@ function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "func
|
|
|
111
111
|
|
|
112
112
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
113
113
|
|
|
114
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
114
|
+
function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
115
115
|
|
|
116
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
116
|
+
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
|
117
117
|
|
|
118
118
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
119
119
|
|
|
@@ -333,7 +333,7 @@ var GraphQLError = /*#__PURE__*/function (_Error) {
|
|
|
333
333
|
return _this;
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
_createClass(GraphQLError, [{
|
|
336
|
+
_createClass$1(GraphQLError, [{
|
|
337
337
|
key: "toString",
|
|
338
338
|
value: function toString() {
|
|
339
339
|
return printError(this);
|
|
@@ -614,7 +614,7 @@ var TokenKind = Object.freeze({
|
|
|
614
614
|
* The enum type representing the token kinds values.
|
|
615
615
|
*/
|
|
616
616
|
|
|
617
|
-
function _typeof
|
|
617
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
618
618
|
var MAX_ARRAY_LENGTH = 10;
|
|
619
619
|
var MAX_RECURSIVE_DEPTH = 2;
|
|
620
620
|
/**
|
|
@@ -626,7 +626,7 @@ function inspect(value) {
|
|
|
626
626
|
}
|
|
627
627
|
|
|
628
628
|
function formatValue(value, seenValues) {
|
|
629
|
-
switch (_typeof
|
|
629
|
+
switch (_typeof(value)) {
|
|
630
630
|
case 'string':
|
|
631
631
|
return JSON.stringify(value);
|
|
632
632
|
|
|
@@ -768,9 +768,9 @@ function instanceOf(value, constructor) {
|
|
|
768
768
|
return false;
|
|
769
769
|
};
|
|
770
770
|
|
|
771
|
-
function _defineProperties
|
|
771
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
772
772
|
|
|
773
|
-
function _createClass
|
|
773
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
774
774
|
|
|
775
775
|
/**
|
|
776
776
|
* A representation of source input to GraphQL. The `name` and `locationOffset` parameters are
|
|
@@ -795,7 +795,7 @@ var Source = /*#__PURE__*/function () {
|
|
|
795
795
|
} // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet
|
|
796
796
|
|
|
797
797
|
|
|
798
|
-
_createClass
|
|
798
|
+
_createClass(Source, [{
|
|
799
799
|
key: SYMBOL_TO_STRING_TAG,
|
|
800
800
|
get: function get() {
|
|
801
801
|
return 'Source';
|