redai-automation-web-sdk
Version:
TypeScript SDK for RedAI Automation Web API - Zalo Personal automation, messaging, advanced sticker search, and bulk operations. 100% compatible with automation-web backend. v1.8.0: Added SessionProxyService for managing proxy assignments to sessions with
223 lines • 5.33 kB
TypeScript
/**
* Group Event Types
* 100% khớp với zalo-personal-sdk/src/models/GroupEvent.ts
*/
import { GroupEventType } from './enums';
/**
* Group Member Type
*/
export interface Member {
id: string;
dName: string;
avatar: string;
type: number;
avatar_25: string;
}
/**
* Group Setting Type
*/
export interface GroupSetting {
blockName: number;
signAdminMsg: number;
addMemberOnly: number;
setTopicOnly: number;
enableMsgHistory: number;
joinAppr: number;
lockCreatePost: number;
lockCreatePoll: number;
lockSendMsg: number;
lockViewMember: number;
bannFeature: number;
dirtyMedia: number;
banDuration: number;
}
/**
* Group Topic Type
*/
export interface GroupTopic {
type: number;
color: number;
emoji: string;
startTime: number;
duration: number;
params: string;
id: string;
creatorId: string;
createTime: number;
editorId: string;
editTime: number;
repeat: number;
action: number;
}
/**
* Group Info Type
*/
export interface GroupInfo {
group_link?: string;
link_expired_time?: number;
[key: string]: any;
}
/**
* Group Extra Data Type
*/
export interface GroupExtraData {
featureId?: number;
field?: string;
[key: string]: any;
}
/**
* Base Group Event Type
*/
export interface TGroupEventBase {
subType: number;
groupId: string;
creatorId: string;
groupName: string;
sourceId: string;
updateMembers: Member[];
groupSetting: GroupSetting | null;
groupTopic: GroupTopic | null;
info: GroupInfo | null;
extraData: GroupExtraData | null;
time: string;
avt: string | null;
fullAvt: string | null;
isAdd: number;
hideGroupInfo: number;
version: string;
groupType: number;
clientId?: number;
errorMap?: Record<string, any>;
e2ee?: number;
}
/**
* Group Event Join Request Type
*/
export interface TGroupEventJoinRequest {
uids: string[];
totalPending: number;
groupId: string;
time: string;
}
/**
* Group Event Pin Topic Type
*/
export interface TGroupEventPinTopic {
oldBoardVersion: number;
boardVersion: number;
topic: GroupTopic;
actorId: string;
groupId: string;
}
/**
* Group Event Reorder Pin Topic Type
*/
export interface TGroupEventReorderPinTopic {
oldBoardVersion: number;
actorId: string;
topics: {
topicId: string;
topicType: number;
}[];
groupId: string;
boardVersion: number;
topic: null;
}
/**
* Group Event Board Type
*/
export interface TGroupEventBoard {
sourceId: string;
groupName: string;
groupTopic: GroupTopic;
groupId: string;
creatorId: string;
subType?: number;
updateMembers?: Member[];
groupSetting?: GroupSetting;
info?: GroupInfo;
extraData?: GroupExtraData;
time?: string;
avt?: null;
fullAvt?: null;
isAdd?: number;
hideGroupInfo?: number;
version?: string;
groupType?: number;
}
/**
* Group Event Remind Respond Type
*/
export interface TGroupEventRemindRespond {
topicId: string;
updateMembers: string[];
groupId: string;
time: string;
}
/**
* Group Event Remind Topic Type
*/
export interface TGroupEventRemindTopic {
msg: string;
editorId: string;
color: string;
emoji: string;
creatorId: string;
editTime: number;
type: number;
duration: number;
group_id: string;
createTime: number;
repeat: number;
startTime: number;
time: number;
remindType: number;
}
/**
* Group Event Union Type
*/
export type TGroupEvent = TGroupEventBase | TGroupEventJoinRequest | TGroupEventPinTopic | TGroupEventReorderPinTopic | TGroupEventBoard | TGroupEventRemindRespond | TGroupEventRemindTopic;
/**
* Group Event Discriminated Union
*/
export type GroupEvent = {
type: GroupEventType.JOIN_REQUEST;
data: TGroupEventJoinRequest;
threadId: string;
isSelf: boolean;
} | {
type: GroupEventType.NEW_PIN_TOPIC | GroupEventType.UNPIN_TOPIC | GroupEventType.UPDATE_PIN_TOPIC;
data: TGroupEventPinTopic;
threadId: string;
isSelf: boolean;
} | {
type: GroupEventType.REORDER_PIN_TOPIC;
data: TGroupEventReorderPinTopic;
threadId: string;
isSelf: boolean;
} | {
type: GroupEventType.UPDATE_BOARD | GroupEventType.REMOVE_BOARD;
data: TGroupEventBoard;
threadId: string;
isSelf: boolean;
} | {
type: GroupEventType.ACCEPT_REMIND | GroupEventType.REJECT_REMIND;
data: TGroupEventRemindRespond;
threadId: string;
isSelf: boolean;
} | {
type: GroupEventType.REMIND_TOPIC;
data: TGroupEventRemindTopic;
threadId: string;
isSelf: boolean;
} | {
type: Exclude<GroupEventType, GroupEventType.JOIN_REQUEST | GroupEventType.NEW_PIN_TOPIC | GroupEventType.UNPIN_TOPIC | GroupEventType.UPDATE_PIN_TOPIC | GroupEventType.REORDER_PIN_TOPIC | GroupEventType.UPDATE_BOARD | GroupEventType.REMOVE_BOARD | GroupEventType.ACCEPT_REMIND | GroupEventType.REJECT_REMIND | GroupEventType.REMIND_TOPIC>;
data: TGroupEventBase;
threadId: string;
isSelf: boolean;
};
/**
* Initialize Group Event Function
*/
export declare function initializeGroupEvent(uid: string, data: TGroupEvent, type: GroupEventType): GroupEvent;
//# sourceMappingURL=group-event.d.ts.map