@banta/sdk 5.7.0 → 5.8.1

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.
@@ -43,7 +43,7 @@ export declare class BantaComponent {
43
43
  pointOpen: ChatMessage;
44
44
  pointSubChat: ChatSourceBase;
45
45
  closeAux(): void;
46
- getViewType(message: ChatMessage): "comment" | "chat";
46
+ getViewType(message: ChatMessage): "chat" | "comment";
47
47
  upvoteMessage(message: ChatMessage): Promise<void>;
48
48
  showProfile(user: User): void;
49
49
  profileUser: User;
@@ -23,6 +23,7 @@ export interface ChatSourceBase {
23
23
  send(message: ChatMessage): Promise<ChatMessage>;
24
24
  close(): any;
25
25
  getCount(): Promise<number>;
26
+ loadSince(id: string): Promise<ChatMessage[]>;
26
27
  getExistingMessages(): Promise<ChatMessage[]>;
27
28
  loadAfter(message: ChatMessage, count: number): Promise<ChatMessage[]>;
28
29
  get(id: string): Promise<ChatMessage>;
@@ -28,6 +28,19 @@ export declare class ChatSource extends SocketRPC implements ChatSourceBase {
28
28
  bind(socket: DurableSocket): Promise<this>;
29
29
  private mapOrUpdateMessages;
30
30
  private mapOrUpdateMessage;
31
+ /**
32
+ * Ask server for messages that have occurred since the message with the given ID.
33
+ * This is used during brief reconnects to avoid dropping messages, while also not
34
+ * causing mobbing as everyone reconnects after an issue. The backend can choose to
35
+ * not service this request, instead returning undefined. In that case, the client
36
+ * is expected to fetch the existing messages and start state anew.
37
+ *
38
+ * TODO: this is not yet used
39
+ *
40
+ * @param id
41
+ * @returns
42
+ */
43
+ loadSince(id: string): Promise<ChatMessage[]>;
31
44
  getExistingMessages(): Promise<ChatMessage[]>;
32
45
  private ensureConnection;
33
46
  editMessage(messageId: string, text: string): Promise<void>;
@@ -29,6 +29,7 @@ export declare class StaticChatSource implements ChatSourceBase {
29
29
  send(message: ChatMessage): Promise<ChatMessage>;
30
30
  close(): void;
31
31
  getCount(): Promise<number>;
32
+ loadSince(id: string): Promise<any>;
32
33
  getExistingMessages(): Promise<ChatMessage[]>;
33
34
  loadAfter(message: ChatMessage, count: number): Promise<ChatMessage[]>;
34
35
  get(id: string): Promise<ChatMessage>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banta/sdk",
3
- "version": "5.7.0",
3
+ "version": "5.8.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"