@banta/sdk 5.0.5 → 5.2.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { ChatMessage, CommentsOrder, Notification, User, UrlCard, FilterMode } from '@banta/common';
|
|
2
|
+
import { ChatMessage, CommentsOrder, Notification, User, UrlCard, FilterMode, Topic } from '@banta/common';
|
|
3
3
|
import { ChatSourceBase } from './chat-source-base';
|
|
4
4
|
import { AttachmentResolver, AttachmentScraper } from './attachment-scraper';
|
|
5
5
|
export interface ChatSourceOptions {
|
|
@@ -14,7 +14,42 @@ export declare abstract class ChatBackendBase {
|
|
|
14
14
|
constructor();
|
|
15
15
|
abstract getSourceForTopic(topicId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
16
16
|
abstract getSourceForThread(topicId: string, messageId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
17
|
+
/**
|
|
18
|
+
* Get the count of the given topic
|
|
19
|
+
* @param topicId
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
17
22
|
abstract getSourceCountForTopic(topicId: string): Promise<number>;
|
|
23
|
+
/**
|
|
24
|
+
* Get the count of the given topics.
|
|
25
|
+
* @param topicId Topics to count messages on. Maximum of 1000.
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
abstract getSourceCountForTopics(topicIds: string[]): Promise<Record<string, number>>;
|
|
29
|
+
/**
|
|
30
|
+
* Get information about the given topic.
|
|
31
|
+
* @param topicId
|
|
32
|
+
* @returns The topic object, or undefined if no such topic was found.
|
|
33
|
+
*/
|
|
34
|
+
abstract getTopic(topicId: string): Promise<Topic | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Get information about the given topics
|
|
37
|
+
* @param topicIds The topic IDs to look up. Maximum of 1000.
|
|
38
|
+
* @returns An array of matching topic objects.
|
|
39
|
+
*/
|
|
40
|
+
abstract getTopicsById(topicIds: string[]): Promise<Topic[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Get a set of messages from the given topic.
|
|
43
|
+
* @param topicId
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
abstract getMessages(topicId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number): Promise<ChatMessage[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Get a set of messages from the given topic.
|
|
49
|
+
* @param topicId
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
abstract getReplies(parentMessageId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number): Promise<ChatMessage[]>;
|
|
18
53
|
abstract refreshMessage(message: ChatMessage): Promise<ChatMessage>;
|
|
19
54
|
abstract getMessage(topicId: string, messageId: string): Promise<ChatMessage>;
|
|
20
55
|
abstract getSubMessage(topicId: string, parentMessageId: string, messageId: string): Promise<ChatMessage>;
|
package/lib/chat-backend.d.ts
CHANGED
|
@@ -26,11 +26,23 @@ export declare class ChatBackend extends ChatBackendBase {
|
|
|
26
26
|
*/
|
|
27
27
|
getSourceCountForTopic(topicId: string): Promise<number>;
|
|
28
28
|
/**
|
|
29
|
-
* Get the count of the given
|
|
30
|
-
* @param topicId
|
|
29
|
+
* Get the count of the given topics.
|
|
30
|
+
* @param topicId Topics to count messages on. Maximum of 1000.
|
|
31
31
|
* @returns
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
getSourceCountForTopics(topicIds: string[]): Promise<Record<string, number>>;
|
|
34
|
+
/**
|
|
35
|
+
* Get information about the given topic.
|
|
36
|
+
* @param topicId
|
|
37
|
+
* @returns The topic object, or undefined if no such topic was found.
|
|
38
|
+
*/
|
|
39
|
+
getTopic(topicId: string): Promise<Topic | undefined>;
|
|
40
|
+
/**
|
|
41
|
+
* Get information about the given topics
|
|
42
|
+
* @param topicIds The topic IDs to look up. Maximum of 1000.
|
|
43
|
+
* @returns An array of matching topic objects.
|
|
44
|
+
*/
|
|
45
|
+
getTopicsById(topicIds: string[]): Promise<Topic[]>;
|
|
34
46
|
/**
|
|
35
47
|
* Get a set of messages from the given topic.
|
|
36
48
|
* @param topicId
|