@nxtedition/deepstream.io-client-js 28.1.21 → 28.1.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/deepstream.io-client-js",
3
- "version": "28.1.21",
3
+ "version": "28.1.22",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "type": "module",
@@ -450,7 +450,7 @@ class RecordHandler {
450
450
  }
451
451
  }
452
452
 
453
- put(name, version, data) {
453
+ put(name, version, data, parent) {
454
454
  if (typeof name !== 'string' || name.startsWith('_')) {
455
455
  throw new Error('invalid argument: name')
456
456
  }
@@ -463,7 +463,16 @@ class RecordHandler {
463
463
  throw new Error('invalid argument: data')
464
464
  }
465
465
 
466
+ if (parent != null && (typeof version !== 'string' || !/^\d+-/.test(version))) {
467
+ throw new Error('invalid argument: parent')
468
+ }
469
+
466
470
  const update = [name, version, jsonPath.stringify(data)]
471
+
472
+ if (parent) {
473
+ update.push(parent)
474
+ }
475
+
467
476
  this._connection.sendMsg(C.TOPIC.RECORD, C.ACTIONS.PUT, update)
468
477
 
469
478
  this._putting.set(update, [])