@cometchat/chat-sdk-javascript 4.0.1 → 4.0.2
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/CometChat.d.ts +369 -28
- package/CometChat.js +1 -1
- package/package.json +1 -1
package/CometChat.d.ts
CHANGED
|
@@ -307,6 +307,7 @@ export class CometChat {
|
|
|
307
307
|
ACTION: string;
|
|
308
308
|
CALL: string;
|
|
309
309
|
CUSTOM: string;
|
|
310
|
+
INTERACTIVE: string;
|
|
310
311
|
};
|
|
311
312
|
RECEIVER_TYPE: {
|
|
312
313
|
USER: string;
|
|
@@ -335,6 +336,14 @@ export class CometChat {
|
|
|
335
336
|
CUSTOM_DATA: string;
|
|
336
337
|
CUSTOM_SUB_TYPE: string;
|
|
337
338
|
RESOURCE: string;
|
|
339
|
+
MENTIONS: string;
|
|
340
|
+
INTERACTIVE_DATA: string;
|
|
341
|
+
INTERACTION_GOAL: string;
|
|
342
|
+
INTERACTIONS: string;
|
|
343
|
+
ALLOW_SENDER_INTERACTION: string;
|
|
344
|
+
ELEMENT_ID: string;
|
|
345
|
+
INTERACTED_AT: string;
|
|
346
|
+
ELEMENT_IDS: string;
|
|
338
347
|
};
|
|
339
348
|
KNOWN_MEDIA_TYPE: {
|
|
340
349
|
IMAGE: any[];
|
|
@@ -376,6 +385,10 @@ export class CometChat {
|
|
|
376
385
|
HIDE_DELETED_MESSAGES: string;
|
|
377
386
|
WITH_TAGS: string;
|
|
378
387
|
TAGS: string;
|
|
388
|
+
MY_MENTIONS_ONLY: string;
|
|
389
|
+
MENTIONS_WITH_TAG_INFO: string;
|
|
390
|
+
MENTIONS_WITH_BLOCKED_INFO: string;
|
|
391
|
+
ONLY_INTERACTION_GOAL_COMPLETED: string;
|
|
379
392
|
};
|
|
380
393
|
};
|
|
381
394
|
};
|
|
@@ -938,6 +951,7 @@ export class CometChat {
|
|
|
938
951
|
MSG_VER_PRE: string;
|
|
939
952
|
MSG_VER_POST: string;
|
|
940
953
|
};
|
|
954
|
+
static GoalType: typeof GoalType;
|
|
941
955
|
static CometChatException: typeof CometChatException;
|
|
942
956
|
static TextMessage: typeof TextMessage;
|
|
943
957
|
static MediaMessage: typeof MediaMessage;
|
|
@@ -947,6 +961,10 @@ export class CometChat {
|
|
|
947
961
|
static Call: typeof Call;
|
|
948
962
|
static TypingIndicator: typeof TypingIndicator;
|
|
949
963
|
static TransientMessage: typeof TransientMessage;
|
|
964
|
+
static InteractiveMessage: typeof InteractiveMessage;
|
|
965
|
+
static InteractionGoal: typeof InteractionGoal;
|
|
966
|
+
static Interaction: typeof Interaction;
|
|
967
|
+
static InteractionReceipt: typeof InteractionReceipt;
|
|
950
968
|
static Group: typeof Group;
|
|
951
969
|
static User: typeof User;
|
|
952
970
|
static GroupMember: typeof GroupMember;
|
|
@@ -1000,6 +1018,7 @@ export class CometChat {
|
|
|
1000
1018
|
static CATEGORY_ACTION: string;
|
|
1001
1019
|
static CATEGORY_CALL: string;
|
|
1002
1020
|
static CATEGORY_CUSTOM: string;
|
|
1021
|
+
static CATEGORY_INTERACTIVE: string;
|
|
1003
1022
|
static ACTION_TYPE: {
|
|
1004
1023
|
MEMBER_ADDED: string;
|
|
1005
1024
|
MEMBER_JOINED: string;
|
|
@@ -1196,11 +1215,11 @@ export class CometChat {
|
|
|
1196
1215
|
*--------------------------------------------------------------------**/
|
|
1197
1216
|
/**
|
|
1198
1217
|
* Function to send message.
|
|
1199
|
-
* @param {TextMessage | MediaMessage | CustomMessage | any} message
|
|
1218
|
+
* @param {TextMessage | MediaMessage | CustomMessage | InteractiveMessage |any} message
|
|
1200
1219
|
* @returns {Message | any}
|
|
1201
1220
|
* @memberof CometChat
|
|
1202
1221
|
*/
|
|
1203
|
-
static sendMessage(message: TextMessage | MediaMessage | CustomMessage | any): Promise<TextMessage | MediaMessage | CustomMessage | BaseMessage>;
|
|
1222
|
+
static sendMessage(message: TextMessage | MediaMessage | CustomMessage | InteractiveMessage | any): Promise<TextMessage | MediaMessage | CustomMessage | BaseMessage>;
|
|
1204
1223
|
/**
|
|
1205
1224
|
* Function to send a message to user.
|
|
1206
1225
|
* @internal
|
|
@@ -1232,6 +1251,14 @@ export class CometChat {
|
|
|
1232
1251
|
* @memberof CometChat
|
|
1233
1252
|
*/
|
|
1234
1253
|
static sendCustomMessage(message: CustomMessage): Promise<TextMessage | BaseMessage | MediaMessage | CustomMessage>;
|
|
1254
|
+
/**
|
|
1255
|
+
*
|
|
1256
|
+
* Function to send a interactive message.
|
|
1257
|
+
* @param {InteractiveMessage} message
|
|
1258
|
+
* @returns {Message | any}
|
|
1259
|
+
* @memberof CometChat
|
|
1260
|
+
*/
|
|
1261
|
+
static sendInteractiveMessage(message: InteractiveMessage): Promise<TextMessage | BaseMessage | MediaMessage | CustomMessage>;
|
|
1235
1262
|
/**
|
|
1236
1263
|
*
|
|
1237
1264
|
* Function to get the last delivered message id from local storage.
|
|
@@ -1267,6 +1294,13 @@ export class CometChat {
|
|
|
1267
1294
|
* @memberof CometChat
|
|
1268
1295
|
*/
|
|
1269
1296
|
static markAsDelivered(...args: any): any;
|
|
1297
|
+
/**
|
|
1298
|
+
* Mark all the messages after the specified message id as unread.
|
|
1299
|
+
* @param {TextMessage | MediaMessage | CustomMessage | BaseMessage | any} message
|
|
1300
|
+
* @returns {Promise<string>}
|
|
1301
|
+
* @memberof CometChat
|
|
1302
|
+
**/
|
|
1303
|
+
static markAsUnread(message: TextMessage | MediaMessage | CustomMessage | any): Promise<string | CometChatException>;
|
|
1270
1304
|
/**
|
|
1271
1305
|
* Send a transient message.
|
|
1272
1306
|
* @param {string} uid
|
|
@@ -1287,7 +1321,7 @@ export class CometChat {
|
|
|
1287
1321
|
* @returns {Message | any}
|
|
1288
1322
|
* @memberof CometChat
|
|
1289
1323
|
*/
|
|
1290
|
-
static getMessageDetails(messageId: string | any): Promise<TextMessage | MediaMessage | CustomMessage | BaseMessage>;
|
|
1324
|
+
static getMessageDetails(messageId: string | any): Promise<TextMessage | MediaMessage | CustomMessage | InteractiveMessage | BaseMessage>;
|
|
1291
1325
|
/**
|
|
1292
1326
|
* Function to fetch message receipt details for the provided messageID.
|
|
1293
1327
|
* @param {string | any} messageId
|
|
@@ -1898,6 +1932,13 @@ export class CometChat {
|
|
|
1898
1932
|
* @returns
|
|
1899
1933
|
*/
|
|
1900
1934
|
internalLogout(pushToLoginListener?: boolean): Promise<unknown>;
|
|
1935
|
+
/**
|
|
1936
|
+
* Mark the element of a message as interacted.
|
|
1937
|
+
* @param {string} messageId
|
|
1938
|
+
* @param {string} elementId
|
|
1939
|
+
* @memberof CometChat
|
|
1940
|
+
*/
|
|
1941
|
+
static markAsInteracted(messageId: string | any, elementId: string): Promise<string>;
|
|
1901
1942
|
}
|
|
1902
1943
|
|
|
1903
1944
|
/**
|
|
@@ -1921,7 +1962,7 @@ export interface UserObj {
|
|
|
1921
1962
|
avatar: string;
|
|
1922
1963
|
lastActiveAt: number;
|
|
1923
1964
|
link: string;
|
|
1924
|
-
metadata:
|
|
1965
|
+
metadata: object;
|
|
1925
1966
|
role: string;
|
|
1926
1967
|
status: string;
|
|
1927
1968
|
statusMessage: string;
|
|
@@ -1994,14 +2035,14 @@ export class User {
|
|
|
1994
2035
|
setLink(link: string): string;
|
|
1995
2036
|
/**
|
|
1996
2037
|
* Method to get metadata of the user.
|
|
1997
|
-
* @returns {
|
|
2038
|
+
* @returns {object}
|
|
1998
2039
|
*/
|
|
1999
|
-
getMetadata():
|
|
2040
|
+
getMetadata(): object;
|
|
2000
2041
|
/**
|
|
2001
2042
|
* Method to set metadata of the user.
|
|
2002
|
-
* @param {
|
|
2043
|
+
* @param {object} metadata
|
|
2003
2044
|
*/
|
|
2004
|
-
setMetadata(metadata:
|
|
2045
|
+
setMetadata(metadata: object): void;
|
|
2005
2046
|
/**
|
|
2006
2047
|
* Method to get role of the user.
|
|
2007
2048
|
* @returns {string}
|
|
@@ -2097,6 +2138,7 @@ export class MediaMessage extends BaseMessage implements Message {
|
|
|
2097
2138
|
ACTION: string;
|
|
2098
2139
|
CALL: string;
|
|
2099
2140
|
CUSTOM: string;
|
|
2141
|
+
INTERACTIVE: string;
|
|
2100
2142
|
};
|
|
2101
2143
|
private url;
|
|
2102
2144
|
private file;
|
|
@@ -2222,6 +2264,8 @@ export class BaseMessage implements Message {
|
|
|
2222
2264
|
protected deletedBy: string;
|
|
2223
2265
|
protected replyCount: number;
|
|
2224
2266
|
protected rawMessage: Object;
|
|
2267
|
+
protected mentionedUsers?: User[];
|
|
2268
|
+
protected mentionedMe?: boolean;
|
|
2225
2269
|
constructor(receiverId: string, messageType: string, receiverType: string, category: MessageCategory);
|
|
2226
2270
|
/**
|
|
2227
2271
|
* Get ID of the message
|
|
@@ -2437,6 +2481,26 @@ export class BaseMessage implements Message {
|
|
|
2437
2481
|
* Set the raw JSON of the message.
|
|
2438
2482
|
*/
|
|
2439
2483
|
setRawMessage(rawMessage: Object): void;
|
|
2484
|
+
/**
|
|
2485
|
+
* @param {User[]} mentionedUsers
|
|
2486
|
+
* Set the array of mentioned users
|
|
2487
|
+
*/
|
|
2488
|
+
setMentionedUsers(mentionedUsers: User[]): void;
|
|
2489
|
+
/**
|
|
2490
|
+
* Get the array of mentioned users
|
|
2491
|
+
* @returns
|
|
2492
|
+
*/
|
|
2493
|
+
getMentionedUsers(): User[];
|
|
2494
|
+
/**
|
|
2495
|
+
* @param {boolean} hasMentionedMe
|
|
2496
|
+
* Method to set if the user was mentioned in the message
|
|
2497
|
+
*/
|
|
2498
|
+
setHasMentionedMe(hasMentionedMe: boolean): void;
|
|
2499
|
+
/**
|
|
2500
|
+
* Method to check if the user was mentioned in the message
|
|
2501
|
+
* @returns
|
|
2502
|
+
*/
|
|
2503
|
+
hasMentionedMe(): boolean;
|
|
2440
2504
|
}
|
|
2441
2505
|
|
|
2442
2506
|
/**
|
|
@@ -2682,6 +2746,7 @@ export const MessageConstatnts: {
|
|
|
2682
2746
|
ACTION: string;
|
|
2683
2747
|
CALL: string;
|
|
2684
2748
|
CUSTOM: string;
|
|
2749
|
+
INTERACTIVE: string;
|
|
2685
2750
|
};
|
|
2686
2751
|
RECEIVER_TYPE: {
|
|
2687
2752
|
USER: string;
|
|
@@ -2710,6 +2775,14 @@ export const MessageConstatnts: {
|
|
|
2710
2775
|
CUSTOM_DATA: string;
|
|
2711
2776
|
CUSTOM_SUB_TYPE: string;
|
|
2712
2777
|
RESOURCE: string;
|
|
2778
|
+
MENTIONS: string;
|
|
2779
|
+
INTERACTIVE_DATA: string;
|
|
2780
|
+
INTERACTION_GOAL: string;
|
|
2781
|
+
INTERACTIONS: string;
|
|
2782
|
+
ALLOW_SENDER_INTERACTION: string;
|
|
2783
|
+
ELEMENT_ID: string;
|
|
2784
|
+
INTERACTED_AT: string;
|
|
2785
|
+
ELEMENT_IDS: string;
|
|
2713
2786
|
};
|
|
2714
2787
|
KNOWN_MEDIA_TYPE: {
|
|
2715
2788
|
IMAGE: any[];
|
|
@@ -2751,6 +2824,10 @@ export const MessageConstatnts: {
|
|
|
2751
2824
|
HIDE_DELETED_MESSAGES: string;
|
|
2752
2825
|
WITH_TAGS: string;
|
|
2753
2826
|
TAGS: string;
|
|
2827
|
+
MY_MENTIONS_ONLY: string;
|
|
2828
|
+
MENTIONS_WITH_TAG_INFO: string;
|
|
2829
|
+
MENTIONS_WITH_BLOCKED_INFO: string;
|
|
2830
|
+
ONLY_INTERACTION_GOAL_COMPLETED: string;
|
|
2754
2831
|
};
|
|
2755
2832
|
};
|
|
2756
2833
|
};
|
|
@@ -2767,7 +2844,14 @@ export enum MessageCategory {
|
|
|
2767
2844
|
ACTION = "action",
|
|
2768
2845
|
MESSAGE = "message",
|
|
2769
2846
|
CALL = "call",
|
|
2770
|
-
CUSTOM = "custom"
|
|
2847
|
+
CUSTOM = "custom",
|
|
2848
|
+
INTERACTIVE = "interactive"
|
|
2849
|
+
}
|
|
2850
|
+
export enum GoalType {
|
|
2851
|
+
ANY_ACTION = "anyAction",
|
|
2852
|
+
ANY_OF = "anyOf",
|
|
2853
|
+
ALL_OF = "allOf",
|
|
2854
|
+
NONE = "none"
|
|
2771
2855
|
}
|
|
2772
2856
|
export const TYPING_NOTIFICATION: {
|
|
2773
2857
|
RECEIVER_ID: string;
|
|
@@ -3625,14 +3709,14 @@ export class Group {
|
|
|
3625
3709
|
setOwner(owner: string): void;
|
|
3626
3710
|
/**
|
|
3627
3711
|
* Method to get metadata of the group.
|
|
3628
|
-
* @returns {
|
|
3712
|
+
* @returns {object}
|
|
3629
3713
|
*/
|
|
3630
|
-
getMetadata():
|
|
3714
|
+
getMetadata(): object;
|
|
3631
3715
|
/**
|
|
3632
3716
|
* Method to set metadata of the group.
|
|
3633
|
-
* @param {
|
|
3717
|
+
* @param {object} metadata
|
|
3634
3718
|
*/
|
|
3635
|
-
setMetadata(metadata:
|
|
3719
|
+
setMetadata(metadata: object): void;
|
|
3636
3720
|
/**
|
|
3637
3721
|
* Method to get the created at timestamp of the group.
|
|
3638
3722
|
* @returns {number}
|
|
@@ -3750,6 +3834,14 @@ export class MessageListener {
|
|
|
3750
3834
|
* This event is triggered when a transient message is received.
|
|
3751
3835
|
*/
|
|
3752
3836
|
onTransientMessageReceived?: Function;
|
|
3837
|
+
/**
|
|
3838
|
+
* This event is triggered when a interactive message is received.
|
|
3839
|
+
*/
|
|
3840
|
+
onInteractiveMessageReceived?: Function;
|
|
3841
|
+
/**
|
|
3842
|
+
* This event is triggered when a interaction goal is completd .
|
|
3843
|
+
*/
|
|
3844
|
+
onInteractionGoalCompleted?: Function;
|
|
3753
3845
|
constructor(...args: any[]);
|
|
3754
3846
|
}
|
|
3755
3847
|
export class CallListener {
|
|
@@ -3991,6 +4083,7 @@ export class Call extends BaseMessage implements Message {
|
|
|
3991
4083
|
ACTION: string;
|
|
3992
4084
|
CALL: string;
|
|
3993
4085
|
CUSTOM: string;
|
|
4086
|
+
INTERACTIVE: string;
|
|
3994
4087
|
};
|
|
3995
4088
|
static readonly ACTION_TYPE: {
|
|
3996
4089
|
TYPE_MEMBER_JOINED: string;
|
|
@@ -4059,12 +4152,12 @@ export class Call extends BaseMessage implements Message {
|
|
|
4059
4152
|
* Get JSONObject of data set by developer.
|
|
4060
4153
|
* @returns
|
|
4061
4154
|
*/
|
|
4062
|
-
getMetadata():
|
|
4155
|
+
getMetadata(): object;
|
|
4063
4156
|
/**
|
|
4064
|
-
* @param {
|
|
4157
|
+
* @param {object} metadata
|
|
4065
4158
|
* Set metadata of the call message.
|
|
4066
4159
|
*/
|
|
4067
|
-
setMetadata(metadata:
|
|
4160
|
+
setMetadata(metadata: object): void;
|
|
4068
4161
|
/**
|
|
4069
4162
|
* Get sender of the message.
|
|
4070
4163
|
* @returns {User}
|
|
@@ -4275,6 +4368,7 @@ export class Action extends BaseMessage implements Message {
|
|
|
4275
4368
|
ACTION: string;
|
|
4276
4369
|
CALL: string;
|
|
4277
4370
|
CUSTOM: string;
|
|
4371
|
+
INTERACTIVE: string;
|
|
4278
4372
|
};
|
|
4279
4373
|
static readonly ACTION_TYPE: {
|
|
4280
4374
|
TYPE_MEMBER_JOINED: string;
|
|
@@ -4388,14 +4482,14 @@ export class Action extends BaseMessage implements Message {
|
|
|
4388
4482
|
setActionFor(actionFor: User | Group | BaseMessage): void;
|
|
4389
4483
|
/**
|
|
4390
4484
|
* Method to get the metadata of the action message.
|
|
4391
|
-
* @returns {
|
|
4485
|
+
* @returns {object}
|
|
4392
4486
|
*/
|
|
4393
|
-
getMetadata():
|
|
4487
|
+
getMetadata(): object;
|
|
4394
4488
|
/**
|
|
4395
|
-
* @param {
|
|
4489
|
+
* @param {object} metadata
|
|
4396
4490
|
* Method to get the metadata of the action message.
|
|
4397
4491
|
*/
|
|
4398
|
-
setMetadata(metadata:
|
|
4492
|
+
setMetadata(metadata: object): void;
|
|
4399
4493
|
}
|
|
4400
4494
|
|
|
4401
4495
|
export class GroupsRequest {
|
|
@@ -4777,6 +4871,10 @@ export class MessagesRequestBuilder {
|
|
|
4777
4871
|
/** @private */ HideDeletedMessages?: boolean;
|
|
4778
4872
|
/** @private */ tags?: Array<String>;
|
|
4779
4873
|
/** @private */ WithTags?: boolean;
|
|
4874
|
+
/** @private */ interactionGoalCompletedOnly?: boolean;
|
|
4875
|
+
/** @private */ ListMentionedMessages?: boolean;
|
|
4876
|
+
/** @private */ mentionsWithUserTags?: boolean;
|
|
4877
|
+
/** @private */ mentionsWithBlockedRelation?: boolean;
|
|
4780
4878
|
/**
|
|
4781
4879
|
* A method to set limit for the number of messages returned in a single iteration. A maximum of 100 messages can fetched in a single iteration.
|
|
4782
4880
|
* @param {number} limit
|
|
@@ -4891,6 +4989,30 @@ export class MessagesRequestBuilder {
|
|
|
4891
4989
|
* @returns
|
|
4892
4990
|
*/
|
|
4893
4991
|
withTags(withTags: boolean): this;
|
|
4992
|
+
/**
|
|
4993
|
+
* A method to get the list of message with mentions
|
|
4994
|
+
* @param {boolean} listMentionedMessages
|
|
4995
|
+
* @returns
|
|
4996
|
+
*/
|
|
4997
|
+
myMentionsOnly(listMentionedMessages?: boolean): this;
|
|
4998
|
+
/**
|
|
4999
|
+
* A method to include the user tags when getting the list of message with mentions
|
|
5000
|
+
* @param {boolean} mentionsWithUserTags
|
|
5001
|
+
* @returns
|
|
5002
|
+
*/
|
|
5003
|
+
mentionsWithTagInfo(mentionsWithUserTags?: boolean): this;
|
|
5004
|
+
/**
|
|
5005
|
+
* A method to include the blocked relation when getting the list of message with mentions
|
|
5006
|
+
* @param {boolean} mentionsWithBlockedRelation
|
|
5007
|
+
* @returns
|
|
5008
|
+
*/
|
|
5009
|
+
mentionsWithBlockedInfo(mentionsWithBlockedRelation?: boolean): this;
|
|
5010
|
+
/**
|
|
5011
|
+
* A method to get only interacted messages.
|
|
5012
|
+
* @param {boolean} interactionGoalCompletedOnly
|
|
5013
|
+
* @returns
|
|
5014
|
+
*/
|
|
5015
|
+
setInteractionGoalCompletedOnly(interactionGoalCompletedOnly?: boolean): this;
|
|
4894
5016
|
/**
|
|
4895
5017
|
* This method will return an object of the MessagesRequest class.
|
|
4896
5018
|
* @returns {MessagesRequest}
|
|
@@ -4926,14 +5048,14 @@ export class TypingIndicator {
|
|
|
4926
5048
|
setReceiverId(receiverId: string): void;
|
|
4927
5049
|
/**
|
|
4928
5050
|
* Method to get metadata of the transient message.
|
|
4929
|
-
* @returns {
|
|
5051
|
+
* @returns {object}
|
|
4930
5052
|
*/
|
|
4931
|
-
getMetadata():
|
|
5053
|
+
getMetadata(): object;
|
|
4932
5054
|
/**
|
|
4933
5055
|
* Method to set metadata of the transient message.
|
|
4934
|
-
* @param {
|
|
5056
|
+
* @param {object} meta
|
|
4935
5057
|
*/
|
|
4936
|
-
setMetadata(meta:
|
|
5058
|
+
setMetadata(meta: object): void;
|
|
4937
5059
|
/**
|
|
4938
5060
|
* Method to get sender of the transient message.
|
|
4939
5061
|
* @returns {User}
|
|
@@ -5245,20 +5367,20 @@ export class CometChatHelper {
|
|
|
5245
5367
|
/**
|
|
5246
5368
|
* Takes JSONMessage as an input and will return an Object of BaseMessage Class.
|
|
5247
5369
|
* @param {Object} message
|
|
5248
|
-
* @returns {TextMessage | MediaMessage | CustomMessage | BaseMessage}
|
|
5370
|
+
* @returns {TextMessage | MediaMessage | CustomMessage | InteractiveMessage | BaseMessage}
|
|
5249
5371
|
* @memberof CometChatHelper
|
|
5250
5372
|
*/
|
|
5251
|
-
static processMessage(message: Object): Promise<TextMessage | MediaMessage | CustomMessage | BaseMessage>;
|
|
5373
|
+
static processMessage(message: Object): Promise<TextMessage | MediaMessage | CustomMessage | InteractiveMessage | BaseMessage>;
|
|
5252
5374
|
/**-------------------------------------------------------------------*
|
|
5253
5375
|
* Message related functions provided by CometChat class *
|
|
5254
5376
|
*--------------------------------------------------------------------**/
|
|
5255
5377
|
/**
|
|
5256
5378
|
* Takes a Message Object and converts it into Conversation Object.
|
|
5257
|
-
* @param {TextMessage | MediaMessage | CustomMessage} message
|
|
5379
|
+
* @param {TextMessage | MediaMessage | CustomMessage | InteractiveMessage} message
|
|
5258
5380
|
* @returns {Conversation} conversation
|
|
5259
5381
|
* @memberof CometChat
|
|
5260
5382
|
*/
|
|
5261
|
-
static getConversationFromMessage(message: TextMessage | MediaMessage | CustomMessage | any): Promise<Conversation>;
|
|
5383
|
+
static getConversationFromMessage(message: TextMessage | MediaMessage | CustomMessage | InteractiveMessage | any): Promise<Conversation>;
|
|
5262
5384
|
}
|
|
5263
5385
|
|
|
5264
5386
|
/**
|
|
@@ -5886,6 +6008,225 @@ export class TransientMessage {
|
|
|
5886
6008
|
setSender(sender: User): void;
|
|
5887
6009
|
}
|
|
5888
6010
|
|
|
6011
|
+
/**
|
|
6012
|
+
*
|
|
6013
|
+
* @module InteractiveMessage
|
|
6014
|
+
*/
|
|
6015
|
+
export class InteractiveMessage extends BaseMessage implements Message {
|
|
6016
|
+
/** @private */ static readonly TYPE: {
|
|
6017
|
+
TEXT: string;
|
|
6018
|
+
MEDIA: string;
|
|
6019
|
+
IMAGE: string;
|
|
6020
|
+
VIDEO: string;
|
|
6021
|
+
AUDIO: string;
|
|
6022
|
+
FILE: string;
|
|
6023
|
+
CUSTOM: string;
|
|
6024
|
+
};
|
|
6025
|
+
/** @private */ static readonly RECEIVER_TYPE: {
|
|
6026
|
+
USER: string;
|
|
6027
|
+
GROUP: string;
|
|
6028
|
+
};
|
|
6029
|
+
/** @private */ static readonly CATEGORY: {
|
|
6030
|
+
MESSAGE: string;
|
|
6031
|
+
ACTION: string;
|
|
6032
|
+
CALL: string;
|
|
6033
|
+
CUSTOM: string;
|
|
6034
|
+
INTERACTIVE: string;
|
|
6035
|
+
};
|
|
6036
|
+
private interactiveData;
|
|
6037
|
+
private interactionGoal;
|
|
6038
|
+
private data?;
|
|
6039
|
+
private interactions?;
|
|
6040
|
+
private tags?;
|
|
6041
|
+
private allowSenderInteraction?;
|
|
6042
|
+
constructor(...args: any[]);
|
|
6043
|
+
/**
|
|
6044
|
+
* Method to get sender of the message.
|
|
6045
|
+
* @returns {User}
|
|
6046
|
+
*/
|
|
6047
|
+
getSender(): User;
|
|
6048
|
+
/**
|
|
6049
|
+
* Method to get interactive data of the message.
|
|
6050
|
+
* @returns {Object}
|
|
6051
|
+
*/
|
|
6052
|
+
getInteractiveData(): Object;
|
|
6053
|
+
/**
|
|
6054
|
+
* Method to set interactive data of interactive message.
|
|
6055
|
+
* @param {Object} interactiveData
|
|
6056
|
+
*/
|
|
6057
|
+
setInteractiveData(interactiveData: Object): void;
|
|
6058
|
+
/**
|
|
6059
|
+
* Method to get receiver of the message.
|
|
6060
|
+
* @returns {User|Group}
|
|
6061
|
+
*/
|
|
6062
|
+
getReceiver(): User | Group;
|
|
6063
|
+
/**
|
|
6064
|
+
* Method to interaction goal of the message.
|
|
6065
|
+
* @returns {InteractionGoal}
|
|
6066
|
+
*/
|
|
6067
|
+
getInteractionGoal(): InteractionGoal;
|
|
6068
|
+
/**
|
|
6069
|
+
* Method to set interaction goal of interactive message.
|
|
6070
|
+
* @param {InteractionGoal} interactionGoal
|
|
6071
|
+
*/
|
|
6072
|
+
setInteractionGoal(interactionGoal: InteractionGoal): void;
|
|
6073
|
+
/**
|
|
6074
|
+
* Method to get interactions on the message.
|
|
6075
|
+
* @returns {Array<Interaction>}
|
|
6076
|
+
*/
|
|
6077
|
+
getInteractions(): Array<Interaction>;
|
|
6078
|
+
/**
|
|
6079
|
+
* Method to set interactions of interactive message.
|
|
6080
|
+
* @param {Array<Interaction>} interactions
|
|
6081
|
+
*/
|
|
6082
|
+
setInteractions(interactions: Array<Interaction>): void;
|
|
6083
|
+
/**
|
|
6084
|
+
* Method to get metadata of the message.
|
|
6085
|
+
* @returns {Object}
|
|
6086
|
+
*/
|
|
6087
|
+
getMetadata(): Object;
|
|
6088
|
+
/**
|
|
6089
|
+
* Method to set sender metadata of the message.
|
|
6090
|
+
* @returns {User}
|
|
6091
|
+
*/
|
|
6092
|
+
setMetadata(metadata: Object): void;
|
|
6093
|
+
/**
|
|
6094
|
+
* Method to get data of the message.
|
|
6095
|
+
* @returns {any}
|
|
6096
|
+
*/
|
|
6097
|
+
getData(): any;
|
|
6098
|
+
/**
|
|
6099
|
+
* Method to get tags of the message.
|
|
6100
|
+
* @returns {Array<String>}
|
|
6101
|
+
*/
|
|
6102
|
+
getTags(): Array<String>;
|
|
6103
|
+
/**
|
|
6104
|
+
* Get the set tags fo the message .
|
|
6105
|
+
* @returns {Array<String>}
|
|
6106
|
+
*/
|
|
6107
|
+
setTags(tags: Array<String>): void;
|
|
6108
|
+
/**
|
|
6109
|
+
* @param {boolean} flag
|
|
6110
|
+
* Set the flag if sender is allowed to interact with the with the message.
|
|
6111
|
+
*/
|
|
6112
|
+
setIsSenderInteractionAllowed(flag: boolean): void;
|
|
6113
|
+
/**
|
|
6114
|
+
* Get the flag which signifies if sender interaction is allowed .
|
|
6115
|
+
* @returns {boolean}
|
|
6116
|
+
*/
|
|
6117
|
+
getIsSenderInteractionAllowed(flag: boolean): boolean;
|
|
6118
|
+
}
|
|
6119
|
+
|
|
6120
|
+
/**
|
|
6121
|
+
*
|
|
6122
|
+
* @module InteractionGoal
|
|
6123
|
+
*/
|
|
6124
|
+
export class InteractionGoal {
|
|
6125
|
+
constructor(type: GoalType, elementIds: Array<String>);
|
|
6126
|
+
/**
|
|
6127
|
+
* Get the type of the interaction goal.
|
|
6128
|
+
* @returns {GoalType}
|
|
6129
|
+
*/
|
|
6130
|
+
getType(): GoalType;
|
|
6131
|
+
/**
|
|
6132
|
+
* @param {GoalType} type
|
|
6133
|
+
* Set the type of goal for the message.
|
|
6134
|
+
*/
|
|
6135
|
+
setType(type: GoalType): void;
|
|
6136
|
+
/**
|
|
6137
|
+
* Get the element ids of the interacttion goal.
|
|
6138
|
+
* @returns {Array<String>}
|
|
6139
|
+
*/
|
|
6140
|
+
getElementIds(): Array<String>;
|
|
6141
|
+
/**
|
|
6142
|
+
* @param {Array<String>} elementIds
|
|
6143
|
+
* Set the element id for the intearction goal.
|
|
6144
|
+
*/
|
|
6145
|
+
setElementIds(elementIds: Array<String>): void;
|
|
6146
|
+
}
|
|
6147
|
+
|
|
6148
|
+
export class Interaction {
|
|
6149
|
+
constructor(elementId: string, interactedAt: number);
|
|
6150
|
+
/**
|
|
6151
|
+
* Get the element id of the interaction.
|
|
6152
|
+
* @returns {string}
|
|
6153
|
+
*/
|
|
6154
|
+
getElementId(): string;
|
|
6155
|
+
/**
|
|
6156
|
+
* Get the time of the interaction.
|
|
6157
|
+
* @returns {number}
|
|
6158
|
+
*/
|
|
6159
|
+
getInteractedAt(): number;
|
|
6160
|
+
/**
|
|
6161
|
+
* @param {string} elementId
|
|
6162
|
+
* Set the element id.
|
|
6163
|
+
*/
|
|
6164
|
+
setElementId(elementId: string): void;
|
|
6165
|
+
/**
|
|
6166
|
+
* @param {number} interactedAt
|
|
6167
|
+
* Set the time of intertaction .
|
|
6168
|
+
*/
|
|
6169
|
+
setInteractedAt(interactedAt: number): void;
|
|
6170
|
+
static getInteractionFromJSON(message: any): Interaction;
|
|
6171
|
+
}
|
|
6172
|
+
|
|
6173
|
+
/**
|
|
6174
|
+
*
|
|
6175
|
+
* @module InteractionReceipt
|
|
6176
|
+
*/
|
|
6177
|
+
export class InteractionReceipt {
|
|
6178
|
+
/**
|
|
6179
|
+
* Method to get receiver type of the interaction receipt.
|
|
6180
|
+
* @returns {string}
|
|
6181
|
+
*/
|
|
6182
|
+
getReceiverType(): string;
|
|
6183
|
+
/**
|
|
6184
|
+
* Method to set receiver type of the interaction receipt.
|
|
6185
|
+
* @param {string} receiverType
|
|
6186
|
+
*/
|
|
6187
|
+
setReceiverType(receiverType: string): void;
|
|
6188
|
+
/**
|
|
6189
|
+
* Method to get sender of the interaction receipt.
|
|
6190
|
+
* @returns {User}
|
|
6191
|
+
*/
|
|
6192
|
+
getSender(): User;
|
|
6193
|
+
/**
|
|
6194
|
+
* Method to set sender of the interaction receipt.
|
|
6195
|
+
* @param {User} sender
|
|
6196
|
+
*/
|
|
6197
|
+
setSender(sender: User): void;
|
|
6198
|
+
/**
|
|
6199
|
+
* Method to get receiver id of the interaction receipt.
|
|
6200
|
+
* @returns {string}
|
|
6201
|
+
*/
|
|
6202
|
+
getReceiveId(): string;
|
|
6203
|
+
/**
|
|
6204
|
+
* Method to set receiver of the interaction receipt.
|
|
6205
|
+
* @param {string} receiverId
|
|
6206
|
+
*/
|
|
6207
|
+
setReceiverId(receiverId: string): void;
|
|
6208
|
+
/**
|
|
6209
|
+
* Method to get the message ID.
|
|
6210
|
+
* @returns {string}
|
|
6211
|
+
*/
|
|
6212
|
+
getMessageId(): string;
|
|
6213
|
+
/**
|
|
6214
|
+
* Method to set the message ID.
|
|
6215
|
+
* @param {string} messageId
|
|
6216
|
+
*/
|
|
6217
|
+
setMessageId(messageId: string): void;
|
|
6218
|
+
/**
|
|
6219
|
+
* Method to get the interactions.
|
|
6220
|
+
* @returns { Array<Interaction>}
|
|
6221
|
+
*/
|
|
6222
|
+
getInteractions(): Array<Interaction>;
|
|
6223
|
+
/**
|
|
6224
|
+
* Method to set the interactions.
|
|
6225
|
+
* @param {Array<Interaction>} interactions
|
|
6226
|
+
*/
|
|
6227
|
+
setInteractions(interactions: Array<Interaction>): void;
|
|
6228
|
+
}
|
|
6229
|
+
|
|
5889
6230
|
/**
|
|
5890
6231
|
*
|
|
5891
6232
|
*
|