@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.
@@ -1325,7 +1325,7 @@ var getAdapterBindings = (req, requestId, systemErrorStatus, systemErrorExtra) =
1325
1325
  if (processingError) {
1326
1326
  return onError(processingError, systemErrorStatus, systemErrorExtra, () => null);
1327
1327
  }
1328
- if (req.mock && req.isMockEnabled) {
1328
+ if (req.mock && req.isMockEnabled && req.client.isMockEnabled) {
1329
1329
  return mocker(request, {
1330
1330
  onError,
1331
1331
  onResponseEnd,
@@ -1342,6 +1342,13 @@ var getAdapterBindings = (req, requestId, systemErrorStatus, systemErrorExtra) =
1342
1342
  }
1343
1343
  return new Promise(apiCall);
1344
1344
  };
1345
+ logger2.debug(`Finishing request bindings creation`, {
1346
+ fullUrl,
1347
+ data,
1348
+ headers,
1349
+ payload,
1350
+ config
1351
+ });
1345
1352
  return {
1346
1353
  fullUrl,
1347
1354
  data,
@@ -2115,10 +2122,11 @@ var Client = class {
2115
2122
  this.loggerManager = new LoggerManager(this);
2116
2123
  this.defaultMethod = "GET" /* get */;
2117
2124
  this.defaultExtra = xhrExtra;
2125
+ this.isMockEnabled = true;
2118
2126
  this.effects = [];
2119
2127
  this.abortKeyMapper = getSimpleKey;
2120
2128
  this.cacheKeyMapper = getRequestKey;
2121
- this.queueKeyMapper = getSimpleKey;
2129
+ this.queueKeyMapper = getRequestKey;
2122
2130
  this.effectKeyMapper = getSimpleKey;
2123
2131
  this.stringifyQueryParams = (queryParams) => stringifyQueryParams(queryParams, this.queryParamsConfig);
2124
2132
  this.headerMapper = getAdapterHeaders;
@@ -2161,6 +2169,10 @@ var Client = class {
2161
2169
  this.payloadMapper = payloadMapper;
2162
2170
  return this;
2163
2171
  };
2172
+ this.setEnableGlobalMocking = (isMockEnabled) => {
2173
+ this.isMockEnabled = isMockEnabled;
2174
+ return this;
2175
+ };
2164
2176
  this.setEndpointMapper = (endpointMapper) => {
2165
2177
  this.endpointMapper = endpointMapper;
2166
2178
  return this;
@@ -2276,7 +2288,7 @@ var stringifyDefaultOptions = {
2276
2288
  strict: true,
2277
2289
  encode: true,
2278
2290
  arrayFormat: "bracket",
2279
- arraySeparator: "",
2291
+ arraySeparator: "bracket",
2280
2292
  sort: false,
2281
2293
  skipNull: true,
2282
2294
  skipEmptyString: true