jsgar 4.0.4 → 4.1.0

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 (3) hide show
  1. package/dist/gar.umd.js +12 -7
  2. package/gar.js +12 -7
  3. package/package.json +1 -1
package/dist/gar.umd.js CHANGED
@@ -55,7 +55,7 @@
55
55
  this.scaledHeartbeatTimeoutInterval *= this.timeoutScale;
56
56
  }
57
57
  this.unique_key_and_record_updates = uniqueKeyAndRecordUpdates;
58
- this.version = 650708;
58
+ this.version = 650709;
59
59
  this.uuid = GARClient._generateUUID();
60
60
 
61
61
  if (typeof window !== 'undefined' && window.location) {
@@ -919,7 +919,8 @@
919
919
  * @param {boolean} [includeDerived=false] - Include derived topics
920
920
  * @param {boolean} [trimDefaultValues=false] - Trim records containing default values from the snapshot
921
921
  * @param {string|null} [workingNamespace] - Namespace for matching relative paths
922
- * @param {string|null} [restrictNamespace=false] - Restricts topics and keys to children of restrict_namespace. Defaults to the working namespace. Use "::" for root / no restriction.
922
+ * @param {string|Array<string>|null} [restrictNamespace] - Restricts topics and keys to children of these namespaces (union). Defaults to the working namespace. Use ["::"] for root / no restriction.
923
+ * @param {string|Array<string>|null} [excludeNamespace] - Excludes topics and keys from children of these namespaces (union). Defaults to 'g' unless restrictNamespace is set.
923
924
  * @param {string|null} [density] - For performance tuning
924
925
  * @param {number} [subscriptionGroup=0] - Subscription group ID for isolating callbacks
925
926
  * @param {string|null} [subscriptionSet] - Subscription set identifier
@@ -943,6 +944,7 @@
943
944
  trimDefaultValues = false,
944
945
  workingNamespace = null,
945
946
  restrictNamespace = null,
947
+ excludeNamespace = null,
946
948
  density = null,
947
949
  subscriptionGroup = 0,
948
950
  subscriptionSet = null,
@@ -1030,7 +1032,10 @@
1030
1032
  valueDict.include_derived = includeDerived;
1031
1033
  }
1032
1034
  if (restrictNamespace) {
1033
- valueDict.restrict_namespace = restrictNamespace;
1035
+ valueDict.restrict_namespace = typeof restrictNamespace === 'string' ? [restrictNamespace] : restrictNamespace;
1036
+ }
1037
+ if (excludeNamespace) {
1038
+ valueDict.exclude_namespace = typeof excludeNamespace === 'string' ? [excludeNamespace] : excludeNamespace;
1034
1039
  }
