UNPKG

n8n-nodes-nqdev

Version:

Tích hợp dịch vụ eSMS.vn vào n8n, cho phép bạn dễ dàng gửi tin nhắn SMS, Zalo hoặc Viber trực tiếp từ quy trình tự động hóa. Với node này, bạn có thể nhanh chóng kết nối API eSMS.vn, gửi tin nhắn quảng cáo, chăm sóc khách hàng hoặc OTP chỉ trong vài bước

28 lines 2.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getLoadZnsTemplateParameters = getLoadZnsTemplateParameters; const esmsvn_1 = require("../../nqdev-libraries/esmsvn"); async function getLoadZnsTemplateParameters(filter, paginationToken) { var _a, _b, _c, _d, _e, _f, _g; const page = paginationToken ? +paginationToken : 1; const pageSize = 100; const esmsCredentials = await esmsvn_1.getEsmsCredentials.call(this), esmsSmsType = this.getNodeParameter('esmsSmsType', 8), esmsZaloOA = (_b = (_a = this.getNodeParameter('esmsZaloOA', {})) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '', esmsTemplateId = (_d = (_c = this.getNodeParameter('esmsTemplateId', {})) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : ''; const responseData = await esmsvn_1.getEsmsZnsTemplateInfo.call(this, { ...esmsCredentials, templateId: esmsTemplateId !== null && esmsTemplateId !== void 0 ? esmsTemplateId : '', zaloOaId: esmsZaloOA !== null && esmsZaloOA !== void 0 ? esmsZaloOA : '', smsType: esmsSmsType !== null && esmsSmsType !== void 0 ? esmsSmsType : '2', page, pageSize, }); const filteredData = (_f = (_e = responseData.Data) === null || _e === void 0 ? void 0 : _e.ListParams) !== null && _f !== void 0 ? _f : []; const results = (_g = filteredData === null || filteredData === void 0 ? void 0 : filteredData.map((item) => { var _a, _b; return ({ name: `${item.Name}`, value: (_a = item.Name) !== null && _a !== void 0 ? _a : '', description: `${((_b = item.Name) !== null && _b !== void 0 ? _b : '')} (bắt buộc: ${(item.Require ? 'có' : 'không')}), kiểu ${item.Type}, độ dài từ ${item.MinLength} đến ${item.MaxLength} ký tự, ${(item.AcceptNull ? 'chấp nhận' : 'không chấp nhận')} giá trị null.`, }); })) !== null && _g !== void 0 ? _g : []; return results; } //# sourceMappingURL=EsmsLoadFunctions.js.map