msw 0.0.0-fetch.rc-14 → 0.0.0-fetch.rc-16
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/README.md +28 -10
- package/lib/browser/index.d.ts +0 -6
- package/lib/browser/index.js +25 -40
- package/lib/browser/index.mjs +25 -40
- package/lib/core/NetworkError.d.ts +2 -2
- package/lib/core/SetupApi.d.ts +0 -1
- package/lib/core/handlers/GraphQLHandler.js +2 -2
- package/lib/core/handlers/GraphQLHandler.mjs +2 -2
- package/lib/core/handlers/{RestHandler.d.ts → HttpHandler.d.ts} +12 -12
- package/lib/core/handlers/{RestHandler.js → HttpHandler.js} +18 -18
- package/lib/core/handlers/{RestHandler.mjs → HttpHandler.mjs} +15 -15
- package/lib/core/{rest.d.ts → http.d.ts} +11 -11
- package/lib/core/{rest.js → http.js} +16 -16
- package/lib/core/http.mjs +22 -0
- package/lib/core/{rest.spec.js → http.spec.js} +3 -3
- package/lib/core/{rest.spec.mjs → http.spec.mjs} +3 -3
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.js +6 -6
- package/lib/core/index.mjs +6 -6
- package/lib/core/passthrough.d.ts +5 -2
- package/lib/core/sharedOptions.d.ts +45 -7
- package/lib/core/utils/handleRequest.js +13 -10
- package/lib/core/utils/handleRequest.mjs +13 -10
- package/lib/core/utils/logging/serializeResponse.js +16 -2
- package/lib/core/utils/logging/serializeResponse.mjs +6 -2
- package/lib/core/utils/request/onUnhandledRequest.js +6 -6
- package/lib/core/utils/request/onUnhandledRequest.mjs +7 -7
- package/lib/iife/index.js +494 -482
- package/lib/mockServiceWorker.js +20 -3
- package/lib/native/index.d.ts +0 -6
- package/lib/native/index.js +13 -17
- package/lib/native/index.mjs +13 -17
- package/lib/node/index.d.ts +0 -6
- package/lib/node/index.js +13 -17
- package/lib/node/index.mjs +13 -17
- package/package.json +5 -5
- package/lib/core/rest.mjs +0 -22
- /package/lib/core/{rest.spec.d.ts → http.spec.d.ts} +0 -0
package/lib/iife/index.js
CHANGED
|
@@ -82,14 +82,14 @@ var MockServiceWorker = (() => {
|
|
|
82
82
|
var iife_exports = {};
|
|
83
83
|
__export(iife_exports, {
|
|
84
84
|
GraphQLHandler: () => GraphQLHandler,
|
|
85
|
+
HttpHandler: () => HttpHandler,
|
|
86
|
+
HttpMethods: () => HttpMethods,
|
|
85
87
|
HttpResponse: () => HttpResponse,
|
|
86
88
|
MAX_SERVER_RESPONSE_TIME: () => MAX_SERVER_RESPONSE_TIME,
|
|
87
89
|
MIN_SERVER_RESPONSE_TIME: () => MIN_SERVER_RESPONSE_TIME,
|
|
88
90
|
NODE_SERVER_RESPONSE_TIME: () => NODE_SERVER_RESPONSE_TIME,
|
|
89
91
|
NetworkError: () => NetworkError,
|
|
90
|
-
RESTMethods: () => RESTMethods,
|
|
91
92
|
RequestHandler: () => RequestHandler,
|
|
92
|
-
RestHandler: () => RestHandler,
|
|
93
93
|
SET_TIMEOUT_MAX_ALLOWED_INT: () => SET_TIMEOUT_MAX_ALLOWED_INT,
|
|
94
94
|
SetupApi: () => SetupApi,
|
|
95
95
|
SetupWorkerApi: () => SetupWorkerApi,
|
|
@@ -98,9 +98,9 @@ var MockServiceWorker = (() => {
|
|
|
98
98
|
delay: () => delay,
|
|
99
99
|
graphql: () => graphql,
|
|
100
100
|
handleRequest: () => handleRequest,
|
|
101
|
+
http: () => http,
|
|
101
102
|
matchRequestUrl: () => matchRequestUrl,
|
|
102
103
|
passthrough: () => passthrough,
|
|
103
|
-
rest: () => rest,
|
|
104
104
|
setupWorker: () => setupWorker
|
|
105
105
|
});
|
|
106
106
|
|
|
@@ -127,12 +127,12 @@ var MockServiceWorker = (() => {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
function format(
|
|
130
|
+
function format(message3, ...positionals) {
|
|
131
131
|
if (positionals.length === 0) {
|
|
132
|
-
return
|
|
132
|
+
return message3;
|
|
133
133
|
}
|
|
134
134
|
let positionalIndex = 0;
|
|
135
|
-
let formattedMessage =
|
|
135
|
+
let formattedMessage = message3.replace(
|
|
136
136
|
POSITIONALS_EXP,
|
|
137
137
|
(match2, isEscaped, _, flag) => {
|
|
138
138
|
const positional = positionals[positionalIndex];
|
|
@@ -160,38 +160,38 @@ var MockServiceWorker = (() => {
|
|
|
160
160
|
error3.stack = nextStack.join("\n");
|
|
161
161
|
}
|
|
162
162
|
var InvariantError = class extends Error {
|
|
163
|
-
constructor(
|
|
164
|
-
super(
|
|
165
|
-
this.message =
|
|
163
|
+
constructor(message3, ...positionals) {
|
|
164
|
+
super(message3);
|
|
165
|
+
this.message = message3;
|
|
166
166
|
this.name = "Invariant Violation";
|
|
167
|
-
this.message = format(
|
|
167
|
+
this.message = format(message3, ...positionals);
|
|
168
168
|
cleanErrorStack(this);
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
|
-
var invariant = (predicate,
|
|
171
|
+
var invariant = (predicate, message3, ...positionals) => {
|
|
172
172
|
if (!predicate) {
|
|
173
|
-
throw new InvariantError(
|
|
173
|
+
throw new InvariantError(message3, ...positionals);
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
|
-
invariant.as = (ErrorConstructor, predicate,
|
|
176
|
+
invariant.as = (ErrorConstructor, predicate, message3, ...positionals) => {
|
|
177
177
|
if (!predicate) {
|
|
178
178
|
const isConstructor = ErrorConstructor.prototype.name != null;
|
|
179
|
-
const error3 = isConstructor ? new ErrorConstructor(format(
|
|
179
|
+
const error3 = isConstructor ? new ErrorConstructor(format(message3, positionals)) : ErrorConstructor(format(message3, positionals));
|
|
180
180
|
throw error3;
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
// src/core/utils/internal/devUtils.ts
|
|
185
185
|
var LIBRARY_PREFIX = "[MSW]";
|
|
186
|
-
function formatMessage(
|
|
187
|
-
const interpolatedMessage = format(
|
|
186
|
+
function formatMessage(message3, ...positionals) {
|
|
187
|
+
const interpolatedMessage = format(message3, ...positionals);
|
|
188
188
|
return `${LIBRARY_PREFIX} ${interpolatedMessage}`;
|
|
189
189
|
}
|
|
190
|
-
function warn(
|
|
191
|
-
console.warn(formatMessage(
|
|
190
|
+
function warn(message3, ...positionals) {
|
|
191
|
+
console.warn(formatMessage(message3, ...positionals));
|
|
192
192
|
}
|
|
193
|
-
function error(
|
|
194
|
-
console.error(formatMessage(
|
|
193
|
+
function error(message3, ...positionals) {
|
|
194
|
+
console.error(formatMessage(message3, ...positionals));
|
|
195
195
|
}
|
|
196
196
|
var devUtils = {
|
|
197
197
|
formatMessage,
|
|
@@ -790,14 +790,184 @@ var MockServiceWorker = (() => {
|
|
|
790
790
|
});
|
|
791
791
|
}
|
|
792
792
|
|
|
793
|
+
// node_modules/.pnpm/@bundled-es-modules+statuses@1.0.1/node_modules/@bundled-es-modules/statuses/index-esm.js
|
|
794
|
+
var __create = Object.create;
|
|
795
|
+
var __defProp2 = Object.defineProperty;
|
|
796
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
797
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
798
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
799
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
800
|
+
var __commonJS = (cb, mod) => function __require3() {
|
|
801
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
802
|
+
};
|
|
803
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
804
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
805
|
+
for (let key of __getOwnPropNames2(from))
|
|
806
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
807
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
808
|
+
}
|
|
809
|
+
return to;
|
|
810
|
+
};
|
|
811
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(
|
|
812
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
813
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
814
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
815
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
816
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
817
|
+
mod
|
|
818
|
+
));
|
|
819
|
+
var require_codes = __commonJS({
|
|
820
|
+
"node_modules/statuses/codes.json"(exports, module) {
|
|
821
|
+
module.exports = {
|
|
822
|
+
"100": "Continue",
|
|
823
|
+
"101": "Switching Protocols",
|
|
824
|
+
"102": "Processing",
|
|
825
|
+
"103": "Early Hints",
|
|
826
|
+
"200": "OK",
|
|
827
|
+
"201": "Created",
|
|
828
|
+
"202": "Accepted",
|
|
829
|
+
"203": "Non-Authoritative Information",
|
|
830
|
+
"204": "No Content",
|
|
831
|
+
"205": "Reset Content",
|
|
832
|
+
"206": "Partial Content",
|
|
833
|
+
"207": "Multi-Status",
|
|
834
|
+
"208": "Already Reported",
|
|
835
|
+
"226": "IM Used",
|
|
836
|
+
"300": "Multiple Choices",
|
|
837
|
+
"301": "Moved Permanently",
|
|
838
|
+
"302": "Found",
|
|
839
|
+
"303": "See Other",
|
|
840
|
+
"304": "Not Modified",
|
|
841
|
+
"305": "Use Proxy",
|
|
842
|
+
"307": "Temporary Redirect",
|
|
843
|
+
"308": "Permanent Redirect",
|
|
844
|
+
"400": "Bad Request",
|
|
845
|
+
"401": "Unauthorized",
|
|
846
|
+
"402": "Payment Required",
|
|
847
|
+
"403": "Forbidden",
|
|
848
|
+
"404": "Not Found",
|
|
849
|
+
"405": "Method Not Allowed",
|
|
850
|
+
"406": "Not Acceptable",
|
|
851
|
+
"407": "Proxy Authentication Required",
|
|
852
|
+
"408": "Request Timeout",
|
|
853
|
+
"409": "Conflict",
|
|
854
|
+
"410": "Gone",
|
|
855
|
+
"411": "Length Required",
|
|
856
|
+
"412": "Precondition Failed",
|
|
857
|
+
"413": "Payload Too Large",
|
|
858
|
+
"414": "URI Too Long",
|
|
859
|
+
"415": "Unsupported Media Type",
|
|
860
|
+
"416": "Range Not Satisfiable",
|
|
861
|
+
"417": "Expectation Failed",
|
|
862
|
+
"418": "I'm a Teapot",
|
|
863
|
+
"421": "Misdirected Request",
|
|
864
|
+
"422": "Unprocessable Entity",
|
|
865
|
+
"423": "Locked",
|
|
866
|
+
"424": "Failed Dependency",
|
|
867
|
+
"425": "Too Early",
|
|
868
|
+
"426": "Upgrade Required",
|
|
869
|
+
"428": "Precondition Required",
|
|
870
|
+
"429": "Too Many Requests",
|
|
871
|
+
"431": "Request Header Fields Too Large",
|
|
872
|
+
"451": "Unavailable For Legal Reasons",
|
|
873
|
+
"500": "Internal Server Error",
|
|
874
|
+
"501": "Not Implemented",
|
|
875
|
+
"502": "Bad Gateway",
|
|
876
|
+
"503": "Service Unavailable",
|
|
877
|
+
"504": "Gateway Timeout",
|
|
878
|
+
"505": "HTTP Version Not Supported",
|
|
879
|
+
"506": "Variant Also Negotiates",
|
|
880
|
+
"507": "Insufficient Storage",
|
|
881
|
+
"508": "Loop Detected",
|
|
882
|
+
"509": "Bandwidth Limit Exceeded",
|
|
883
|
+
"510": "Not Extended",
|
|
884
|
+
"511": "Network Authentication Required"
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
var require_statuses = __commonJS({
|
|
889
|
+
"node_modules/statuses/index.js"(exports, module) {
|
|
890
|
+
"use strict";
|
|
891
|
+
var codes = require_codes();
|
|
892
|
+
module.exports = status2;
|
|
893
|
+
status2.message = codes;
|
|
894
|
+
status2.code = createMessageToStatusCodeMap(codes);
|
|
895
|
+
status2.codes = createStatusCodeList(codes);
|
|
896
|
+
status2.redirect = {
|
|
897
|
+
300: true,
|
|
898
|
+
301: true,
|
|
899
|
+
302: true,
|
|
900
|
+
303: true,
|
|
901
|
+
305: true,
|
|
902
|
+
307: true,
|
|
903
|
+
308: true
|
|
904
|
+
};
|
|
905
|
+
status2.empty = {
|
|
906
|
+
204: true,
|
|
907
|
+
205: true,
|
|
908
|
+
304: true
|
|
909
|
+
};
|
|
910
|
+
status2.retry = {
|
|
911
|
+
502: true,
|
|
912
|
+
503: true,
|
|
913
|
+
504: true
|
|
914
|
+
};
|
|
915
|
+
function createMessageToStatusCodeMap(codes2) {
|
|
916
|
+
var map = {};
|
|
917
|
+
Object.keys(codes2).forEach(function forEachCode(code) {
|
|
918
|
+
var message3 = codes2[code];
|
|
919
|
+
var status3 = Number(code);
|
|
920
|
+
map[message3.toLowerCase()] = status3;
|
|
921
|
+
});
|
|
922
|
+
return map;
|
|
923
|
+
}
|
|
924
|
+
function createStatusCodeList(codes2) {
|
|
925
|
+
return Object.keys(codes2).map(function mapCode(code) {
|
|
926
|
+
return Number(code);
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
function getStatusCode(message3) {
|
|
930
|
+
var msg = message3.toLowerCase();
|
|
931
|
+
if (!Object.prototype.hasOwnProperty.call(status2.code, msg)) {
|
|
932
|
+
throw new Error('invalid status message: "' + message3 + '"');
|
|
933
|
+
}
|
|
934
|
+
return status2.code[msg];
|
|
935
|
+
}
|
|
936
|
+
function getStatusMessage(code) {
|
|
937
|
+
if (!Object.prototype.hasOwnProperty.call(status2.message, code)) {
|
|
938
|
+
throw new Error("invalid status code: " + code);
|
|
939
|
+
}
|
|
940
|
+
return status2.message[code];
|
|
941
|
+
}
|
|
942
|
+
function status2(code) {
|
|
943
|
+
if (typeof code === "number") {
|
|
944
|
+
return getStatusMessage(code);
|
|
945
|
+
}
|
|
946
|
+
if (typeof code !== "string") {
|
|
947
|
+
throw new TypeError("code must be a number or string");
|
|
948
|
+
}
|
|
949
|
+
var n = parseInt(code, 10);
|
|
950
|
+
if (!isNaN(n)) {
|
|
951
|
+
return getStatusMessage(n);
|
|
952
|
+
}
|
|
953
|
+
return getStatusCode(code);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
var import_statuses = __toESM(require_statuses(), 1);
|
|
958
|
+
var source_default = import_statuses.default;
|
|
959
|
+
|
|
793
960
|
// src/core/utils/logging/serializeResponse.ts
|
|
961
|
+
var { message } = source_default;
|
|
794
962
|
function serializeResponse(response) {
|
|
795
963
|
return __async(this, null, function* () {
|
|
796
964
|
const responseClone = response.clone();
|
|
797
965
|
const responseText = yield responseClone.text();
|
|
966
|
+
const responseStatus = responseClone.status || 200;
|
|
967
|
+
const responseStatusText = responseClone.statusText || message[responseStatus] || "OK";
|
|
798
968
|
return {
|
|
799
|
-
status:
|
|
800
|
-
statusText:
|
|
969
|
+
status: responseStatus,
|
|
970
|
+
statusText: responseStatusText,
|
|
801
971
|
headers: headersToObject(responseClone.headers),
|
|
802
972
|
body: responseText
|
|
803
973
|
};
|
|
@@ -1119,10 +1289,10 @@ var MockServiceWorker = (() => {
|
|
|
1119
1289
|
}
|
|
1120
1290
|
|
|
1121
1291
|
// node_modules/.pnpm/@open-draft+logger@0.3.0/node_modules/@open-draft/logger/lib/index.mjs
|
|
1122
|
-
var
|
|
1292
|
+
var __defProp3 = Object.defineProperty;
|
|
1123
1293
|
var __export2 = (target, all) => {
|
|
1124
1294
|
for (var name in all)
|
|
1125
|
-
|
|
1295
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1126
1296
|
};
|
|
1127
1297
|
var colors_exports = {};
|
|
1128
1298
|
__export2(colors_exports, {
|
|
@@ -1178,10 +1348,10 @@ var MockServiceWorker = (() => {
|
|
|
1178
1348
|
* @example
|
|
1179
1349
|
* logger.debug('no duplicates found, creating a document...')
|
|
1180
1350
|
*/
|
|
1181
|
-
debug(
|
|
1351
|
+
debug(message3, ...positionals) {
|
|
1182
1352
|
this.logEntry({
|
|
1183
1353
|
level: "debug",
|
|
1184
|
-
message: gray(
|
|
1354
|
+
message: gray(message3),
|
|
1185
1355
|
positionals,
|
|
1186
1356
|
prefix: this.prefix,
|
|
1187
1357
|
colors: {
|
|
@@ -1194,10 +1364,10 @@ var MockServiceWorker = (() => {
|
|
|
1194
1364
|
* @example
|
|
1195
1365
|
* logger.info('start parsing...')
|
|
1196
1366
|
*/
|
|
1197
|
-
info(
|
|
1367
|
+
info(message3, ...positionals) {
|
|
1198
1368
|
this.logEntry({
|
|
1199
1369
|
level: "info",
|
|
1200
|
-
message:
|
|
1370
|
+
message: message3,
|
|
1201
1371
|
positionals,
|
|
1202
1372
|
prefix: this.prefix,
|
|
1203
1373
|
colors: {
|
|
@@ -1223,10 +1393,10 @@ var MockServiceWorker = (() => {
|
|
|
1223
1393
|
* @example
|
|
1224
1394
|
* logger.success('successfully created document')
|
|
1225
1395
|
*/
|
|
1226
|
-
success(
|
|
1396
|
+
success(message3, ...positionals) {
|
|
1227
1397
|
this.logEntry({
|
|
1228
1398
|
level: "info",
|
|
1229
|
-
message:
|
|
1399
|
+
message: message3,
|
|
1230
1400
|
positionals,
|
|
1231
1401
|
prefix: `\u2714 ${this.prefix}`,
|
|
1232
1402
|
colors: {
|
|
@@ -1240,10 +1410,10 @@ var MockServiceWorker = (() => {
|
|
|
1240
1410
|
* @example
|
|
1241
1411
|
* logger.warning('found legacy document format')
|
|
1242
1412
|
*/
|
|
1243
|
-
warning(
|
|
1413
|
+
warning(message3, ...positionals) {
|
|
1244
1414
|
this.logEntry({
|
|
1245
1415
|
level: "warning",
|
|
1246
|
-
message:
|
|
1416
|
+
message: message3,
|
|
1247
1417
|
positionals,
|
|
1248
1418
|
prefix: `\u26A0 ${this.prefix}`,
|
|
1249
1419
|
colors: {
|
|
@@ -1257,10 +1427,10 @@ var MockServiceWorker = (() => {
|
|
|
1257
1427
|
* @example
|
|
1258
1428
|
* logger.error('something went wrong')
|
|
1259
1429
|
*/
|
|
1260
|
-
error(
|
|
1430
|
+
error(message3, ...positionals) {
|
|
1261
1431
|
this.logEntry({
|
|
1262
1432
|
level: "error",
|
|
1263
|
-
message:
|
|
1433
|
+
message: message3,
|
|
1264
1434
|
positionals,
|
|
1265
1435
|
prefix: `\u2716 ${this.prefix}`,
|
|
1266
1436
|
colors: {
|
|
@@ -1281,22 +1451,22 @@ var MockServiceWorker = (() => {
|
|
|
1281
1451
|
only(callback) {
|
|
1282
1452
|
callback();
|
|
1283
1453
|
}
|
|
1284
|
-
createEntry(level,
|
|
1454
|
+
createEntry(level, message3) {
|
|
1285
1455
|
return {
|
|
1286
1456
|
timestamp: /* @__PURE__ */ new Date(),
|
|
1287
1457
|
level,
|
|
1288
|
-
message:
|
|
1458
|
+
message: message3
|
|
1289
1459
|
};
|
|
1290
1460
|
}
|
|
1291
1461
|
logEntry(args) {
|
|
1292
1462
|
const {
|
|
1293
1463
|
level,
|
|
1294
|
-
message:
|
|
1464
|
+
message: message3,
|
|
1295
1465
|
prefix,
|
|
1296
1466
|
colors: customColors,
|
|
1297
1467
|
positionals = []
|
|
1298
1468
|
} = args;
|
|
1299
|
-
const entry = this.createEntry(level,
|
|
1469
|
+
const entry = this.createEntry(level, message3);
|
|
1300
1470
|
const timestampColor = (customColors == null ? void 0 : customColors.timestamp) || "gray";
|
|
1301
1471
|
const prefixColor = (customColors == null ? void 0 : customColors.prefix) || "gray";
|
|
1302
1472
|
const colorize = {
|
|
@@ -1305,7 +1475,7 @@ var MockServiceWorker = (() => {
|
|
|
1305
1475
|
};
|
|
1306
1476
|
const write = this.getWriter(level);
|
|
1307
1477
|
write(
|
|
1308
|
-
[colorize.timestamp(this.formatTimestamp(entry.timestamp))].concat(prefix != null ? colorize.prefix(prefix) : []).concat(serializeInput(
|
|
1478
|
+
[colorize.timestamp(this.formatTimestamp(entry.timestamp))].concat(prefix != null ? colorize.prefix(prefix) : []).concat(serializeInput(message3)).join(" "),
|
|
1309
1479
|
...positionals.map(serializeInput)
|
|
1310
1480
|
);
|
|
1311
1481
|
}
|
|
@@ -1344,26 +1514,26 @@ var MockServiceWorker = (() => {
|
|
|
1344
1514
|
}
|
|
1345
1515
|
};
|
|
1346
1516
|
var noop = () => void 0;
|
|
1347
|
-
function log(
|
|
1517
|
+
function log(message3, ...positionals) {
|
|
1348
1518
|
if (IS_NODE) {
|
|
1349
|
-
process.stdout.write(format(
|
|
1519
|
+
process.stdout.write(format(message3, ...positionals) + "\n");
|
|
1350
1520
|
return;
|
|
1351
1521
|
}
|
|
1352
|
-
console.log(
|
|
1522
|
+
console.log(message3, ...positionals);
|
|
1353
1523
|
}
|
|
1354
|
-
function warn2(
|
|
1524
|
+
function warn2(message3, ...positionals) {
|
|
1355
1525
|
if (IS_NODE) {
|
|
1356
|
-
process.stderr.write(format(
|
|
1526
|
+
process.stderr.write(format(message3, ...positionals) + "\n");
|
|
1357
1527
|
return;
|
|
1358
1528
|
}
|
|
1359
|
-
console.warn(
|
|
1529
|
+
console.warn(message3, ...positionals);
|
|
1360
1530
|
}
|
|
1361
|
-
function error2(
|
|
1531
|
+
function error2(message3, ...positionals) {
|
|
1362
1532
|
if (IS_NODE) {
|
|
1363
|
-
process.stderr.write(format(
|
|
1533
|
+
process.stderr.write(format(message3, ...positionals) + "\n");
|
|
1364
1534
|
return;
|
|
1365
1535
|
}
|
|
1366
|
-
console.error(
|
|
1536
|
+
console.error(message3, ...positionals);
|
|
1367
1537
|
}
|
|
1368
1538
|
function getVariable(variableName) {
|
|
1369
1539
|
var _a2;
|
|
@@ -1375,23 +1545,23 @@ var MockServiceWorker = (() => {
|
|
|
1375
1545
|
function isDefinedAndNotEquals(value, expected) {
|
|
1376
1546
|
return value !== void 0 && value !== expected;
|
|
1377
1547
|
}
|
|
1378
|
-
function serializeInput(
|
|
1379
|
-
if (typeof
|
|
1548
|
+
function serializeInput(message3) {
|
|
1549
|
+
if (typeof message3 === "undefined") {
|
|
1380
1550
|
return "undefined";
|
|
1381
1551
|
}
|
|
1382
|
-
if (
|
|
1552
|
+
if (message3 === null) {
|
|
1383
1553
|
return "null";
|
|
1384
1554
|
}
|
|
1385
|
-
if (typeof
|
|
1386
|
-
return
|
|
1555
|
+
if (typeof message3 === "string") {
|
|
1556
|
+
return message3;
|
|
1387
1557
|
}
|
|
1388
|
-
if (typeof
|
|
1389
|
-
return JSON.stringify(
|
|
1558
|
+
if (typeof message3 === "object") {
|
|
1559
|
+
return JSON.stringify(message3);
|
|
1390
1560
|
}
|
|
1391
|
-
return
|
|
1561
|
+
return message3.toString();
|
|
1392
1562
|
}
|
|
1393
1563
|
|
|
1394
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1564
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-Y5QA6OEZ.mjs
|
|
1395
1565
|
var __require2 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
1396
1566
|
get: (a, b) => (typeof __require !== "undefined" ? __require : a)[b]
|
|
1397
1567
|
}) : x)(function(x) {
|
|
@@ -1556,17 +1726,13 @@ var MockServiceWorker = (() => {
|
|
|
1556
1726
|
logger.info('removed proxied "%s" listener!', event);
|
|
1557
1727
|
});
|
|
1558
1728
|
};
|
|
1559
|
-
|
|
1560
|
-
this.readyState = "APPLIED";
|
|
1561
|
-
});
|
|
1729
|
+
this.readyState = "APPLIED";
|
|
1562
1730
|
return;
|
|
1563
1731
|
}
|
|
1564
1732
|
logger.info("no running instance found, setting up a new instance...");
|
|
1565
1733
|
this.setup();
|
|
1566
1734
|
this.setInstance();
|
|
1567
|
-
|
|
1568
|
-
this.readyState = "APPLIED";
|
|
1569
|
-
});
|
|
1735
|
+
this.readyState = "APPLIED";
|
|
1570
1736
|
}
|
|
1571
1737
|
setup() {
|
|
1572
1738
|
}
|
|
@@ -1603,9 +1769,7 @@ var MockServiceWorker = (() => {
|
|
|
1603
1769
|
}
|
|
1604
1770
|
this.emitter.deactivate();
|
|
1605
1771
|
logger.info("destroyed the listener!");
|
|
1606
|
-
|
|
1607
|
-
this.readyState = "DISPOSED";
|
|
1608
|
-
});
|
|
1772
|
+
this.readyState = "DISPOSED";
|
|
1609
1773
|
}
|
|
1610
1774
|
getInstance() {
|
|
1611
1775
|
var _a2;
|
|
@@ -1623,7 +1787,7 @@ var MockServiceWorker = (() => {
|
|
|
1623
1787
|
}
|
|
1624
1788
|
};
|
|
1625
1789
|
|
|
1626
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1790
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-NUSH7ACE.mjs
|
|
1627
1791
|
var BatchInterceptor = class extends Interceptor {
|
|
1628
1792
|
constructor(options) {
|
|
1629
1793
|
BatchInterceptor.symbol = Symbol(options.name);
|
|
@@ -1647,15 +1811,15 @@ var MockServiceWorker = (() => {
|
|
|
1647
1811
|
}
|
|
1648
1812
|
};
|
|
1649
1813
|
|
|
1650
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1814
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-LTX5IGCQ.mjs
|
|
1651
1815
|
var TextEncoder = typeof globalThis.TextEncoder === "undefined" ? __require2("util").TextEncoder : globalThis.TextEncoder;
|
|
1652
1816
|
var TextDecoder = typeof globalThis.TextDecoder === "undefined" ? __require2("util").TextDecoder : globalThis.TextDecoder;
|
|
1653
1817
|
var encoder = new TextEncoder();
|
|
1654
1818
|
|
|
1655
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1819
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/chunk-GFH37L5D.mjs
|
|
1656
1820
|
var IS_PATCHED_MODULE = Symbol("isPatchedModule");
|
|
1657
1821
|
|
|
1658
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
1822
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/node/index.mjs
|
|
1659
1823
|
function getCleanUrl(url, isAbsolute = true) {
|
|
1660
1824
|
return [isAbsolute && url.origin, url.pathname].filter(Boolean).join("");
|
|
1661
1825
|
}
|
|
@@ -1733,32 +1897,32 @@ var MockServiceWorker = (() => {
|
|
|
1733
1897
|
}
|
|
1734
1898
|
|
|
1735
1899
|
// node_modules/.pnpm/@bundled-es-modules+cookie@2.0.0/node_modules/@bundled-es-modules/cookie/index-esm.js
|
|
1736
|
-
var
|
|
1737
|
-
var
|
|
1738
|
-
var
|
|
1739
|
-
var
|
|
1740
|
-
var
|
|
1741
|
-
var
|
|
1742
|
-
var
|
|
1743
|
-
return mod || (0, cb[
|
|
1900
|
+
var __create2 = Object.create;
|
|
1901
|
+
var __defProp4 = Object.defineProperty;
|
|
1902
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1903
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1904
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
1905
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1906
|
+
var __commonJS2 = (cb, mod) => function __require3() {
|
|
1907
|
+
return mod || (0, cb[__getOwnPropNames3(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1744
1908
|
};
|
|
1745
|
-
var
|
|
1909
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1746
1910
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1747
|
-
for (let key of
|
|
1748
|
-
if (!
|
|
1749
|
-
|
|
1911
|
+
for (let key of __getOwnPropNames3(from))
|
|
1912
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1913
|
+
__defProp4(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1750
1914
|
}
|
|
1751
1915
|
return to;
|
|
1752
1916
|
};
|
|
1753
|
-
var
|
|
1917
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps3(
|
|
1754
1918
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
1755
1919
|
// file that has been converted to a CommonJS file using a Babel-
|
|
1756
1920
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1757
1921
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1758
|
-
isNodeMode || !mod || !mod.__esModule ?
|
|
1922
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp4(target, "default", { value: mod, enumerable: true }) : target,
|
|
1759
1923
|
mod
|
|
1760
1924
|
));
|
|
1761
|
-
var require_cookie =
|
|
1925
|
+
var require_cookie = __commonJS2({
|
|
1762
1926
|
"node_modules/cookie/index.js"(exports) {
|
|
1763
1927
|
"use strict";
|
|
1764
1928
|
exports.parse = parse3;
|
|
@@ -1898,32 +2062,32 @@ var MockServiceWorker = (() => {
|
|
|
1898
2062
|
}
|
|
1899
2063
|
}
|
|
1900
2064
|
});
|
|
1901
|
-
var import_cookie =
|
|
1902
|
-
var
|
|
2065
|
+
var import_cookie = __toESM2(require_cookie(), 1);
|
|
2066
|
+
var source_default2 = import_cookie.default;
|
|
1903
2067
|
|
|
1904
2068
|
// node_modules/.pnpm/@mswjs+cookies@1.0.0/node_modules/@mswjs/cookies/lib/index.mjs
|
|
1905
|
-
var
|
|
1906
|
-
var
|
|
1907
|
-
var
|
|
1908
|
-
var
|
|
1909
|
-
var
|
|
1910
|
-
var
|
|
1911
|
-
var
|
|
1912
|
-
return mod || (0, cb[
|
|
2069
|
+
var __create3 = Object.create;
|
|
2070
|
+
var __defProp5 = Object.defineProperty;
|
|
2071
|
+
var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
|
|
2072
|
+
var __getOwnPropNames4 = Object.getOwnPropertyNames;
|
|
2073
|
+
var __getProtoOf3 = Object.getPrototypeOf;
|
|
2074
|
+
var __hasOwnProp4 = Object.prototype.hasOwnProperty;
|
|
2075
|
+
var __commonJS3 = (cb, mod) => function __require3() {
|
|
2076
|
+
return mod || (0, cb[__getOwnPropNames4(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1913
2077
|
};
|
|
1914
|
-
var
|
|
2078
|
+
var __copyProps4 = (to, from, except, desc) => {
|
|
1915
2079
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1916
|
-
for (let key of
|
|
1917
|
-
if (!
|
|
1918
|
-
|
|
2080
|
+
for (let key of __getOwnPropNames4(from))
|
|
2081
|
+
if (!__hasOwnProp4.call(to, key) && key !== except)
|
|
2082
|
+
__defProp5(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc4(from, key)) || desc.enumerable });
|
|
1919
2083
|
}
|
|
1920
2084
|
return to;
|
|
1921
2085
|
};
|
|
1922
|
-
var
|
|
1923
|
-
isNodeMode || !mod || !mod.__esModule ?
|
|
2086
|
+
var __toESM3 = (mod, isNodeMode, target) => (target = mod != null ? __create3(__getProtoOf3(mod)) : {}, __copyProps4(
|
|
2087
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp5(target, "default", { value: mod, enumerable: true }) : target,
|
|
1924
2088
|
mod
|
|
1925
2089
|
));
|
|
1926
|
-
var require_set_cookie =
|
|
2090
|
+
var require_set_cookie = __commonJS3({
|
|
1927
2091
|
"node_modules/set-cookie-parser/lib/set-cookie.js"(exports, module) {
|
|
1928
2092
|
"use strict";
|
|
1929
2093
|
var defaultParseOptions = {
|
|
@@ -2064,7 +2228,7 @@ var MockServiceWorker = (() => {
|
|
|
2064
2228
|
module.exports.splitCookiesString = splitCookiesString;
|
|
2065
2229
|
}
|
|
2066
2230
|
});
|
|
2067
|
-
var import_set_cookie_parser =
|
|
2231
|
+
var import_set_cookie_parser = __toESM3(require_set_cookie());
|
|
2068
2232
|
var PERSISTENCY_KEY = "MSW_COOKIE_STORE";
|
|
2069
2233
|
function supportsLocalStorage() {
|
|
2070
2234
|
try {
|
|
@@ -2208,7 +2372,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2208
2372
|
|
|
2209
2373
|
// src/core/utils/request/getRequestCookies.ts
|
|
2210
2374
|
function getAllDocumentCookies() {
|
|
2211
|
-
return
|
|
2375
|
+
return source_default2.parse(document.cookie);
|
|
2212
2376
|
}
|
|
2213
2377
|
function getRequestCookies(request) {
|
|
2214
2378
|
if (typeof document === "undefined" || typeof location === "undefined") {
|
|
@@ -2230,7 +2394,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2230
2394
|
function getAllRequestCookies(request) {
|
|
2231
2395
|
var _a2;
|
|
2232
2396
|
const requestCookiesString = request.headers.get("cookie");
|
|
2233
|
-
const cookiesFromHeaders = requestCookiesString ?
|
|
2397
|
+
const cookiesFromHeaders = requestCookiesString ? source_default2.parse(requestCookiesString) : {};
|
|
2234
2398
|
store.hydrate();
|
|
2235
2399
|
const cookiesFromStore = Array.from((_a2 = store.get(request)) == null ? void 0 : _a2.entries()).reduce(
|
|
2236
2400
|
(cookies, [name, { value }]) => {
|
|
@@ -2246,18 +2410,18 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2246
2410
|
return __spreadValues(__spreadValues({}, forwardedCookies), cookiesFromHeaders);
|
|
2247
2411
|
}
|
|
2248
2412
|
|
|
2249
|
-
// src/core/handlers/
|
|
2250
|
-
var
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
return
|
|
2259
|
-
})(
|
|
2260
|
-
var
|
|
2413
|
+
// src/core/handlers/HttpHandler.ts
|
|
2414
|
+
var HttpMethods = /* @__PURE__ */ ((HttpMethods2) => {
|
|
2415
|
+
HttpMethods2["HEAD"] = "HEAD";
|
|
2416
|
+
HttpMethods2["GET"] = "GET";
|
|
2417
|
+
HttpMethods2["POST"] = "POST";
|
|
2418
|
+
HttpMethods2["PUT"] = "PUT";
|
|
2419
|
+
HttpMethods2["PATCH"] = "PATCH";
|
|
2420
|
+
HttpMethods2["OPTIONS"] = "OPTIONS";
|
|
2421
|
+
HttpMethods2["DELETE"] = "DELETE";
|
|
2422
|
+
return HttpMethods2;
|
|
2423
|
+
})(HttpMethods || {});
|
|
2424
|
+
var HttpHandler = class extends RequestHandler {
|
|
2261
2425
|
constructor(method, path, resolver, options) {
|
|
2262
2426
|
super({
|
|
2263
2427
|
info: {
|
|
@@ -2323,14 +2487,14 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2323
2487
|
const publicUrl = getPublicUrlFromRequest(request);
|
|
2324
2488
|
const loggedRequest = yield serializeRequest(request);
|
|
2325
2489
|
const loggedResponse = yield serializeResponse(response);
|
|
2326
|
-
const statusColor = getStatusCodeColor(
|
|
2490
|
+
const statusColor = getStatusCodeColor(loggedResponse.status);
|
|
2327
2491
|
console.groupCollapsed(
|
|
2328
2492
|
devUtils.formatMessage("%s %s %s (%c%s%c)"),
|
|
2329
2493
|
getTimestamp(),
|
|
2330
2494
|
request.method,
|
|
2331
2495
|
publicUrl,
|
|
2332
2496
|
`color:${statusColor}`,
|
|
2333
|
-
`${
|
|
2497
|
+
`${loggedResponse.status} ${loggedResponse.statusText}`,
|
|
2334
2498
|
"color:inherit"
|
|
2335
2499
|
);
|
|
2336
2500
|
console.log("Request", loggedRequest);
|
|
@@ -2341,47 +2505,47 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2341
2505
|
}
|
|
2342
2506
|
};
|
|
2343
2507
|
|
|
2344
|
-
// src/core/
|
|
2345
|
-
function
|
|
2508
|
+
// src/core/http.ts
|
|
2509
|
+
function createHttpHandler(method) {
|
|
2346
2510
|
return (path, resolver, options = {}) => {
|
|
2347
|
-
return new
|
|
2511
|
+
return new HttpHandler(method, path, resolver, options);
|
|
2348
2512
|
};
|
|
2349
2513
|
}
|
|
2350
|
-
var
|
|
2351
|
-
all:
|
|
2352
|
-
head:
|
|
2353
|
-
get:
|
|
2354
|
-
post:
|
|
2355
|
-
put:
|
|
2356
|
-
delete:
|
|
2357
|
-
patch:
|
|
2358
|
-
options:
|
|
2514
|
+
var http = {
|
|
2515
|
+
all: createHttpHandler(/.+/),
|
|
2516
|
+
head: createHttpHandler("HEAD" /* HEAD */),
|
|
2517
|
+
get: createHttpHandler("GET" /* GET */),
|
|
2518
|
+
post: createHttpHandler("POST" /* POST */),
|
|
2519
|
+
put: createHttpHandler("PUT" /* PUT */),
|
|
2520
|
+
delete: createHttpHandler("DELETE" /* DELETE */),
|
|
2521
|
+
patch: createHttpHandler("PATCH" /* PATCH */),
|
|
2522
|
+
options: createHttpHandler("OPTIONS" /* OPTIONS */)
|
|
2359
2523
|
};
|
|
2360
2524
|
|
|
2361
|
-
// node_modules/.pnpm/graphql@16.
|
|
2362
|
-
function devAssert(condition,
|
|
2525
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/jsutils/devAssert.mjs
|
|
2526
|
+
function devAssert(condition, message3) {
|
|
2363
2527
|
const booleanCondition = Boolean(condition);
|
|
2364
2528
|
if (!booleanCondition) {
|
|
2365
|
-
throw new Error(
|
|
2529
|
+
throw new Error(message3);
|
|
2366
2530
|
}
|
|
2367
2531
|
}
|
|
2368
2532
|
|
|
2369
|
-
// node_modules/.pnpm/graphql@16.
|
|
2533
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/jsutils/isObjectLike.mjs
|
|
2370
2534
|
function isObjectLike(value) {
|
|
2371
2535
|
return typeof value == "object" && value !== null;
|
|
2372
2536
|
}
|
|
2373
2537
|
|
|
2374
|
-
// node_modules/.pnpm/graphql@16.
|
|
2375
|
-
function invariant2(condition,
|
|
2538
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/jsutils/invariant.mjs
|
|
2539
|
+
function invariant2(condition, message3) {
|
|
2376
2540
|
const booleanCondition = Boolean(condition);
|
|
2377
2541
|
if (!booleanCondition) {
|
|
2378
2542
|
throw new Error(
|
|
2379
|
-
|
|
2543
|
+
message3 != null ? message3 : "Unexpected invariant triggered."
|
|
2380
2544
|
);
|
|
2381
2545
|
}
|
|
2382
2546
|
}
|
|
2383
2547
|
|
|
2384
|
-
// node_modules/.pnpm/graphql@16.
|
|
2548
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/location.mjs
|
|
2385
2549
|
var LineRegExp = /\r\n|[\n\r]/g;
|
|
2386
2550
|
function getLocation(source, position) {
|
|
2387
2551
|
let lastLineStart = 0;
|
|
@@ -2400,7 +2564,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2400
2564
|
};
|
|
2401
2565
|
}
|
|
2402
2566
|
|
|
2403
|
-
// node_modules/.pnpm/graphql@16.
|
|
2567
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/printLocation.mjs
|
|
2404
2568
|
function printLocation(location2) {
|
|
2405
2569
|
return printSourceLocation(
|
|
2406
2570
|
location2.source,
|
|
@@ -2447,7 +2611,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2447
2611
|
return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join("\n");
|
|
2448
2612
|
}
|
|
2449
2613
|
|
|
2450
|
-
// node_modules/.pnpm/graphql@16.
|
|
2614
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/error/GraphQLError.mjs
|
|
2451
2615
|
function toNormalizedOptions(args) {
|
|
2452
2616
|
const firstArg = args[0];
|
|
2453
2617
|
if (firstArg == null || "kind" in firstArg || "length" in firstArg) {
|
|
@@ -2501,10 +2665,10 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2501
2665
|
/**
|
|
2502
2666
|
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
|
2503
2667
|
*/
|
|
2504
|
-
constructor(
|
|
2668
|
+
constructor(message3, ...rawArgs) {
|
|
2505
2669
|
var _this$nodes, _nodeLocations$, _ref;
|
|
2506
2670
|
const { nodes, source, positions, path, originalError, extensions } = toNormalizedOptions(rawArgs);
|
|
2507
|
-
super(
|
|
2671
|
+
super(message3);
|
|
2508
2672
|
this.name = "GraphQLError";
|
|
2509
2673
|
this.path = path !== null && path !== void 0 ? path : void 0;
|
|
2510
2674
|
this.originalError = originalError !== null && originalError !== void 0 ? originalError : void 0;
|
|
@@ -2596,7 +2760,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2596
2760
|
return array === void 0 || array.length === 0 ? void 0 : array;
|
|
2597
2761
|
}
|
|
2598
2762
|
|
|
2599
|
-
// node_modules/.pnpm/graphql@16.
|
|
2763
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/error/syntaxError.mjs
|
|
2600
2764
|
function syntaxError(source, position, description) {
|
|
2601
2765
|
return new GraphQLError(`Syntax Error: ${description}`, {
|
|
2602
2766
|
source,
|
|
@@ -2604,7 +2768,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2604
2768
|
});
|
|
2605
2769
|
}
|
|
2606
2770
|
|
|
2607
|
-
// node_modules/.pnpm/graphql@16.
|
|
2771
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/ast.mjs
|
|
2608
2772
|
var Location = class {
|
|
2609
2773
|
/**
|
|
2610
2774
|
* The character offset at which this Node begins.
|
|
@@ -2770,7 +2934,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2770
2934
|
OperationTypeNode2["SUBSCRIPTION"] = "subscription";
|
|
2771
2935
|
})(OperationTypeNode || (OperationTypeNode = {}));
|
|
2772
2936
|
|
|
2773
|
-
// node_modules/.pnpm/graphql@16.
|
|
2937
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/directiveLocation.mjs
|
|
2774
2938
|
var DirectiveLocation;
|
|
2775
2939
|
(function(DirectiveLocation2) {
|
|
2776
2940
|
DirectiveLocation2["QUERY"] = "QUERY";
|
|
@@ -2794,7 +2958,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2794
2958
|
DirectiveLocation2["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION";
|
|
2795
2959
|
})(DirectiveLocation || (DirectiveLocation = {}));
|
|
2796
2960
|
|
|
2797
|
-
// node_modules/.pnpm/graphql@16.
|
|
2961
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/kinds.mjs
|
|
2798
2962
|
var Kind;
|
|
2799
2963
|
(function(Kind2) {
|
|
2800
2964
|
Kind2["NAME"] = "Name";
|
|
@@ -2842,7 +3006,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2842
3006
|
Kind2["INPUT_OBJECT_TYPE_EXTENSION"] = "InputObjectTypeExtension";
|
|
2843
3007
|
})(Kind || (Kind = {}));
|
|
2844
3008
|
|
|
2845
|
-
// node_modules/.pnpm/graphql@16.
|
|
3009
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/characterClasses.mjs
|
|
2846
3010
|
function isWhiteSpace(code) {
|
|
2847
3011
|
return code === 9 || code === 32;
|
|
2848
3012
|
}
|
|
@@ -2860,7 +3024,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2860
3024
|
return isLetter(code) || isDigit(code) || code === 95;
|
|
2861
3025
|
}
|
|
2862
3026
|
|
|
2863
|
-
// node_modules/.pnpm/graphql@16.
|
|
3027
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/blockString.mjs
|
|
2864
3028
|
function dedentBlockStringLines(lines) {
|
|
2865
3029
|
var _firstNonEmptyLine2;
|
|
2866
3030
|
let commonIndent = Number.MAX_SAFE_INTEGER;
|
|
@@ -2892,7 +3056,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2892
3056
|
return i;
|
|
2893
3057
|
}
|
|
2894
3058
|
|
|
2895
|
-
// node_modules/.pnpm/graphql@16.
|
|
3059
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/tokenKind.mjs
|
|
2896
3060
|
var TokenKind;
|
|
2897
3061
|
(function(TokenKind2) {
|
|
2898
3062
|
TokenKind2["SOF"] = "<SOF>";
|
|
@@ -2919,7 +3083,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
2919
3083
|
TokenKind2["COMMENT"] = "Comment";
|
|
2920
3084
|
})(TokenKind || (TokenKind = {}));
|
|
2921
3085
|
|
|
2922
|
-
// node_modules/.pnpm/graphql@16.
|
|
3086
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/lexer.mjs
|
|
2923
3087
|
var Lexer = class {
|
|
2924
3088
|
/**
|
|
2925
3089
|
* The previously focused non-ignored token.
|
|
@@ -3420,7 +3584,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
3420
3584
|
);
|
|
3421
3585
|
}
|
|
3422
3586
|
|
|
3423
|
-
// node_modules/.pnpm/graphql@16.
|
|
3587
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/jsutils/inspect.mjs
|
|
3424
3588
|
var MAX_ARRAY_LENGTH = 10;
|
|
3425
3589
|
var MAX_RECURSIVE_DEPTH = 2;
|
|
3426
3590
|
function inspect(value) {
|
|
@@ -3503,12 +3667,11 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
3503
3667
|
return tag;
|
|
3504
3668
|
}
|
|
3505
3669
|
|
|
3506
|
-
// node_modules/.pnpm/graphql@16.
|
|
3670
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/jsutils/instanceOf.mjs
|
|
3507
3671
|
var instanceOf = (
|
|
3508
3672
|
/* c8 ignore next 6 */
|
|
3509
3673
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
3510
|
-
|
|
3511
|
-
false ? function instanceOf2(value, constructor) {
|
|
3674
|
+
globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function instanceOf2(value, constructor) {
|
|
3512
3675
|
return value instanceof constructor;
|
|
3513
3676
|
} : function instanceOf3(value, constructor) {
|
|
3514
3677
|
if (value instanceof constructor) {
|
|
@@ -3541,7 +3704,7 @@ spurious results.`);
|
|
|
3541
3704
|
}
|
|
3542
3705
|
);
|
|
3543
3706
|
|
|
3544
|
-
// node_modules/.pnpm/graphql@16.
|
|
3707
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/source.mjs
|
|
3545
3708
|
var Source = class {
|
|
3546
3709
|
constructor(body, name = "GraphQL request", locationOffset = {
|
|
3547
3710
|
line: 1,
|
|
@@ -3568,7 +3731,7 @@ spurious results.`);
|
|
|
3568
3731
|
return instanceOf(source, Source);
|
|
3569
3732
|
}
|
|
3570
3733
|
|
|
3571
|
-
// node_modules/.pnpm/graphql@16.
|
|
3734
|
+
// node_modules/.pnpm/graphql@16.7.1/node_modules/graphql/language/parser.mjs
|
|
3572
3735
|
function parse2(source, options) {
|
|
3573
3736
|
const parser = new Parser(source, options);
|
|
3574
3737
|
return parser.parseDocument();
|
|
@@ -4836,8 +4999,8 @@ spurious results.`);
|
|
|
4836
4999
|
throw new Error('"Content-Disposition" header is required.');
|
|
4837
5000
|
}
|
|
4838
5001
|
const directives = disposition.split(";").reduce((acc, chunk) => {
|
|
4839
|
-
const [name2, ...
|
|
4840
|
-
acc[name2] =
|
|
5002
|
+
const [name2, ...rest] = chunk.trim().split("=");
|
|
5003
|
+
acc[name2] = rest.join("=");
|
|
4841
5004
|
return acc;
|
|
4842
5005
|
}, {});
|
|
4843
5006
|
const name = (_a2 = directives.name) == null ? void 0 : _a2.slice(1, -1);
|
|
@@ -4866,8 +5029,8 @@ spurious results.`);
|
|
|
4866
5029
|
const parsedBody = {};
|
|
4867
5030
|
try {
|
|
4868
5031
|
for (const field of fields) {
|
|
4869
|
-
const [contentHeaders, ...
|
|
4870
|
-
const contentBody =
|
|
5032
|
+
const [contentHeaders, ...rest] = field.split("\r\n\r\n");
|
|
5033
|
+
const contentBody = rest.join("\r\n\r\n");
|
|
4871
5034
|
const { contentType: contentType2, filename, name } = parseContentHeaders(contentHeaders);
|
|
4872
5035
|
const value = filename === void 0 ? contentBody : new File([contentBody], filename, { type: contentType2 });
|
|
4873
5036
|
const parsedValue = parsedBody[name];
|
|
@@ -5077,14 +5240,14 @@ Consider naming this operation or using "graphql.operation()" request handler to
|
|
|
5077
5240
|
return __async(this, null, function* () {
|
|
5078
5241
|
const loggedRequest = yield serializeRequest(request);
|
|
5079
5242
|
const loggedResponse = yield serializeResponse(response);
|
|
5080
|
-
const statusColor = getStatusCodeColor(
|
|
5243
|
+
const statusColor = getStatusCodeColor(loggedResponse.status);
|
|
5081
5244
|
const requestInfo = (parsedRequest == null ? void 0 : parsedRequest.operationName) ? `${parsedRequest == null ? void 0 : parsedRequest.operationType} ${parsedRequest == null ? void 0 : parsedRequest.operationName}` : `anonymous ${parsedRequest == null ? void 0 : parsedRequest.operationType}`;
|
|
5082
5245
|
console.groupCollapsed(
|
|
5083
5246
|
devUtils.formatMessage("%s %s (%c%s%c)"),
|
|
5084
5247
|
getTimestamp(),
|
|
5085
5248
|
`${requestInfo}`,
|
|
5086
5249
|
`color:${statusColor}`,
|
|
5087
|
-
`${
|
|
5250
|
+
`${loggedResponse.status} ${loggedResponse.statusText}`,
|
|
5088
5251
|
"color:inherit"
|
|
5089
5252
|
);
|
|
5090
5253
|
console.log("Request:", loggedRequest);
|
|
@@ -5182,32 +5345,32 @@ Consider naming this operation or using "graphql.operation()" request handler to
|
|
|
5182
5345
|
});
|
|
5183
5346
|
|
|
5184
5347
|
// node_modules/.pnpm/@bundled-es-modules+js-levenshtein@2.0.1/node_modules/@bundled-es-modules/js-levenshtein/index-esm.js
|
|
5185
|
-
var
|
|
5186
|
-
var
|
|
5187
|
-
var
|
|
5188
|
-
var
|
|
5189
|
-
var
|
|
5190
|
-
var
|
|
5191
|
-
var
|
|
5192
|
-
return mod || (0, cb[
|
|
5348
|
+
var __create4 = Object.create;
|
|
5349
|
+
var __defProp6 = Object.defineProperty;
|
|
5350
|
+
var __getOwnPropDesc5 = Object.getOwnPropertyDescriptor;
|
|
5351
|
+
var __getOwnPropNames5 = Object.getOwnPropertyNames;
|
|
5352
|
+
var __getProtoOf4 = Object.getPrototypeOf;
|
|
5353
|
+
var __hasOwnProp5 = Object.prototype.hasOwnProperty;
|
|
5354
|
+
var __commonJS4 = (cb, mod) => function __require3() {
|
|
5355
|
+
return mod || (0, cb[__getOwnPropNames5(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
5193
5356
|
};
|
|
5194
|
-
var
|
|
5357
|
+
var __copyProps5 = (to, from, except, desc) => {
|
|
5195
5358
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
5196
|
-
for (let key of
|
|
5197
|
-
if (!
|
|
5198
|
-
|
|
5359
|
+
for (let key of __getOwnPropNames5(from))
|
|
5360
|
+
if (!__hasOwnProp5.call(to, key) && key !== except)
|
|
5361
|
+
__defProp6(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc5(from, key)) || desc.enumerable });
|
|
5199
5362
|
}
|
|
5200
5363
|
return to;
|
|
5201
5364
|
};
|
|
5202
|
-
var
|
|
5365
|
+
var __toESM4 = (mod, isNodeMode, target) => (target = mod != null ? __create4(__getProtoOf4(mod)) : {}, __copyProps5(
|
|
5203
5366
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
5204
5367
|
// file that has been converted to a CommonJS file using a Babel-
|
|
5205
5368
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
5206
5369
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
5207
|
-
isNodeMode || !mod || !mod.__esModule ?
|
|
5370
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp6(target, "default", { value: mod, enumerable: true }) : target,
|
|
5208
5371
|
mod
|
|
5209
5372
|
));
|
|
5210
|
-
var require_js_levenshtein =
|
|
5373
|
+
var require_js_levenshtein = __commonJS4({
|
|
5211
5374
|
"node_modules/js-levenshtein/index.js"(exports, module) {
|
|
5212
5375
|
"use strict";
|
|
5213
5376
|
module.exports = function() {
|
|
@@ -5291,19 +5454,19 @@ Consider naming this operation or using "graphql.operation()" request handler to
|
|
|
5291
5454
|
}();
|
|
5292
5455
|
}
|
|
5293
5456
|
});
|
|
5294
|
-
var import_js_levenshtein =
|
|
5295
|
-
var
|
|
5457
|
+
var import_js_levenshtein = __toESM4(require_js_levenshtein(), 1);
|
|
5458
|
+
var source_default3 = import_js_levenshtein.default;
|
|
5296
5459
|
|
|
5297
5460
|
// src/core/utils/request/onUnhandledRequest.ts
|
|
5298
|
-
var getStringMatchScore =
|
|
5461
|
+
var getStringMatchScore = source_default3;
|
|
5299
5462
|
var MAX_MATCH_SCORE = 3;
|
|
5300
5463
|
var MAX_SUGGESTION_COUNT = 4;
|
|
5301
5464
|
var TYPE_MATCH_DELTA = 0.5;
|
|
5302
5465
|
function groupHandlersByType(handlers) {
|
|
5303
5466
|
return handlers.reduce(
|
|
5304
5467
|
(groups, handler) => {
|
|
5305
|
-
if (handler instanceof
|
|
5306
|
-
groups.
|
|
5468
|
+
if (handler instanceof HttpHandler) {
|
|
5469
|
+
groups.http.push(handler);
|
|
5307
5470
|
}
|
|
5308
5471
|
if (handler instanceof GraphQLHandler) {
|
|
5309
5472
|
groups.graphql.push(handler);
|
|
@@ -5311,12 +5474,12 @@ Consider naming this operation or using "graphql.operation()" request handler to
|
|
|
5311
5474
|
return groups;
|
|
5312
5475
|
},
|
|
5313
5476
|
{
|
|
5314
|
-
|
|
5477
|
+
http: [],
|
|
5315
5478
|
graphql: []
|
|
5316
5479
|
}
|
|
5317
5480
|
);
|
|
5318
5481
|
}
|
|
5319
|
-
function
|
|
5482
|
+
function getHttpHandlerScore() {
|
|
5320
5483
|
return (request, handler) => {
|
|
5321
5484
|
const { path, method } = handler.info;
|
|
5322
5485
|
if (path instanceof RegExp || method instanceof RegExp) {
|
|
@@ -5366,11 +5529,11 @@ ${handlers.map((handler) => ` \u2022 ${handler.info.header}`).join("\n")}`;
|
|
|
5366
5529
|
);
|
|
5367
5530
|
function generateHandlerSuggestion() {
|
|
5368
5531
|
const handlerGroups = groupHandlersByType(handlers);
|
|
5369
|
-
const relevantHandlers = parsedGraphQLQuery ? handlerGroups.graphql : handlerGroups.
|
|
5532
|
+
const relevantHandlers = parsedGraphQLQuery ? handlerGroups.graphql : handlerGroups.http;
|
|
5370
5533
|
const suggestedHandlers = getSuggestedHandler(
|
|
5371
5534
|
request,
|
|
5372
5535
|
relevantHandlers,
|
|
5373
|
-
parsedGraphQLQuery ? getGraphQLHandlerScore(parsedGraphQLQuery) :
|
|
5536
|
+
parsedGraphQLQuery ? getGraphQLHandlerScore(parsedGraphQLQuery) : getHttpHandlerScore()
|
|
5374
5537
|
);
|
|
5375
5538
|
return suggestedHandlers.length > 0 ? getSuggestedHandlersMessage(suggestedHandlers) : "";
|
|
5376
5539
|
}
|
|
@@ -5388,10 +5551,10 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
|
|
|
5388
5551
|
return messageTemplate.join("\n\n");
|
|
5389
5552
|
}
|
|
5390
5553
|
function applyStrategy(strategy2) {
|
|
5391
|
-
const
|
|
5554
|
+
const message3 = generateUnhandledRequestMessage();
|
|
5392
5555
|
switch (strategy2) {
|
|
5393
5556
|
case "error": {
|
|
5394
|
-
devUtils.error("Error: %s",
|
|
5557
|
+
devUtils.error("Error: %s", message3);
|
|
5395
5558
|
throw new Error(
|
|
5396
5559
|
devUtils.formatMessage(
|
|
5397
5560
|
'Cannot bypass a request when using the "error" strategy for the "onUnhandledRequest" option.'
|
|
@@ -5399,7 +5562,7 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
|
|
|
5399
5562
|
);
|
|
5400
5563
|
}
|
|
5401
5564
|
case "warn": {
|
|
5402
|
-
devUtils.warn("Warning: %s",
|
|
5565
|
+
devUtils.warn("Warning: %s", message3);
|
|
5403
5566
|
break;
|
|
5404
5567
|
}
|
|
5405
5568
|
case "bypass":
|
|
@@ -5434,9 +5597,9 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
|
|
|
5434
5597
|
function handleRequest(request, requestId, handlers, options, emitter, handleRequestOptions) {
|
|
5435
5598
|
return __async(this, null, function* () {
|
|
5436
5599
|
var _a2, _b2, _c, _d, _e, _f;
|
|
5437
|
-
emitter.emit("request:start", request, requestId);
|
|
5600
|
+
emitter.emit("request:start", { request, requestId });
|
|
5438
5601
|
if (request.headers.get("x-msw-intention") === "bypass") {
|
|
5439
|
-
emitter.emit("request:end", request, requestId);
|
|
5602
|
+
emitter.emit("request:end", { request, requestId });
|
|
5440
5603
|
(_a2 = handleRequestOptions == null ? void 0 : handleRequestOptions.onPassthroughResponse) == null ? void 0 : _a2.call(handleRequestOptions, request);
|
|
5441
5604
|
return;
|
|
5442
5605
|
}
|
|
@@ -5448,30 +5611,33 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
|
|
|
5448
5611
|
);
|
|
5449
5612
|
});
|
|
5450
5613
|
if (lookupResult.error) {
|
|
5451
|
-
emitter.emit("unhandledException",
|
|
5614
|
+
emitter.emit("unhandledException", {
|
|
5615
|
+
error: lookupResult.error,
|
|
5616
|
+
request,
|
|
5617
|
+
requestId
|
|
5618
|
+
});
|
|
5452
5619
|
throw lookupResult.error;
|
|
5453
5620
|
}
|
|
5454
5621
|
if (!lookupResult.data) {
|
|
5455
5622
|
yield onUnhandledRequest(request, handlers, options.onUnhandledRequest);
|
|
5456
|
-
emitter.emit("request:unhandled", request, requestId);
|
|
5457
|
-
emitter.emit("request:end", request, requestId);
|
|
5623
|
+
emitter.emit("request:unhandled", { request, requestId });
|
|
5624
|
+
emitter.emit("request:end", { request, requestId });
|
|
5458
5625
|
(_b2 = handleRequestOptions == null ? void 0 : handleRequestOptions.onPassthroughResponse) == null ? void 0 : _b2.call(handleRequestOptions, request);
|
|
5459
5626
|
return;
|
|
5460
5627
|
}
|
|
5461
5628
|
const { response } = lookupResult.data;
|
|
5462
5629
|
if (!response) {
|
|
5463
|
-
emitter.emit("request:end", request, requestId);
|
|
5630
|
+
emitter.emit("request:end", { request, requestId });
|
|
5464
5631
|
(_c = handleRequestOptions == null ? void 0 : handleRequestOptions.onPassthroughResponse) == null ? void 0 : _c.call(handleRequestOptions, request);
|
|
5465
5632
|
return;
|
|
5466
5633
|
}
|
|
5467
5634
|
if (response.status === 302 && response.headers.get("x-msw-intention") === "passthrough") {
|
|
5468
|
-
emitter.emit("request:end", request, requestId);
|
|
5635
|
+
emitter.emit("request:end", { request, requestId });
|
|
5469
5636
|
(_d = handleRequestOptions == null ? void 0 : handleRequestOptions.onPassthroughResponse) == null ? void 0 : _d.call(handleRequestOptions, request);
|
|
5470
5637
|
return;
|
|
5471
5638
|
}
|
|
5472
|
-
response.headers.set("x-powered-by", "msw");
|
|
5473
5639
|
readResponseCookies(request, response);
|
|
5474
|
-
emitter.emit("request:match", request, requestId);
|
|
5640
|
+
emitter.emit("request:match", { request, requestId });
|
|
5475
5641
|
const requiredLookupResult = lookupResult.data;
|
|
5476
5642
|
const transformedResponse = ((_e = handleRequestOptions == null ? void 0 : handleRequestOptions.transformResponse) == null ? void 0 : _e.call(handleRequestOptions, response)) || response;
|
|
5477
5643
|
(_f = handleRequestOptions == null ? void 0 : handleRequestOptions.onMockedResponse) == null ? void 0 : _f.call(
|
|
@@ -5479,183 +5645,16 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
|
|
|
5479
5645
|
transformedResponse,
|
|
5480
5646
|
requiredLookupResult
|
|
5481
5647
|
);
|
|
5482
|
-
emitter.emit("request:end", request, requestId);
|
|
5648
|
+
emitter.emit("request:end", { request, requestId });
|
|
5483
5649
|
return transformedResponse;
|
|
5484
5650
|
});
|
|
5485
5651
|
}
|
|
5486
5652
|
|
|
5487
|
-
// node_modules/.pnpm/@bundled-es-modules+statuses@1.0.1/node_modules/@bundled-es-modules/statuses/index-esm.js
|
|
5488
|
-
var __create4 = Object.create;
|
|
5489
|
-
var __defProp6 = Object.defineProperty;
|
|
5490
|
-
var __getOwnPropDesc5 = Object.getOwnPropertyDescriptor;
|
|
5491
|
-
var __getOwnPropNames5 = Object.getOwnPropertyNames;
|
|
5492
|
-
var __getProtoOf4 = Object.getPrototypeOf;
|
|
5493
|
-
var __hasOwnProp5 = Object.prototype.hasOwnProperty;
|
|
5494
|
-
var __commonJS4 = (cb, mod) => function __require3() {
|
|
5495
|
-
return mod || (0, cb[__getOwnPropNames5(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
5496
|
-
};
|
|
5497
|
-
var __copyProps5 = (to, from, except, desc) => {
|
|
5498
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
5499
|
-
for (let key of __getOwnPropNames5(from))
|
|
5500
|
-
if (!__hasOwnProp5.call(to, key) && key !== except)
|
|
5501
|
-
__defProp6(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc5(from, key)) || desc.enumerable });
|
|
5502
|
-
}
|
|
5503
|
-
return to;
|
|
5504
|
-
};
|
|
5505
|
-
var __toESM4 = (mod, isNodeMode, target) => (target = mod != null ? __create4(__getProtoOf4(mod)) : {}, __copyProps5(
|
|
5506
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
5507
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
5508
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
5509
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
5510
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp6(target, "default", { value: mod, enumerable: true }) : target,
|
|
5511
|
-
mod
|
|
5512
|
-
));
|
|
5513
|
-
var require_codes = __commonJS4({
|
|
5514
|
-
"node_modules/statuses/codes.json"(exports, module) {
|
|
5515
|
-
module.exports = {
|
|
5516
|
-
"100": "Continue",
|
|
5517
|
-
"101": "Switching Protocols",
|
|
5518
|
-
"102": "Processing",
|
|
5519
|
-
"103": "Early Hints",
|
|
5520
|
-
"200": "OK",
|
|
5521
|
-
"201": "Created",
|
|
5522
|
-
"202": "Accepted",
|
|
5523
|
-
"203": "Non-Authoritative Information",
|
|
5524
|
-
"204": "No Content",
|
|
5525
|
-
"205": "Reset Content",
|
|
5526
|
-
"206": "Partial Content",
|
|
5527
|
-
"207": "Multi-Status",
|
|
5528
|
-
"208": "Already Reported",
|
|
5529
|
-
"226": "IM Used",
|
|
5530
|
-
"300": "Multiple Choices",
|
|
5531
|
-
"301": "Moved Permanently",
|
|
5532
|
-
"302": "Found",
|
|
5533
|
-
"303": "See Other",
|
|
5534
|
-
"304": "Not Modified",
|
|
5535
|
-
"305": "Use Proxy",
|
|
5536
|
-
"307": "Temporary Redirect",
|
|
5537
|
-
"308": "Permanent Redirect",
|
|
5538
|
-
"400": "Bad Request",
|
|
5539
|
-
"401": "Unauthorized",
|
|
5540
|
-
"402": "Payment Required",
|
|
5541
|
-
"403": "Forbidden",
|
|
5542
|
-
"404": "Not Found",
|
|
5543
|
-
"405": "Method Not Allowed",
|
|
5544
|
-
"406": "Not Acceptable",
|
|
5545
|
-
"407": "Proxy Authentication Required",
|
|
5546
|
-
"408": "Request Timeout",
|
|
5547
|
-
"409": "Conflict",
|
|
5548
|
-
"410": "Gone",
|
|
5549
|
-
"411": "Length Required",
|
|
5550
|
-
"412": "Precondition Failed",
|
|
5551
|
-
"413": "Payload Too Large",
|
|
5552
|
-
"414": "URI Too Long",
|
|
5553
|
-
"415": "Unsupported Media Type",
|
|
5554
|
-
"416": "Range Not Satisfiable",
|
|
5555
|
-
"417": "Expectation Failed",
|
|
5556
|
-
"418": "I'm a Teapot",
|
|
5557
|
-
"421": "Misdirected Request",
|
|
5558
|
-
"422": "Unprocessable Entity",
|
|
5559
|
-
"423": "Locked",
|
|
5560
|
-
"424": "Failed Dependency",
|
|
5561
|
-
"425": "Too Early",
|
|
5562
|
-
"426": "Upgrade Required",
|
|
5563
|
-
"428": "Precondition Required",
|
|
5564
|
-
"429": "Too Many Requests",
|
|
5565
|
-
"431": "Request Header Fields Too Large",
|
|
5566
|
-
"451": "Unavailable For Legal Reasons",
|
|
5567
|
-
"500": "Internal Server Error",
|
|
5568
|
-
"501": "Not Implemented",
|
|
5569
|
-
"502": "Bad Gateway",
|
|
5570
|
-
"503": "Service Unavailable",
|
|
5571
|
-
"504": "Gateway Timeout",
|
|
5572
|
-
"505": "HTTP Version Not Supported",
|
|
5573
|
-
"506": "Variant Also Negotiates",
|
|
5574
|
-
"507": "Insufficient Storage",
|
|
5575
|
-
"508": "Loop Detected",
|
|
5576
|
-
"509": "Bandwidth Limit Exceeded",
|
|
5577
|
-
"510": "Not Extended",
|
|
5578
|
-
"511": "Network Authentication Required"
|
|
5579
|
-
};
|
|
5580
|
-
}
|
|
5581
|
-
});
|
|
5582
|
-
var require_statuses = __commonJS4({
|
|
5583
|
-
"node_modules/statuses/index.js"(exports, module) {
|
|
5584
|
-
"use strict";
|
|
5585
|
-
var codes = require_codes();
|
|
5586
|
-
module.exports = status2;
|
|
5587
|
-
status2.message = codes;
|
|
5588
|
-
status2.code = createMessageToStatusCodeMap(codes);
|
|
5589
|
-
status2.codes = createStatusCodeList(codes);
|
|
5590
|
-
status2.redirect = {
|
|
5591
|
-
300: true,
|
|
5592
|
-
301: true,
|
|
5593
|
-
302: true,
|
|
5594
|
-
303: true,
|
|
5595
|
-
305: true,
|
|
5596
|
-
307: true,
|
|
5597
|
-
308: true
|
|
5598
|
-
};
|
|
5599
|
-
status2.empty = {
|
|
5600
|
-
204: true,
|
|
5601
|
-
205: true,
|
|
5602
|
-
304: true
|
|
5603
|
-
};
|
|
5604
|
-
status2.retry = {
|
|
5605
|
-
502: true,
|
|
5606
|
-
503: true,
|
|
5607
|
-
504: true
|
|
5608
|
-
};
|
|
5609
|
-
function createMessageToStatusCodeMap(codes2) {
|
|
5610
|
-
var map = {};
|
|
5611
|
-
Object.keys(codes2).forEach(function forEachCode(code) {
|
|
5612
|
-
var message2 = codes2[code];
|
|
5613
|
-
var status3 = Number(code);
|
|
5614
|
-
map[message2.toLowerCase()] = status3;
|
|
5615
|
-
});
|
|
5616
|
-
return map;
|
|
5617
|
-
}
|
|
5618
|
-
function createStatusCodeList(codes2) {
|
|
5619
|
-
return Object.keys(codes2).map(function mapCode(code) {
|
|
5620
|
-
return Number(code);
|
|
5621
|
-
});
|
|
5622
|
-
}
|
|
5623
|
-
function getStatusCode(message2) {
|
|
5624
|
-
var msg = message2.toLowerCase();
|
|
5625
|
-
if (!Object.prototype.hasOwnProperty.call(status2.code, msg)) {
|
|
5626
|
-
throw new Error('invalid status message: "' + message2 + '"');
|
|
5627
|
-
}
|
|
5628
|
-
return status2.code[msg];
|
|
5629
|
-
}
|
|
5630
|
-
function getStatusMessage(code) {
|
|
5631
|
-
if (!Object.prototype.hasOwnProperty.call(status2.message, code)) {
|
|
5632
|
-
throw new Error("invalid status code: " + code);
|
|
5633
|
-
}
|
|
5634
|
-
return status2.message[code];
|
|
5635
|
-
}
|
|
5636
|
-
function status2(code) {
|
|
5637
|
-
if (typeof code === "number") {
|
|
5638
|
-
return getStatusMessage(code);
|
|
5639
|
-
}
|
|
5640
|
-
if (typeof code !== "string") {
|
|
5641
|
-
throw new TypeError("code must be a number or string");
|
|
5642
|
-
}
|
|
5643
|
-
var n = parseInt(code, 10);
|
|
5644
|
-
if (!isNaN(n)) {
|
|
5645
|
-
return getStatusMessage(n);
|
|
5646
|
-
}
|
|
5647
|
-
return getStatusCode(code);
|
|
5648
|
-
}
|
|
5649
|
-
}
|
|
5650
|
-
});
|
|
5651
|
-
var import_statuses = __toESM4(require_statuses(), 1);
|
|
5652
|
-
var source_default3 = import_statuses.default;
|
|
5653
|
-
|
|
5654
5653
|
// src/core/utils/HttpResponse/decorators.ts
|
|
5655
|
-
var { message } =
|
|
5654
|
+
var { message: message2 } = source_default;
|
|
5656
5655
|
function normalizeResponseInit(init = {}) {
|
|
5657
5656
|
const status = (init == null ? void 0 : init.status) || 200;
|
|
5658
|
-
const statusText = (init == null ? void 0 : init.statusText) ||
|
|
5657
|
+
const statusText = (init == null ? void 0 : init.statusText) || message2[status] || "";
|
|
5659
5658
|
const headers = new Headers(init == null ? void 0 : init.headers);
|
|
5660
5659
|
return __spreadProps(__spreadValues({}, init), {
|
|
5661
5660
|
headers,
|
|
@@ -5863,8 +5862,8 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
|
|
|
5863
5862
|
|
|
5864
5863
|
// src/core/NetworkError.ts
|
|
5865
5864
|
var NetworkError = class extends Error {
|
|
5866
|
-
constructor(
|
|
5867
|
-
super(
|
|
5865
|
+
constructor(message3) {
|
|
5866
|
+
super(message3);
|
|
5868
5867
|
this.name = "NetworkError";
|
|
5869
5868
|
}
|
|
5870
5869
|
};
|
|
@@ -5955,9 +5954,9 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
|
|
|
5955
5954
|
if (args.quiet) {
|
|
5956
5955
|
return;
|
|
5957
5956
|
}
|
|
5958
|
-
const
|
|
5957
|
+
const message3 = args.message || "Mocking enabled.";
|
|
5959
5958
|
console.groupCollapsed(
|
|
5960
|
-
`%c${devUtils.formatMessage(
|
|
5959
|
+
`%c${devUtils.formatMessage(message3)}`,
|
|
5961
5960
|
"color:orangered;font-weight:bold;"
|
|
5962
5961
|
);
|
|
5963
5962
|
console.log(
|
|
@@ -6001,8 +6000,8 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
|
|
|
6001
6000
|
constructor(port) {
|
|
6002
6001
|
this.port = port;
|
|
6003
6002
|
}
|
|
6004
|
-
postMessage(event, ...
|
|
6005
|
-
const [data, transfer] =
|
|
6003
|
+
postMessage(event, ...rest) {
|
|
6004
|
+
const [data, transfer] = rest;
|
|
6006
6005
|
this.port.postMessage(
|
|
6007
6006
|
{ type: event, data },
|
|
6008
6007
|
{
|
|
@@ -6040,11 +6039,11 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
|
|
|
6040
6039
|
|
|
6041
6040
|
// src/browser/setupWorker/start/createRequestListener.ts
|
|
6042
6041
|
var createRequestListener = (context, options) => {
|
|
6043
|
-
return (event,
|
|
6042
|
+
return (event, message3) => __async(void 0, null, function* () {
|
|
6044
6043
|
var _b2;
|
|
6045
6044
|
const messageChannel = new WorkerChannel(event.ports[0]);
|
|
6046
|
-
const requestId =
|
|
6047
|
-
const request = parseWorkerRequest(
|
|
6045
|
+
const requestId = message3.payload.id;
|
|
6046
|
+
const request = parseWorkerRequest(message3.payload);
|
|
6048
6047
|
const requestCloneForLogs = request.clone();
|
|
6049
6048
|
try {
|
|
6050
6049
|
let _a2;
|
|
@@ -6073,7 +6072,7 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
|
|
|
6073
6072
|
responseStream ? [responseStream] : void 0
|
|
6074
6073
|
);
|
|
6075
6074
|
if (!options.quiet) {
|
|
6076
|
-
context.emitter.once("response:mocked", (response2) => {
|
|
6075
|
+
context.emitter.once("response:mocked", ({ response: response2 }) => {
|
|
6077
6076
|
handler.log(requestCloneForLogs, response2, parsedRequest);
|
|
6078
6077
|
});
|
|
6079
6078
|
}
|
|
@@ -6124,9 +6123,9 @@ This exception has been gracefully handled as a 500 response, however, it's stro
|
|
|
6124
6123
|
const { payload: actualChecksum } = yield context.events.once(
|
|
6125
6124
|
"INTEGRITY_CHECK_RESPONSE"
|
|
6126
6125
|
);
|
|
6127
|
-
if (actualChecksum !== "
|
|
6126
|
+
if (actualChecksum !== "42fb047ce943b9103a6ed499f86548c4") {
|
|
6128
6127
|
throw new Error(
|
|
6129
|
-
`Currently active Service Worker (${actualChecksum}) is behind the latest published one (${"
|
|
6128
|
+
`Currently active Service Worker (${actualChecksum}) is behind the latest published one (${"42fb047ce943b9103a6ed499f86548c4"}).`
|
|
6130
6129
|
);
|
|
6131
6130
|
}
|
|
6132
6131
|
return serviceWorker;
|
|
@@ -6152,33 +6151,25 @@ This exception has been gracefully handled as a 500 response, however, it's stro
|
|
|
6152
6151
|
|
|
6153
6152
|
// src/browser/setupWorker/start/createResponseListener.ts
|
|
6154
6153
|
function createResponseListener(context) {
|
|
6155
|
-
return (_,
|
|
6154
|
+
return (_, message3) => {
|
|
6156
6155
|
var _a2;
|
|
6157
|
-
const { payload: responseJson } =
|
|
6156
|
+
const { payload: responseJson } = message3;
|
|
6158
6157
|
if ((_a2 = responseJson.type) == null ? void 0 : _a2.includes("opaque")) {
|
|
6159
6158
|
return;
|
|
6160
6159
|
}
|
|
6161
|
-
const response = new Response(responseJson.body, responseJson);
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
"response:mocked",
|
|
6160
|
+
const response = responseJson.status === 0 ? Response.error() : new Response(responseJson.body, responseJson);
|
|
6161
|
+
context.emitter.emit(
|
|
6162
|
+
responseJson.isMockedResponse ? "response:mocked" : "response:bypass",
|
|
6163
|
+
{
|
|
6166
6164
|
response,
|
|
6167
6165
|
/**
|
|
6168
6166
|
* @todo @fixme In this context, we don't know anything about
|
|
6169
6167
|
* the request.
|
|
6170
6168
|
*/
|
|
6171
|
-
null,
|
|
6172
|
-
responseJson.requestId
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
context.emitter.emit(
|
|
6176
|
-
"response:bypass",
|
|
6177
|
-
response,
|
|
6178
|
-
null,
|
|
6179
|
-
responseJson.requestId
|
|
6180
|
-
);
|
|
6181
|
-
}
|
|
6169
|
+
request: null,
|
|
6170
|
+
requestId: responseJson.requestId
|
|
6171
|
+
}
|
|
6172
|
+
);
|
|
6182
6173
|
};
|
|
6183
6174
|
}
|
|
6184
6175
|
|
|
@@ -6346,7 +6337,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6346
6337
|
}
|
|
6347
6338
|
};
|
|
6348
6339
|
|
|
6349
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
6340
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-RT3ATOJH.mjs
|
|
6350
6341
|
function uuidv4() {
|
|
6351
6342
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
6352
6343
|
const r = Math.random() * 16 | 0;
|
|
@@ -6399,7 +6390,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6399
6390
|
return request;
|
|
6400
6391
|
}
|
|
6401
6392
|
|
|
6402
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
6393
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-MW6NCDWE.mjs
|
|
6403
6394
|
var __getOwnPropNames6 = Object.getOwnPropertyNames;
|
|
6404
6395
|
var __commonJS5 = (cb, mod) => function __require3() {
|
|
6405
6396
|
return mod || (0, cb[__getOwnPropNames6(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
@@ -6562,17 +6553,13 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6562
6553
|
logger.info('removed proxied "%s" listener!', event);
|
|
6563
6554
|
});
|
|
6564
6555
|
};
|
|
6565
|
-
|
|
6566
|
-
this.readyState = "APPLIED";
|
|
6567
|
-
});
|
|
6556
|
+
this.readyState = "APPLIED";
|
|
6568
6557
|
return;
|
|
6569
6558
|
}
|
|
6570
6559
|
logger.info("no running instance found, setting up a new instance...");
|
|
6571
6560
|
this.setup();
|
|
6572
6561
|
this.setInstance();
|
|
6573
|
-
|
|
6574
|
-
this.readyState = "APPLIED";
|
|
6575
|
-
});
|
|
6562
|
+
this.readyState = "APPLIED";
|
|
6576
6563
|
}
|
|
6577
6564
|
setup() {
|
|
6578
6565
|
}
|
|
@@ -6609,9 +6596,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6609
6596
|
}
|
|
6610
6597
|
this.emitter.deactivate();
|
|
6611
6598
|
logger.info("destroyed the listener!");
|
|
6612
|
-
|
|
6613
|
-
this.readyState = "DISPOSED";
|
|
6614
|
-
});
|
|
6599
|
+
this.readyState = "DISPOSED";
|
|
6615
6600
|
}
|
|
6616
6601
|
getInstance() {
|
|
6617
6602
|
var _a2;
|
|
@@ -6629,7 +6614,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6629
6614
|
}
|
|
6630
6615
|
};
|
|
6631
6616
|
|
|
6632
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
6617
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-AKTXHQ7X.mjs
|
|
6633
6618
|
var _FetchInterceptor = class extends Interceptor2 {
|
|
6634
6619
|
constructor() {
|
|
6635
6620
|
super(_FetchInterceptor.symbol);
|
|
@@ -6653,12 +6638,15 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6653
6638
|
'emitting the "request" event for %d listener(s)...',
|
|
6654
6639
|
this.emitter.listenerCount("request")
|
|
6655
6640
|
);
|
|
6656
|
-
this.emitter.emit("request",
|
|
6641
|
+
this.emitter.emit("request", {
|
|
6642
|
+
request: interactiveRequest,
|
|
6643
|
+
requestId
|
|
6644
|
+
});
|
|
6657
6645
|
this.logger.info("awaiting for the mocked response...");
|
|
6658
6646
|
const resolverResult = yield until(() => __async(this, null, function* () {
|
|
6659
6647
|
yield this.emitter.untilIdle(
|
|
6660
6648
|
"request",
|
|
6661
|
-
({ args: [
|
|
6649
|
+
({ args: [{ requestId: pendingRequestId }] }) => {
|
|
6662
6650
|
return pendingRequestId === requestId;
|
|
6663
6651
|
}
|
|
6664
6652
|
);
|
|
@@ -6668,7 +6656,6 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6668
6656
|
return mockedResponse2;
|
|
6669
6657
|
}));
|
|
6670
6658
|
if (resolverResult.error) {
|
|
6671
|
-
console.error(`${request.method} ${request.url} net::ERR_FAILED`);
|
|
6672
6659
|
const error3 = Object.assign(new TypeError("Failed to fetch"), {
|
|
6673
6660
|
cause: resolverResult.error
|
|
6674
6661
|
});
|
|
@@ -6677,13 +6664,13 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6677
6664
|
const mockedResponse = resolverResult.data;
|
|
6678
6665
|
if (mockedResponse && !((_a2 = request.signal) == null ? void 0 : _a2.aborted)) {
|
|
6679
6666
|
this.logger.info("received mocked response:", mockedResponse);
|
|
6680
|
-
const
|
|
6681
|
-
this.emitter.emit(
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
interactiveRequest,
|
|
6667
|
+
const responseClone = mockedResponse.clone();
|
|
6668
|
+
this.emitter.emit("response", {
|
|
6669
|
+
response: responseClone,
|
|
6670
|
+
isMockedResponse: true,
|
|
6671
|
+
request: interactiveRequest,
|
|
6685
6672
|
requestId
|
|
6686
|
-
);
|
|
6673
|
+
});
|
|
6687
6674
|
const response = new Response(mockedResponse.body, mockedResponse);
|
|
6688
6675
|
Object.defineProperty(response, "url", {
|
|
6689
6676
|
writable: false,
|
|
@@ -6697,12 +6684,12 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6697
6684
|
return pureFetch(request).then((response) => {
|
|
6698
6685
|
const responseClone = response.clone();
|
|
6699
6686
|
this.logger.info("original fetch performed", responseClone);
|
|
6700
|
-
this.emitter.emit(
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
interactiveRequest,
|
|
6687
|
+
this.emitter.emit("response", {
|
|
6688
|
+
response: responseClone,
|
|
6689
|
+
isMockedResponse: false,
|
|
6690
|
+
request: interactiveRequest,
|
|
6704
6691
|
requestId
|
|
6705
|
-
);
|
|
6692
|
+
});
|
|
6706
6693
|
return response;
|
|
6707
6694
|
});
|
|
6708
6695
|
});
|
|
@@ -6726,7 +6713,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6726
6713
|
var FetchInterceptor = _FetchInterceptor;
|
|
6727
6714
|
FetchInterceptor.symbol = Symbol("fetch");
|
|
6728
6715
|
|
|
6729
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
6716
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-MQA5WAD4.mjs
|
|
6730
6717
|
var require_shams = __commonJS5({
|
|
6731
6718
|
"node_modules/has-symbols/shams.js"(exports, module) {
|
|
6732
6719
|
"use strict";
|
|
@@ -8806,7 +8793,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
8806
8793
|
);
|
|
8807
8794
|
}
|
|
8808
8795
|
|
|
8809
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.
|
|
8796
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.23.0/node_modules/@mswjs/interceptors/lib/browser/chunk-DWXGORCS.mjs
|
|
8810
8797
|
function concatArrayBuffer(left, right) {
|
|
8811
8798
|
const result = new Uint8Array(left.byteLength + right.byteLength);
|
|
8812
8799
|
result.set(left, 0);
|
|
@@ -8885,6 +8872,17 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
8885
8872
|
});
|
|
8886
8873
|
return event;
|
|
8887
8874
|
}
|
|
8875
|
+
function findPropertySource(target, propertyName) {
|
|
8876
|
+
if (!(propertyName in target)) {
|
|
8877
|
+
return null;
|
|
8878
|
+
}
|
|
8879
|
+
const hasProperty = Object.prototype.hasOwnProperty.call(target, propertyName);
|
|
8880
|
+
if (hasProperty) {
|
|
8881
|
+
return target;
|
|
8882
|
+
}
|
|
8883
|
+
const prototype = Reflect.getPrototypeOf(target);
|
|
8884
|
+
return prototype ? findPropertySource(prototype, propertyName) : null;
|
|
8885
|
+
}
|
|
8888
8886
|
function createProxy(target, options) {
|
|
8889
8887
|
const proxy = new Proxy(target, optionsToProxyHandler(options));
|
|
8890
8888
|
return proxy;
|
|
@@ -8900,15 +8898,18 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
8900
8898
|
}
|
|
8901
8899
|
handler.set = function(target, propertyName, nextValue, receiver) {
|
|
8902
8900
|
const next = () => {
|
|
8901
|
+
const propertySource = findPropertySource(target, propertyName);
|
|
8902
|
+
if (propertySource === null)
|
|
8903
|
+
return false;
|
|
8903
8904
|
const ownDescriptors = Reflect.getOwnPropertyDescriptor(
|
|
8904
|
-
|
|
8905
|
+
propertySource,
|
|
8905
8906
|
propertyName
|
|
8906
8907
|
);
|
|
8907
8908
|
if (typeof (ownDescriptors == null ? void 0 : ownDescriptors.set) !== "undefined") {
|
|
8908
8909
|
ownDescriptors.set.apply(target, [nextValue]);
|
|
8909
8910
|
return true;
|
|
8910
8911
|
}
|
|
8911
|
-
return Reflect.defineProperty(
|
|
8912
|
+
return Reflect.defineProperty(propertySource, propertyName, {
|
|
8912
8913
|
writable: true,
|
|
8913
8914
|
enumerable: true,
|
|
8914
8915
|
configurable: true,
|
|
@@ -8963,6 +8964,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
8963
8964
|
headers: stringToHeaders(request.getAllResponseHeaders())
|
|
8964
8965
|
});
|
|
8965
8966
|
}
|
|
8967
|
+
var IS_MOCKED_RESPONSE = Symbol("isMockedResponse");
|
|
8966
8968
|
var XMLHttpRequestController = class {
|
|
8967
8969
|
constructor(initialRequest, logger) {
|
|
8968
8970
|
this.initialRequest = initialRequest;
|
|
@@ -9027,16 +9029,19 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9027
9029
|
this.request,
|
|
9028
9030
|
this.request.response
|
|
9029
9031
|
);
|
|
9030
|
-
this.onResponse.call(
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
fetchRequest,
|
|
9034
|
-
this.requestId
|
|
9035
|
-
);
|
|
9032
|
+
this.onResponse.call(this, {
|
|
9033
|
+
response: fetchResponse,
|
|
9034
|
+
isMockedResponse: IS_MOCKED_RESPONSE in this.request,
|
|
9035
|
+
request: fetchRequest,
|
|
9036
|
+
requestId: this.requestId
|
|
9037
|
+
});
|
|
9036
9038
|
}
|
|
9037
9039
|
});
|
|
9038
9040
|
const fetchRequest = this.toFetchApiRequest();
|
|
9039
|
-
const onceRequestSettled = ((_a2 = this.onRequest) == null ? void 0 : _a2.call(this,
|
|
9041
|
+
const onceRequestSettled = ((_a2 = this.onRequest) == null ? void 0 : _a2.call(this, {
|
|
9042
|
+
request: fetchRequest,
|
|
9043
|
+
requestId: this.requestId
|
|
9044
|
+
})) || Promise.resolve();
|
|
9040
9045
|
onceRequestSettled.finally(() => {
|
|
9041
9046
|
if (this.request.readyState < this.request.LOADING) {
|
|
9042
9047
|
this.logger.info(
|
|
@@ -9068,6 +9073,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9068
9073
|
response.status,
|
|
9069
9074
|
response.statusText
|
|
9070
9075
|
);
|
|
9076
|
+
define(this.request, IS_MOCKED_RESPONSE, true);
|
|
9071
9077
|
define(this.request, "status", response.status);
|
|
9072
9078
|
define(this.request, "statusText", response.statusText);
|
|
9073
9079
|
define(this.request, "responseURL", this.url.href);
|
|
@@ -9292,7 +9298,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9292
9298
|
method: this.method,
|
|
9293
9299
|
headers: this.requestHeaders,
|
|
9294
9300
|
credentials: this.request.withCredentials ? "include" : "same-origin",
|
|
9295
|
-
body: this.requestBody
|
|
9301
|
+
body: ["GET", "HEAD"].includes(this.method) ? null : this.requestBody
|
|
9296
9302
|
});
|
|
9297
9303
|
const proxyHeaders = createProxy(fetchRequest.headers, {
|
|
9298
9304
|
methodCall: ([methodName, args], invoke) => {
|
|
@@ -9351,19 +9357,22 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9351
9357
|
originalRequest,
|
|
9352
9358
|
logger
|
|
9353
9359
|
);
|
|
9354
|
-
requestController.onRequest = function(
|
|
9355
|
-
return __async(this,
|
|
9360
|
+
requestController.onRequest = function(_0) {
|
|
9361
|
+
return __async(this, arguments, function* ({ request, requestId }) {
|
|
9356
9362
|
const interactiveRequest = toInteractiveRequest(request);
|
|
9357
9363
|
this.logger.info(
|
|
9358
9364
|
'emitting the "request" event for %s listener(s)...',
|
|
9359
9365
|
emitter.listenerCount("request")
|
|
9360
9366
|
);
|
|
9361
|
-
emitter.emit("request",
|
|
9367
|
+
emitter.emit("request", {
|
|
9368
|
+
request: interactiveRequest,
|
|
9369
|
+
requestId
|
|
9370
|
+
});
|
|
9362
9371
|
this.logger.info("awaiting mocked response...");
|
|
9363
9372
|
const resolverResult = yield until(() => __async(this, null, function* () {
|
|
9364
9373
|
yield emitter.untilIdle(
|
|
9365
9374
|
"request",
|
|
9366
|
-
({ args: [
|
|
9375
|
+
({ args: [{ requestId: pendingRequestId }] }) => {
|
|
9367
9376
|
return pendingRequestId === requestId;
|
|
9368
9377
|
}
|
|
9369
9378
|
);
|
|
@@ -9394,13 +9403,23 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9394
9403
|
);
|
|
9395
9404
|
});
|
|
9396
9405
|
};
|
|
9397
|
-
requestController.onResponse = function(
|
|
9398
|
-
return __async(this,
|
|
9406
|
+
requestController.onResponse = function(_0) {
|
|
9407
|
+
return __async(this, arguments, function* ({
|
|
9408
|
+
response,
|
|
9409
|
+
isMockedResponse,
|
|
9410
|
+
request,
|
|
9411
|
+
requestId
|
|
9412
|
+
}) {
|
|
9399
9413
|
this.logger.info(
|
|
9400
9414
|
'emitting the "response" event for %s listener(s)...',
|
|
9401
9415
|
emitter.listenerCount("response")
|
|
9402
9416
|
);
|
|
9403
|
-
emitter.emit("response",
|
|
9417
|
+
emitter.emit("response", {
|
|
9418
|
+
response,
|
|
9419
|
+
isMockedResponse,
|
|
9420
|
+
request,
|
|
9421
|
+
requestId
|
|
9422
|
+
});
|
|
9404
9423
|
});
|
|
9405
9424
|
};
|
|
9406
9425
|
return requestController.request;
|
|
@@ -9457,7 +9476,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9457
9476
|
name: "fallback",
|
|
9458
9477
|
interceptors: [new FetchInterceptor(), new XMLHttpRequestInterceptor()]
|
|
9459
9478
|
});
|
|
9460
|
-
interceptor.on("request", (
|
|
9479
|
+
interceptor.on("request", (_0) => __async(this, [_0], function* ({ request, requestId }) {
|
|
9461
9480
|
const requestCloneForLogs = request.clone();
|
|
9462
9481
|
const response = yield handleRequest(
|
|
9463
9482
|
request,
|
|
@@ -9468,7 +9487,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9468
9487
|
{
|
|
9469
9488
|
onMockedResponse(_, { handler, parsedRequest }) {
|
|
9470
9489
|
if (!options.quiet) {
|
|
9471
|
-
context.emitter.once("response:mocked", (response2) => {
|
|
9490
|
+
context.emitter.once("response:mocked", ({ response: response2 }) => {
|
|
9472
9491
|
handler.log(requestCloneForLogs, response2, parsedRequest);
|
|
9473
9492
|
});
|
|
9474
9493
|
}
|
|
@@ -9479,13 +9498,19 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9479
9498
|
request.respondWith(response);
|
|
9480
9499
|
}
|
|
9481
9500
|
}));
|
|
9482
|
-
interceptor.on(
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9501
|
+
interceptor.on(
|
|
9502
|
+
"response",
|
|
9503
|
+
({ response, isMockedResponse, request, requestId }) => {
|
|
9504
|
+
context.emitter.emit(
|
|
9505
|
+
isMockedResponse ? "response:mocked" : "response:bypass",
|
|
9506
|
+
{
|
|
9507
|
+
response,
|
|
9508
|
+
request,
|
|
9509
|
+
requestId
|
|
9510
|
+
}
|
|
9511
|
+
);
|
|
9487
9512
|
}
|
|
9488
|
-
|
|
9513
|
+
);
|
|
9489
9514
|
interceptor.apply();
|
|
9490
9515
|
return interceptor;
|
|
9491
9516
|
}
|
|
@@ -9547,12 +9572,12 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9547
9572
|
if (event.source !== this.context.worker) {
|
|
9548
9573
|
return;
|
|
9549
9574
|
}
|
|
9550
|
-
const
|
|
9551
|
-
if (!
|
|
9575
|
+
const message3 = event.data;
|
|
9576
|
+
if (!message3) {
|
|
9552
9577
|
return;
|
|
9553
9578
|
}
|
|
9554
|
-
if (
|
|
9555
|
-
callback(event,
|
|
9579
|
+
if (message3.type === eventType) {
|
|
9580
|
+
callback(event, message3);
|
|
9556
9581
|
}
|
|
9557
9582
|
});
|
|
9558
9583
|
},
|
|
@@ -9584,9 +9609,9 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9584
9609
|
return new Promise((resolve, reject) => {
|
|
9585
9610
|
const handleIncomingMessage = (event) => {
|
|
9586
9611
|
try {
|
|
9587
|
-
const
|
|
9588
|
-
if (
|
|
9589
|
-
resolve(
|
|
9612
|
+
const message3 = event.data;
|
|
9613
|
+
if (message3.type === eventType) {
|
|
9614
|
+
resolve(message3);
|
|
9590
9615
|
}
|
|
9591
9616
|
} catch (error3) {
|
|
9592
9617
|
reject(error3);
|
|
@@ -9629,19 +9654,6 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9629
9654
|
return yield this.startHandler(this.context.startOptions, options);
|
|
9630
9655
|
});
|
|
9631
9656
|
}
|
|
9632
|
-
printHandlers() {
|
|
9633
|
-
const handlers = this.listHandlers();
|
|
9634
|
-
handlers.forEach((handler) => {
|
|
9635
|
-
const { header, callFrame } = handler.info;
|
|
9636
|
-
const pragma = handler.info.hasOwnProperty("operationType") ? "[graphql]" : "[rest]";
|
|
9637
|
-
console.groupCollapsed(`${pragma} ${header}`);
|
|
9638
|
-
if (callFrame) {
|
|
9639
|
-
console.log(`Declaration: ${callFrame}`);
|
|
9640
|
-
}
|
|
9641
|
-
console.log("Handler:", handler);
|
|
9642
|
-
console.groupEnd();
|
|
9643
|
-
});
|
|
9644
|
-
}
|
|
9645
9657
|
stop() {
|
|
9646
9658
|
super.dispose();
|
|
9647
9659
|
this.context.events.removeAllListeners();
|
|
@@ -9656,26 +9668,26 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
9656
9668
|
})();
|
|
9657
9669
|
/*! Bundled license information:
|
|
9658
9670
|
|
|
9659
|
-
@bundled-es-modules/
|
|
9671
|
+
@bundled-es-modules/statuses/index-esm.js:
|
|
9660
9672
|
(*! Bundled license information:
|
|
9661
9673
|
|
|
9662
|
-
|
|
9674
|
+
statuses/index.js:
|
|
9663
9675
|
(*!
|
|
9664
|
-
*
|
|
9665
|
-
* Copyright(c)
|
|
9666
|
-
* Copyright(c)
|
|
9676
|
+
* statuses
|
|
9677
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
9678
|
+
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
9667
9679
|
* MIT Licensed
|
|
9668
9680
|
*)
|
|
9669
9681
|
*)
|
|
9670
9682
|
|
|
9671
|
-
@bundled-es-modules/
|
|
9683
|
+
@bundled-es-modules/cookie/index-esm.js:
|
|
9672
9684
|
(*! Bundled license information:
|
|
9673
9685
|
|
|
9674
|
-
|
|
9686
|
+
cookie/index.js:
|
|
9675
9687
|
(*!
|
|
9676
|
-
*
|
|
9677
|
-
* Copyright(c) 2014
|
|
9678
|
-
* Copyright(c)
|
|
9688
|
+
* cookie
|
|
9689
|
+
* Copyright(c) 2012-2014 Roman Shtylman
|
|
9690
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
9679
9691
|
* MIT Licensed
|
|
9680
9692
|
*)
|
|
9681
9693
|
*)
|