jsgar 4.5.2 → 4.5.3

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/gar.umd.js CHANGED
@@ -74,7 +74,7 @@
74
74
  this.localKeyMap = new Map();
75
75
  this.invalidatedKeyIds = new Set();
76
76
  this.recordMap = new Map();
77
- this._activeOwnership = { msg_ref: 0, ownership_action: 'None', skip_ownership_checks: false, client_key_id: 0 };
77
+ this._activeOwnership = { msg_ref: 0, ownership_action: 'None', skip_ownership_checks: false, require_existing: false, client_key_id: 0 };
78
78
 
79
79
  this.running = false;
80
80
  this.heartbeatIntervalId = null;
@@ -142,7 +142,7 @@
142
142
  this.invalidatedKeyIds.clear();
143
143
 
144
144
  // Active ownership state
145
- this._activeOwnership = { msg_ref: 0, ownership_action: 'None', skip_ownership_checks: false, client_key_id: 0 };
145
+ this._activeOwnership = { msg_ref: 0, ownership_action: 'None', skip_ownership_checks: false, require_existing: false, client_key_id: 0 };
146
146
 
147
147
  // Heartbeat grace period flags
148
148
  this._initialGracePeriod = false;
@@ -1145,12 +1145,13 @@
1145
1145
  * @param {number} [options.msgRef=0] - Message reference for correlating recoverable error responses.
1146
1146
  * @param {string} [options.ownershipAction='None'] - 'None' (check only), 'Acquire', or 'Release'.
1147
1147
  * @param {boolean} [options.skipOwnershipChecks=false] - Bypass ownership validation.
1148
+ * @param {boolean} [options.requireExisting=false] - Only write to existing keys; do not create new keys.
1148
1149
  * @param {number} [options.clientKeyId=0] - The g::Client key ID for ownership. 0 uses the connection key.
1149
1150
  */
1150
- updateActiveOwnership({ msgRef = 0, ownershipAction = 'None', skipOwnershipChecks = false, clientKeyId = 0 } = {}) {
1151
- const newOwnership = { msg_ref: msgRef, ownership_action: ownershipAction, skip_ownership_checks: skipOwnershipChecks, client_key_id: clientKeyId };
1151
+ updateActiveOwnership({ msgRef = 0, ownershipAction = 'None', skipOwnershipChecks = false, requireExisting = false, clientKeyId = 0 } = {}) {
1152
+ const newOwnership = { msg_ref: msgRef, ownership_action: ownershipAction, skip_ownership_checks: skipOwnershipChecks, require_existing: requireExisting, client_key_id: clientKeyId };
1152
1153
  const cur = this._activeOwnership;
1153
- if (newOwnership.msg_ref !== cur.msg_ref || newOwnership.ownership_action !== cur.ownership_action || newOwnership.skip_ownership_checks !== cur.skip_ownership_checks || newOwnership.client_key_id !== cur.client_key_id) {
1154
+ if (newOwnership.msg_ref !== cur.msg_ref || newOwnership.ownership_action !== cur.ownership_action || newOwnership.skip_ownership_checks !== cur.skip_ownership_checks || newOwnership.require_existing !== cur.require_existing || newOwnership.client_key_id !== cur.client_key_id) {
1154
1155
  this._activeOwnership = newOwnership;
1155
1156
  this.sendMessage({ message_type: 'ActiveOwnership', value: newOwnership });
1156
1157
  }
package/gar.js CHANGED
@@ -68,7 +68,7 @@ class GARClient {
68
68
  this.localKeyMap = new Map();
69
69
  this.invalidatedKeyIds = new Set();
70
70
  this.recordMap = new Map();
71
- this._activeOwnership = { msg_ref: 0, ownership_action: 'None', skip_ownership_checks: false, client_key_id: 0 };
71
+ this._activeOwnership = { msg_ref: 0, ownership_action: 'None', skip_ownership_checks: false, require_existing: false, client_key_id: 0 };
72
72
 
73
73
  this.running = false;
74
74
  this.heartbeatIntervalId = null;
@@ -136,7 +136,7 @@ class GARClient {
136
136
  this.invalidatedKeyIds.clear();
137
137
 
138
138
  // Active ownership state
139
- this._activeOwnership = { msg_ref: 0, ownership_action: 'None', skip_ownership_checks: false, client_key_id: 0 };
139
+ this._activeOwnership = { msg_ref: 0, ownership_action: 'None', skip_ownership_checks: false, require_existing: false, client_key_id: 0 };
140
140
 
141
141
  // Heartbeat grace period flags
142
142
  this._initialGracePeriod = false;
@@ -1139,12 +1139,13 @@ class GARClient {
1139
1139
  * @param {number} [options.msgRef=0] - Message reference for correlating recoverable error responses.
1140
1140
  * @param {string} [options.ownershipAction='None'] - 'None' (check only), 'Acquire', or 'Release'.
1141
1141
  * @param {boolean} [options.skipOwnershipChecks=false] - Bypass ownership validation.
1142
+ * @param {boolean} [options.requireExisting=false] - Only write to existing keys; do not create new keys.
1142
1143
  * @param {number} [options.clientKeyId=0] - The g::Client key ID for ownership. 0 uses the connection key.
1143
1144
  */
1144
- updateActiveOwnership({ msgRef = 0, ownershipAction = 'None', skipOwnershipChecks = false, clientKeyId = 0 } = {}) {
1145
- const newOwnership = { msg_ref: msgRef, ownership_action: ownershipAction, skip_ownership_checks: skipOwnershipChecks, client_key_id: clientKeyId };
1145
+ updateActiveOwnership({ msgRef = 0, ownershipAction = 'None', skipOwnershipChecks = false, requireExisting = false, clientKeyId = 0 } = {}) {
1146
+ const newOwnership = { msg_ref: msgRef, ownership_action: ownershipAction, skip_ownership_checks: skipOwnershipChecks, require_existing: requireExisting, client_key_id: clientKeyId };
1146
1147
  const cur = this._activeOwnership;
1147
- if (newOwnership.msg_ref !== cur.msg_ref || newOwnership.ownership_action !== cur.ownership_action || newOwnership.skip_ownership_checks !== cur.skip_ownership_checks || newOwnership.client_key_id !== cur.client_key_id) {
1148
+ if (newOwnership.msg_ref !== cur.msg_ref || newOwnership.ownership_action !== cur.ownership_action || newOwnership.skip_ownership_checks !== cur.skip_ownership_checks || newOwnership.require_existing !== cur.require_existing || newOwnership.client_key_id !== cur.client_key_id) {
1148
1149
  this._activeOwnership = newOwnership;
1149
1150
  this.sendMessage({ message_type: 'ActiveOwnership', value: newOwnership });
1150
1151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsgar",
3
- "version": "4.5.2",
3
+ "version": "4.5.3",
4
4
  "description": "A Javascript client for the GAR protocol",
5
5
  "type": "module",
6
6
  "main": "dist/gar.umd.js",