import { ChannelTypeEnum , ISendMessageSuccessResponse , ISmsOptions , ISmsProvider , } from '@notifire/core' ; import * as plivo from 'plivo' ; export class PlivoSmsProvider implements ISmsProvider { id = 'plivo' ; channelType = ChannelTypeEnum . SMS as ChannelTypeEnum . SMS ; private plivoClient : plivo . Client ; constructor ( private config ) { this . plivoClient = new plivo . Client ( config . accountSid , config . authToken ) ; } async sendMessage ( options ) { const plivoResponse = await this . plivoClient . messages . create ( this . config . from , options . to , options . content ) ; return { id : plivoResponse . apiId , date : new Date ( ) . toISOString ( ) , } ; } }