@eka-care/ekascribe-ts-sdk 2.0.35 → 2.0.36
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.mjs +10 -23
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -54372,7 +54372,7 @@ class SystemCompatibilityManager {
|
|
|
54372
54372
|
async checkSystemInfo() {
|
|
54373
54373
|
const a = COMPATIBILITY_TEST_TYPE.SYSTEM_INFO;
|
|
54374
54374
|
try {
|
|
54375
|
-
const { browser: s, version: n } = this.detectBrowser(), r = navigator.deviceMemory, c = Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
54375
|
+
const { browser: s, version: n } = this.detectBrowser(), r = navigator.deviceMemory, c = Intl.DateTimeFormat().resolvedOptions().timeZone, m = (/* @__PURE__ */ new Date()).toISOString(), y = await this.validateTimezone();
|
|
54376
54376
|
return y ? this.createTestResult(a, COMPATIBILITY_TEST_STATUS.ERROR, y, {
|
|
54377
54377
|
browser: s,
|
|
54378
54378
|
version: n,
|
|
@@ -54398,28 +54398,15 @@ class SystemCompatibilityManager {
|
|
|
54398
54398
|
/**
|
|
54399
54399
|
* Validate timezone against system time
|
|
54400
54400
|
*/
|
|
54401
|
-
validateTimezone(
|
|
54401
|
+
async validateTimezone() {
|
|
54402
54402
|
try {
|
|
54403
|
-
|
|
54404
|
-
|
|
54405
|
-
|
|
54406
|
-
|
|
54407
|
-
|
|
54408
|
-
|
|
54409
|
-
|
|
54410
|
-
hour: "2-digit",
|
|
54411
|
-
minute: "2-digit",
|
|
54412
|
-
second: "2-digit",
|
|
54413
|
-
hour12: !1
|
|
54414
|
-
}).formatToParts(a), c = new Date(
|
|
54415
|
-
parseInt(r.find((y) => y.type === "year").value),
|
|
54416
|
-
parseInt(r.find((y) => y.type === "month").value) - 1,
|
|
54417
|
-
parseInt(r.find((y) => y.type === "day").value),
|
|
54418
|
-
parseInt(r.find((y) => y.type === "hour").value),
|
|
54419
|
-
parseInt(r.find((y) => y.type === "minute").value),
|
|
54420
|
-
parseInt(r.find((y) => y.type === "second").value)
|
|
54421
|
-
), u = Math.abs((a.getTime() - c.getTime()) / (1e3 * 60 * 60)), m = -a.getTimezoneOffset() / 60;
|
|
54422
|
-
return m < -12 || m > 14 ? "System timezone offset is invalid (outside -12 to +14 range)" : u > 24 ? "System time does not match timezone configuration" : null;
|
|
54403
|
+
const a = Intl.DateTimeFormat().resolvedOptions().timeZone, r = (await (await fetchWrapper(
|
|
54404
|
+
`${GET_EKA_HOST()}/voice/sys/time?timezone=${a}`,
|
|
54405
|
+
{
|
|
54406
|
+
method: "GET"
|
|
54407
|
+
}
|
|
54408
|
+
)).json()).time, c = new Date(r), u = /* @__PURE__ */ new Date(), m = Math.abs(c.getTime() - u.getTime()), y = 600 * 1e3;
|
|
54409
|
+
return m > y ? `System time and server time differ by ${Math.round(m / 6e4)} minutes. Maximum allowed difference is 10 minutes.` : null;
|
|
54423
54410
|
} catch {
|
|
54424
54411
|
return "Failed to validate timezone against system time";
|
|
54425
54412
|
}
|
|
@@ -54625,7 +54612,7 @@ class SystemCompatibilityManager {
|
|
|
54625
54612
|
*/
|
|
54626
54613
|
async pingApi() {
|
|
54627
54614
|
try {
|
|
54628
|
-
return (await fetchWrapper(
|
|
54615
|
+
return (await fetchWrapper(`${GET_EKA_HOST()}/voice/ping`, {
|
|
54629
54616
|
method: "GET"
|
|
54630
54617
|
})).ok;
|
|
54631
54618
|
} catch (a) {
|