@cometchat/chat-sdk-javascript 4.1.4 → 4.1.6

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 CHANGED
@@ -300,7 +300,7 @@ export class CometChat {
300
300
  };
301
301
  SESSION_ID_REQUIRED: {
302
302
  code: string;
303
- /** @internal */ name: string;
303
+ name: string;
304
304
  message: string;
305
305
  details: {};
306
306
  };
@@ -493,6 +493,7 @@ export class CometChat {
493
493
  CORE_CONVERSATIONS_UPDATE_ON_GROUP_ACTIONS: string;
494
494
  CORE_CONVERSATIONS_UPDATE_ON_CUSTOM_MESSAGES: string;
495
495
  CORE_CONVERSATIONS_UPDATE_ON_REPLIES: string;
496
+ FLAG_REASONS: string;
496
497
  };
497
498
  };
498
499
  static GroupConstants: {
@@ -1385,12 +1386,36 @@ export class CometChat {
1385
1386
  */
1386
1387
  static markAsDelivered(...args: any): any;
1387
1388
  /**
1389
+ * Mark entire conversation as read for a user or group.
1390
+ * @param {string} conversationWith - User ID or Group ID
1391
+ * @param {string} conversationType - Conversation type (user or group)
1392
+ * @returns {Promise<string>}
1393
+ * @memberof CometChat
1394
+ */
1395
+ static markConversationAsRead(conversationWith: string, conversationType: string): Promise<string>;
1396
+ /**
1397
+ * Mark entire conversation as delivered for a user or group.
1398
+ * @param {string} conversationWith - User ID or Group ID
1399
+ * @param {string} conversationType - Receiver type (user or group)
1400
+ * @returns {Promise<string>}
1401
+ * @memberof CometChat
1402
+ */
1403
+ static markConversationAsDelivered(conversationWith: string, conversationType: string): Promise<string>;
1404
+ /**
1405
+ * @deprecated Please use markMessageAsUnread() instead.
1388
1406
  * Mark all the messages after the specified message id as unread.
1389
1407
  * @param {TextMessage | MediaMessage | CustomMessage | BaseMessage | any} message
1390
1408
  * @returns {Promise<string>}
1391
1409
  * @memberof CometChat
1392
1410
  **/
1393
1411
  static markAsUnread(message: TextMessage | MediaMessage | CustomMessage | any): Promise<string | CometChatException>;
1412
+ /**
1413
+ * Mark all the messages after the specified message id as unread.
1414
+ * @param {TextMessage | MediaMessage | CustomMessage | BaseMessage | any} message
1415
+ * @returns {Promise<string>}
1416
+ * @memberof CometChat
1417
+ **/
1418
+ static markMessageAsUnread(message: TextMessage | MediaMessage | CustomMessage | any): Promise<Conversation>;
1394
1419
  /**
1395
1420
  * Send a transient message.
1396
1421
  * @param {string} uid
@@ -2072,6 +2097,26 @@ export class CometChat {
2072
2097
  * @return A ConversationUpdateSettings object that holds the settings for updating the conversation.
2073
2098
  */
2074
2099
  static getConversationUpdateSettings(): Promise<ConversationUpdateSettings>;
2100
+ /**
2101
+ * Fetches the list of flag reasons configured in the CometChat Dashboard.
2102
+ * @returns {Promise<FlagReason[]>}
2103
+ * @memberof CometChat
2104
+ */
2105
+ static getFlagReasons(): Promise<FlagReason[]>;
2106
+ /**
2107
+ * Allows users to flag a message with a specific reason and an optional remark.
2108
+ * @param {string} messageId
2109
+ * @param {{ reasonId?: string; remark?: string }} payload
2110
+ * @returns {Promise<{ success: boolean; message: string }>}
2111
+ * @memberof CometChat
2112
+ */
2113
+ static flagMessage(messageId: string, payload: {
2114
+ reasonId: string;
2115
+ remark?: string;
2116
+ }): Promise<{
2117
+ success: boolean;
2118
+ message: string;
2119
+ }>;
2075
2120
  }
2076
2121
 
2077
2122
  export class CometChatNotifications {
@@ -3894,6 +3939,7 @@ export const APP_SETTINGS: {
3894
3939
  CORE_CONVERSATIONS_UPDATE_ON_GROUP_ACTIONS: string;
3895
3940
  CORE_CONVERSATIONS_UPDATE_ON_CUSTOM_MESSAGES: string;
3896
3941
  CORE_CONVERSATIONS_UPDATE_ON_REPLIES: string;
3942
+ FLAG_REASONS: string;
3897
3943
  };
3898
3944
  };
3899
3945
  export const COMMON_UTILITY_CONSTANTS: {
@@ -4002,6 +4048,14 @@ export const AI_ASSISTANT_EVENTS: {
4002
4048
  TOOL_CALL_RESULT: string;
4003
4049
  TOOL_CALL_ARGUMENT: string;
4004
4050
  };
4051
+ export interface FlagReason {
4052
+ id: string;
4053
+ name: string;
4054
+ description: string;
4055
+ default?: boolean;
4056
+ createdAt: number;
4057
+ updatedAt: number;
4058
+ }
4005
4059
 
4006
4060
  /**
4007
4061
  *
@@ -4523,12 +4577,6 @@ export class Call extends BaseMessage implements Message {
4523
4577
  MEDIA: string;
4524
4578
  IMAGE: string;
4525
4579
  VIDEO: string;
4526
- AUDIO: string;
4527
- FILE: string;
4528
- CUSTOM: string;
4529
- ASSISTANT: string;
4530
- TOOL_RESULT: string;
4531
- TOOL_ARGUMENTS: string;
4532
4580
  };
4533
4581
  static readonly RECEIVER_TYPE: {
4534
4582
  USER: string;
@@ -4540,7 +4588,6 @@ export class Call extends BaseMessage implements Message {
4540
4588
  CALL: string;
4541
4589
  CUSTOM: string;
4542
4590
  INTERACTIVE: string;
4543
- AGENTIC: string;
4544
4591
  };
4545
4592
  static readonly ACTION_TYPE: {
4546
4593
  TYPE_MEMBER_JOINED: string;
@@ -6590,8 +6637,9 @@ export class Conversation {
6590
6637
  protected unreadMessageCount: number;
6591
6638
  protected unreadMentionsCount: number;
6592
6639
  protected lastReadMessageId: string;
6640
+ protected latestMessageId: string;
6593
6641
  protected tags: Array<String>;
6594
- constructor(conversationId: string, conversationType: string, lastMessage: TextMessage | MediaMessage | CustomMessage | any, conversationWith: User | Group, unreadMessageCount: number, tags: Array<String>, unreadMentionsCount: number | any, lastReadMessageId: string | any);
6642
+ constructor(conversationId: string, conversationType: string, lastMessage: TextMessage | MediaMessage | CustomMessage | any, conversationWith: User | Group, unreadMessageCount: number, tags: Array<String>, unreadMentionsCount: number | any, lastReadMessageId: string | any, latestMessageId?: string | any);
6595
6643
  /**
6596
6644
  * Method to set conversation ID of the conversation.
6597
6645
  * @param {string} conversationId
@@ -6617,6 +6665,16 @@ export class Conversation {
6617
6665
  * @param {string}
6618
6666
  */
6619
6667
  setLastReadMessageId(id: string): void;
6668
+ /**
6669
+ * Method to get latestMessageId of the conversation.
6670
+ * @returns {string}
6671
+ */
6672
+ getLatestMessageId(): string;
6673
+ /**
6674
+ * Method to set latestMessageId of the conversation.
6675
+ * @param {string}
6676
+ */
6677
+ setLatestMessageId(id: string): void;
6620
6678
  /**
6621
6679
  * Method to set conversation type of the conversation.
6622
6680
  * @param {string} conversationId