chore: remove ekata feature

This commit is contained in:
Rafael Taranto 2025-05-12 09:24:35 +01:00
parent 8b3f93d8f0
commit c593b60a4e
12 changed files with 8 additions and 184 deletions

View file

@ -37,33 +37,7 @@ function sendMessage (account, rec) {
})
}
function getLookup (account, number) {
return Promise.resolve()
.then(() => {
const client = twilio(account.accountSid, account.authToken)
return client.lookups.v1.phoneNumbers(number)
.fetch({ addOns: ['lamassu_ekata'] })
})
.then(info => info.addOns.results['lamassu_ekata'])
.then(info => {
if (info.status !== 'successful') {
throw new Error(`Twilio error: ${info.message}`)
}
return info
})
.catch(err => {
if (_.includes(err.code, BAD_NUMBER_CODES)) {
const badNumberError = new Error(err.message)
badNumberError.name = 'BadNumberError'
throw badNumberError
}
throw new Error(`Twilio error: ${err.message}`)
})
}
module.exports = {
NAME,
sendMessage,
getLookup
sendMessage
}