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.

112 lines 3.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createReminder = createReminder; exports.editReminder = editReminder; exports.getListReminder = getListReminder; exports.getReminder = getReminder; exports.removeReminder = removeReminder; exports.getReminderResponses = getReminderResponses; const zca_js_1 = require("zca-js"); function mapThreadType(threadType) { return threadType === 'user' ? zca_js_1.ThreadType.User : zca_js_1.ThreadType.Group; } async function createReminder(api, input) { const threadType = mapThreadType(input.threadType); const options = { title: input.title, emoji: input.emoji || '⏰', startTime: input.startTime || Date.now(), repeat: input.repeat !== undefined ? input.repeat : 0, }; const result = await api.createReminder(options, input.threadId, threadType); return { success: true, operation: 'create', data: result, metadata: { threadId: input.threadId, threadType: input.threadType, timestamp: Date.now(), }, }; } async function editReminder(api, input) { const threadType = mapThreadType(input.threadType); const options = { title: input.title, topicId: input.reminderId, emoji: input.emoji || '⏰', startTime: input.startTime || Date.now(), repeat: input.repeat !== undefined ? input.repeat : 0, }; const result = await api.editReminder(options, input.threadId, threadType); return { success: true, operation: 'edit', data: result, metadata: { threadId: input.threadId, threadType: input.threadType, reminderId: input.reminderId, timestamp: Date.now(), }, }; } async function getListReminder(api, input) { const threadType = mapThreadType(input.threadType); const options = { page: input.page || 1, count: input.count || 20, }; const result = await api.getListReminder(options, input.threadId, threadType); return { success: true, operation: 'getList', data: result, metadata: { threadId: input.threadId, threadType: input.threadType, timestamp: Date.now(), }, }; } async function getReminder(api, input) { const result = await api.getReminder(input.reminderId); return { success: true, operation: 'get', data: result, metadata: { reminderId: input.reminderId, timestamp: Date.now(), }, }; } async function removeReminder(api, input) { const threadType = mapThreadType(input.threadType); const result = await api.removeReminder(input.reminderId, input.threadId, threadType); return { success: true, operation: 'remove', data: result, metadata: { threadId: input.threadId, threadType: input.threadType, reminderId: input.reminderId, timestamp: Date.now(), }, }; } async function getReminderResponses(api, input) { const result = await api.getReminderResponses(input.reminderId); return { success: true, operation: 'getResponses', data: result, metadata: { reminderId: input.reminderId, timestamp: Date.now(), }, }; } //# sourceMappingURL=reminderProcessor.js.map