@pryv/monitor 3.4.0 → 3.5.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/package.json +1 -1
- package/src/Monitor.js +3 -3
- package/src/UpdateMethod/Socket.js +2 -2
- package/src/index.d.ts +4 -4
package/package.json
CHANGED
package/src/Monitor.js
CHANGED
|
@@ -164,9 +164,9 @@ class Monitor extends EventEmitter {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
167
|
+
* Register a handler for the server's fine-grained `accessUpdated`
|
|
168
|
+
* event. Fires whenever a Pryv.io ≥ 2.0.0-pre.X server emits the
|
|
169
|
+
* event after a successful `accesses.update` — payload is
|
|
170
170
|
* `{ type: 'access-updated', accessId: '<base>:<serial>', serial }`.
|
|
171
171
|
*
|
|
172
172
|
* Requires `Monitor.UpdateMethod.Socket` to be active (the event
|
|
@@ -23,8 +23,8 @@ class Socket extends UpdateMethod {
|
|
|
23
23
|
this.socket = await this.monitor.connection.socket.open();
|
|
24
24
|
this.socket.on('eventsChanged', () => { this.monitor.updateEvents(); });
|
|
25
25
|
this.socket.on('streamsChanged', () => { this.monitor.updateStreams(); });
|
|
26
|
-
//
|
|
27
|
-
//
|
|
26
|
+
// Re-emit the server's fine-grained `accessUpdated` event on the
|
|
27
|
+
// Monitor itself so consumers can subscribe via
|
|
28
28
|
// `monitor.onAccessUpdated(handler)`. The underlying SocketIO has
|
|
29
29
|
// already busted the connection's accessInfo cache; the payload
|
|
30
30
|
// carries the new composite accessId + serial for fine-grained
|
package/src/index.d.ts
CHANGED
|
@@ -97,10 +97,10 @@ declare module 'pryv' {
|
|
|
97
97
|
stop(): Monitor;
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
100
|
+
* Register a handler for the server's fine-grained `accessUpdated`
|
|
101
|
+
* event. Requires `Monitor.UpdateMethod.Socket`. The underlying
|
|
102
|
+
* `connection.socket` busts the `connection.accessInfo` cache
|
|
103
|
+
* before this fires.
|
|
104
104
|
*/
|
|
105
105
|
onAccessUpdated(handler: (payload: { type: 'access-updated', accessId: string, serial: number }) => void): Monitor;
|
|
106
106
|
|