@globalfishingwatch/api-client
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -249,3 +249,3 @@ /*! ***************************************************************************** | ||
e_2 = _f.sent(); | ||
if (!(refreshRetries < this.maxRefreshRetries)) return [3 /*break*/, 11]; | ||
if (!(refreshRetries <= this.maxRefreshRetries)) return [3 /*break*/, 11]; | ||
if (!(e_2.status === 401 || e_2.status === 403)) return [3 /*break*/, 10]; | ||
@@ -263,3 +263,3 @@ if (this.debug) { | ||
if (this.debug) { | ||
console.log("Token refresh worked! trying to fetch again " + url); | ||
console.log("GFWAPI: Token refresh worked! trying to fetch again " + url); | ||
} | ||
@@ -274,7 +274,7 @@ return [3 /*break*/, 10]; | ||
throw e_3; | ||
case 10: return [2 /*return*/, this._internalFetch(url, options, ++refreshRetries)]; | ||
case 10: return [2 /*return*/, this._internalFetch(url, options, ++refreshRetries, waitLogin)]; | ||
case 11: | ||
if (this.debug) { | ||
if (refreshRetries >= this.maxRefreshRetries) { | ||
console.log("GFWAPI: Attemps to retry the reuqest excedeed"); | ||
console.log("GFWAPI: Attemps to retry the request excedeed"); | ||
} | ||
@@ -281,0 +281,0 @@ console.warn("GFWAPI: Error fetching " + url, e_2); |
@@ -255,3 +255,3 @@ (function (global, factory) { | ||
e_2 = _f.sent(); | ||
if (!(refreshRetries < this.maxRefreshRetries)) return [3 /*break*/, 11]; | ||
if (!(refreshRetries <= this.maxRefreshRetries)) return [3 /*break*/, 11]; | ||
if (!(e_2.status === 401 || e_2.status === 403)) return [3 /*break*/, 10]; | ||
@@ -269,3 +269,3 @@ if (this.debug) { | ||
if (this.debug) { | ||
console.log("Token refresh worked! trying to fetch again " + url); | ||
console.log("GFWAPI: Token refresh worked! trying to fetch again " + url); | ||
} | ||
@@ -280,7 +280,7 @@ return [3 /*break*/, 10]; | ||
throw e_3; | ||
case 10: return [2 /*return*/, this._internalFetch(url, options, ++refreshRetries)]; | ||
case 10: return [2 /*return*/, this._internalFetch(url, options, ++refreshRetries, waitLogin)]; | ||
case 11: | ||
if (this.debug) { | ||
if (refreshRetries >= this.maxRefreshRetries) { | ||
console.log("GFWAPI: Attemps to retry the reuqest excedeed"); | ||
console.log("GFWAPI: Attemps to retry the request excedeed"); | ||
} | ||
@@ -287,0 +287,0 @@ console.warn("GFWAPI: Error fetching " + url, e_2); |
@@ -199,3 +199,3 @@ "use strict"; | ||
e_2 = _f.sent(); | ||
if (!(refreshRetries < this.maxRefreshRetries)) return [3 /*break*/, 11]; | ||
if (!(refreshRetries <= this.maxRefreshRetries)) return [3 /*break*/, 11]; | ||
if (!(e_2.status === 401 || e_2.status === 403)) return [3 /*break*/, 10]; | ||
@@ -213,3 +213,3 @@ if (this.debug) { | ||
if (this.debug) { | ||
console.log("Token refresh worked! trying to fetch again " + url); | ||
console.log("GFWAPI: Token refresh worked! trying to fetch again " + url); | ||
} | ||
@@ -224,7 +224,7 @@ return [3 /*break*/, 10]; | ||
throw e_3; | ||
case 10: return [2 /*return*/, this._internalFetch(url, options, ++refreshRetries)]; | ||
case 10: return [2 /*return*/, this._internalFetch(url, options, ++refreshRetries, waitLogin)]; | ||
case 11: | ||
if (this.debug) { | ||
if (refreshRetries >= this.maxRefreshRetries) { | ||
console.log("GFWAPI: Attemps to retry the reuqest excedeed"); | ||
console.log("GFWAPI: Attemps to retry the request excedeed"); | ||
} | ||
@@ -231,0 +231,0 @@ console.warn("GFWAPI: Error fetching " + url, e_2); |
{ | ||
"name": "@globalfishingwatch/api-client", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "js library to help with the login/logout and resources fetch of the GFW API", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
173811