@hyper-fetch/core 5.1.2 → 5.3.0
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/dist/browser/index.cjs.js +15 -3
- package/dist/browser/index.cjs.js.map +2 -2
- package/dist/browser/index.esm.js +15 -3
- package/dist/browser/index.esm.js.map +2 -2
- package/dist/index.cjs.js +15 -3
- package/dist/index.cjs.js.map +2 -2
- package/dist/index.d.ts +7 -1
- package/dist/index.esm.js +15 -3
- package/dist/index.esm.js.map +2 -2
- package/package.json +1 -1
- package/src/adapter/adapter.bindings.ts +10 -1
- package/src/client/client.constants.ts +1 -1
- package/src/client/client.ts +12 -1
|
@@ -1429,7 +1429,7 @@ var getAdapterBindings = (req, requestId, systemErrorStatus, systemErrorExtra) =
|
|
|
1429
1429
|
if (processingError) {
|
|
1430
1430
|
return onError(processingError, systemErrorStatus, systemErrorExtra, () => null);
|
|
1431
1431
|
}
|
|
1432
|
-
if (req.mock && req.isMockEnabled) {
|
|
1432
|
+
if (req.mock && req.isMockEnabled && req.client.isMockEnabled) {
|
|
1433
1433
|
return mocker(request, {
|
|
1434
1434
|
onError,
|
|
1435
1435
|
onResponseEnd,
|
|
@@ -1446,6 +1446,13 @@ var getAdapterBindings = (req, requestId, systemErrorStatus, systemErrorExtra) =
|
|
|
1446
1446
|
}
|
|
1447
1447
|
return new Promise(apiCall);
|
|
1448
1448
|
};
|
|
1449
|
+
logger2.debug(`Finishing request bindings creation`, {
|
|
1450
|
+
fullUrl,
|
|
1451
|
+
data,
|
|
1452
|
+
headers,
|
|
1453
|
+
payload,
|
|
1454
|
+
config
|
|
1455
|
+
});
|
|
1449
1456
|
return {
|
|
1450
1457
|
fullUrl,
|
|
1451
1458
|
data,
|
|
@@ -2219,10 +2226,11 @@ var Client = class {
|
|
|
2219
2226
|
this.loggerManager = new LoggerManager(this);
|
|
2220
2227
|
this.defaultMethod = "GET" /* get */;
|
|
2221
2228
|
this.defaultExtra = xhrExtra;
|
|
2229
|
+
this.isMockEnabled = true;
|
|
2222
2230
|
this.effects = [];
|
|
2223
2231
|
this.abortKeyMapper = getSimpleKey;
|
|
2224
2232
|
this.cacheKeyMapper = getRequestKey;
|
|
2225
|
-
this.queueKeyMapper =
|
|
2233
|
+
this.queueKeyMapper = getRequestKey;
|
|
2226
2234
|
this.effectKeyMapper = getSimpleKey;
|
|
2227
2235
|
this.stringifyQueryParams = (queryParams) => stringifyQueryParams(queryParams, this.queryParamsConfig);
|
|
2228
2236
|
this.headerMapper = getAdapterHeaders;
|
|
@@ -2265,6 +2273,10 @@ var Client = class {
|
|
|
2265
2273
|
this.payloadMapper = payloadMapper;
|
|
2266
2274
|
return this;
|
|
2267
2275
|
};
|
|
2276
|
+
this.setEnableGlobalMocking = (isMockEnabled) => {
|
|
2277
|
+
this.isMockEnabled = isMockEnabled;
|
|
2278
|
+
return this;
|
|
2279
|
+
};
|
|
2268
2280
|
this.setEndpointMapper = (endpointMapper) => {
|
|
2269
2281
|
this.endpointMapper = endpointMapper;
|
|
2270
2282
|
return this;
|
|
@@ -2380,7 +2392,7 @@ var stringifyDefaultOptions = {
|
|
|
2380
2392
|
strict: true,
|
|
2381
2393
|
encode: true,
|
|
2382
2394
|
arrayFormat: "bracket",
|
|
2383
|
-
arraySeparator: "",
|
|
2395
|
+
arraySeparator: "bracket",
|
|
2384
2396
|
sort: false,
|
|
2385
2397
|
skipNull: true,
|
|
2386
2398
|
skipEmptyString: true
|