msw 2.4.9 → 2.4.11
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 +23 -106
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/index.mjs +23 -106
- package/lib/browser/index.mjs.map +1 -1
- package/lib/core/{GraphQLHandler-5pZBHLn9.d.mts → GraphQLHandler-ClMB0BOy.d.mts} +1 -1
- package/lib/core/{GraphQLHandler-Cu4Xvg4S.d.ts → GraphQLHandler-D6mLMXGZ.d.ts} +1 -1
- package/lib/core/{HttpResponse-DE19n76Q.d.ts → HttpResponse-DaYkf3ml.d.ts} +1 -1
- package/lib/core/{HttpResponse-Gtw1lt3H.d.mts → HttpResponse-vn-Pb4Bi.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/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/iife/index.js +117 -190
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +21 -22
- package/src/browser/setupWorker/start/utils/getWorkerInstance.ts +12 -10
package/lib/iife/index.js
CHANGED
|
@@ -7,8 +7,7 @@ var MockServiceWorker = (() => {
|
|
|
7
7
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
8
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
9
|
}) : x)(function(x) {
|
|
10
|
-
if (typeof require !== "undefined")
|
|
11
|
-
return require.apply(this, arguments);
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
11
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
12
|
});
|
|
14
13
|
var __esm = (fn, res) => function __init() {
|
|
@@ -77,7 +76,7 @@ var MockServiceWorker = (() => {
|
|
|
77
76
|
});
|
|
78
77
|
|
|
79
78
|
// node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/invariant.mjs
|
|
80
|
-
function
|
|
79
|
+
function invariant2(condition, message3) {
|
|
81
80
|
const booleanCondition = Boolean(condition);
|
|
82
81
|
if (!booleanCondition) {
|
|
83
82
|
throw new Error(
|
|
@@ -96,7 +95,7 @@ var MockServiceWorker = (() => {
|
|
|
96
95
|
let lastLineStart = 0;
|
|
97
96
|
let line = 1;
|
|
98
97
|
for (const match2 of source.body.matchAll(LineRegExp)) {
|
|
99
|
-
typeof match2.index === "number" ||
|
|
98
|
+
typeof match2.index === "number" || invariant2(false);
|
|
100
99
|
if (match2.index >= position) {
|
|
101
100
|
break;
|
|
102
101
|
}
|
|
@@ -683,8 +682,10 @@ var MockServiceWorker = (() => {
|
|
|
683
682
|
case 14:
|
|
684
683
|
case 15:
|
|
685
684
|
return false;
|
|
685
|
+
// Has non-printable characters
|
|
686
686
|
case 13:
|
|
687
687
|
return false;
|
|
688
|
+
// Has \r or \r\n which will be replaced as \n
|
|
688
689
|
case 10:
|
|
689
690
|
if (isEmptyLine && !seenNonEmptyLine) {
|
|
690
691
|
return false;
|
|
@@ -694,6 +695,7 @@ var MockServiceWorker = (() => {
|
|
|
694
695
|
hasIndent = false;
|
|
695
696
|
break;
|
|
696
697
|
case 9:
|
|
698
|
+
// \t
|
|
697
699
|
case 32:
|
|
698
700
|
hasIndent || (hasIndent = isEmptyLine);
|
|
699
701
|
break;
|
|
@@ -809,12 +811,33 @@ var MockServiceWorker = (() => {
|
|
|
809
811
|
while (position < bodyLength) {
|
|
810
812
|
const code = body.charCodeAt(position);
|
|
811
813
|
switch (code) {
|
|
814
|
+
// Ignored ::
|
|
815
|
+
// - UnicodeBOM
|
|
816
|
+
// - WhiteSpace
|
|
817
|
+
// - LineTerminator
|
|
818
|
+
// - Comment
|
|
819
|
+
// - Comma
|
|
820
|
+
//
|
|
821
|
+
// UnicodeBOM :: "Byte Order Mark (U+FEFF)"
|
|
822
|
+
//
|
|
823
|
+
// WhiteSpace ::
|
|
824
|
+
// - "Horizontal Tab (U+0009)"
|
|
825
|
+
// - "Space (U+0020)"
|
|
826
|
+
//
|
|
827
|
+
// Comma :: ,
|
|
812
828
|
case 65279:
|
|
829
|
+
// <BOM>
|
|
813
830
|
case 9:
|
|
831
|
+
// \t
|
|
814
832
|
case 32:
|
|
833
|
+
// <space>
|
|
815
834
|
case 44:
|
|
816
835
|
++position;
|
|
817
836
|
continue;
|
|
837
|
+
// LineTerminator ::
|
|
838
|
+
// - "New Line (U+000A)"
|
|
839
|
+
// - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
|
|
840
|
+
// - "Carriage Return (U+000D)" "New Line (U+000A)"
|
|
818
841
|
case 10:
|
|
819
842
|
++position;
|
|
820
843
|
++lexer2.line;
|
|
@@ -829,8 +852,17 @@ var MockServiceWorker = (() => {
|
|
|
829
852
|
++lexer2.line;
|
|
830
853
|
lexer2.lineStart = position;
|
|
831
854
|
continue;
|
|
855
|
+
// Comment
|
|
832
856
|
case 35:
|
|
833
857
|
return readComment(lexer2, position);
|
|
858
|
+
// Token ::
|
|
859
|
+
// - Punctuator
|
|
860
|
+
// - Name
|
|
861
|
+
// - IntValue
|
|
862
|
+
// - FloatValue
|
|
863
|
+
// - StringValue
|
|
864
|
+
//
|
|
865
|
+
// Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
|
|
834
866
|
case 33:
|
|
835
867
|
return createToken(lexer2, TokenKind.BANG, position, position + 1);
|
|
836
868
|
case 36:
|
|
@@ -862,6 +894,7 @@ var MockServiceWorker = (() => {
|
|
|
862
894
|
return createToken(lexer2, TokenKind.PIPE, position, position + 1);
|
|
863
895
|
case 125:
|
|
864
896
|
return createToken(lexer2, TokenKind.BRACE_R, position, position + 1);
|
|
897
|
+
// StringValue
|
|
865
898
|
case 34:
|
|
866
899
|
if (body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {
|
|
867
900
|
return readBlockString(lexer2, position);
|
|
@@ -4968,7 +5001,7 @@ spurious results.`);
|
|
|
4968
5001
|
}
|
|
4969
5002
|
throw new TypeError(`Cannot convert value to AST: ${inspect(serialized)}.`);
|
|
4970
5003
|
}
|
|
4971
|
-
|
|
5004
|
+
invariant2(false, "Unexpected input type: " + inspect(type));
|
|
4972
5005
|
}
|
|
4973
5006
|
var integerStringRegExp;
|
|
4974
5007
|
var init_astFromValue = __esm({
|
|
@@ -5190,7 +5223,7 @@ spurious results.`);
|
|
|
5190
5223
|
if (isNonNullType(type)) {
|
|
5191
5224
|
return TypeKind.NON_NULL;
|
|
5192
5225
|
}
|
|
5193
|
-
|
|
5226
|
+
invariant2(false, `Unexpected type: "${inspect(type)}".`);
|
|
5194
5227
|
}
|
|
5195
5228
|
},
|
|
5196
5229
|
name: {
|
|
@@ -6760,7 +6793,7 @@ spurious results.`);
|
|
|
6760
6793
|
}
|
|
6761
6794
|
function getDirectiveLocationForASTPath(ancestors) {
|
|
6762
6795
|
const appliedTo = ancestors[ancestors.length - 1];
|
|
6763
|
-
"kind" in appliedTo ||
|
|
6796
|
+
"kind" in appliedTo || invariant2(false);
|
|
6764
6797
|
switch (appliedTo.kind) {
|
|
6765
6798
|
case Kind.OPERATION_DEFINITION:
|
|
6766
6799
|
return getDirectiveLocationForOperation(appliedTo.operation);
|
|
@@ -6801,11 +6834,13 @@ spurious results.`);
|
|
|
6801
6834
|
return DirectiveLocation.INPUT_OBJECT;
|
|
6802
6835
|
case Kind.INPUT_VALUE_DEFINITION: {
|
|
6803
6836
|
const parentNode = ancestors[ancestors.length - 3];
|
|
6804
|
-
"kind" in parentNode ||
|
|
6837
|
+
"kind" in parentNode || invariant2(false);
|
|
6805
6838
|
return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ? DirectiveLocation.INPUT_FIELD_DEFINITION : DirectiveLocation.ARGUMENT_DEFINITION;
|
|
6806
6839
|
}
|
|
6840
|
+
// Not reachable, all possible types have been considered.
|
|
6841
|
+
/* c8 ignore next */
|
|
6807
6842
|
default:
|
|
6808
|
-
|
|
6843
|
+
invariant2(false, "Unexpected kind: " + inspect(appliedTo.kind));
|
|
6809
6844
|
}
|
|
6810
6845
|
}
|
|
6811
6846
|
function getDirectiveLocationForOperation(operation) {
|
|
@@ -7875,7 +7910,7 @@ spurious results.`);
|
|
|
7875
7910
|
if (isInputObjectType(type)) {
|
|
7876
7911
|
return Kind.INPUT_OBJECT_TYPE_EXTENSION;
|
|
7877
7912
|
}
|
|
7878
|
-
|
|
7913
|
+
invariant2(false, "Unexpected type: " + inspect(type));
|
|
7879
7914
|
}
|
|
7880
7915
|
function extensionKindToTypeName(kind) {
|
|
7881
7916
|
switch (kind) {
|
|
@@ -7891,8 +7926,10 @@ spurious results.`);
|
|
|
7891
7926
|
return "enum";
|
|
7892
7927
|
case Kind.INPUT_OBJECT_TYPE_EXTENSION:
|
|
7893
7928
|
return "input object";
|
|
7929
|
+
// Not reachable. All possible types have been considered
|
|
7930
|
+
/* c8 ignore next */
|
|
7894
7931
|
default:
|
|
7895
|
-
|
|
7932
|
+
invariant2(false, "Unexpected kind: " + inspect(kind));
|
|
7896
7933
|
}
|
|
7897
7934
|
}
|
|
7898
7935
|
var defKindToExtKind;
|
|
@@ -8238,7 +8275,7 @@ spurious results.`);
|
|
|
8238
8275
|
}
|
|
8239
8276
|
return parseResult;
|
|
8240
8277
|
}
|
|
8241
|
-
|
|
8278
|
+
invariant2(false, "Unexpected input type: " + inspect(type));
|
|
8242
8279
|
}
|
|
8243
8280
|
var init_coerceInputValue = __esm({
|
|
8244
8281
|
"node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/utilities/coerceInputValue.mjs"() {
|
|
@@ -8352,7 +8389,7 @@ spurious results.`);
|
|
|
8352
8389
|
}
|
|
8353
8390
|
return result;
|
|
8354
8391
|
}
|
|
8355
|
-
|
|
8392
|
+
invariant2(false, "Unexpected input type: " + inspect(type));
|
|
8356
8393
|
}
|
|
8357
8394
|
function isMissingVariable(valueNode, variables) {
|
|
8358
8395
|
return valueNode.kind === Kind.VARIABLE && (variables == null || variables[valueNode.name.value] === void 0);
|
|
@@ -9114,7 +9151,7 @@ spurious results.`);
|
|
|
9114
9151
|
},
|
|
9115
9152
|
leave() {
|
|
9116
9153
|
const prevKnownNames = knownNameStack.pop();
|
|
9117
|
-
prevKnownNames ||
|
|
9154
|
+
prevKnownNames || invariant2(false);
|
|
9118
9155
|
knownNames = prevKnownNames;
|
|
9119
9156
|
}
|
|
9120
9157
|
},
|
|
@@ -10383,7 +10420,7 @@ spurious results.`);
|
|
|
10383
10420
|
result
|
|
10384
10421
|
);
|
|
10385
10422
|
}
|
|
10386
|
-
|
|
10423
|
+
invariant2(
|
|
10387
10424
|
false,
|
|
10388
10425
|
"Cannot complete value of unexpected output type: " + inspect(returnType)
|
|
10389
10426
|
);
|
|
@@ -10950,7 +10987,7 @@ spurious results.`);
|
|
|
10950
10987
|
const deprecationReason = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.deprecationReason;
|
|
10951
10988
|
if (fieldDef && deprecationReason != null) {
|
|
10952
10989
|
const parentType = context.getParentType();
|
|
10953
|
-
parentType != null ||
|
|
10990
|
+
parentType != null || invariant2(false);
|
|
10954
10991
|
context.reportError(
|
|
10955
10992
|
new GraphQLError(
|
|
10956
10993
|
`The field ${parentType.name}.${fieldDef.name} is deprecated. ${deprecationReason}`,
|
|
@@ -10978,7 +11015,7 @@ spurious results.`);
|
|
|
10978
11015
|
} else {
|
|
10979
11016
|
const parentType = context.getParentType();
|
|
10980
11017
|
const fieldDef = context.getFieldDef();
|
|
10981
|
-
parentType != null && fieldDef != null ||
|
|
11018
|
+
parentType != null && fieldDef != null || invariant2(false);
|
|
10982
11019
|
context.reportError(
|
|
10983
11020
|
new GraphQLError(
|
|
10984
11021
|
`Field "${parentType.name}.${fieldDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`,
|
|
@@ -11012,7 +11049,7 @@ spurious results.`);
|
|
|
11012
11049
|
const deprecationReason = enumValueDef === null || enumValueDef === void 0 ? void 0 : enumValueDef.deprecationReason;
|
|
11013
11050
|
if (enumValueDef && deprecationReason != null) {
|
|
11014
11051
|
const enumTypeDef = getNamedType(context.getInputType());
|
|
11015
|
-
enumTypeDef != null ||
|
|
11052
|
+
enumTypeDef != null || invariant2(false);
|
|
11016
11053
|
context.reportError(
|
|
11017
11054
|
new GraphQLError(
|
|
11018
11055
|
`The enum value "${enumTypeDef.name}.${enumValueDef.name}" is deprecated. ${deprecationReason}`,
|
|
@@ -11337,7 +11374,7 @@ spurious results.`);
|
|
|
11337
11374
|
schema,
|
|
11338
11375
|
document: document2
|
|
11339
11376
|
});
|
|
11340
|
-
!result.errors && result.data ||
|
|
11377
|
+
!result.errors && result.data || invariant2(false);
|
|
11341
11378
|
return result.data;
|
|
11342
11379
|
}
|
|
11343
11380
|
var init_introspectionFromSchema = __esm({
|
|
@@ -11726,7 +11763,7 @@ spurious results.`);
|
|
|
11726
11763
|
if (isInputObjectType(type)) {
|
|
11727
11764
|
return extendInputObjectType(type);
|
|
11728
11765
|
}
|
|
11729
|
-
|
|
11766
|
+
invariant2(false, "Unexpected type: " + inspect(type));
|
|
11730
11767
|
}
|
|
11731
11768
|
function extendInputObjectType(type) {
|
|
11732
11769
|
var _typeExtensionsMap$co;
|
|
@@ -12109,6 +12146,9 @@ spurious results.`);
|
|
|
12109
12146
|
if (config.astNode == null) {
|
|
12110
12147
|
for (const type of config.types) {
|
|
12111
12148
|
switch (type.name) {
|
|
12149
|
+
// Note: While this could make early assertions to get the correctly
|
|
12150
|
+
// typed values below, that would throw immediately while type system
|
|
12151
|
+
// validation with validateSchema() will produce more actionable results.
|
|
12112
12152
|
case "Query":
|
|
12113
12153
|
config.query = type;
|
|
12114
12154
|
break;
|
|
@@ -12253,7 +12293,7 @@ spurious results.`);
|
|
|
12253
12293
|
fields: () => sortInputFields(config.fields)
|
|
12254
12294
|
});
|
|
12255
12295
|
}
|
|
12256
|
-
|
|
12296
|
+
invariant2(false, "Unexpected type: " + inspect(type));
|
|
12257
12297
|
}
|
|
12258
12298
|
}
|
|
12259
12299
|
function sortObjMap(map, sortValueFn) {
|
|
@@ -12365,7 +12405,7 @@ ${operationTypes.join("\n")}
|
|
|
12365
12405
|
if (isInputObjectType(type)) {
|
|
12366
12406
|
return printInputObject(type);
|
|
12367
12407
|
}
|
|
12368
|
-
|
|
12408
|
+
invariant2(false, "Unexpected type: " + inspect(type));
|
|
12369
12409
|
}
|
|
12370
12410
|
function printScalar(type) {
|
|
12371
12411
|
return printDescription(type) + `scalar ${type.name}` + printSpecifiedByURL(type);
|
|
@@ -12952,11 +12992,11 @@ ${operationTypes.join("\n")}
|
|
|
12952
12992
|
if (isInputObjectType(type)) {
|
|
12953
12993
|
return "an Input type";
|
|
12954
12994
|
}
|
|
12955
|
-
|
|
12995
|
+
invariant2(false, "Unexpected type: " + inspect(type));
|
|
12956
12996
|
}
|
|
12957
12997
|
function stringifyValue2(value, type) {
|
|
12958
12998
|
const ast = astFromValue(value, type);
|
|
12959
|
-
ast != null ||
|
|
12999
|
+
ast != null || invariant2(false);
|
|
12960
13000
|
return print(sortValueNode(ast));
|
|
12961
13001
|
}
|
|
12962
13002
|
function diff(oldArray, newArray) {
|
|
@@ -13308,7 +13348,7 @@ ${operationTypes.join("\n")}
|
|
|
13308
13348
|
setupWorker: () => setupWorker
|
|
13309
13349
|
});
|
|
13310
13350
|
|
|
13311
|
-
// node_modules/.pnpm/outvariant@1.4.
|
|
13351
|
+
// node_modules/.pnpm/outvariant@1.4.3/node_modules/outvariant/lib/index.mjs
|
|
13312
13352
|
var POSITIONALS_EXP = /(%?)(%([sdijo]))/g;
|
|
13313
13353
|
function serializePositional(positional, flag) {
|
|
13314
13354
|
switch (flag) {
|
|
@@ -13379,10 +13419,12 @@ ${operationTypes.join("\n")}
|
|
|
13379
13419
|
};
|
|
13380
13420
|
invariant.as = (ErrorConstructor, predicate, message3, ...positionals) => {
|
|
13381
13421
|
if (!predicate) {
|
|
13382
|
-
const formatMessage2 = positionals.length === 0 ? message3 : format(message3, positionals);
|
|
13422
|
+
const formatMessage2 = positionals.length === 0 ? message3 : format(message3, ...positionals);
|
|
13383
13423
|
let error3;
|
|
13384
13424
|
try {
|
|
13385
|
-
error3 = Reflect.construct(ErrorConstructor, [
|
|
13425
|
+
error3 = Reflect.construct(ErrorConstructor, [
|
|
13426
|
+
formatMessage2
|
|
13427
|
+
]);
|
|
13386
13428
|
} catch (err) {
|
|
13387
13429
|
error3 = ErrorConstructor(formatMessage2);
|
|
13388
13430
|
}
|
|
@@ -14484,90 +14526,6 @@ ${operationTypes.join("\n")}
|
|
|
14484
14526
|
return false;
|
|
14485
14527
|
}
|
|
14486
14528
|
|
|
14487
|
-
// node_modules/.pnpm/outvariant@1.4.3/node_modules/outvariant/lib/index.mjs
|
|
14488
|
-
var POSITIONALS_EXP2 = /(%?)(%([sdijo]))/g;
|
|
14489
|
-
function serializePositional2(positional, flag) {
|
|
14490
|
-
switch (flag) {
|
|
14491
|
-
case "s":
|
|
14492
|
-
return positional;
|
|
14493
|
-
case "d":
|
|
14494
|
-
case "i":
|
|
14495
|
-
return Number(positional);
|
|
14496
|
-
case "j":
|
|
14497
|
-
return JSON.stringify(positional);
|
|
14498
|
-
case "o": {
|
|
14499
|
-
if (typeof positional === "string") {
|
|
14500
|
-
return positional;
|
|
14501
|
-
}
|
|
14502
|
-
const json = JSON.stringify(positional);
|
|
14503
|
-
if (json === "{}" || json === "[]" || /^\[object .+?\]$/.test(json)) {
|
|
14504
|
-
return positional;
|
|
14505
|
-
}
|
|
14506
|
-
return json;
|
|
14507
|
-
}
|
|
14508
|
-
}
|
|
14509
|
-
}
|
|
14510
|
-
function format2(message3, ...positionals) {
|
|
14511
|
-
if (positionals.length === 0) {
|
|
14512
|
-
return message3;
|
|
14513
|
-
}
|
|
14514
|
-
let positionalIndex = 0;
|
|
14515
|
-
let formattedMessage = message3.replace(
|
|
14516
|
-
POSITIONALS_EXP2,
|
|
14517
|
-
(match2, isEscaped, _, flag) => {
|
|
14518
|
-
const positional = positionals[positionalIndex];
|
|
14519
|
-
const value = serializePositional2(positional, flag);
|
|
14520
|
-
if (!isEscaped) {
|
|
14521
|
-
positionalIndex++;
|
|
14522
|
-
return value;
|
|
14523
|
-
}
|
|
14524
|
-
return match2;
|
|
14525
|
-
}
|
|
14526
|
-
);
|
|
14527
|
-
if (positionalIndex < positionals.length) {
|
|
14528
|
-
formattedMessage += ` ${positionals.slice(positionalIndex).join(" ")}`;
|
|
14529
|
-
}
|
|
14530
|
-
formattedMessage = formattedMessage.replace(/%{2,2}/g, "%");
|
|
14531
|
-
return formattedMessage;
|
|
14532
|
-
}
|
|
14533
|
-
var STACK_FRAMES_TO_IGNORE2 = 2;
|
|
14534
|
-
function cleanErrorStack2(error3) {
|
|
14535
|
-
if (!error3.stack) {
|
|
14536
|
-
return;
|
|
14537
|
-
}
|
|
14538
|
-
const nextStack = error3.stack.split("\n");
|
|
14539
|
-
nextStack.splice(1, STACK_FRAMES_TO_IGNORE2);
|
|
14540
|
-
error3.stack = nextStack.join("\n");
|
|
14541
|
-
}
|
|
14542
|
-
var InvariantError2 = class extends Error {
|
|
14543
|
-
constructor(message3, ...positionals) {
|
|
14544
|
-
super(message3);
|
|
14545
|
-
this.message = message3;
|
|
14546
|
-
this.name = "Invariant Violation";
|
|
14547
|
-
this.message = format2(message3, ...positionals);
|
|
14548
|
-
cleanErrorStack2(this);
|
|
14549
|
-
}
|
|
14550
|
-
};
|
|
14551
|
-
var invariant2 = (predicate, message3, ...positionals) => {
|
|
14552
|
-
if (!predicate) {
|
|
14553
|
-
throw new InvariantError2(message3, ...positionals);
|
|
14554
|
-
}
|
|
14555
|
-
};
|
|
14556
|
-
invariant2.as = (ErrorConstructor, predicate, message3, ...positionals) => {
|
|
14557
|
-
if (!predicate) {
|
|
14558
|
-
const formatMessage2 = positionals.length === 0 ? message3 : format2(message3, ...positionals);
|
|
14559
|
-
let error3;
|
|
14560
|
-
try {
|
|
14561
|
-
error3 = Reflect.construct(ErrorConstructor, [
|
|
14562
|
-
formatMessage2
|
|
14563
|
-
]);
|
|
14564
|
-
} catch (err) {
|
|
14565
|
-
error3 = ErrorConstructor(formatMessage2);
|
|
14566
|
-
}
|
|
14567
|
-
throw error3;
|
|
14568
|
-
}
|
|
14569
|
-
};
|
|
14570
|
-
|
|
14571
14529
|
// node_modules/.pnpm/@open-draft+logger@0.3.0/node_modules/@open-draft/logger/lib/index.mjs
|
|
14572
14530
|
var __defProp3 = Object.defineProperty;
|
|
14573
14531
|
var __export2 = (target, all) => {
|
|
@@ -14796,21 +14754,21 @@ ${operationTypes.join("\n")}
|
|
|
14796
14754
|
var noop = () => void 0;
|
|
14797
14755
|
function log(message3, ...positionals) {
|
|
14798
14756
|
if (IS_NODE) {
|
|
14799
|
-
process.stdout.write(
|
|
14757
|
+
process.stdout.write(format(message3, ...positionals) + "\n");
|
|
14800
14758
|
return;
|
|
14801
14759
|
}
|
|
14802
14760
|
console.log(message3, ...positionals);
|
|
14803
14761
|
}
|
|
14804
14762
|
function warn2(message3, ...positionals) {
|
|
14805
14763
|
if (IS_NODE) {
|
|
14806
|
-
process.stderr.write(
|
|
14764
|
+
process.stderr.write(format(message3, ...positionals) + "\n");
|
|
14807
14765
|
return;
|
|
14808
14766
|
}
|
|
14809
14767
|
console.warn(message3, ...positionals);
|
|
14810
14768
|
}
|
|
14811
14769
|
function error2(message3, ...positionals) {
|
|
14812
14770
|
if (IS_NODE) {
|
|
14813
|
-
process.stderr.write(
|
|
14771
|
+
process.stderr.write(format(message3, ...positionals) + "\n");
|
|
14814
14772
|
return;
|
|
14815
14773
|
}
|
|
14816
14774
|
console.error(message3, ...positionals);
|
|
@@ -15288,8 +15246,7 @@ ${operationTypes.join("\n")}
|
|
|
15288
15246
|
var __require2 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
15289
15247
|
get: (a, b) => (typeof __require !== "undefined" ? __require : a)[b]
|
|
15290
15248
|
}) : x)(function(x) {
|
|
15291
|
-
if (typeof __require !== "undefined")
|
|
15292
|
-
return __require.apply(this, arguments);
|
|
15249
|
+
if (typeof __require !== "undefined") return __require.apply(this, arguments);
|
|
15293
15250
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15294
15251
|
});
|
|
15295
15252
|
var __commonJS3 = (cb, mod) => function __require22() {
|
|
@@ -15554,8 +15511,7 @@ ${operationTypes.join("\n")}
|
|
|
15554
15511
|
module.exports = function required(port, protocol) {
|
|
15555
15512
|
protocol = protocol.split(":")[0];
|
|
15556
15513
|
port = +port;
|
|
15557
|
-
if (!port)
|
|
15558
|
-
return false;
|
|
15514
|
+
if (!port) return false;
|
|
15559
15515
|
switch (protocol) {
|
|
15560
15516
|
case "http":
|
|
15561
15517
|
case "ws":
|
|
@@ -15597,8 +15553,7 @@ ${operationTypes.join("\n")}
|
|
|
15597
15553
|
var parser = /([^=?#&]+)=?([^&]*)/g, result = {}, part;
|
|
15598
15554
|
while (part = parser.exec(query)) {
|
|
15599
15555
|
var key = decode(part[1]), value = decode(part[2]);
|
|
15600
|
-
if (key === null || value === null || key in result)
|
|
15601
|
-
continue;
|
|
15556
|
+
if (key === null || value === null || key in result) continue;
|
|
15602
15557
|
result[key] = value;
|
|
15603
15558
|
}
|
|
15604
15559
|
return result;
|
|
@@ -15606,8 +15561,7 @@ ${operationTypes.join("\n")}
|
|
|
15606
15561
|
function querystringify(obj, prefix) {
|
|
15607
15562
|
prefix = prefix || "";
|
|
15608
15563
|
var pairs = [], value, key;
|
|
15609
|
-
if ("string" !== typeof prefix)
|
|
15610
|
-
prefix = "?";
|
|
15564
|
+
if ("string" !== typeof prefix) prefix = "?";
|
|
15611
15565
|
for (key in obj) {
|
|
15612
15566
|
if (has.call(obj, key)) {
|
|
15613
15567
|
value = obj[key];
|
|
@@ -15616,8 +15570,7 @@ ${operationTypes.join("\n")}
|
|
|
15616
15570
|
}
|
|
15617
15571
|
key = encode(key);
|
|
15618
15572
|
value = encode(value);
|
|
15619
|
-
if (key === null || value === null)
|
|
15620
|
-
continue;
|
|
15573
|
+
if (key === null || value === null) continue;
|
|
15621
15574
|
pairs.push(key + "=" + value);
|
|
15622
15575
|
}
|
|
15623
15576
|
}
|
|
@@ -15663,14 +15616,10 @@ ${operationTypes.join("\n")}
|
|
|
15663
15616
|
var ignore = { hash: 1, query: 1 };
|
|
15664
15617
|
function lolcation(loc) {
|
|
15665
15618
|
var globalVar;
|
|
15666
|
-
if (typeof window !== "undefined")
|
|
15667
|
-
|
|
15668
|
-
else if (typeof
|
|
15669
|
-
|
|
15670
|
-
else if (typeof self !== "undefined")
|
|
15671
|
-
globalVar = self;
|
|
15672
|
-
else
|
|
15673
|
-
globalVar = {};
|
|
15619
|
+
if (typeof window !== "undefined") globalVar = window;
|
|
15620
|
+
else if (typeof global !== "undefined") globalVar = global;
|
|
15621
|
+
else if (typeof self !== "undefined") globalVar = self;
|
|
15622
|
+
else globalVar = {};
|
|
15674
15623
|
var location2 = globalVar.location || {};
|
|
15675
15624
|
loc = loc || location2;
|
|
15676
15625
|
var finaldestination = {}, type = typeof loc, key;
|
|
@@ -15678,12 +15627,10 @@ ${operationTypes.join("\n")}
|
|
|
15678
15627
|
finaldestination = new Url(unescape(loc.pathname), {});
|
|
15679
15628
|
} else if ("string" === type) {
|
|
15680
15629
|
finaldestination = new Url(loc, {});
|
|
15681
|
-
for (key in ignore)
|
|
15682
|
-
delete finaldestination[key];
|
|
15630
|
+
for (key in ignore) delete finaldestination[key];
|
|
15683
15631
|
} else if ("object" === type) {
|
|
15684
15632
|
for (key in loc) {
|
|
15685
|
-
if (key in ignore)
|
|
15686
|
-
continue;
|
|
15633
|
+
if (key in ignore) continue;
|
|
15687
15634
|
finaldestination[key] = loc[key];
|
|
15688
15635
|
}
|
|
15689
15636
|
if (finaldestination.slashes === void 0) {
|
|
@@ -15742,8 +15689,7 @@ ${operationTypes.join("\n")}
|
|
|
15742
15689
|
};
|
|
15743
15690
|
}
|
|
15744
15691
|
function resolve(relative, base) {
|
|
15745
|
-
if (relative === "")
|
|
15746
|
-
return base;
|
|
15692
|
+
if (relative === "") return base;
|
|
15747
15693
|
var path = (base || "/").split("/").slice(0, -1).concat(relative.split("/")), i = path.length, last = path[i - 1], unshift = false, up = 0;
|
|
15748
15694
|
while (i--) {
|
|
15749
15695
|
if (path[i] === ".") {
|
|
@@ -15752,16 +15698,13 @@ ${operationTypes.join("\n")}
|
|
|
15752
15698
|
path.splice(i, 1);
|
|
15753
15699
|
up++;
|
|
15754
15700
|
} else if (up) {
|
|
15755
|
-
if (i === 0)
|
|
15756
|
-
unshift = true;
|
|
15701
|
+
if (i === 0) unshift = true;
|
|
15757
15702
|
path.splice(i, 1);
|
|
15758
15703
|
up--;
|
|
15759
15704
|
}
|
|
15760
15705
|
}
|
|
15761
|
-
if (unshift)
|
|
15762
|
-
|
|
15763
|
-
if (last === "." || last === "..")
|
|
15764
|
-
path.push("");
|
|
15706
|
+
if (unshift) path.unshift("");
|
|
15707
|
+
if (last === "." || last === "..") path.push("");
|
|
15765
15708
|
return path.join("/");
|
|
15766
15709
|
}
|
|
15767
15710
|
function Url(address, location2, parser) {
|
|
@@ -15775,8 +15718,7 @@ ${operationTypes.join("\n")}
|
|
|
15775
15718
|
parser = location2;
|
|
15776
15719
|
location2 = null;
|
|
15777
15720
|
}
|
|
15778
|
-
if (parser && "function" !== typeof parser)
|
|
15779
|
-
parser = qs.parse;
|
|
15721
|
+
if (parser && "function" !== typeof parser) parser = qs.parse;
|
|
15780
15722
|
location2 = lolcation(location2);
|
|
15781
15723
|
extracted = extractProtocol(address || "", location2);
|
|
15782
15724
|
relative = !extracted.protocol && !extracted.slashes;
|
|
@@ -15812,11 +15754,9 @@ ${operationTypes.join("\n")}
|
|
|
15812
15754
|
address = address.slice(0, index.index);
|
|
15813
15755
|
}
|
|
15814
15756
|
url[key] = url[key] || (relative && instruction[3] ? location2[key] || "" : "");
|
|
15815
|
-
if (instruction[4])
|
|
15816
|
-
url[key] = url[key].toLowerCase();
|
|
15757
|
+
if (instruction[4]) url[key] = url[key].toLowerCase();
|
|
15817
15758
|
}
|
|
15818
|
-
if (parser)
|
|
15819
|
-
url.query = parser(url.query);
|
|
15759
|
+
if (parser) url.query = parser(url.query);
|
|
15820
15760
|
if (relative && location2.slashes && url.pathname.charAt(0) !== "/" && (url.pathname !== "" || location2.pathname !== "")) {
|
|
15821
15761
|
url.pathname = resolve(url.pathname, location2.pathname);
|
|
15822
15762
|
}
|
|
@@ -15863,8 +15803,7 @@ ${operationTypes.join("\n")}
|
|
|
15863
15803
|
break;
|
|
15864
15804
|
case "hostname":
|
|
15865
15805
|
url[part] = value;
|
|
15866
|
-
if (url.port)
|
|
15867
|
-
value += ":" + url.port;
|
|
15806
|
+
if (url.port) value += ":" + url.port;
|
|
15868
15807
|
url.host = value;
|
|
15869
15808
|
break;
|
|
15870
15809
|
case "host":
|
|
@@ -15908,8 +15847,7 @@ ${operationTypes.join("\n")}
|
|
|
15908
15847
|
}
|
|
15909
15848
|
for (var i = 0; i < rules.length; i++) {
|
|
15910
15849
|
var ins = rules[i];
|
|
15911
|
-
if (ins[4])
|
|
15912
|
-
url[ins[1]] = url[ins[1]].toLowerCase();
|
|
15850
|
+
if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();
|
|
15913
15851
|
}
|
|
15914
15852
|
url.auth = url.password ? url.username + ":" + url.password : url.username;
|
|
15915
15853
|
url.origin = url.protocol !== "file:" && isSpecial(url.protocol) && url.host ? url.protocol + "//" + url.host : "null";
|
|
@@ -15917,16 +15855,13 @@ ${operationTypes.join("\n")}
|
|
|
15917
15855
|
return url;
|
|
15918
15856
|
}
|
|
15919
15857
|
function toString(stringify) {
|
|
15920
|
-
if (!stringify || "function" !== typeof stringify)
|
|
15921
|
-
stringify = qs.stringify;
|
|
15858
|
+
if (!stringify || "function" !== typeof stringify) stringify = qs.stringify;
|
|
15922
15859
|
var query, url = this, host = url.host, protocol = url.protocol;
|
|
15923
|
-
if (protocol && protocol.charAt(protocol.length - 1) !== ":")
|
|
15924
|
-
protocol += ":";
|
|
15860
|
+
if (protocol && protocol.charAt(protocol.length - 1) !== ":") protocol += ":";
|
|
15925
15861
|
var result = protocol + (url.protocol && url.slashes || isSpecial(url.protocol) ? "//" : "");
|
|
15926
15862
|
if (url.username) {
|
|
15927
15863
|
result += url.username;
|
|
15928
|
-
if (url.password)
|
|
15929
|
-
result += ":" + url.password;
|
|
15864
|
+
if (url.password) result += ":" + url.password;
|
|
15930
15865
|
result += "@";
|
|
15931
15866
|
} else if (url.password) {
|
|
15932
15867
|
result += ":" + url.password;
|
|
@@ -15939,10 +15874,8 @@ ${operationTypes.join("\n")}
|
|
|
15939
15874
|
}
|
|
15940
15875
|
result += host + url.pathname;
|
|
15941
15876
|
query = "object" === typeof url.query ? stringify(url.query) : url.query;
|
|
15942
|
-
if (query)
|
|
15943
|
-
|
|
15944
|
-
if (url.hash)
|
|
15945
|
-
result += url.hash;
|
|
15877
|
+
if (query) result += "?" !== query.charAt(0) ? "?" + query : query;
|
|
15878
|
+
if (url.hash) result += url.hash;
|
|
15946
15879
|
return result;
|
|
15947
15880
|
}
|
|
15948
15881
|
Url.prototype = { set, toString };
|
|
@@ -25568,13 +25501,11 @@ ${operationTypes.join("\n")}
|
|
|
25568
25501
|
"use strict";
|
|
25569
25502
|
exports.fromCallback = function(fn) {
|
|
25570
25503
|
return Object.defineProperty(function() {
|
|
25571
|
-
if (typeof arguments[arguments.length - 1] === "function")
|
|
25572
|
-
fn.apply(this, arguments);
|
|
25504
|
+
if (typeof arguments[arguments.length - 1] === "function") fn.apply(this, arguments);
|
|
25573
25505
|
else {
|
|
25574
25506
|
return new Promise((resolve, reject) => {
|
|
25575
25507
|
arguments[arguments.length] = (err, res) => {
|
|
25576
|
-
if (err)
|
|
25577
|
-
return reject(err);
|
|
25508
|
+
if (err) return reject(err);
|
|
25578
25509
|
resolve(res);
|
|
25579
25510
|
};
|
|
25580
25511
|
arguments.length++;
|
|
@@ -25586,8 +25517,7 @@ ${operationTypes.join("\n")}
|
|
|
25586
25517
|
exports.fromPromise = function(fn) {
|
|
25587
25518
|
return Object.defineProperty(function() {
|
|
25588
25519
|
const cb = arguments[arguments.length - 1];
|
|
25589
|
-
if (typeof cb !== "function")
|
|
25590
|
-
return fn.apply(this, arguments);
|
|
25520
|
+
if (typeof cb !== "function") return fn.apply(this, arguments);
|
|
25591
25521
|
else {
|
|
25592
25522
|
delete arguments[arguments.length - 1];
|
|
25593
25523
|
arguments.length--;
|
|
@@ -25908,8 +25838,7 @@ ${operationTypes.join("\n")}
|
|
|
25908
25838
|
options = cb;
|
|
25909
25839
|
cb = null;
|
|
25910
25840
|
}
|
|
25911
|
-
if (!isObject2(options))
|
|
25912
|
-
options = { Error: "Failed Check" };
|
|
25841
|
+
if (!isObject2(options)) options = { Error: "Failed Check" };
|
|
25913
25842
|
if (!bool) {
|
|
25914
25843
|
if (cb) {
|
|
25915
25844
|
cb(new ParameterError(options));
|
|
@@ -26157,8 +26086,7 @@ ${operationTypes.join("\n")}
|
|
|
26157
26086
|
return path.slice(0, rightSlash);
|
|
26158
26087
|
}
|
|
26159
26088
|
function trimTerminator(str) {
|
|
26160
|
-
if (validators.isEmptyString(str))
|
|
26161
|
-
return str;
|
|
26089
|
+
if (validators.isEmptyString(str)) return str;
|
|
26162
26090
|
for (let t = 0; t < TERMINATORS.length; t++) {
|
|
26163
26091
|
const terminatorIdx = str.indexOf(TERMINATORS[t]);
|
|
26164
26092
|
if (terminatorIdx !== -1) {
|
|
@@ -28646,16 +28574,15 @@ Read more: https://mswjs.io/docs/getting-started/mocks`;
|
|
|
28646
28574
|
}
|
|
28647
28575
|
const [existingRegistration] = mockRegistrations;
|
|
28648
28576
|
if (existingRegistration) {
|
|
28649
|
-
|
|
28650
|
-
|
|
28651
|
-
|
|
28652
|
-
|
|
28653
|
-
|
|
28654
|
-
|
|
28655
|
-
|
|
28656
|
-
|
|
28657
|
-
|
|
28658
|
-
});
|
|
28577
|
+
existingRegistration.update();
|
|
28578
|
+
return [
|
|
28579
|
+
getWorkerByRegistration(
|
|
28580
|
+
existingRegistration,
|
|
28581
|
+
absoluteWorkerUrl,
|
|
28582
|
+
findWorker
|
|
28583
|
+
),
|
|
28584
|
+
existingRegistration
|
|
28585
|
+
];
|
|
28659
28586
|
}
|
|
28660
28587
|
const registrationResult = await until(
|
|
28661
28588
|
async () => {
|
|
@@ -29153,7 +29080,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
29153
29080
|
* controller.respondWith(Response.error())
|
|
29154
29081
|
*/
|
|
29155
29082
|
respondWith(response) {
|
|
29156
|
-
|
|
29083
|
+
invariant.as(
|
|
29157
29084
|
InterceptorError,
|
|
29158
29085
|
!this[kRequestHandled],
|
|
29159
29086
|
'Failed to respond to the "%s %s" request: the "request" event has already been handled.',
|
|
@@ -29170,7 +29097,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
29170
29097
|
* controller.errorWith(new Error('Oops!'))
|
|
29171
29098
|
*/
|
|
29172
29099
|
errorWith(error3) {
|
|
29173
|
-
|
|
29100
|
+
invariant.as(
|
|
29174
29101
|
InterceptorError,
|
|
29175
29102
|
!this[kRequestHandled],
|
|
29176
29103
|
'Failed to error the "%s %s" request: the "request" event has already been handled.',
|
|
@@ -29381,7 +29308,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
29381
29308
|
}
|
|
29382
29309
|
async setup() {
|
|
29383
29310
|
const pureFetch = globalThis.fetch;
|
|
29384
|
-
|
|
29311
|
+
invariant(
|
|
29385
29312
|
!pureFetch[IS_PATCHED_MODULE],
|
|
29386
29313
|
'Failed to patch the "fetch" module: already patched.'
|
|
29387
29314
|
);
|
|
@@ -30019,7 +29946,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
30019
29946
|
}
|
|
30020
29947
|
}
|
|
30021
29948
|
get responseText() {
|
|
30022
|
-
|
|
29949
|
+
invariant(
|
|
30023
29950
|
this.request.responseType === "" || this.request.responseType === "text",
|
|
30024
29951
|
"InvalidStateError: The object is in invalid state."
|
|
30025
29952
|
);
|
|
@@ -30031,7 +29958,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
30031
29958
|
return responseText;
|
|
30032
29959
|
}
|
|
30033
29960
|
get responseXML() {
|
|
30034
|
-
|
|
29961
|
+
invariant(
|
|
30035
29962
|
this.request.responseType === "" || this.request.responseType === "document",
|
|
30036
29963
|
"InvalidStateError: The object is in invalid state."
|
|
30037
29964
|
);
|
|
@@ -30247,7 +30174,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
30247
30174
|
const logger = this.logger.extend("setup");
|
|
30248
30175
|
logger.info('patching "XMLHttpRequest" module...');
|
|
30249
30176
|
const PureXMLHttpRequest = globalThis.XMLHttpRequest;
|
|
30250
|
-
|
|
30177
|
+
invariant(
|
|
30251
30178
|
!PureXMLHttpRequest[IS_PATCHED_MODULE],
|
|
30252
30179
|
'Failed to patch the "XMLHttpRequest" module: already patched.'
|
|
30253
30180
|
);
|