@openfin/cloud-interop-core-api 0.0.1-alpha.ca42c10 → 0.0.1-alpha.fba3468
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.cjs +6 -0
- package/dist/index.mjs +6 -0
- package/dist/interfaces.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -31,6 +31,7 @@ class CloudInteropAPI {
|
|
|
31
31
|
#sessionDetails;
|
|
32
32
|
#mqttClient;
|
|
33
33
|
#reconnectRetryLimit = 30;
|
|
34
|
+
#keepAliveIntervalSeconds = 30;
|
|
34
35
|
#logger = (level, message) => {
|
|
35
36
|
console[level](message);
|
|
36
37
|
};
|
|
@@ -60,6 +61,7 @@ class CloudInteropAPI {
|
|
|
60
61
|
this.#validateConnectParams(parameters);
|
|
61
62
|
this.#connectionParams = parameters;
|
|
62
63
|
this.#reconnectRetryLimit = parameters.reconnectRetryLimit || this.#reconnectRetryLimit;
|
|
64
|
+
this.#keepAliveIntervalSeconds = parameters.keepAliveIntervalSeconds || this.#keepAliveIntervalSeconds;
|
|
63
65
|
this.#logger = parameters.logger || this.#logger;
|
|
64
66
|
const { sourceId, platformId } = this.#connectionParams;
|
|
65
67
|
try {
|
|
@@ -75,6 +77,7 @@ class CloudInteropAPI {
|
|
|
75
77
|
this.#sessionDetails = createSessionResponse.data;
|
|
76
78
|
const sessionRootTopic = this.#sessionDetails.sessionRootTopic;
|
|
77
79
|
const clientOptions = {
|
|
80
|
+
keepalive: this.#keepAliveIntervalSeconds,
|
|
78
81
|
clientId: this.#sessionDetails.sessionId,
|
|
79
82
|
clean: true,
|
|
80
83
|
protocolVersion: 5,
|
|
@@ -85,6 +88,9 @@ class CloudInteropAPI {
|
|
|
85
88
|
payload: Buffer.from(JSON.stringify(this.#sessionDetails)),
|
|
86
89
|
qos: 0,
|
|
87
90
|
retain: false,
|
|
91
|
+
properties: {
|
|
92
|
+
willDelayInterval: 10,
|
|
93
|
+
},
|
|
88
94
|
},
|
|
89
95
|
username: this.#sessionDetails.token,
|
|
90
96
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -3795,6 +3795,7 @@ class CloudInteropAPI {
|
|
|
3795
3795
|
#sessionDetails;
|
|
3796
3796
|
#mqttClient;
|
|
3797
3797
|
#reconnectRetryLimit = 30;
|
|
3798
|
+
#keepAliveIntervalSeconds = 30;
|
|
3798
3799
|
#logger = (level, message) => {
|
|
3799
3800
|
console[level](message);
|
|
3800
3801
|
};
|
|
@@ -3824,6 +3825,7 @@ class CloudInteropAPI {
|
|
|
3824
3825
|
this.#validateConnectParams(parameters);
|
|
3825
3826
|
this.#connectionParams = parameters;
|
|
3826
3827
|
this.#reconnectRetryLimit = parameters.reconnectRetryLimit || this.#reconnectRetryLimit;
|
|
3828
|
+
this.#keepAliveIntervalSeconds = parameters.keepAliveIntervalSeconds || this.#keepAliveIntervalSeconds;
|
|
3827
3829
|
this.#logger = parameters.logger || this.#logger;
|
|
3828
3830
|
const { sourceId, platformId } = this.#connectionParams;
|
|
3829
3831
|
try {
|
|
@@ -3839,6 +3841,7 @@ class CloudInteropAPI {
|
|
|
3839
3841
|
this.#sessionDetails = createSessionResponse.data;
|
|
3840
3842
|
const sessionRootTopic = this.#sessionDetails.sessionRootTopic;
|
|
3841
3843
|
const clientOptions = {
|
|
3844
|
+
keepalive: this.#keepAliveIntervalSeconds,
|
|
3842
3845
|
clientId: this.#sessionDetails.sessionId,
|
|
3843
3846
|
clean: true,
|
|
3844
3847
|
protocolVersion: 5,
|
|
@@ -3849,6 +3852,9 @@ class CloudInteropAPI {
|
|
|
3849
3852
|
payload: Buffer.from(JSON.stringify(this.#sessionDetails)),
|
|
3850
3853
|
qos: 0,
|
|
3851
3854
|
retain: false,
|
|
3855
|
+
properties: {
|
|
3856
|
+
willDelayInterval: 10,
|
|
3857
|
+
},
|
|
3852
3858
|
},
|
|
3853
3859
|
username: this.#sessionDetails.token,
|
|
3854
3860
|
};
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -30,6 +30,11 @@ export type ConnectParameters = {
|
|
|
30
30
|
* defaults to 30
|
|
31
31
|
*/
|
|
32
32
|
reconnectRetryLimit?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Specifies how often keep alive messages should be sent to the cloud interop service in seconds
|
|
35
|
+
* defaults to 30
|
|
36
|
+
*/
|
|
37
|
+
keepAliveIntervalSeconds?: number;
|
|
33
38
|
/**
|
|
34
39
|
* Optional function to call with any logging messages to allow integration with the host application's logging
|
|
35
40
|
*
|