@namiml/sdk-core 3.4.3-dev.202606110413 → 3.4.3-dev.202606110638
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.cjs +9 -3
- package/dist/index.mjs +9 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -98,7 +98,7 @@ const {
|
|
|
98
98
|
// version — stamped by scripts/version.sh
|
|
99
99
|
NAMI_SDK_VERSION: exports.NAMI_SDK_VERSION = "3.4.3",
|
|
100
100
|
// full package version including dev suffix — stamped by scripts/version.sh
|
|
101
|
-
NAMI_SDK_PACKAGE_VERSION: exports.NAMI_SDK_PACKAGE_VERSION = "3.4.3-dev.
|
|
101
|
+
NAMI_SDK_PACKAGE_VERSION: exports.NAMI_SDK_PACKAGE_VERSION = "3.4.3-dev.202606110638",
|
|
102
102
|
// environments
|
|
103
103
|
PRODUCTION: exports.PRODUCTION = "production", DEVELOPMENT: exports.DEVELOPMENT = "development",
|
|
104
104
|
// error messages
|
|
@@ -8348,7 +8348,13 @@ const DEFAULTS = {
|
|
|
8348
8348
|
maxAttempts: 3,
|
|
8349
8349
|
baseDelayMs: 200,
|
|
8350
8350
|
maxDelayMs: 2000,
|
|
8351
|
-
|
|
8351
|
+
// timeoutMs per-request: 5s is appropriate for small CDN JSON blobs and
|
|
8352
|
+
// allows retries to fire before the overall budget expires.
|
|
8353
|
+
timeoutMs: 5000,
|
|
8354
|
+
// budgetMs must exceed timeoutMs × maxAttempts + max backoff to allow all
|
|
8355
|
+
// retry attempts to complete. With 3 × 5s + ~4s backoff ≈ 19s; 20s gives
|
|
8356
|
+
// a round number with a small margin.
|
|
8357
|
+
budgetMs: 20000,
|
|
8352
8358
|
};
|
|
8353
8359
|
const TRANSIENT_STATUSES = new Set([408, 425, 429]);
|
|
8354
8360
|
const TRANSIENT_ERROR_CODES = new Set(["ECONNRESET", "ECONNREFUSED", "ENOTFOUND", "ETIMEDOUT"]);
|
|
@@ -8432,7 +8438,7 @@ async function fetchWithCdnRetry(url, opts = {}) {
|
|
|
8432
8438
|
const baseDelayMs = opts.baseDelayMs ?? DEFAULTS.baseDelayMs;
|
|
8433
8439
|
const maxDelayMs = opts.maxDelayMs ?? DEFAULTS.maxDelayMs;
|
|
8434
8440
|
const budgetMs = opts.budgetMs ?? DEFAULTS.budgetMs;
|
|
8435
|
-
const timeoutMs = opts.timeoutMs ??
|
|
8441
|
+
const timeoutMs = opts.timeoutMs ?? DEFAULTS.timeoutMs;
|
|
8436
8442
|
const randomFn = opts.randomFn ?? Math.random;
|
|
8437
8443
|
const sleepFn = opts.sleepFn ?? defaultSleep;
|
|
8438
8444
|
const logRequests = shouldLogHTTPRequests();
|
package/dist/index.mjs
CHANGED
|
@@ -96,7 +96,7 @@ const {
|
|
|
96
96
|
// version — stamped by scripts/version.sh
|
|
97
97
|
NAMI_SDK_VERSION = "3.4.3",
|
|
98
98
|
// full package version including dev suffix — stamped by scripts/version.sh
|
|
99
|
-
NAMI_SDK_PACKAGE_VERSION = "3.4.3-dev.
|
|
99
|
+
NAMI_SDK_PACKAGE_VERSION = "3.4.3-dev.202606110638",
|
|
100
100
|
// environments
|
|
101
101
|
PRODUCTION = "production", DEVELOPMENT = "development",
|
|
102
102
|
// error messages
|
|
@@ -8346,7 +8346,13 @@ const DEFAULTS = {
|
|
|
8346
8346
|
maxAttempts: 3,
|
|
8347
8347
|
baseDelayMs: 200,
|
|
8348
8348
|
maxDelayMs: 2000,
|
|
8349
|
-
|
|
8349
|
+
// timeoutMs per-request: 5s is appropriate for small CDN JSON blobs and
|
|
8350
|
+
// allows retries to fire before the overall budget expires.
|
|
8351
|
+
timeoutMs: 5000,
|
|
8352
|
+
// budgetMs must exceed timeoutMs × maxAttempts + max backoff to allow all
|
|
8353
|
+
// retry attempts to complete. With 3 × 5s + ~4s backoff ≈ 19s; 20s gives
|
|
8354
|
+
// a round number with a small margin.
|
|
8355
|
+
budgetMs: 20000,
|
|
8350
8356
|
};
|
|
8351
8357
|
const TRANSIENT_STATUSES = new Set([408, 425, 429]);
|
|
8352
8358
|
const TRANSIENT_ERROR_CODES = new Set(["ECONNRESET", "ECONNREFUSED", "ENOTFOUND", "ETIMEDOUT"]);
|
|
@@ -8430,7 +8436,7 @@ async function fetchWithCdnRetry(url, opts = {}) {
|
|
|
8430
8436
|
const baseDelayMs = opts.baseDelayMs ?? DEFAULTS.baseDelayMs;
|
|
8431
8437
|
const maxDelayMs = opts.maxDelayMs ?? DEFAULTS.maxDelayMs;
|
|
8432
8438
|
const budgetMs = opts.budgetMs ?? DEFAULTS.budgetMs;
|
|
8433
|
-
const timeoutMs = opts.timeoutMs ??
|
|
8439
|
+
const timeoutMs = opts.timeoutMs ?? DEFAULTS.timeoutMs;
|
|
8434
8440
|
const randomFn = opts.randomFn ?? Math.random;
|
|
8435
8441
|
const sleepFn = opts.sleepFn ?? defaultSleep;
|
|
8436
8442
|
const logRequests = shouldLogHTTPRequests();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namiml/sdk-core",
|
|
3
|
-
"version": "3.4.3-dev.
|
|
3
|
+
"version": "3.4.3-dev.202606110638",
|
|
4
4
|
"description": "Platform-agnostic core for the Nami SDK — business logic, API, types, and state management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|