@nxtedition/deepstream.io-client-js 32.0.7 → 32.0.8
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 +1 -1
- package/src/client.d.ts +4 -3
- package/src/utils/legacy-listener.js +6 -0
- package/src/utils/unicast-listener.js +6 -0
- package/.claude/settings.local.json +0 -9
- package/nxtedition-deepstream.io-client-js-31.0.18-b1.tgz +0 -0
- package/nxtedition-deepstream.io-client-js-31.0.18-b2.tgz +0 -0
- package/nxtedition-deepstream.io-client-js-31.0.18-b3.tgz +0 -0
- package/nxtedition-deepstream.io-client-js-32.0.6-alpha.0.tgz +0 -0
package/package.json
CHANGED
package/src/client.d.ts
CHANGED
|
@@ -87,11 +87,12 @@ export interface DeepstreamClient<
|
|
|
87
87
|
rpc: RpcHandler<Methods>
|
|
88
88
|
record: RecordHandler<Records>
|
|
89
89
|
user: string | null
|
|
90
|
-
on: (evt: EventName, callback: (...args: unknown[]) => void) =>
|
|
91
|
-
off: (evt: EventName, callback: (...args: unknown[]) => void) =>
|
|
90
|
+
on: (evt: EventName, callback: (...args: unknown[]) => void) => this
|
|
91
|
+
off: (evt: EventName, callback: (...args: unknown[]) => void) => this
|
|
92
92
|
getConnectionState: () => ConnectionStateName
|
|
93
93
|
close: () => void
|
|
94
|
-
login: unknown
|
|
94
|
+
login(callback: (success: boolean, authData: unknown) => void): this
|
|
95
|
+
login(authParams: object, callback: (success: boolean, authData: unknown) => void): this
|
|
95
96
|
stats: {
|
|
96
97
|
record: RecordStats
|
|
97
98
|
rpc: RpcStats
|
|
@@ -6,6 +6,7 @@ export default class Listener {
|
|
|
6
6
|
constructor(topic, pattern, callback, handler, { recursive = false, stringify = null } = {}) {
|
|
7
7
|
this._topic = topic
|
|
8
8
|
this._pattern = pattern
|
|
9
|
+
this._expr = new RegExp(pattern)
|
|
9
10
|
this._callback = callback
|
|
10
11
|
this._handler = handler
|
|
11
12
|
this._client = this._handler._client
|
|
@@ -54,6 +55,11 @@ export default class Listener {
|
|
|
54
55
|
return
|
|
55
56
|
}
|
|
56
57
|
|
|
58
|
+
if (!this._expr.test(name)) {
|
|
59
|
+
this._error(name, 'invalid add: name does not match pattern')
|
|
60
|
+
return
|
|
61
|
+
}
|
|
62
|
+
|
|
57
63
|
// TODO (refactor): Move to class
|
|
58
64
|
const provider = {
|
|
59
65
|
name,
|
|
@@ -37,6 +37,7 @@ export default class Listener {
|
|
|
37
37
|
|
|
38
38
|
this._topic = topic
|
|
39
39
|
this._pattern = pattern
|
|
40
|
+
this._expr = new RegExp(pattern)
|
|
40
41
|
this._callback = callback
|
|
41
42
|
this._handler = handler
|
|
42
43
|
this._client = this._handler._client
|
|
@@ -69,6 +70,11 @@ export default class Listener {
|
|
|
69
70
|
return
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
if (!this._expr.test(name)) {
|
|
74
|
+
this._error(name, 'invalid accept: name does not match pattern')
|
|
75
|
+
return
|
|
76
|
+
}
|
|
77
|
+
|
|
72
78
|
let value$
|
|
73
79
|
try {
|
|
74
80
|
value$ = this._callback(name)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|