@nxtedition/deepstream.io-client-js 25.0.3 → 25.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.
package/.husky/pre-commit CHANGED
@@ -1,3 +1 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
- yarn lint-staged
1
+ npx lint-staged
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/deepstream.io-client-js",
3
- "version": "25.0.3",
3
+ "version": "25.1.0",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "type": "module",
@@ -18,9 +18,9 @@
18
18
  "ws": false
19
19
  },
20
20
  "scripts": {
21
- "_postinstall": "husky install",
22
21
  "prepublishOnly": "pinst --disable",
23
- "postpublish": "pinst --enable"
22
+ "postpublish": "pinst --enable",
23
+ "prepare": "husky"
24
24
  },
25
25
  "lint-staged": {
26
26
  "*.{js,jsx,md,ts}": [
@@ -59,30 +59,30 @@
59
59
  "/__tests__"
60
60
  ],
61
61
  "dependencies": {
62
- "@nxtedition/json-path": "^1.0.3",
63
- "bufferutil": "^4.0.7",
62
+ "@nxtedition/json-path": "^1.0.8",
63
+ "bufferutil": "^4.0.8",
64
64
  "component-emitter2": "^1.3.5",
65
65
  "invariant": "^2.2.4",
66
66
  "lodash.clonedeep": "^4.5.0",
67
- "utf-8-validate": "^6.0.3",
67
+ "utf-8-validate": "^6.0.4",
68
68
  "varint": "^6.0.0",
69
- "ws": "^8.13.0",
70
- "xuid": "^4.1.2",
69
+ "ws": "^8.18.0",
70
+ "xuid": "^4.1.3",
71
71
  "xxhash-wasm": "^1.0.2"
72
72
  },
73
73
  "devDependencies": {
74
- "eslint": "^8.42.0",
75
- "eslint-config-prettier": "^8.8.0",
74
+ "eslint": "^8.0.0",
75
+ "eslint-config-prettier": "^9.1.0",
76
76
  "eslint-config-standard": "^17.1.0",
77
- "eslint-plugin-import": "^2.27.5",
78
- "eslint-plugin-n": "^16.0.0",
77
+ "eslint-plugin-import": "^2.29.1",
78
+ "eslint-plugin-n": "^17.9.0",
79
79
  "eslint-plugin-node": "^11.1.0",
80
- "eslint-plugin-promise": "^6.1.1",
81
- "husky": "^8.0.3",
82
- "lint-staged": "^13.2.2",
80
+ "eslint-plugin-promise": "^7.0.0",
81
+ "husky": "^9.1.1",
82
+ "lint-staged": "^15.2.7",
83
83
  "mitata": "^0.1.11",
84
84
  "pinst": "^3.0.0",
85
- "prettier": "^2.8.8"
85
+ "prettier": "^3.3.3"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "rxjs": ">=6.x"
@@ -161,7 +161,7 @@ Connection.prototype._sendAuthParams = function () {
161
161
  this._setState(C.CONNECTION_STATE.AUTHENTICATING)
162
162
  const authMessage = messageBuilder.getMsg(C.TOPIC.AUTH, C.ACTIONS.REQUEST, [
163
163
  this._authParams,
164
- '25.0.0', // TODO (fix): How to read from package.json?
164
+ '25.1.0', // TODO (fix): How to read from package.json?
165
165
  utils.isNode
166
166
  ? `Node/${process.version}`
167
167
  : globalThis.navigator && globalThis.navigator.userAgent,
@@ -313,7 +313,7 @@ Connection.prototype._handleConnectionResponse = function (message) {
313
313
  } else if (message.action === C.ACTIONS.CHALLENGE) {
314
314
  this._setState(C.CONNECTION_STATE.CHALLENGING)
315
315
  this._submit(
316
- messageBuilder.getMsg(C.TOPIC.CONNECTION, C.ACTIONS.CHALLENGE_RESPONSE, [this._url])
316
+ messageBuilder.getMsg(C.TOPIC.CONNECTION, C.ACTIONS.CHALLENGE_RESPONSE, [this._url]),
317
317
  )
318
318
  } else if (message.action === C.ACTIONS.REJECTION) {
319
319
  this._challengeDenied = true
@@ -381,10 +381,16 @@ Connection.prototype._tryReconnect = function () {
381
381
 
382
382
  if (this._reconnectionAttempt < this._options.maxReconnectAttempts) {
383
383
  this._setState(C.CONNECTION_STATE.RECONNECTING)
384
- this._reconnectTimeout = setTimeout(() => {
385
- this._reconnectTimeout = null
386
- this._createEndpoint()
387
- }, Math.min(this._options.maxReconnectInterval, this._options.reconnectIntervalIncrement * this._reconnectionAttempt))
384
+ this._reconnectTimeout = setTimeout(
385
+ () => {
386
+ this._reconnectTimeout = null
387
+ this._createEndpoint()
388
+ },
389
+ Math.min(
390
+ this._options.maxReconnectInterval,
391
+ this._options.reconnectIntervalIncrement * this._reconnectionAttempt,
392
+ ),
393
+ )
388
394
  this._reconnectionAttempt++
389
395
  } else {
390
396
  this._clearReconnect()
@@ -392,7 +392,7 @@ class Record {
392
392
  this._version = nextVersion
393
393
  }
394
394
 
395
- _onUpdate([, version, data]) {
395
+ _onUpdate([, version, data, hasProvider]) {
396
396
  const prevData = this._data
397
397
  const prevVersion = this._version
398
398
  const prevState = this._state
@@ -425,9 +425,11 @@ class Record {
425
425
  this._onPatching(false)
426
426
  }
427
427
 
428
- if (this._state < C.RECORD_STATE.SERVER) {
429
- this._state = this._version.charAt(0) === 'I' ? C.RECORD_STATE.STALE : C.RECORD_STATE.SERVER
430
- }
428
+ this._state = hasProvider != null && convertTyped(hasProvider, this._handler._client) === true
429
+ ? C.RECORD_STATE.PROVIDER
430
+ : this._version.charAt(0) === 'I'
431
+ ? C.RECORD_STATE.STALE
432
+ : C.RECORD_STATE.SERVER
431
433
 
432
434
  if (this._state !== prevState || this._data !== prevData || this._version !== prevVersion) {
433
435
  this._emitUpdate()