@cometchat/chat-sdk-javascript 4.1.0 → 4.1.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 CHANGED
@@ -433,6 +433,7 @@ export class CometChat {
433
433
  MENTIONED_UIDS: string;
434
434
  ATTACHMENT_TYPES: string;
435
435
  WITH_PARENT: string;
436
+ HIDE_QUOTED_MESSAGES: string;
436
437
  };
437
438
  };
438
439
  };
@@ -1017,6 +1018,7 @@ export class CometChat {
1017
1018
  };
1018
1019
  static GoalType: typeof GoalType;
1019
1020
  static AttachmentType: typeof AttachmentType;
1021
+ static ModerationStatus: typeof ModerationStatus;
1020
1022
  static CometChatException: typeof CometChatException;
1021
1023
  static TextMessage: typeof TextMessage;
1022
1024
  static MediaMessage: typeof MediaMessage;
@@ -2473,6 +2475,13 @@ export class MediaMessage extends BaseMessage implements Message {
2473
2475
  * Set the tags for the message.
2474
2476
  */
2475
2477
  setTags(tags: Array<String>): void;
2478
+ /**
2479
+ * Gets the moderation status of the message.
2480
+ * @description If the message is not moderated, it returns "unmoderated".
2481
+ * If the message is moderated, it returns the status of the moderation.
2482
+ * @returns {ModerationStatus}
2483
+ */
2484
+ getModerationStatus(): ModerationStatus;
2476
2485
  }
2477
2486
 
2478
2487
  /**
@@ -2519,6 +2528,8 @@ export class BaseMessage implements Message {
2519
2528
  protected unreadRepliesCount: number;
2520
2529
  protected mentionedUsers?: User[];
2521
2530
  protected mentionedMe?: boolean;
2531
+ protected quotedMessageId?: number;
2532
+ protected quotedMessage?: BaseMessage;
2522
2533
  constructor(receiverId: string, messageType: string, receiverType: string, category: MessageCategory);
2523
2534
  /**
2524
2535
  * Get unread replies count of the message
@@ -2778,12 +2789,32 @@ export class BaseMessage implements Message {
2778
2789
  * set the array of reactions in message
2779
2790
  * @param {ReactionCount[]} reactions
2780
2791
  */
2781
- setReactions(reactions: any): ReactionCount[];
2792
+ setReactions(reactions: ReactionCount[]): void;
2782
2793
  /**
2783
2794
  * Get the array of reactions in message
2784
2795
  * @returns {ReactionCount[]}
2785
2796
  */
2786
2797
  getReactions(): ReactionCount[];
2798
+ /**
2799
+ * Get quoted message ID of the message.
2800
+ * @returns {number}
2801
+ */
2802
+ getQuotedMessageId(): number;
2803
+ /**
2804
+ * @param {number} value
2805
+ * Set quoted message ID of the message.
2806
+ */
2807
+ setQuotedMessageId(value: number): void;
2808
+ /**
2809
+ * Get quoted message of the message.
2810
+ * @returns {BaseMessage}
2811
+ */
2812
+ getQuotedMessage(): BaseMessage;
2813
+ /**
2814
+ * @param {BaseMessage} value
2815
+ * Set quoted message of the message.
2816
+ */
2817
+ setQuotedMessage(value: BaseMessage): void;
2787
2818
  }
2788
2819
 
2789
2820
  /**
@@ -2864,6 +2895,13 @@ export class TextMessage extends BaseMessage implements Message {
2864
2895
  * Set the tags for the message.
2865
2896
  */
2866
2897
  setTags(tags: Array<String>): void;
2898
+ /**
2899
+ * Gets the moderation status of the message.
2900
+ * @description If the message is not moderated, it returns "unmoderated".
2901
+ * If the message is moderated, it returns the status of the moderation.
2902
+ * @returns {ModerationStatus}
2903
+ */
2904
+ getModerationStatus(): ModerationStatus;
2867
2905
  }
2868
2906
 
