UNPKG

n8n-nodes-zalo-nnt

Version:

Unofficial Zalo integration for n8n - Send messages, manage groups, user operations with QR login. No API key required, works via browser simulation.

586 lines 19.9 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.zaloSendMessageProperties = void 0; const branding_1 = require("../shared/branding"); exports.zaloSendMessageProperties = [ branding_1.BRANDING_CONFIG, { displayName: 'ID Cuộc Trò Chuyện', name: 'threadId', type: 'string', default: '', required: true, description: 'ID của cuộc trò chuyện để gửi tin nhắn', }, { displayName: 'Loại', name: 'type', type: 'options', options: [ { name: 'Người Dùng', value: 0, }, { name: 'Nhóm', value: 1, }, ], default: 0, description: 'Loại tin nhắn (người dùng hoặc nhóm)', }, { displayName: 'Loại Nội Dung', name: 'messageType', type: 'options', options: [ { name: 'Tin Nhắn Văn Bản/Ảnh', value: 'text', }, { name: 'Video', value: 'video', }, { name: 'Danh Thiếp (Card)', value: 'card', }, { name: 'Thẻ Ngân Hàng', value: 'bankCard', }, { name: 'Link (Xem Trước)', value: 'link', }, { name: 'Tin Nhắn Thoại', value: 'voice', }, { name: 'Chỉ Tải Lên Tệp (Không Gửi)', value: 'upload', }, ], default: 'text', description: 'Loại nội dung gửi đi: văn bản/ảnh, video, danh thiếp, thẻ ngân hàng, link, thoại, hoặc chỉ tải lên tệp', }, { displayName: 'ID Người Dùng', name: 'cardUserId', type: 'string', default: '', required: true, displayOptions: { show: { messageType: ['card'], }, }, description: 'ID người dùng muốn gửi danh thiếp (danh thiếp chính là thông tin liên hệ của user này)', }, { displayName: 'Số Điện Thoại', name: 'cardPhoneNumber', type: 'string', default: '', displayOptions: { show: { messageType: ['card'], }, }, description: 'Số điện thoại hiển thị trên danh thiếp (tùy chọn)', }, { displayName: 'TTL (Ms)', name: 'cardTtl', type: 'number', default: 0, displayOptions: { show: { messageType: ['card'], }, }, description: 'Thời gian tồn tại tin nhắn tính bằng mili giây (0 = không giới hạn)', }, { displayName: 'Mã Ngân Hàng (BIN)', name: 'bankCardBin', type: 'number', default: '', required: true, displayOptions: { show: { messageType: ['bankCard'], }, }, description: 'Mã BIN ngân hàng theo enum BinBankCard của zca-js (ví dụ: Vietcombank, ACB...). Xem danh sách tại node_modules/zca-js.', }, { displayName: 'Số Tài Khoản', name: 'bankCardAccNum', type: 'string', default: '', required: true, displayOptions: { show: { messageType: ['bankCard'], }, }, description: 'Số tài khoản ngân hàng', }, { displayName: 'Tên Chủ Tài Khoản', name: 'bankCardAccName', type: 'string', default: '', displayOptions: { show: { messageType: ['bankCard'], }, }, description: 'Tên chủ tài khoản (tùy chọn)', }, { displayName: 'Link', name: 'linkUrl', type: 'string', default: '', required: true, displayOptions: { show: { messageType: ['link'], }, }, description: 'URL cần gửi kèm xem trước (link preview)', }, { displayName: 'Tin Nhắn Kèm Theo', name: 'linkMsg', type: 'string', default: '', displayOptions: { show: { messageType: ['link'], }, }, description: 'Nội dung tin nhắn kèm link (tùy chọn)', }, { displayName: 'TTL (Ms)', name: 'linkTtl', type: 'number', default: 0, displayOptions: { show: { messageType: ['link'], }, }, description: 'Thời gian tồn tại tin nhắn tính bằng mili giây (0 = không giới hạn)', }, { displayName: 'URL File Thoại', name: 'voiceUrl', type: 'string', default: '', required: true, displayOptions: { show: { messageType: ['voice'], }, }, description: 'URL file âm thanh cần gửi', }, { displayName: 'TTL (Ms)', name: 'voiceTtl', type: 'number', default: 0, displayOptions: { show: { messageType: ['voice'], }, }, description: 'Thời gian tồn tại tin nhắn tính bằng mili giây (0 = không giới hạn)', }, { displayName: 'URL Tệp', name: 'uploadUrl', type: 'string', default: '', required: true, displayOptions: { show: { messageType: ['upload'], }, }, description: 'URL tệp cần tải lên server Zalo (không gửi tin nhắn, chỉ trả về metadata sau khi upload)', }, { displayName: 'Tin Nhắn', name: 'message', type: 'string', default: '', required: true, displayOptions: { show: { messageType: ['text'], }, }, description: 'Nội dung tin nhắn cần gửi. Hỗ trợ gắn thẻ trong nhóm: @[uid] (VD: @[123456]) hoặc @all (tag tất cả). Có thể kết hợp với Markdown nếu bật.', }, { displayName: 'Nguồn Video', name: 'videoSource', type: 'options', options: [ { name: 'URL', value: 'url', description: 'Video từ URL công khai', }, { name: 'Binary (File)', value: 'binary', description: 'Video từ binary data (file upload/download)', }, ], default: 'url', displayOptions: { show: { messageType: ['video'], }, }, description: 'Chọn nguồn video: URL công khai hoặc binary data từ node trước', }, { displayName: 'URL Video', name: 'videoUrl', type: 'string', default: '', required: true, displayOptions: { show: { messageType: ['video'], videoSource: ['url'], }, }, description: 'URL công khai của video (phải có thể truy cập trực tiếp). Hỗ trợ định dạng MP4.', placeholder: 'https://example.com/video.mp4', }, { displayName: 'Binary Property', name: 'videoBinaryProperty', type: 'string', default: 'data', required: true, displayOptions: { show: { messageType: ['video'], videoSource: ['binary'], }, }, description: 'Tên property chứa binary data của video (thường là "data")', }, { displayName: 'URL Thumbnail', name: 'thumbnailUrl', type: 'string', default: '', required: false, displayOptions: { show: { messageType: ['video'], videoSource: ['url'], }, }, description: 'URL ảnh thumbnail cho video. Để trống = tự động tạo từ video (cần ffmpeg trên server).', placeholder: 'https://example.com/thumbnail.jpg (để trống = tự động)', }, { displayName: 'Tự Động Lấy Metadata Video', name: 'autoVideoMetadata', type: 'boolean', default: true, displayOptions: { show: { messageType: ['video'], }, }, description: 'Tự động lấy thông tin video (thời lượng, kích thước) từ URL. Cần ffprobe trên server.', }, { displayName: 'Tin Nhắn Kèm Video', name: 'videoMessage', type: 'string', default: '', displayOptions: { show: { messageType: ['video'], }, }, description: 'Nội dung tin nhắn kèm theo video (tùy chọn)', }, { displayName: 'Thời Lượng Video (ms)', name: 'videoDuration', type: 'number', default: 0, displayOptions: { show: { messageType: ['video'], }, }, description: 'Thời lượng video tính bằng milliseconds. VD: video 5.5 giây = 5500ms. Để 0 nếu không biết.', placeholder: '5500', }, { displayName: 'Chiều Rộng Video', name: 'videoWidth', type: 'number', default: 1280, displayOptions: { show: { messageType: ['video'], }, }, description: 'Chiều rộng video (pixels). Mặc định 1280 (HD).', }, { displayName: 'Chiều Cao Video', name: 'videoHeight', type: 'number', default: 720, displayOptions: { show: { messageType: ['video'], }, }, description: 'Chiều cao video (pixels). Mặc định 720 (HD).', }, { displayName: 'Bật Markdown', name: 'enableMarkdown', type: 'boolean', default: false, displayOptions: { show: { messageType: ['text'], }, }, description: 'Bật để sử dụng cú pháp Markdown cho định dạng văn bản. VD: **đậm**, *nghiêng*, [red]chữ[/red].', }, { displayName: 'Mức Độ Khẩn', name: 'urgency', type: 'options', options: [ { name: 'Mặc ĐịNh', value: 0, }, { name: 'Quan Trọng', value: 1, }, { name: 'Khẩn Cấp', value: 2, }, ], default: 0, displayOptions: { show: { messageType: ['text'], }, }, description: 'Mức độ khẩn cấp của tin nhắn', }, { displayName: 'Thời Gian Tự Xóa (TTL)', name: 'ttl', type: 'number', default: 0, description: 'Thời gian tự động xóa tin nhắn (milliseconds). 0 = không tự xóa. VD: 60000 = xóa sau 1 phút', placeholder: '60000', }, { displayName: 'Trả Lời Tin Nhắn', name: 'quoteFields', type: 'fixedCollection', default: {}, displayOptions: { show: { messageType: ['text'], }, }, description: 'Trích dẫn/trả lời một tin nhắn cụ thể', options: [ { name: 'quote', displayName: 'Chi Tiết Trích Dẫn', values: [ { displayName: 'ID Tin Nhắn', name: 'msgId', type: 'string', default: '', required: true, description: 'ID tin nhắn muốn trích dẫn. Lấy từ $JSON.message.data.msgId của ZaloMessageTrigger hoặc $JSON.response.message.msgId từ ZaloSendMessage.', placeholder: '{{ $json.message.data.msgId }}', }, { displayName: 'ID Người Gửi', name: 'uidFrom', type: 'string', default: '', required: true, description: 'ID người gửi tin nhắn gốc. Lấy từ $JSON.message.data.uidFrom.', placeholder: '{{ $json.message.data.uidFrom }}', }, { displayName: 'Nội Dung', name: 'content', type: 'string', default: '', required: true, description: 'Nội dung tin nhắn gốc. Lấy từ $JSON.message.data.content.', placeholder: '{{ $json.message.data.content }}', }, { displayName: 'ID Tin Nhắn Client', name: 'cliMsgId', type: 'string', default: '', required: true, description: 'ID tin nhắn từ phía client. Lấy từ $JSON.message.data.cliMsgId.', placeholder: '{{ $json.message.data.cliMsgId }}', }, { displayName: 'Dấu Thời Gian', name: 'ts', type: 'string', default: '', required: true, description: 'Dấu thời gian của tin nhắn gốc. Lấy từ $JSON.message.data.ts.', placeholder: '{{ $json.message.data.ts }}', }, { displayName: 'Loại Tin Nhắn', name: 'msgType', type: 'string', default: 'webchat', description: 'Loại tin nhắn. Mặc định là "webchat".', }, { displayName: 'Thời Gian Tự Xóa', name: 'ttl', type: 'number', default: 0, description: 'Thời gian sống của tin nhắn. Mặc định là 0.', }, ], }, ], }, { displayName: 'File ĐÍnh Kèm', name: 'attachments', type: 'fixedCollection', typeOptions: { multipleValues: true, }, placeholder: 'Thêm File Đính Kèm', default: {}, displayOptions: { show: { messageType: ['text'], }, }, options: [ { name: 'attachment', displayName: 'File ĐÍnh Kèm', values: [ { displayName: 'Loại', name: 'type', type: 'options', options: [ { name: 'URL Ảnh/File', value: 'url', }, { name: 'Mảng URL', value: 'urlArray', }, { name: 'ĐườNg Dẫn Local', value: 'localPath', }, { name: 'Mảng ĐườNg Dẫn Local', value: 'localPaths', }, ], default: 'url', description: 'Loại file đính kèm', }, { displayName: 'URL Ảnh/File', name: 'imageUrl', type: 'string', default: '', displayOptions: { show: { type: ['url'], }, }, description: 'URL công khai của ảnh hoặc file', }, { displayName: 'Mảng URL ẢNh', name: 'imageUrls', type: 'string', default: '', displayOptions: { show: { type: ['urlArray'], }, }, description: 'Mảng các URL (định dạng JSON) hoặc các URL phân cách bằng dấu phẩy. VD: ["url1","url2"] hoặc url1,url2.', }, { displayName: 'ĐườNg Dẫn File', name: 'filePath', type: 'string', default: '', displayOptions: { show: { type: ['localPath'], }, }, description: 'Đường dẫn đến file trên server n8n. Hỗ trợ: 1) Đường dẫn tuyệt đối (VD: /home/node/image.jpg), 2) Đường dẫn tương đối từ thư mục n8n (VD: temp_files/image.jpg sẽ tìm trong ~/.n8n/temp_files/), 3) Tên file từ node "Read/Write Files from Disk" (VD: {{ $JSON.fileName }}). Lưu ý: Chỉ dùng cho file đã có sẵn trên server, không download từ URL.', placeholder: '/home/node/image.jpg hoặc temp_files/image.jpg', }, { displayName: 'Mảng ĐườNg Dẫn File', name: 'filePaths', type: 'string', default: '', displayOptions: { show: { type: ['localPaths'], }, }, description: 'Nhiều đường dẫn file trên server, phân cách bằng dấu phẩy hoặc định dạng JSON array. VD: /home/node/img1.jpg,/home/node/img2.jpg hoặc ["/home/node/img1.jpg","/home/node/img2.jpg"]. Hỗ trợ cả đường dẫn tuyệt đối và tương đối từ thư mục n8n (~/.n8n/).', placeholder: '/home/node/img1.jpg,/home/node/img2.jpg', }, ], }, ], description: 'Một hoặc nhiều file đính kèm để gửi (ảnh, PDF, audio, docs, zip...). File .jpg/.jpeg/.png/.webp được Zalo xử lý qua kênh ảnh; các định dạng khác gửi qua kênh file thông thường, trừ một số đuôi nguy hiểm (.exe, .bat...) bị Zalo chặn.', }, ]; //# sourceMappingURL=ZaloSendMessage.properties.js.map