Comparing version 1.0.8 to 1.0.9
@@ -1,2 +0,2 @@ | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n,t,r,o,s=/*#__PURE__*/e(require("axios")).default.create({baseURL:"https://api.zapfy.me/v1",headers:{Accept:"*/*",Connection:"keep-alive"}});function i(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}exports.ZapfySdk=void 0,(t=(n=exports.ZapfySdk||(exports.ZapfySdk={})).Instance||(n.Instance={})).connect=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/connect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.disconnect=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/disconnect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.getState=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.get("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getState")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.updateWebhook=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateWebhook",{webhookUrl:e.webhookUrl})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(r=n.Profile||(n.Profile={})).verifyIfNumberIsInWhatsApp=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/onWhatsApp",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.getProfileStatus=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfileStatus",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.updateProfileStatus=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileStatus",{status:e.status})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.updateProfileName=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileName",{name:e.name})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.getProfilePictureUrl=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfilePictureUrl",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.blockUser=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/blockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.unblockUser=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/unblockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.getBusinessProfile=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getBusinessProfile",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(o=n.Message||(n.Message={})).sendTextMessage=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=text",{text:e.text,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.sendButtonsMessage=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=buttons",{text:e.text,footer:e.footer,buttons:e.buttons,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.sendListMessage=function(e){try{return Promise.resolve(i(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(s.post("/instance/"+n+"/token/"+t+"/message?type=list",{text:e.text,buttonText:e.buttonText,title:e.title,destination:e.destination,sections:e.sections,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.sendLocationMessage=function(e){try{return Promise.resolve(i(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(s.post("/instance/"+n+"/token/"+t+"/message?type=location",{lat:e.lat,long:e.long,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.sendMediaMessage=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type="+e.type,{base64:e.base64,fileName:e.fileName,text:e.text})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},exports.ZapfyTypes=void 0,exports.ZapfyTypes||(exports.ZapfyTypes={}); | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n,t,r,o,s=/*#__PURE__*/e(require("axios")).default.create({baseURL:"https://api.zapfy.me/v1",headers:{Accept:"*/*",Connection:"keep-alive","User-Agent":"request","Content-Type":"application/json"}});function i(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}exports.ZapfySdk=void 0,(t=(n=exports.ZapfySdk||(exports.ZapfySdk={})).Instance||(n.Instance={})).connect=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/connect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.disconnect=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/disconnect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.getState=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.get("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getState")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.updateWebhook=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateWebhook",{webhookUrl:e.webhookUrl})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(r=n.Profile||(n.Profile={})).verifyIfNumberIsInWhatsApp=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/onWhatsApp",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.getProfileStatus=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfileStatus",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.updateProfileStatus=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileStatus",{status:e.status})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.updateProfileName=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileName",{name:e.name})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.getProfilePictureUrl=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfilePictureUrl",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.blockUser=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/blockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.unblockUser=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/unblockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},r.getBusinessProfile=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getBusinessProfile",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(o=n.Message||(n.Message={})).sendTextMessage=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=text",{text:e.text,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.sendButtonsMessage=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=buttons",{text:e.text,footer:e.footer,buttons:e.buttons,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.sendListMessage=function(e){try{return Promise.resolve(i(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(s.post("/instance/"+n+"/token/"+t+"/message?type=list",{text:e.text,buttonText:e.buttonText,title:e.title,destination:e.destination,sections:e.sections,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.sendLocationMessage=function(e){try{return Promise.resolve(i(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(s.post("/instance/"+n+"/token/"+t+"/message?type=location",{lat:e.lat,long:e.long,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.sendMediaMessage=function(e){try{return Promise.resolve(i(function(){return Promise.resolve(s.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type="+e.type,{base64:e.base64,fileName:e.fileName,text:e.text})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},exports.ZapfyTypes=void 0,exports.ZapfyTypes||(exports.ZapfyTypes={}); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import e from"axios";var n,t,r=e.create({baseURL:"https://api.zapfy.me/v1",headers:{Accept:"*/*",Connection:"keep-alive"}});function o(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}!function(e){var n,t,s;(n=e.Instance||(e.Instance={})).connect=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/connect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},n.disconnect=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/disconnect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},n.getState=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.get("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getState")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},n.updateWebhook=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateWebhook",{webhookUrl:e.webhookUrl})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(t=e.Profile||(e.Profile={})).verifyIfNumberIsInWhatsApp=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/onWhatsApp",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.getProfileStatus=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfileStatus",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.updateProfileStatus=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileStatus",{status:e.status})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.updateProfileName=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileName",{name:e.name})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.getProfilePictureUrl=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfilePictureUrl",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.blockUser=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/blockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.unblockUser=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/unblockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.getBusinessProfile=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getBusinessProfile",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(s=e.Message||(e.Message={})).sendTextMessage=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=text",{text:e.text,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.sendButtonsMessage=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=buttons",{text:e.text,footer:e.footer,buttons:e.buttons,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.sendListMessage=function(e){try{return Promise.resolve(o(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(r.post("/instance/"+n+"/token/"+t+"/message?type=list",{text:e.text,buttonText:e.buttonText,title:e.title,destination:e.destination,sections:e.sections,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.sendLocationMessage=function(e){try{return Promise.resolve(o(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(r.post("/instance/"+n+"/token/"+t+"/message?type=location",{lat:e.lat,long:e.long,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.sendMediaMessage=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type="+e.type,{base64:e.base64,fileName:e.fileName,text:e.text})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}}}(n||(n={})),t||(t={});export{n as ZapfySdk,t as ZapfyTypes}; | ||
import e from"axios";var n,t,r=e.create({baseURL:"https://api.zapfy.me/v1",headers:{Accept:"*/*",Connection:"keep-alive","User-Agent":"request","Content-Type":"application/json"}});function o(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}!function(e){var n,t,s;(n=e.Instance||(e.Instance={})).connect=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/connect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},n.disconnect=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/disconnect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},n.getState=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.get("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getState")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},n.updateWebhook=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateWebhook",{webhookUrl:e.webhookUrl})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(t=e.Profile||(e.Profile={})).verifyIfNumberIsInWhatsApp=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/onWhatsApp",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.getProfileStatus=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfileStatus",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.updateProfileStatus=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileStatus",{status:e.status})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.updateProfileName=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileName",{name:e.name})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.getProfilePictureUrl=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfilePictureUrl",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.blockUser=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/blockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.unblockUser=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/unblockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},t.getBusinessProfile=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getBusinessProfile",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(s=e.Message||(e.Message={})).sendTextMessage=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=text",{text:e.text,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.sendButtonsMessage=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=buttons",{text:e.text,footer:e.footer,buttons:e.buttons,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.sendListMessage=function(e){try{return Promise.resolve(o(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(r.post("/instance/"+n+"/token/"+t+"/message?type=list",{text:e.text,buttonText:e.buttonText,title:e.title,destination:e.destination,sections:e.sections,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.sendLocationMessage=function(e){try{return Promise.resolve(o(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(r.post("/instance/"+n+"/token/"+t+"/message?type=location",{lat:e.lat,long:e.long,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.sendMediaMessage=function(e){try{return Promise.resolve(o(function(){return Promise.resolve(r.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type="+e.type,{base64:e.base64,fileName:e.fileName,text:e.text})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}}}(n||(n={})),t||(t={});export{n as ZapfySdk,t as ZapfyTypes}; | ||
//# sourceMappingURL=index.modern.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("axios")):"function"==typeof define&&define.amd?define(["exports","axios"],n):n((e||self).zapfySdk={},e.axios)}(this,function(e,n){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r,o,s,i,c=/*#__PURE__*/t(n).default.create({baseURL:"https://api.zapfy.me/v1",headers:{Accept:"*/*",Connection:"keep-alive"}});function u(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}e.ZapfySdk=void 0,(o=(r=e.ZapfySdk||(e.ZapfySdk={})).Instance||(r.Instance={})).connect=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/connect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.disconnect=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/disconnect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.getState=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.get("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getState")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.updateWebhook=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateWebhook",{webhookUrl:e.webhookUrl})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(s=r.Profile||(r.Profile={})).verifyIfNumberIsInWhatsApp=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/onWhatsApp",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.getProfileStatus=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfileStatus",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.updateProfileStatus=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileStatus",{status:e.status})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.updateProfileName=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileName",{name:e.name})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.getProfilePictureUrl=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfilePictureUrl",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.blockUser=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/blockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.unblockUser=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/unblockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.getBusinessProfile=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getBusinessProfile",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(i=r.Message||(r.Message={})).sendTextMessage=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=text",{text:e.text,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},i.sendButtonsMessage=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=buttons",{text:e.text,footer:e.footer,buttons:e.buttons,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},i.sendListMessage=function(e){try{return Promise.resolve(u(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(c.post("/instance/"+n+"/token/"+t+"/message?type=list",{text:e.text,buttonText:e.buttonText,title:e.title,destination:e.destination,sections:e.sections,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},i.sendLocationMessage=function(e){try{return Promise.resolve(u(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(c.post("/instance/"+n+"/token/"+t+"/message?type=location",{lat:e.lat,long:e.long,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},i.sendMediaMessage=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type="+e.type,{base64:e.base64,fileName:e.fileName,text:e.text})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},e.ZapfyTypes=void 0,e.ZapfyTypes||(e.ZapfyTypes={})}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("axios")):"function"==typeof define&&define.amd?define(["exports","axios"],n):n((e||self).zapfySdk={},e.axios)}(this,function(e,n){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r,o,s,i,c=/*#__PURE__*/t(n).default.create({baseURL:"https://api.zapfy.me/v1",headers:{Accept:"*/*",Connection:"keep-alive","User-Agent":"request","Content-Type":"application/json"}});function u(e,n){try{var t=e()}catch(e){return n(e)}return t&&t.then?t.then(void 0,n):t}e.ZapfySdk=void 0,(o=(r=e.ZapfySdk||(e.ZapfySdk={})).Instance||(r.Instance={})).connect=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/connect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.disconnect=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/disconnect")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.getState=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.get("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getState")).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},o.updateWebhook=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateWebhook",{webhookUrl:e.webhookUrl})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(s=r.Profile||(r.Profile={})).verifyIfNumberIsInWhatsApp=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/onWhatsApp",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.getProfileStatus=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfileStatus",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.updateProfileStatus=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileStatus",{status:e.status})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.updateProfileName=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/updateProfileName",{name:e.name})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.getProfilePictureUrl=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getProfilePictureUrl",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.blockUser=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/blockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.unblockUser=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/unblockUser",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},s.getBusinessProfile=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/getBusinessProfile",{phoneNumber:e.phoneNumber})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},(i=r.Message||(r.Message={})).sendTextMessage=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=text",{text:e.text,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},i.sendButtonsMessage=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type=buttons",{text:e.text,footer:e.footer,buttons:e.buttons,destination:e.destination})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},i.sendListMessage=function(e){try{return Promise.resolve(u(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(c.post("/instance/"+n+"/token/"+t+"/message?type=list",{text:e.text,buttonText:e.buttonText,title:e.title,destination:e.destination,sections:e.sections,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},i.sendLocationMessage=function(e){try{return Promise.resolve(u(function(){var n=e.instanceKey,t=e.instanceToken;return Promise.resolve(c.post("/instance/"+n+"/token/"+t+"/message?type=location",{lat:e.lat,long:e.long,instanceKey:n,instanceToken:t})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},i.sendMediaMessage=function(e){try{return Promise.resolve(u(function(){return Promise.resolve(c.post("/instance/"+e.instanceKey+"/token/"+e.instanceToken+"/message?type="+e.type,{base64:e.base64,fileName:e.fileName,text:e.text})).then(function(e){return e.data})},function(e){throw new Error(e)}))}catch(e){return Promise.reject(e)}},e.ZapfyTypes=void 0,e.ZapfyTypes||(e.ZapfyTypes={})}); | ||
//# sourceMappingURL=index.umd.js.map |
@@ -5,3 +5,3 @@ { | ||
"description": "A package to request all routes on ZapFy", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "main": "dist/index.js", |
@@ -8,3 +8,5 @@ import axios from 'axios'; | ||
'Connection': 'keep-alive', | ||
'User-Agent': 'request', | ||
'Content-Type': 'application/json', | ||
} | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
144242
660