@squidcloud/client 1.0.182 → 1.0.183
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/cjs/index.js +9 -5
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -50371,7 +50371,6 @@ var external_axios_default = /*#__PURE__*/__webpack_require__.n(external_axios_n
|
|
|
50371
50371
|
|
|
50372
50372
|
|
|
50373
50373
|
|
|
50374
|
-
|
|
50375
50374
|
class RpcError extends Error {
|
|
50376
50375
|
/** @internal */
|
|
50377
50376
|
constructor(statusCode, statusText, url, headers, body, message) {
|
|
@@ -50383,15 +50382,20 @@ class RpcError extends Error {
|
|
|
50383
50382
|
this.body = body;
|
|
50384
50383
|
}
|
|
50385
50384
|
}
|
|
50385
|
+
function isFetchMode() {
|
|
50386
|
+
// Temporary (1 week) keep the old code to simplify rollback.
|
|
50387
|
+
return true;
|
|
50388
|
+
// Native fetch is used in json request mode or when the corresponding private Squid option is enabled.
|
|
50389
|
+
// This option is enabled in console-local and console-dev modes both in Web & Backend.
|
|
50390
|
+
// return files.length === 0 || !!getSquidPrivateOption(SQUID_PRIVATE_OPTION_USE_FETCH_IN_RPC_MANAGER);
|
|
50391
|
+
}
|
|
50386
50392
|
/**
|
|
50387
50393
|
* Runs a post request to the given URL.
|
|
50388
50394
|
* @internal.
|
|
50389
50395
|
*/
|
|
50390
50396
|
async function rawSquidHttpPost(input) {
|
|
50391
|
-
|
|
50392
|
-
|
|
50393
|
-
const isFetch = input.files.length === 0 || !!getSquidPrivateOption(SQUID_PRIVATE_OPTION_USE_FETCH_IN_RPC_MANAGER);
|
|
50394
|
-
const response = await (isFetch ? performFetchRequest(input) : await performAxiosRequest(input));
|
|
50397
|
+
const isFetch = isFetchMode();
|
|
50398
|
+
const response = await (isFetch ? performFetchRequest(input) : performAxiosRequest(input));
|
|
50395
50399
|
response.body = tryDeserializing(response.body);
|
|
50396
50400
|
return response;
|
|
50397
50401
|
}
|