@cometchat/chat-sdk-javascript 4.0.0-beta2 → 4.0.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/{dist/index.d.ts → CometChat.d.ts} +111 -0
- package/CometChat.js +1 -0
- package/{dist/javascript-chat-sdk/LICENSE.md → LICENSE.md} +1 -1
- package/{dist/javascript-chat-sdk/README.md → README.md} +2 -2
- package/package.json +31 -42
- package/dist/.DS_Store +0 -0
- package/dist/CometChat.js +0 -1
- package/dist/javascript-chat-sdk/.git/COMMIT_EDITMSG +0 -1
- package/dist/javascript-chat-sdk/.git/FETCH_HEAD +0 -4
- package/dist/javascript-chat-sdk/.git/HEAD +0 -1
- package/dist/javascript-chat-sdk/.git/ORIG_HEAD +0 -1
- package/dist/javascript-chat-sdk/.git/config +0 -19
- package/dist/javascript-chat-sdk/.git/description +0 -1
- package/dist/javascript-chat-sdk/.git/hooks/applypatch-msg.sample +0 -15
- package/dist/javascript-chat-sdk/.git/hooks/commit-msg.sample +0 -24
- package/dist/javascript-chat-sdk/.git/hooks/fsmonitor-watchman.sample +0 -174
- package/dist/javascript-chat-sdk/.git/hooks/post-update.sample +0 -8
- package/dist/javascript-chat-sdk/.git/hooks/pre-applypatch.sample +0 -14
- package/dist/javascript-chat-sdk/.git/hooks/pre-commit.sample +0 -49
- package/dist/javascript-chat-sdk/.git/hooks/pre-merge-commit.sample +0 -13
- package/dist/javascript-chat-sdk/.git/hooks/pre-push.sample +0 -53
- package/dist/javascript-chat-sdk/.git/hooks/pre-rebase.sample +0 -169
- package/dist/javascript-chat-sdk/.git/hooks/pre-receive.sample +0 -24
- package/dist/javascript-chat-sdk/.git/hooks/prepare-commit-msg.sample +0 -42
- package/dist/javascript-chat-sdk/.git/hooks/push-to-checkout.sample +0 -78
- package/dist/javascript-chat-sdk/.git/hooks/update.sample +0 -128
- package/dist/javascript-chat-sdk/.git/index +0 -0
- package/dist/javascript-chat-sdk/.git/info/exclude +0 -6
- package/dist/javascript-chat-sdk/.git/logs/HEAD +0 -13
- package/dist/javascript-chat-sdk/.git/logs/refs/heads/master +0 -1
- package/dist/javascript-chat-sdk/.git/logs/refs/heads/master-v3 +0 -3
- package/dist/javascript-chat-sdk/.git/logs/refs/heads/master-v4 +0 -4
- package/dist/javascript-chat-sdk/.git/logs/refs/remotes/origin/HEAD +0 -1
- package/dist/javascript-chat-sdk/.git/logs/refs/remotes/origin/master-v3 +0 -2
- package/dist/javascript-chat-sdk/.git/logs/refs/remotes/origin/master-v4 +0 -2
- package/dist/javascript-chat-sdk/.git/logs/refs/stash +0 -1
- 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 +0 -4
- package/dist/javascript-chat-sdk/.git/objects/43/7ffc94a259dcd818cca308ab60a2780714092d +0 -1
- 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 +0 -2
- 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 +0 -1
- package/dist/javascript-chat-sdk/.git/objects/f0/cc86624ec0504ed24dcd6a7b2cdee917b73395 +0 -2
- package/dist/javascript-chat-sdk/.git/objects/f9/95e0e3dc98868eb6404f8cdd84632ae140e1ff +0 -2
- 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 +0 -107
- package/dist/javascript-chat-sdk/.git/refs/heads/master +0 -1
- package/dist/javascript-chat-sdk/.git/refs/heads/master-v3 +0 -1
- package/dist/javascript-chat-sdk/.git/refs/heads/master-v4 +0 -1
- package/dist/javascript-chat-sdk/.git/refs/remotes/origin/HEAD +0 -1
- package/dist/javascript-chat-sdk/.git/refs/remotes/origin/master-v3 +0 -1
- package/dist/javascript-chat-sdk/.git/refs/remotes/origin/master-v4 +0 -1
- package/dist/javascript-chat-sdk/.git/refs/stash +0 -1
- package/dist/javascript-chat-sdk/.gitignore +0 -2
- package/dist/javascript-chat-sdk/CometChat.d.ts +0 -4732
- package/dist/javascript-chat-sdk/CometChat.js +0 -1
- package/dist/javascript-chat-sdk/package.json +0 -36
- package/dist/package.json +0 -36
- package/dist/type/index.d.ts +0 -10
- package/dist/type/lib/BannedMembersRequest.d.ts +0 -60
- package/dist/type/lib/BlockedUsersRequest.d.ts +0 -67
- package/dist/type/lib/CallSettings.d.ts +0 -429
- package/dist/type/lib/CometChat.d.ts +0 -1955
- package/dist/type/lib/CometChatErrorConstants.d.ts +0 -124
- package/dist/type/lib/CometChatHelper.d.ts +0 -26
- package/dist/type/lib/Constants.d.ts +0 -953
- package/dist/type/lib/ConversationRequest.d.ts +0 -89
- package/dist/type/lib/GroupMembersRequest.d.ts +0 -61
- package/dist/type/lib/GroupsRequest.d.ts +0 -78
- package/dist/type/lib/Helper.d.ts +0 -46
- package/dist/type/lib/ListenerHandlers.d.ts +0 -101
- package/dist/type/lib/MessagesRequest.d.ts +0 -188
- package/dist/type/lib/UsersRequest.d.ts +0 -142
- package/dist/type/lib/WebSockets/WSConnectionHelper.d.ts +0 -41
- package/dist/type/lib/WebSockets/WSConstants.d.ts +0 -71
- package/dist/type/lib/WebSockets/WSHelper.d.ts +0 -3
- package/dist/type/lib/controllers/CallController.d.ts +0 -151
- package/dist/type/lib/controllers/ConversationController.d.ts +0 -14
- package/dist/type/lib/controllers/GroupMemberController.d.ts +0 -10
- package/dist/type/lib/controllers/GroupsController.d.ts +0 -9
- package/dist/type/lib/controllers/MessageController.d.ts +0 -18
- package/dist/type/lib/controllers/PresenceController.d.ts +0 -0
- package/dist/type/lib/controllers/TypingNotificationController.d.ts +0 -14
- package/dist/type/lib/controllers/UserAuthController.d.ts +0 -10
- package/dist/type/lib/controllers/UsersController.d.ts +0 -9
- package/dist/type/lib/localStore/KeyStore.d.ts +0 -45
- package/dist/type/lib/localStore/MessageListenerEventMaping.d.ts +0 -56
- package/dist/type/lib/localStore/MessagesStore.d.ts +0 -72
- package/dist/type/lib/localStore/UserStore.d.ts +0 -72
- package/dist/type/lib/localStore/store.d.ts +0 -61
- package/dist/type/lib/models/Action.d.ts +0 -159
- package/dist/type/lib/models/AppSettings.d.ts +0 -135
- package/dist/type/lib/models/BaseMessage.d.ts +0 -259
- package/dist/type/lib/models/CCExtension.d.ts +0 -15
- package/dist/type/lib/models/Call.d.ts +0 -159
- package/dist/type/lib/models/CometChatAuthEvent.d.ts +0 -25
- package/dist/type/lib/models/CometChatEvent.d.ts +0 -25
- package/dist/type/lib/models/CometChatMessageEvent.d.ts +0 -9
- package/dist/type/lib/models/CometChatPingEvent.d.ts +0 -6
- package/dist/type/lib/models/CometChatPresenceEvent.d.ts +0 -15
- package/dist/type/lib/models/CometChatReceiptEvent.d.ts +0 -14
- package/dist/type/lib/models/CometChatTransientEvent.d.ts +0 -11
- package/dist/type/lib/models/CometChatTypingEvent.d.ts +0 -14
- package/dist/type/lib/models/ConversationModel.d.ts +0 -73
- package/dist/type/lib/models/CustomError.d.ts +0 -13
- package/dist/type/lib/models/CustomMessage.d.ts +0 -71
- package/dist/type/lib/models/ErrorModel.d.ts +0 -12
- package/dist/type/lib/models/Group.d.ts +0 -190
- package/dist/type/lib/models/GroupMember.d.ts +0 -43
- package/dist/type/lib/models/Listner.d.ts +0 -258
- package/dist/type/lib/models/MediaDevice.d.ts +0 -36
- package/dist/type/lib/models/MediaMessage.d.ts +0 -115
- package/dist/type/lib/models/MessageReceipt.d.ts +0 -99
- package/dist/type/lib/models/RTCUser.d.ts +0 -18
- package/dist/type/lib/models/TextMessage.d.ts +0 -84
- package/dist/type/lib/models/TransientMessage.d.ts +0 -48
- package/dist/type/lib/models/TypingNotification.d.ts +0 -52
- package/dist/type/lib/models/UserModel.d.ts +0 -175
- package/dist/type/lib/models/UserPresence.d.ts +0 -0
- package/dist/type/lib/models/attachment.d.ts +0 -74
- package/dist/type/lib/rest-api/EndPointUtils.d.ts +0 -9
- package/dist/type/lib/rest-api/EndpointFactory.d.ts +0 -28
- package/dist/type/lib/rest-api/HttpHelper.d.ts +0 -10
- package/readme.md +0 -189
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/** @private */
|
|
2
|
-
export interface UserObj {
|
|
3
|
-
uid: string;
|
|
4
|
-
name: string;
|
|
5
|
-
authToken: string;
|
|
6
|
-
avatar: string;
|
|
7
|
-
lastActiveAt: number;
|
|
8
|
-
link: string;
|
|
9
|
-
metadata: string;
|
|
10
|
-
role: string;
|
|
11
|
-
status: string;
|
|
12
|
-
statusMessage: string;
|
|
13
|
-
tags: Array<string>;
|
|
14
|
-
deactivatedAt: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Implementation of UserObject
|
|
18
|
-
*/
|
|
19
|
-
export declare class User {
|
|
20
|
-
private uid;
|
|
21
|
-
private name;
|
|
22
|
-
private authToken;
|
|
23
|
-
private avatar;
|
|
24
|
-
private lastActiveAt;
|
|
25
|
-
private link;
|
|
26
|
-
private metadata;
|
|
27
|
-
private role;
|
|
28
|
-
private status;
|
|
29
|
-
private statusMessage;
|
|
30
|
-
private hasBlockedMe;
|
|
31
|
-
private blockedByMe;
|
|
32
|
-
private tags;
|
|
33
|
-
private deactivatedAt;
|
|
34
|
-
/**
|
|
35
|
-
* Method to get UID of the user.
|
|
36
|
-
* @returns {string}
|
|
37
|
-
*/
|
|
38
|
-
getUid(): string;
|
|
39
|
-
/**
|
|
40
|
-
* Method to set UID of the user.
|
|
41
|
-
* @param {string} uid
|
|
42
|
-
*/
|
|
43
|
-
setUid(uid: string): void;
|
|
44
|
-
/**
|
|
45
|
-
* Method to get name of the user.
|
|
46
|
-
* @returns {string}
|
|
47
|
-
*/
|
|
48
|
-
getName(): string;
|
|
49
|
-
/**
|
|
50
|
-
* Method to set name of the user.
|
|
51
|
-
* @param {string} name
|
|
52
|
-
*/
|
|
53
|
-
setName(name: string): void;
|
|
54
|
-
/**
|
|
55
|
-
* Method to get authToken of the user.
|
|
56
|
-
* @returns {string}
|
|
57
|
-
*/
|
|
58
|
-
getAuthToken(): string;
|
|
59
|
-
/**
|
|
60
|
-
* Method to set authToken of the user.
|
|
61
|
-
* @param {string} authToken
|
|
62
|
-
*/
|
|
63
|
-
setAuthToken(authToken: string): void;
|
|
64
|
-
/**
|
|
65
|
-
* Method to get avatar of the user.
|
|
66
|
-
* @returns {string}
|
|
67
|
-
*/
|
|
68
|
-
getAvatar(): string;
|
|
69
|
-
/**
|
|
70
|
-
* Method to set avatar of the user.
|
|
71
|
-
* @param {string} avatar
|
|
72
|
-
*/
|
|
73
|
-
setAvatar(avatar: string): void;
|
|
74
|
-
/**
|
|
75
|
-
* Method to get last active at timestamp of the user.
|
|
76
|
-
* @returns {number}
|
|
77
|
-
*/
|
|
78
|
-
getLastActiveAt(): number;
|
|
79
|
-
/**
|
|
80
|
-
* Method to set last active at timestamp of the user.
|
|
81
|
-
* @param {number} lastActiveAt
|
|
82
|
-
*/
|
|
83
|
-
setLastActiveAt(lastActiveAt: number): void;
|
|
84
|
-
/**
|
|
85
|
-
* Method to get link of the user.
|
|
86
|
-
* @returns {string}
|
|
87
|
-
*/
|
|
88
|
-
getLink(): string;
|
|
89
|
-
/**
|
|
90
|
-
* Method to set link of the user.
|
|
91
|
-
* @param {string} link
|
|
92
|
-
*/
|
|
93
|
-
setLink(link: string): string;
|
|
94
|
-
/**
|
|
95
|
-
* Method to get metadata of the user.
|
|
96
|
-
* @returns {string}
|
|
97
|
-
*/
|
|
98
|
-
getMetadata(): string;
|
|
99
|
-
/**
|
|
100
|
-
* Method to set metadata of the user.
|
|
101
|
-
* @param {string} metadata
|
|
102
|
-
*/
|
|
103
|
-
setMetadata(metadata: string): void;
|
|
104
|
-
/**
|
|
105
|
-
* Method to get role of the user.
|
|
106
|
-
* @returns {string}
|
|
107
|
-
*/
|
|
108
|
-
getRole(): string;
|
|
109
|
-
/**
|
|
110
|
-
* Method to set role of the user.
|
|
111
|
-
* @param {string} role
|
|
112
|
-
*/
|
|
113
|
-
setRole(role: string): void;
|
|
114
|
-
/**
|
|
115
|
-
* Method to get status of the user.
|
|
116
|
-
* @returns {string}
|
|
117
|
-
*/
|
|
118
|
-
getStatus(): string;
|
|
119
|
-
/**
|
|
120
|
-
* Method to set status of the user.
|
|
121
|
-
* @param {string} status
|
|
122
|
-
*/
|
|
123
|
-
setStatus(status: string): void;
|
|
124
|
-
/**
|
|
125
|
-
* Method to get status message of the user.
|
|
126
|
-
* @returns {string}
|
|
127
|
-
*/
|
|
128
|
-
getStatusMessage(): string;
|
|
129
|
-
/**
|
|
130
|
-
* Method to set status message of the user.
|
|
131
|
-
* @param {string} statusMessage
|
|
132
|
-
*/
|
|
133
|
-
setStatusMessage(statusMessage: string): void;
|
|
134
|
-
setBlockedByMe(blockedByMe: boolean): void;
|
|
135
|
-
/**
|
|
136
|
-
* Method to know if the logged-in user has blocked the other user.
|
|
137
|
-
* @returns {boolean}
|
|
138
|
-
*/
|
|
139
|
-
getBlockedByMe(): boolean;
|
|
140
|
-
setHasBlockedMe(hasBlockedMe: boolean): void;
|
|
141
|
-
/**
|
|
142
|
-
* Method to know if the logged-in user has been blocked by the other user.
|
|
143
|
-
* @returns {boolean}
|
|
144
|
-
*/
|
|
145
|
-
getHasBlockedMe(): boolean;
|
|
146
|
-
/**
|
|
147
|
-
* Method to set tags of the user.
|
|
148
|
-
* @param {string[]} tags
|
|
149
|
-
*/
|
|
150
|
-
setTags(tags: Array<string>): void;
|
|
151
|
-
/**
|
|
152
|
-
* Method to get tags of the user.
|
|
153
|
-
* @returns {string[]}
|
|
154
|
-
*/
|
|
155
|
-
getTags(): Array<string>;
|
|
156
|
-
/**
|
|
157
|
-
* Method to set deactivatedAt timestamp of a user.
|
|
158
|
-
* @param {number} deactivatedAt
|
|
159
|
-
*/
|
|
160
|
-
setDeactivatedAt(deactivatedAt: number): void;
|
|
161
|
-
/**
|
|
162
|
-
* Method to get deactivatedAt timestamp of a user.
|
|
163
|
-
* @returns {number}
|
|
164
|
-
*/
|
|
165
|
-
getDeactivatedAt(): number;
|
|
166
|
-
constructor(...userObj: any[]);
|
|
167
|
-
}
|
|
168
|
-
/** @private */
|
|
169
|
-
export declare class Me extends User {
|
|
170
|
-
private wsChannel;
|
|
171
|
-
private jwt;
|
|
172
|
-
constructor(userObj: UserObj | any);
|
|
173
|
-
getWsChannel(): any;
|
|
174
|
-
getJWT(): string;
|
|
175
|
-
}
|
|
File without changes
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
export declare class Attachment {
|
|
2
|
-
private extension;
|
|
3
|
-
private mimeType;
|
|
4
|
-
private name;
|
|
5
|
-
private size;
|
|
6
|
-
private url;
|
|
7
|
-
constructor(file: Object);
|
|
8
|
-
/**
|
|
9
|
-
* Create the file object from the provided JSON Object.
|
|
10
|
-
* @private
|
|
11
|
-
* @param {Object} file
|
|
12
|
-
* @returns {FileObject}
|
|
13
|
-
* @memberof FileObject
|
|
14
|
-
*/
|
|
15
|
-
createFileFromJSON(file: Object): Attachment;
|
|
16
|
-
/**
|
|
17
|
-
* Converts the FileObject to JSON Object.
|
|
18
|
-
* @private
|
|
19
|
-
* @param {FileObject} fileObject
|
|
20
|
-
* @returns {Object}
|
|
21
|
-
* @memberof FileObject
|
|
22
|
-
*/
|
|
23
|
-
static toJSON(attachment: Attachment): Object;
|
|
24
|
-
/**
|
|
25
|
-
* Get extension of the file.
|
|
26
|
-
* @returns {string}
|
|
27
|
-
*/
|
|
28
|
-
getExtension(): string;
|
|
29
|
-
/**
|
|
30
|
-
* Method to set extension of the file.
|
|
31
|
-
* @param {string} extension
|
|
32
|
-
*/
|
|
33
|
-
setExtension(extension: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* Get mime type of the file.
|
|
36
|
-
* @returns {string}
|
|
37
|
-
*/
|
|
38
|
-
getMimeType(): string;
|
|
39
|
-
/**
|
|
40
|
-
* Method to set mimeType of the file.
|
|
41
|
-
* @param {string} mimeType
|
|
42
|
-
*/
|
|
43
|
-
setMimeType(mimeType: string): void;
|
|
44
|
-
/**
|
|
45
|
-
* Get name of the file.
|
|
46
|
-
* @returns {string}
|
|
47
|
-
*/
|
|
48
|
-
getName(): string;
|
|
49
|
-
/**
|
|
50
|
-
* Method to set name of the file.
|
|
51
|
-
* @param {string} name
|
|
52
|
-
*/
|
|
53
|
-
setName(name: string): void;
|
|
54
|
-
/**
|
|
55
|
-
* Get size of the file.
|
|
56
|
-
* @returns {string}
|
|
57
|
-
*/
|
|
58
|
-
getSize(): number;
|
|
59
|
-
/**
|
|
60
|
-
* Method to set size of the file.
|
|
61
|
-
* @param {string} name
|
|
62
|
-
*/
|
|
63
|
-
setSize(size: number): void;
|
|
64
|
-
/**
|
|
65
|
-
* Get URL of the file.
|
|
66
|
-
* @returns {string}
|
|
67
|
-
*/
|
|
68
|
-
getUrl(): string;
|
|
69
|
-
/**
|
|
70
|
-
* Method to set URL of the file.
|
|
71
|
-
* @param {string} name
|
|
72
|
-
*/
|
|
73
|
-
setUrl(url: string): void;
|
|
74
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*Endpoint factory class which will give enpoint data to client.
|
|
3
|
-
*
|
|
4
|
-
* @export
|
|
5
|
-
* @class EndpointFactory
|
|
6
|
-
*/
|
|
7
|
-
export declare class EndpointFactory {
|
|
8
|
-
baseUrl: string;
|
|
9
|
-
apiVersion: string;
|
|
10
|
-
adminApiUrl: string;
|
|
11
|
-
adminApiVersion: string;
|
|
12
|
-
extensionApi: string;
|
|
13
|
-
prosodyApi: string;
|
|
14
|
-
wsApi: string;
|
|
15
|
-
/**
|
|
16
|
-
* FIXME: Need to use string templating.
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* User AuthToken generation Endpoints:
|
|
20
|
-
*/
|
|
21
|
-
private uriEndpoints;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param endpointName accepts enpoint name
|
|
25
|
-
* @returns enpoint object with type, headers,and expected data
|
|
26
|
-
*/
|
|
27
|
-
getEndpointData(endpointName: string): Promise<Object>;
|
|
28
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @export
|
|
3
|
-
* @param {string} [endPointName=""]
|
|
4
|
-
* @param {object} [params={}]
|
|
5
|
-
* @param {*} [data={}]
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare function makeApiCall(endPointName?: string, params?: object, data?: any, isFile?: boolean): any;
|
|
9
|
-
export declare function makeAdminApiCall(endPointName?: string, params?: object, data?: any, isFile?: boolean): any;
|
|
10
|
-
export declare function postData(url?: string, method?: string, data?: any, headers?: any, isFile?: boolean): any;
|
package/readme.md
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
<div style="width:100%">
|
|
2
|
-
<div style="width:100%">
|
|
3
|
-
<div style="width:50%; display:inline-block">
|
|
4
|
-
<p align="center">
|
|
5
|
-
<img style="text-align:center" width="180" height="180" alt="" src="https://avatars2.githubusercontent.com/u/45484907?s=200&v=4">
|
|
6
|
-
</p>
|
|
7
|
-
</div>
|
|
8
|
-
</div>
|
|
9
|
-
</br>
|
|
10
|
-
</br>
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
# CometChat Javascript SDK
|
|
14
|
-
|
|
15
|
-
CometChat Pro enables you to add voice, video & text chat for your website & app.
|
|
16
|
-
This guide demonstrates how to add chat to a WebSite using CometChat Pro.
|
|
17
|
-
|
|
18
|
-
## Features
|
|
19
|
-
|
|
20
|
-
<ul>
|
|
21
|
-
<li> 1-1 & Group Conversations </li>
|
|
22
|
-
<li> Voice & video calling & conferencing </li>
|
|
23
|
-
<li> Rich Media Attachments </li>
|
|
24
|
-
<li> Typing Indicators </li>
|
|
25
|
-
<li> Custom Messages </li>
|
|
26
|
-
<li> Read receipts </li>
|
|
27
|
-
<li> Online Presence Indicators </li>
|
|
28
|
-
<li> Message History </li>
|
|
29
|
-
<li> Single Sign-on </li>
|
|
30
|
-
<li> Webhooks </li>
|
|
31
|
-
<li> Bots </li>
|
|
32
|
-
<li> Users & Friends List </li>
|
|
33
|
-
<li> Groups List </li>
|
|
34
|
-
<li> Conversations List </li>
|
|
35
|
-
<li> Threaded Conversations </li>
|
|
36
|
-
</ul>
|
|
37
|
-
|
|
38
|
-
## Extensions
|
|
39
|
-
|
|
40
|
-
[Push Notification](https://prodocs.cometchat.com/docs/extensions-enhanced-push-notification) | [Email Notification](https://prodocs.cometchat.com/docs/extensions-email-notification) | [SMS Notification](https://prodocs.cometchat.com/docs/extensions-sms-notification) | [Thumbnail Generation](https://prodocs.cometchat.com/docs/extensions-thumbnail-generation) | [Link Preview](https://prodocs.cometchat.com/docs/extensions-link-preview) | [Rich Media Preview](https://prodocs.cometchat.com/docs/extensions-rich-media-preview) | [Voice Transcription](https://prodocs.cometchat.com/docs/extensions-voice-transcription) | [Smart Reply](https://prodocs.cometchat.com/docs/extensions-smart-reply) | [Message Translation](https://prodocs.cometchat.com/docs/extensions-message-translation) | [Emojis](https://prodocs.cometchat.com/docs/extensions-emojis) | [Polls](https://prodocs.cometchat.com/docs/extensions-polls) | [Reactions](https://prodocs.cometchat.com/docs/extensions-reactions) | [Stickers](https://prodocs.cometchat.com/docs/extensions-stickers) | [Video Broadcasting](https://prodocs.cometchat.com/docs/extensions-broadcast) | [Collaborative Documents](https://prodocs.cometchat.com/docs/extensions-collaborative-document) | [Collaborative Whiteboards](https://prodocs.cometchat.com/docs/extensions-collaborative-whiteboard) | [Data Masking Filter](https://prodocs.cometchat.com/docs/extensions-data-masking-filter) | [Profanity Filter](https://prodocs.cometchat.com/docs/extensions-profanity-filter) | [Image Moderation](https://prodocs.cometchat.com/docs/extensions-image-moderation)| [Sentiment Analysis](https://prodocs.cometchat.com/docs/extensions-sentiment-analysis) | [In-flight Message Moderation](https://prodocs.cometchat.com/docs/extensions-in-flight-message-moderation) | [Virus & Malware Scanner](https://prodocs.cometchat.com/docs/extensions-virus-malware-scanner) | [XSS Filter](https://prodocs.cometchat.com/docs/extensions-xss-filter)
|
|
41
|
-
|
|
42
|
-
[](#)
|
|
43
|
-
<a href=" "> <img src="https://img.shields.io/badge/Version-3.0.0-beta1-important" /></a>
|
|
44
|
-

|
|
45
|
-

|
|
46
|
-

|
|
47
|
-

|
|
48
|
-
<hr/>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## Prerequisites :star:
|
|
52
|
-
Before you begin, ensure you have met the following requirements:<br/>
|
|
53
|
-
✅ You have [`Visual Studio Code`](https://code.visualstudio.com/) or any other code editor installed in your machine.<br/>
|
|
54
|
-
✅ You have [`npm`](https://www.npmjs.com/get-npm) installed in your machine.<br/>
|
|
55
|
-
✅ You have read [CometChat Key Concepts](https://prodocs.cometchat.com/docs/concepts).<br/>
|
|
56
|
-
|
|
57
|
-
<hr/>
|
|
58
|
-
|
|
59
|
-
## Installing CometChat Javascript SDK
|
|
60
|
-
## Setup :wrench:
|
|
61
|
-
|
|
62
|
-
To setup Javascript SDK, you need to first register on CometChat Dashboard. [Click here to sign up](https://app.cometchat.com/login).
|
|
63
|
-
|
|
64
|
-
### i. Get your Application Keys :key:
|
|
65
|
-
|
|
66
|
-
<a href="https://app.cometchat.io" target="_blank">Signup for CometChat</a> and then:
|
|
67
|
-
|
|
68
|
-
1. Create a new app: Click **Add App** option available → Enter App Name & other information → Create App
|
|
69
|
-
2. At the Top in **QuickStart** section you will find **Auth Key** & **App ID** or else you can head over to the **API & Auth Keys** section and note the **Auth Key** and **App ID**
|
|
70
|
-
<img align="center" src="https://files.readme.io/4b771c5-qs_copy.jpg"/>
|
|
71
|
-
|
|
72
|
-
<hr/>
|
|
73
|
-
|
|
74
|
-
### ii. Add the CometChat Dependency
|
|
75
|
-
<ul>
|
|
76
|
-
<li>
|
|
77
|
-
<b>Install via NPM</b><br/>
|
|
78
|
-
1. Run the following command to install the CometChat Pro Javascript SDK<br/>
|
|
79
|
-
|
|
80
|
-
```javascript
|
|
81
|
-
npm install @cometchat-pro/chat@3.0.0-beta1 --save
|
|
82
|
-
```
|
|
83
|
-
</li>
|
|
84
|
-
|
|
85
|
-
<li>
|
|
86
|
-
<b>Import via CDN</b><br/>
|
|
87
|
-
1. Include the CometChat Pro Javascript library in your HTML code.<br/>
|
|
88
|
-
|
|
89
|
-
```html
|
|
90
|
-
<script type="text/javascript" src="https://unpkg.com/@cometchat-pro/chat@3.0.0-beta1/CometChat.js"></script>
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
You can refer to the below link for instructions on how to do so:<br/>
|
|
94
|
-
[📝 Add CometChat Dependency](https://prodocs.cometchat.com/docs/js-quick-start#add-the-cometchat-dependency)
|
|
95
|
-
</li>
|
|
96
|
-
</ul>
|
|
97
|
-
<hr/>
|
|
98
|
-
|
|
99
|
-
## Configure CometChat Javascript SDK
|
|
100
|
-
|
|
101
|
-
### i. Initialize CometChat 🌟
|
|
102
|
-
We suggest you call the init() method on app startup, preferably in the index.js file.
|
|
103
|
-
|
|
104
|
-
```javascript
|
|
105
|
-
var appID = "APP_ID";
|
|
106
|
-
var region = "REGION";
|
|
107
|
-
var appSetting = new CometChat.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region).build();
|
|
108
|
-
CometChat.init(appID, appSetting).then(
|
|
109
|
-
() => {
|
|
110
|
-
console.log("Initialization completed successfully");
|
|
111
|
-
},
|
|
112
|
-
error => {
|
|
113
|
-
console.log("Initialization failed with error:", error);
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
| :information_source: <b> Note: Make sure to replace `region` and `appID` with your credentials.</b> |
|
|
119
|
-
|------------------------------------------------------------------------------------------------------------|
|
|
120
|
-
|
|
121
|
-
### ii. Create User 👤
|
|
122
|
-
Once initialisation is successful, you will need to create a user. You need to use createUser() method to create user on the fly.
|
|
123
|
-
```javascript
|
|
124
|
-
let authKey = "AUTH_KEY";
|
|
125
|
-
var uid = "user1";
|
|
126
|
-
var name = "Kevin";
|
|
127
|
-
|
|
128
|
-
var user = new CometChat.User(uid);
|
|
129
|
-
|
|
130
|
-
user.setName(name);
|
|
131
|
-
|
|
132
|
-
CometChat.createUser(user, authKey).then(
|
|
133
|
-
user => {
|
|
134
|
-
console.log("user created", user);
|
|
135
|
-
},error => {
|
|
136
|
-
console.log("error", error);
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
```
|
|
140
|
-
>:information_source: <b>Note: Make sure that UID and name are specified as these are mandatory fields to create a user.</b>
|
|
141
|
-
<hr/>
|
|
142
|
-
|
|
143
|
-
### iii. Login User 👤
|
|
144
|
-
Once you have created the user successfully, you will need to log the user into CometChat using the login() method.
|
|
145
|
-
```javascript
|
|
146
|
-
var UID = "SUPERHERO1";
|
|
147
|
-
var authKey = "AUTH_KEY";
|
|
148
|
-
|
|
149
|
-
CometChat.getLoggedinUser().then(
|
|
150
|
-
user => {
|
|
151
|
-
if(!user){
|
|
152
|
-
CometChat.login(UID, authKey).then(
|
|
153
|
-
user => {
|
|
154
|
-
console.log("Login Successful:", { user });
|
|
155
|
-
},
|
|
156
|
-
error => {
|
|
157
|
-
console.log("Login failed with exception:", { error });
|
|
158
|
-
}
|
|
159
|
-
);
|
|
160
|
-
}else{
|
|
161
|
-
// User already logged in
|
|
162
|
-
}
|
|
163
|
-
}, error => {
|
|
164
|
-
console.log("getLoggedinUser failed with exception:", { error });
|
|
165
|
-
}
|
|
166
|
-
);
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
| :information_source: <b>Note - The login() method needs to be called only once. Also replace AUTH_KEY with your App Auth Key.</b> |
|
|
170
|
-
|------------------------------------------------------------------------------------------------------------|
|
|
171
|
-
|
|
172
|
-
<hr/>
|
|
173
|
-
|
|
174
|
-
📝 Please refer to our [Developer Documentation](https://prodocs.cometchat.com/docs/js-quick-start) for more information on how to configure the CometChat Pro SDK and implement various features using the same.
|
|
175
|
-
|
|
176
|
-
<hr/>
|
|
177
|
-
|
|
178
|
-
## Learn more about UI-Kit
|
|
179
|
-
[Angular UI Kit](https://github.com/cometchat-pro/javascript-angular-chat-ui-kit) | [React UI Kit](https://github.com/cometchat-pro/javascript-react-chat-ui-kit) | [Vue UI Kit](https://github.com/cometchat-pro/javascript-vue-chat-ui-kit)
|
|
180
|
-
|
|
181
|
-
## Contributors :clap:
|
|
182
|
-
Thanks to the following people who have contributed to this project:
|
|
183
|
-
[👨💻 @ajaygajra](https://github.com/ajaygajra)
|
|
184
|
-
[👨💻 @mayur-bhandari](https://github.com/mayur-bhandari)
|
|
185
|
-
<hr/>
|
|
186
|
-
|
|
187
|
-
## Contact :mailbox:
|
|
188
|
-
Contact us via real time support present in [CometChat Dashboard.](https://app.cometchat.io/)
|
|
189
|
-
<hr/>
|