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.1: Updated GroupInfo interface to match backend controller with complete gro
147 lines • 6.18 kB
TypeScript
/**
* Event Job Types (Non-Message Events)
* 100% khớp với automation-web event jobs
*/
import { BaseZaloWebhookEvent, ZaloWebhookEventType } from './webhook-job.types';
import { Typing, Reaction, SeenMessage, DeliveredMessage, Undo } from '../webhook';
/**
* Typing Event Data - sử dụng trực tiếp Typing từ zalo-personal-sdk
* Automation-web sử dụng trực tiếp: data: typing
*/
export type ZaloTypingData = Typing;
/**
* Typing event interfaces - 4 variants
*/
export interface ZaloTypingBySelfInUserEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.TYPING_BY_SELF_IN_USER;
data: ZaloTypingData;
}
export interface ZaloTypingBySelfInGroupEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.TYPING_BY_SELF_IN_GROUP;
data: ZaloTypingData;
}
export interface ZaloTypingByOtherInUserEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.TYPING_BY_OTHER_IN_USER;
data: ZaloTypingData;
}
export interface ZaloTypingByOtherInGroupEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.TYPING_BY_OTHER_IN_GROUP;
data: ZaloTypingData;
}
/**
* Union type for all typing events
*/
export type ZaloTypingEvent = ZaloTypingBySelfInUserEvent | ZaloTypingBySelfInGroupEvent | ZaloTypingByOtherInUserEvent | ZaloTypingByOtherInGroupEvent;
/**
* Seen Message Event Data - sử dụng trực tiếp SeenMessage[] từ zalo-personal-sdk
* Automation-web sử dụng trực tiếp: data: messages (array)
*/
export type ZaloSeenMessageData = SeenMessage[];
/**
* Seen messages event interfaces - 4 variants
*/
export interface ZaloSeenMessagesBySelfInUserEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_USER;
data: ZaloSeenMessageData;
}
export interface ZaloSeenMessagesBySelfInGroupEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.SEEN_MESSAGES_BY_SELF_IN_GROUP;
data: ZaloSeenMessageData;
}
export interface ZaloSeenMessagesByOtherInUserEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_USER;
data: ZaloSeenMessageData;
}
export interface ZaloSeenMessagesByOtherInGroupEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.SEEN_MESSAGES_BY_OTHER_IN_GROUP;
data: ZaloSeenMessageData;
}
/**
* Union type for all seen message events
*/
export type ZaloSeenMessagesEvent = ZaloSeenMessagesBySelfInUserEvent | ZaloSeenMessagesBySelfInGroupEvent | ZaloSeenMessagesByOtherInUserEvent | ZaloSeenMessagesByOtherInGroupEvent;
/**
* Delivered Message Event Data - sử dụng trực tiếp DeliveredMessage[] từ zalo-personal-sdk
* Automation-web sử dụng trực tiếp: data: messages (array)
*/
export type ZaloDeliveredMessageData = DeliveredMessage[];
/**
* Delivered messages event interfaces - 4 variants
*/
export interface ZaloDeliveredMessagesBySelfInUserEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_USER;
data: ZaloDeliveredMessageData;
}
export interface ZaloDeliveredMessagesBySelfInGroupEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.DELIVERED_MESSAGES_BY_SELF_IN_GROUP;
data: ZaloDeliveredMessageData;
}
export interface ZaloDeliveredMessagesByOtherInUserEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_USER;
data: ZaloDeliveredMessageData;
}
export interface ZaloDeliveredMessagesByOtherInGroupEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.DELIVERED_MESSAGES_BY_OTHER_IN_GROUP;
data: ZaloDeliveredMessageData;
}
/**
* Union type for all delivered message events
*/
export type ZaloDeliveredMessagesEvent = ZaloDeliveredMessagesBySelfInUserEvent | ZaloDeliveredMessagesBySelfInGroupEvent | ZaloDeliveredMessagesByOtherInUserEvent | ZaloDeliveredMessagesByOtherInGroupEvent;
/**
* Reaction Event Data - sử dụng trực tiếp Reaction từ zalo-personal-sdk
* Automation-web sử dụng trực tiếp: data: reaction
*/
export type ZaloReactionData = Reaction;
/**
* Reaction event interfaces - 4 variants
*/
export interface ZaloReactionBySelfInUserEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.REACTION_BY_SELF_IN_USER;
data: ZaloReactionData;
}
export interface ZaloReactionBySelfInGroupEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.REACTION_BY_SELF_IN_GROUP;
data: ZaloReactionData;
}
export interface ZaloReactionByOtherInUserEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.REACTION_BY_OTHER_IN_USER;
data: ZaloReactionData;
}
export interface ZaloReactionByOtherInGroupEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.REACTION_BY_OTHER_IN_GROUP;
data: ZaloReactionData;
}
/**
* Union type for all reaction events
*/
export type ZaloReactionEvent = ZaloReactionBySelfInUserEvent | ZaloReactionBySelfInGroupEvent | ZaloReactionByOtherInUserEvent | ZaloReactionByOtherInGroupEvent;
/**
* Undo Event Data - sử dụng trực tiếp Undo từ zalo-personal-sdk
* Automation-web sử dụng trực tiếp: data: undo
*/
export type ZaloUndoData = Undo;
/**
* Undo event interfaces - 4 variants
*/
export interface ZaloUndoBySelfInUserEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.UNDO_BY_SELF_IN_USER;
data: ZaloUndoData;
}
export interface ZaloUndoBySelfInGroupEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.UNDO_BY_SELF_IN_GROUP;
data: ZaloUndoData;
}
export interface ZaloUndoByOtherInUserEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.UNDO_BY_OTHER_IN_USER;
data: ZaloUndoData;
}
export interface ZaloUndoByOtherInGroupEvent extends BaseZaloWebhookEvent {
eventType: ZaloWebhookEventType.UNDO_BY_OTHER_IN_GROUP;
data: ZaloUndoData;
}
/**
* Union type for all undo events
*/
export type ZaloUndoEvent = ZaloUndoBySelfInUserEvent | ZaloUndoBySelfInGroupEvent | ZaloUndoByOtherInUserEvent | ZaloUndoByOtherInGroupEvent;
//# sourceMappingURL=event-job.types.d.ts.map