@cometchat/chat-sdk-javascript 4.0.0-beta1
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/dist/.DS_Store +0 -0
- package/dist/CometChat.js +1 -0
- package/dist/index.d.ts +5894 -0
- package/dist/javascript-chat-sdk/.git/COMMIT_EDITMSG +1 -0
- package/dist/javascript-chat-sdk/.git/FETCH_HEAD +4 -0
- package/dist/javascript-chat-sdk/.git/HEAD +1 -0
- package/dist/javascript-chat-sdk/.git/ORIG_HEAD +1 -0
- package/dist/javascript-chat-sdk/.git/config +19 -0
- package/dist/javascript-chat-sdk/.git/description +1 -0
- package/dist/javascript-chat-sdk/.git/hooks/applypatch-msg.sample +15 -0
- package/dist/javascript-chat-sdk/.git/hooks/commit-msg.sample +24 -0
- package/dist/javascript-chat-sdk/.git/hooks/fsmonitor-watchman.sample +174 -0
- package/dist/javascript-chat-sdk/.git/hooks/post-update.sample +8 -0
- package/dist/javascript-chat-sdk/.git/hooks/pre-applypatch.sample +14 -0
- package/dist/javascript-chat-sdk/.git/hooks/pre-commit.sample +49 -0
- package/dist/javascript-chat-sdk/.git/hooks/pre-merge-commit.sample +13 -0
- package/dist/javascript-chat-sdk/.git/hooks/pre-push.sample +53 -0
- package/dist/javascript-chat-sdk/.git/hooks/pre-rebase.sample +169 -0
- package/dist/javascript-chat-sdk/.git/hooks/pre-receive.sample +24 -0
- package/dist/javascript-chat-sdk/.git/hooks/prepare-commit-msg.sample +42 -0
- package/dist/javascript-chat-sdk/.git/hooks/push-to-checkout.sample +78 -0
- package/dist/javascript-chat-sdk/.git/hooks/update.sample +128 -0
- package/dist/javascript-chat-sdk/.git/index +0 -0
- package/dist/javascript-chat-sdk/.git/info/exclude +6 -0
- package/dist/javascript-chat-sdk/.git/logs/HEAD +13 -0
- package/dist/javascript-chat-sdk/.git/logs/refs/heads/master +1 -0
- package/dist/javascript-chat-sdk/.git/logs/refs/heads/master-v3 +3 -0
- package/dist/javascript-chat-sdk/.git/logs/refs/heads/master-v4 +4 -0
- package/dist/javascript-chat-sdk/.git/logs/refs/remotes/origin/HEAD +1 -0
- package/dist/javascript-chat-sdk/.git/logs/refs/remotes/origin/master-v3 +2 -0
- package/dist/javascript-chat-sdk/.git/logs/refs/remotes/origin/master-v4 +2 -0
- package/dist/javascript-chat-sdk/.git/logs/refs/stash +1 -0
- package/dist/javascript-chat-sdk/.git/objects/09/b9e17d9a0acd55c3644f4cfa19b1c40a139018 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/0f/2d8999b370e8ddb236f767aa565b2aa72a6b21 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/15/7f5161e31be14c74df7907c9c5046fbbea4461 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/17/89200f3f5621f9df6d08d1071c59557ce5a29d +0 -0
- package/dist/javascript-chat-sdk/.git/objects/26/1de108a0253f54cf37e8a072f7f5f0098c7e89 +4 -0
- package/dist/javascript-chat-sdk/.git/objects/43/7ffc94a259dcd818cca308ab60a2780714092d +1 -0
- package/dist/javascript-chat-sdk/.git/objects/4e/6ab6a981ea6dccdb60b6438d7ca142aef269fc +0 -0
- package/dist/javascript-chat-sdk/.git/objects/5e/04a3d79cebcc2b02c14ea807f839ea73d44461 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/65/bbff4d1cccc12285ea1c59a6f2082552f0d034 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/6a/a6ef178cb2e3775bb149aba99ace8399525da6 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/6b/e1ffe406de9ebb698ea891315b2b1459160029 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/6b/efb8e9de892be7ecee5d39c30c0aa17d43d727 +2 -0
- package/dist/javascript-chat-sdk/.git/objects/6e/f136ca41bbb5684639947fa121b7eebb795592 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/87/96f6311621c3ee4fc8d37eeec64a6c94e3e6ca +0 -0
- package/dist/javascript-chat-sdk/.git/objects/8b/2d226d44814b7265b68ab7953a87cd44d77965 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/9c/bc4afb06153fd276e240e709984bf1099386ba +0 -0
- package/dist/javascript-chat-sdk/.git/objects/a9/6c6710dfb57871b6eccda3a94d83990ba94d9f +0 -0
- package/dist/javascript-chat-sdk/.git/objects/ad/1b70a4bb12b3fe2e6306d2b0922582036f4e42 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/c1/655387f263ec50dbef8042099eead57dfe00c2 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/e0/ad85d968302e5447402ed4d0bc8ace931b9167 +0 -0
- package/dist/javascript-chat-sdk/.git/objects/e8/0b03094191c92690d5bb92b4271058f188efd1 +1 -0
- package/dist/javascript-chat-sdk/.git/objects/f0/cc86624ec0504ed24dcd6a7b2cdee917b73395 +2 -0
- package/dist/javascript-chat-sdk/.git/objects/f9/95e0e3dc98868eb6404f8cdd84632ae140e1ff +2 -0
- package/dist/javascript-chat-sdk/.git/objects/fb/d9b82e03d33337a8d2606fc9e2f1652ffda3de +0 -0
- package/dist/javascript-chat-sdk/.git/objects/pack/pack-efd6261f29a0c404693064c4a255aada38ddab72.idx +0 -0
- package/dist/javascript-chat-sdk/.git/objects/pack/pack-efd6261f29a0c404693064c4a255aada38ddab72.pack +0 -0
- package/dist/javascript-chat-sdk/.git/packed-refs +107 -0
- package/dist/javascript-chat-sdk/.git/refs/heads/master +1 -0
- package/dist/javascript-chat-sdk/.git/refs/heads/master-v3 +1 -0
- package/dist/javascript-chat-sdk/.git/refs/heads/master-v4 +1 -0
- package/dist/javascript-chat-sdk/.git/refs/remotes/origin/HEAD +1 -0
- package/dist/javascript-chat-sdk/.git/refs/remotes/origin/master-v3 +1 -0
- package/dist/javascript-chat-sdk/.git/refs/remotes/origin/master-v4 +1 -0
- package/dist/javascript-chat-sdk/.git/refs/stash +1 -0
- package/dist/javascript-chat-sdk/.gitignore +2 -0
- package/dist/javascript-chat-sdk/CometChat.d.ts +4732 -0
- package/dist/javascript-chat-sdk/CometChat.js +1 -0
- package/dist/javascript-chat-sdk/LICENSE.md +3 -0
- package/dist/javascript-chat-sdk/README.md +189 -0
- package/dist/javascript-chat-sdk/package.json +36 -0
- package/dist/package.json +36 -0
- package/dist/type/index.d.ts +10 -0
- package/dist/type/lib/BannedMembersRequest.d.ts +60 -0
- package/dist/type/lib/BlockedUsersRequest.d.ts +67 -0
- package/dist/type/lib/CallSettings.d.ts +429 -0
- package/dist/type/lib/CometChat.d.ts +1954 -0
- package/dist/type/lib/CometChatErrorConstants.d.ts +124 -0
- package/dist/type/lib/CometChatHelper.d.ts +26 -0
- package/dist/type/lib/Constants.d.ts +953 -0
- package/dist/type/lib/ConversationRequest.d.ts +89 -0
- package/dist/type/lib/GroupMembersRequest.d.ts +61 -0
- package/dist/type/lib/GroupsRequest.d.ts +78 -0
- package/dist/type/lib/Helper.d.ts +46 -0
- package/dist/type/lib/ListenerHandlers.d.ts +101 -0
- package/dist/type/lib/MessagesRequest.d.ts +188 -0
- package/dist/type/lib/UsersRequest.d.ts +142 -0
- package/dist/type/lib/WebSockets/WSConnectionHelper.d.ts +41 -0
- package/dist/type/lib/WebSockets/WSConstants.d.ts +71 -0
- package/dist/type/lib/WebSockets/WSHelper.d.ts +3 -0
- package/dist/type/lib/controllers/CallController.d.ts +151 -0
- package/dist/type/lib/controllers/ConversationController.d.ts +14 -0
- package/dist/type/lib/controllers/GroupMemberController.d.ts +10 -0
- package/dist/type/lib/controllers/GroupsController.d.ts +9 -0
- package/dist/type/lib/controllers/MessageController.d.ts +18 -0
- package/dist/type/lib/controllers/PresenceController.d.ts +0 -0
- package/dist/type/lib/controllers/TypingNotificationController.d.ts +14 -0
- package/dist/type/lib/controllers/UserAuthController.d.ts +10 -0
- package/dist/type/lib/controllers/UsersController.d.ts +9 -0
- package/dist/type/lib/localStore/KeyStore.d.ts +45 -0
- package/dist/type/lib/localStore/MessageListenerEventMaping.d.ts +56 -0
- package/dist/type/lib/localStore/MessagesStore.d.ts +72 -0
- package/dist/type/lib/localStore/UserStore.d.ts +72 -0
- package/dist/type/lib/localStore/store.d.ts +61 -0
- package/dist/type/lib/models/Action.d.ts +159 -0
- package/dist/type/lib/models/AppSettings.d.ts +135 -0
- package/dist/type/lib/models/BaseMessage.d.ts +259 -0
- package/dist/type/lib/models/CCExtension.d.ts +15 -0
- package/dist/type/lib/models/Call.d.ts +159 -0
- package/dist/type/lib/models/CometChatAuthEvent.d.ts +25 -0
- package/dist/type/lib/models/CometChatEvent.d.ts +25 -0
- package/dist/type/lib/models/CometChatMessageEvent.d.ts +9 -0
- package/dist/type/lib/models/CometChatPingEvent.d.ts +6 -0
- package/dist/type/lib/models/CometChatPresenceEvent.d.ts +15 -0
- package/dist/type/lib/models/CometChatReceiptEvent.d.ts +14 -0
- package/dist/type/lib/models/CometChatTransientEvent.d.ts +11 -0
- package/dist/type/lib/models/CometChatTypingEvent.d.ts +14 -0
- package/dist/type/lib/models/ConversationModel.d.ts +73 -0
- package/dist/type/lib/models/CustomError.d.ts +13 -0
- package/dist/type/lib/models/CustomMessage.d.ts +71 -0
- package/dist/type/lib/models/ErrorModel.d.ts +12 -0
- package/dist/type/lib/models/Group.d.ts +190 -0
- package/dist/type/lib/models/GroupMember.d.ts +43 -0
- package/dist/type/lib/models/Listner.d.ts +258 -0
- package/dist/type/lib/models/MediaDevice.d.ts +36 -0
- package/dist/type/lib/models/MediaMessage.d.ts +115 -0
- package/dist/type/lib/models/MessageReceipt.d.ts +99 -0
- package/dist/type/lib/models/RTCUser.d.ts +18 -0
- package/dist/type/lib/models/TextMessage.d.ts +84 -0
- package/dist/type/lib/models/TransientMessage.d.ts +48 -0
- package/dist/type/lib/models/TypingNotification.d.ts +52 -0
- package/dist/type/lib/models/UserModel.d.ts +175 -0
- package/dist/type/lib/models/UserPresence.d.ts +0 -0
- package/dist/type/lib/models/attachment.d.ts +74 -0
- package/dist/type/lib/rest-api/EndPointUtils.d.ts +9 -0
- package/dist/type/lib/rest-api/EndpointFactory.d.ts +28 -0
- package/dist/type/lib/rest-api/HttpHelper.d.ts +10 -0
- package/package.json +48 -0
- package/readme.md +189 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { User } from "../models/UserModel";
|
|
2
|
+
/**
|
|
3
|
+
* Wraper for local database. with store selector
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @class LocalStorage
|
|
7
|
+
*/
|
|
8
|
+
export declare class UserStore {
|
|
9
|
+
private static UserStore;
|
|
10
|
+
private userStore;
|
|
11
|
+
private store?;
|
|
12
|
+
private constructor();
|
|
13
|
+
/**
|
|
14
|
+
* Returns the singleton instace of the class.
|
|
15
|
+
* @returns {UserStore}
|
|
16
|
+
* @memberof UserStore
|
|
17
|
+
*/
|
|
18
|
+
static getInstance(): UserStore;
|
|
19
|
+
/**
|
|
20
|
+
*set the data in local storage with provided key.
|
|
21
|
+
*
|
|
22
|
+
* @param {String} key key with the data is stored in localstorage
|
|
23
|
+
* @param {*} value value provide that will be serialized and stored.
|
|
24
|
+
* @memberof localStorage
|
|
25
|
+
*/
|
|
26
|
+
set(key: string, value: any): any;
|
|
27
|
+
/**
|
|
28
|
+
* Delete the individual item from the storage
|
|
29
|
+
* @param key
|
|
30
|
+
*/
|
|
31
|
+
remove(key: string): void;
|
|
32
|
+
/**
|
|
33
|
+
*gets the value from the localstorage and provides back to user.
|
|
34
|
+
*
|
|
35
|
+
* @param {string} key
|
|
36
|
+
* @memberof localStorage
|
|
37
|
+
*/
|
|
38
|
+
get(key: string): any;
|
|
39
|
+
/**
|
|
40
|
+
*clear the user store.
|
|
41
|
+
*
|
|
42
|
+
* @returns
|
|
43
|
+
* @memberof UserStore
|
|
44
|
+
*/
|
|
45
|
+
clearStore(): Promise<unknown>;
|
|
46
|
+
/**
|
|
47
|
+
* clears the current store if not provided.
|
|
48
|
+
*
|
|
49
|
+
* @param {String} [store]
|
|
50
|
+
* @memberof localStorage
|
|
51
|
+
*/
|
|
52
|
+
clear(store?: String): void;
|
|
53
|
+
/**
|
|
54
|
+
*Change the store
|
|
55
|
+
*
|
|
56
|
+
* @param {String} store change the store can be selected ant time.
|
|
57
|
+
* @memberof localStorage
|
|
58
|
+
*/
|
|
59
|
+
selectStore(store?: String): void;
|
|
60
|
+
/**
|
|
61
|
+
* Stores the bulk users to user store for future use.
|
|
62
|
+
*
|
|
63
|
+
* @param messages accepts the message array and converts it to Object to store in database.
|
|
64
|
+
*/
|
|
65
|
+
storeUsers(users: User[]): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Stores the user to user store for future use.
|
|
68
|
+
*
|
|
69
|
+
* @param messages accepts the message array and converts it to Object to store in database.
|
|
70
|
+
*/
|
|
71
|
+
storeUser(user: User): boolean;
|
|
72
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*Wraper for local database. with store selector
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @class LocalStorage
|
|
6
|
+
*/
|
|
7
|
+
export declare class LocalStorage {
|
|
8
|
+
private static localStorage;
|
|
9
|
+
private localStore;
|
|
10
|
+
private store?;
|
|
11
|
+
private constructor();
|
|
12
|
+
/**
|
|
13
|
+
* Returns the singleton instace of the class.
|
|
14
|
+
* @returns {LocalStorage}
|
|
15
|
+
* @memberof LocalStorage
|
|
16
|
+
*/
|
|
17
|
+
static getInstance(): LocalStorage;
|
|
18
|
+
/**
|
|
19
|
+
*set the data in local storage with provided key.
|
|
20
|
+
*
|
|
21
|
+
* @param {String} key key with the data is stored in localstorage
|
|
22
|
+
* @param {*} value value provide that will be serialized and stored.
|
|
23
|
+
* @memberof localStorage
|
|
24
|
+
*/
|
|
25
|
+
set(key: string, value: any): any;
|
|
26
|
+
/**
|
|
27
|
+
* Delete the individual item from the storage
|
|
28
|
+
* @param key
|
|
29
|
+
*/
|
|
30
|
+
remove(key: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Update the individual item in the storage
|
|
33
|
+
* @param key
|
|
34
|
+
*/
|
|
35
|
+
update(key: string, value: any): void;
|
|
36
|
+
/**
|
|
37
|
+
*gets the value from the localstorage and provides back to user.
|
|
38
|
+
*
|
|
39
|
+
* @param {string} key
|
|
40
|
+
* @memberof localStorage
|
|
41
|
+
*/
|
|
42
|
+
get(key: string): Promise<Object>;
|
|
43
|
+
/**
|
|
44
|
+
* Clear the local store.
|
|
45
|
+
*/
|
|
46
|
+
clearStore(): Promise<unknown>;
|
|
47
|
+
/**
|
|
48
|
+
* clears the current store if not provided.
|
|
49
|
+
*
|
|
50
|
+
* @param {String} [store]
|
|
51
|
+
* @memberof localStorage
|
|
52
|
+
*/
|
|
53
|
+
clear(store?: String): void;
|
|
54
|
+
/**
|
|
55
|
+
*Change the store
|
|
56
|
+
*
|
|
57
|
+
* @param {String} store change the store can be selected ant time.
|
|
58
|
+
* @memberof localStorage
|
|
59
|
+
*/
|
|
60
|
+
selectStore(store?: String): void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @module Action
|
|
4
|
+
*/
|
|
5
|
+
import { BaseMessage, Message } from "./BaseMessage";
|
|
6
|
+
import { Group } from "./Group";
|
|
7
|
+
import { User } from "./UserModel";
|
|
8
|
+
export declare class Action extends BaseMessage implements Message {
|
|
9
|
+
static readonly TYPE: {
|
|
10
|
+
TEXT: string;
|
|
11
|
+
MEDIA: string;
|
|
12
|
+
IMAGE: string;
|
|
13
|
+
VIDEO: string;
|
|
14
|
+
AUDIO: string;
|
|
15
|
+
FILE: string;
|
|
16
|
+
CUSTOM: string;
|
|
17
|
+
};
|
|
18
|
+
static readonly RECEIVER_TYPE: {
|
|
19
|
+
USER: string;
|
|
20
|
+
GROUP: string;
|
|
21
|
+
};
|
|
22
|
+
static readonly CATEGORY: {
|
|
23
|
+
MESSAGE: string;
|
|
24
|
+
ACTION: string;
|
|
25
|
+
CALL: string;
|
|
26
|
+
CUSTOM: string;
|
|
27
|
+
};
|
|
28
|
+
static readonly ACTION_TYPE: {
|
|
29
|
+
TYPE_MEMBER_JOINED: string;
|
|
30
|
+
TYPE_MEMBER_LEFT: string;
|
|
31
|
+
TYPE_MEMBER_KICKED: string;
|
|
32
|
+
TYPE_MEMBER_BANNED: string;
|
|
33
|
+
TYPE_MEMBER_UNBANNED: string;
|
|
34
|
+
TYPE_MEMBER_INVITED: string;
|
|
35
|
+
TYPE_MEMBER_SCOPE_CHANGED: string;
|
|
36
|
+
TYPE_MESSAGE: string;
|
|
37
|
+
TYPE_MESSAGE_EDITED: string;
|
|
38
|
+
TYPE_MESSAGE_DELETED: string;
|
|
39
|
+
TYPE_MEMBER_ADDED: string;
|
|
40
|
+
};
|
|
41
|
+
private data?;
|
|
42
|
+
protected actionBy: User | Group | BaseMessage;
|
|
43
|
+
protected actionFor: User | Group | BaseMessage;
|
|
44
|
+
protected actionOn: User | Group | BaseMessage;
|
|
45
|
+
protected message: string;
|
|
46
|
+
protected rawData: any;
|
|
47
|
+
protected action: string;
|
|
48
|
+
protected oldScope: string;
|
|
49
|
+
protected newScope: string;
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
static actionFromJSON(rawMessage: any): Action | Message;
|
|
54
|
+
/**
|
|
55
|
+
* Method to get old scope of a member.
|
|
56
|
+
* @returns {string}
|
|
57
|
+
*/
|
|
58
|
+
getOldScope(): string;
|
|
59
|
+
/**
|
|
60
|
+
* @param {string} oldScope
|
|
61
|
+
* Method to set old scope of a member.
|
|
62
|
+
*/
|
|
63
|
+
setOldScope(oldScope: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* Method to get new scope of a member.
|
|
66
|
+
* @returns {string}
|
|
67
|
+
*/
|
|
68
|
+
getNewScope(): string;
|
|
69
|
+
/**
|
|
70
|
+
* @param {string} newScope
|
|
71
|
+
* Method to set new scope of a member.
|
|
72
|
+
*/
|
|
73
|
+
setNewScope(newScope: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* Method to get raw JSON data in string.
|
|
76
|
+
* @returns {string}
|
|
77
|
+
*/
|
|
78
|
+
getRawData(): any;
|
|
79
|
+
/**
|
|
80
|
+
* @param {any} rawData
|
|
81
|
+
* Method to set raw JSON data.
|
|
82
|
+
*/
|
|
83
|
+
setRawData(rawData: any): void;
|
|
84
|
+
/**
|
|
85
|
+
* Method to get the default action message.
|
|
86
|
+
* @returns {string}
|
|
87
|
+
*/
|
|
88
|
+
getMessage(): string;
|
|
89
|
+
/**
|
|
90
|
+
* @param {string} message
|
|
91
|
+
* Method to set the default action message.
|
|
92
|
+
*/
|
|
93
|
+
setMessage(message: string): void;
|
|
94
|
+
/**
|
|
95
|
+
* Method to get the action which is being performed.
|
|
96
|
+
* @returns {string}
|
|
97
|
+
*/
|
|
98
|
+
getAction(): string;
|
|
99
|
+
/**
|
|
100
|
+
* @param {string} action
|
|
101
|
+
* Method to set the default action message.
|
|
102
|
+
*/
|
|
103
|
+
setAction(action: string): void;
|
|
104
|
+
/**
|
|
105
|
+
* Method to get the sender of the action message.
|
|
106
|
+
* @returns {string}
|
|
107
|
+
*/
|
|
108
|
+
getSender(): User;
|
|
109
|
+
/**
|
|
110
|
+
* Method to get the entity which performed the action.
|
|
111
|
+
* @returns {User | Group | BaseMessage}
|
|
112
|
+
*/
|
|
113
|
+
getActionBy(): User | Group | BaseMessage;
|
|
114
|
+
/**
|
|
115
|
+
* @param {User | Group | BaseMessage} by
|
|
116
|
+
* Method to set the entity which performed the action.
|
|
117
|
+
*/
|
|
118
|
+
setActionBy(by: User | Group | BaseMessage): void;
|
|
119
|
+
/**
|
|
120
|
+
* Method to get the entity on which the action was performed.
|
|
121
|
+
* @returns {User | Group | BaseMessage}
|
|
122
|
+
*/
|
|
123
|
+
getActionOn(): User | Group | BaseMessage;
|
|
124
|
+
/**
|
|
125
|
+
* @param {User | Group | BaseMessage} on
|
|
126
|
+
* Method to set the entity on which the action was performed.
|
|
127
|
+
*/
|
|
128
|
+
setActionOn(on: User | Group | BaseMessage): void;
|
|
129
|
+
/**
|
|
130
|
+
* Method to get the entity for whom the action was performed.
|
|
131
|
+
* @returns {User | Group | BaseMessage | any}
|
|
132
|
+
*/
|
|
133
|
+
getActionFor(): User | Group | BaseMessage | any;
|
|
134
|
+
/**
|
|
135
|
+
* @param {User | Group | BaseMessage} for
|
|
136
|
+
* Method to set the entity for whom the action was performed.
|
|
137
|
+
*/
|
|
138
|
+
setActionFor(actionFor: User | Group | BaseMessage): void;
|
|
139
|
+
/**
|
|
140
|
+
* Method to get the metadata of the action message.
|
|
141
|
+
* @returns {any}
|
|
142
|
+
*/
|
|
143
|
+
getMetadata(): any;
|
|
144
|
+
/**
|
|
145
|
+
* @param {any} metadata
|
|
146
|
+
* Method to get the metadata of the action message.
|
|
147
|
+
*/
|
|
148
|
+
setMetadata(metadata: any): void;
|
|
149
|
+
/**
|
|
150
|
+
* Private method to generate the message sting to provide the message to user.
|
|
151
|
+
*
|
|
152
|
+
* @private
|
|
153
|
+
* @param {Action} action
|
|
154
|
+
* @returns {string}
|
|
155
|
+
* @memberof Action
|
|
156
|
+
*/
|
|
157
|
+
private getActionMessage;
|
|
158
|
+
private getSenderFromData;
|
|
159
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export declare class AppSettings {
|
|
2
|
+
static SUBSCRIPTION_TYPE_NONE: string;
|
|
3
|
+
static SUBSCRIPTION_TYPE_ALL_USERS: string;
|
|
4
|
+
static SUBSCRIPTION_TYPE_ROLES: string;
|
|
5
|
+
static SUBSCRIPTION_TYPE_FRIENDS: string;
|
|
6
|
+
/** @private */
|
|
7
|
+
static REGION_EU: string;
|
|
8
|
+
/** @private */
|
|
9
|
+
static REGION_US: string;
|
|
10
|
+
/** @private */
|
|
11
|
+
static REGION_IN: string;
|
|
12
|
+
/** @private */
|
|
13
|
+
static REGION_PRIVATE: string;
|
|
14
|
+
/** @private */
|
|
15
|
+
subscriptionType: string;
|
|
16
|
+
/** @private */
|
|
17
|
+
roles: string[];
|
|
18
|
+
/** @private */
|
|
19
|
+
region: string;
|
|
20
|
+
/** @private */
|
|
21
|
+
autoJoinGroup: boolean;
|
|
22
|
+
/** @private */
|
|
23
|
+
establishSocketConnection: boolean;
|
|
24
|
+
/** @private */
|
|
25
|
+
adminHost: string;
|
|
26
|
+
/** @private */
|
|
27
|
+
clientHost: string;
|
|
28
|
+
/**
|
|
29
|
+
* @private
|
|
30
|
+
* @param {AppSettingsBuilder}
|
|
31
|
+
*/
|
|
32
|
+
constructor(builder: AppSettingsBuilder);
|
|
33
|
+
/**
|
|
34
|
+
* This method returns the subscription type set using one of the following methods of the AppSettingsBuilder `subscribePresenceForAllUsers()`, `subscribePresenceForRoles()` or `subscribePresenceForFriends()`.
|
|
35
|
+
* @returns {string}
|
|
36
|
+
*/
|
|
37
|
+
getSubscriptionType(): string;
|
|
38
|
+
/**
|
|
39
|
+
* This method returns the roles set using the `setRoles()` of the AppSettingsBuilder.
|
|
40
|
+
* @returns {string[]}
|
|
41
|
+
*/
|
|
42
|
+
getRoles(): string[];
|
|
43
|
+
/**
|
|
44
|
+
* This method returns the region set using the `setRegion()` of the AppSettingsBuilder.
|
|
45
|
+
* @returns {string}
|
|
46
|
+
*/
|
|
47
|
+
getRegion(): string;
|
|
48
|
+
/**
|
|
49
|
+
* This method returns whether auto joining of group was enabled or not using the `enableAutoJoinForGroups()` of the AppSettingsBuilder.
|
|
50
|
+
* @returns {boolean}
|
|
51
|
+
*/
|
|
52
|
+
getIsAutoJoinEnabled(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* This method returns whether the SDK should connect to WebSocket server when a user logs-in or not.
|
|
55
|
+
* @returns {boolean}
|
|
56
|
+
*/
|
|
57
|
+
shouldAutoEstablishSocketConnection(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* This method returns the admin host to which the SDK should connect.
|
|
60
|
+
* @returns {boolean}
|
|
61
|
+
*/
|
|
62
|
+
getAdminHost(): string;
|
|
63
|
+
/**
|
|
64
|
+
* This method returns the client host to which the SDK should connect.
|
|
65
|
+
* @returns {boolean}
|
|
66
|
+
*/
|
|
67
|
+
getClientHost(): string;
|
|
68
|
+
}
|
|
69
|
+
export declare class AppSettingsBuilder {
|
|
70
|
+
/** @private */
|
|
71
|
+
subscriptionType: string;
|
|
72
|
+
/** @private */
|
|
73
|
+
roles: string[];
|
|
74
|
+
/** @private */
|
|
75
|
+
region: string;
|
|
76
|
+
/** @private */
|
|
77
|
+
autoJoinGroup: boolean;
|
|
78
|
+
/** @private */
|
|
79
|
+
establishSocketConnection: boolean;
|
|
80
|
+
/** @private */
|
|
81
|
+
adminHost: string;
|
|
82
|
+
/** @private */
|
|
83
|
+
clientHost: string;
|
|
84
|
+
/**
|
|
85
|
+
* A method to subscribe presence for all users.
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
88
|
+
subscribePresenceForAllUsers(): this;
|
|
89
|
+
/**
|
|
90
|
+
* @param {string[]} roles
|
|
91
|
+
* A method to subscribe presence for all roles.
|
|
92
|
+
* @returns
|
|
93
|
+
*/
|
|
94
|
+
subscribePresenceForRoles(roles: string[]): this;
|
|
95
|
+
/**
|
|
96
|
+
* A method to subscribe presence for friends.
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
subscribePresenceForFriends(): this;
|
|
100
|
+
/**
|
|
101
|
+
* @param {string} region
|
|
102
|
+
* A method to set region of the app.
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
105
|
+
setRegion(region?: string): this;
|
|
106
|
+
/**
|
|
107
|
+
* @param {boolean} isAutoJoinEnabled
|
|
108
|
+
* A method to enable/disable auto joining group. The default value is true.
|
|
109
|
+
* @returns
|
|
110
|
+
*/
|
|
111
|
+
enableAutoJoinForGroups(isAutoJoinEnabled?: boolean): this;
|
|
112
|
+
/**
|
|
113
|
+
* @param {boolean} establishSocketConnection
|
|
114
|
+
* A method to auto connect to WebSocket server when a user logs-in. The default value is true.
|
|
115
|
+
* @returns
|
|
116
|
+
*/
|
|
117
|
+
autoEstablishSocketConnection(establishSocketConnection?: boolean): this;
|
|
118
|
+
/**
|
|
119
|
+
* @param {string} adminHost
|
|
120
|
+
* This method is used to override the admin host which the SDK uses to make an API call.
|
|
121
|
+
* @returns
|
|
122
|
+
*/
|
|
123
|
+
overrideAdminHost(adminHost: string): this;
|
|
124
|
+
/**
|
|
125
|
+
* @param {string} clientHost
|
|
126
|
+
* This method is used to override the client host which the SDK uses to make an API call.
|
|
127
|
+
* @returns
|
|
128
|
+
*/
|
|
129
|
+
overrideClientHost(clientHost: string): this;
|
|
130
|
+
/**
|
|
131
|
+
* This method will return an object of the AppSettings class.
|
|
132
|
+
* @returns {AppSettings}
|
|
133
|
+
*/
|
|
134
|
+
build(): AppSettings;
|
|
135
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @module BaseMessage
|
|
4
|
+
*/
|
|
5
|
+
import { MessageCategory } from "../Constants";
|
|
6
|
+
import { User } from "./UserModel";
|
|
7
|
+
import { MessageReceipt } from './MessageReceipt';
|
|
8
|
+
import { Group } from "./Group";
|
|
9
|
+
export interface Message {
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
*Basic Message Object
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @class BaseMessage
|
|
16
|
+
*/
|
|
17
|
+
export declare class BaseMessage implements Message {
|
|
18
|
+
protected id?: number;
|
|
19
|
+
protected conversationId?: string;
|
|
20
|
+
protected parentMessageId?: number;
|
|
21
|
+
protected muid?: string;
|
|
22
|
+
protected sender?: User;
|
|
23
|
+
protected receiverId?: string;
|
|
24
|
+
protected receiver?: User | Group;
|
|
25
|
+
protected type?: string;
|
|
26
|
+
protected category?: MessageCategory;
|
|
27
|
+
protected receiverType?: string;
|
|
28
|
+
protected sentAt?: number;
|
|
29
|
+
protected deliveredAt?: number;
|
|
30
|
+
protected readAt?: number;
|
|
31
|
+
protected deliveredToMeAt?: number;
|
|
32
|
+
protected readByMeAt?: number;
|
|
33
|
+
protected metadata: Object;
|
|
34
|
+
protected status?: string;
|
|
35
|
+
protected receipts?: any[];
|
|
36
|
+
protected readReceipts?: MessageReceipt[];
|
|
37
|
+
protected deliveryReceipts?: MessageReceipt[];
|
|
38
|
+
protected editedAt: number;
|
|
39
|
+
protected editedBy: string;
|
|
40
|
+
protected deletedAt: number;
|
|
41
|
+
protected deletedBy: string;
|
|
42
|
+
protected replyCount: number;
|
|
43
|
+
protected rawMessage: Object;
|
|
44
|
+
constructor(receiverId: string, messageType: string, receiverType: string, category: MessageCategory);
|
|
45
|
+
/**
|
|
46
|
+
* Get ID of the message
|
|
47
|
+
* @returns {number}
|
|
48
|
+
*/
|
|
49
|
+
getId(): number;
|
|
50
|
+
/**
|
|
51
|
+
* @param {number} value
|
|
52
|
+
* Set ID of the message
|
|
53
|
+
*/
|
|
54
|
+
setId(value: number): void;
|
|
55
|
+
/**
|
|
56
|
+
* Get conversation ID of the message.
|
|
57
|
+
* @returns {string}
|
|
58
|
+
*/
|
|
59
|
+
getConversationId(): string;
|
|
60
|
+
/**
|
|
61
|
+
* @param {string} value
|
|
62
|
+
* Set conversation ID of the message.
|
|
63
|
+
*/
|
|
64
|
+
setConversationId(value: string): void;
|
|
65
|
+
/**
|
|
66
|
+
* Get parent message ID of the message.
|
|
67
|
+
* @returns {number}
|
|
68
|
+
*/
|
|
69
|
+
getParentMessageId(): number;
|
|
70
|
+
/**
|
|
71
|
+
* @param {number} value
|
|
72
|
+
* Set parent message ID of the message.
|
|
73
|
+
*/
|
|
74
|
+
setParentMessageId(value: number): void;
|
|
75
|
+
/**
|
|
76
|
+
* Get MUID of the message.
|
|
77
|
+
* @returns {string}
|
|
78
|
+
*/
|
|
79
|
+
getMuid(): string;
|
|
80
|
+
/**
|
|
81
|
+
* @param {string} value
|
|
82
|
+
* Sets the MUID of the message.
|
|
83
|
+
*/
|
|
84
|
+
setMuid(value: string): void;
|
|
85
|
+
/**
|
|
86
|
+
* Get sender of the message.
|
|
87
|
+
* @returns {User}
|
|
88
|
+
*/
|
|
89
|
+
getSender(): User;
|
|
90
|
+
/**
|
|
91
|
+
* @param {User} value
|
|
92
|
+
* Set sender of the message.
|
|
93
|
+
*/
|
|
94
|
+
setSender(value: User): void;
|
|
95
|
+
/**
|
|
96
|
+
* Get receiver of the message.
|
|
97
|
+
* @returns {User | Group}
|
|
98
|
+
*/
|
|
99
|
+
getReceiver(): User | Group;
|
|
100
|
+
/**
|
|
101
|
+
* @param {User | Group} value
|
|
102
|
+
* Set receiver of the message.
|
|
103
|
+
*/
|
|
104
|
+
setReceiver(value: User | Group): void;
|
|
105
|
+
/**
|
|
106
|
+
* Get receiverID of the message.
|
|
107
|
+
* @returns {string}
|
|
108
|
+
*/
|
|
109
|
+
getReceiverId(): string;
|
|
110
|
+
/**
|
|
111
|
+
* @param {string} value
|
|
112
|
+
* Set receiverId of the message.
|
|
113
|
+
*/
|
|
114
|
+
setReceiverId(value: string): void;
|
|
115
|
+
/**
|
|
116
|
+
* Get type of the message.
|
|
117
|
+
* @returns {string}
|
|
118
|
+
*/
|
|
119
|
+
getType(): string;
|
|
120
|
+
/**
|
|
121
|
+
* @param {string} value
|
|
122
|
+
* Set type of the message.
|
|
123
|
+
*/
|
|
124
|
+
setType(value: string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Get receiver type of the message.
|
|
127
|
+
* @returns {string}
|
|
128
|
+
*/
|
|
129
|
+
getReceiverType(): string;
|
|
130
|
+
/**
|
|
131
|
+
* @param {string} value
|
|
132
|
+
* Set the receiver type of the message.
|
|
133
|
+
*/
|
|
134
|
+
setReceiverType(value: string): void;
|
|
135
|
+
/**
|
|
136
|
+
* Get message's sentAt timestamp.
|
|
137
|
+
* @returns {number}
|
|
138
|
+
*/
|
|
139
|
+
getSentAt(): number;
|
|
140
|
+
/**
|
|
141
|
+
* @param {number} value
|
|
142
|
+
* Set message's sentAt timestamp.
|
|
143
|
+
*/
|
|
144
|
+
setSentAt(value: number): void;
|
|
145
|
+
/** @private */
|
|
146
|
+
getStatus(): string;
|
|
147
|
+
/** @private */
|
|
148
|
+
setStatus(value: string): void;
|
|
149
|
+
/**
|
|
150
|
+
* Get delivery timestamp of the message.
|
|
151
|
+
* @returns {number}
|
|
152
|
+
*/
|
|
153
|
+
getDeliveredAt(): number;
|
|
154
|
+
/**
|
|
155
|
+
* @param {number} deliveredAt
|
|
156
|
+
* Set delivery timestamp of the message.
|
|
157
|
+
*/
|
|
158
|
+
setDeliveredAt(deliveredAt: number): void;
|
|
159
|
+
/**
|
|
160
|
+
* Get timestamp of the message at which it was delivered to logged in user.
|
|
161
|
+
* @returns {number}
|
|
162
|
+
*/
|
|
163
|
+
getDeliveredToMeAt(): number;
|
|
164
|
+
/**
|
|
165
|
+
* @param {number} deliveredToMeAt
|
|
166
|
+
* Set timestamp of the message at which it was delivered to logged in user.
|
|
167
|
+
*/
|
|
168
|
+
setDeliveredToMeAt(deliveredToMeAt: number): void;
|
|
169
|
+
/**
|
|
170
|
+
* Get Timestamp of the when message was read at.
|
|
171
|
+
* @returns
|
|
172
|
+
*/
|
|
173
|
+
getReadAt(): number;
|
|
174
|
+
/**
|
|
175
|
+
* @param {number} readAt
|
|
176
|
+
* Set read timestamp of the message.
|
|
177
|
+
*/
|
|
178
|
+
setReadAt(readAt: number): void;
|
|
179
|
+
/**
|
|
180
|
+
* Get timestamp of the message at which it was read by the logged in user.
|
|
181
|
+
* @returns {number}
|
|
182
|
+
*/
|
|
183
|
+
getReadByMeAt(): number;
|
|
184
|
+
/**
|
|
185
|
+
* @param {number} readByMeAt
|
|
186
|
+
* Set timestamp of the message at which it was read by the logged in user.
|
|
187
|
+
*/
|
|
188
|
+
setReadByMeAt(readByMeAt: number): void;
|
|
189
|
+
/**
|
|
190
|
+
* Get category of the message.
|
|
191
|
+
* @returns {string}
|
|
192
|
+
*/
|
|
193
|
+
getCategory(): MessageCategory;
|
|
194
|
+
/**
|
|
195
|
+
* @param {string} category
|
|
196
|
+
* Set category of the message.
|
|
197
|
+
*/
|
|
198
|
+
setCategory(category: MessageCategory): void;
|
|
199
|
+
/**
|
|
200
|
+
* Get timestamp of the message when it was updated/edited.
|
|
201
|
+
* @returns
|
|
202
|
+
*/
|
|
203
|
+
getEditedAt(): number;
|
|
204
|
+
/**
|
|
205
|
+
* @param {number} editedAt
|
|
206
|
+
* Set timestamp of the message when it was updated/edited.
|
|
207
|
+
*/
|
|
208
|
+
setEditedAt(editedAt: number): void;
|
|
209
|
+
/**
|
|
210
|
+
* Get UID of the user who edited/updated the message.
|
|
211
|
+
* @returns
|
|
212
|
+
*/
|
|
213
|
+
getEditedBy(): string;
|
|
214
|
+
/**
|
|
215
|
+
* @param {string} editedBy
|
|
216
|
+
* Set UID of the user who edited/updated the message.
|
|
217
|
+
*/
|
|
218
|
+
setEditedBy(editedBy: string): void;
|
|
219
|
+
/**
|
|
220
|
+
* Get timestamp of the message when it was deleted.
|
|
221
|
+
* @returns {number}
|
|
222
|
+
*/
|
|
223
|
+
getDeletedAt(): number;
|
|
224
|
+
/**
|
|
225
|
+
* @param {number} deletedAt
|
|
226
|
+
* Set timestamp of the message when it was deleted.
|
|
227
|
+
*/
|
|
228
|
+
setDeletedAt(deletedAt: number): void;
|
|
229
|
+
/**
|
|
230
|
+
* Get UID of the user who deleted the message.
|
|
231
|
+
* @returns {number}
|
|
232
|
+
*/
|
|
233
|
+
getDeletedBy(): string;
|
|
234
|
+
/**
|
|
235
|
+
* @param {string} deletedBy
|
|
236
|
+
* Set UID of the user who deleted the message.
|
|
237
|
+
*/
|
|
238
|
+
setDeletedBy(deletedBy: string): void;
|
|
239
|
+
/**
|
|
240
|
+
* Get the number of replies of the message.
|
|
241
|
+
* @returns {number}
|
|
242
|
+
*/
|
|
243
|
+
getReplyCount(): number;
|
|
244
|
+
/**
|
|
245
|
+
* @param {number} value
|
|
246
|
+
* Set the number of replies of the message.
|
|
247
|
+
*/
|
|
248
|
+
setReplyCount(value: number): void;
|
|
249
|
+
/**
|
|
250
|
+
* Get the raw JSON of the message.
|
|
251
|
+
* @returns
|
|
252
|
+
*/
|
|
253
|
+
getRawMessage(): Object;
|
|
254
|
+
/**
|
|
255
|
+
* @param {Object} rawMessage
|
|
256
|
+
* Set the raw JSON of the message.
|
|
257
|
+
*/
|
|
258
|
+
setRawMessage(rawMessage: Object): void;
|
|
259
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class CCExtension {
|
|
2
|
+
private id;
|
|
3
|
+
private name;
|
|
4
|
+
constructor(extension: any);
|
|
5
|
+
/**
|
|
6
|
+
* This method returns the id of the extension.
|
|
7
|
+
* @returns {string}
|
|
8
|
+
*/
|
|
9
|
+
getId(): string;
|
|
10
|
+
/**
|
|
11
|
+
* This method returns the name of the extension.
|
|
12
|
+
* @returns {string}
|
|
13
|
+
*/
|
|
14
|
+
getName(): string;
|
|
15
|
+
}
|