@verdant-web/common 3.2.2 → 3.3.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.
@@ -13,6 +13,12 @@ export interface UserInfo<Profile, Presence> {
13
13
  * identify the client when sending messages to it.
14
14
  */
15
15
  replicaId: string;
16
+ /**
17
+ * All replica clients for this user which the server has
18
+ * seen recently, including `replicaId`. Older servers
19
+ * may not provide this.
20
+ */
21
+ replicaIds?: string[];
16
22
  /**
17
23
  * This is the user's server profile. This data is associated
18
24
  * with the logged in user of the app and cannot be modified
@@ -1 +1 @@
1
- {"version":3,"file":"presence.js","sourceRoot":"","sources":["../../src/presence.ts"],"names":[],"mappings":"AAkDA,MAAM,CAAC,MAAM,uBAAuB,GAA4B,EAAE,CAAC"}
1
+ {"version":3,"file":"presence.js","sourceRoot":"","sources":["../../src/presence.ts"],"names":[],"mappings":"AAyDA,MAAM,CAAC,MAAM,uBAAuB,GAA4B,EAAE,CAAC"}
@@ -140,6 +140,11 @@ export type ForbiddenMessage = {
140
140
  export type ServerAckMessage = {
141
141
  type: 'server-ack';
142
142
  timestamp: string;
143
+ /**
144
+ * Included for push/pull clients so they can discover
145
+ * peers without waiting for their next full sync.
146
+ */
147
+ peerPresence?: Record<string, UserInfo<any, any>>;
143
148
  };
144
149
  export type ServerNeedSinceMessage = {
145
150
  type: 'need-since';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdant-web/common",
3
- "version": "3.2.2",
3
+ "version": "3.3.0",
4
4
  "access": "public",
5
5
  "type": "module",
6
6
  "exports": {
package/src/presence.ts CHANGED
@@ -14,6 +14,13 @@ export interface UserInfo<Profile, Presence> {
14
14
  */
15
15
  replicaId: string;
16
16
 
17
+ /**
18
+ * All replica clients for this user which the server has
19
+ * seen recently, including `replicaId`. Older servers
20
+ * may not provide this.
21
+ */
22
+ replicaIds?: string[];
23
+
17
24
  /**
18
25
  * This is the user's server profile. This data is associated
19
26
  * with the logged in user of the app and cannot be modified
package/src/protocol.ts CHANGED
@@ -163,6 +163,11 @@ export type ForbiddenMessage = {
163
163
  export type ServerAckMessage = {
164
164
  type: 'server-ack';
165
165
  timestamp: string;
166
+ /**
167
+ * Included for push/pull clients so they can discover
168
+ * peers without waiting for their next full sync.
169
+ */
170
+ peerPresence?: Record<string, UserInfo<any, any>>;
166
171
  };
167
172
 
168
173
  export type ServerNeedSinceMessage = {