jsgar 1.2.0 → 1.2.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.
- package/dist/gar.umd.js +6 -4
- package/package.json +1 -1
package/dist/gar.umd.js
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
//for browser:
|
|
29
29
|
const WebSocket = window.WebSocket;
|
|
30
30
|
|
|
31
|
-
// for Node.
|
|
31
|
+
// for Node.js:
|
|
32
32
|
// import ws from 'ws';
|
|
33
33
|
// const WebSocket = ws;
|
|
34
34
|
|
|
@@ -558,13 +558,14 @@
|
|
|
558
558
|
* @param {string|null} [keyFilter=null] - Key filter regex
|
|
559
559
|
* @param {string|null} [topicFilter=null] - Topic filter regex
|
|
560
560
|
*/
|
|
561
|
-
subscribe(name, mode = 'Streaming', keyName = null, topicName = null, classFilter = null, keyFilter = null, topicFilter = null) {
|
|
561
|
+
subscribe(name, mode = 'Streaming', keyName = null, topicName = null, classFilter = null, keyFilter = null, topicFilter = null, include_unknown_keys = false) {
|
|
562
562
|
const keyId = keyName ? this.getAndPossiblyIntroduceKeyId(keyName) : 0;
|
|
563
563
|
const topicId = topicName ? this.getAndPossiblyIntroduceTopicId(topicName) : 0;
|
|
564
564
|
const subMsg = {
|
|
565
565
|
message_type: 'Subscribe',
|
|
566
566
|
value: {
|
|
567
567
|
subscription_mode: mode,
|
|
568
|
+
include_unknown_keys: include_unknown_keys,
|
|
568
569
|
nagle_interval: 0,
|
|
569
570
|
name,
|
|
570
571
|
key_id: keyId,
|
|
@@ -688,9 +689,10 @@
|
|
|
688
689
|
* @param {string} keyName - Key name
|
|
689
690
|
* @param {string} topicName - Topic name
|
|
690
691
|
* @param {any} value - JSON-serializable value
|
|
692
|
+
* @param class_name - Class name for key (optional)
|
|
691
693
|
*/
|
|
692
|
-
publishRecord(keyName, topicName, value) {
|
|
693
|
-
const keyId = this.getAndPossiblyIntroduceKeyId(keyName);
|
|
694
|
+
publishRecord(keyName, topicName, value, class_name = null) {
|
|
695
|
+
const keyId = this.getAndPossiblyIntroduceKeyId(keyName, class_name);
|
|
694
696
|
const topicId = this.getAndPossiblyIntroduceTopicId(topicName);
|
|
695
697
|
this.publishRecordWithIds(keyId, topicId, value);
|
|
696
698
|
}
|