@signaliz/sdk 1.0.43 → 1.0.44
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/{chunk-HQS7N57T.mjs → chunk-Q4T2GUXD.mjs} +17 -4
- package/dist/index.js +17 -4
- package/dist/index.mjs +1 -1
- package/dist/mcp-config.js +17 -4
- package/dist/mcp-config.mjs +1 -1
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ function parseError(status, body) {
|
|
|
18
18
|
code: body.error.code || `HTTP_${status}`,
|
|
19
19
|
message: body.error.message || `Request failed with status ${status}`,
|
|
20
20
|
errorType: mapErrorType(body.error.code, status),
|
|
21
|
-
retryAfter: body.error
|
|
21
|
+
retryAfter: retryAfterSeconds(body.error),
|
|
22
22
|
details: body.error.details
|
|
23
23
|
});
|
|
24
24
|
}
|
|
@@ -27,9 +27,22 @@ function parseError(status, body) {
|
|
|
27
27
|
code,
|
|
28
28
|
message: body?.message || body?.error || `Request failed with status ${status}`,
|
|
29
29
|
errorType: mapErrorType(code, status),
|
|
30
|
-
|
|
30
|
+
retryAfter: retryAfterSeconds(body),
|
|
31
|
+
details: body?.details || publicRetryDetails(body)
|
|
31
32
|
});
|
|
32
33
|
}
|
|
34
|
+
function retryAfterSeconds(body) {
|
|
35
|
+
const value = Number(body?.retry_after_seconds ?? body?.retry_after);
|
|
36
|
+
return Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
37
|
+
}
|
|
38
|
+
function publicRetryDetails(body) {
|
|
39
|
+
const details = {
|
|
40
|
+
...body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : {},
|
|
41
|
+
...body?.retry_after !== void 0 ? { retry_after: body.retry_after } : {},
|
|
42
|
+
...body?.retry_after_seconds !== void 0 ? { retry_after_seconds: body.retry_after_seconds } : {}
|
|
43
|
+
};
|
|
44
|
+
return Object.keys(details).length > 0 ? details : void 0;
|
|
45
|
+
}
|
|
33
46
|
function mapErrorType(code, status) {
|
|
34
47
|
if (code === "RATE_LIMITED" || status === 429) return "rate_limited";
|
|
35
48
|
if (code === "VALIDATION_ERROR" || code === "SIGNAL_RUN_COMPANY_MISMATCH" || status === 400) return "validation";
|
|
@@ -864,8 +877,8 @@ function rowRateLimitDelayMs(items) {
|
|
|
864
877
|
const delays = items.map((item) => {
|
|
865
878
|
const retryAfterMs = Number(item.raw?.retry_after_ms);
|
|
866
879
|
if (Number.isFinite(retryAfterMs) && retryAfterMs > 0) return retryAfterMs;
|
|
867
|
-
const
|
|
868
|
-
if (Number.isFinite(
|
|
880
|
+
const retryAfterSeconds2 = Number(item.raw?.retry_after_seconds ?? item.raw?.retry_after);
|
|
881
|
+
if (Number.isFinite(retryAfterSeconds2) && retryAfterSeconds2 > 0) return retryAfterSeconds2 * 1e3;
|
|
869
882
|
return 6e4;
|
|
870
883
|
});
|
|
871
884
|
return Math.max(1, Math.min(6e4, Math.max(...delays)));
|
package/dist/index.js
CHANGED
|
@@ -45,7 +45,7 @@ function parseError(status, body) {
|
|
|
45
45
|
code: body.error.code || `HTTP_${status}`,
|
|
46
46
|
message: body.error.message || `Request failed with status ${status}`,
|
|
47
47
|
errorType: mapErrorType(body.error.code, status),
|
|
48
|
-
retryAfter: body.error
|
|
48
|
+
retryAfter: retryAfterSeconds(body.error),
|
|
49
49
|
details: body.error.details
|
|
50
50
|
});
|
|
51
51
|
}
|
|
@@ -54,9 +54,22 @@ function parseError(status, body) {
|
|
|
54
54
|
code,
|
|
55
55
|
message: body?.message || body?.error || `Request failed with status ${status}`,
|
|
56
56
|
errorType: mapErrorType(code, status),
|
|
57
|
-
|
|
57
|
+
retryAfter: retryAfterSeconds(body),
|
|
58
|
+
details: body?.details || publicRetryDetails(body)
|
|
58
59
|
});
|
|
59
60
|
}
|
|
61
|
+
function retryAfterSeconds(body) {
|
|
62
|
+
const value = Number(body?.retry_after_seconds ?? body?.retry_after);
|
|
63
|
+
return Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
64
|
+
}
|
|
65
|
+
function publicRetryDetails(body) {
|
|
66
|
+
const details = {
|
|
67
|
+
...body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : {},
|
|
68
|
+
...body?.retry_after !== void 0 ? { retry_after: body.retry_after } : {},
|
|
69
|
+
...body?.retry_after_seconds !== void 0 ? { retry_after_seconds: body.retry_after_seconds } : {}
|
|
70
|
+
};
|
|
71
|
+
return Object.keys(details).length > 0 ? details : void 0;
|
|
72
|
+
}
|
|
60
73
|
function mapErrorType(code, status) {
|
|
61
74
|
if (code === "RATE_LIMITED" || status === 429) return "rate_limited";
|
|
62
75
|
if (code === "VALIDATION_ERROR" || code === "SIGNAL_RUN_COMPANY_MISMATCH" || status === 400) return "validation";
|
|
@@ -891,8 +904,8 @@ function rowRateLimitDelayMs(items) {
|
|
|
891
904
|
const delays = items.map((item) => {
|
|
892
905
|
const retryAfterMs = Number(item.raw?.retry_after_ms);
|
|
893
906
|
if (Number.isFinite(retryAfterMs) && retryAfterMs > 0) return retryAfterMs;
|
|
894
|
-
const
|
|
895
|
-
if (Number.isFinite(
|
|
907
|
+
const retryAfterSeconds2 = Number(item.raw?.retry_after_seconds ?? item.raw?.retry_after);
|
|
908
|
+
if (Number.isFinite(retryAfterSeconds2) && retryAfterSeconds2 > 0) return retryAfterSeconds2 * 1e3;
|
|
896
909
|
return 6e4;
|
|
897
910
|
});
|
|
898
911
|
return Math.max(1, Math.min(6e4, Math.max(...delays)));
|
package/dist/index.mjs
CHANGED
package/dist/mcp-config.js
CHANGED
|
@@ -49,7 +49,7 @@ function parseError(status, body) {
|
|
|
49
49
|
code: body.error.code || `HTTP_${status}`,
|
|
50
50
|
message: body.error.message || `Request failed with status ${status}`,
|
|
51
51
|
errorType: mapErrorType(body.error.code, status),
|
|
52
|
-
retryAfter: body.error
|
|
52
|
+
retryAfter: retryAfterSeconds(body.error),
|
|
53
53
|
details: body.error.details
|
|
54
54
|
});
|
|
55
55
|
}
|
|
@@ -58,9 +58,22 @@ function parseError(status, body) {
|
|
|
58
58
|
code,
|
|
59
59
|
message: body?.message || body?.error || `Request failed with status ${status}`,
|
|
60
60
|
errorType: mapErrorType(code, status),
|
|
61
|
-
|
|
61
|
+
retryAfter: retryAfterSeconds(body),
|
|
62
|
+
details: body?.details || publicRetryDetails(body)
|
|
62
63
|
});
|
|
63
64
|
}
|
|
65
|
+
function retryAfterSeconds(body) {
|
|
66
|
+
const value = Number(body?.retry_after_seconds ?? body?.retry_after);
|
|
67
|
+
return Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
68
|
+
}
|
|
69
|
+
function publicRetryDetails(body) {
|
|
70
|
+
const details = {
|
|
71
|
+
...body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : {},
|
|
72
|
+
...body?.retry_after !== void 0 ? { retry_after: body.retry_after } : {},
|
|
73
|
+
...body?.retry_after_seconds !== void 0 ? { retry_after_seconds: body.retry_after_seconds } : {}
|
|
74
|
+
};
|
|
75
|
+
return Object.keys(details).length > 0 ? details : void 0;
|
|
76
|
+
}
|
|
64
77
|
function mapErrorType(code, status) {
|
|
65
78
|
if (code === "RATE_LIMITED" || status === 429) return "rate_limited";
|
|
66
79
|
if (code === "VALIDATION_ERROR" || code === "SIGNAL_RUN_COMPANY_MISMATCH" || status === 400) return "validation";
|
|
@@ -895,8 +908,8 @@ function rowRateLimitDelayMs(items) {
|
|
|
895
908
|
const delays = items.map((item) => {
|
|
896
909
|
const retryAfterMs = Number(item.raw?.retry_after_ms);
|
|
897
910
|
if (Number.isFinite(retryAfterMs) && retryAfterMs > 0) return retryAfterMs;
|
|
898
|
-
const
|
|
899
|
-
if (Number.isFinite(
|
|
911
|
+
const retryAfterSeconds2 = Number(item.raw?.retry_after_seconds ?? item.raw?.retry_after);
|
|
912
|
+
if (Number.isFinite(retryAfterSeconds2) && retryAfterSeconds2 > 0) return retryAfterSeconds2 * 1e3;
|
|
900
913
|
return 6e4;
|
|
901
914
|
});
|
|
902
915
|
return Math.max(1, Math.min(6e4, Math.max(...delays)));
|
package/dist/mcp-config.mjs
CHANGED
package/package.json
CHANGED