@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/index.cjs.js CHANGED
@@ -1508,7 +1508,7 @@ var getAdapterBindings = (req, requestId, systemErrorStatus, systemErrorExtra) =
1508
1508
  if (processingError) {
1509
1509
  return onError(processingError, systemErrorStatus, systemErrorExtra, () => null);
1510
1510
  }
1511
- if (req.mock && req.isMockEnabled) {
1511
+ if (req.mock && req.isMockEnabled && req.client.isMockEnabled) {
1512
1512
  return mocker(request, {
1513
1513
  onError,
1514
1514
  onResponseEnd,
@@ -1525,6 +1525,13 @@ var getAdapterBindings = (req, requestId, systemErrorStatus, systemErrorExtra) =
1525
1525
  }
1526
1526
  return new Promise(apiCall);
1527
1527
  };
1528
+ logger2.debug(`Finishing request bindings creation`, {
1529
+ fullUrl,
1530
+ data,
1531
+ headers,
1532
+ payload,
1533
+ config
1534
+ });
1528
1535
  return {
1529
1536
  fullUrl,
1530
1537
  data,
@@ -2298,10 +2305,11 @@ var Client = class {
2298
2305
  this.loggerManager = new LoggerManager(this);
2299
2306
  this.defaultMethod = "GET" /* get */;
2300
2307
  this.defaultExtra = xhrExtra;
2308
+ this.isMockEnabled = true;
2301
2309
  this.effects = [];
2302
2310
  this.abortKeyMapper = getSimpleKey;
2303
2311
  this.cacheKeyMapper = getRequestKey;
2304
- this.queueKeyMapper = getSimpleKey;
2312
+ this.queueKeyMapper = getRequestKey;
2305
2313
  this.effectKeyMapper = getSimpleKey;
2306
2314
  this.stringifyQueryParams = (queryParams) => stringifyQueryParams(queryParams, this.queryParamsConfig);
2307
2315
  this.headerMapper = getAdapterHeaders;
@@ -2344,6 +2352,10 @@ var Client = class {
2344
2352
  this.payloadMapper = payloadMapper;
2345
2353
  return this;
2346
2354
  };
2355
+ this.setEnableGlobalMocking = (isMockEnabled) => {
2356
+ this.isMockEnabled = isMockEnabled;
2357
+ return this;
2358
+ };
2347
2359
  this.setEndpointMapper = (endpointMapper) => {
2348
2360
  this.endpointMapper = endpointMapper;
2349
2361
  return this;
@@ -2459,7 +2471,7 @@ var stringifyDefaultOptions = {
2459
2471
  strict: true,
2460
2472
  encode: true,
2461
2473
  arrayFormat: "bracket",
2462
- arraySeparator: "",
2474
+ arraySeparator: "bracket",
2463
2475
  sort: false,
2464
2476
  skipNull: true,
2465
2477
  skipEmptyString: true