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.
168 lines • 6.21 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.zaloChatHistoryProperties = void 0;
exports.zaloChatHistoryProperties = [
{
displayName: 'Loại Hội Thoại',
name: 'operation',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Lịch Sử Chat Cá Nhân',
value: 'getUserHistory',
description: 'Lấy lịch sử tin nhắn từ cuộc trò chuyện cá nhân',
action: 'Lấy lịch sử chat cá nhân',
},
{
name: 'Lịch Sử Chat Nhóm',
value: 'getGroupHistory',
description: 'Lấy lịch sử tin nhắn từ nhóm',
action: 'Lấy lịch sử chat nhóm',
},
],
default: 'getUserHistory',
description: 'Chọn loại hội thoại để đồng bộ. Lưu ý: Zalo trả backlog chung cho tất cả hội thoại cùng loại, không truy vấn được riêng từng hội thoại — node lọc giúp ở bước sau.',
},
{
displayName: 'Lọc Theo ID Hội Thoại',
name: 'filterByThreadId',
type: 'boolean',
default: true,
description: 'Whether to chỉ giữ tin nhắn của một hội thoại cụ thể. Tắt để lấy toàn bộ backlog của mọi hội thoại (mỗi tin đều kèm threadId) — dùng khi nạp dữ liệu vào database.',
},
{
displayName: 'ID Người Dùng',
name: 'threadId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
operation: ['getUserHistory'],
filterByThreadId: [true],
},
},
description: 'ID của người dùng cần lấy tin nhắn (tin của người khác sẽ bị loại bỏ)',
placeholder: 'Ví dụ: 1234567890123456789',
},
{
displayName: 'ID Nhóm',
name: 'threadId',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
operation: ['getGroupHistory'],
filterByThreadId: [true],
},
},
description: 'ID của nhóm cần lấy tin nhắn (tin của nhóm khác sẽ bị loại bỏ)',
placeholder: 'Ví dụ: 9876543210987654321',
},
{
displayName: 'Chế Độ Lấy Dữ Liệu',
name: 'fetchAll',
type: 'boolean',
default: false,
description: 'Whether to fetch all messages (duyệt hết backlog rồi mới lọc). Chậm và dễ bị Zalo chặn — chỉ nên dùng cho lần đồng bộ đầu tiên.',
},
{
displayName: 'Số Lượng Tin Nhắn',
name: 'limit',
type: 'number',
default: 50,
displayOptions: {
show: {
fetchAll: [false],
},
},
description: 'Max number of results to return',
hint: 'Là số tin GIỮ LẠI sau khi lọc, không phải số tin Zalo trả về. Nếu hội thoại cần tìm không có tin trong batch này thì kết quả sẽ rỗng — dùng "ID Tin Nhắn Cuối" để kéo tiếp.',
typeOptions: {
minValue: 1,
},
},
{
displayName: 'Giới Hạn Số Trang',
name: 'maxPages',
type: 'number',
default: 50,
displayOptions: {
show: {
fetchAll: [true],
},
},
description: 'Trần số lượt gọi Zalo trong một lần chạy, tránh chạy vô tận. Chạm trần thì kết quả trả về "hasMore": true kèm "lastMsgId" — truyền lại để kéo tiếp ở lần chạy sau.',
typeOptions: {
minValue: 1,
maxValue: 500,
},
},
{
displayName: 'Thời Gian Chờ Giữa Các Lần Lấy (Ms)',
name: 'delayBetweenRequests',
type: 'number',
default: 1000,
displayOptions: {
show: {
fetchAll: [true],
},
},
description: 'Thời gian chờ giữa các lần lấy tin nhắn (để tránh bị block). Khuyến nghị: 1000-3000ms.',
typeOptions: {
minValue: 500,
maxValue: 10000,
},
},
{
displayName: 'ID Tin Nhắn Cuối',
name: 'lastMsgId',
type: 'string',
default: '',
description: 'Con trỏ phân trang — truyền lại giá trị "lastMsgId" của lần chạy trước để kéo tiếp phần backlog cũ hơn. Để trống để bắt đầu từ tin mới nhất.',
placeholder: 'Ví dụ: 123456789',
},
{
displayName: 'Bao Gồm Cảm Xúc',
name: 'includeReactions',
type: 'boolean',
default: false,
description: 'Whether to fetch reactions for messages (có thể làm chậm quá trình)',
},
{
displayName: 'Sắp Xếp',
name: 'sortOrder',
type: 'options',
options: [
{
name: 'Mới Nhất Trước (Z-A)',
value: 'desc',
description: 'Tin nhắn mới nhất ở đầu',
},
{
name: 'Cũ Nhất Trước (A-Z)',
value: 'asc',
description: 'Tin nhắn cũ nhất ở đầu',
},
],
default: 'desc',
description: 'Thứ tự sắp xếp tin nhắn theo thời gian',
},
{
displayName: 'Từ Ngày (Tùy Chọn)',
name: 'fromDate',
type: 'dateTime',
default: '',
description: 'Lấy tin nhắn từ thời điểm này (để trống = không giới hạn)',
},
{
displayName: 'ĐếN Ngày (Tùy Chọn)',
name: 'toDate',
type: 'dateTime',
default: '',
description: 'Lấy tin nhắn đến thời điểm này (để trống = không giới hạn)',
},
];
//# sourceMappingURL=ZaloChatHistory.properties.js.map