UNPKG

wundertec-core

Version:

Librería estándar de utilidades e integraciones AWS + helpers generales

31 lines (30 loc) 897 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sendSMS = sendSMS; exports.publishTopic = publishTopic; const client_sns_1 = require("@aws-sdk/client-sns"); const snsClient = new client_sns_1.SNSClient({ region: process.env.AWS_REGION }); /** * Envía un SMS a un número de teléfono. */ async function sendSMS(phoneNumber, message, options) { const params = { PhoneNumber: phoneNumber, Message: message, ...options, }; const command = new client_sns_1.PublishCommand(params); return snsClient.send(command); } /** * Publica un mensaje en un topic SNS. */ async function publishTopic(topicArn, message, options) { const params = { TopicArn: topicArn, Message: message, ...options, }; const command = new client_sns_1.PublishCommand(params); return snsClient.send(command); }