Skip to content

Commit

Permalink
v4.0.4-beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikRitik committed Mar 13, 2024
1 parent 0a2b7c3 commit 3567f4d
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 78 deletions.
160 changes: 84 additions & 76 deletions CometChat.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ export class CometChat {
HIDE_DELETED_MESSAGES: string;
WITH_TAGS: string;
TAGS: string;
MY_MENTIONS_ONLY: string;
MENTIONS_WITH_TAG_INFO: string;
MENTIONS_WITH_BLOCKED_INFO: string;
ONLY_INTERACTION_GOAL_COMPLETED: string;
Expand Down Expand Up @@ -892,6 +891,7 @@ export class CometChat {
REGION_DEFAULT_US: string;
REGION_DEFAULT_IN: string;
REGION_DEFAULT_PRIVATE: string;
REACTIONS_MAX_LIMIT: number;
};
static DELIVERY_RECEIPTS: {
RECEIVER_ID: string;
Expand Down Expand Up @@ -974,14 +974,17 @@ export class CometChat {
static User: typeof User;
static GroupMember: typeof GroupMember;
static Conversation: typeof Conversation;
static ReactionCount: typeof ReactionCount;
static ReactionEvent: typeof ReactionEvent;
static Reaction: typeof Reaction;
static USER_STATUS: {
ONLINE: string;
OFFLINE: string;
};
static MessagesRequest: typeof MessagesRequest;
static MessagesRequestBuilder: typeof MessagesRequestBuilder;
static ReactionRequest: typeof ReactionRequest;
static ReactionRequestBuilder: typeof ReactionRequestBuilder;
static ReactionsRequest: typeof ReactionsRequest;
static ReactionsRequestBuilder: typeof ReactionsRequestBuilder;
static UsersRequest: typeof UsersRequest;
static UsersRequestBuilder: typeof UsersRequestBuilder;
static ConversationsRequest: typeof ConversationsRequest;
Expand Down Expand Up @@ -2549,7 +2552,7 @@ export class BaseMessage implements Message {
setData(value: object): void;
/**
* set the array of reactions in message
* @returns {ReactionCount[]}
* @param {ReactionCount[]} reactions
*/
setReactions(reactions: any): ReactionCount[];
/**
Expand Down Expand Up @@ -2662,6 +2665,7 @@ export const DEFAULT_VALUES: {
REGION_DEFAULT_US: string;
REGION_DEFAULT_IN: string;
REGION_DEFAULT_PRIVATE: string;
REACTIONS_MAX_LIMIT: number;
};
export const CALLING_COMPONENT_VERSION = 5;
export enum GroupType {
Expand Down Expand Up @@ -2884,7 +2888,6 @@ export const MessageConstatnts: {
HIDE_DELETED_MESSAGES: string;
WITH_TAGS: string;
TAGS: string;
MY_MENTIONS_ONLY: string;
MENTIONS_WITH_TAG_INFO: string;
MENTIONS_WITH_BLOCKED_INFO: string;
ONLY_INTERACTION_GOAL_COMPLETED: string;
Expand Down Expand Up @@ -4946,7 +4949,6 @@ export class MessagesRequestBuilder {
/** @private */ tags?: Array<String>;
/** @private */ WithTags?: boolean;
/** @private */ interactionGoalCompletedOnly?: boolean;
/** @private */ ListMentionedMessages?: boolean;
/** @private */ mentionsWithUserTags?: boolean;
/** @private */ mentionsWithBlockedRelation?: boolean;
/**
Expand Down Expand Up @@ -5063,12 +5065,6 @@ export class MessagesRequestBuilder {
* @returns
*/
withTags(withTags: boolean): this;
/**
* A method to get the list of message with mentions
* @param {boolean} listMentionedMessages
* @returns
*/
myMentionsOnly(listMentionedMessages?: boolean): this;
/**
* A method to include the user tags when getting the list of message with mentions
* @param {boolean} mentionsWithUserTags
Expand Down Expand Up @@ -5456,7 +5452,7 @@ export class CometChatHelper {
* @memberof CometChat
*/
static getConversationFromMessage(message: TextMessage | MediaMessage | CustomMessage | InteractiveMessage | any): Promise<Conversation>;
static updateMessageWithReactionInfo(baseMessage: BaseMessage, messageReaction: MessageReaction, action: REACTION_ACTION): Promise<BaseMessage | null>;
static updateMessageWithReactionInfo(baseMessage: BaseMessage, messageReaction: Reaction, action: REACTION_ACTION): BaseMessage | CometChatException;
}

/**
Expand Down Expand Up @@ -6326,25 +6322,25 @@ export class InteractionReceipt {
setInteractions(interactions: Array<Interaction>): void;
}

export class ReactionRequest {
constructor(builder?: ReactionRequestBuilder);
export class ReactionsRequest {
constructor(builder?: ReactionsRequestBuilder);
/**
* Get list of next reactions list based on the parameters specified in ReactionRequestBuilder class. The Developer need to call this method repeatedly using the same object of ReactionRequest class to get paginated list of reactions.
* @returns {Promise<MessageReaction[] | []>}
* Get list of next reactions list based on the parameters specified in ReactionsRequestBuilder class. The Developer need to call this method repeatedly using the same object of ReactionsRequest class to get paginated list of reactions.
* @returns {Promise<Reaction[] | []>}
*/
fetchNext(): Promise<MessageReaction[] | []>;
fetchNext(): Promise<Reaction[] | []>;
/**
* Get list of previous reactions list based on the parameters specified in ReactionRequestBuilder class. The Developer need to call this method repeatedly using the same object of ReactionRequest class to get paginated list of reactions.
* @returns {Promise<MessageReaction[] | []>}
* Get list of previous reactions list based on the parameters specified in ReactionsRequestBuilder class. The Developer need to call this method repeatedly using the same object of ReactionsRequest class to get paginated list of reactions.
* @returns {Promise<Reaction[] | []>}
*/
fetchPrevious(): Promise<MessageReaction[] | []>;
fetchPrevious(): Promise<Reaction[] | []>;
}
export class ReactionRequestBuilder {
export class ReactionsRequestBuilder {
/** @private */ limit?: number;
/** @private */ msgId: number;
/** @private */ reaction?: string;
/**
* A method to set limit for the number of entries returned in a single iteration. A maximum of 100 entries can fetched in a single iteration.
* A method to set limit for the number of entries returned in a single iteration. A maximum of 20 entries can fetched in a single iteration.
* @param {number} limit
* @returns
*/
Expand All @@ -6356,15 +6352,76 @@ export class ReactionRequestBuilder {
*/
setMessageId(id?: number): this;
/**
* A method to fetch list of MessageReaction for a specific reaction.
* A method to fetch list of Reaction for a specific reaction.
* @returns
*/
setReaction(reaction: string): this;
/**
* This method will return an object of the ReactionRequest class.
* @returns {ReactionRequest}
* This method will return an object of the ReactionsRequest class.
* @returns {ReactionsRequest}
*/
build(): ReactionRequest;
build(): ReactionsRequest;
}

export class ReactionCount {
constructor(reaction: string, count: number, reactedByMe: boolean);
/**
* Method to get reacted reaction.
* @returns {string}
*/
getReaction(): string;
/**
* Method to set reacted reaction.
*/
setReaction(reaction: string): void;
/**
* Method to get no of users reacted with a reaction.
* @returns {number}
*/
getCount(): number;
/**
* Method to set no of users reacted with a reaction.
*/
setCount(count: number): void;
/**
* Method to get if loggedIn user reacted with the a reaction.
* @returns {boolean}
*/
getReactedByMe(): boolean;
/**
* Method to set if loggedIn user reacted with the a reaction.
*/
setReactedByMe(reactedByMe: boolean): void;
}

export class ReactionEvent {
constructor(reaction: Reaction, receiverId: string, receiverType: string, conversationId: string, parentMessageId?: string);
getReaction(): Reaction;
setReaction(reaction: Reaction): void;
getReceiverId(): string;
setReceiverId(receiverId: string): void;
getReceiverType(): string;
setReceiverType(receiverType: string): void;
getConversationId(): string;
setConversationId(conversationId: string): void;
getParentMessageId(): string;
setParentMessageId(parentMessageId: string): void;
}

export class Reaction {
constructor(reactionId: string, messageId: string, reaction: string, uid: string, reactedAt: number, reactedBy: User);
getReactionId(): string;
setReactionId(id: string): void;
getMessageId(): string;
setMessageId(messageId: string): void;
getReaction(): string;
setReaction(reaction: string): void;
getUid(): string;
setUid(uid: string): void;
getReactedAt(): number;
setReactedAt(reactedAt: number): void;
getReactedBy(): User;
setReactedBy(reactedBy: User): void;
}

/**
Expand Down Expand Up @@ -6471,55 +6528,6 @@ export class MessageReceipt {
setReceiptType(receiptType?: string): void;
}

export class ReactionCount {
reaction: string;
count: number;
reactedByMe?: boolean;
constructor(object: any);
/**
* Method to get reacted reaction.
* @returns {string}
*/
getReaction(): string;
/**
* Method to set reacted reaction.
*/
setReaction(reaction: string): void;
/**
* Method to get no of users reacted with a reaction.
* @returns {number}
*/
getCount(): number;
/**
* Method to set no of users reacted with a reaction.
*/
setCount(count: number): void;
/**
* Method to get if loggedIn user reacted with the a reaction.
* @returns {boolean}
*/
getReactedByMe(): boolean;
/**
* Method to set if loggedIn user reacted with the a reaction.
*/
setReactedByMe(reactedByMe: boolean): void;
}
export class MessageReaction {
constructor(object: any);
getReactionId(): string;
setReactionId(id: string): void;
getMessageId(): number | string;
setMessageId(messageId: number | string): void;
getReaction(): string;
setReaction(reaction: string): void;
getUid(): string;
setUid(uid: string): void;
getReactedAt(): number;
setReactedAt(reactedAt: number): void;
getReactedBy(): User;
setReactedBy(reactedBy: User): void;
}

export class RTCUser {
constructor(uid: string);
setUID(uid: string): void;
Expand Down
2 changes: 1 addition & 1 deletion CometChat.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cometchat/chat-sdk-javascript",
"version": "4.0.3",
"version": "4.0.4-beta1",
"description": "A complete chat solution.",
"main": "CometChat.js",
"scripts": {
Expand Down

0 comments on commit 3567f4d

Please sign in to comment.