@cinerino/sdk 3.124.0 → 3.124.1

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.
@@ -263,7 +263,7 @@ var OAuth2client = /** @class */ (function () {
263
263
  */
264
264
  OAuth2client.prototype.fetch = function (url, options, expectedStatusCodes) {
265
265
  return __awaiter(this, void 0, void 0, function () {
266
- var retry, result, numberOfTry, _a, _b, error_1, statusCode;
266
+ var retry, result, numberOfTry, _a, _b, error_1, statusCode, retryableStatusCodes;
267
267
  return __generator(this, function (_c) {
268
268
  switch (_c.label) {
269
269
  case 0:
@@ -293,7 +293,8 @@ var OAuth2client = /** @class */ (function () {
293
293
  error_1 = _c.sent();
294
294
  if (!(error_1 instanceof Error)) return [3 /*break*/, 8];
295
295
  statusCode = error_1.code;
296
- if (!(retry && (statusCode === http_status_1.UNAUTHORIZED || statusCode === http_status_1.FORBIDDEN))) return [3 /*break*/, 8];
296
+ retryableStatusCodes = [http_status_1.BAD_GATEWAY, http_status_1.FORBIDDEN, http_status_1.UNAUTHORIZED];
297
+ if (!(retry && retryableStatusCodes.includes(statusCode))) return [3 /*break*/, 8];
297
298
  if (!(typeof this.credentials.refresh_token === 'string' && this.credentials.refresh_token.length > 0)) return [3 /*break*/, 7];
298
299
  return [4 /*yield*/, this.refreshAccessToken()];
299
300
  case 6:
package/lib/bundle.js CHANGED
@@ -1206,7 +1206,7 @@ var OAuth2client = /** @class */ (function () {
1206
1206
  */
1207
1207
  OAuth2client.prototype.fetch = function (url, options, expectedStatusCodes) {
1208
1208
  return __awaiter(this, void 0, void 0, function () {
1209
- var retry, result, numberOfTry, _a, _b, error_1, statusCode;
1209
+ var retry, result, numberOfTry, _a, _b, error_1, statusCode, retryableStatusCodes;
1210
1210
  return __generator(this, function (_c) {
1211
1211
  switch (_c.label) {
1212
1212
  case 0:
@@ -1236,7 +1236,8 @@ var OAuth2client = /** @class */ (function () {
1236
1236
  error_1 = _c.sent();
1237
1237
  if (!(error_1 instanceof Error)) return [3 /*break*/, 8];
1238
1238
  statusCode = error_1.code;
1239
- if (!(retry && (statusCode === http_status_1.UNAUTHORIZED || statusCode === http_status_1.FORBIDDEN))) return [3 /*break*/, 8];
1239
+ retryableStatusCodes = [http_status_1.BAD_GATEWAY, http_status_1.FORBIDDEN, http_status_1.UNAUTHORIZED];
1240
+ if (!(retry && retryableStatusCodes.includes(statusCode))) return [3 /*break*/, 8];
1240
1241
  if (!(typeof this.credentials.refresh_token === 'string' && this.credentials.refresh_token.length > 0)) return [3 /*break*/, 7];
1241
1242
  return [4 /*yield*/, this.refreshAccessToken()];
1242
1243
  case 6:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "3.124.0",
3
+ "version": "3.124.1",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {