@dynamic-labs-wallet/core 1.0.93 → 1.0.95
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
CHANGED
|
@@ -952,7 +952,7 @@ const getRequiredExternalKeyShareId = (ks)=>{
|
|
|
952
952
|
* before it is posted and surfaces in Datadog exactly as the recovery path does.
|
|
953
953
|
*/ const assertDynamicLocationsHaveExternalKeyShareId = (locations)=>locations.filter((location)=>location.location === BackupLocation.DYNAMIC).forEach((location)=>getRequiredExternalKeyShareId(location));
|
|
954
954
|
|
|
955
|
-
var version = "1.0.
|
|
955
|
+
var version = "1.0.95";
|
|
956
956
|
|
|
957
957
|
class BaseClient {
|
|
958
958
|
/**
|
|
@@ -2454,7 +2454,15 @@ const resolveStatusMessage = (status, error)=>{
|
|
|
2454
2454
|
}
|
|
2455
2455
|
return undefined;
|
|
2456
2456
|
};
|
|
2457
|
-
const handleAxiosError = (error, message, context,
|
|
2457
|
+
const handleAxiosError = (error, message, context, /**
|
|
2458
|
+
* Optional severity hint from the caller, for failures the caller knows are
|
|
2459
|
+
* expected (e.g. a business-rule rejection). It can only *lower* severity to
|
|
2460
|
+
* `warn` — a caller must not be able to escalate, and a genuine 5xx has to
|
|
2461
|
+
* stay at `error` regardless of what the call site believes.
|
|
2462
|
+
*
|
|
2463
|
+
* Without this the hint that `logError` accepts was silently discarded for
|
|
2464
|
+
* every AxiosError, which is the most common error type in the SDK.
|
|
2465
|
+
*/ options)=>{
|
|
2458
2466
|
var _error_config, _error_config1, _error_response, _error_response1, _error_response2;
|
|
2459
2467
|
const requestUrl = (_error_config = error.config) == null ? void 0 : _error_config.url;
|
|
2460
2468
|
const requestBaseUrl = (_error_config1 = error.config) == null ? void 0 : _error_config1.baseURL;
|
|
@@ -2482,7 +2490,11 @@ const handleAxiosError = (error, message, context, _logger)=>{
|
|
|
2482
2490
|
// connectivity problem, not a server fault. Both are logged at `warn` so they
|
|
2483
2491
|
// don't pollute error dashboards or trigger PagerDuty. The 429 case covers
|
|
2484
2492
|
// both Cloudflare WAF blocks and application-level rate limiting.
|
|
2485
|
-
const
|
|
2493
|
+
const inferredLevel = status === 429 || status === undefined ? 'warn' : 'error';
|
|
2494
|
+
// A 5xx is a server fault: no call site is entitled to downgrade it, however
|
|
2495
|
+
// expected it believes the failure to be. The hint only applies below 500.
|
|
2496
|
+
const isServerFault = status !== undefined && status >= 500;
|
|
2497
|
+
const logLevel = (options == null ? void 0 : options.level) === 'warn' && !isServerFault ? 'warn' : inferredLevel;
|
|
2486
2498
|
Logger[logLevel]('[DynamicWaasWalletClient] Axios error: ', logPayload);
|
|
2487
2499
|
// No response at all: report it as such rather than laundering it into a 500.
|
|
2488
2500
|
if (status === undefined) {
|
package/index.esm.js
CHANGED
|
@@ -952,7 +952,7 @@ const getRequiredExternalKeyShareId = (ks)=>{
|
|
|
952
952
|
* before it is posted and surfaces in Datadog exactly as the recovery path does.
|
|
953
953
|
*/ const assertDynamicLocationsHaveExternalKeyShareId = (locations)=>locations.filter((location)=>location.location === BackupLocation.DYNAMIC).forEach((location)=>getRequiredExternalKeyShareId(location));
|
|
954
954
|
|
|
955
|
-
var version = "1.0.
|
|
955
|
+
var version = "1.0.95";
|
|
956
956
|
|
|
957
957
|
class BaseClient {
|
|
958
958
|
/**
|
|
@@ -2454,7 +2454,15 @@ const resolveStatusMessage = (status, error)=>{
|
|
|
2454
2454
|
}
|
|
2455
2455
|
return undefined;
|
|
2456
2456
|
};
|
|
2457
|
-
const handleAxiosError = (error, message, context,
|
|
2457
|
+
const handleAxiosError = (error, message, context, /**
|
|
2458
|
+
* Optional severity hint from the caller, for failures the caller knows are
|
|
2459
|
+
* expected (e.g. a business-rule rejection). It can only *lower* severity to
|
|
2460
|
+
* `warn` — a caller must not be able to escalate, and a genuine 5xx has to
|
|
2461
|
+
* stay at `error` regardless of what the call site believes.
|
|
2462
|
+
*
|
|
2463
|
+
* Without this the hint that `logError` accepts was silently discarded for
|
|
2464
|
+
* every AxiosError, which is the most common error type in the SDK.
|
|
2465
|
+
*/ options)=>{
|
|
2458
2466
|
var _error_config, _error_config1, _error_response, _error_response1, _error_response2;
|
|
2459
2467
|
const requestUrl = (_error_config = error.config) == null ? void 0 : _error_config.url;
|
|
2460
2468
|
const requestBaseUrl = (_error_config1 = error.config) == null ? void 0 : _error_config1.baseURL;
|
|
@@ -2482,7 +2490,11 @@ const handleAxiosError = (error, message, context, _logger)=>{
|
|
|
2482
2490
|
// connectivity problem, not a server fault. Both are logged at `warn` so they
|
|
2483
2491
|
// don't pollute error dashboards or trigger PagerDuty. The 429 case covers
|
|
2484
2492
|
// both Cloudflare WAF blocks and application-level rate limiting.
|
|
2485
|
-
const
|
|
2493
|
+
const inferredLevel = status === 429 || status === undefined ? 'warn' : 'error';
|
|
2494
|
+
// A 5xx is a server fault: no call site is entitled to downgrade it, however
|
|
2495
|
+
// expected it believes the failure to be. The hint only applies below 500.
|
|
2496
|
+
const isServerFault = status !== undefined && status >= 500;
|
|
2497
|
+
const logLevel = (options == null ? void 0 : options.level) === 'warn' && !isServerFault ? 'warn' : inferredLevel;
|
|
2486
2498
|
Logger[logLevel]('[DynamicWaasWalletClient] Axios error: ', logPayload);
|
|
2487
2499
|
// No response at all: report it as such rather than laundering it into a 500.
|
|
2488
2500
|
if (status === undefined) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.95",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@dynamic-labs/sdk-api-core": "^0.0.1093",
|
|
8
|
-
"@dynamic-labs-wallet/primitives": "1.0.
|
|
8
|
+
"@dynamic-labs-wallet/primitives": "1.0.95",
|
|
9
9
|
"axios": "1.16.0",
|
|
10
10
|
"uuid": "11.1.0"
|
|
11
11
|
},
|
|
@@ -16,7 +16,9 @@ export declare class WalletApiError extends Error {
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const NETWORK_ERROR_STATUS = 0;
|
|
18
18
|
export declare const NETWORK_ERROR_CODE = "NETWORK_ERROR";
|
|
19
|
-
export declare const handleAxiosError: (error: AxiosError, message: string, context: Record<string, unknown>,
|
|
19
|
+
export declare const handleAxiosError: (error: AxiosError, message: string, context: Record<string, unknown>, options?: {
|
|
20
|
+
level?: "warn" | "error";
|
|
21
|
+
}) => never;
|
|
20
22
|
export type { AxiosError } from 'axios';
|
|
21
23
|
export { isAxiosError } from 'axios';
|
|
22
24
|
//# sourceMappingURL=axiosErrorResponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axiosErrorResponse.d.ts","sourceRoot":"","sources":["../../src/services/axiosErrorResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,qBAAa,cAAe,SAAQ,KAAK;IACvC,MAAM,EAAE,MAAM,CAAC;IAIf,IAAI,CAAC,EAAE,MAAM,CAAC;gBAEF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAM3D;AAgBD;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAqDlD,eAAO,MAAM,gBAAgB,UACpB,UAAU,WACR,MAAM,WACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"axiosErrorResponse.d.ts","sourceRoot":"","sources":["../../src/services/axiosErrorResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,qBAAa,cAAe,SAAQ,KAAK;IACvC,MAAM,EAAE,MAAM,CAAC;IAIf,IAAI,CAAC,EAAE,MAAM,CAAC;gBAEF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAM3D;AAgBD;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAqDlD,eAAO,MAAM,gBAAgB,UACpB,UAAU,WACR,MAAM,WACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAUtB;IAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,UAyCvC,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC"}
|