@eka-care/ekascribe-ts-sdk 2.0.35 → 2.0.37
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 +18 -28
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -54344,7 +54344,7 @@ class SystemCompatibilityManager {
|
|
|
54344
54344
|
return this.createTestResult(
|
|
54345
54345
|
s,
|
|
54346
54346
|
COMPATIBILITY_TEST_STATUS.SUCCESS,
|
|
54347
|
-
"Internet connection is
|
|
54347
|
+
"Internet connection is working properly.",
|
|
54348
54348
|
{ isOnline: !0, pingTime: c }
|
|
54349
54349
|
);
|
|
54350
54350
|
} catch (c) {
|
|
@@ -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,
|
|
@@ -54382,7 +54382,7 @@ class SystemCompatibilityManager {
|
|
|
54382
54382
|
}) : this.createTestResult(
|
|
54383
54383
|
a,
|
|
54384
54384
|
COMPATIBILITY_TEST_STATUS.SUCCESS,
|
|
54385
|
-
"
|
|
54385
|
+
"Your browser and device meet the required specifications.",
|
|
54386
54386
|
{ browser: s, version: n, ram: r, timezone: c, systemTime: m }
|
|
54387
54387
|
);
|
|
54388
54388
|
} catch (s) {
|
|
@@ -54398,28 +54398,18 @@ 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
|
-
|
|
54411
|
-
|
|
54412
|
-
|
|
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, s = await fetchWrapper(
|
|
54404
|
+
`${GET_EKA_HOST()}/voice/sys/time?timezone=${a}`,
|
|
54405
|
+
{
|
|
54406
|
+
method: "GET"
|
|
54407
|
+
}
|
|
54408
|
+
);
|
|
54409
|
+
if (!s.ok)
|
|
54410
|
+
return "Failed to validate timezone against system time";
|
|
54411
|
+
const r = (await s.json()).time, c = new Date(r), u = /* @__PURE__ */ new Date(), m = Math.abs(c.getTime() - u.getTime()), y = 600 * 1e3;
|
|
54412
|
+
return m > y ? `System time and server time differ by ${Math.round(m / 6e4)} minutes. Maximum allowed difference is 10 minutes.` : null;
|
|
54423
54413
|
} catch {
|
|
54424
54414
|
return "Failed to validate timezone against system time";
|
|
54425
54415
|
}
|
|
@@ -54465,7 +54455,7 @@ class SystemCompatibilityManager {
|
|
|
54465
54455
|
return s.getTracks().forEach((r) => r.stop()), this.createTestResult(
|
|
54466
54456
|
a,
|
|
54467
54457
|
COMPATIBILITY_TEST_STATUS.SUCCESS,
|
|
54468
|
-
"Microphone
|
|
54458
|
+
"Microphone access is enabled and working.",
|
|
54469
54459
|
{ permission: "granted", deviceId: n }
|
|
54470
54460
|
);
|
|
54471
54461
|
} catch (s) {
|
|
@@ -54565,7 +54555,7 @@ class SystemCompatibilityManager {
|
|
|
54565
54555
|
this.createTestResult(
|
|
54566
54556
|
s,
|
|
54567
54557
|
COMPATIBILITY_TEST_STATUS.SUCCESS,
|
|
54568
|
-
"
|
|
54558
|
+
"Your browser supports smooth background performance.",
|
|
54569
54559
|
{ supported: !0, workerCreated: !0 }
|
|
54570
54560
|
)
|
|
54571
54561
|
));
|
|
@@ -54591,7 +54581,7 @@ class SystemCompatibilityManager {
|
|
|
54591
54581
|
return n.pingSuccess && this.awsConfigured && n.uploadSuccess ? this.createTestResult(
|
|
54592
54582
|
s,
|
|
54593
54583
|
COMPATIBILITY_TEST_STATUS.SUCCESS,
|
|
54594
|
-
"
|
|
54584
|
+
"Secure network access is confirmed.",
|
|
54595
54585
|
c
|
|
54596
54586
|
) : n.pingSuccess && this.awsConfigured ? this.createTestResult(
|
|
54597
54587
|
s,
|
|
@@ -54625,7 +54615,7 @@ class SystemCompatibilityManager {
|
|
|
54625
54615
|
*/
|
|
54626
54616
|
async pingApi() {
|
|
54627
54617
|
try {
|
|
54628
|
-
return (await fetchWrapper(
|
|
54618
|
+
return (await fetchWrapper(`${GET_EKA_HOST()}/voice/ping`, {
|
|
54629
54619
|
method: "GET"
|
|
54630
54620
|
})).ok;
|
|
54631
54621
|
} catch (a) {
|