msw 0.49.0 → 0.49.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{SetupApi-0d3126ba.d.ts → SetupApi-b2f0e5ac.d.ts} +1 -1
- package/lib/{SetupServerApi-3406bf53.d.ts → SetupServerApi-70cc71a7.d.ts} +1 -1
- package/lib/{glossary-6a87827e.d.ts → glossary-a30fab39.d.ts} +1 -1
- package/lib/iife/index.js +1 -1
- package/lib/iife/index.js.map +1 -1
- package/lib/index.d.ts +3 -14
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/lib/native/index.d.ts +2 -2
- package/lib/native/index.js +1 -1
- package/lib/native/index.mjs +1 -1
- package/lib/node/index.d.ts +4 -4
- package/lib/node/index.js +1 -1
- package/lib/node/index.js.map +1 -1
- package/lib/node/index.mjs +1 -1
- package/lib/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { R as ResponseTransformer, s as status, a as set, d as delay, f as fetch, b as RequestHandler, S as
|
|
2
|
-
export { A as AsyncResponseResolverReturnType,
|
|
1
|
+
import { R as ResponseTransformer, s as status, a as set, d as delay, f as fetch, b as RequestHandler, S as SetupWorkerApi, D as DefaultContext, c as DefaultBodyType, M as MockedRequest, e as ResponseResolver, g as ResponseResolutionContext, h as SerializedResponse, i as RequestHandlerDefaultInfo, j as MockedResponse, k as ResponseLookupResult, l as SharedOptions } from './SetupApi-b2f0e5ac.js';
|
|
2
|
+
export { A as AsyncResponseResolverReturnType, c as DefaultBodyType, u as DefaultRequestMultipartBody, y as DelayMode, M as MockedRequest, H as MockedRequestInit, j as MockedResponse, z as RequestCache, E as RequestDestination, b as RequestHandler, B as RequestMode, F as RequestPriority, C as RequestRedirect, G as RequestReferrerPolicy, v as ResponseComposition, w as ResponseCompositionOptions, x as ResponseFunction, e as ResponseResolver, t as ResponseResolverReturnType, R as ResponseTransformer, m as SetupApi, S as SetupWorkerApi, l as SharedOptions, q as StartOptions, o as createResponseComposition, p as defaultContext, n as defaultResponse, r as response } from './SetupApi-b2f0e5ac.js';
|
|
3
3
|
import * as cookieUtils from 'cookie';
|
|
4
4
|
import { GraphQLError, OperationTypeNode, DocumentNode } from 'graphql';
|
|
5
5
|
import { StrictEventEmitter } from 'strict-event-emitter';
|
|
6
|
-
import { S as ServerLifecycleEventsMap } from './glossary-
|
|
6
|
+
import { S as ServerLifecycleEventsMap } from './glossary-a30fab39.js';
|
|
7
7
|
import 'headers-polyfill';
|
|
8
8
|
import '@mswjs/interceptors';
|
|
9
9
|
import 'type-fest';
|
|
@@ -123,17 +123,6 @@ declare namespace index {
|
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
declare class SetupWorkerApi extends SetupApi<WorkerLifecycleEventsMap> {
|
|
127
|
-
private context;
|
|
128
|
-
private startHandler;
|
|
129
|
-
private stopHandler;
|
|
130
|
-
private listeners;
|
|
131
|
-
constructor(...handlers: Array<RequestHandler>);
|
|
132
|
-
private createWorkerContext;
|
|
133
|
-
start(options?: StartOptions): StartReturnType;
|
|
134
|
-
printHandlers(): void;
|
|
135
|
-
stop(): void;
|
|
136
|
-
}
|
|
137
126
|
/**
|
|
138
127
|
* Sets up a requests interception in the browser with the given request handlers.
|
|
139
128
|
* @param {RequestHandler[]} handlers List of request handlers.
|
package/lib/index.js
CHANGED
|
@@ -383,7 +383,7 @@ var errors = (errorsList) => {
|
|
|
383
383
|
// src/context/fetch.ts
|
|
384
384
|
var import_is_node_process2 = require("is-node-process");
|
|
385
385
|
var import_headers_polyfill2 = require("headers-polyfill");
|
|
386
|
-
var useFetch = (0, import_is_node_process2.isNodeProcess)() ? (input, init) => Promise.resolve().then(() => __toESM(require("node-fetch"))).then(({ default: nodeFetch }) => nodeFetch(input, init)) :
|
|
386
|
+
var useFetch = (0, import_is_node_process2.isNodeProcess)() ? (input, init) => Promise.resolve().then(() => __toESM(require("node-fetch"))).then(({ default: nodeFetch }) => nodeFetch(input, init)) : globalThis.fetch;
|
|
387
387
|
var augmentRequestInit = (requestInit) => {
|
|
388
388
|
const headers = new import_headers_polyfill2.Headers(requestInit.headers);
|
|
389
389
|
headers.set("x-msw-bypass", "true");
|