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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OperationTypeNode, DocumentNode, GraphQLError } from 'graphql';
|
|
2
|
-
import { g as RequestHandlerDefaultInfo, D as DefaultBodyType, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions } from './
|
|
2
|
+
import { g as RequestHandlerDefaultInfo, D as DefaultBodyType, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions } from './HttpResponse-wcp03c7-.mjs';
|
|
3
3
|
import { Match, Path } from './utils/matching/matchRequestUrl.mjs';
|
|
4
4
|
|
|
5
5
|
interface ParsedGraphQLQuery {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OperationTypeNode, DocumentNode, GraphQLError } from 'graphql';
|
|
2
|
-
import { g as RequestHandlerDefaultInfo, D as DefaultBodyType, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions } from './
|
|
2
|
+
import { g as RequestHandlerDefaultInfo, D as DefaultBodyType, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions } from './HttpResponse-_514VQ9z.js';
|
|
3
3
|
import { Match, Path } from './utils/matching/matchRequestUrl.js';
|
|
4
4
|
|
|
5
5
|
interface ParsedGraphQLQuery {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { f as HttpResponse, H as HttpResponseInit, S as StrictRequest, e as StrictResponse } from './
|
|
1
|
+
export { f as HttpResponse, H as HttpResponseInit, S as StrictRequest, e as StrictResponse } from './HttpResponse-wcp03c7-.mjs';
|
|
2
2
|
import './typeUtils.mjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { f as HttpResponse, H as HttpResponseInit, S as StrictRequest, e as StrictResponse } from './
|
|
1
|
+
export { f as HttpResponse, H as HttpResponseInit, S as StrictRequest, e as StrictResponse } from './HttpResponse-_514VQ9z.js';
|
|
2
2
|
import './typeUtils.js';
|
package/lib/core/SetupApi.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventMap, Emitter } from 'strict-event-emitter';
|
|
2
|
-
import { R as RequestHandler, g as RequestHandlerDefaultInfo } from './
|
|
2
|
+
import { R as RequestHandler, g as RequestHandlerDefaultInfo } from './HttpResponse-wcp03c7-.mjs';
|
|
3
3
|
import { LifeCycleEventEmitter } from './sharedOptions.mjs';
|
|
4
4
|
import { Disposable } from './utils/internal/Disposable.mjs';
|
|
5
5
|
import './typeUtils.mjs';
|
package/lib/core/SetupApi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventMap, Emitter } from 'strict-event-emitter';
|
|
2
|
-
import { R as RequestHandler, g as RequestHandlerDefaultInfo } from './
|
|
2
|
+
import { R as RequestHandler, g as RequestHandlerDefaultInfo } from './HttpResponse-_514VQ9z.js';
|
|
3
3
|
import { LifeCycleEventEmitter } from './sharedOptions.js';
|
|
4
4
|
import { Disposable } from './utils/internal/Disposable.js';
|
|
5
5
|
import './typeUtils.js';
|
package/lib/core/graphql.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DocumentNode } from 'graphql';
|
|
2
|
-
import { c as RequestHandlerOptions, a as ResponseResolver } from './
|
|
3
|
-
import { a as GraphQLQuery, b as GraphQLVariables, e as GraphQLHandlerNameSelector, G as GraphQLHandler, f as GraphQLResolverExtras, g as GraphQLResponseBody } from './GraphQLHandler-
|
|
2
|
+
import { c as RequestHandlerOptions, a as ResponseResolver } from './HttpResponse-wcp03c7-.mjs';
|
|
3
|
+
import { a as GraphQLQuery, b as GraphQLVariables, e as GraphQLHandlerNameSelector, G as GraphQLHandler, f as GraphQLResolverExtras, g as GraphQLResponseBody } from './GraphQLHandler-AenIUdwE.mjs';
|
|
4
4
|
import { Path } from './utils/matching/matchRequestUrl.mjs';
|
|
5
5
|
import './typeUtils.mjs';
|
|
6
6
|
|
package/lib/core/graphql.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DocumentNode } from 'graphql';
|
|
2
|
-
import { c as RequestHandlerOptions, a as ResponseResolver } from './
|
|
3
|
-
import { a as GraphQLQuery, b as GraphQLVariables, e as GraphQLHandlerNameSelector, G as GraphQLHandler, f as GraphQLResolverExtras, g as GraphQLResponseBody } from './GraphQLHandler-
|
|
2
|
+
import { c as RequestHandlerOptions, a as ResponseResolver } from './HttpResponse-_514VQ9z.js';
|
|
3
|
+
import { a as GraphQLQuery, b as GraphQLVariables, e as GraphQLHandlerNameSelector, G as GraphQLHandler, f as GraphQLResolverExtras, g as GraphQLResponseBody } from './GraphQLHandler-jOzqbxSK.js';
|
|
4
4
|
import { Path } from './utils/matching/matchRequestUrl.js';
|
|
5
5
|
import './typeUtils.js';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'graphql';
|
|
2
|
-
import '../
|
|
2
|
+
import '../HttpResponse-wcp03c7-.mjs';
|
|
3
3
|
import '../utils/matching/matchRequestUrl.mjs';
|
|
4
|
-
export { E as ExpectedOperationTypeNode, G as GraphQLHandler, l as GraphQLHandlerInfo, e as GraphQLHandlerNameSelector, d as GraphQLJsonRequestBody, a as GraphQLQuery, c as GraphQLRequestBody, m as GraphQLRequestParsedResult, f as GraphQLResolverExtras, g as GraphQLResponseBody, b as GraphQLVariables, n as isDocumentNode } from '../GraphQLHandler-
|
|
4
|
+
export { E as ExpectedOperationTypeNode, G as GraphQLHandler, l as GraphQLHandlerInfo, e as GraphQLHandlerNameSelector, d as GraphQLJsonRequestBody, a as GraphQLQuery, c as GraphQLRequestBody, m as GraphQLRequestParsedResult, f as GraphQLResolverExtras, g as GraphQLResponseBody, b as GraphQLVariables, n as isDocumentNode } from '../GraphQLHandler-AenIUdwE.mjs';
|
|
5
5
|
import '../typeUtils.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'graphql';
|
|
2
|
-
import '../
|
|
2
|
+
import '../HttpResponse-_514VQ9z.js';
|
|
3
3
|
import '../utils/matching/matchRequestUrl.js';
|
|
4
|
-
export { E as ExpectedOperationTypeNode, G as GraphQLHandler, l as GraphQLHandlerInfo, e as GraphQLHandlerNameSelector, d as GraphQLJsonRequestBody, a as GraphQLQuery, c as GraphQLRequestBody, m as GraphQLRequestParsedResult, f as GraphQLResolverExtras, g as GraphQLResponseBody, b as GraphQLVariables, n as isDocumentNode } from '../GraphQLHandler-
|
|
4
|
+
export { E as ExpectedOperationTypeNode, G as GraphQLHandler, l as GraphQLHandlerInfo, e as GraphQLHandlerNameSelector, d as GraphQLJsonRequestBody, a as GraphQLQuery, c as GraphQLRequestBody, m as GraphQLRequestParsedResult, f as GraphQLResolverExtras, g as GraphQLResponseBody, b as GraphQLVariables, n as isDocumentNode } from '../GraphQLHandler-jOzqbxSK.js';
|
|
5
5
|
import '../typeUtils.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as RequestHandlerDefaultInfo, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions, i as ResponseResolutionContext } from '../
|
|
1
|
+
import { g as RequestHandlerDefaultInfo, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions, i as ResponseResolutionContext } from '../HttpResponse-wcp03c7-.mjs';
|
|
2
2
|
import { Path, Match, PathParams } from '../utils/matching/matchRequestUrl.mjs';
|
|
3
3
|
import '../typeUtils.mjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as RequestHandlerDefaultInfo, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions, i as ResponseResolutionContext } from '../
|
|
1
|
+
import { g as RequestHandlerDefaultInfo, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions, i as ResponseResolutionContext } from '../HttpResponse-_514VQ9z.js';
|
|
2
2
|
import { Path, Match, PathParams } from '../utils/matching/matchRequestUrl.js';
|
|
3
3
|
import '../typeUtils.js';
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, J as JsonBodyType, M as MaybeAsyncResponseResolverReturnType, R as RequestHandler, m as RequestHandlerArgs, g as RequestHandlerDefaultInfo, n as RequestHandlerExecutionResult, k as RequestHandlerInternalInfo, c as RequestHandlerOptions, a as ResponseResolver, l as ResponseResolverInfo, b as ResponseResolverReturnType } from '../
|
|
1
|
+
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, J as JsonBodyType, M as MaybeAsyncResponseResolverReturnType, R as RequestHandler, m as RequestHandlerArgs, g as RequestHandlerDefaultInfo, n as RequestHandlerExecutionResult, k as RequestHandlerInternalInfo, c as RequestHandlerOptions, a as ResponseResolver, l as ResponseResolverInfo, b as ResponseResolverReturnType } from '../HttpResponse-wcp03c7-.mjs';
|
|
2
2
|
import '../typeUtils.mjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, J as JsonBodyType, M as MaybeAsyncResponseResolverReturnType, R as RequestHandler, m as RequestHandlerArgs, g as RequestHandlerDefaultInfo, n as RequestHandlerExecutionResult, k as RequestHandlerInternalInfo, c as RequestHandlerOptions, a as ResponseResolver, l as ResponseResolverInfo, b as ResponseResolverReturnType } from '../
|
|
1
|
+
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, J as JsonBodyType, M as MaybeAsyncResponseResolverReturnType, R as RequestHandler, m as RequestHandlerArgs, g as RequestHandlerDefaultInfo, n as RequestHandlerExecutionResult, k as RequestHandlerInternalInfo, c as RequestHandlerOptions, a as ResponseResolver, l as ResponseResolverInfo, b as ResponseResolverReturnType } from '../HttpResponse-_514VQ9z.js';
|
|
2
2
|
import '../typeUtils.js';
|
package/lib/core/http.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DefaultBodyType, c as RequestHandlerOptions, a as ResponseResolver } from './
|
|
1
|
+
import { D as DefaultBodyType, c as RequestHandlerOptions, a as ResponseResolver } from './HttpResponse-wcp03c7-.mjs';
|
|
2
2
|
import { HttpHandler, HttpRequestResolverExtras } from './handlers/HttpHandler.mjs';
|
|
3
3
|
import { PathParams, Path } from './utils/matching/matchRequestUrl.mjs';
|
|
4
4
|
import './typeUtils.mjs';
|
package/lib/core/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DefaultBodyType, c as RequestHandlerOptions, a as ResponseResolver } from './
|
|
1
|
+
import { D as DefaultBodyType, c as RequestHandlerOptions, a as ResponseResolver } from './HttpResponse-_514VQ9z.js';
|
|
2
2
|
import { HttpHandler, HttpRequestResolverExtras } from './handlers/HttpHandler.js';
|
|
3
3
|
import { PathParams, Path } from './utils/matching/matchRequestUrl.js';
|
|
4
4
|
import './typeUtils.js';
|
package/lib/core/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { SetupApi } from './SetupApi.mjs';
|
|
2
|
-
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, f as HttpResponse, H as HttpResponseInit, J as JsonBodyType, R as RequestHandler, c as RequestHandlerOptions, a as ResponseResolver, b as ResponseResolverReturnType, S as StrictRequest, e as StrictResponse } from './
|
|
2
|
+
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, f as HttpResponse, H as HttpResponseInit, J as JsonBodyType, R as RequestHandler, c as RequestHandlerOptions, a as ResponseResolver, b as ResponseResolverReturnType, S as StrictRequest, e as StrictResponse } from './HttpResponse-wcp03c7-.mjs';
|
|
3
3
|
export { HttpRequestHandler, HttpResponseResolver, http } from './http.mjs';
|
|
4
4
|
export { HttpHandler, HttpMethods, HttpRequestParsedResult, RequestQuery } from './handlers/HttpHandler.mjs';
|
|
5
5
|
export { GraphQLRequestHandler, GraphQLResponseResolver, graphql } from './graphql.mjs';
|
|
6
|
-
export { G as GraphQLHandler, d as GraphQLJsonRequestBody, a as GraphQLQuery, c as GraphQLRequestBody, b as GraphQLVariables, P as ParsedGraphQLRequest } from './GraphQLHandler-
|
|
6
|
+
export { G as GraphQLHandler, d as GraphQLJsonRequestBody, a as GraphQLQuery, c as GraphQLRequestBody, b as GraphQLVariables, P as ParsedGraphQLRequest } from './GraphQLHandler-AenIUdwE.mjs';
|
|
7
7
|
export { Match, Path, PathParams, matchRequestUrl } from './utils/matching/matchRequestUrl.mjs';
|
|
8
8
|
export { HandleRequestOptions, handleRequest } from './utils/handleRequest.mjs';
|
|
9
9
|
export { getResponse } from './getResponse.mjs';
|
package/lib/core/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { SetupApi } from './SetupApi.js';
|
|
2
|
-
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, f as HttpResponse, H as HttpResponseInit, J as JsonBodyType, R as RequestHandler, c as RequestHandlerOptions, a as ResponseResolver, b as ResponseResolverReturnType, S as StrictRequest, e as StrictResponse } from './
|
|
2
|
+
export { A as AsyncResponseResolverReturnType, D as DefaultBodyType, d as DefaultRequestMultipartBody, f as HttpResponse, H as HttpResponseInit, J as JsonBodyType, R as RequestHandler, c as RequestHandlerOptions, a as ResponseResolver, b as ResponseResolverReturnType, S as StrictRequest, e as StrictResponse } from './HttpResponse-_514VQ9z.js';
|
|
3
3
|
export { HttpRequestHandler, HttpResponseResolver, http } from './http.js';
|
|
4
4
|
export { HttpHandler, HttpMethods, HttpRequestParsedResult, RequestQuery } from './handlers/HttpHandler.js';
|
|
5
5
|
export { GraphQLRequestHandler, GraphQLResponseResolver, graphql } from './graphql.js';
|
|
6
|
-
export { G as GraphQLHandler, d as GraphQLJsonRequestBody, a as GraphQLQuery, c as GraphQLRequestBody, b as GraphQLVariables, P as ParsedGraphQLRequest } from './GraphQLHandler-
|
|
6
|
+
export { G as GraphQLHandler, d as GraphQLJsonRequestBody, a as GraphQLQuery, c as GraphQLRequestBody, b as GraphQLVariables, P as ParsedGraphQLRequest } from './GraphQLHandler-jOzqbxSK.js';
|
|
7
7
|
export { Match, Path, PathParams, matchRequestUrl } from './utils/matching/matchRequestUrl.js';
|
|
8
8
|
export { HandleRequestOptions, handleRequest } from './utils/handleRequest.js';
|
|
9
9
|
export { getResponse } from './getResponse.js';
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { e as StrictResponse } from './HttpResponse-wcp03c7-.mjs';
|
|
2
|
+
import './typeUtils.mjs';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Performs the intercepted request as-is.
|
|
3
6
|
*
|
|
@@ -12,6 +15,6 @@
|
|
|
12
15
|
*
|
|
13
16
|
* @see {@link https://mswjs.io/docs/api/passthrough `passthrough()` API reference}
|
|
14
17
|
*/
|
|
15
|
-
declare function passthrough():
|
|
18
|
+
declare function passthrough(): StrictResponse<any>;
|
|
16
19
|
|
|
17
20
|
export { passthrough };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { e as StrictResponse } from './HttpResponse-_514VQ9z.js';
|
|
2
|
+
import './typeUtils.js';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Performs the intercepted request as-is.
|
|
3
6
|
*
|
|
@@ -12,6 +15,6 @@
|
|
|
12
15
|
*
|
|
13
16
|
* @see {@link https://mswjs.io/docs/api/passthrough `passthrough()` API reference}
|
|
14
17
|
*/
|
|
15
|
-
declare function passthrough():
|
|
18
|
+
declare function passthrough(): StrictResponse<any>;
|
|
16
19
|
|
|
17
20
|
export { passthrough };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/passthrough.ts"],"sourcesContent":["/**\n * Performs the intercepted request as-is.\n *\n * This stops request handler lookup so no other handlers\n * can affect this request past this point.\n * Unlike `bypass()`, this will not trigger an additional request.\n *\n * @example\n * http.get('/resource', () => {\n * return passthrough()\n * })\n *\n * @see {@link https://mswjs.io/docs/api/passthrough `passthrough()` API reference}\n */\nexport function passthrough():
|
|
1
|
+
{"version":3,"sources":["../../src/core/passthrough.ts"],"sourcesContent":["import type { StrictResponse } from './HttpResponse'\n\n/**\n * Performs the intercepted request as-is.\n *\n * This stops request handler lookup so no other handlers\n * can affect this request past this point.\n * Unlike `bypass()`, this will not trigger an additional request.\n *\n * @example\n * http.get('/resource', () => {\n * return passthrough()\n * })\n *\n * @see {@link https://mswjs.io/docs/api/passthrough `passthrough()` API reference}\n */\nexport function passthrough(): StrictResponse<any> {\n return new Response(null, {\n status: 302,\n statusText: 'Passthrough',\n headers: {\n 'x-msw-intention': 'passthrough',\n },\n }) as StrictResponse<any>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,SAAS,cAAmC;AACjD,SAAO,IAAI,SAAS,MAAM;AAAA,IACxB,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,SAAS;AAAA,MACP,mBAAmB;AAAA,IACrB;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/passthrough.ts"],"sourcesContent":["/**\n * Performs the intercepted request as-is.\n *\n * This stops request handler lookup so no other handlers\n * can affect this request past this point.\n * Unlike `bypass()`, this will not trigger an additional request.\n *\n * @example\n * http.get('/resource', () => {\n * return passthrough()\n * })\n *\n * @see {@link https://mswjs.io/docs/api/passthrough `passthrough()` API reference}\n */\nexport function passthrough():
|
|
1
|
+
{"version":3,"sources":["../../src/core/passthrough.ts"],"sourcesContent":["import type { StrictResponse } from './HttpResponse'\n\n/**\n * Performs the intercepted request as-is.\n *\n * This stops request handler lookup so no other handlers\n * can affect this request past this point.\n * Unlike `bypass()`, this will not trigger an additional request.\n *\n * @example\n * http.get('/resource', () => {\n * return passthrough()\n * })\n *\n * @see {@link https://mswjs.io/docs/api/passthrough `passthrough()` API reference}\n */\nexport function passthrough(): StrictResponse<any> {\n return new Response(null, {\n status: 302,\n statusText: 'Passthrough',\n headers: {\n 'x-msw-intention': 'passthrough',\n },\n }) as StrictResponse<any>\n}\n"],"mappings":"AAgBO,SAAS,cAAmC;AACjD,SAAO,IAAI,SAAS,MAAM;AAAA,IACxB,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,SAAS;AAAA,MACP,mBAAmB;AAAA,IACrB;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { h as HandlersExecutionResult, i as ResponseResolutionContext, j as executeHandlers } from '../
|
|
1
|
+
export { h as HandlersExecutionResult, i as ResponseResolutionContext, j as executeHandlers } from '../HttpResponse-wcp03c7-.mjs';
|
|
2
2
|
import '../typeUtils.mjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { h as HandlersExecutionResult, i as ResponseResolutionContext, j as executeHandlers } from '../
|
|
1
|
+
export { h as HandlersExecutionResult, i as ResponseResolutionContext, j as executeHandlers } from '../HttpResponse-_514VQ9z.js';
|
|
2
2
|
import '../typeUtils.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Emitter } from 'strict-event-emitter';
|
|
2
|
-
import { h as HandlersExecutionResult, R as RequestHandler } from '../
|
|
2
|
+
import { h as HandlersExecutionResult, R as RequestHandler } from '../HttpResponse-wcp03c7-.mjs';
|
|
3
3
|
import { SharedOptions, LifeCycleEventsMap } from '../sharedOptions.mjs';
|
|
4
4
|
import { RequiredDeep } from '../typeUtils.mjs';
|
|
5
5
|
import './request/onUnhandledRequest.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Emitter } from 'strict-event-emitter';
|
|
2
|
-
import { h as HandlersExecutionResult, R as RequestHandler } from '../
|
|
2
|
+
import { h as HandlersExecutionResult, R as RequestHandler } from '../HttpResponse-_514VQ9z.js';
|
|
3
3
|
import { SharedOptions, LifeCycleEventsMap } from '../sharedOptions.js';
|
|
4
4
|
import { RequiredDeep } from '../typeUtils.js';
|
|
5
5
|
import './request/onUnhandledRequest.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'graphql';
|
|
2
|
-
export { j as GraphQLMultipartRequestBody, i as GraphQLParsedOperationsMap, h as ParsedGraphQLQuery, P as ParsedGraphQLRequest, p as parseDocumentNode, k as parseGraphQLRequest } from '../../GraphQLHandler-
|
|
3
|
-
import '../../
|
|
2
|
+
export { j as GraphQLMultipartRequestBody, i as GraphQLParsedOperationsMap, h as ParsedGraphQLQuery, P as ParsedGraphQLRequest, p as parseDocumentNode, k as parseGraphQLRequest } from '../../GraphQLHandler-AenIUdwE.mjs';
|
|
3
|
+
import '../../HttpResponse-wcp03c7-.mjs';
|
|
4
4
|
import '../../typeUtils.mjs';
|
|
5
5
|
import '../matching/matchRequestUrl.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'graphql';
|
|
2
|
-
export { j as GraphQLMultipartRequestBody, i as GraphQLParsedOperationsMap, h as ParsedGraphQLQuery, P as ParsedGraphQLRequest, p as parseDocumentNode, k as parseGraphQLRequest } from '../../GraphQLHandler-
|
|
3
|
-
import '../../
|
|
2
|
+
export { j as GraphQLMultipartRequestBody, i as GraphQLParsedOperationsMap, h as ParsedGraphQLQuery, P as ParsedGraphQLRequest, p as parseDocumentNode, k as parseGraphQLRequest } from '../../GraphQLHandler-jOzqbxSK.js';
|
|
3
|
+
import '../../HttpResponse-_514VQ9z.js';
|
|
4
4
|
import '../../typeUtils.js';
|
|
5
5
|
import '../matching/matchRequestUrl.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RequestHandler, g as RequestHandlerDefaultInfo, c as RequestHandlerOptions } from '../../
|
|
1
|
+
import { R as RequestHandler, g as RequestHandlerDefaultInfo, c as RequestHandlerOptions } from '../../HttpResponse-wcp03c7-.mjs';
|
|
2
2
|
import '../../typeUtils.mjs';
|
|
3
3
|
|
|
4
4
|
declare function use(currentHandlers: Array<RequestHandler>, ...handlers: Array<RequestHandler>): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RequestHandler, g as RequestHandlerDefaultInfo, c as RequestHandlerOptions } from '../../
|
|
1
|
+
import { R as RequestHandler, g as RequestHandlerDefaultInfo, c as RequestHandlerOptions } from '../../HttpResponse-_514VQ9z.js';
|
|
2
2
|
import '../../typeUtils.js';
|
|
3
3
|
|
|
4
4
|
declare function use(currentHandlers: Array<RequestHandler>, ...handlers: Array<RequestHandler>): void;
|
package/lib/iife/index.js
CHANGED
|
@@ -1107,7 +1107,7 @@ var MockServiceWorker = (() => {
|
|
|
1107
1107
|
return stringToRegexp(path, keys, options);
|
|
1108
1108
|
}
|
|
1109
1109
|
|
|
1110
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
1110
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/chunk-UJZOJSMP.mjs
|
|
1111
1111
|
var encoder = new TextEncoder();
|
|
1112
1112
|
function encodeBuffer(text) {
|
|
1113
1113
|
return encoder.encode(text);
|
|
@@ -1420,7 +1420,7 @@ var MockServiceWorker = (() => {
|
|
|
1420
1420
|
return message3.toString();
|
|
1421
1421
|
}
|
|
1422
1422
|
|
|
1423
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
1423
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/chunk-WZQN3FMY.mjs
|
|
1424
1424
|
var IS_PATCHED_MODULE = Symbol("isPatchedModule");
|
|
1425
1425
|
function getGlobalSymbol(symbol) {
|
|
1426
1426
|
return (
|
|
@@ -1565,7 +1565,7 @@ var MockServiceWorker = (() => {
|
|
|
1565
1565
|
}
|
|
1566
1566
|
};
|
|
1567
1567
|
|
|
1568
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
1568
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/index.mjs
|
|
1569
1569
|
var BatchInterceptor = class extends Interceptor {
|
|
1570
1570
|
constructor(options) {
|
|
1571
1571
|
BatchInterceptor.symbol = Symbol(options.name);
|
|
@@ -6447,7 +6447,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6447
6447
|
}
|
|
6448
6448
|
};
|
|
6449
6449
|
|
|
6450
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
6450
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/chunk-72HT65NX.mjs
|
|
6451
6451
|
function uuidv4() {
|
|
6452
6452
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
6453
6453
|
const r = Math.random() * 16 | 0;
|
|
@@ -6492,7 +6492,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6492
6492
|
}
|
|
6493
6493
|
}
|
|
6494
6494
|
|
|
6495
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
6495
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/chunk-XQZ6GVNB.mjs
|
|
6496
6496
|
function isPropertyAccessible2(obj, key) {
|
|
6497
6497
|
try {
|
|
6498
6498
|
obj[key];
|
|
@@ -6544,13 +6544,15 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6544
6544
|
this.logger.info("awaiting for the mocked response...");
|
|
6545
6545
|
const signal = interactiveRequest.signal;
|
|
6546
6546
|
const requestAborted = new DeferredPromise();
|
|
6547
|
-
signal
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6547
|
+
if (signal) {
|
|
6548
|
+
signal.addEventListener(
|
|
6549
|
+
"abort",
|
|
6550
|
+
() => {
|
|
6551
|
+
requestAborted.reject(signal.reason);
|
|
6552
|
+
},
|
|
6553
|
+
{ once: true }
|
|
6554
|
+
);
|
|
6555
|
+
}
|
|
6554
6556
|
const resolverResult = await until(async () => {
|
|
6555
6557
|
const listenersFinished = emitAsync(this.emitter, "request", {
|
|
6556
6558
|
request: interactiveRequest,
|
|
@@ -6591,14 +6593,13 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6591
6593
|
request: interactiveRequest,
|
|
6592
6594
|
requestId
|
|
6593
6595
|
});
|
|
6594
|
-
|
|
6595
|
-
Object.defineProperty(response, "url", {
|
|
6596
|
+
Object.defineProperty(mockedResponse, "url", {
|
|
6596
6597
|
writable: false,
|
|
6597
6598
|
enumerable: true,
|
|
6598
6599
|
configurable: false,
|
|
6599
6600
|
value: request.url
|
|
6600
6601
|
});
|
|
6601
|
-
return
|
|
6602
|
+
return mockedResponse;
|
|
6602
6603
|
}
|
|
6603
6604
|
this.logger.info("no mocked response received!");
|
|
6604
6605
|
return pureFetch(request).then((response) => {
|
|
@@ -6638,7 +6639,7 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
6638
6639
|
});
|
|
6639
6640
|
}
|
|
6640
6641
|
|
|
6641
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.25.
|
|
6642
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.25.16/node_modules/@mswjs/interceptors/lib/browser/chunk-DZVB7JEV.mjs
|
|
6642
6643
|
function concatArrayBuffer(left, right) {
|
|
6643
6644
|
const result = new Uint8Array(left.byteLength + right.byteLength);
|
|
6644
6645
|
result.set(left, 0);
|