@pmate/chat-sdk 0.12.0-next.4 → 0.12.0-next.41
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/README.md +41 -1
- package/lib/runtime/batchedReadIndex.d.ts +11 -2
- package/lib/runtime/batchedReadIndex.js +21 -1
- package/lib/runtime/cachedMessage.d.ts +12 -0
- package/lib/runtime/cachedMessage.js +18 -0
- package/lib/runtime/chatClient.d.ts +1 -0
- package/lib/runtime/chatClient.js +1 -1
- package/lib/runtime/chatSession.d.ts +78 -8
- package/lib/runtime/chatSession.js +504 -39
- package/lib/runtime/connectivity.d.ts +4 -0
- package/lib/runtime/connectivity.js +8 -0
- package/lib/runtime/conversationRead.d.ts +13 -0
- package/lib/runtime/conversationRead.js +34 -0
- package/lib/runtime/conversationReading.d.ts +28 -0
- package/lib/runtime/conversationReading.js +47 -0
- package/lib/runtime/createChat.d.ts +4 -5
- package/lib/runtime/createChat.js +14 -17
- package/lib/runtime/durableSender.d.ts +30 -4
- package/lib/runtime/durableSender.js +174 -34
- package/lib/runtime/index.d.ts +4 -0
- package/lib/runtime/index.js +4 -0
- package/lib/runtime/messageClient.d.ts +33 -6
- package/lib/runtime/messageClient.js +443 -71
- package/lib/runtime/messageControls.d.ts +19 -0
- package/lib/runtime/messageControls.js +44 -0
- package/lib/runtime/messageLaunch.d.ts +42 -0
- package/lib/runtime/messageLaunch.js +127 -0
- package/lib/runtime/messageQuotes.d.ts +3 -0
- package/lib/runtime/messageQuotes.js +17 -0
- package/lib/runtime/messageReaders.d.ts +12 -1
- package/lib/runtime/messageReaders.js +67 -3
- package/lib/runtime/messageStore.d.ts +47 -2
- package/lib/runtime/messageStore.js +233 -10
- package/lib/runtime/messageTimeline.d.ts +50 -0
- package/lib/runtime/messageTimeline.js +120 -0
- package/lib/runtime/readCounts.d.ts +15 -1
- package/lib/runtime/readCounts.js +96 -8
- package/lib/runtime/readIndex.d.ts +44 -6
- package/lib/runtime/readIndex.js +238 -11
- package/lib/runtime/readSync.d.ts +1 -0
- package/lib/runtime/readSync.js +21 -8
- package/lib/runtime/readingClient.d.ts +19 -0
- package/lib/runtime/readingClient.js +121 -18
- package/lib/runtime/readingContent.d.ts +5 -0
- package/lib/runtime/readingContent.js +23 -0
- package/lib/runtime/recordCache.d.ts +9 -0
- package/lib/runtime/recordCache.js +62 -5
- package/lib/runtime/responseCache.d.ts +44 -0
- package/lib/runtime/responseCache.js +173 -0
- package/package.json +6 -1
|
@@ -15,6 +15,8 @@ export type MessageTransport<T> = {
|
|
|
15
15
|
export type MessageSnapshot<T> = {
|
|
16
16
|
messages: readonly T[];
|
|
17
17
|
hasEarlier: boolean;
|
|
18
|
+
resetVersion: number;
|
|
19
|
+
complete: boolean;
|
|
18
20
|
};
|
|
19
21
|
export type MessageClientOptions<T extends StoredMessage> = {
|
|
20
22
|
scope: MessageScope;
|
|
@@ -34,6 +36,9 @@ export declare class MessageClient<T extends StoredMessage> {
|
|
|
34
36
|
private options;
|
|
35
37
|
private storage;
|
|
36
38
|
private watches;
|
|
39
|
+
private windowEdges;
|
|
40
|
+
private accessListeners;
|
|
41
|
+
private allListeners;
|
|
37
42
|
private reads;
|
|
38
43
|
private syncing;
|
|
39
44
|
private paging;
|
|
@@ -51,12 +56,32 @@ export declare class MessageClient<T extends StoredMessage> {
|
|
|
51
56
|
private queueBytes;
|
|
52
57
|
private pendingBytes;
|
|
53
58
|
private pendingRecords;
|
|
59
|
+
private legacyImports;
|
|
60
|
+
private revokingScope?;
|
|
61
|
+
private scopeReady?;
|
|
62
|
+
private scopeVersion;
|
|
63
|
+
private scopeAllowed;
|
|
64
|
+
private scopeDenied;
|
|
65
|
+
private enqueuing;
|
|
66
|
+
private ensureScope;
|
|
54
67
|
constructor(options: MessageClientOptions<T>);
|
|
68
|
+
/** Shared guard for sibling caches; it never authorizes a denied old instance. */
|
|
69
|
+
subscribeAccessRevoked(listener: () => void): () => void;
|
|
70
|
+
scopeAccess(): Promise<{
|
|
71
|
+
version: number;
|
|
72
|
+
allowed: boolean;
|
|
73
|
+
}>;
|
|
55
74
|
getSnapshot(thread: string): MessageSnapshot<T> | undefined;
|
|
56
75
|
subscribe(thread: string, listener: () => void): () => void;
|
|
57
|
-
|
|
76
|
+
subscribeAll(listener: (threadId: string) => void): () => void;
|
|
77
|
+
/** Close the connection gap for saved windows with four bounded background lanes. */
|
|
78
|
+
restore(since: number, threadId?: string): Promise<void>;
|
|
79
|
+
read(thread: string, limit?: number, refresh?: boolean): Promise<MessageSnapshot<T>>;
|
|
58
80
|
/** Application connection/wake events invalidate, rather than fetching directly. */
|
|
59
81
|
invalidate(thread: string): void;
|
|
82
|
+
private fallback;
|
|
83
|
+
/** Migration batches remain separate from authoritative message coverage. */
|
|
84
|
+
importLegacy(thread: string, messages: T[]): Promise<void>;
|
|
60
85
|
private reload;
|
|
61
86
|
/** Events are visible only after their atomic batch commits. */
|
|
62
87
|
receive(thread: string, messages: T[]): Promise<void>;
|
|
@@ -66,14 +91,16 @@ export declare class MessageClient<T extends StoredMessage> {
|
|
|
66
91
|
private flushWrites;
|
|
67
92
|
private runWrites;
|
|
68
93
|
synchronize(thread: string): Promise<void>;
|
|
94
|
+
/** Keep an explicitly requested history range in the shared subscribed view. */
|
|
95
|
+
expandWindow(thread: string, page: MessageSnapshot<T>): Promise<void>;
|
|
69
96
|
earlier(thread: string, before: {
|
|
70
97
|
timestamp: number;
|
|
71
98
|
id: string;
|
|
72
|
-
}, limit?: number): Promise<
|
|
73
|
-
messages: T[];
|
|
74
|
-
hasEarlier: boolean;
|
|
75
|
-
}>;
|
|
99
|
+
}, limit?: number, expand?: boolean): Promise<MessageSnapshot<T>>;
|
|
76
100
|
private fillWindow;
|
|
101
|
+
private denyView;
|
|
102
|
+
private denyScope;
|
|
103
|
+
revokeScope(): Promise<number>;
|
|
77
104
|
revoke(thread: string): Promise<void>;
|
|
78
|
-
close(): Promise<void>;
|
|
105
|
+
close(beforeDispose?: Promise<unknown>): Promise<void>;
|
|
79
106
|
}
|