|
@@ -1,5 +1,5 @@
|
1
|
1
|
import { Client } from '@bilingo.com/ts-linker-sdk';
|
2
|
|
-import { ContactMsg, ContactAddMsg, ChatroomMsg } from './messages';
|
|
2
|
+import { ContactMsg, ContactAddMsg, ChatroomMsg, ConversationTop } from './messages';
|
3
|
3
|
export interface WebSocketClientStatus {
|
4
|
4
|
created: boolean;
|
5
|
5
|
connected: boolean;
|
|
@@ -24,73 +24,85 @@ export declare class WebSocketClient {
|
24
|
24
|
create(): Promise<{}>;
|
25
|
25
|
on(url: string, callback: (data: WebSocketResp) => void): void;
|
26
|
26
|
off(url: string): void;
|
27
|
|
- request(url: string, data: object): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
28
|
|
- connect(): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
29
|
|
- ping(): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
30
|
|
- authentication(): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
27
|
+ request(url: string, data: object): Promise<any>;
|
|
28
|
+ connect(): Promise<any>;
|
|
29
|
+ ping(): Promise<any>;
|
|
30
|
+ authentication(): Promise<any>;
|
31
|
31
|
onMessage(callback: ListenerCallback): Promise<void>;
|
32
|
|
- sendMessage(data: object): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
32
|
+ sendMessage(data: object): Promise<any>;
|
33
|
33
|
markServiced(data: {
|
34
|
34
|
msg_id: string;
|
35
|
|
- }): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
35
|
+ }): Promise<any>;
|
36
|
36
|
messageReaded(data: {
|
37
|
37
|
msg_id: string;
|
38
|
|
- }): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
38
|
+ }): Promise<any>;
|
39
|
39
|
getHistoryMessage(data: {
|
40
|
40
|
contact_id: string;
|
41
|
41
|
chat_type: string;
|
42
|
42
|
start_time: number;
|
43
|
43
|
limit: number;
|
44
|
|
- }): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
44
|
+ }): Promise<any>;
|
45
|
45
|
updateStatus(data: {
|
46
|
46
|
status: 'on' | 'off' | 'busy';
|
47
|
|
- }): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
48
|
|
- getSessionLists(): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
47
|
+ }): Promise<any>;
|
|
48
|
+ getSessionLists(): Promise<any>;
|
49
|
49
|
getAllConversations(data: {
|
50
|
50
|
last_pull: number;
|
51
|
|
- }): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
51
|
+ }): Promise<any>;
|
52
|
52
|
getAllContact(data: {
|
53
|
|
- last_pull: number;
|
54
|
|
- }): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
53
|
+ page: number;
|
|
54
|
+ limit: number;
|
|
55
|
+ }): Promise<any>;
|
55
|
56
|
addContact(data: {
|
56
|
57
|
to_add_username: string;
|
57
|
58
|
reason: string;
|
58
|
|
- }): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
59
|
|
- deleteContact(data: ContactMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
60
|
|
- maskingContact(data: ContactMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
61
|
|
- removeMaskingContact(data: ContactMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
62
|
|
- stickingContact(data: ContactMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
63
|
|
- removeStickContact(data: ContactMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
64
|
|
- setNoDisturbing(data: ContactMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
65
|
|
- removeNoDisturbing(data: ContactMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
66
|
|
- agreeAddContact(data: ContactAddMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
67
|
|
- rejectAddContact(data: ContactAddMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
68
|
|
- addContactServiced(data: ContactAddMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
59
|
+ }): Promise<any>;
|
|
60
|
+ deleteContact(data: ContactMsg): Promise<any>;
|
|
61
|
+ maskingContact(data: ContactMsg): Promise<any>;
|
|
62
|
+ removeMaskingContact(data: ContactMsg): Promise<any>;
|
|
63
|
+ stickingContact(data: ContactMsg): Promise<any>;
|
|
64
|
+ removeStickContact(data: ContactMsg): Promise<any>;
|
|
65
|
+ setNoDisturbing(data: ContactMsg): Promise<any>;
|
|
66
|
+ removeNoDisturbing(data: ContactMsg): Promise<any>;
|
|
67
|
+ agreeAddContact(data: ContactAddMsg): Promise<any>;
|
|
68
|
+ rejectAddContact(data: ContactAddMsg): Promise<any>;
|
|
69
|
+ addContactServiced(data: ContactAddMsg): Promise<any>;
|
69
|
70
|
createChatroom(data: {
|
70
|
71
|
subject: string;
|
71
|
72
|
description: string;
|
72
|
73
|
welcome_message: string;
|
73
|
74
|
max: number;
|
74
|
|
- }): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
75
|
|
- destroyChatroom(data: ChatroomMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
76
|
|
- leaveChatroom(data: ChatroomMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
77
|
|
- getChatroomProfile(data: ChatroomMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
78
|
|
- updateChatroomSubject(data: ChatroomMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
79
|
|
- updateChatroomDescription(data: ChatroomMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
80
|
|
- addChatroomAdmin(data: ChatroomMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
81
|
|
- removeChatroomAdmin(data: ChatroomMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
82
|
|
- addChatroomAdmins(data: ChatroomMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
83
|
|
- removeChatroomAdmins(data: ChatroomMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
84
|
|
- joinChatroom(data: {}): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
85
|
|
- removeChatroomMember(data: ChatroomMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
75
|
+ }): Promise<any>;
|
|
76
|
+ destroyChatroom(data: ChatroomMsg): Promise<any>;
|
|
77
|
+ leaveChatroom(data: ChatroomMsg): Promise<any>;
|
|
78
|
+ getChatroomProfile(data: ChatroomMsg): Promise<any>;
|
|
79
|
+ updateChatroomSubject(data: ChatroomMsg): Promise<any>;
|
|
80
|
+ updateChatroomDescription(data: ChatroomMsg): Promise<any>;
|
|
81
|
+ addChatroomAdmin(data: ChatroomMsg): Promise<any>;
|
|
82
|
+ removeChatroomAdmin(data: ChatroomMsg): Promise<any>;
|
|
83
|
+ addChatroomAdmins(data: ChatroomMsg): Promise<any>;
|
|
84
|
+ removeChatroomAdmins(data: ChatroomMsg): Promise<any>;
|
|
85
|
+ joinChatroom(data: {}): Promise<any>;
|
|
86
|
+ removeChatroomMember(data: ChatroomMsg): Promise<any>;
|
86
|
87
|
fetchStickChatroom(data: {
|
87
|
88
|
cache_time: number;
|
88
|
|
- }): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
89
|
|
- fetchChatroomMembers(data: ChatroomMsg): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
89
|
+ }): Promise<any>;
|
|
90
|
+ fetchChatroomMembers(data: ChatroomMsg): Promise<any>;
|
|
91
|
+ setConversationIsTop(data: ConversationTop): Promise<any>;
|
90
|
92
|
searchHistoryMessage(data: {
|
91
|
93
|
contact_id: string;
|
92
|
94
|
chat_type: string;
|
93
|
95
|
keyword: string;
|
94
|
96
|
limit: number;
|
95
|
|
- }): Promise<import("@bilingo.com/ts-linker-sdk/dist/types/types").WebSocketResp>;
|
|
97
|
+ }): Promise<any>;
|
|
98
|
+ startGroupChat(data: {
|
|
99
|
+ subject: string;
|
|
100
|
+ description?: string;
|
|
101
|
+ contact_list: {
|
|
102
|
+ id: string;
|
|
103
|
+ source: string;
|
|
104
|
+ }[];
|
|
105
|
+ welcome_message?: string;
|
|
106
|
+ group_type: number;
|
|
107
|
+ }): Promise<any>;
|
96
|
108
|
}
|