@zenvia/sdk
Version:
This SDK for [Node.js](https://nodejs.org/) was created based on the [Zenvia](https://www.zenvia.com/) [API](https://zenvia.github.io/zenvia-openapi-spec/).
26 lines • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WhatsAppChannel = void 0;
const abstract_channel_1 = require("./abstract-channel");
/**
* Implementation of WhatsApp channel.
*/
class WhatsAppChannel extends abstract_channel_1.AbstractChannel {
/**
* Returns a new `WhatsAppChannel` that is used to set the WhatsApp channel.
*
* @param token Zenvia platform token.
* @param loggerInstance If you want, you can pass your log instance.
*/
constructor(token, loggerInstance, options) {
super(token, 'whatsapp', loggerInstance, options);
this.supportedContents = ['text', 'file', 'template', 'contacts', 'location'];
}
contentSupportValidation(content) {
if (!this.supportedContents.includes(content.type)) {
throw new Error(`Content of type ${content.type} is not supported in WhatsApp channel`);
}
}
}
exports.WhatsAppChannel = WhatsAppChannel;
//# sourceMappingURL=whatsapp.js.map