msw 2.2.12 → 2.2.14
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 +12 -9
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/index.mjs +12 -9
- package/lib/browser/index.mjs.map +1 -1
- package/lib/core/{GraphQLHandler-bom2Dn82.d.ts → GraphQLHandler-COiPfZ8k.d.ts} +1 -1
- package/lib/core/{GraphQLHandler-yJ_I6j54.d.mts → GraphQLHandler-Dq_WRbKe.d.mts} +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/getResponse.js +2 -2
- package/lib/core/getResponse.js.map +1 -1
- package/lib/core/getResponse.mjs +2 -2
- package/lib/core/getResponse.mjs.map +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 +1 -1
- package/lib/core/passthrough.d.ts +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/core/utils/request/onUnhandledRequest.js +1 -1
- package/lib/core/utils/request/onUnhandledRequest.js.map +1 -1
- package/lib/core/utils/request/onUnhandledRequest.mjs +1 -1
- package/lib/core/utils/request/onUnhandledRequest.mjs.map +1 -1
- package/lib/iife/index.js +19 -19
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +18 -6
- package/src/core/getResponse.ts +2 -2
- package/src/core/handlers/GraphQLHandler.test.ts +4 -5
- package/src/core/handlers/HttpHandler.test.ts +5 -5
- package/src/core/utils/handleRequest.test.ts +14 -14
- package/src/core/utils/request/onUnhandledRequest.test.ts +30 -4
- package/src/core/utils/request/onUnhandledRequest.ts +1 -1
- package/lib/core/utils/internal/randomId.d.mts +0 -3
- package/lib/core/utils/internal/randomId.d.ts +0 -3
- package/lib/core/utils/internal/randomId.js +0 -27
- package/lib/core/utils/internal/randomId.js.map +0 -1
- package/lib/core/utils/internal/randomId.mjs +0 -7
- package/lib/core/utils/internal/randomId.mjs.map +0 -1
- package/src/core/utils/internal/randomId.ts +0 -3
- /package/lib/core/{HttpResponse-vQNlixkj.d.ts → HttpResponse-B07UKAkU.d.ts} +0 -0
- /package/lib/core/{HttpResponse-3-NyzyF7.d.mts → HttpResponse-C7niBMwb.d.mts} +0 -0
|
@@ -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 './HttpResponse-
|
|
2
|
+
import { g as RequestHandlerDefaultInfo, D as DefaultBodyType, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions } from './HttpResponse-B07UKAkU.js';
|
|
3
3
|
import { Match, Path } from './utils/matching/matchRequestUrl.js';
|
|
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 './HttpResponse-
|
|
2
|
+
import { g as RequestHandlerDefaultInfo, D as DefaultBodyType, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions } from './HttpResponse-C7niBMwb.mjs';
|
|
3
3
|
import { Match, Path } from './utils/matching/matchRequestUrl.mjs';
|
|
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 './HttpResponse-
|
|
1
|
+
export { f as HttpResponse, H as HttpResponseInit, S as StrictRequest, e as StrictResponse } from './HttpResponse-C7niBMwb.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 './HttpResponse-
|
|
1
|
+
export { f as HttpResponse, H as HttpResponseInit, S as StrictRequest, e as StrictResponse } from './HttpResponse-B07UKAkU.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 './HttpResponse-
|
|
2
|
+
import { R as RequestHandler, g as RequestHandlerDefaultInfo } from './HttpResponse-C7niBMwb.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 './HttpResponse-
|
|
2
|
+
import { R as RequestHandler, g as RequestHandlerDefaultInfo } from './HttpResponse-B07UKAkU.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/getResponse.js
CHANGED
|
@@ -21,12 +21,12 @@ __export(getResponse_exports, {
|
|
|
21
21
|
getResponse: () => getResponse
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(getResponse_exports);
|
|
24
|
+
var import_interceptors = require("@mswjs/interceptors");
|
|
24
25
|
var import_executeHandlers = require("./utils/executeHandlers.js");
|
|
25
|
-
var import_randomId = require("./utils/internal/randomId.js");
|
|
26
26
|
const getResponse = async (handlers, request) => {
|
|
27
27
|
const result = await (0, import_executeHandlers.executeHandlers)({
|
|
28
28
|
request,
|
|
29
|
-
requestId: (0,
|
|
29
|
+
requestId: (0, import_interceptors.createRequestId)(),
|
|
30
30
|
handlers
|
|
31
31
|
});
|
|
32
32
|
return result?.response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/getResponse.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/core/getResponse.ts"],"sourcesContent":["import { createRequestId } from '@mswjs/interceptors'\nimport type { RequestHandler } from './handlers/RequestHandler'\nimport { executeHandlers } from './utils/executeHandlers'\n\n/**\n * Finds a response for the given request instance\n * in the array of request handlers.\n * @param handlers The array of request handlers.\n * @param request The `Request` instance.\n * @returns {Response} A mocked response, if any.\n */\nexport const getResponse = async (\n handlers: Array<RequestHandler>,\n request: Request,\n): Promise<Response | undefined> => {\n const result = await executeHandlers({\n request,\n requestId: createRequestId(),\n handlers,\n })\n\n return result?.response\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgC;AAEhC,6BAAgC;AASzB,MAAM,cAAc,OACzB,UACA,YACkC;AAClC,QAAM,SAAS,UAAM,wCAAgB;AAAA,IACnC;AAAA,IACA,eAAW,qCAAgB;AAAA,IAC3B;AAAA,EACF,CAAC;AAED,SAAO,QAAQ;AACjB;","names":[]}
|
package/lib/core/getResponse.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { createRequestId } from "@mswjs/interceptors";
|
|
1
2
|
import { executeHandlers } from './utils/executeHandlers.mjs';
|
|
2
|
-
import { randomId } from './utils/internal/randomId.mjs';
|
|
3
3
|
const getResponse = async (handlers, request) => {
|
|
4
4
|
const result = await executeHandlers({
|
|
5
5
|
request,
|
|
6
|
-
requestId:
|
|
6
|
+
requestId: createRequestId(),
|
|
7
7
|
handlers
|
|
8
8
|
});
|
|
9
9
|
return result?.response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/getResponse.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/core/getResponse.ts"],"sourcesContent":["import { createRequestId } from '@mswjs/interceptors'\nimport type { RequestHandler } from './handlers/RequestHandler'\nimport { executeHandlers } from './utils/executeHandlers'\n\n/**\n * Finds a response for the given request instance\n * in the array of request handlers.\n * @param handlers The array of request handlers.\n * @param request The `Request` instance.\n * @returns {Response} A mocked response, if any.\n */\nexport const getResponse = async (\n handlers: Array<RequestHandler>,\n request: Request,\n): Promise<Response | undefined> => {\n const result = await executeHandlers({\n request,\n requestId: createRequestId(),\n handlers,\n })\n\n return result?.response\n}\n"],"mappings":"AAAA,SAAS,uBAAuB;AAEhC,SAAS,uBAAuB;AASzB,MAAM,cAAc,OACzB,UACA,YACkC;AAClC,QAAM,SAAS,MAAM,gBAAgB;AAAA,IACnC;AAAA,IACA,WAAW,gBAAgB;AAAA,IAC3B;AAAA,EACF,CAAC;AAED,SAAO,QAAQ;AACjB;","names":[]}
|
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 './HttpResponse-
|
|
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-C7niBMwb.mjs';
|
|
3
|
+
import { a as GraphQLQuery, b as GraphQLVariables, e as GraphQLHandlerNameSelector, G as GraphQLHandler, f as GraphQLResolverExtras, g as GraphQLResponseBody } from './GraphQLHandler-Dq_WRbKe.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 './HttpResponse-
|
|
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-B07UKAkU.js';
|
|
3
|
+
import { a as GraphQLQuery, b as GraphQLVariables, e as GraphQLHandlerNameSelector, G as GraphQLHandler, f as GraphQLResolverExtras, g as GraphQLResponseBody } from './GraphQLHandler-COiPfZ8k.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 '../HttpResponse-
|
|
2
|
+
import '../HttpResponse-C7niBMwb.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-Dq_WRbKe.mjs';
|
|
5
5
|
import '../typeUtils.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'graphql';
|
|
2
|
-
import '../HttpResponse-
|
|
2
|
+
import '../HttpResponse-B07UKAkU.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-COiPfZ8k.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 '../HttpResponse-
|
|
1
|
+
import { g as RequestHandlerDefaultInfo, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions, i as ResponseResolutionContext } from '../HttpResponse-C7niBMwb.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 '../HttpResponse-
|
|
1
|
+
import { g as RequestHandlerDefaultInfo, R as RequestHandler, a as ResponseResolver, c as RequestHandlerOptions, i as ResponseResolutionContext } from '../HttpResponse-B07UKAkU.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 '../HttpResponse-
|
|
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-C7niBMwb.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 '../HttpResponse-
|
|
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-B07UKAkU.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 './HttpResponse-
|
|
1
|
+
import { D as DefaultBodyType, c as RequestHandlerOptions, a as ResponseResolver } from './HttpResponse-C7niBMwb.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 './HttpResponse-
|
|
1
|
+
import { D as DefaultBodyType, c as RequestHandlerOptions, a as ResponseResolver } from './HttpResponse-B07UKAkU.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 './HttpResponse-
|
|
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-C7niBMwb.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-Dq_WRbKe.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 './HttpResponse-
|
|
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-B07UKAkU.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-COiPfZ8k.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,2 +1,2 @@
|
|
|
1
|
-
export { h as HandlersExecutionResult, i as ResponseResolutionContext, j as executeHandlers } from '../HttpResponse-
|
|
1
|
+
export { h as HandlersExecutionResult, i as ResponseResolutionContext, j as executeHandlers } from '../HttpResponse-C7niBMwb.mjs';
|
|
2
2
|
import '../typeUtils.mjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { h as HandlersExecutionResult, i as ResponseResolutionContext, j as executeHandlers } from '../HttpResponse-
|
|
1
|
+
export { h as HandlersExecutionResult, i as ResponseResolutionContext, j as executeHandlers } from '../HttpResponse-B07UKAkU.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 '../HttpResponse-
|
|
2
|
+
import { h as HandlersExecutionResult, R as RequestHandler } from '../HttpResponse-C7niBMwb.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 '../HttpResponse-
|
|
2
|
+
import { h as HandlersExecutionResult, R as RequestHandler } from '../HttpResponse-B07UKAkU.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 '../../HttpResponse-
|
|
2
|
+
export { j as GraphQLMultipartRequestBody, i as GraphQLParsedOperationsMap, h as ParsedGraphQLQuery, P as ParsedGraphQLRequest, p as parseDocumentNode, k as parseGraphQLRequest } from '../../GraphQLHandler-Dq_WRbKe.mjs';
|
|
3
|
+
import '../../HttpResponse-C7niBMwb.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 '../../HttpResponse-
|
|
2
|
+
export { j as GraphQLMultipartRequestBody, i as GraphQLParsedOperationsMap, h as ParsedGraphQLQuery, P as ParsedGraphQLRequest, p as parseDocumentNode, k as parseGraphQLRequest } from '../../GraphQLHandler-COiPfZ8k.js';
|
|
3
|
+
import '../../HttpResponse-B07UKAkU.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 '../../HttpResponse-
|
|
1
|
+
import { R as RequestHandler, g as RequestHandlerDefaultInfo, c as RequestHandlerOptions } from '../../HttpResponse-C7niBMwb.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 '../../HttpResponse-
|
|
1
|
+
import { R as RequestHandler, g as RequestHandlerDefaultInfo, c as RequestHandlerOptions } from '../../HttpResponse-B07UKAkU.js';
|
|
2
2
|
import '../../typeUtils.js';
|
|
3
3
|
|
|
4
4
|
declare function use(currentHandlers: Array<RequestHandler>, ...handlers: Array<RequestHandler>): void;
|
|
@@ -25,7 +25,7 @@ var import_toPublicUrl = require("./toPublicUrl.js");
|
|
|
25
25
|
var import_devUtils = require("../internal/devUtils.js");
|
|
26
26
|
async function onUnhandledRequest(request, strategy = "warn") {
|
|
27
27
|
const url = new URL(request.url);
|
|
28
|
-
const publicUrl = (0, import_toPublicUrl.toPublicUrl)(url);
|
|
28
|
+
const publicUrl = (0, import_toPublicUrl.toPublicUrl)(url) + url.search;
|
|
29
29
|
const unhandledRequestMessage = `intercepted a request without a matching request handler:
|
|
30
30
|
|
|
31
31
|
\u2022 ${request.method} ${publicUrl}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/core/utils/request/onUnhandledRequest.ts"],"sourcesContent":["import { toPublicUrl } from './toPublicUrl'\nimport { devUtils } from '../internal/devUtils'\n\nexport interface UnhandledRequestPrint {\n warning(): void\n error(): void\n}\n\nexport type UnhandledRequestCallback = (\n request: Request,\n print: UnhandledRequestPrint,\n) => void\n\nexport type UnhandledRequestStrategy =\n | 'bypass'\n | 'warn'\n | 'error'\n | UnhandledRequestCallback\n\nexport async function onUnhandledRequest(\n request: Request,\n strategy: UnhandledRequestStrategy = 'warn',\n): Promise<void> {\n const url = new URL(request.url)\n const publicUrl = toPublicUrl(url)\n\n const unhandledRequestMessage = `intercepted a request without a matching request handler:\\n\\n \\u2022 ${request.method} ${publicUrl}\\n\\nIf you still wish to intercept this unhandled request, please create a request handler for it.\\nRead more: https://mswjs.io/docs/getting-started/mocks`\n\n function applyStrategy(strategy: UnhandledRequestStrategy) {\n switch (strategy) {\n case 'error': {\n // Print a developer-friendly error.\n devUtils.error('Error: %s', unhandledRequestMessage)\n\n // Throw an exception to halt request processing and not perform the original request.\n throw new Error(\n devUtils.formatMessage(\n 'Cannot bypass a request when using the \"error\" strategy for the \"onUnhandledRequest\" option.',\n ),\n )\n }\n\n case 'warn': {\n devUtils.warn('Warning: %s', unhandledRequestMessage)\n break\n }\n\n case 'bypass':\n break\n\n default:\n throw new Error(\n devUtils.formatMessage(\n 'Failed to react to an unhandled request: unknown strategy \"%s\". Please provide one of the supported strategies (\"bypass\", \"warn\", \"error\") or a custom callback function as the value of the \"onUnhandledRequest\" option.',\n strategy,\n ),\n )\n }\n }\n\n if (typeof strategy === 'function') {\n strategy(request, {\n warning: applyStrategy.bind(null, 'warn'),\n error: applyStrategy.bind(null, 'error'),\n })\n return\n }\n\n /**\n * @note Ignore \"file://\" requests.\n * Those often are an implementation detail of modern tooling\n * that fetches modules via HTTP. Developers don't issue those\n * requests and so they mustn't be warned about them.\n */\n if (url.protocol === 'file:') {\n return\n }\n\n applyStrategy(strategy)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAC5B,sBAAyB;AAkBzB,eAAsB,mBACpB,SACA,WAAqC,QACtB;AACf,QAAM,MAAM,IAAI,IAAI,QAAQ,GAAG;AAC/B,QAAM,gBAAY,gCAAY,GAAG;
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/utils/request/onUnhandledRequest.ts"],"sourcesContent":["import { toPublicUrl } from './toPublicUrl'\nimport { devUtils } from '../internal/devUtils'\n\nexport interface UnhandledRequestPrint {\n warning(): void\n error(): void\n}\n\nexport type UnhandledRequestCallback = (\n request: Request,\n print: UnhandledRequestPrint,\n) => void\n\nexport type UnhandledRequestStrategy =\n | 'bypass'\n | 'warn'\n | 'error'\n | UnhandledRequestCallback\n\nexport async function onUnhandledRequest(\n request: Request,\n strategy: UnhandledRequestStrategy = 'warn',\n): Promise<void> {\n const url = new URL(request.url)\n const publicUrl = toPublicUrl(url) + url.search\n\n const unhandledRequestMessage = `intercepted a request without a matching request handler:\\n\\n \\u2022 ${request.method} ${publicUrl}\\n\\nIf you still wish to intercept this unhandled request, please create a request handler for it.\\nRead more: https://mswjs.io/docs/getting-started/mocks`\n\n function applyStrategy(strategy: UnhandledRequestStrategy) {\n switch (strategy) {\n case 'error': {\n // Print a developer-friendly error.\n devUtils.error('Error: %s', unhandledRequestMessage)\n\n // Throw an exception to halt request processing and not perform the original request.\n throw new Error(\n devUtils.formatMessage(\n 'Cannot bypass a request when using the \"error\" strategy for the \"onUnhandledRequest\" option.',\n ),\n )\n }\n\n case 'warn': {\n devUtils.warn('Warning: %s', unhandledRequestMessage)\n break\n }\n\n case 'bypass':\n break\n\n default:\n throw new Error(\n devUtils.formatMessage(\n 'Failed to react to an unhandled request: unknown strategy \"%s\". Please provide one of the supported strategies (\"bypass\", \"warn\", \"error\") or a custom callback function as the value of the \"onUnhandledRequest\" option.',\n strategy,\n ),\n )\n }\n }\n\n if (typeof strategy === 'function') {\n strategy(request, {\n warning: applyStrategy.bind(null, 'warn'),\n error: applyStrategy.bind(null, 'error'),\n })\n return\n }\n\n /**\n * @note Ignore \"file://\" requests.\n * Those often are an implementation detail of modern tooling\n * that fetches modules via HTTP. Developers don't issue those\n * requests and so they mustn't be warned about them.\n */\n if (url.protocol === 'file:') {\n return\n }\n\n applyStrategy(strategy)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAC5B,sBAAyB;AAkBzB,eAAsB,mBACpB,SACA,WAAqC,QACtB;AACf,QAAM,MAAM,IAAI,IAAI,QAAQ,GAAG;AAC/B,QAAM,gBAAY,gCAAY,GAAG,IAAI,IAAI;AAEzC,QAAM,0BAA0B;AAAA;AAAA,WAAyE,QAAQ,MAAM,IAAI,SAAS;AAAA;AAAA;AAAA;AAEpI,WAAS,cAAcA,WAAoC;AACzD,YAAQA,WAAU;AAAA,MAChB,KAAK,SAAS;AAEZ,iCAAS,MAAM,aAAa,uBAAuB;AAGnD,cAAM,IAAI;AAAA,UACR,yBAAS;AAAA,YACP;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MAEA,KAAK,QAAQ;AACX,iCAAS,KAAK,eAAe,uBAAuB;AACpD;AAAA,MACF;AAAA,MAEA,KAAK;AACH;AAAA,MAEF;AACE,cAAM,IAAI;AAAA,UACR,yBAAS;AAAA,YACP;AAAA,YACAA;AAAA,UACF;AAAA,QACF;AAAA,IACJ;AAAA,EACF;AAEA,MAAI,OAAO,aAAa,YAAY;AAClC,aAAS,SAAS;AAAA,MAChB,SAAS,cAAc,KAAK,MAAM,MAAM;AAAA,MACxC,OAAO,cAAc,KAAK,MAAM,OAAO;AAAA,IACzC,CAAC;AACD;AAAA,EACF;AAQA,MAAI,IAAI,aAAa,SAAS;AAC5B;AAAA,EACF;AAEA,gBAAc,QAAQ;AACxB;","names":["strategy"]}
|
|
@@ -2,7 +2,7 @@ import { toPublicUrl } from './toPublicUrl.mjs';
|
|
|
2
2
|
import { devUtils } from '../internal/devUtils.mjs';
|
|
3
3
|
async function onUnhandledRequest(request, strategy = "warn") {
|
|
4
4
|
const url = new URL(request.url);
|
|
5
|
-
const publicUrl = toPublicUrl(url);
|
|
5
|
+
const publicUrl = toPublicUrl(url) + url.search;
|
|
6
6
|
const unhandledRequestMessage = `intercepted a request without a matching request handler:
|
|
7
7
|
|
|
8
8
|
\u2022 ${request.method} ${publicUrl}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/core/utils/request/onUnhandledRequest.ts"],"sourcesContent":["import { toPublicUrl } from './toPublicUrl'\nimport { devUtils } from '../internal/devUtils'\n\nexport interface UnhandledRequestPrint {\n warning(): void\n error(): void\n}\n\nexport type UnhandledRequestCallback = (\n request: Request,\n print: UnhandledRequestPrint,\n) => void\n\nexport type UnhandledRequestStrategy =\n | 'bypass'\n | 'warn'\n | 'error'\n | UnhandledRequestCallback\n\nexport async function onUnhandledRequest(\n request: Request,\n strategy: UnhandledRequestStrategy = 'warn',\n): Promise<void> {\n const url = new URL(request.url)\n const publicUrl = toPublicUrl(url)\n\n const unhandledRequestMessage = `intercepted a request without a matching request handler:\\n\\n \\u2022 ${request.method} ${publicUrl}\\n\\nIf you still wish to intercept this unhandled request, please create a request handler for it.\\nRead more: https://mswjs.io/docs/getting-started/mocks`\n\n function applyStrategy(strategy: UnhandledRequestStrategy) {\n switch (strategy) {\n case 'error': {\n // Print a developer-friendly error.\n devUtils.error('Error: %s', unhandledRequestMessage)\n\n // Throw an exception to halt request processing and not perform the original request.\n throw new Error(\n devUtils.formatMessage(\n 'Cannot bypass a request when using the \"error\" strategy for the \"onUnhandledRequest\" option.',\n ),\n )\n }\n\n case 'warn': {\n devUtils.warn('Warning: %s', unhandledRequestMessage)\n break\n }\n\n case 'bypass':\n break\n\n default:\n throw new Error(\n devUtils.formatMessage(\n 'Failed to react to an unhandled request: unknown strategy \"%s\". Please provide one of the supported strategies (\"bypass\", \"warn\", \"error\") or a custom callback function as the value of the \"onUnhandledRequest\" option.',\n strategy,\n ),\n )\n }\n }\n\n if (typeof strategy === 'function') {\n strategy(request, {\n warning: applyStrategy.bind(null, 'warn'),\n error: applyStrategy.bind(null, 'error'),\n })\n return\n }\n\n /**\n * @note Ignore \"file://\" requests.\n * Those often are an implementation detail of modern tooling\n * that fetches modules via HTTP. Developers don't issue those\n * requests and so they mustn't be warned about them.\n */\n if (url.protocol === 'file:') {\n return\n }\n\n applyStrategy(strategy)\n}\n"],"mappings":"AAAA,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AAkBzB,eAAsB,mBACpB,SACA,WAAqC,QACtB;AACf,QAAM,MAAM,IAAI,IAAI,QAAQ,GAAG;AAC/B,QAAM,YAAY,YAAY,GAAG;
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/utils/request/onUnhandledRequest.ts"],"sourcesContent":["import { toPublicUrl } from './toPublicUrl'\nimport { devUtils } from '../internal/devUtils'\n\nexport interface UnhandledRequestPrint {\n warning(): void\n error(): void\n}\n\nexport type UnhandledRequestCallback = (\n request: Request,\n print: UnhandledRequestPrint,\n) => void\n\nexport type UnhandledRequestStrategy =\n | 'bypass'\n | 'warn'\n | 'error'\n | UnhandledRequestCallback\n\nexport async function onUnhandledRequest(\n request: Request,\n strategy: UnhandledRequestStrategy = 'warn',\n): Promise<void> {\n const url = new URL(request.url)\n const publicUrl = toPublicUrl(url) + url.search\n\n const unhandledRequestMessage = `intercepted a request without a matching request handler:\\n\\n \\u2022 ${request.method} ${publicUrl}\\n\\nIf you still wish to intercept this unhandled request, please create a request handler for it.\\nRead more: https://mswjs.io/docs/getting-started/mocks`\n\n function applyStrategy(strategy: UnhandledRequestStrategy) {\n switch (strategy) {\n case 'error': {\n // Print a developer-friendly error.\n devUtils.error('Error: %s', unhandledRequestMessage)\n\n // Throw an exception to halt request processing and not perform the original request.\n throw new Error(\n devUtils.formatMessage(\n 'Cannot bypass a request when using the \"error\" strategy for the \"onUnhandledRequest\" option.',\n ),\n )\n }\n\n case 'warn': {\n devUtils.warn('Warning: %s', unhandledRequestMessage)\n break\n }\n\n case 'bypass':\n break\n\n default:\n throw new Error(\n devUtils.formatMessage(\n 'Failed to react to an unhandled request: unknown strategy \"%s\". Please provide one of the supported strategies (\"bypass\", \"warn\", \"error\") or a custom callback function as the value of the \"onUnhandledRequest\" option.',\n strategy,\n ),\n )\n }\n }\n\n if (typeof strategy === 'function') {\n strategy(request, {\n warning: applyStrategy.bind(null, 'warn'),\n error: applyStrategy.bind(null, 'error'),\n })\n return\n }\n\n /**\n * @note Ignore \"file://\" requests.\n * Those often are an implementation detail of modern tooling\n * that fetches modules via HTTP. Developers don't issue those\n * requests and so they mustn't be warned about them.\n */\n if (url.protocol === 'file:') {\n return\n }\n\n applyStrategy(strategy)\n}\n"],"mappings":"AAAA,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AAkBzB,eAAsB,mBACpB,SACA,WAAqC,QACtB;AACf,QAAM,MAAM,IAAI,IAAI,QAAQ,GAAG;AAC/B,QAAM,YAAY,YAAY,GAAG,IAAI,IAAI;AAEzC,QAAM,0BAA0B;AAAA;AAAA,WAAyE,QAAQ,MAAM,IAAI,SAAS;AAAA;AAAA;AAAA;AAEpI,WAAS,cAAcA,WAAoC;AACzD,YAAQA,WAAU;AAAA,MAChB,KAAK,SAAS;AAEZ,iBAAS,MAAM,aAAa,uBAAuB;AAGnD,cAAM,IAAI;AAAA,UACR,SAAS;AAAA,YACP;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MAEA,KAAK,QAAQ;AACX,iBAAS,KAAK,eAAe,uBAAuB;AACpD;AAAA,MACF;AAAA,MAEA,KAAK;AACH;AAAA,MAEF;AACE,cAAM,IAAI;AAAA,UACR,SAAS;AAAA,YACP;AAAA,YACAA;AAAA,UACF;AAAA,QACF;AAAA,IACJ;AAAA,EACF;AAEA,MAAI,OAAO,aAAa,YAAY;AAClC,aAAS,SAAS;AAAA,MAChB,SAAS,cAAc,KAAK,MAAM,MAAM;AAAA,MACxC,OAAO,cAAc,KAAK,MAAM,OAAO;AAAA,IACzC,CAAC;AACD;AAAA,EACF;AAQA,MAAI,IAAI,aAAa,SAAS;AAC5B;AAAA,EACF;AAEA,gBAAc,QAAQ;AACxB;","names":["strategy"]}
|
package/lib/iife/index.js
CHANGED
|
@@ -1062,7 +1062,7 @@ var MockServiceWorker = (() => {
|
|
|
1062
1062
|
if (options === void 0) {
|
|
1063
1063
|
options = {};
|
|
1064
1064
|
}
|
|
1065
|
-
var _a2 = options.strict, strict = _a2 === void 0 ? false : _a2, _b2 = options.start, start = _b2 === void 0 ? true : _b2,
|
|
1065
|
+
var _a2 = options.strict, strict = _a2 === void 0 ? false : _a2, _b2 = options.start, start = _b2 === void 0 ? true : _b2, _c2 = options.end, end = _c2 === void 0 ? true : _c2, _d = options.encode, encode = _d === void 0 ? function(x) {
|
|
1066
1066
|
return x;
|
|
1067
1067
|
} : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f;
|
|
1068
1068
|
var endsWithRe = "[".concat(escapeString(endsWith), "]|$");
|
|
@@ -1121,7 +1121,7 @@ var MockServiceWorker = (() => {
|
|
|
1121
1121
|
return stringToRegexp(path, keys, options);
|
|
1122
1122
|
}
|
|
1123
1123
|
|
|
1124
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.26.
|
|
1124
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.26.15/node_modules/@mswjs/interceptors/lib/browser/chunk-UJZOJSMP.mjs
|
|
1125
1125
|
var encoder = new TextEncoder();
|
|
1126
1126
|
function encodeBuffer(text) {
|
|
1127
1127
|
return encoder.encode(text);
|
|
@@ -1147,7 +1147,7 @@ var MockServiceWorker = (() => {
|
|
|
1147
1147
|
return RESPONSE_STATUS_CODES_WITHOUT_BODY.has(status);
|
|
1148
1148
|
}
|
|
1149
1149
|
|
|
1150
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.26.
|
|
1150
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.26.15/node_modules/@mswjs/interceptors/lib/browser/chunk-HAGW22AN.mjs
|
|
1151
1151
|
var IS_PATCHED_MODULE = Symbol("isPatchedModule");
|
|
1152
1152
|
|
|
1153
1153
|
// node_modules/.pnpm/is-node-process@1.2.0/node_modules/is-node-process/lib/index.mjs
|
|
@@ -1437,7 +1437,7 @@ var MockServiceWorker = (() => {
|
|
|
1437
1437
|
return message3.toString();
|
|
1438
1438
|
}
|
|
1439
1439
|
|
|
1440
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.26.
|
|
1440
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.26.15/node_modules/@mswjs/interceptors/lib/browser/chunk-QED3Q6Z2.mjs
|
|
1441
1441
|
var INTERNAL_REQUEST_ID_HEADER_NAME = "x-interceptors-internal-request-id";
|
|
1442
1442
|
function getGlobalSymbol(symbol) {
|
|
1443
1443
|
return (
|
|
@@ -1581,8 +1581,11 @@ var MockServiceWorker = (() => {
|
|
|
1581
1581
|
this.logger.info("cleared global instance!", this.symbol.description);
|
|
1582
1582
|
}
|
|
1583
1583
|
};
|
|
1584
|
+
function createRequestId() {
|
|
1585
|
+
return Math.random().toString(16).slice(2);
|
|
1586
|
+
}
|
|
1584
1587
|
|
|
1585
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.26.
|
|
1588
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.26.15/node_modules/@mswjs/interceptors/lib/browser/index.mjs
|
|
1586
1589
|
var BatchInterceptor = class extends Interceptor {
|
|
1587
1590
|
constructor(options) {
|
|
1588
1591
|
BatchInterceptor.symbol = Symbol(options.name);
|
|
@@ -4819,7 +4822,7 @@ spurious results.`);
|
|
|
4819
4822
|
}
|
|
4820
4823
|
}
|
|
4821
4824
|
|
|
4822
|
-
// node_modules/.pnpm/headers-polyfill@4.0.
|
|
4825
|
+
// node_modules/.pnpm/headers-polyfill@4.0.3/node_modules/headers-polyfill/lib/index.mjs
|
|
4823
4826
|
var __create4 = Object.create;
|
|
4824
4827
|
var __defProp6 = Object.defineProperty;
|
|
4825
4828
|
var __getOwnPropDesc5 = Object.getOwnPropertyDescriptor;
|
|
@@ -5095,10 +5098,12 @@ spurious results.`);
|
|
|
5095
5098
|
var HEADER_VALUE_DELIMITER = ", ";
|
|
5096
5099
|
var _a;
|
|
5097
5100
|
var _b;
|
|
5101
|
+
var _c;
|
|
5098
5102
|
var Headers2 = class _Headers {
|
|
5099
5103
|
constructor(init) {
|
|
5100
5104
|
this[_a] = {};
|
|
5101
5105
|
this[_b] = /* @__PURE__ */ new Map();
|
|
5106
|
+
this[_c] = "Headers";
|
|
5102
5107
|
if (["Headers", "HeadersPolyfill"].includes(init?.constructor.name) || init instanceof _Headers || typeof globalThis.Headers !== "undefined" && init instanceof globalThis.Headers) {
|
|
5103
5108
|
const initialHeaders = init;
|
|
5104
5109
|
initialHeaders.forEach((value, name) => {
|
|
@@ -5121,7 +5126,7 @@ spurious results.`);
|
|
|
5121
5126
|
});
|
|
5122
5127
|
}
|
|
5123
5128
|
}
|
|
5124
|
-
[(_a = NORMALIZED_HEADERS, _b = RAW_HEADER_NAMES, Symbol.iterator)]() {
|
|
5129
|
+
[(_a = NORMALIZED_HEADERS, _b = RAW_HEADER_NAMES, _c = Symbol.toStringTag, Symbol.iterator)]() {
|
|
5125
5130
|
return this.entries();
|
|
5126
5131
|
}
|
|
5127
5132
|
*keys() {
|
|
@@ -5653,7 +5658,7 @@ Consider naming this operation or using "graphql.operation()" request handler to
|
|
|
5653
5658
|
// src/core/utils/request/onUnhandledRequest.ts
|
|
5654
5659
|
async function onUnhandledRequest(request, strategy = "warn") {
|
|
5655
5660
|
const url = new URL(request.url);
|
|
5656
|
-
const publicUrl = toPublicUrl(url);
|
|
5661
|
+
const publicUrl = toPublicUrl(url) + url.search;
|
|
5657
5662
|
const unhandledRequestMessage = `intercepted a request without a matching request handler:
|
|
5658
5663
|
|
|
5659
5664
|
\u2022 ${request.method} ${publicUrl}
|
|
@@ -5758,16 +5763,11 @@ Read more: https://mswjs.io/docs/getting-started/mocks`;
|
|
|
5758
5763
|
return transformedResponse;
|
|
5759
5764
|
}
|
|
5760
5765
|
|
|
5761
|
-
// src/core/utils/internal/randomId.ts
|
|
5762
|
-
function randomId() {
|
|
5763
|
-
return Math.random().toString(16).slice(2);
|
|
5764
|
-
}
|
|
5765
|
-
|
|
5766
5766
|
// src/core/getResponse.ts
|
|
5767
5767
|
var getResponse = async (handlers, request) => {
|
|
5768
5768
|
const result = await executeHandlers({
|
|
5769
5769
|
request,
|
|
5770
|
-
requestId:
|
|
5770
|
+
requestId: createRequestId(),
|
|
5771
5771
|
handlers
|
|
5772
5772
|
});
|
|
5773
5773
|
return result?.response;
|
|
@@ -6490,7 +6490,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
6490
6490
|
}
|
|
6491
6491
|
};
|
|
6492
6492
|
|
|
6493
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.26.
|
|
6493
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.26.15/node_modules/@mswjs/interceptors/lib/browser/chunk-OUWBQF3Z.mjs
|
|
6494
6494
|
var RequestController = class {
|
|
6495
6495
|
constructor(request) {
|
|
6496
6496
|
this.request = request;
|
|
@@ -6528,7 +6528,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
6528
6528
|
}
|
|
6529
6529
|
}
|
|
6530
6530
|
|
|
6531
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.26.
|
|
6531
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.26.15/node_modules/@mswjs/interceptors/lib/browser/chunk-3FNUI33J.mjs
|
|
6532
6532
|
function isPropertyAccessible2(obj, key) {
|
|
6533
6533
|
try {
|
|
6534
6534
|
obj[key];
|
|
@@ -6560,7 +6560,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
6560
6560
|
);
|
|
6561
6561
|
globalThis.fetch = async (input, init) => {
|
|
6562
6562
|
var _a2;
|
|
6563
|
-
const requestId =
|
|
6563
|
+
const requestId = createRequestId();
|
|
6564
6564
|
const resolvedInput = typeof input === "string" && typeof location !== "undefined" && !canParseUrl(input) ? new URL(input, location.origin) : input;
|
|
6565
6565
|
const request = new Request(resolvedInput, init);
|
|
6566
6566
|
this.logger.info("[%s] %s", request.method, request.url);
|
|
@@ -6675,7 +6675,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
6675
6675
|
});
|
|
6676
6676
|
}
|
|
6677
6677
|
|
|
6678
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.26.
|
|
6678
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.26.15/node_modules/@mswjs/interceptors/lib/browser/chunk-VYFS2IF2.mjs
|
|
6679
6679
|
function concatArrayBuffer(left, right) {
|
|
6680
6680
|
const result = new Uint8Array(left.byteLength + right.byteLength);
|
|
6681
6681
|
result.set(left, 0);
|
|
@@ -6869,7 +6869,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
6869
6869
|
this.method = "GET";
|
|
6870
6870
|
this.url = null;
|
|
6871
6871
|
this.events = /* @__PURE__ */ new Map();
|
|
6872
|
-
this.requestId =
|
|
6872
|
+
this.requestId = createRequestId();
|
|
6873
6873
|
this.requestHeaders = new Headers();
|
|
6874
6874
|
this.responseBuffer = new Uint8Array();
|
|
6875
6875
|
this.request = createProxy(initialRequest, {
|