@warriorteam/zalo-webhook-types
Version:
TypeScript types for Zalo Personal webhook events from automation-web
222 lines • 9.81 kB
TypeScript
/**
* Zalo Personal Webhook Events - Enums
*
* Complete enum definitions for all 57 webhook event types.
* Synced with automation-web documentation.
*/
/**
* Thread Type enum
*/
export declare enum ZaloThreadType {
USER = "user",
GROUP = "group"
}
/**
* All Zalo webhook event types (57 total)
*/
export declare enum ZaloWebhookEventType {
TEXT_MESSAGE_SENT_TO_USER = "text-message-sent-to-user",
TEXT_MESSAGE_SENT_TO_GROUP = "text-message-sent-to-group",
TEXT_MESSAGE_RECEIVED_FROM_USER = "text-message-received-from-user",
TEXT_MESSAGE_RECEIVED_FROM_GROUP = "text-message-received-from-group",
LINK_MESSAGE_SENT_TO_USER = "link-message-sent-to-user",
LINK_MESSAGE_SENT_TO_GROUP = "link-message-sent-to-group",
LINK_MESSAGE_RECEIVED_FROM_USER = "link-message-received-from-user",
LINK_MESSAGE_RECEIVED_FROM_GROUP = "link-message-received-from-group",
IMAGE_MESSAGE_SENT_TO_USER = "image-message-sent-to-user",
IMAGE_MESSAGE_SENT_TO_GROUP = "image-message-sent-to-group",
IMAGE_MESSAGE_RECEIVED_FROM_USER = "image-message-received-from-user",
IMAGE_MESSAGE_RECEIVED_FROM_GROUP = "image-message-received-from-group",
VIDEO_MESSAGE_SENT_TO_USER = "video-message-sent-to-user",
VIDEO_MESSAGE_SENT_TO_GROUP = "video-message-sent-to-group",
VIDEO_MESSAGE_RECEIVED_FROM_USER = "video-message-received-from-user",
VIDEO_MESSAGE_RECEIVED_FROM_GROUP = "video-message-received-from-group",
VOICE_MESSAGE_SENT_TO_USER = "voice-message-sent-to-user",
VOICE_MESSAGE_SENT_TO_GROUP = "voice-message-sent-to-group",
VOICE_MESSAGE_RECEIVED_FROM_USER = "voice-message-received-from-user",
VOICE_MESSAGE_RECEIVED_FROM_GROUP = "voice-message-received-from-group",
GIF_MESSAGE_SENT_TO_USER = "gif-message-sent-to-user",
GIF_MESSAGE_SENT_TO_GROUP = "gif-message-sent-to-group",
GIF_MESSAGE_RECEIVED_FROM_USER = "gif-message-received-from-user",
GIF_MESSAGE_RECEIVED_FROM_GROUP = "gif-message-received-from-group",
DOODLE_MESSAGE_SENT_TO_USER = "doodle-message-sent-to-user",
DOODLE_MESSAGE_SENT_TO_GROUP = "doodle-message-sent-to-group",
DOODLE_MESSAGE_RECEIVED_FROM_USER = "doodle-message-received-from-user",
DOODLE_MESSAGE_RECEIVED_FROM_GROUP = "doodle-message-received-from-group",
FILE_MESSAGE_SENT_TO_USER = "file-message-sent-to-user",
FILE_MESSAGE_SENT_TO_GROUP = "file-message-sent-to-group",
FILE_MESSAGE_RECEIVED_FROM_USER = "file-message-received-from-user",
FILE_MESSAGE_RECEIVED_FROM_GROUP = "file-message-received-from-group",
STICKER_MESSAGE_SENT_TO_USER = "sticker-message-sent-to-user",
STICKER_MESSAGE_SENT_TO_GROUP = "sticker-message-sent-to-group",
STICKER_MESSAGE_RECEIVED_FROM_USER = "sticker-message-received-from-user",
STICKER_MESSAGE_RECEIVED_FROM_GROUP = "sticker-message-received-from-group",
LOCATION_MESSAGE_SENT_TO_USER = "location-message-sent-to-user",
LOCATION_MESSAGE_SENT_TO_GROUP = "location-message-sent-to-group",
LOCATION_MESSAGE_RECEIVED_FROM_USER = "location-message-received-from-user",
LOCATION_MESSAGE_RECEIVED_FROM_GROUP = "location-message-received-from-group",
MESSAGE_SENT_TO_USER = "message-sent-to-user",
MESSAGE_SENT_TO_GROUP = "message-sent-to-group",
MESSAGE_RECEIVED_FROM_USER = "message-received-from-user",
MESSAGE_RECEIVED_FROM_GROUP = "message-received-from-group",
TYPING = "typing",
SEEN_MESSAGES = "seen-messages",
DELIVERED_MESSAGES = "delivered-messages",
REACTION = "reaction",
UNDO = "undo",
FRIEND_EVENT = "friend-event",
GROUP_EVENT = "group-event",
CONNECTION_STATUS = "connection-status",
ERROR = "error",
OLD_MESSAGES = "old-messages",
OLD_REACTIONS = "old-reactions",
UPLOAD_ATTACHMENT = "upload-attachment",
CIPHER_KEY = "cipher-key"
}
/**
* Friend Event Type enum (simplified)
*/
export declare enum ZaloFriendEventType {
REQUEST = "REQUEST",
ADD = "ADD",
REMOVE = "REMOVE",
BLOCK = "BLOCK",
UNBLOCK = "UNBLOCK"
}
/**
* Group Event Type enum (simplified)
*/
export declare enum ZaloGroupEventType {
JOIN = "JOIN",
LEAVE = "LEAVE",
UPDATE = "UPDATE",
KICK = "KICK",
PROMOTE = "PROMOTE",
DEMOTE = "DEMOTE"
}
/**
* Reaction Type enum từ SDK
*/
export declare enum ZaloReactionType {
LIKE = "/-heart",
LOVE = "/-heart",
HAHA = ":))",
WOW = ":-o",
SAD = ":(",
ANGRY = ">:(",
NONE = ""
}
/**
* Connection Status enum
*/
export declare enum ZaloConnectionStatus {
CONNECTED = "connected",
DISCONNECTED = "disconnected",
RECONNECTING = "reconnecting",
LOGGED_OUT = "logged_out"
}
/**
* Upload Attachment Status enum
*/
export declare enum ZaloUploadStatus {
IN_PROGRESS = "in_progress",
COMPLETED = "completed",
FAILED = "failed"
}
/**
* Message categories for classification
*/
export declare enum ZaloMessageCategory {
TEXT = "text",
MEDIA = "media",
FILE = "file",
SOCIAL = "social"
}
/**
* SDK message types from Zalo Personal
*/
export declare enum ZaloMessageType {
WEBCHAT = "webchat",
LINK = "chat.link",
PHOTO = "chat.photo",
VIDEO = "chat.video.msg",
VOICE = "chat.voice",
GIF = "chat.gif",
DOODLE = "chat.doodle",
FILE = "share.file",
STICKER = "chat.sticker",
LOCATION = "chat.location.new"
}
/**
* Reaction icon types (updated to match documentation)
*/
export declare enum ZaloReactionIcon {
NONE = 0,
LIKE = 1,
LOVE = 2,
HAHA = 3,
WOW = 4,
SAD = 5,
ANGRY = 6
}
/**
* All text message event types
*/
export type TextMessageEventType = ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_USER | ZaloWebhookEventType.TEXT_MESSAGE_SENT_TO_GROUP | ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_USER | ZaloWebhookEventType.TEXT_MESSAGE_RECEIVED_FROM_GROUP;
/**
* All link message event types
*/
export type LinkMessageEventType = ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_USER | ZaloWebhookEventType.LINK_MESSAGE_SENT_TO_GROUP | ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_USER | ZaloWebhookEventType.LINK_MESSAGE_RECEIVED_FROM_GROUP;
/**
* All image message event types
*/
export type ImageMessageEventType = ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_USER | ZaloWebhookEventType.IMAGE_MESSAGE_SENT_TO_GROUP | ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_USER | ZaloWebhookEventType.IMAGE_MESSAGE_RECEIVED_FROM_GROUP;
/**
* All video message event types
*/
export type VideoMessageEventType = ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_USER | ZaloWebhookEventType.VIDEO_MESSAGE_SENT_TO_GROUP | ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_USER | ZaloWebhookEventType.VIDEO_MESSAGE_RECEIVED_FROM_GROUP;
/**
* All voice message event types
*/
export type VoiceMessageEventType = ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_USER | ZaloWebhookEventType.VOICE_MESSAGE_SENT_TO_GROUP | ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_USER | ZaloWebhookEventType.VOICE_MESSAGE_RECEIVED_FROM_GROUP;
/**
* All GIF message event types
*/
export type GifMessageEventType = ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_USER | ZaloWebhookEventType.GIF_MESSAGE_SENT_TO_GROUP | ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_USER | ZaloWebhookEventType.GIF_MESSAGE_RECEIVED_FROM_GROUP;
/**
* All file message event types
*/
export type FileMessageEventType = ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_USER | ZaloWebhookEventType.FILE_MESSAGE_SENT_TO_GROUP | ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_USER | ZaloWebhookEventType.FILE_MESSAGE_RECEIVED_FROM_GROUP;
/**
* All sticker message event types
*/
export type StickerMessageEventType = ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_USER | ZaloWebhookEventType.STICKER_MESSAGE_SENT_TO_GROUP | ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_USER | ZaloWebhookEventType.STICKER_MESSAGE_RECEIVED_FROM_GROUP;
/**
* All location message event types
*/
export type LocationMessageEventType = ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_USER | ZaloWebhookEventType.LOCATION_MESSAGE_SENT_TO_GROUP | ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_USER | ZaloWebhookEventType.LOCATION_MESSAGE_RECEIVED_FROM_GROUP;
/**
* All doodle message event types
*/
export type DoodleMessageEventType = ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_USER | ZaloWebhookEventType.DOODLE_MESSAGE_SENT_TO_GROUP | ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_USER | ZaloWebhookEventType.DOODLE_MESSAGE_RECEIVED_FROM_GROUP;
/**
* All generic message event types
*/
export type GenericMessageEventType = ZaloWebhookEventType.MESSAGE_SENT_TO_USER | ZaloWebhookEventType.MESSAGE_SENT_TO_GROUP | ZaloWebhookEventType.MESSAGE_RECEIVED_FROM_USER | ZaloWebhookEventType.MESSAGE_RECEIVED_FROM_GROUP;
/**
* All message event types (44 total)
*/
export type MessageEventType = TextMessageEventType | LinkMessageEventType | ImageMessageEventType | VideoMessageEventType | VoiceMessageEventType | GifMessageEventType | FileMessageEventType | StickerMessageEventType | LocationMessageEventType | DoodleMessageEventType | GenericMessageEventType;
/**
* All interaction event types (5 total)
*/
export type InteractionEventType = ZaloWebhookEventType.TYPING | ZaloWebhookEventType.SEEN_MESSAGES | ZaloWebhookEventType.DELIVERED_MESSAGES | ZaloWebhookEventType.REACTION | ZaloWebhookEventType.UNDO;
/**
* All social event types (2 total)
*/
export type SocialEventType = ZaloWebhookEventType.FRIEND_EVENT | ZaloWebhookEventType.GROUP_EVENT;
/**
* All system event types (6 total)
*/
export type SystemEventType = ZaloWebhookEventType.CONNECTION_STATUS | ZaloWebhookEventType.ERROR | ZaloWebhookEventType.OLD_MESSAGES | ZaloWebhookEventType.OLD_REACTIONS | ZaloWebhookEventType.UPLOAD_ATTACHMENT | ZaloWebhookEventType.CIPHER_KEY;
//# sourceMappingURL=index.d.ts.map