2869
2907
  export const constants: {
@@ -3135,6 +3173,7 @@ export const MessageConstatnts: {
3135
3173
  MENTIONED_UIDS: string;
3136
3174
  ATTACHMENT_TYPES: string;
3137
3175
  WITH_PARENT: string;
3176
+ HIDE_QUOTED_MESSAGES: string;
3138
3177
  };
3139
3178
  };
3140
3179
  };
@@ -3937,6 +3976,12 @@ export enum AttachmentType {
3937
3976
  AUDIO = "audio",
3938
3977
  FILE = "file"
3939
3978
  }
3979
+ export enum ModerationStatus {
3980
+ PENDING = "pending",
3981
+ APPROVED = "approved",
3982
+ DISAPPROVED = "disapproved",
3983
+ UNMODERATED = "unmoderated"
3984
+ }
3940
3985
  export const AI_ASSISTANT_EVENTS: {
3941
3986
  RUN_STARTED: string;
3942
3987
  RUN_FINISHED: string;
@@ -4211,6 +4256,10 @@ export class MessageListener {
4211
4256
  * This event is triggered when a message is read by all members in a group.
4212
4257
  */
4213
4258
  onMessagesReadByAll?: Function;
4259
+ /**
4260
+ * This event is triggered when a message is moderated.
4261
+ */
4262
+ onMessageModerated?: Function;
4214
4263
  /**
4215
4264
  * This event is triggered when an AI tool result is received.
4216
4265
  */
@@ -5712,6 +5761,12 @@ export class MessagesRequest {
5712
5761
  * Gets the flag indicating whether to fetch messages with parent message information.
5713
5762
  */
5714
5763
  isWithParent(): boolean;
5764
+ /**
5765
+ * Gets the flag indicating whether to hide quoted messages when fetching messages.
5766
+ *
5767
+ * @return {boolean}
5768
+ */
5769
+ isHideQuotedMessages(): boolean;
5715
5770
  /**
5716
5771
  * Get list of next messages based on the parameters specified in MessagesRequestBuilder class. The Developer need to call this method repeatedly using the same object of MessagesRequest class to get paginated list of message.
5717
5772
  * @returns {Promise<BaseMessage[] | []>}
@@ -5754,6 +5809,7 @@ export class MessagesRequestBuilder {
5754
5809
  /** @private */ mentionedUIDs?: Array<String>;
5755
5810
  /** @private */ attachmentTypes?: Array<AttachmentType>;
5756
5811
  /** @private */ WithParent?: boolean;
5812
+ /** @private */ HideQuotedMessages?: boolean;
5757
5813
  /**
5758
5814
  * 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.
5759
5815
  * @param {number} limit
@@ -5928,6 +5984,12 @@ export class MessagesRequestBuilder {
5928
5984
  * @returns {this}
5929
5985
  */
5930
5986
  withParent(withParent?: boolean): this;
5987
+ /**
5988
+ * A method to hide quoted messages.
5989
+ * @param {boolean} hideQuotedMessages
5990
+ * @returns
5991
+ */
5992
+ hideQuotedMessages(hideQuotedMessages: boolean): this;
5931
5993
  /**
5932
5994
  * This method will return an object of the MessagesRequest class.
5933
5995
  * @returns {MessagesRequest}
@@ -8300,7 +8362,7 @@ export class AIAssistantBaseEvent<T extends AssistantBaseEventData = AssistantBa
8300
8362
  /**
8301
8363
  * The parent message ID (if applicable)
8302
8364
  */
8303
- patentMessageId: string;
8365
+ parentMessageId: string;
8304
8366
  /**
8305
8367
  * Additional data associated with the event
8306
8368
  */
@@ -8310,10 +8372,10 @@ export class AIAssistantBaseEvent<T extends AssistantBaseEventData = AssistantBa
8310
8372
  * @param type - The type of the stream event
8311
8373
  * @param conversationId - The conversation ID
8312
8374
  * @param messageId - The message ID
8313
- * @param patentMessageId - The parent message ID
8375
+ * @param parentMessageId - The parent message ID
8314
8376
  * @param data - Additional data with timestamp
8315
8377
  */
8316
- constructor(type: string, conversationId: string, messageId: string, patentMessageId: string, data: T);
8378
+ constructor(type: string, conversationId: string, messageId: string, parentMessageId: string, data: T);
8317
8379
  /**
8318
8380
  * Get the type of the stream event
8319
8381
  * @returns The type as a string
@@ -8346,14 +8408,26 @@ export class AIAssistantBaseEvent<T extends AssistantBaseEventData = AssistantBa
8346
8408
  setMessageId(messageId: string): void;
8347
8409
  /**
8348
8410
  * Get the parent message ID
8411
+ * @deprecated Use getParentMessageId() instead
8349
8412
  * @returns The parent message ID as a string
8350
8413
  */
8351
8414
  getPatentMessageId(): string;
8415
+ /**
8416
+ * Get the parent message ID
8417
+ * @returns The parent message ID as a string
8418
+ */
8419
+ getParentMessageId(): string;
8352
8420
  /**
8353
8421
  * Set the parent message ID
8354
- * @param patentMessageId - The parent message ID to set
8422
+ * @deprecated Use setParentMessageId() instead
8423
+ * @param parentMessageId - The parent message ID to set
8355
8424
  */
8356
- setPatentMessageId(patentMessageId: string): void;
8425
+ setPatentMessageId(parentMessageId: string): void;
8426
+ /**
8427
+ * Set the parent message ID
8428
+ * @param parentMessageId - The parent message ID to set
8429
+ */
8430
+ setParentMessageId(parentMessageId: string): void;
8357
8431
  /**
8358
8432
  * Get the data object
8359
8433
  * @returns The data object
@@ -8415,7 +8489,7 @@ export interface AssistantRunStartedEventData extends AssistantBaseEventData {
8415
8489
  [key: string]: any;
8416
8490
  }
8417
8491
  export class AIAssistantRunStartedEvent extends AIAssistantBaseEvent<AssistantRunStartedEventData> {
8418
- constructor(conversationId: string, messageId: string, patentMessageId: string, data: AssistantRunStartedEventData);
8492
+ constructor(conversationId: string, messageId: string, parentMessageId: string, data: AssistantRunStartedEventData);
8419
8493
  }
8420
8494
 
8421
8495
  /**
@@ -8426,7 +8500,7 @@ export interface AssistantRunFinishedEventData extends AssistantBaseEventData {
8426
8500
  [key: string]: any;
8427
8501
  }
8428
8502
  export class AIAssistantRunFinishedEvent extends AIAssistantBaseEvent<AssistantRunFinishedEventData> {
8429
- constructor(conversationId: string, messageId: string, patentMessageId: string, data: AssistantRunFinishedEventData);
8503
+ constructor(conversationId: string, messageId: string, parentMessageId: string, data: AssistantRunFinishedEventData);
8430
8504
  }
8431
8505
 
8432
8506
  /**
@@ -8438,7 +8512,7 @@ export interface AssistantMessageStartedEventData extends AssistantBaseEventData
8438
8512
  [key: string]: any;
8439
8513
  }
8440
8514
  export class AIAssistantMessageStartedEvent extends AIAssistantBaseEvent<AssistantMessageStartedEventData> {
8441
- constructor(conversationId: string, messageId: string, patentMessageId: string, data: AssistantMessageStartedEventData);
8515
+ constructor(conversationId: string, messageId: string, parentMessageId: string, data: AssistantMessageStartedEventData);
8442
8516
  /**
8443
8517
  * Returns the role of the event
8444
8518
  * @returns {string | undefined} The role of the event
@@ -8459,7 +8533,7 @@ export interface AssistantMessageEndedEventData extends AssistantBaseEventData {
8459
8533
  [key: string]: any;
8460
8534
  }
8461
8535
  export class AIAssistantMessageEndedEvent extends AIAssistantBaseEvent<AssistantMessageEndedEventData> {
8462
- constructor(conversationId: string, messageId: string, patentMessageId: string, data: AssistantMessageEndedEventData);
8536
+ constructor(conversationId: string, messageId: string, parentMessageId: string, data: AssistantMessageEndedEventData);
8463
8537
  }
8464
8538
 
8465
8539
  /**
@@ -8474,7 +8548,7 @@ export interface AssistantContentEventData extends AssistantBaseEventData {
8474
8548
  * Event class for text message content received from assistant
8475
8549
  */
8476
8550
  export class AIAssistantContentReceivedEvent extends AIAssistantBaseEvent<AssistantContentEventData> {
8477
- constructor(conversationId: string, messageId: string, patentMessageId: string, data: AssistantContentEventData);
8551
+ constructor(conversationId: string, messageId: string, parentMessageId: string, data: AssistantContentEventData);
8478
8552
  /**
8479
8553
  * Gets the delta value for the content received event
8480
8554
  * @returns The delta string
@@ -8502,7 +8576,7 @@ export interface AssistantToolStartedEventData extends AssistantBaseEventData {
8502
8576
  * Event class for tool call started events
8503
8577
  */
8504
8578
  export class AIAssistantToolStartedEvent extends AIAssistantBaseEvent<AssistantToolStartedEventData> {
8505
- constructor(conversationId: string, messageId: string, patentMessageId: string, data: AssistantToolStartedEventData);
8579
+ constructor(conversationId: string, messageId: string, parentMessageId: string, data: AssistantToolStartedEventData);
8506
8580
  /**
8507
8581
  * Gets the tool call ID for the tool started event
8508
8582
  * @returns The tool call ID
@@ -8558,7 +8632,7 @@ export interface AssistantToolArgumentEventData extends AssistantBaseEventData {
8558
8632
  * Event class for tool call argument events
8559
8633
  */
8560
8634
  export class AIAssistantToolArgumentEvent extends AIAssistantBaseEvent<AssistantToolArgumentEventData> {
8561
- constructor(conversationId: string, messageId: string, patentMessageId: string, data: AssistantToolArgumentEventData);
8635
+ constructor(conversationId: string, messageId: string, parentMessageId: string, data: AssistantToolArgumentEventData);
8562
8636
  /**
8563
8637
  * Gets the tool call ID for the tool argument event
8564
8638
  * @returns The tool call ID
@@ -8593,7 +8667,7 @@ export interface AssistantToolEndedEventData extends AssistantBaseEventData {
8593
8667
  * Event class for tool call ended events
8594
8668
  */
8595
8669
  export class AIAssistantToolEndedEvent extends AIAssistantBaseEvent<AssistantToolEndedEventData> {
8596
- constructor(conversationId: string, messageId: string, patentMessageId: string, data: AssistantToolEndedEventData);
8670
+ constructor(conversationId: string, messageId: string, parentMessageId: string, data: AssistantToolEndedEventData);
8597
8671
  /**
8598
8672
  * Gets the tool call ID for the tool ended event
8599
8673
  * @returns The tool call ID
@@ -8625,7 +8699,7 @@ export interface AssistantToolResultEventData extends AssistantBaseEventData {
8625
8699
  * Event class for tool call result events
8626
8700
  */
8627
8701
  export class AIAssistantToolResultEvent extends AIAssistantBaseEvent<AssistantToolResultEventData> {
8628
- constructor(conversationId: string, messageId: string, patentMessageId: string, data: AssistantToolResultEventData);
8702
+ constructor(conversationId: string, messageId: string, parentMessageId: string, data: AssistantToolResultEventData);
8629
8703
  /**
8630
8704
  * Gets the tool call ID for the tool result event
8631
8705
  * @returns The tool call ID
@@ -8657,4 +8731,3 @@ export class AIAssistantToolResultEvent extends AIAssistantBaseEvent<AssistantTo
8657
8731
  */
8658
8732
  setRole(role: string): void;
8659
8733
  }
8660
-