UNPKG

meta-cloud-api

Version:
2 lines 733 B
import {a}from'./chunk-RIL6QABY.js';var t=class extends a{endpoint="media";constructor(e,s){super(e,s);}async getMediaById(e,s){return this.sendJson("GET",`${e}`,this.config.REQUEST_TIMEOUT,null)}async uploadMedia(e,s="whatsapp"){let o=new FormData;return o.append("file",e),o.append("messaging_product",s),o.append("type",e.type),this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,o)}async deleteMedia(e,s){return this.sendJson("DELETE",`${e}`,this.config.REQUEST_TIMEOUT,null)}async downloadMedia(e){return this.sendJson("GET",e,this.config.REQUEST_TIMEOUT,null)}};var d=t;export{t as a,d as b};//# sourceMappingURL=chunk-JXCLRKQ7.js.map //# sourceMappingURL=chunk-JXCLRKQ7.js.map