jsgar 1.4.2 → 1.5.1

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 +12 -2
  2. package/package.json +1 -1
package/dist/gar.umd.js CHANGED
@@ -41,16 +41,25 @@
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, heartbeatInterval = 4000, allowSelfSignedCertificate = false, logLevel = 'INFO') {
44
+ constructor(wsEndpoint, user, working_namespace = null, heartbeatInterval = 4000, allowSelfSignedCertificate = false, logLevel = 'INFO') {
45
45
  this.wsEndpoint = wsEndpoint;
46
46
  this.websocket = null;
47
47
  this.messageQueue = [];
48
48
  this.connected = false;
49
49
  this.reconnectDelay = 5000; // Milliseconds
50
50
  this.user = user;
51
+ this.working_namespace = working_namespace;
51
52
  this.heartbeatInterval = heartbeatInterval;
52
53
  this.version = 650269;
53
54
 
55
+ if (typeof window !== 'undefined' && window.location) {
56
+ this.application = window.location.href;
57
+ } else if (typeof require !== 'undefined' && require.main) {
58
+ this.application = require.main.filename;
59
+ } else {
60
+ this.application = 'unknown-js';
61
+ }
62
+
54
63
  this.serverTopicMap = new Map();
55
64
  this.serverKeyMap = new Map();
56
65
  this.localTopicCounter = 1;
@@ -426,7 +435,8 @@
426
435
  value: {
427
436
  version: this.version,
428
437
  heartbeat_timeout_interval: this.heartbeatInterval,
429
- user: this.user
438
+ user: this.user,
439
+ working_namespace: this.working_namespace
430
440
  }
431
441
  };
432
442
  this.sendMessage(introMsg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsgar",
3
- "version": "1.4.2",
3
+ "version": "1.5.1",
4
4
  "description": "A Javascript client for the GAR protocol",
5
5
  "type": "module",
6
6
  "main": "dist/gar.umd.js",