@banta/sdk 5.1.0 → 5.2.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.
- package/esm2022/lib/banta-sdk.module.mjs +1 -9
- package/esm2022/lib/chat-backend-base.mjs +1 -1
- package/esm2022/lib/common/attachment/attachment.component.mjs +24 -10
- package/esm2022/lib/tweet-attachments.mjs +2 -2
- package/fesm2022/banta-sdk.mjs +24 -18
- package/fesm2022/banta-sdk.mjs.map +1 -1
- package/lib/chat-backend-base.d.ts +36 -1
- package/lib/chat-source.d.ts +3 -3
- package/lib/common/attachment/attachment.component.d.ts +2 -1
- package/lib/static-chat-source.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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-source.d.ts
CHANGED
|
@@ -19,11 +19,11 @@ export declare class ChatSource extends SocketRPC implements ChatSourceBase {
|
|
|
19
19
|
private _state;
|
|
20
20
|
get sortOrder(): "newest" | "oldest" | "likes";
|
|
21
21
|
get filterMode(): string;
|
|
22
|
-
get state(): "
|
|
23
|
-
set state(value: "
|
|
22
|
+
get state(): "lost" | "connected" | "connecting" | "restored";
|
|
23
|
+
set state(value: "lost" | "connected" | "connecting" | "restored");
|
|
24
24
|
private _connectionStateChanged;
|
|
25
25
|
private _connectionStateChanged$;
|
|
26
|
-
get connectionStateChanged(): import("rxjs").Observable<"
|
|
26
|
+
get connectionStateChanged(): import("rxjs").Observable<"lost" | "connected" | "connecting" | "restored">;
|
|
27
27
|
private wasRestored;
|
|
28
28
|
bind(socket: DurableSocket): Promise<this>;
|
|
29
29
|
private mapOrUpdateMessages;
|
|
@@ -16,9 +16,10 @@ export declare class BantaAttachmentComponent {
|
|
|
16
16
|
removed: Subject<void>;
|
|
17
17
|
activated: Subject<void>;
|
|
18
18
|
loaded: Subject<void>;
|
|
19
|
-
ngOnInit(): void;
|
|
20
19
|
private _viewLoaded;
|
|
21
20
|
ngAfterViewInit(): void;
|
|
21
|
+
private loadTwitterWidgets;
|
|
22
|
+
private loadPlatformSpecific;
|
|
22
23
|
private checkLoad;
|
|
23
24
|
activate(): void;
|
|
24
25
|
remove(): void;
|
|
@@ -36,7 +36,7 @@ export declare class StaticChatSource implements ChatSourceBase {
|
|
|
36
36
|
unlikeMessage(messageId: string): Promise<void>;
|
|
37
37
|
editMessage(messageId: string, text: string): Promise<void>;
|
|
38
38
|
deleteMessage(messageId: string): Promise<void>;
|
|
39
|
-
connectionStateChanged: Subject<"
|
|
39
|
+
connectionStateChanged: Subject<"lost" | "connected" | "connecting" | "restored">;
|
|
40
40
|
state: 'connecting' | 'connected' | 'lost' | 'restored';
|
|
41
41
|
get errorState(): any;
|
|
42
42
|
}
|