@dynamic-labs-wallet/browser 1.0.82 → 1.0.84
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/index.cjs +19 -10
- package/index.esm.js +19 -10
- package/package.json +3 -3
- package/src/utils.d.ts.map +1 -1
package/index.cjs
CHANGED
|
@@ -1326,15 +1326,20 @@ const getClientKeyShareBackupInfo = (params)=>{
|
|
|
1326
1326
|
const timeoutPromise = ({ timeInMs, activity = 'Ceremony' })=>{
|
|
1327
1327
|
return new Promise((_, reject)=>setTimeout(()=>reject(new Error(`${activity} did not complete in ${timeInMs}ms`)), timeInMs));
|
|
1328
1328
|
};
|
|
1329
|
-
const
|
|
1330
|
-
var _error_response, _error_response1;
|
|
1329
|
+
const buildAxiosErrorContext = (error)=>{
|
|
1330
|
+
var _error_response, _error_response1, _error_request, _error_config;
|
|
1331
|
+
var _error_response_status;
|
|
1331
1332
|
return {
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1333
|
+
axiosError: (_error_response = error.response) == null ? void 0 : _error_response.data,
|
|
1334
|
+
axiosStatus: (_error_response_status = (_error_response1 = error.response) == null ? void 0 : _error_response1.status) != null ? _error_response_status : (_error_request = error.request) == null ? void 0 : _error_request.status,
|
|
1335
|
+
axiosErrorCode: error.code,
|
|
1336
|
+
axiosUrl: (_error_config = error.config) == null ? void 0 : _error_config.url
|
|
1336
1337
|
};
|
|
1337
1338
|
};
|
|
1339
|
+
const buildErrorContext = (error)=>_extends({
|
|
1340
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
1341
|
+
errorStack: error instanceof Error ? error.stack : undefined
|
|
1342
|
+
}, error instanceof axios.AxiosError && buildAxiosErrorContext(error));
|
|
1338
1343
|
const logRetrySuccess = (operationName, attempts, logContext)=>{
|
|
1339
1344
|
core.Logger.info(`Successfully executed ${operationName} after ${attempts + 1} attempts`, _extends({}, logContext, {
|
|
1340
1345
|
attemptsTaken: attempts + 1
|
|
@@ -1366,6 +1371,7 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1366
1371
|
*/ async function retryPromise(operation, { maxAttempts = 5, retryInterval = 500, operationName = 'operation', logContext = {}, shouldRetry } = {}) {
|
|
1367
1372
|
let attempts = 0;
|
|
1368
1373
|
while(attempts < maxAttempts){
|
|
1374
|
+
const attemptStartMs = Date.now();
|
|
1369
1375
|
try {
|
|
1370
1376
|
const result = await operation();
|
|
1371
1377
|
if (attempts > 0) {
|
|
@@ -1376,9 +1382,12 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1376
1382
|
attempts++;
|
|
1377
1383
|
const errorContext = buildErrorContext(error);
|
|
1378
1384
|
const isNonRetryable = (error == null ? void 0 : error.isRetryable) === false;
|
|
1379
|
-
|
|
1385
|
+
const attemptLogContext = _extends({}, logContext, {
|
|
1386
|
+
requestDurationMs: Date.now() - attemptStartMs
|
|
1387
|
+
});
|
|
1388
|
+
logRetryFailure(operationName, attempts, maxAttempts, errorContext, attemptLogContext, isNonRetryable);
|
|
1380
1389
|
if (isNonRetryable) {
|
|
1381
|
-
core.Logger.debug(`Skipping retry for ${operationName}: error marked non-retryable`, _extends({},
|
|
1390
|
+
core.Logger.debug(`Skipping retry for ${operationName}: error marked non-retryable`, _extends({}, attemptLogContext, errorContext));
|
|
1382
1391
|
throw error;
|
|
1383
1392
|
}
|
|
1384
1393
|
if (shouldRetry) {
|
|
@@ -1386,7 +1395,7 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1386
1395
|
try {
|
|
1387
1396
|
allow = await shouldRetry(error, attempts);
|
|
1388
1397
|
} catch (predicateError) {
|
|
1389
|
-
core.Logger.warn(`shouldRetry predicate failed for ${operationName}, surfacing original error`, _extends({},
|
|
1398
|
+
core.Logger.warn(`shouldRetry predicate failed for ${operationName}, surfacing original error`, _extends({}, attemptLogContext, errorContext, {
|
|
1390
1399
|
predicateError: predicateError instanceof Error ? predicateError.message : 'Unknown error'
|
|
1391
1400
|
}));
|
|
1392
1401
|
}
|
|
@@ -1395,7 +1404,7 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1395
1404
|
}
|
|
1396
1405
|
}
|
|
1397
1406
|
if (attempts === maxAttempts) {
|
|
1398
|
-
logRetryExhausted(operationName, maxAttempts, errorContext,
|
|
1407
|
+
logRetryExhausted(operationName, maxAttempts, errorContext, attemptLogContext);
|
|
1399
1408
|
throw error;
|
|
1400
1409
|
}
|
|
1401
1410
|
const exponentialDelay = retryInterval * 2 ** (attempts - 1);
|
package/index.esm.js
CHANGED
|
@@ -1327,15 +1327,20 @@ const getClientKeyShareBackupInfo = (params)=>{
|
|
|
1327
1327
|
const timeoutPromise = ({ timeInMs, activity = 'Ceremony' })=>{
|
|
1328
1328
|
return new Promise((_, reject)=>setTimeout(()=>reject(new Error(`${activity} did not complete in ${timeInMs}ms`)), timeInMs));
|
|
1329
1329
|
};
|
|
1330
|
-
const
|
|
1331
|
-
var _error_response, _error_response1;
|
|
1330
|
+
const buildAxiosErrorContext = (error)=>{
|
|
1331
|
+
var _error_response, _error_response1, _error_request, _error_config;
|
|
1332
|
+
var _error_response_status;
|
|
1332
1333
|
return {
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1334
|
+
axiosError: (_error_response = error.response) == null ? void 0 : _error_response.data,
|
|
1335
|
+
axiosStatus: (_error_response_status = (_error_response1 = error.response) == null ? void 0 : _error_response1.status) != null ? _error_response_status : (_error_request = error.request) == null ? void 0 : _error_request.status,
|
|
1336
|
+
axiosErrorCode: error.code,
|
|
1337
|
+
axiosUrl: (_error_config = error.config) == null ? void 0 : _error_config.url
|
|
1337
1338
|
};
|
|
1338
1339
|
};
|
|
1340
|
+
const buildErrorContext = (error)=>_extends({
|
|
1341
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
1342
|
+
errorStack: error instanceof Error ? error.stack : undefined
|
|
1343
|
+
}, error instanceof AxiosError && buildAxiosErrorContext(error));
|
|
1339
1344
|
const logRetrySuccess = (operationName, attempts, logContext)=>{
|
|
1340
1345
|
Logger.info(`Successfully executed ${operationName} after ${attempts + 1} attempts`, _extends({}, logContext, {
|
|
1341
1346
|
attemptsTaken: attempts + 1
|
|
@@ -1367,6 +1372,7 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1367
1372
|
*/ async function retryPromise(operation, { maxAttempts = 5, retryInterval = 500, operationName = 'operation', logContext = {}, shouldRetry } = {}) {
|
|
1368
1373
|
let attempts = 0;
|
|
1369
1374
|
while(attempts < maxAttempts){
|
|
1375
|
+
const attemptStartMs = Date.now();
|
|
1370
1376
|
try {
|
|
1371
1377
|
const result = await operation();
|
|
1372
1378
|
if (attempts > 0) {
|
|
@@ -1377,9 +1383,12 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1377
1383
|
attempts++;
|
|
1378
1384
|
const errorContext = buildErrorContext(error);
|
|
1379
1385
|
const isNonRetryable = (error == null ? void 0 : error.isRetryable) === false;
|
|
1380
|
-
|
|
1386
|
+
const attemptLogContext = _extends({}, logContext, {
|
|
1387
|
+
requestDurationMs: Date.now() - attemptStartMs
|
|
1388
|
+
});
|
|
1389
|
+
logRetryFailure(operationName, attempts, maxAttempts, errorContext, attemptLogContext, isNonRetryable);
|
|
1381
1390
|
if (isNonRetryable) {
|
|
1382
|
-
Logger.debug(`Skipping retry for ${operationName}: error marked non-retryable`, _extends({},
|
|
1391
|
+
Logger.debug(`Skipping retry for ${operationName}: error marked non-retryable`, _extends({}, attemptLogContext, errorContext));
|
|
1383
1392
|
throw error;
|
|
1384
1393
|
}
|
|
1385
1394
|
if (shouldRetry) {
|
|
@@ -1387,7 +1396,7 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1387
1396
|
try {
|
|
1388
1397
|
allow = await shouldRetry(error, attempts);
|
|
1389
1398
|
} catch (predicateError) {
|
|
1390
|
-
Logger.warn(`shouldRetry predicate failed for ${operationName}, surfacing original error`, _extends({},
|
|
1399
|
+
Logger.warn(`shouldRetry predicate failed for ${operationName}, surfacing original error`, _extends({}, attemptLogContext, errorContext, {
|
|
1391
1400
|
predicateError: predicateError instanceof Error ? predicateError.message : 'Unknown error'
|
|
1392
1401
|
}));
|
|
1393
1402
|
}
|
|
@@ -1396,7 +1405,7 @@ const logRetryExhausted = (operationName, maxAttempts, errorContext, logContext)
|
|
|
1396
1405
|
}
|
|
1397
1406
|
}
|
|
1398
1407
|
if (attempts === maxAttempts) {
|
|
1399
|
-
logRetryExhausted(operationName, maxAttempts, errorContext,
|
|
1408
|
+
logRetryExhausted(operationName, maxAttempts, errorContext, attemptLogContext);
|
|
1400
1409
|
throw error;
|
|
1401
1410
|
}
|
|
1402
1411
|
const exponentialDelay = retryInterval * 2 ** (attempts - 1);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.84",
|
|
4
4
|
"license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/core": "1.0.
|
|
7
|
+
"@dynamic-labs-wallet/core": "1.0.84",
|
|
8
8
|
"@dynamic-labs-wallet/forward-mpc-client": "1.0.1",
|
|
9
|
-
"@dynamic-labs-wallet/primitives": "1.0.
|
|
9
|
+
"@dynamic-labs-wallet/primitives": "1.0.84",
|
|
10
10
|
"@dynamic-labs/sdk-api-core": "^0.0.1083",
|
|
11
11
|
"argon2id": "1.0.1",
|
|
12
12
|
"axios": "1.16.0",
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/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