msw 2.1.5 → 2.1.7
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/lib/browser/index.js +17 -16
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/index.mjs +17 -16
- package/lib/browser/index.mjs.map +1 -1
- package/lib/core/{GraphQLHandler-rZ7XkeDz.d.mts → GraphQLHandler-AenIUdwE.d.mts} +1 -1
- package/lib/core/{GraphQLHandler-eJejgV5u.d.ts → GraphQLHandler-jOzqbxSK.d.ts} +1 -1
- package/lib/core/HttpResponse.d.mts +1 -1
- package/lib/core/HttpResponse.d.ts +1 -1
- package/lib/core/SetupApi.d.mts +1 -1
- package/lib/core/SetupApi.d.ts +1 -1
- package/lib/core/getResponse.d.mts +1 -1
- package/lib/core/getResponse.d.ts +1 -1
- package/lib/core/graphql.d.mts +2 -2
- package/lib/core/graphql.d.ts +2 -2
- package/lib/core/handlers/GraphQLHandler.d.mts +2 -2
- package/lib/core/handlers/GraphQLHandler.d.ts +2 -2
- package/lib/core/handlers/HttpHandler.d.mts +1 -1
- package/lib/core/handlers/HttpHandler.d.ts +1 -1
- package/lib/core/handlers/RequestHandler.d.mts +1 -1
- package/lib/core/handlers/RequestHandler.d.ts +1 -1
- package/lib/core/http.d.mts +1 -1
- package/lib/core/http.d.ts +1 -1
- package/lib/core/index.d.mts +2 -2
- package/lib/core/index.d.ts +2 -2
- package/lib/core/passthrough.d.mts +4 -1
- package/lib/core/passthrough.d.ts +4 -1
- package/lib/core/passthrough.js.map +1 -1
- package/lib/core/passthrough.mjs.map +1 -1
- package/lib/core/utils/HttpResponse/decorators.d.mts +1 -1
- package/lib/core/utils/HttpResponse/decorators.d.ts +1 -1
- package/lib/core/utils/executeHandlers.d.mts +1 -1
- package/lib/core/utils/executeHandlers.d.ts +1 -1
- package/lib/core/utils/handleRequest.d.mts +1 -1
- package/lib/core/utils/handleRequest.d.ts +1 -1
- package/lib/core/utils/internal/parseGraphQLRequest.d.mts +2 -2
- package/lib/core/utils/internal/parseGraphQLRequest.d.ts +2 -2
- package/lib/core/utils/internal/parseMultipartData.d.mts +1 -1
- package/lib/core/utils/internal/parseMultipartData.d.ts +1 -1
- package/lib/core/utils/internal/requestHandlerUtils.d.mts +1 -1
- package/lib/core/utils/internal/requestHandlerUtils.d.ts +1 -1
- package/lib/iife/index.js +17 -16
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/lib/native/index.js +5 -1
- package/lib/native/index.js.map +1 -1
- package/lib/native/index.mjs +5 -1
- package/lib/native/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/core/passthrough.ts +4 -2
- package/src/native/index.ts +5 -1
- package/lib/core/{RequestHandler-CwjkprZE.d.ts → HttpResponse-_514VQ9z.d.ts} +68 -68
- package/lib/core/{RequestHandler-MAVTMsma.d.mts → HttpResponse-wcp03c7-.d.mts} +68 -68
package/lib/browser/index.mjs
CHANGED
|
@@ -366,7 +366,7 @@ async function requestIntegrityCheck(context, serviceWorker) {
|
|
|
366
366
|
return serviceWorker;
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
369
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/chunk-UJZOJSMP.mjs
|
|
370
370
|
var encoder = new TextEncoder();
|
|
371
371
|
function encodeBuffer(text) {
|
|
372
372
|
return encoder.encode(text);
|
|
@@ -829,7 +829,7 @@ var _Emitter = class {
|
|
|
829
829
|
var Emitter = _Emitter;
|
|
830
830
|
Emitter.defaultMaxListeners = 10;
|
|
831
831
|
|
|
832
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
832
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/chunk-WZQN3FMY.mjs
|
|
833
833
|
var IS_PATCHED_MODULE = Symbol("isPatchedModule");
|
|
834
834
|
function getGlobalSymbol(symbol) {
|
|
835
835
|
return (
|
|
@@ -974,7 +974,7 @@ var Interceptor = class {
|
|
|
974
974
|
}
|
|
975
975
|
};
|
|
976
976
|
|
|
977
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
977
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/index.mjs
|
|
978
978
|
var BatchInterceptor = class extends Interceptor {
|
|
979
979
|
constructor(options) {
|
|
980
980
|
BatchInterceptor.symbol = Symbol(options.name);
|
|
@@ -1258,7 +1258,7 @@ var DeferredPromise = class extends Promise {
|
|
|
1258
1258
|
}
|
|
1259
1259
|
};
|
|
1260
1260
|
|
|
1261
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
1261
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/chunk-72HT65NX.mjs
|
|
1262
1262
|
function uuidv4() {
|
|
1263
1263
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
1264
1264
|
const r = Math.random() * 16 | 0;
|
|
@@ -1303,7 +1303,7 @@ async function emitAsync(emitter, eventName, ...data) {
|
|
|
1303
1303
|
}
|
|
1304
1304
|
}
|
|
1305
1305
|
|
|
1306
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
1306
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/chunk-XQZ6GVNB.mjs
|
|
1307
1307
|
function isPropertyAccessible(obj, key) {
|
|
1308
1308
|
try {
|
|
1309
1309
|
obj[key];
|
|
@@ -1355,13 +1355,15 @@ var _FetchInterceptor = class extends Interceptor {
|
|
|
1355
1355
|
this.logger.info("awaiting for the mocked response...");
|
|
1356
1356
|
const signal = interactiveRequest.signal;
|
|
1357
1357
|
const requestAborted = new DeferredPromise();
|
|
1358
|
-
signal
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1358
|
+
if (signal) {
|
|
1359
|
+
signal.addEventListener(
|
|
1360
|
+
"abort",
|
|
1361
|
+
() => {
|
|
1362
|
+
requestAborted.reject(signal.reason);
|
|
1363
|
+
},
|
|
1364
|
+
{ once: true }
|
|
1365
|
+
);
|
|
1366
|
+
}
|
|
1365
1367
|
const resolverResult = await until(async () => {
|
|
1366
1368
|
const listenersFinished = emitAsync(this.emitter, "request", {
|
|
1367
1369
|
request: interactiveRequest,
|
|
@@ -1402,14 +1404,13 @@ var _FetchInterceptor = class extends Interceptor {
|
|
|
1402
1404
|
request: interactiveRequest,
|
|
1403
1405
|
requestId
|
|
1404
1406
|
});
|
|
1405
|
-
|
|
1406
|
-
Object.defineProperty(response, "url", {
|
|
1407
|
+
Object.defineProperty(mockedResponse, "url", {
|
|
1407
1408
|
writable: false,
|
|
1408
1409
|
enumerable: true,
|
|
1409
1410
|
configurable: false,
|
|
1410
1411
|
value: request.url
|
|
1411
1412
|
});
|
|
1412
|
-
return
|
|
1413
|
+
return mockedResponse;
|
|
1413
1414
|
}
|
|
1414
1415
|
this.logger.info("no mocked response received!");
|
|
1415
1416
|
return pureFetch(request).then((response) => {
|
|
@@ -1449,7 +1450,7 @@ function createNetworkError(cause) {
|
|
|
1449
1450
|
});
|
|
1450
1451
|
}
|
|
1451
1452
|
|
|
1452
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
1453
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/chunk-DZVB7JEV.mjs
|
|
1453
1454
|
function concatArrayBuffer(left, right) {
|
|
1454
1455
|
const result = new Uint8Array(left.byteLength + right.byteLength);
|
|
1455
1456
|
result.set(left, 0);
|