@wildix/xbees-conversations-client 1.2.9 → 1.2.10
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.
|
@@ -44,7 +44,7 @@ class ConversationsClient extends smithy_client_1.Client {
|
|
|
44
44
|
const getHeaderWithKey = (name) => {
|
|
45
45
|
const normalizedName = name.toLowerCase();
|
|
46
46
|
for (const [key, value] of headerEntries) {
|
|
47
|
-
if (key.toLowerCase() === normalizedName && typeof value === "string") {
|
|
47
|
+
if (key.toLowerCase() === normalizedName && (typeof value === "string" || typeof value === "number")) {
|
|
48
48
|
return [key, value];
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -52,10 +52,14 @@ class ConversationsClient extends smithy_client_1.Client {
|
|
|
52
52
|
};
|
|
53
53
|
const retryAfterHeader = getHeaderWithKey("retry-after");
|
|
54
54
|
if (retryAfterHeader) {
|
|
55
|
-
const [retryAfterKey,
|
|
56
|
-
const retryAfterNumeric = Number(
|
|
55
|
+
const [retryAfterKey, retryAfterValueRaw] = retryAfterHeader;
|
|
56
|
+
const retryAfterNumeric = Number(retryAfterValueRaw);
|
|
57
57
|
if (!Number.isNaN(retryAfterNumeric) && retryAfterNumeric >= 1000) {
|
|
58
|
-
|
|
58
|
+
const normalizedRetryAfterValue = new Date(Date.now() + retryAfterNumeric).toUTCString();
|
|
59
|
+
headers[retryAfterKey] = normalizedRetryAfterValue;
|
|
60
|
+
if (configuration?.retryLogging) {
|
|
61
|
+
console.warn(`[ConversationsClient] Normalized retry-after header from ${String(retryAfterValueRaw)} to ${normalizedRetryAfterValue}`);
|
|
62
|
+
}
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
}
|
|
@@ -41,7 +41,7 @@ export class ConversationsClient extends __Client {
|
|
|
41
41
|
const getHeaderWithKey = (name) => {
|
|
42
42
|
const normalizedName = name.toLowerCase();
|
|
43
43
|
for (const [key, value] of headerEntries) {
|
|
44
|
-
if (key.toLowerCase() === normalizedName && typeof value === "string") {
|
|
44
|
+
if (key.toLowerCase() === normalizedName && (typeof value === "string" || typeof value === "number")) {
|
|
45
45
|
return [key, value];
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -49,10 +49,14 @@ export class ConversationsClient extends __Client {
|
|
|
49
49
|
};
|
|
50
50
|
const retryAfterHeader = getHeaderWithKey("retry-after");
|
|
51
51
|
if (retryAfterHeader) {
|
|
52
|
-
const [retryAfterKey,
|
|
53
|
-
const retryAfterNumeric = Number(
|
|
52
|
+
const [retryAfterKey, retryAfterValueRaw] = retryAfterHeader;
|
|
53
|
+
const retryAfterNumeric = Number(retryAfterValueRaw);
|
|
54
54
|
if (!Number.isNaN(retryAfterNumeric) && retryAfterNumeric >= 1000) {
|
|
55
|
-
|
|
55
|
+
const normalizedRetryAfterValue = new Date(Date.now() + retryAfterNumeric).toUTCString();
|
|
56
|
+
headers[retryAfterKey] = normalizedRetryAfterValue;
|
|
57
|
+
if (configuration?.retryLogging) {
|
|
58
|
+
console.warn(`[ConversationsClient] Normalized retry-after header from ${String(retryAfterValueRaw)} to ${normalizedRetryAfterValue}`);
|
|
59
|
+
}
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
62
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-conversations-client",
|
|
3
3
|
"description": "@wildix/xbees-conversations-client client",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.10",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|