@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.
Files changed (2) hide show
  1. package/dist/index.mjs +18 -28
  2. 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 active",
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, u = /* @__PURE__ */ new Date(), m = u.toISOString(), y = this.validateTimezone(u, c);
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
- "System information collected successfully",
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(a, s) {
54401
+ async validateTimezone() {
54402
54402
  try {
54403
- if (isNaN(a.getTime()))
54404
- return "Invalid system time detected";
54405
- const r = new Intl.DateTimeFormat("en-US", {
54406
- timeZone: s,
54407
- year: "numeric",
54408
- month: "2-digit",
54409
- day: "2-digit",
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, 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 permission granted",
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
- "SharedWorker is supported and functional",
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
- "Network and API access verified, S3 upload successful",
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("https://api.eka.care/voice/ping", {
54618
+ return (await fetchWrapper(`${GET_EKA_HOST()}/voice/ping`, {
54629
54619
  method: "GET"
54630
54620
  })).ok;
54631
54621
  } catch (a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "2.0.35",
3
+ "version": "2.0.37",
4
4
  "description": "EkaScribe TypeScript SDK - Modern ES2020 build",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",