@voicenter-team/events-sdk 0.0.85 → 0.0.86
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/voicenter-events-sdk.cjs.js +1 -1
- package/dist/voicenter-events-sdk.cjs.js.map +1 -1
- package/dist/voicenter-events-sdk.es.js +29 -5
- package/dist/voicenter-events-sdk.es.js.map +1 -1
- package/dist/voicenter-events-sdk.iife.js +1 -1
- package/dist/voicenter-events-sdk.iife.js.map +1 -1
- package/dist/voicenter-events-sdk.umd.js +1 -1
- package/dist/voicenter-events-sdk.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -2688,13 +2688,31 @@ class qt {
|
|
|
2688
2688
|
e[t] = n;
|
|
2689
2689
|
}
|
|
2690
2690
|
/**
|
|
2691
|
-
* Configures UTC for
|
|
2691
|
+
* Configures UTC timestamps for an object by converting server-time properties to both UTC and client-local UTC timestamps
|
|
2692
2692
|
*
|
|
2693
|
-
*
|
|
2694
|
-
*
|
|
2695
|
-
*
|
|
2696
|
-
*
|
|
2693
|
+
* For each specified property, creates two new timestamp properties:
|
|
2694
|
+
* - property_UTC: Server timestamp converted to UTC milliseconds
|
|
2695
|
+
* - property_UTC_CLIENT: Server timestamp converted to client-local UTC milliseconds
|
|
2696
|
+
*
|
|
2697
|
+
* @example
|
|
2698
|
+
* // Input object
|
|
2699
|
+
* const data = {
|
|
2700
|
+
* callStarted: 1634567890 // Unix timestamp in seconds
|
|
2701
|
+
* }
|
|
2702
|
+
*
|
|
2703
|
+
* // After configureUTCForObject:
|
|
2704
|
+
* {
|
|
2705
|
+
* callStarted: 1634567890,
|
|
2706
|
+
* callStarted_UTC: 1634567890000, // Converted to UTC ms
|
|
2707
|
+
* callStarted_UTC_CLIENT: 1634571490000 // Converted to client-local UTC ms
|
|
2708
|
+
* }
|
|
2709
|
+
*
|
|
2710
|
+
* @param data - Source object containing server timestamp properties
|
|
2711
|
+
* @param properties - Array of property configs specifying which properties to convert and their format
|
|
2712
|
+
* @param servertime - Current server time in seconds
|
|
2713
|
+
* @param servertimeoffset - Server timezone offset in minutes
|
|
2697
2714
|
* @private
|
|
2715
|
+
* @returns Original object extended with new _UTC and _UTC_CLIENT properties for each configured timestamp
|
|
2698
2716
|
*/
|
|
2699
2717
|
static configureUTCForObject(e, t, n, r) {
|
|
2700
2718
|
const o = (n - r * 60) * 1e3, u = Date.now() - o, h = {};
|
|
@@ -2770,6 +2788,9 @@ class un {
|
|
|
2770
2788
|
this.eventsSdkClass.loggerClass.sdkAttemptToConnectError(r);
|
|
2771
2789
|
}
|
|
2772
2790
|
}
|
|
2791
|
+
clearKeepAliveInterval() {
|
|
2792
|
+
this.keepAliveInterval && clearInterval(this.keepAliveInterval);
|
|
2793
|
+
}
|
|
2773
2794
|
initKeepAlive() {
|
|
2774
2795
|
this.keepAliveInterval && clearInterval(this.keepAliveInterval), this.keepAliveInterval = setInterval(async () => {
|
|
2775
2796
|
if ((/* @__PURE__ */ new Date()).getTime() > this.lastEventTimestamp + this.eventsSdkClass.options.keepAliveTimeout && this.io && this.eventsSdkClass.authClass.token) {
|
|
@@ -5775,6 +5796,9 @@ class ks {
|
|
|
5775
5796
|
disconnect() {
|
|
5776
5797
|
this.socketIoClass.doReconnect = !1, this.socketIoClass.closeAllConnections(), this.loggerClass.stop();
|
|
5777
5798
|
}
|
|
5799
|
+
clearKeepAliveInterval() {
|
|
5800
|
+
this.socketIoClass.clearKeepAliveInterval();
|
|
5801
|
+
}
|
|
5778
5802
|
findMainServer() {
|
|
5779
5803
|
this.servers.length ? (this.mainServer = this.servers.reduce((e, t) => t.Priority > e.Priority ? t : e), this.server = this.mainServer) : this.URLList.length && (this.URL = this.URLList[0]);
|
|
5780
5804
|
}
|