jsgar 1.5.4 → 1.6.2

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/gar.umd.js +6 -5
  2. package/package.json +1 -1
package/dist/gar.umd.js CHANGED
@@ -37,11 +37,11 @@
37
37
  * Initialize the GAR client.
38
38
  * @param {string} wsEndpoint - WebSocket endpoint (e.g., "ws://localhost:8765")
39
39
  * @param {string} user - Client username for identification
40
- * @param {number} [heartbeatInterval=4000] - Heartbeat interval in milliseconds
40
+ * @param {number} [heartbeatTimeoutInterval=4000] - Heartbeat interval in milliseconds
41
41
  * @param {boolean} [allowSelfSignedCertificate=false] - Allow self-signed certificates
42
42
  * @param {string} [logLevel='INFO'] - Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
43
43
  */
44
- constructor(wsEndpoint, user, working_namespace = null, heartbeatInterval = 4000, allowSelfSignedCertificate = false, logLevel = 'INFO') {
44
+ constructor(wsEndpoint, user, working_namespace = null, heartbeatTimeoutInterval = 4000, allowSelfSignedCertificate = false, logLevel = 'INFO') {
45
45
  this.wsEndpoint = wsEndpoint;
46
46
  this.websocket = null;
47
47
  this.messageQueue = [];
@@ -49,7 +49,7 @@
49
49
  this.reconnectDelay = 5000; // Milliseconds
50
50
  this.user = user;
51
51
  this.working_namespace = working_namespace;
52
- this.heartbeatInterval = heartbeatInterval;
52
+ this.heartbeatTimeoutInterval = heartbeatTimeoutInterval;
53
53
  this.version = 650269;
54
54
 
55
55
  if (typeof window !== 'undefined' && window.location) {
@@ -432,13 +432,13 @@
432
432
  message_type: 'Introduction',
433
433
  value: {
434
434
  version: this.version,
435
- heartbeat_timeout_interval: this.heartbeatInterval,
435
+ heartbeat_timeout_interval: this.heartbeatTimeoutInterval,
436
436
  user: this.user,
437
437
  working_namespace: this.working_namespace
438
438
  }
439
439
  };
440
440
  this.sendMessage(introMsg);
441
- this.heartbeatIntervalId = setInterval(() => this._heartbeatLoop(), this.heartbeatInterval / 2);
441
+ this.heartbeatIntervalId = setInterval(() => this._heartbeatLoop(), this.heartbeatTimeoutInterval / 2);
442
442
  this.connect();
443
443
  }
444
444
 
@@ -482,6 +482,7 @@
482
482
  if (this.stoppedCallback) {
483
483
  this.stoppedCallback();
484
484
  }
485
+ this.log('INFO', 'GAR client stopped');
485
486
  }
486
487
 
487
488
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsgar",
3
- "version": "1.5.4",
3
+ "version": "1.6.2",
4
4
  "description": "A Javascript client for the GAR protocol",
5
5
  "type": "module",
6
6
  "main": "dist/gar.umd.js",