1035
1040
  if (trimDefaultValues) {
1036
1041
  valueDict.trim_default_values = trimDefaultValues;
@@ -1299,8 +1304,8 @@
1299
1304
  * @param {string|null} [excludeTopicFilter]
1300
1305
  * @param {Array<string>|null} [historyTypes]
1301
1306
  * @param {string|null} [workingNamespace]
1302
- * @param {string|null} [restrictNamespace]
1303
- * @param {string|null} [excludeNamespace]
1307
+ * @param {string|Array<string>|null} [restrictNamespace]
1308
+ * @param {string|Array<string>|null} [excludeNamespace]
1304
1309
  * @param {boolean} [includeDerived=false]
1305
1310
  * @param {number} [timeout=10.0] seconds
1306
1311
  * @param {number} [subscriptionGroupServerKeys=650704]
@@ -1335,8 +1340,8 @@
1335
1340
  if (Array.isArray(topicList)) recordFilter.topic_list = topicList;
1336
1341
  if (Array.isArray(classList)) recordFilter.class_list = classList;
1337
1342
  if (workingNamespace != null) recordFilter.working_namespace = workingNamespace;
1338
- if (restrictNamespace != null) recordFilter.restrict_namespace = restrictNamespace;
1339
- if (excludeNamespace != null) recordFilter.exclude_namespace = excludeNamespace;
1343
+ if (restrictNamespace != null) recordFilter.restrict_namespace = typeof restrictNamespace === 'string' ? [restrictNamespace] : restrictNamespace;
1344
+ if (excludeNamespace != null) recordFilter.exclude_namespace = typeof excludeNamespace === 'string' ? [excludeNamespace] : excludeNamespace;
1340
1345
  if (keyFilter != null) recordFilter.key_filter_regex = keyFilter;
1341
1346
  if (excludeKeyFilter != null) recordFilter.exclude_key_filter_regex = excludeKeyFilter;
1342
1347
  if (topicFilter != null) recordFilter.topic_filter_regex = topicFilter;
package/gar.js CHANGED
@@ -49,7 +49,7 @@ class GARClient {
49
49
  this.scaledHeartbeatTimeoutInterval *= this.timeoutScale;
50
50
  }
51
51
  this.unique_key_and_record_updates = uniqueKeyAndRecordUpdates;
52
- this.version = 650708;
52
+ this.version = 650709;
53
53
  this.uuid = GARClient._generateUUID();
54
54
 
55
55
  if (typeof window !== 'undefined' && window.location) {
@@ -913,7 +913,8 @@ class GARClient {
913
913
  * @param {boolean} [includeDerived=false] - Include derived topics
914
914
  * @param {boolean} [trimDefaultValues=false] - Trim records containing default values from the snapshot
915
915
  * @param {string|null} [workingNamespace] - Namespace for matching relative paths
916
- * @param {string|null} [restrictNamespace=false] - Restricts topics and keys to children of restrict_namespace. Defaults to the working namespace. Use "::" for root / no restriction.
916
+ * @param {string|Array<string>|null} [restrictNamespace] - Restricts topics and keys to children of these namespaces (union). Defaults to the working namespace. Use ["::"] for root / no restriction.
917
+ * @param {string|Array<string>|null} [excludeNamespace] - Excludes topics and keys from children of these namespaces (union). Defaults to 'g' unless restrictNamespace is set.
917
918
  * @param {string|null} [density] - For performance tuning
918
919
  * @param {number} [subscriptionGroup=0] - Subscription group ID for isolating callbacks
919
920
  * @param {string|null} [subscriptionSet] - Subscription set identifier
@@ -937,6 +938,7 @@ class GARClient {
937
938
  trimDefaultValues = false,
938
939
  workingNamespace = null,
939
940
  restrictNamespace = null,
941
+ excludeNamespace = null,
940
942
  density = null,
941
943
  subscriptionGroup = 0,
942
944
  subscriptionSet = null,
@@ -1024,7 +1026,10 @@ class GARClient {
1024
1026
  valueDict.include_derived = includeDerived;
1025
1027
  }
1026
1028
  if (restrictNamespace) {
1027
- valueDict.restrict_namespace = restrictNamespace;
1029
+ valueDict.restrict_namespace = typeof restrictNamespace === 'string' ? [restrictNamespace] : restrictNamespace;
1030
+ }
1031
+ if (excludeNamespace) {
1032
+ valueDict.exclude_namespace = typeof excludeNamespace === 'string' ? [excludeNamespace] : excludeNamespace;
1028
1033
  }
1029
1034
  if (trimDefaultValues) {
1030
1035
  valueDict.trim_default_values = trimDefaultValues;
@@ -1293,8 +1298,8 @@ class GARClient {
1293
1298
  * @param {string|null} [excludeTopicFilter]
1294
1299
  * @param {Array<string>|null} [historyTypes]
1295
1300
  * @param {string|null} [workingNamespace]
1296
- * @param {string|null} [restrictNamespace]
1297
- * @param {string|null} [excludeNamespace]
1301
+ * @param {string|Array<string>|null} [restrictNamespace]
1302
+ * @param {string|Array<string>|null} [excludeNamespace]
1298
1303
  * @param {boolean} [includeDerived=false]
1299
1304
  * @param {number} [timeout=10.0] seconds
1300
1305
  * @param {number} [subscriptionGroupServerKeys=650704]
@@ -1329,8 +1334,8 @@ class GARClient {
1329
1334
  if (Array.isArray(topicList)) recordFilter.topic_list = topicList;
1330
1335
  if (Array.isArray(classList)) recordFilter.class_list = classList;
1331
1336
  if (workingNamespace != null) recordFilter.working_namespace = workingNamespace;
1332
- if (restrictNamespace != null) recordFilter.restrict_namespace = restrictNamespace;
1333
- if (excludeNamespace != null) recordFilter.exclude_namespace = excludeNamespace;
1337
+ if (restrictNamespace != null) recordFilter.restrict_namespace = typeof restrictNamespace === 'string' ? [restrictNamespace] : restrictNamespace;
1338
+ if (excludeNamespace != null) recordFilter.exclude_namespace = typeof excludeNamespace === 'string' ? [excludeNamespace] : excludeNamespace;
1334
1339
  if (keyFilter != null) recordFilter.key_filter_regex = keyFilter;
1335
1340
  if (excludeKeyFilter != null) recordFilter.exclude_key_filter_regex = excludeKeyFilter;
1336
1341
  if (topicFilter != null) recordFilter.topic_filter_regex = topicFilter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsgar",
3
- "version": "4.0.4",
3
+ "version": "4.1.0",
4
4
  "description": "A Javascript client for the GAR protocol",
5
5
  "type": "module",
6
6
  "main": "dist/gar.umd.js",