@insforge/sdk 1.2.8-dev.1 → 1.2.8-dev.2
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.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -325,7 +325,10 @@ var TokenManager = class {
|
|
|
325
325
|
// src/lib/http-client.ts
|
|
326
326
|
var RETRYABLE_STATUS_CODES = /* @__PURE__ */ new Set([500, 502, 503, 504]);
|
|
327
327
|
var IDEMPOTENT_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD", "PUT", "DELETE", "OPTIONS"]);
|
|
328
|
-
var
|
|
328
|
+
var REFRESHABLE_AUTH_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
329
|
+
"AUTH_UNAUTHORIZED",
|
|
330
|
+
"PGRST301"
|
|
331
|
+
]);
|
|
329
332
|
function serializeBody(method, body, headers) {
|
|
330
333
|
if (body === void 0) return void 0;
|
|
331
334
|
if (method === "GET" || method === "HEAD") return void 0;
|
|
@@ -435,7 +438,7 @@ var HttpClient = class {
|
|
|
435
438
|
return Math.round(jitter);
|
|
436
439
|
}
|
|
437
440
|
shouldRefreshAccessToken(statusCode, errorCode, authToken, options = {}) {
|
|
438
|
-
return statusCode === 401 && errorCode
|
|
441
|
+
return statusCode === 401 && REFRESHABLE_AUTH_ERROR_CODES.has(errorCode ?? "") && !this.config.isServerMode && !this.config.edgeFunctionToken && !options.skipAuthRefresh && authToken !== null;
|
|
439
442
|
}
|
|
440
443
|
async fetchWithRetry(args) {
|
|
441
444
|
const {
|