@zimic/interceptor 0.16.0-canary.11 → 0.16.0-canary.3
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/README.md +2 -1
- package/dist/{chunk-NTRC2S4I.mjs → chunk-2RNFR6TF.mjs} +267 -249
- package/dist/chunk-2RNFR6TF.mjs.map +1 -0
- package/dist/{chunk-O6ZIPCUJ.js → chunk-D7CDDSQE.js} +268 -250
- package/dist/chunk-D7CDDSQE.js.map +1 -0
- package/dist/cli.js +9 -9
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +5 -5
- package/dist/cli.mjs.map +1 -1
- package/dist/http.d.ts +141 -180
- package/dist/http.js +69 -102
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +69 -101
- package/dist/http.mjs.map +1 -1
- package/dist/server.d.ts +46 -20
- package/dist/server.js +7 -7
- package/dist/server.mjs +1 -1
- package/package.json +11 -11
- package/src/cli/browser/init.ts +2 -2
- package/src/cli/server/start.ts +2 -2
- package/src/http/index.ts +2 -5
- package/src/http/interceptor/HttpInterceptorClient.ts +15 -30
- package/src/http/interceptor/LocalHttpInterceptor.ts +8 -8
- package/src/http/interceptor/RemoteHttpInterceptor.ts +8 -8
- package/src/http/interceptor/types/options.ts +10 -3
- package/src/http/interceptor/types/public.ts +12 -44
- package/src/http/interceptorWorker/HttpInterceptorWorker.ts +2 -2
- package/src/http/requestHandler/HttpRequestHandlerClient.ts +5 -15
- package/src/http/requestHandler/errors/DisabledRequestSavingError.ts +1 -1
- package/src/http/requestHandler/errors/TimesCheckError.ts +14 -15
- package/src/http/requestHandler/types/public.ts +8 -16
- package/src/server/index.ts +11 -1
- package/src/server/namespace/InterceptorServerNamespace.ts +21 -0
- package/src/utils/console.ts +2 -2
- package/dist/chunk-NTRC2S4I.mjs.map +0 -1
- package/dist/chunk-O6ZIPCUJ.js.map +0 -1
- package/src/http/interceptor/errors/RequestSavingSafeLimitExceededError.ts +0 -22
package/dist/http.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chalk2 = require('chalk');
|
|
4
4
|
var http = require('@zimic/http');
|
|
5
5
|
var msw = require('msw');
|
|
6
6
|
var mswBrowser = require('msw/browser');
|
|
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
|
|
|
27
27
|
return Object.freeze(n);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var chalk2__default = /*#__PURE__*/_interopDefault(chalk2);
|
|
31
31
|
var mswBrowser__namespace = /*#__PURE__*/_interopNamespace(mswBrowser);
|
|
32
32
|
var mswNode__namespace = /*#__PURE__*/_interopNamespace(mswNode);
|
|
33
33
|
var ClientSocket__default = /*#__PURE__*/_interopDefault(ClientSocket);
|
|
@@ -35,6 +35,30 @@ var ClientSocket__default = /*#__PURE__*/_interopDefault(ClientSocket);
|
|
|
35
35
|
var __defProp = Object.defineProperty;
|
|
36
36
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
37
37
|
|
|
38
|
+
// src/http/interceptorWorker/errors/InvalidJSONError.ts
|
|
39
|
+
var InvalidJSONError = class extends SyntaxError {
|
|
40
|
+
static {
|
|
41
|
+
__name(this, "InvalidJSONError");
|
|
42
|
+
}
|
|
43
|
+
constructor(value) {
|
|
44
|
+
super(`Failed to parse value as JSON: ${value}`);
|
|
45
|
+
this.name = "InvalidJSONError";
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var InvalidJSONError_default = InvalidJSONError;
|
|
49
|
+
|
|
50
|
+
// src/http/interceptorWorker/errors/InvalidFormDataError.ts
|
|
51
|
+
var InvalidFormDataError = class extends SyntaxError {
|
|
52
|
+
static {
|
|
53
|
+
__name(this, "InvalidFormDataError");
|
|
54
|
+
}
|
|
55
|
+
constructor(value) {
|
|
56
|
+
super(`Failed to parse value as form data: ${value}`);
|
|
57
|
+
this.name = "InvalidFormDataError";
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
var InvalidFormDataError_default = InvalidFormDataError;
|
|
61
|
+
|
|
38
62
|
// src/http/interceptor/errors/RunningHttpInterceptorError.ts
|
|
39
63
|
var RunningHttpInterceptorError = class extends Error {
|
|
40
64
|
static {
|
|
@@ -87,50 +111,6 @@ var UnknownHttpInterceptorTypeError = class extends TypeError {
|
|
|
87
111
|
};
|
|
88
112
|
var UnknownHttpInterceptorTypeError_default = UnknownHttpInterceptorTypeError;
|
|
89
113
|
|
|
90
|
-
// src/http/interceptor/errors/RequestSavingSafeLimitExceededError.ts
|
|
91
|
-
var RequestSavingSafeLimitExceededError = class extends TypeError {
|
|
92
|
-
static {
|
|
93
|
-
__name(this, "RequestSavingSafeLimitExceededError");
|
|
94
|
-
}
|
|
95
|
-
constructor(numberOfSavedRequests, safeLimit) {
|
|
96
|
-
super(
|
|
97
|
-
`The number of intercepted requests saved in memory (${numberOfSavedRequests}) exceeded the safe limit of ${safeLimit}. Did you forget to call \`interceptor.clear()\`?
|
|
98
|
-
|
|
99
|
-
If you need to save requests, make sure to regularly call \`interceptor.clear()\`. Alternatively, you can hide this warning by increasing \`requestSaving.safeLimit\` in your interceptor. Note that saving too many requests in memory can lead to performance issues.
|
|
100
|
-
|
|
101
|
-
If you do not need to save requests, consider setting \`requestSaving.enabled: false\` in your interceptor.
|
|
102
|
-
|
|
103
|
-
Learn more: https://github.com/zimicjs/zimic/wiki/api\u2010zimic\u2010interceptor\u2010http#saving-requests`
|
|
104
|
-
);
|
|
105
|
-
this.name = "RequestSavingSafeLimitExceededError";
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
var RequestSavingSafeLimitExceededError_default = RequestSavingSafeLimitExceededError;
|
|
109
|
-
|
|
110
|
-
// src/http/interceptorWorker/errors/InvalidFormDataError.ts
|
|
111
|
-
var InvalidFormDataError = class extends SyntaxError {
|
|
112
|
-
static {
|
|
113
|
-
__name(this, "InvalidFormDataError");
|
|
114
|
-
}
|
|
115
|
-
constructor(value) {
|
|
116
|
-
super(`Failed to parse value as form data: ${value}`);
|
|
117
|
-
this.name = "InvalidFormDataError";
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
var InvalidFormDataError_default = InvalidFormDataError;
|
|
121
|
-
|
|
122
|
-
// src/http/interceptorWorker/errors/InvalidJSONError.ts
|
|
123
|
-
var InvalidJSONError = class extends SyntaxError {
|
|
124
|
-
static {
|
|
125
|
-
__name(this, "InvalidJSONError");
|
|
126
|
-
}
|
|
127
|
-
constructor(value) {
|
|
128
|
-
super(`Failed to parse value as JSON: ${value}`);
|
|
129
|
-
this.name = "InvalidJSONError";
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
var InvalidJSONError_default = InvalidJSONError;
|
|
133
|
-
|
|
134
114
|
// src/cli/browser/shared/constants.ts
|
|
135
115
|
var SERVICE_WORKER_FILE_NAME = "mockServiceWorker.js";
|
|
136
116
|
|
|
@@ -162,7 +142,7 @@ var DisabledRequestSavingError = class extends TypeError {
|
|
|
162
142
|
}
|
|
163
143
|
constructor() {
|
|
164
144
|
super(
|
|
165
|
-
"Intercepted requests are not being saved. Did you forget to use `
|
|
145
|
+
"Intercepted requests are not being saved. Did you forget to use `saveRequests: true` when creating the interceptor?\n\nLearn more: https://github.com/zimicjs/zimic/wiki/api\u2010zimic\u2010interceptor\u2010http#saving-requests"
|
|
166
146
|
);
|
|
167
147
|
this.name = "DisabledRequestSavingError";
|
|
168
148
|
}
|
|
@@ -275,7 +255,7 @@ __name(formatValueToLog, "formatValueToLog");
|
|
|
275
255
|
function logWithPrefix(messageOrMessages, options = {}) {
|
|
276
256
|
const { method = "log" } = options;
|
|
277
257
|
const messages = Array.isArray(messageOrMessages) ? messageOrMessages : [messageOrMessages];
|
|
278
|
-
console[method](
|
|
258
|
+
console[method](chalk2__default.default.cyan("[@zimic/interceptor]"), ...messages);
|
|
279
259
|
}
|
|
280
260
|
__name(logWithPrefix, "logWithPrefix");
|
|
281
261
|
|
|
@@ -301,14 +281,14 @@ function createMessageHeader({
|
|
|
301
281
|
|
|
302
282
|
Requests evaluated by this handler:
|
|
303
283
|
|
|
304
|
-
${
|
|
305
|
-
${
|
|
284
|
+
${chalk2__default.default.green("- Expected")}
|
|
285
|
+
${chalk2__default.default.red("+ Received")}`
|
|
306
286
|
].filter((part) => part !== false).join("");
|
|
307
287
|
}
|
|
308
288
|
__name(createMessageHeader, "createMessageHeader");
|
|
309
|
-
function createMessageDiffs({
|
|
310
|
-
if (!
|
|
311
|
-
return "Tip:
|
|
289
|
+
function createMessageDiffs({ hasSavedRequests, unmatchedRequestGroups }) {
|
|
290
|
+
if (!hasSavedRequests) {
|
|
291
|
+
return "Tip: enable `saveRequests: true` in your interceptor for more details about the unmatched requests.";
|
|
312
292
|
}
|
|
313
293
|
return unmatchedRequestGroups.map(({ request, diff }, index) => {
|
|
314
294
|
const requestNumber = index + 1;
|
|
@@ -317,22 +297,22 @@ function createMessageDiffs({ requestSaving, unmatchedRequestGroups }) {
|
|
|
317
297
|
messageParts.push("Computed restriction:");
|
|
318
298
|
const stringifiedExpected = stringifyValueToLog(diff.computed.expected);
|
|
319
299
|
const stringifiedReceived = stringifyValueToLog(diff.computed.received);
|
|
320
|
-
messageParts.push(` ${
|
|
321
|
-
messageParts.push(` ${
|
|
300
|
+
messageParts.push(` ${chalk2__default.default.green(`- return ${stringifiedExpected}`)}`);
|
|
301
|
+
messageParts.push(` ${chalk2__default.default.red(`+ return ${stringifiedReceived}`)}`);
|
|
322
302
|
}
|
|
323
303
|
if (diff.headers) {
|
|
324
304
|
messageParts.push("Headers:");
|
|
325
305
|
const stringifiedExpected = stringifyValueToLog(diff.headers.expected);
|
|
326
306
|
const stringifiedReceived = stringifyValueToLog(diff.headers.received);
|
|
327
|
-
messageParts.push(` ${
|
|
328
|
-
messageParts.push(` ${
|
|
307
|
+
messageParts.push(` ${chalk2__default.default.green(`- ${stringifiedExpected}`)}`);
|
|
308
|
+
messageParts.push(` ${chalk2__default.default.red(`+ ${stringifiedReceived}`)}`);
|
|
329
309
|
}
|
|
330
310
|
if (diff.searchParams) {
|
|
331
311
|
messageParts.push("Search params:");
|
|
332
312
|
const stringifiedExpected = stringifyValueToLog(diff.searchParams.expected);
|
|
333
313
|
const stringifiedReceived = stringifyValueToLog(diff.searchParams.received);
|
|
334
|
-
messageParts.push(` ${
|
|
335
|
-
messageParts.push(` ${
|
|
314
|
+
messageParts.push(` ${chalk2__default.default.green(`- ${stringifiedExpected}`)}`);
|
|
315
|
+
messageParts.push(` ${chalk2__default.default.red(`+ ${stringifiedReceived}`)}`);
|
|
336
316
|
}
|
|
337
317
|
if (diff.body) {
|
|
338
318
|
messageParts.push("Body:");
|
|
@@ -342,8 +322,8 @@ function createMessageDiffs({ requestSaving, unmatchedRequestGroups }) {
|
|
|
342
322
|
const stringifiedReceived = stringifyValueToLog(diff.body.received, {
|
|
343
323
|
includeClassName: { searchParams: true }
|
|
344
324
|
});
|
|
345
|
-
messageParts.push(` ${
|
|
346
|
-
messageParts.push(` ${
|
|
325
|
+
messageParts.push(` ${chalk2__default.default.green(`- ${stringifiedExpected}`)}`);
|
|
326
|
+
messageParts.push(` ${chalk2__default.default.red(`+ ${stringifiedReceived}`)}`);
|
|
347
327
|
}
|
|
348
328
|
return messageParts.join("\n ");
|
|
349
329
|
}).join("\n\n");
|
|
@@ -523,7 +503,7 @@ var HttpRequestHandlerClient = class {
|
|
|
523
503
|
newThis.createResponseDeclaration = this.isResponseDeclarationFactory(declaration) ? declaration : () => declaration;
|
|
524
504
|
newThis.numberOfMatchedRequests = 0;
|
|
525
505
|
newThis.unmatchedRequestGroups.length = 0;
|
|
526
|
-
newThis.
|
|
506
|
+
newThis._requests.length = 0;
|
|
527
507
|
this.interceptor.registerRequestHandler(this.handler);
|
|
528
508
|
return newThis;
|
|
529
509
|
}
|
|
@@ -547,7 +527,7 @@ var HttpRequestHandlerClient = class {
|
|
|
547
527
|
declarationPointer: this.timesDeclarationPointer,
|
|
548
528
|
unmatchedRequestGroups: this.unmatchedRequestGroups,
|
|
549
529
|
hasRestrictions: this.restrictions.length > 0,
|
|
550
|
-
|
|
530
|
+
hasSavedRequests: this.interceptor.saveRequests
|
|
551
531
|
});
|
|
552
532
|
}
|
|
553
533
|
}
|
|
@@ -559,7 +539,7 @@ var HttpRequestHandlerClient = class {
|
|
|
559
539
|
this.timesDeclarationPointer = void 0;
|
|
560
540
|
this.numberOfMatchedRequests = 0;
|
|
561
541
|
this.unmatchedRequestGroups.length = 0;
|
|
562
|
-
this.
|
|
542
|
+
this._requests.length = 0;
|
|
563
543
|
this.createResponseDeclaration = void 0;
|
|
564
544
|
return this;
|
|
565
545
|
}
|
|
@@ -572,7 +552,7 @@ var HttpRequestHandlerClient = class {
|
|
|
572
552
|
if (restrictionsMatch.value) {
|
|
573
553
|
this.numberOfMatchedRequests++;
|
|
574
554
|
} else {
|
|
575
|
-
const shouldSaveUnmatchedGroup = this.interceptor.
|
|
555
|
+
const shouldSaveUnmatchedGroup = this.interceptor.saveRequests && this.restrictions.length > 0 && this.timesDeclarationPointer !== void 0;
|
|
576
556
|
if (shouldSaveUnmatchedGroup) {
|
|
577
557
|
this.unmatchedRequestGroups.push({ request, diff: restrictionsMatch.diff });
|
|
578
558
|
}
|
|
@@ -706,11 +686,6 @@ var HttpRequestHandlerClient = class {
|
|
|
706
686
|
saveInterceptedRequest(request, response) {
|
|
707
687
|
const interceptedRequest = this.createInterceptedRequest(request, response);
|
|
708
688
|
this._requests.push(interceptedRequest);
|
|
709
|
-
this.interceptor.incrementNumberOfSavedRequests(1);
|
|
710
|
-
}
|
|
711
|
-
clearInterceptedRequests() {
|
|
712
|
-
this.interceptor.incrementNumberOfSavedRequests(-this._requests.length);
|
|
713
|
-
this._requests.length = 0;
|
|
714
689
|
}
|
|
715
690
|
createInterceptedRequest(request, response) {
|
|
716
691
|
const interceptedRequest = request;
|
|
@@ -723,7 +698,7 @@ var HttpRequestHandlerClient = class {
|
|
|
723
698
|
return interceptedRequest;
|
|
724
699
|
}
|
|
725
700
|
get requests() {
|
|
726
|
-
if (!this.interceptor.
|
|
701
|
+
if (!this.interceptor.saveRequests) {
|
|
727
702
|
throw new DisabledRequestSavingError_default();
|
|
728
703
|
}
|
|
729
704
|
return this._requests;
|
|
@@ -1204,7 +1179,7 @@ var HttpInterceptorWorker = class _HttpInterceptorWorker {
|
|
|
1204
1179
|
]);
|
|
1205
1180
|
logWithPrefix(
|
|
1206
1181
|
[
|
|
1207
|
-
`${action === "bypass" ? "Warning:" : "Error:"} Request was not handled and was ${action === "bypass" ?
|
|
1182
|
+
`${action === "bypass" ? "Warning:" : "Error:"} Request was not handled and was ${action === "bypass" ? chalk2__default.default.yellow("bypassed") : chalk2__default.default.red("rejected")}.
|
|
1208
1183
|
|
|
1209
1184
|
`,
|
|
1210
1185
|
`${request.method} ${request.url}`,
|
|
@@ -1511,7 +1486,6 @@ var RemoteHttpRequestHandler_default = RemoteHttpRequestHandler;
|
|
|
1511
1486
|
|
|
1512
1487
|
// src/http/interceptor/HttpInterceptorClient.ts
|
|
1513
1488
|
var SUPPORTED_BASE_URL_PROTOCOLS = Object.freeze(["http", "https"]);
|
|
1514
|
-
var DEFAULT_REQUEST_SAVING_SAFE_LIMIT = 1e3;
|
|
1515
1489
|
var HttpInterceptorClient = class {
|
|
1516
1490
|
static {
|
|
1517
1491
|
__name(this, "HttpInterceptorClient");
|
|
@@ -1519,8 +1493,7 @@ var HttpInterceptorClient = class {
|
|
|
1519
1493
|
worker;
|
|
1520
1494
|
store;
|
|
1521
1495
|
_baseURL;
|
|
1522
|
-
|
|
1523
|
-
numberOfSavedRequests = 0;
|
|
1496
|
+
_saveRequests;
|
|
1524
1497
|
onUnhandledRequest;
|
|
1525
1498
|
isRunning = false;
|
|
1526
1499
|
Handler;
|
|
@@ -1537,16 +1510,10 @@ var HttpInterceptorClient = class {
|
|
|
1537
1510
|
this.worker = options.worker;
|
|
1538
1511
|
this.store = options.store;
|
|
1539
1512
|
this.baseURL = options.baseURL;
|
|
1540
|
-
this.
|
|
1541
|
-
enabled: options.requestSaving?.enabled ?? this.getDefaultRequestSavingEnabled(),
|
|
1542
|
-
safeLimit: options.requestSaving?.safeLimit ?? DEFAULT_REQUEST_SAVING_SAFE_LIMIT
|
|
1543
|
-
};
|
|
1513
|
+
this._saveRequests = options.saveRequests;
|
|
1544
1514
|
this.onUnhandledRequest = options.onUnhandledRequest;
|
|
1545
1515
|
this.Handler = options.Handler;
|
|
1546
1516
|
}
|
|
1547
|
-
getDefaultRequestSavingEnabled() {
|
|
1548
|
-
return isServerSide() ? process.env.NODE_ENV === "test" : false;
|
|
1549
|
-
}
|
|
1550
1517
|
get baseURL() {
|
|
1551
1518
|
return this._baseURL;
|
|
1552
1519
|
}
|
|
@@ -1566,6 +1533,15 @@ var HttpInterceptorClient = class {
|
|
|
1566
1533
|
}
|
|
1567
1534
|
return this.baseURL.href;
|
|
1568
1535
|
}
|
|
1536
|
+
get saveRequests() {
|
|
1537
|
+
if (this._saveRequests === void 0) {
|
|
1538
|
+
return isServerSide() ? process.env.NODE_ENV === "test" : false;
|
|
1539
|
+
}
|
|
1540
|
+
return this._saveRequests;
|
|
1541
|
+
}
|
|
1542
|
+
set saveRequests(saveRequests) {
|
|
1543
|
+
this._saveRequests = saveRequests;
|
|
1544
|
+
}
|
|
1569
1545
|
get platform() {
|
|
1570
1546
|
return this.worker.platform;
|
|
1571
1547
|
}
|
|
@@ -1663,21 +1639,13 @@ var HttpInterceptorClient = class {
|
|
|
1663
1639
|
}
|
|
1664
1640
|
const responseDeclaration = await matchedHandler.applyResponseDeclaration(parsedRequest);
|
|
1665
1641
|
const response = HttpInterceptorWorker_default.createResponseFromDeclaration(request, responseDeclaration);
|
|
1666
|
-
if (this.
|
|
1642
|
+
if (this.saveRequests) {
|
|
1667
1643
|
const responseClone = response.clone();
|
|
1668
1644
|
const parsedResponse = await HttpInterceptorWorker_default.parseRawResponse(responseClone);
|
|
1669
1645
|
matchedHandler.saveInterceptedRequest(parsedRequest, parsedResponse);
|
|
1670
1646
|
}
|
|
1671
1647
|
return response;
|
|
1672
1648
|
}
|
|
1673
|
-
incrementNumberOfSavedRequests(increment) {
|
|
1674
|
-
this.numberOfSavedRequests = Math.max(this.numberOfSavedRequests + increment, 0);
|
|
1675
|
-
const exceedsSafeLimit = this.numberOfSavedRequests > this.requestSaving.safeLimit;
|
|
1676
|
-
if (increment > 0 && exceedsSafeLimit) {
|
|
1677
|
-
const error = new RequestSavingSafeLimitExceededError_default(this.numberOfSavedRequests, this.requestSaving.safeLimit);
|
|
1678
|
-
console.warn(error);
|
|
1679
|
-
}
|
|
1680
|
-
}
|
|
1681
1649
|
async findMatchedHandler(method, path, parsedRequest) {
|
|
1682
1650
|
const handlersByPath = this.handlerClientsByMethod[method].get(path) ?? [];
|
|
1683
1651
|
for (let handlerIndex = handlersByPath.length - 1; handlerIndex >= 0; handlerIndex--) {
|
|
@@ -2426,7 +2394,7 @@ var LocalHttpInterceptor = class {
|
|
|
2426
2394
|
baseURL,
|
|
2427
2395
|
Handler: LocalHttpRequestHandler_default,
|
|
2428
2396
|
onUnhandledRequest: options.onUnhandledRequest,
|
|
2429
|
-
|
|
2397
|
+
saveRequests: options.saveRequests
|
|
2430
2398
|
});
|
|
2431
2399
|
}
|
|
2432
2400
|
get type() {
|
|
@@ -2438,11 +2406,11 @@ var LocalHttpInterceptor = class {
|
|
|
2438
2406
|
set baseURL(baseURL) {
|
|
2439
2407
|
this.client.baseURL = new URL(baseURL);
|
|
2440
2408
|
}
|
|
2441
|
-
get
|
|
2442
|
-
return this.client.
|
|
2409
|
+
get saveRequests() {
|
|
2410
|
+
return this.client.saveRequests;
|
|
2443
2411
|
}
|
|
2444
|
-
set
|
|
2445
|
-
this.client.
|
|
2412
|
+
set saveRequests(saveRequests) {
|
|
2413
|
+
this.client.saveRequests = saveRequests;
|
|
2446
2414
|
}
|
|
2447
2415
|
get onUnhandledRequest() {
|
|
2448
2416
|
return this.client.onUnhandledRequest;
|
|
@@ -2516,7 +2484,7 @@ var RemoteHttpInterceptor = class {
|
|
|
2516
2484
|
baseURL,
|
|
2517
2485
|
Handler: RemoteHttpRequestHandler_default,
|
|
2518
2486
|
onUnhandledRequest: options.onUnhandledRequest,
|
|
2519
|
-
|
|
2487
|
+
saveRequests: options.saveRequests
|
|
2520
2488
|
});
|
|
2521
2489
|
}
|
|
2522
2490
|
get type() {
|
|
@@ -2528,11 +2496,11 @@ var RemoteHttpInterceptor = class {
|
|
|
2528
2496
|
set baseURL(baseURL) {
|
|
2529
2497
|
this.client.baseURL = new URL(baseURL);
|
|
2530
2498
|
}
|
|
2531
|
-
get
|
|
2532
|
-
return this.client.
|
|
2499
|
+
get saveRequests() {
|
|
2500
|
+
return this.client.saveRequests;
|
|
2533
2501
|
}
|
|
2534
|
-
set
|
|
2535
|
-
this.client.
|
|
2502
|
+
set saveRequests(saveRequests) {
|
|
2503
|
+
this.client.saveRequests = saveRequests;
|
|
2536
2504
|
}
|
|
2537
2505
|
get onUnhandledRequest() {
|
|
2538
2506
|
return this.client.onUnhandledRequest;
|
|
@@ -2639,7 +2607,6 @@ exports.DisabledRequestSavingError = DisabledRequestSavingError_default;
|
|
|
2639
2607
|
exports.InvalidFormDataError = InvalidFormDataError_default;
|
|
2640
2608
|
exports.InvalidJSONError = InvalidJSONError_default;
|
|
2641
2609
|
exports.NotRunningHttpInterceptorError = NotRunningHttpInterceptorError_default;
|
|
2642
|
-
exports.RequestSavingSafeLimitExceededError = RequestSavingSafeLimitExceededError_default;
|
|
2643
2610
|
exports.RunningHttpInterceptorError = RunningHttpInterceptorError_default;
|
|
2644
2611
|
exports.TimesCheckError = TimesCheckError_default;
|
|
2645
2612
|
exports.UnknownHttpInterceptorPlatformError = UnknownHttpInterceptorPlatformError_default;
|