meta-cloud-api 0.1.22 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +210 -140
  3. package/dist/api/base.d.mts +1 -1
  4. package/dist/api/base.d.ts +1 -1
  5. package/dist/api/businessProfile.d.mts +1 -1
  6. package/dist/api/businessProfile.d.ts +1 -1
  7. package/dist/api/businessProfile.js +1 -1
  8. package/dist/api/encryption.d.mts +1 -1
  9. package/dist/api/encryption.d.ts +1 -1
  10. package/dist/api/encryption.js +1 -1
  11. package/dist/api/encryption.mjs +1 -1
  12. package/dist/api/flow.d.mts +2 -1
  13. package/dist/api/flow.d.ts +2 -1
  14. package/dist/api/flow.js +1 -1
  15. package/dist/api/flow.mjs +1 -1
  16. package/dist/api/index.d.mts +2 -1
  17. package/dist/api/index.d.ts +2 -1
  18. package/dist/api/media.d.mts +1 -1
  19. package/dist/api/media.d.ts +1 -1
  20. package/dist/api/media.js +1 -1
  21. package/dist/api/media.mjs +1 -1
  22. package/dist/api/messages.d.mts +1 -1
  23. package/dist/api/messages.d.ts +1 -1
  24. package/dist/api/messages.js +1 -1
  25. package/dist/api/messages.mjs +1 -1
  26. package/dist/api/phoneNumber.d.mts +1 -1
  27. package/dist/api/phoneNumber.d.ts +1 -1
  28. package/dist/api/phoneNumber.js +1 -1
  29. package/dist/api/phoneNumber.mjs +1 -1
  30. package/dist/api/qrCode.d.mts +1 -1
  31. package/dist/api/qrCode.d.ts +1 -1
  32. package/dist/api/qrCode.js +1 -1
  33. package/dist/api/qrCode.mjs +1 -1
  34. package/dist/api/registration.d.mts +1 -1
  35. package/dist/api/registration.d.ts +1 -1
  36. package/dist/api/registration.js +1 -1
  37. package/dist/api/registration.mjs +1 -1
  38. package/dist/api/template.d.mts +1 -1
  39. package/dist/api/template.d.ts +1 -1
  40. package/dist/api/template.js +1 -1
  41. package/dist/api/template.mjs +1 -1
  42. package/dist/api/twoStepVerification.d.mts +1 -1
  43. package/dist/api/twoStepVerification.d.ts +1 -1
  44. package/dist/api/twoStepVerification.js +1 -1
  45. package/dist/api/twoStepVerification.mjs +1 -1
  46. package/dist/api/waba.d.mts +1 -1
  47. package/dist/api/waba.d.ts +1 -1
  48. package/dist/api/waba.js +1 -1
  49. package/dist/api/waba.mjs +1 -1
  50. package/dist/{enums-BYfW0iLO.d.mts → enums-CI7vzKhn.d.mts} +3 -2
  51. package/dist/{enums-BYfW0iLO.d.ts → enums-CI7vzKhn.d.ts} +3 -2
  52. package/dist/httpsClient.d.mts +1 -1
  53. package/dist/httpsClient.d.ts +1 -1
  54. package/dist/index.d.mts +3 -2
  55. package/dist/index.d.ts +3 -2
  56. package/dist/index.js +1 -1
  57. package/dist/index.js.map +1 -1
  58. package/dist/index.mjs +1 -1
  59. package/dist/index.mjs.map +1 -1
  60. package/dist/request.d.mts +2 -2
  61. package/dist/request.d.ts +2 -2
  62. package/dist/request.js +1 -1
  63. package/dist/request.js.map +1 -1
  64. package/dist/request.mjs +1 -1
  65. package/dist/request.mjs.map +1 -1
  66. package/dist/types/base.d.mts +1 -1
  67. package/dist/types/base.d.ts +1 -1
  68. package/dist/types/businessProfile.d.mts +1 -1
  69. package/dist/types/businessProfile.d.ts +1 -1
  70. package/dist/types/config.d.mts +9 -6
  71. package/dist/types/config.d.ts +9 -6
  72. package/dist/types/config.js +1 -1
  73. package/dist/types/config.js.map +1 -1
  74. package/dist/types/encryption.d.mts +1 -1
  75. package/dist/types/encryption.d.ts +1 -1
  76. package/dist/types/enums.d.mts +1 -1
  77. package/dist/types/enums.d.ts +1 -1
  78. package/dist/types/enums.js +1 -1
  79. package/dist/types/enums.js.map +1 -1
  80. package/dist/types/enums.mjs +1 -1
  81. package/dist/types/enums.mjs.map +1 -1
  82. package/dist/types/flow.d.mts +114 -10
  83. package/dist/types/flow.d.ts +114 -10
  84. package/dist/types/flow.js +1 -1
  85. package/dist/types/flow.js.map +1 -1
  86. package/dist/types/flow.mjs +1 -1
  87. package/dist/types/flow.mjs.map +1 -1
  88. package/dist/types/httpsClient.d.mts +1 -1
  89. package/dist/types/httpsClient.d.ts +1 -1
  90. package/dist/types/index.d.mts +3 -2
  91. package/dist/types/index.d.ts +3 -2
  92. package/dist/types/index.js +1 -1
  93. package/dist/types/index.js.map +1 -1
  94. package/dist/types/index.mjs +1 -1
  95. package/dist/types/index.mjs.map +1 -1
  96. package/dist/types/media.d.mts +1 -1
  97. package/dist/types/media.d.ts +1 -1
  98. package/dist/types/messages.d.mts +1 -1
  99. package/dist/types/messages.d.ts +1 -1
  100. package/dist/types/phoneNumber.d.mts +1 -1
  101. package/dist/types/phoneNumber.d.ts +1 -1
  102. package/dist/types/qrCode.d.mts +1 -1
  103. package/dist/types/qrCode.d.ts +1 -1
  104. package/dist/types/registration.d.mts +1 -1
  105. package/dist/types/registration.d.ts +1 -1
  106. package/dist/types/request.d.mts +2 -2
  107. package/dist/types/request.d.ts +2 -2
  108. package/dist/types/request.js.map +1 -1
  109. package/dist/types/template.d.mts +1 -1
  110. package/dist/types/template.d.ts +1 -1
  111. package/dist/types/twoStepVerification.d.mts +1 -1
  112. package/dist/types/twoStepVerification.d.ts +1 -1
  113. package/dist/types/waba.d.mts +1 -1
  114. package/dist/types/waba.d.ts +1 -1
  115. package/dist/types/webhook.d.mts +1 -1
  116. package/dist/types/webhook.d.ts +1 -1
  117. package/dist/types/whatsapp.d.mts +4 -2
  118. package/dist/types/whatsapp.d.ts +4 -2
  119. package/dist/types/whatsapp.js +1 -1
  120. package/dist/types/whatsapp.js.map +1 -1
  121. package/dist/utils/filters.d.mts +1 -1
  122. package/dist/utils/filters.d.ts +1 -1
  123. package/dist/utils/filters.js +1 -1
  124. package/dist/utils/filters.mjs +1 -1
  125. package/dist/utils/importConfig.d.mts +2 -1
  126. package/dist/utils/importConfig.d.ts +2 -1
  127. package/dist/utils/importConfig.js +1 -1
  128. package/dist/utils/importConfig.js.map +1 -1
  129. package/dist/utils/importConfig.mjs +1 -1
  130. package/dist/utils/importConfig.mjs.map +1 -1
  131. package/dist/utils/index.d.mts +2 -1
  132. package/dist/utils/index.d.ts +2 -1
  133. package/dist/utils/index.js +1 -1
  134. package/dist/utils/index.js.map +1 -1
  135. package/dist/utils/index.mjs +1 -1
  136. package/dist/utils/index.mjs.map +1 -1
  137. package/dist/webhook.d.mts +13 -4
  138. package/dist/webhook.d.ts +13 -4
  139. package/dist/webhook.js +1 -1
  140. package/dist/webhook.js.map +1 -1
  141. package/dist/webhook.mjs +1 -1
  142. package/dist/webhook.mjs.map +1 -1
  143. package/dist/whatsapp.d.mts +2 -1
  144. package/dist/whatsapp.d.ts +2 -1
  145. package/dist/whatsapp.js +1 -1
  146. package/dist/whatsapp.js.map +1 -1
  147. package/dist/whatsapp.mjs +1 -1
  148. package/dist/whatsapp.mjs.map +1 -1
  149. package/package.json +2 -2
@@ -2,7 +2,7 @@ import { WabaConfigType } from '../types/config.mjs';
2
2
  import { MediaClass, MediaResponse, UploadMediaResponse } from '../types/media.mjs';
3
3
  import { RequesterClass, ResponseSuccess } from '../types/request.mjs';
4
4
  import BaseAPI from './base.mjs';
5
- import '../enums-BYfW0iLO.mjs';
5
+ import '../enums-CI7vzKhn.mjs';
6
6
  import '../types/base.mjs';
7
7
 
8
8
  declare class MediaAPI extends BaseAPI implements MediaClass {
@@ -2,7 +2,7 @@ import { WabaConfigType } from '../types/config.js';
2
2
  import { MediaClass, MediaResponse, UploadMediaResponse } from '../types/media.js';
3
3
  import { RequesterClass, ResponseSuccess } from '../types/request.js';
4
4
  import BaseAPI from './base.js';
5
- import '../enums-BYfW0iLO.js';
5
+ import '../enums-CI7vzKhn.js';
6
6
  import '../types/base.js';
7
7
 
8
8
  declare class MediaAPI extends BaseAPI implements MediaClass {
package/dist/api/media.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var U=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var I=(D,t)=>{for(var R in t)U(D,R,{get:t[R],enumerable:!0})},p=(D,t,R,A)=>{if(t&&typeof t=="object"||typeof t=="function")for(let S of B(t))!O.call(D,S)&&S!==R&&U(D,S,{get:()=>t[S],enumerable:!(A=G(t,S))||A.enumerable});return D};var T=D=>p(U({},"__esModule",{value:!0}),D);var _={};I(_,{default:()=>N});module.exports=T(_);var P=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var l="BaseAPI",K=!1,M=new P(l,process.env.DEBUG==="true"||K),i=class{config;client;constructor(t,R){this.config=t,this.client=R,M.log("Initialized with HTTPSClient")}sendJson(t,R,A,S){return this.client.getJson(t,R,A,S)}sendFormData(t,R,A,S){return this.client.sendFormData(t,R,A,S)}sendUrlEncodedForm(t,R,A,S){return this.client.sendUrlEncodedForm(t,R,A,S)}};var N=class extends i{endpoint="media";constructor(t,R){super(t,R)}async getMediaById(t){return this.sendJson("GET",`${t}`,this.config.REQUEST_TIMEOUT,null)}async uploadMedia(t,R="whatsapp"){let A=new FormData;return A.append("file",t),A.append("messaging_product",R),A.append("type",t.type),this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,A)}async deleteMedia(t){return this.sendJson("DELETE",`${t}`,this.config.REQUEST_TIMEOUT,null)}async downloadMedia(t){return this.sendJson("GET",t,this.config.REQUEST_TIMEOUT,null)}};
1
+ "use strict";var U=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var I=(P,t)=>{for(var R in t)U(P,R,{get:t[R],enumerable:!0})},p=(P,t,R,A)=>{if(t&&typeof t=="object"||typeof t=="function")for(let S of B(t))!O.call(P,S)&&S!==R&&U(P,S,{get:()=>t[S],enumerable:!(A=G(t,S))||A.enumerable});return P};var T=P=>p(U({},"__esModule",{value:!0}),P);var _={};I(_,{default:()=>N});module.exports=T(_);var D=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var l="BaseAPI",K=!1,M=new D(l,process.env.DEBUG==="true"||K),i=class{config;client;constructor(t,R){this.config=t,this.client=R,M.log("Initialized with HTTPSClient")}sendJson(t,R,A,S){return this.client.getJson(t,R,A,S)}sendFormData(t,R,A,S){return this.client.sendFormData(t,R,A,S)}sendUrlEncodedForm(t,R,A,S){return this.client.sendUrlEncodedForm(t,R,A,S)}};var N=class extends i{endpoint="media";constructor(t,R){super(t,R)}async getMediaById(t){return this.sendJson("GET",`${t}`,this.config.REQUEST_TIMEOUT,null)}async uploadMedia(t,R="whatsapp"){let A=new FormData;return A.append("file",t),A.append("messaging_product",R),A.append("type",t.type),this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,A)}async deleteMedia(t){return this.sendJson("DELETE",`${t}`,this.config.REQUEST_TIMEOUT,null)}async downloadMedia(t){return this.sendJson("GET",t,this.config.REQUEST_TIMEOUT,null)}};
2
2
  //# sourceMappingURL=media.js.map
@@ -1,2 +1,2 @@
1
- var D=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var U="BaseAPI",G=!1,B=new D(U,process.env.DEBUG==="true"||G),P=class{config;client;constructor(t,R){this.config=t,this.client=R,B.log("Initialized with HTTPSClient")}sendJson(t,R,A,S){return this.client.getJson(t,R,A,S)}sendFormData(t,R,A,S){return this.client.sendFormData(t,R,A,S)}sendUrlEncodedForm(t,R,A,S){return this.client.sendUrlEncodedForm(t,R,A,S)}};var i=class extends P{endpoint="media";constructor(t,R){super(t,R)}async getMediaById(t){return this.sendJson("GET",`${t}`,this.config.REQUEST_TIMEOUT,null)}async uploadMedia(t,R="whatsapp"){let A=new FormData;return A.append("file",t),A.append("messaging_product",R),A.append("type",t.type),this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,A)}async deleteMedia(t){return this.sendJson("DELETE",`${t}`,this.config.REQUEST_TIMEOUT,null)}async downloadMedia(t){return this.sendJson("GET",t,this.config.REQUEST_TIMEOUT,null)}};export{i as default};
1
+ var P=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var U="BaseAPI",G=!1,B=new P(U,process.env.DEBUG==="true"||G),D=class{config;client;constructor(t,R){this.config=t,this.client=R,B.log("Initialized with HTTPSClient")}sendJson(t,R,A,S){return this.client.getJson(t,R,A,S)}sendFormData(t,R,A,S){return this.client.sendFormData(t,R,A,S)}sendUrlEncodedForm(t,R,A,S){return this.client.sendUrlEncodedForm(t,R,A,S)}};var i=class extends D{endpoint="media";constructor(t,R){super(t,R)}async getMediaById(t){return this.sendJson("GET",`${t}`,this.config.REQUEST_TIMEOUT,null)}async uploadMedia(t,R="whatsapp"){let A=new FormData;return A.append("file",t),A.append("messaging_product",R),A.append("type",t.type),this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,A)}async deleteMedia(t){return this.sendJson("DELETE",`${t}`,this.config.REQUEST_TIMEOUT,null)}async downloadMedia(t){return this.sendJson("GET",t,this.config.REQUEST_TIMEOUT,null)}};export{i as default};
2
2
  //# sourceMappingURL=media.mjs.map
@@ -1,5 +1,5 @@
1
1
  import { WabaConfigType } from '../types/config.mjs';
2
- import { M as MessageTypesEnum, b as ComponentTypesEnum, I as InteractiveTypesEnum } from '../enums-BYfW0iLO.mjs';
2
+ import { M as MessageTypesEnum, b as ComponentTypesEnum, I as InteractiveTypesEnum } from '../enums-CI7vzKhn.mjs';
3
3
  import { MessagesClass, AudioMediaObject, ContactObject, DocumentMediaObject, ImageMediaObject, InteractiveObject, LocationObject, MessageTemplateObject, StickerMediaObject, TextObject, VideoMediaObject, MessageRequestBody, MessageRequestParams as MessageRequestParams$1, MessagesResponse, TextMessageParams as TextMessageParams$1, StatusParams as StatusParams$1, ReactionParams as ReactionParams$1 } from '../types/messages.mjs';
4
4
  import { RequesterClass } from '../types/request.mjs';
5
5
  import BaseAPI from './base.mjs';
@@ -1,5 +1,5 @@
1
1
  import { WabaConfigType } from '../types/config.js';
2
- import { M as MessageTypesEnum, b as ComponentTypesEnum, I as InteractiveTypesEnum } from '../enums-BYfW0iLO.js';
2
+ import { M as MessageTypesEnum, b as ComponentTypesEnum, I as InteractiveTypesEnum } from '../enums-CI7vzKhn.js';
3
3
  import { MessagesClass, AudioMediaObject, ContactObject, DocumentMediaObject, ImageMediaObject, InteractiveObject, LocationObject, MessageTemplateObject, StickerMediaObject, TextObject, VideoMediaObject, MessageRequestBody, MessageRequestParams as MessageRequestParams$1, MessagesResponse, TextMessageParams as TextMessageParams$1, StatusParams as StatusParams$1, ReactionParams as ReactionParams$1 } from '../types/messages.js';
4
4
  import { RequesterClass } from '../types/request.js';
5
5
  import BaseAPI from './base.js';
@@ -1,2 +1,2 @@
1
- "use strict";var M=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var O=(p,i)=>{for(var t in i)M(p,t,{get:i[t],enumerable:!0})},l=(p,i,t,R)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of N(i))!D.call(p,a)&&a!==t&&M(p,a,{get:()=>i[a],enumerable:!(R=I(i,a))||R.enumerable});return p};var T=p=>l(M({},"__esModule",{value:!0}),p);var _={};O(_,{default:()=>e});module.exports=T(_);var P=class{name;debug;constructor(i,t=!1){this.name=i,this.debug=t}log(...i){if(this.debug){let t=`[ ${Date.now()} ]`;this.name&&(t+=` - ${this.name}`),console.log.apply(console,[t,": ",...i])}}error(...i){let t=`[ ${Date.now()} ] - ERROR`;this.name&&(t+=` - ${this.name}`),console.error.apply(console,[t,": ",...i])}warn(...i){let t=`[ ${Date.now()} ] - WARN`;this.name&&(t+=` - ${this.name}`),console.warn.apply(console,[t,": ",...i])}info(...i){let t=`[ ${Date.now()} ] - INFO`;this.name&&(t+=` - ${this.name}`),console.info.apply(console,[t,": ",...i])}};var B="BaseAPI",U=!1,G=new P(B,process.env.DEBUG==="true"||U),A=class{config;client;constructor(i,t){this.config=i,this.client=t,G.log("Initialized with HTTPSClient")}sendJson(i,t,R,a){return this.client.getJson(i,t,R,a)}sendFormData(i,t,R,a){return this.client.sendFormData(i,t,R,a)}sendUrlEncodedForm(i,t,R,a){return this.client.sendUrlEncodedForm(i,t,R,a)}};var e=class extends A{commonMethod="POST";commonEndpoint="messages";constructor(i,t){super(i,t)}bodyBuilder(i,t,R,a){let s={messaging_product:"whatsapp",recipient_type:"individual",to:R,type:i,[i]:t};return a&&(s.context={message_id:a}),s}send(i){return this.sendJson(this.commonMethod,`${this.config.WA_PHONE_NUMBER_ID}/${this.commonEndpoint}`,this.config.REQUEST_TIMEOUT,i)}async audio(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("audio",t,R,a)))}async contacts(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("contacts",t,R,a)))}async document(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("document",t,R,a)))}async image(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("image",t,R,a)))}async interactive(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async location(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("location",t,R,a)))}async sticker(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("sticker",t,R,a)))}async template(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("template",t,R,a)))}async text(i){let{body:t,previewUrl:R,to:a,replyMessageId:s}=i,S;return typeof t=="string"?S={body:t,preview_url:R}:S=t,this.send(JSON.stringify(this.bodyBuilder("text",S,a,s)))}async video(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("video",t,R,a)))}async status(i){let{status:t,messageId:R,typingIndicator:a}=i,s={messaging_product:"whatsapp",status:t,message_id:R,...a&&{typing_indicator:a}};return this.send(JSON.stringify(s))}async markAsRead(i){return this.status({status:"read",messageId:i.messageId})}async showTypingIndicator(i){return this.status({status:"read",messageId:i.messageId,typingIndicator:{type:"text"}})}async interactiveList(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveCtaUrl(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveLocationRequest(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveAddressMessage(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveReplyButtons(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveFlow(i){let{body:t,to:R,replyMessageId:a}=i;return t.action.parameters.flow_message_version===void 0&&(t.action.parameters.flow_message_version="3"),t.action.parameters.mode===void 0&&(t.action.parameters.mode="published"),t.action.parameters.flow_action===void 0&&(t.action.parameters.flow_action="navigate"),t.action.parameters.flow_action==="navigate"?t.action.parameters.flow_action_payload?.screen===void 0&&(t.action.parameters.flow_action_payload={...t.action.parameters.flow_action_payload,screen:"INIT"}):t.action.parameters.flow_action==="data_exchange"&&delete t.action.parameters.flow_action_payload,this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async reaction(i){let{messageId:t,emoji:R,to:a}=i,s={messaging_product:"whatsapp",recipient_type:"individual",to:a,type:"reaction",reaction:{message_id:t,emoji:R}};return this.send(JSON.stringify(s))}};
1
+ "use strict";var M=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var D=(p,i)=>{for(var t in i)M(p,t,{get:i[t],enumerable:!0})},l=(p,i,t,R)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of O(i))!N.call(p,a)&&a!==t&&M(p,a,{get:()=>i[a],enumerable:!(R=I(i,a))||R.enumerable});return p};var T=p=>l(M({},"__esModule",{value:!0}),p);var _={};D(_,{default:()=>e});module.exports=T(_);var s=class{name;debug;constructor(i,t=!1){this.name=i,this.debug=t}log(...i){if(this.debug){let t=`[ ${Date.now()} ]`;this.name&&(t+=` - ${this.name}`),console.log.apply(console,[t,": ",...i])}}error(...i){let t=`[ ${Date.now()} ] - ERROR`;this.name&&(t+=` - ${this.name}`),console.error.apply(console,[t,": ",...i])}warn(...i){let t=`[ ${Date.now()} ] - WARN`;this.name&&(t+=` - ${this.name}`),console.warn.apply(console,[t,": ",...i])}info(...i){let t=`[ ${Date.now()} ] - INFO`;this.name&&(t+=` - ${this.name}`),console.info.apply(console,[t,": ",...i])}};var B="BaseAPI",U=!1,G=new s(B,process.env.DEBUG==="true"||U),A=class{config;client;constructor(i,t){this.config=i,this.client=t,G.log("Initialized with HTTPSClient")}sendJson(i,t,R,a){return this.client.getJson(i,t,R,a)}sendFormData(i,t,R,a){return this.client.sendFormData(i,t,R,a)}sendUrlEncodedForm(i,t,R,a){return this.client.sendUrlEncodedForm(i,t,R,a)}};var e=class extends A{commonMethod="POST";commonEndpoint="messages";constructor(i,t){super(i,t)}bodyBuilder(i,t,R,a){let P={messaging_product:"whatsapp",recipient_type:"individual",to:R,type:i,[i]:t};return a&&(P.context={message_id:a}),P}send(i){return this.sendJson(this.commonMethod,`${this.config.WA_PHONE_NUMBER_ID}/${this.commonEndpoint}`,this.config.REQUEST_TIMEOUT,i)}async audio(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("audio",t,R,a)))}async contacts(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("contacts",t,R,a)))}async document(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("document",t,R,a)))}async image(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("image",t,R,a)))}async interactive(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async location(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("location",t,R,a)))}async sticker(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("sticker",t,R,a)))}async template(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("template",t,R,a)))}async text(i){let{body:t,previewUrl:R,to:a,replyMessageId:P}=i,S;return typeof t=="string"?S={body:t,preview_url:R}:S=t,this.send(JSON.stringify(this.bodyBuilder("text",S,a,P)))}async video(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("video",t,R,a)))}async status(i){let{status:t,messageId:R,typingIndicator:a}=i,P={messaging_product:"whatsapp",status:t,message_id:R,...a&&{typing_indicator:a}};return this.send(JSON.stringify(P))}async markAsRead(i){return this.status({status:"read",messageId:i.messageId})}async showTypingIndicator(i){return this.status({status:"read",messageId:i.messageId,typingIndicator:{type:"text"}})}async interactiveList(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveCtaUrl(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveLocationRequest(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveAddressMessage(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveReplyButtons(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveFlow(i){let{body:t,to:R,replyMessageId:a}=i;return t.action.parameters.flow_message_version===void 0&&(t.action.parameters.flow_message_version="3"),t.action.parameters.mode===void 0&&(t.action.parameters.mode="published"),t.action.parameters.flow_action===void 0&&(t.action.parameters.flow_action="navigate"),t.action.parameters.flow_action==="navigate"?t.action.parameters.flow_action_payload?.screen===void 0&&(t.action.parameters.flow_action_payload={...t.action.parameters.flow_action_payload,screen:"INIT"}):t.action.parameters.flow_action==="data_exchange"&&delete t.action.parameters.flow_action_payload,this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async reaction(i){let{messageId:t,emoji:R,to:a}=i,P={messaging_product:"whatsapp",recipient_type:"individual",to:a,type:"reaction",reaction:{message_id:t,emoji:R}};return this.send(JSON.stringify(P))}};
2
2
  //# sourceMappingURL=messages.js.map
@@ -1,2 +1,2 @@
1
- var s=class{name;debug;constructor(i,t=!1){this.name=i,this.debug=t}log(...i){if(this.debug){let t=`[ ${Date.now()} ]`;this.name&&(t+=` - ${this.name}`),console.log.apply(console,[t,": ",...i])}}error(...i){let t=`[ ${Date.now()} ] - ERROR`;this.name&&(t+=` - ${this.name}`),console.error.apply(console,[t,": ",...i])}warn(...i){let t=`[ ${Date.now()} ] - WARN`;this.name&&(t+=` - ${this.name}`),console.warn.apply(console,[t,": ",...i])}info(...i){let t=`[ ${Date.now()} ] - INFO`;this.name&&(t+=` - ${this.name}`),console.info.apply(console,[t,": ",...i])}};var M="BaseAPI",I=!1,N=new s(M,process.env.DEBUG==="true"||I),P=class{config;client;constructor(i,t){this.config=i,this.client=t,N.log("Initialized with HTTPSClient")}sendJson(i,t,R,a){return this.client.getJson(i,t,R,a)}sendFormData(i,t,R,a){return this.client.sendFormData(i,t,R,a)}sendUrlEncodedForm(i,t,R,a){return this.client.sendUrlEncodedForm(i,t,R,a)}};var e=class extends P{commonMethod="POST";commonEndpoint="messages";constructor(i,t){super(i,t)}bodyBuilder(i,t,R,a){let p={messaging_product:"whatsapp",recipient_type:"individual",to:R,type:i,[i]:t};return a&&(p.context={message_id:a}),p}send(i){return this.sendJson(this.commonMethod,`${this.config.WA_PHONE_NUMBER_ID}/${this.commonEndpoint}`,this.config.REQUEST_TIMEOUT,i)}async audio(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("audio",t,R,a)))}async contacts(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("contacts",t,R,a)))}async document(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("document",t,R,a)))}async image(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("image",t,R,a)))}async interactive(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async location(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("location",t,R,a)))}async sticker(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("sticker",t,R,a)))}async template(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("template",t,R,a)))}async text(i){let{body:t,previewUrl:R,to:a,replyMessageId:p}=i,A;return typeof t=="string"?A={body:t,preview_url:R}:A=t,this.send(JSON.stringify(this.bodyBuilder("text",A,a,p)))}async video(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("video",t,R,a)))}async status(i){let{status:t,messageId:R,typingIndicator:a}=i,p={messaging_product:"whatsapp",status:t,message_id:R,...a&&{typing_indicator:a}};return this.send(JSON.stringify(p))}async markAsRead(i){return this.status({status:"read",messageId:i.messageId})}async showTypingIndicator(i){return this.status({status:"read",messageId:i.messageId,typingIndicator:{type:"text"}})}async interactiveList(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveCtaUrl(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveLocationRequest(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveAddressMessage(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveReplyButtons(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveFlow(i){let{body:t,to:R,replyMessageId:a}=i;return t.action.parameters.flow_message_version===void 0&&(t.action.parameters.flow_message_version="3"),t.action.parameters.mode===void 0&&(t.action.parameters.mode="published"),t.action.parameters.flow_action===void 0&&(t.action.parameters.flow_action="navigate"),t.action.parameters.flow_action==="navigate"?t.action.parameters.flow_action_payload?.screen===void 0&&(t.action.parameters.flow_action_payload={...t.action.parameters.flow_action_payload,screen:"INIT"}):t.action.parameters.flow_action==="data_exchange"&&delete t.action.parameters.flow_action_payload,this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async reaction(i){let{messageId:t,emoji:R,to:a}=i,p={messaging_product:"whatsapp",recipient_type:"individual",to:a,type:"reaction",reaction:{message_id:t,emoji:R}};return this.send(JSON.stringify(p))}};export{e as default};
1
+ var P=class{name;debug;constructor(i,t=!1){this.name=i,this.debug=t}log(...i){if(this.debug){let t=`[ ${Date.now()} ]`;this.name&&(t+=` - ${this.name}`),console.log.apply(console,[t,": ",...i])}}error(...i){let t=`[ ${Date.now()} ] - ERROR`;this.name&&(t+=` - ${this.name}`),console.error.apply(console,[t,": ",...i])}warn(...i){let t=`[ ${Date.now()} ] - WARN`;this.name&&(t+=` - ${this.name}`),console.warn.apply(console,[t,": ",...i])}info(...i){let t=`[ ${Date.now()} ] - INFO`;this.name&&(t+=` - ${this.name}`),console.info.apply(console,[t,": ",...i])}};var M="BaseAPI",I=!1,O=new P(M,process.env.DEBUG==="true"||I),s=class{config;client;constructor(i,t){this.config=i,this.client=t,O.log("Initialized with HTTPSClient")}sendJson(i,t,R,a){return this.client.getJson(i,t,R,a)}sendFormData(i,t,R,a){return this.client.sendFormData(i,t,R,a)}sendUrlEncodedForm(i,t,R,a){return this.client.sendUrlEncodedForm(i,t,R,a)}};var e=class extends s{commonMethod="POST";commonEndpoint="messages";constructor(i,t){super(i,t)}bodyBuilder(i,t,R,a){let p={messaging_product:"whatsapp",recipient_type:"individual",to:R,type:i,[i]:t};return a&&(p.context={message_id:a}),p}send(i){return this.sendJson(this.commonMethod,`${this.config.WA_PHONE_NUMBER_ID}/${this.commonEndpoint}`,this.config.REQUEST_TIMEOUT,i)}async audio(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("audio",t,R,a)))}async contacts(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("contacts",t,R,a)))}async document(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("document",t,R,a)))}async image(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("image",t,R,a)))}async interactive(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async location(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("location",t,R,a)))}async sticker(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("sticker",t,R,a)))}async template(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("template",t,R,a)))}async text(i){let{body:t,previewUrl:R,to:a,replyMessageId:p}=i,A;return typeof t=="string"?A={body:t,preview_url:R}:A=t,this.send(JSON.stringify(this.bodyBuilder("text",A,a,p)))}async video(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("video",t,R,a)))}async status(i){let{status:t,messageId:R,typingIndicator:a}=i,p={messaging_product:"whatsapp",status:t,message_id:R,...a&&{typing_indicator:a}};return this.send(JSON.stringify(p))}async markAsRead(i){return this.status({status:"read",messageId:i.messageId})}async showTypingIndicator(i){return this.status({status:"read",messageId:i.messageId,typingIndicator:{type:"text"}})}async interactiveList(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveCtaUrl(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveLocationRequest(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveAddressMessage(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveReplyButtons(i){let{body:t,to:R,replyMessageId:a}=i;return this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async interactiveFlow(i){let{body:t,to:R,replyMessageId:a}=i;return t.action.parameters.flow_message_version===void 0&&(t.action.parameters.flow_message_version="3"),t.action.parameters.mode===void 0&&(t.action.parameters.mode="published"),t.action.parameters.flow_action===void 0&&(t.action.parameters.flow_action="navigate"),t.action.parameters.flow_action==="navigate"?t.action.parameters.flow_action_payload?.screen===void 0&&(t.action.parameters.flow_action_payload={...t.action.parameters.flow_action_payload,screen:"INIT"}):t.action.parameters.flow_action==="data_exchange"&&delete t.action.parameters.flow_action_payload,this.send(JSON.stringify(this.bodyBuilder("interactive",t,R,a)))}async reaction(i){let{messageId:t,emoji:R,to:a}=i,p={messaging_product:"whatsapp",recipient_type:"individual",to:a,type:"reaction",reaction:{message_id:t,emoji:R}};return this.send(JSON.stringify(p))}};export{e as default};
2
2
  //# sourceMappingURL=messages.mjs.map
@@ -2,7 +2,7 @@ import { PhoneNumberClass, PhoneNumberResponse, PhoneNumbersResponse, RequestVer
2
2
  import { WabaConfigType } from '../types/config.mjs';
3
3
  import { RequesterClass, ResponseSuccess } from '../types/request.mjs';
4
4
  import BaseAPI from './base.mjs';
5
- import '../enums-BYfW0iLO.mjs';
5
+ import '../enums-CI7vzKhn.mjs';
6
6
  import '../types/base.mjs';
7
7
 
8
8
  declare class PhoneNumberApi extends BaseAPI implements PhoneNumberClass {
@@ -2,7 +2,7 @@ import { PhoneNumberClass, PhoneNumberResponse, PhoneNumbersResponse, RequestVer
2
2
  import { WabaConfigType } from '../types/config.js';
3
3
  import { RequesterClass, ResponseSuccess } from '../types/request.js';
4
4
  import BaseAPI from './base.js';
5
- import '../enums-BYfW0iLO.js';
5
+ import '../enums-CI7vzKhn.js';
6
6
  import '../types/base.js';
7
7
 
8
8
  declare class PhoneNumberApi extends BaseAPI implements PhoneNumberClass {
@@ -1,2 +1,2 @@
1
- "use strict";var U=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var T=(A,t)=>{for(var R in t)U(A,R,{get:t[R],enumerable:!0})},K=(A,t,R,P)=>{if(t&&typeof t=="object"||typeof t=="function")for(let S of O(t))!I.call(A,S)&&S!==R&&U(A,S,{get:()=>t[S],enumerable:!(P=B(t,S))||P.enumerable});return A};var l=A=>K(U({},"__esModule",{value:!0}),A);var h={};T(h,{default:()=>N});module.exports=l(h);var G=A=>{if(!A||Object.keys(A).length===0)return"";let t=new URLSearchParams;for(let[P,S]of Object.entries(A))S!==void 0&&t.append(P,String(S));let R=t.toString();return R?`?${R}`:""};var i=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var p="BaseAPI",M=!1,_=new i(p,process.env.DEBUG==="true"||M),D=class{config;client;constructor(t,R){this.config=t,this.client=R,_.log("Initialized with HTTPSClient")}sendJson(t,R,P,S){return this.client.getJson(t,R,P,S)}sendFormData(t,R,P,S){return this.client.sendFormData(t,R,P,S)}sendUrlEncodedForm(t,R,P,S){return this.client.sendUrlEncodedForm(t,R,P,S)}};var N=class extends D{endpoint="phone_numbers";constructor(t,R){super(t,R)}async getPhoneNumberById(t){let R=t?G({fields:t}):"";return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}${R}`,this.config.REQUEST_TIMEOUT,null)}async getPhoneNumbers(){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,null)}async requestVerificationCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/request_code`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async verifyCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/verify_code`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}};
1
+ "use strict";var U=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var T=(A,t)=>{for(var R in t)U(A,R,{get:t[R],enumerable:!0})},K=(A,t,R,S)=>{if(t&&typeof t=="object"||typeof t=="function")for(let P of B(t))!I.call(A,P)&&P!==R&&U(A,P,{get:()=>t[P],enumerable:!(S=O(t,P))||S.enumerable});return A};var l=A=>K(U({},"__esModule",{value:!0}),A);var h={};T(h,{default:()=>N});module.exports=l(h);var G=A=>{if(!A||Object.keys(A).length===0)return"";let t=new URLSearchParams;for(let[S,P]of Object.entries(A))P!==void 0&&t.append(S,String(P));let R=t.toString();return R?`?${R}`:""};var i=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var p="BaseAPI",_=!1,M=new i(p,process.env.DEBUG==="true"||_),D=class{config;client;constructor(t,R){this.config=t,this.client=R,M.log("Initialized with HTTPSClient")}sendJson(t,R,S,P){return this.client.getJson(t,R,S,P)}sendFormData(t,R,S,P){return this.client.sendFormData(t,R,S,P)}sendUrlEncodedForm(t,R,S,P){return this.client.sendUrlEncodedForm(t,R,S,P)}};var N=class extends D{endpoint="phone_numbers";constructor(t,R){super(t,R)}async getPhoneNumberById(t){let R=t?G({fields:t}):"";return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}${R}`,this.config.REQUEST_TIMEOUT,null)}async getPhoneNumbers(){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,null)}async requestVerificationCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/request_code`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async verifyCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/verify_code`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}};
2
2
  //# sourceMappingURL=phoneNumber.js.map
@@ -1,2 +1,2 @@
1
- var U=P=>{if(!P||Object.keys(P).length===0)return"";let t=new URLSearchParams;for(let[S,A]of Object.entries(P))A!==void 0&&t.append(S,String(A));let R=t.toString();return R?`?${R}`:""};var i=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var G="BaseAPI",B=!1,O=new i(G,process.env.DEBUG==="true"||B),D=class{config;client;constructor(t,R){this.config=t,this.client=R,O.log("Initialized with HTTPSClient")}sendJson(t,R,S,A){return this.client.getJson(t,R,S,A)}sendFormData(t,R,S,A){return this.client.sendFormData(t,R,S,A)}sendUrlEncodedForm(t,R,S,A){return this.client.sendUrlEncodedForm(t,R,S,A)}};var N=class extends D{endpoint="phone_numbers";constructor(t,R){super(t,R)}async getPhoneNumberById(t){let R=t?U({fields:t}):"";return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}${R}`,this.config.REQUEST_TIMEOUT,null)}async getPhoneNumbers(){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,null)}async requestVerificationCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/request_code`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async verifyCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/verify_code`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}};export{N as default};
1
+ var U=S=>{if(!S||Object.keys(S).length===0)return"";let t=new URLSearchParams;for(let[P,A]of Object.entries(S))A!==void 0&&t.append(P,String(A));let R=t.toString();return R?`?${R}`:""};var i=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var G="BaseAPI",O=!1,B=new i(G,process.env.DEBUG==="true"||O),D=class{config;client;constructor(t,R){this.config=t,this.client=R,B.log("Initialized with HTTPSClient")}sendJson(t,R,P,A){return this.client.getJson(t,R,P,A)}sendFormData(t,R,P,A){return this.client.sendFormData(t,R,P,A)}sendUrlEncodedForm(t,R,P,A){return this.client.sendUrlEncodedForm(t,R,P,A)}};var N=class extends D{endpoint="phone_numbers";constructor(t,R){super(t,R)}async getPhoneNumberById(t){let R=t?U({fields:t}):"";return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}${R}`,this.config.REQUEST_TIMEOUT,null)}async getPhoneNumbers(){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,null)}async requestVerificationCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/request_code`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async verifyCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/verify_code`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}};export{N as default};
2
2
  //# sourceMappingURL=phoneNumber.mjs.map
@@ -2,7 +2,7 @@ import { WabaConfigType } from '../types/config.mjs';
2
2
  import { QrCodeClass, CreateQrCodeRequest, QrCodeResponse, QrCodesResponse, UpdateQrCodeRequest } from '../types/qrCode.mjs';
3
3
  import { RequesterClass, ResponseSuccess } from '../types/request.mjs';
4
4
  import BaseAPI from './base.mjs';
5
- import '../enums-BYfW0iLO.mjs';
5
+ import '../enums-CI7vzKhn.mjs';
6
6
  import '../types/base.mjs';
7
7
 
8
8
  declare class QrCodeAPI extends BaseAPI implements QrCodeClass {
@@ -2,7 +2,7 @@ import { WabaConfigType } from '../types/config.js';
2
2
  import { QrCodeClass, CreateQrCodeRequest, QrCodeResponse, QrCodesResponse, UpdateQrCodeRequest } from '../types/qrCode.js';
3
3
  import { RequesterClass, ResponseSuccess } from '../types/request.js';
4
4
  import BaseAPI from './base.js';
5
- import '../enums-BYfW0iLO.js';
5
+ import '../enums-CI7vzKhn.js';
6
6
  import '../types/base.js';
7
7
 
8
8
  declare class QrCodeAPI extends BaseAPI implements QrCodeClass {
@@ -1,2 +1,2 @@
1
- "use strict";var U=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var I=(S,t)=>{for(var R in t)U(S,R,{get:t[R],enumerable:!0})},T=(S,t,R,P)=>{if(t&&typeof t=="object"||typeof t=="function")for(let A of B(t))!O.call(S,A)&&A!==R&&U(S,A,{get:()=>t[A],enumerable:!(P=G(t,A))||P.enumerable});return S};var K=S=>T(U({},"__esModule",{value:!0}),S);var _={};I(_,{default:()=>N});module.exports=K(_);var D=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var l="BaseAPI",p=!1,M=new D(l,process.env.DEBUG==="true"||p),i=class{config;client;constructor(t,R){this.config=t,this.client=R,M.log("Initialized with HTTPSClient")}sendJson(t,R,P,A){return this.client.getJson(t,R,P,A)}sendFormData(t,R,P,A){return this.client.sendFormData(t,R,P,A)}sendUrlEncodedForm(t,R,P,A){return this.client.sendUrlEncodedForm(t,R,P,A)}};var N=class extends i{endpoint="message_qrdls";constructor(t,R){super(t,R)}async createQrCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async getQrCodes(){return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,null)}async getQrCode(t){return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}/${t}`,this.config.REQUEST_TIMEOUT,null)}async updateQrCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async deleteQrCode(t){return this.sendJson("DELETE",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}/${t}`,this.config.REQUEST_TIMEOUT,null)}};
1
+ "use strict";var U=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var I=(P,t)=>{for(var R in t)U(P,R,{get:t[R],enumerable:!0})},T=(P,t,R,S)=>{if(t&&typeof t=="object"||typeof t=="function")for(let A of O(t))!B.call(P,A)&&A!==R&&U(P,A,{get:()=>t[A],enumerable:!(S=G(t,A))||S.enumerable});return P};var K=P=>T(U({},"__esModule",{value:!0}),P);var _={};I(_,{default:()=>N});module.exports=K(_);var D=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var p="BaseAPI",l=!1,M=new D(p,process.env.DEBUG==="true"||l),i=class{config;client;constructor(t,R){this.config=t,this.client=R,M.log("Initialized with HTTPSClient")}sendJson(t,R,S,A){return this.client.getJson(t,R,S,A)}sendFormData(t,R,S,A){return this.client.sendFormData(t,R,S,A)}sendUrlEncodedForm(t,R,S,A){return this.client.sendUrlEncodedForm(t,R,S,A)}};var N=class extends i{endpoint="message_qrdls";constructor(t,R){super(t,R)}async createQrCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async getQrCodes(){return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,null)}async getQrCode(t){return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}/${t}`,this.config.REQUEST_TIMEOUT,null)}async updateQrCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async deleteQrCode(t){return this.sendJson("DELETE",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}/${t}`,this.config.REQUEST_TIMEOUT,null)}};
2
2
  //# sourceMappingURL=qrCode.js.map
@@ -1,2 +1,2 @@
1
- var P=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var U="BaseAPI",G=!1,B=new P(U,process.env.DEBUG==="true"||G),D=class{config;client;constructor(t,R){this.config=t,this.client=R,B.log("Initialized with HTTPSClient")}sendJson(t,R,A,S){return this.client.getJson(t,R,A,S)}sendFormData(t,R,A,S){return this.client.sendFormData(t,R,A,S)}sendUrlEncodedForm(t,R,A,S){return this.client.sendUrlEncodedForm(t,R,A,S)}};var i=class extends D{endpoint="message_qrdls";constructor(t,R){super(t,R)}async createQrCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async getQrCodes(){return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,null)}async getQrCode(t){return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}/${t}`,this.config.REQUEST_TIMEOUT,null)}async updateQrCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async deleteQrCode(t){return this.sendJson("DELETE",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}/${t}`,this.config.REQUEST_TIMEOUT,null)}};export{i as default};
1
+ var S=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var U="BaseAPI",G=!1,O=new S(U,process.env.DEBUG==="true"||G),D=class{config;client;constructor(t,R){this.config=t,this.client=R,O.log("Initialized with HTTPSClient")}sendJson(t,R,A,P){return this.client.getJson(t,R,A,P)}sendFormData(t,R,A,P){return this.client.sendFormData(t,R,A,P)}sendUrlEncodedForm(t,R,A,P){return this.client.sendUrlEncodedForm(t,R,A,P)}};var i=class extends D{endpoint="message_qrdls";constructor(t,R){super(t,R)}async createQrCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async getQrCodes(){return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,null)}async getQrCode(t){return this.sendJson("GET",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}/${t}`,this.config.REQUEST_TIMEOUT,null)}async updateQrCode(t){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async deleteQrCode(t){return this.sendJson("DELETE",`${this.config.WA_PHONE_NUMBER_ID}/${this.endpoint}/${t}`,this.config.REQUEST_TIMEOUT,null)}};export{i as default};
2
2
  //# sourceMappingURL=qrCode.mjs.map
@@ -1,5 +1,5 @@
1
1
  import { WabaConfigType } from '../types/config.mjs';
2
- import { j as DataLocalizationRegionEnum } from '../enums-BYfW0iLO.mjs';
2
+ import { j as DataLocalizationRegionEnum } from '../enums-CI7vzKhn.mjs';
3
3
  import { RegistrationClass } from '../types/registration.mjs';
4
4
  import { RequesterClass, ResponseSuccess } from '../types/request.mjs';
5
5
  import BaseAPI from './base.mjs';
@@ -1,5 +1,5 @@
1
1
  import { WabaConfigType } from '../types/config.js';
2
- import { j as DataLocalizationRegionEnum } from '../enums-BYfW0iLO.js';
2
+ import { j as DataLocalizationRegionEnum } from '../enums-CI7vzKhn.js';
3
3
  import { RegistrationClass } from '../types/registration.js';
4
4
  import { RequesterClass, ResponseSuccess } from '../types/request.js';
5
5
  import BaseAPI from './base.js';
@@ -1,2 +1,2 @@
1
- "use strict";var U=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var I=(S,t)=>{for(var R in t)U(S,R,{get:t[R],enumerable:!0})},K=(S,t,R,D)=>{if(t&&typeof t=="object"||typeof t=="function")for(let A of B(t))!O.call(S,A)&&A!==R&&U(S,A,{get:()=>t[A],enumerable:!(D=G(t,A))||D.enumerable});return S};var T=S=>K(U({},"__esModule",{value:!0}),S);var p={};I(p,{default:()=>i});module.exports=T(p);var P=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var l="BaseAPI",M=!1,_=new P(l,process.env.DEBUG==="true"||M),N=class{config;client;constructor(t,R){this.config=t,this.client=R,_.log("Initialized with HTTPSClient")}sendJson(t,R,D,A){return this.client.getJson(t,R,D,A)}sendFormData(t,R,D,A){return this.client.sendFormData(t,R,D,A)}sendUrlEncodedForm(t,R,D,A){return this.client.sendUrlEncodedForm(t,R,D,A)}};var i=class extends N{constructor(t,R){super(t,R)}async register(t,R){let D={messaging_product:"whatsapp",pin:t,...R&&{data_localization_region:R}};return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/register`,this.config.REQUEST_TIMEOUT,JSON.stringify(D))}async deregister(){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/deregister`,this.config.REQUEST_TIMEOUT,null)}};
1
+ "use strict";var U=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var I=(S,t)=>{for(var R in t)U(S,R,{get:t[R],enumerable:!0})},T=(S,t,R,P)=>{if(t&&typeof t=="object"||typeof t=="function")for(let A of O(t))!B.call(S,A)&&A!==R&&U(S,A,{get:()=>t[A],enumerable:!(P=G(t,A))||P.enumerable});return S};var K=S=>T(U({},"__esModule",{value:!0}),S);var p={};I(p,{default:()=>i});module.exports=K(p);var D=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var l="BaseAPI",_=!1,M=new D(l,process.env.DEBUG==="true"||_),N=class{config;client;constructor(t,R){this.config=t,this.client=R,M.log("Initialized with HTTPSClient")}sendJson(t,R,P,A){return this.client.getJson(t,R,P,A)}sendFormData(t,R,P,A){return this.client.sendFormData(t,R,P,A)}sendUrlEncodedForm(t,R,P,A){return this.client.sendUrlEncodedForm(t,R,P,A)}};var i=class extends N{constructor(t,R){super(t,R)}async register(t,R){let P={messaging_product:"whatsapp",pin:t,...R&&{data_localization_region:R}};return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/register`,this.config.REQUEST_TIMEOUT,JSON.stringify(P))}async deregister(){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/deregister`,this.config.REQUEST_TIMEOUT,null)}};
2
2
  //# sourceMappingURL=registration.js.map
@@ -1,2 +1,2 @@
1
- var D=class{name;debug;constructor(R,t=!1){this.name=R,this.debug=t}log(...R){if(this.debug){let t=`[ ${Date.now()} ]`;this.name&&(t+=` - ${this.name}`),console.log.apply(console,[t,": ",...R])}}error(...R){let t=`[ ${Date.now()} ] - ERROR`;this.name&&(t+=` - ${this.name}`),console.error.apply(console,[t,": ",...R])}warn(...R){let t=`[ ${Date.now()} ] - WARN`;this.name&&(t+=` - ${this.name}`),console.warn.apply(console,[t,": ",...R])}info(...R){let t=`[ ${Date.now()} ] - INFO`;this.name&&(t+=` - ${this.name}`),console.info.apply(console,[t,": ",...R])}};var U="BaseAPI",G=!1,B=new D(U,process.env.DEBUG==="true"||G),P=class{config;client;constructor(R,t){this.config=R,this.client=t,B.log("Initialized with HTTPSClient")}sendJson(R,t,A,S){return this.client.getJson(R,t,A,S)}sendFormData(R,t,A,S){return this.client.sendFormData(R,t,A,S)}sendUrlEncodedForm(R,t,A,S){return this.client.sendUrlEncodedForm(R,t,A,S)}};var N=class extends P{constructor(R,t){super(R,t)}async register(R,t){let A={messaging_product:"whatsapp",pin:R,...t&&{data_localization_region:t}};return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/register`,this.config.REQUEST_TIMEOUT,JSON.stringify(A))}async deregister(){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/deregister`,this.config.REQUEST_TIMEOUT,null)}};export{N as default};
1
+ var P=class{name;debug;constructor(R,t=!1){this.name=R,this.debug=t}log(...R){if(this.debug){let t=`[ ${Date.now()} ]`;this.name&&(t+=` - ${this.name}`),console.log.apply(console,[t,": ",...R])}}error(...R){let t=`[ ${Date.now()} ] - ERROR`;this.name&&(t+=` - ${this.name}`),console.error.apply(console,[t,": ",...R])}warn(...R){let t=`[ ${Date.now()} ] - WARN`;this.name&&(t+=` - ${this.name}`),console.warn.apply(console,[t,": ",...R])}info(...R){let t=`[ ${Date.now()} ] - INFO`;this.name&&(t+=` - ${this.name}`),console.info.apply(console,[t,": ",...R])}};var U="BaseAPI",G=!1,O=new P(U,process.env.DEBUG==="true"||G),D=class{config;client;constructor(R,t){this.config=R,this.client=t,O.log("Initialized with HTTPSClient")}sendJson(R,t,A,S){return this.client.getJson(R,t,A,S)}sendFormData(R,t,A,S){return this.client.sendFormData(R,t,A,S)}sendUrlEncodedForm(R,t,A,S){return this.client.sendUrlEncodedForm(R,t,A,S)}};var N=class extends D{constructor(R,t){super(R,t)}async register(R,t){let A={messaging_product:"whatsapp",pin:R,...t&&{data_localization_region:t}};return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/register`,this.config.REQUEST_TIMEOUT,JSON.stringify(A))}async deregister(){return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}/deregister`,this.config.REQUEST_TIMEOUT,null)}};export{N as default};
2
2
  //# sourceMappingURL=registration.mjs.map
@@ -2,7 +2,7 @@ import { WabaConfigType } from '../types/config.mjs';
2
2
  import { RequesterClass, ResponseSuccess, ResponsePagination } from '../types/request.mjs';
3
3
  import { TemplateClass, TemplateResponse, TemplateRequestBody, TemplateGetParams, TemplateDeleteParams } from '../types/template.mjs';
4
4
  import BaseAPI from './base.mjs';
5
- import '../enums-BYfW0iLO.mjs';
5
+ import '../enums-CI7vzKhn.mjs';
6
6
  import '../types/base.mjs';
7
7
 
8
8
  declare class TemplateApi extends BaseAPI implements TemplateClass {
@@ -2,7 +2,7 @@ import { WabaConfigType } from '../types/config.js';
2
2
  import { RequesterClass, ResponseSuccess, ResponsePagination } from '../types/request.js';
3
3
  import { TemplateClass, TemplateResponse, TemplateRequestBody, TemplateGetParams, TemplateDeleteParams } from '../types/template.js';
4
4
  import BaseAPI from './base.js';
5
- import '../enums-BYfW0iLO.js';
5
+ import '../enums-CI7vzKhn.js';
6
6
  import '../types/base.js';
7
7
 
8
8
  declare class TemplateApi extends BaseAPI implements TemplateClass {
@@ -1,2 +1,2 @@
1
- "use strict";var U=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var l=(A,t)=>{for(var R in t)U(A,R,{get:t[R],enumerable:!0})},p=(A,t,R,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let S of T(t))!O.call(A,S)&&S!==R&&U(A,S,{get:()=>t[S],enumerable:!(i=B(t,S))||i.enumerable});return A};var I=A=>p(U({},"__esModule",{value:!0}),A);var H={};l(H,{default:()=>N});module.exports=I(H);var G=A=>{if(!A||Object.keys(A).length===0)return"";let t=new URLSearchParams;for(let[i,S]of Object.entries(A))S!==void 0&&t.append(i,String(S));let R=t.toString();return R?`?${R}`:""};var P=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var K="BaseAPI",M=!1,_=new P(K,process.env.DEBUG==="true"||M),D=class{config;client;constructor(t,R){this.config=t,this.client=R,_.log("Initialized with HTTPSClient")}sendJson(t,R,i,S){return this.client.getJson(t,R,i,S)}sendFormData(t,R,i,S){return this.client.sendFormData(t,R,i,S)}sendUrlEncodedForm(t,R,i,S){return this.client.sendUrlEncodedForm(t,R,i,S)}};var N=class extends D{endpoint="message_templates";constructor(t,R){super(t,R)}async getTemplate(t){return this.sendJson("GET",`${t}`,this.config.REQUEST_TIMEOUT,null)}async updateTemplate(t,R){return this.sendJson("POST",`${t}`,this.config.REQUEST_TIMEOUT,JSON.stringify(R))}async getTemplates(t){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}${G(t)}`,this.config.REQUEST_TIMEOUT,null)}async createTemplate(t){return this.sendJson("POST",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async deleteTemplate(t){return this.sendJson("DELETE",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}${G(t)}`,this.config.REQUEST_TIMEOUT,null)}};
1
+ "use strict";var G=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var l=(A,t)=>{for(var R in t)G(A,R,{get:t[R],enumerable:!0})},p=(A,t,R,S)=>{if(t&&typeof t=="object"||typeof t=="function")for(let P of B(t))!O.call(A,P)&&P!==R&&G(A,P,{get:()=>t[P],enumerable:!(S=T(t,P))||S.enumerable});return A};var I=A=>p(G({},"__esModule",{value:!0}),A);var F={};l(F,{default:()=>N});module.exports=I(F);var U=A=>{if(!A||Object.keys(A).length===0)return"";let t=new URLSearchParams;for(let[S,P]of Object.entries(A))P!==void 0&&t.append(S,String(P));let R=t.toString();return R?`?${R}`:""};var i=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var K="BaseAPI",M=!1,_=new i(K,process.env.DEBUG==="true"||M),D=class{config;client;constructor(t,R){this.config=t,this.client=R,_.log("Initialized with HTTPSClient")}sendJson(t,R,S,P){return this.client.getJson(t,R,S,P)}sendFormData(t,R,S,P){return this.client.sendFormData(t,R,S,P)}sendUrlEncodedForm(t,R,S,P){return this.client.sendUrlEncodedForm(t,R,S,P)}};var N=class extends D{endpoint="message_templates";constructor(t,R){super(t,R)}async getTemplate(t){return this.sendJson("GET",`${t}`,this.config.REQUEST_TIMEOUT,null)}async updateTemplate(t,R){return this.sendJson("POST",`${t}`,this.config.REQUEST_TIMEOUT,JSON.stringify(R))}async getTemplates(t){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}${U(t)}`,this.config.REQUEST_TIMEOUT,null)}async createTemplate(t){return this.sendJson("POST",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async deleteTemplate(t){return this.sendJson("DELETE",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}${U(t)}`,this.config.REQUEST_TIMEOUT,null)}};
2
2
  //# sourceMappingURL=template.js.map
@@ -1,2 +1,2 @@
1
- var N=i=>{if(!i||Object.keys(i).length===0)return"";let t=new URLSearchParams;for(let[S,A]of Object.entries(i))A!==void 0&&t.append(S,String(A));let R=t.toString();return R?`?${R}`:""};var P=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var G="BaseAPI",B=!1,T=new P(G,process.env.DEBUG==="true"||B),D=class{config;client;constructor(t,R){this.config=t,this.client=R,T.log("Initialized with HTTPSClient")}sendJson(t,R,S,A){return this.client.getJson(t,R,S,A)}sendFormData(t,R,S,A){return this.client.sendFormData(t,R,S,A)}sendUrlEncodedForm(t,R,S,A){return this.client.sendUrlEncodedForm(t,R,S,A)}};var U=class extends D{endpoint="message_templates";constructor(t,R){super(t,R)}async getTemplate(t){return this.sendJson("GET",`${t}`,this.config.REQUEST_TIMEOUT,null)}async updateTemplate(t,R){return this.sendJson("POST",`${t}`,this.config.REQUEST_TIMEOUT,JSON.stringify(R))}async getTemplates(t){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}${N(t)}`,this.config.REQUEST_TIMEOUT,null)}async createTemplate(t){return this.sendJson("POST",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async deleteTemplate(t){return this.sendJson("DELETE",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}${N(t)}`,this.config.REQUEST_TIMEOUT,null)}};export{U as default};
1
+ var N=S=>{if(!S||Object.keys(S).length===0)return"";let t=new URLSearchParams;for(let[P,A]of Object.entries(S))A!==void 0&&t.append(P,String(A));let R=t.toString();return R?`?${R}`:""};var i=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var U="BaseAPI",T=!1,B=new i(U,process.env.DEBUG==="true"||T),D=class{config;client;constructor(t,R){this.config=t,this.client=R,B.log("Initialized with HTTPSClient")}sendJson(t,R,P,A){return this.client.getJson(t,R,P,A)}sendFormData(t,R,P,A){return this.client.sendFormData(t,R,P,A)}sendUrlEncodedForm(t,R,P,A){return this.client.sendUrlEncodedForm(t,R,P,A)}};var G=class extends D{endpoint="message_templates";constructor(t,R){super(t,R)}async getTemplate(t){return this.sendJson("GET",`${t}`,this.config.REQUEST_TIMEOUT,null)}async updateTemplate(t,R){return this.sendJson("POST",`${t}`,this.config.REQUEST_TIMEOUT,JSON.stringify(R))}async getTemplates(t){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}${N(t)}`,this.config.REQUEST_TIMEOUT,null)}async createTemplate(t){return this.sendJson("POST",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}async deleteTemplate(t){return this.sendJson("DELETE",`${this.config.WA_BUSINESS_ACCOUNT_ID}/${this.endpoint}${N(t)}`,this.config.REQUEST_TIMEOUT,null)}};export{G as default};
2
2
  //# sourceMappingURL=template.mjs.map
@@ -2,7 +2,7 @@ import { WabaConfigType } from '../types/config.mjs';
2
2
  import { RequesterClass, ResponseSuccess } from '../types/request.mjs';
3
3
  import { TwoStepVerificationClass } from '../types/twoStepVerification.mjs';
4
4
  import BaseAPI from './base.mjs';
5
- import '../enums-BYfW0iLO.mjs';
5
+ import '../enums-CI7vzKhn.mjs';
6
6
  import '../types/base.mjs';
7
7
 
8
8
  declare class TwoStepVerificationAPI extends BaseAPI implements TwoStepVerificationClass {
@@ -2,7 +2,7 @@ import { WabaConfigType } from '../types/config.js';
2
2
  import { RequesterClass, ResponseSuccess } from '../types/request.js';
3
3
  import { TwoStepVerificationClass } from '../types/twoStepVerification.js';
4
4
  import BaseAPI from './base.js';
5
- import '../enums-BYfW0iLO.js';
5
+ import '../enums-CI7vzKhn.js';
6
6
  import '../types/base.js';
7
7
 
8
8
  declare class TwoStepVerificationAPI extends BaseAPI implements TwoStepVerificationClass {
@@ -1,2 +1,2 @@
1
- "use strict";var G=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var I=(S,R)=>{for(var t in R)G(S,t,{get:R[t],enumerable:!0})},T=(S,R,t,D)=>{if(R&&typeof R=="object"||typeof R=="function")for(let A of B(R))!O.call(S,A)&&A!==t&&G(S,A,{get:()=>R[A],enumerable:!(D=i(R,A))||D.enumerable});return S};var K=S=>T(G({},"__esModule",{value:!0}),S);var H={};I(H,{default:()=>U});module.exports=K(H);var P=class{name;debug;constructor(R,t=!1){this.name=R,this.debug=t}log(...R){if(this.debug){let t=`[ ${Date.now()} ]`;this.name&&(t+=` - ${this.name}`),console.log.apply(console,[t,": ",...R])}}error(...R){let t=`[ ${Date.now()} ] - ERROR`;this.name&&(t+=` - ${this.name}`),console.error.apply(console,[t,": ",...R])}warn(...R){let t=`[ ${Date.now()} ] - WARN`;this.name&&(t+=` - ${this.name}`),console.warn.apply(console,[t,": ",...R])}info(...R){let t=`[ ${Date.now()} ] - INFO`;this.name&&(t+=` - ${this.name}`),console.info.apply(console,[t,": ",...R])}};var M="BaseAPI",l=!1,_=new P(M,process.env.DEBUG==="true"||l),N=class{config;client;constructor(R,t){this.config=R,this.client=t,_.log("Initialized with HTTPSClient")}sendJson(R,t,D,A){return this.client.getJson(R,t,D,A)}sendFormData(R,t,D,A){return this.client.sendFormData(R,t,D,A)}sendUrlEncodedForm(R,t,D,A){return this.client.sendUrlEncodedForm(R,t,D,A)}};var U=class extends N{constructor(R,t){super(R,t)}async setTwoStepVerificationCode(R){let t={pin:R};return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}};
1
+ "use strict";var G=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var I=(S,R)=>{for(var t in R)G(S,t,{get:R[t],enumerable:!0})},T=(S,R,t,P)=>{if(R&&typeof R=="object"||typeof R=="function")for(let A of O(R))!B.call(S,A)&&A!==t&&G(S,A,{get:()=>R[A],enumerable:!(P=i(R,A))||P.enumerable});return S};var K=S=>T(G({},"__esModule",{value:!0}),S);var F={};I(F,{default:()=>U});module.exports=K(F);var D=class{name;debug;constructor(R,t=!1){this.name=R,this.debug=t}log(...R){if(this.debug){let t=`[ ${Date.now()} ]`;this.name&&(t+=` - ${this.name}`),console.log.apply(console,[t,": ",...R])}}error(...R){let t=`[ ${Date.now()} ] - ERROR`;this.name&&(t+=` - ${this.name}`),console.error.apply(console,[t,": ",...R])}warn(...R){let t=`[ ${Date.now()} ] - WARN`;this.name&&(t+=` - ${this.name}`),console.warn.apply(console,[t,": ",...R])}info(...R){let t=`[ ${Date.now()} ] - INFO`;this.name&&(t+=` - ${this.name}`),console.info.apply(console,[t,": ",...R])}};var M="BaseAPI",_=!1,l=new D(M,process.env.DEBUG==="true"||_),N=class{config;client;constructor(R,t){this.config=R,this.client=t,l.log("Initialized with HTTPSClient")}sendJson(R,t,P,A){return this.client.getJson(R,t,P,A)}sendFormData(R,t,P,A){return this.client.sendFormData(R,t,P,A)}sendUrlEncodedForm(R,t,P,A){return this.client.sendUrlEncodedForm(R,t,P,A)}};var U=class extends N{constructor(R,t){super(R,t)}async setTwoStepVerificationCode(R){let t={pin:R};return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}`,this.config.REQUEST_TIMEOUT,JSON.stringify(t))}};
2
2
  //# sourceMappingURL=twoStepVerification.js.map
@@ -1,2 +1,2 @@
1
- var D=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var G="BaseAPI",i=!1,B=new D(G,process.env.DEBUG==="true"||i),P=class{config;client;constructor(t,R){this.config=t,this.client=R,B.log("Initialized with HTTPSClient")}sendJson(t,R,A,S){return this.client.getJson(t,R,A,S)}sendFormData(t,R,A,S){return this.client.sendFormData(t,R,A,S)}sendUrlEncodedForm(t,R,A,S){return this.client.sendUrlEncodedForm(t,R,A,S)}};var N=class extends P{constructor(t,R){super(t,R)}async setTwoStepVerificationCode(t){let R={pin:t};return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}`,this.config.REQUEST_TIMEOUT,JSON.stringify(R))}};export{N as default};
1
+ var P=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var G="BaseAPI",i=!1,O=new P(G,process.env.DEBUG==="true"||i),D=class{config;client;constructor(t,R){this.config=t,this.client=R,O.log("Initialized with HTTPSClient")}sendJson(t,R,A,S){return this.client.getJson(t,R,A,S)}sendFormData(t,R,A,S){return this.client.sendFormData(t,R,A,S)}sendUrlEncodedForm(t,R,A,S){return this.client.sendUrlEncodedForm(t,R,A,S)}};var N=class extends D{constructor(t,R){super(t,R)}async setTwoStepVerificationCode(t){let R={pin:t};return this.sendJson("POST",`${this.config.WA_PHONE_NUMBER_ID}`,this.config.REQUEST_TIMEOUT,JSON.stringify(R))}};export{N as default};
2
2
  //# sourceMappingURL=twoStepVerification.mjs.map
@@ -2,7 +2,7 @@ import { WabaConfigType } from '../types/config.mjs';
2
2
  import { RequesterClass, ResponseSuccess } from '../types/request.mjs';
3
3
  import { WABAClass, WabaAccountFieldsParam, WabaAccount, WabaSubscriptions, UpdateWabaSubscription } from '../types/waba.mjs';
4
4
  import BaseAPI from './base.mjs';
5
- import '../enums-BYfW0iLO.mjs';
5
+ import '../enums-CI7vzKhn.mjs';
6
6
  import '../types/base.mjs';
7
7
 
8
8
  declare class WabaAPI extends BaseAPI implements WABAClass {
@@ -2,7 +2,7 @@ import { WabaConfigType } from '../types/config.js';
2
2
  import { RequesterClass, ResponseSuccess } from '../types/request.js';
3
3
  import { WABAClass, WabaAccountFieldsParam, WabaAccount, WabaSubscriptions, UpdateWabaSubscription } from '../types/waba.js';
4
4
  import BaseAPI from './base.js';
5
- import '../enums-BYfW0iLO.js';
5
+ import '../enums-CI7vzKhn.js';
6
6
  import '../types/base.js';
7
7
 
8
8
  declare class WabaAPI extends BaseAPI implements WABAClass {
package/dist/api/waba.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var U=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var l=(A,t)=>{for(var R in t)U(A,R,{get:t[R],enumerable:!0})},T=(A,t,R,S)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of O(t))!I.call(A,i)&&i!==R&&U(A,i,{get:()=>t[i],enumerable:!(S=G(t,i))||S.enumerable});return A};var p=A=>T(U({},"__esModule",{value:!0}),A);var F={};l(F,{default:()=>N});module.exports=p(F);function B(A){if(!A)return"";let t="";return Array.isArray(A)?t=A.join(","):t=Object.entries(A).filter(([R,S])=>S).map(([R])=>R).join(","),t?`?fields=${t}`:""}var D=class{name;debug;constructor(t,R=!1){this.name=t,this.debug=R}log(...t){if(this.debug){let R=`[ ${Date.now()} ]`;this.name&&(R+=` - ${this.name}`),console.log.apply(console,[R,": ",...t])}}error(...t){let R=`[ ${Date.now()} ] - ERROR`;this.name&&(R+=` - ${this.name}`),console.error.apply(console,[R,": ",...t])}warn(...t){let R=`[ ${Date.now()} ] - WARN`;this.name&&(R+=` - ${this.name}`),console.warn.apply(console,[R,": ",...t])}info(...t){let R=`[ ${Date.now()} ] - INFO`;this.name&&(R+=` - ${this.name}`),console.info.apply(console,[R,": ",...t])}};var K="BaseAPI",M=!1,_=new D(K,process.env.DEBUG==="true"||M),P=class{config;client;constructor(t,R){this.config=t,this.client=R,_.log("Initialized with HTTPSClient")}sendJson(t,R,S,i){return this.client.getJson(t,R,S,i)}sendFormData(t,R,S,i){return this.client.sendFormData(t,R,S,i)}sendUrlEncodedForm(t,R,S,i){return this.client.sendUrlEncodedForm(t,R,S,i)}};var N=class extends P{constructor(t,R){super(t,R)}async getWabaAccount(t){let R=B(t)?.replace(/,/g,"%2C");return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}${R}`,this.config.REQUEST_TIMEOUT,null)}async getAllWabaSubscriptions(){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,null)}async updateWabaSubscription({override_callback_uri:t,verify_token:R}){let S={override_callback_uri:t,verify_token:R};return this.sendJson("POST",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,JSON.stringify(S))}async unsubscribeFromWaba(){return this.sendJson("DELETE",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,null)}};
1
+ "use strict";var U=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var l=(R,t)=>{for(var A in t)U(R,A,{get:t[A],enumerable:!0})},T=(R,t,A,S)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of O(t))!I.call(R,i)&&i!==A&&U(R,i,{get:()=>t[i],enumerable:!(S=B(t,i))||S.enumerable});return R};var p=R=>T(U({},"__esModule",{value:!0}),R);var F={};l(F,{default:()=>N});module.exports=p(F);function G(R){if(!R)return"";let t="";return Array.isArray(R)?t=R.join(","):t=Object.entries(R).filter(([A,S])=>S).map(([A])=>A).join(","),t?`?fields=${t}`:""}var P=class{name;debug;constructor(t,A=!1){this.name=t,this.debug=A}log(...t){if(this.debug){let A=`[ ${Date.now()} ]`;this.name&&(A+=` - ${this.name}`),console.log.apply(console,[A,": ",...t])}}error(...t){let A=`[ ${Date.now()} ] - ERROR`;this.name&&(A+=` - ${this.name}`),console.error.apply(console,[A,": ",...t])}warn(...t){let A=`[ ${Date.now()} ] - WARN`;this.name&&(A+=` - ${this.name}`),console.warn.apply(console,[A,": ",...t])}info(...t){let A=`[ ${Date.now()} ] - INFO`;this.name&&(A+=` - ${this.name}`),console.info.apply(console,[A,": ",...t])}};var K="BaseAPI",_=!1,M=new P(K,process.env.DEBUG==="true"||_),D=class{config;client;constructor(t,A){this.config=t,this.client=A,M.log("Initialized with HTTPSClient")}sendJson(t,A,S,i){return this.client.getJson(t,A,S,i)}sendFormData(t,A,S,i){return this.client.sendFormData(t,A,S,i)}sendUrlEncodedForm(t,A,S,i){return this.client.sendUrlEncodedForm(t,A,S,i)}};var N=class extends D{constructor(t,A){super(t,A)}async getWabaAccount(t){let A=G(t)?.replace(/,/g,"%2C");return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}${A}`,this.config.REQUEST_TIMEOUT,null)}async getAllWabaSubscriptions(){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,null)}async updateWabaSubscription({override_callback_uri:t,verify_token:A}){let S={override_callback_uri:t,verify_token:A};return this.sendJson("POST",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,JSON.stringify(S))}async unsubscribeFromWaba(){return this.sendJson("DELETE",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,null)}};
2
2
  //# sourceMappingURL=waba.js.map
package/dist/api/waba.mjs CHANGED
@@ -1,2 +1,2 @@
1
- function U(S){if(!S)return"";let R="";return Array.isArray(S)?R=S.join(","):R=Object.entries(S).filter(([t,A])=>A).map(([t])=>t).join(","),R?`?fields=${R}`:""}var D=class{name;debug;constructor(R,t=!1){this.name=R,this.debug=t}log(...R){if(this.debug){let t=`[ ${Date.now()} ]`;this.name&&(t+=` - ${this.name}`),console.log.apply(console,[t,": ",...R])}}error(...R){let t=`[ ${Date.now()} ] - ERROR`;this.name&&(t+=` - ${this.name}`),console.error.apply(console,[t,": ",...R])}warn(...R){let t=`[ ${Date.now()} ] - WARN`;this.name&&(t+=` - ${this.name}`),console.warn.apply(console,[t,": ",...R])}info(...R){let t=`[ ${Date.now()} ] - INFO`;this.name&&(t+=` - ${this.name}`),console.info.apply(console,[t,": ",...R])}};var B="BaseAPI",G=!1,O=new D(B,process.env.DEBUG==="true"||G),P=class{config;client;constructor(R,t){this.config=R,this.client=t,O.log("Initialized with HTTPSClient")}sendJson(R,t,A,i){return this.client.getJson(R,t,A,i)}sendFormData(R,t,A,i){return this.client.sendFormData(R,t,A,i)}sendUrlEncodedForm(R,t,A,i){return this.client.sendUrlEncodedForm(R,t,A,i)}};var N=class extends P{constructor(R,t){super(R,t)}async getWabaAccount(R){let t=U(R)?.replace(/,/g,"%2C");return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}${t}`,this.config.REQUEST_TIMEOUT,null)}async getAllWabaSubscriptions(){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,null)}async updateWabaSubscription({override_callback_uri:R,verify_token:t}){let A={override_callback_uri:R,verify_token:t};return this.sendJson("POST",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,JSON.stringify(A))}async unsubscribeFromWaba(){return this.sendJson("DELETE",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,null)}};export{N as default};
1
+ function U(S){if(!S)return"";let A="";return Array.isArray(S)?A=S.join(","):A=Object.entries(S).filter(([t,R])=>R).map(([t])=>t).join(","),A?`?fields=${A}`:""}var P=class{name;debug;constructor(A,t=!1){this.name=A,this.debug=t}log(...A){if(this.debug){let t=`[ ${Date.now()} ]`;this.name&&(t+=` - ${this.name}`),console.log.apply(console,[t,": ",...A])}}error(...A){let t=`[ ${Date.now()} ] - ERROR`;this.name&&(t+=` - ${this.name}`),console.error.apply(console,[t,": ",...A])}warn(...A){let t=`[ ${Date.now()} ] - WARN`;this.name&&(t+=` - ${this.name}`),console.warn.apply(console,[t,": ",...A])}info(...A){let t=`[ ${Date.now()} ] - INFO`;this.name&&(t+=` - ${this.name}`),console.info.apply(console,[t,": ",...A])}};var G="BaseAPI",B=!1,O=new P(G,process.env.DEBUG==="true"||B),D=class{config;client;constructor(A,t){this.config=A,this.client=t,O.log("Initialized with HTTPSClient")}sendJson(A,t,R,i){return this.client.getJson(A,t,R,i)}sendFormData(A,t,R,i){return this.client.sendFormData(A,t,R,i)}sendUrlEncodedForm(A,t,R,i){return this.client.sendUrlEncodedForm(A,t,R,i)}};var N=class extends D{constructor(A,t){super(A,t)}async getWabaAccount(A){let t=U(A)?.replace(/,/g,"%2C");return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}${t}`,this.config.REQUEST_TIMEOUT,null)}async getAllWabaSubscriptions(){return this.sendJson("GET",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,null)}async updateWabaSubscription({override_callback_uri:A,verify_token:t}){let R={override_callback_uri:A,verify_token:t};return this.sendJson("POST",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,JSON.stringify(R))}async unsubscribeFromWaba(){return this.sendJson("DELETE",`${this.config.WA_BUSINESS_ACCOUNT_ID}/subscribed_apps`,this.config.REQUEST_TIMEOUT,null)}};export{N as default};
2
2
  //# sourceMappingURL=waba.mjs.map
@@ -67,7 +67,6 @@ declare enum ComponentTypesEnum {
67
67
  Footer = "FOOTER"
68
68
  }
69
69
  declare enum WabaConfigEnum {
70
- BaseURL = "WA_BASE_URL",
71
70
  AppId = "M4D_APP_ID",
72
71
  Port = "WA_PORT",
73
72
  AppSecret = "M4D_APP_SECRET",
@@ -80,7 +79,9 @@ declare enum WabaConfigEnum {
80
79
  ListenerPort = "LISTENER_PORT",
81
80
  MaxRetriesAfterWait = "MAX_RETRIES_AFTER_WAIT",
82
81
  RequestTimeout = "REQUEST_TIMEOUT",
83
- Debug = "DEBUG"
82
+ Debug = "DEBUG",
83
+ PrivatePem = "FLOW_API_PRIVATE_PEM",
84
+ Passphrase = "FLOW_API_PASSPHRASE"
84
85
  }
85
86
  declare enum ConversationTypesEnum {
86
87
  BusinessInitiated = "business_initiated",
@@ -67,7 +67,6 @@ declare enum ComponentTypesEnum {
67
67
  Footer = "FOOTER"
68
68
  }
69
69
  declare enum WabaConfigEnum {
70
- BaseURL = "WA_BASE_URL",
71
70
  AppId = "M4D_APP_ID",
72
71
  Port = "WA_PORT",
73
72
  AppSecret = "M4D_APP_SECRET",
@@ -80,7 +79,9 @@ declare enum WabaConfigEnum {
80
79
  ListenerPort = "LISTENER_PORT",
81
80
  MaxRetriesAfterWait = "MAX_RETRIES_AFTER_WAIT",
82
81
  RequestTimeout = "REQUEST_TIMEOUT",
83
- Debug = "DEBUG"
82
+ Debug = "DEBUG",
83
+ PrivatePem = "FLOW_API_PRIVATE_PEM",
84
+ Passphrase = "FLOW_API_PASSPHRASE"
84
85
  }
85
86
  declare enum ConversationTypesEnum {
86
87
  BusinessInitiated = "business_initiated",
@@ -1,5 +1,5 @@
1
1
  import { Agent } from 'https';
2
- import { H as HttpMethodsEnum } from './enums-BYfW0iLO.mjs';
2
+ import { H as HttpMethodsEnum } from './enums-CI7vzKhn.mjs';
3
3
  import { HttpsClientClass, HttpsClientResponseClass, ResponseHeaders, ResponseJSONBody } from './types/httpsClient.mjs';
4
4
 
5
5
  declare class HttpsClient implements HttpsClientClass {
@@ -1,5 +1,5 @@
1
1
  import { Agent } from 'https';
2
- import { H as HttpMethodsEnum } from './enums-BYfW0iLO.js';
2
+ import { H as HttpMethodsEnum } from './enums-CI7vzKhn.js';
3
3
  import { HttpsClientClass, HttpsClientResponseClass, ResponseHeaders, ResponseJSONBody } from './types/httpsClient.js';
4
4
 
5
5
  declare class HttpsClient implements HttpsClientClass {
package/dist/index.d.mts CHANGED
@@ -4,8 +4,8 @@ export { BaseClass } from './types/base.mjs';
4
4
  export { BusinessProfileClass, BusinessProfileData, BusinessProfileField, BusinessProfileFieldsParam, BusinessProfileResponse, UpdateBusinessProfileRequest, UploadBusinessProfileResponse, UploadHandle, UploadSession, UploadSessionResponse } from './types/businessProfile.mjs';
5
5
  export { WabaConfigType } from './types/config.mjs';
6
6
  export { EncryptionClass, EncryptionPublicKeyResponse } from './types/encryption.mjs';
7
- export { A as AudioMediaTypesEnum, k as BusinessVerticalEnum, a as ButtonPositionEnum, B as ButtonTypesEnum, C as CategoryEnum, b as ComponentTypesEnum, c as ConversationTypesEnum, i as CurrencyCodesEnum, j as DataLocalizationRegionEnum, D as DocumentMediaTypesEnum, H as HttpMethodsEnum, e as ImageMediaTypesEnum, I as InteractiveTypesEnum, L as LanguagesEnum, M as MessageTypesEnum, P as ParametersTypesEnum, R as ReferralSourceTypesEnum, h as RequestCodeMethodsEnum, S as StatusEnum, d as StickerMediaTypesEnum, g as SystemChangeTypesEnum, T as TemplateStatusEnum, V as VideoMediaTypesEnum, W as WabaConfigEnum, f as WebhookTypesEnum } from './enums-BYfW0iLO.mjs';
8
- export { CreateFlowResponse, Flow, FlowAsset, FlowAssetsResponse, FlowCategoryEnum, FlowClass, FlowMigrationFailure, FlowMigrationResponse, FlowMigrationResult, FlowPreview, FlowPreviewResponse, FlowStatusEnum, FlowValidationError, FlowValidationErrorPointer, FlowsListResponse, Pagination, PaginationCursors, UpdateFlowResponse, ValidateFlowJsonResponse } from './types/flow.mjs';
7
+ export { A as AudioMediaTypesEnum, k as BusinessVerticalEnum, a as ButtonPositionEnum, B as ButtonTypesEnum, C as CategoryEnum, b as ComponentTypesEnum, c as ConversationTypesEnum, i as CurrencyCodesEnum, j as DataLocalizationRegionEnum, D as DocumentMediaTypesEnum, H as HttpMethodsEnum, e as ImageMediaTypesEnum, I as InteractiveTypesEnum, L as LanguagesEnum, M as MessageTypesEnum, P as ParametersTypesEnum, R as ReferralSourceTypesEnum, h as RequestCodeMethodsEnum, S as StatusEnum, d as StickerMediaTypesEnum, g as SystemChangeTypesEnum, T as TemplateStatusEnum, V as VideoMediaTypesEnum, W as WabaConfigEnum, f as WebhookTypesEnum } from './enums-CI7vzKhn.mjs';
8
+ export { CreateFlowResponse, Flow, FlowActionEnum, FlowAsset, FlowAssetsResponse, FlowCategoryEnum, FlowClass, FlowDataExchangeRequest, FlowDataExchangeResponse, FlowDecryptedRequestResponse, FlowEncryptedRequestPayload, FlowEndpointRequest, FlowEndpointResponse, FlowErrorNotificationRequest, FlowErrorNotificationResponse, FlowHealthCheckRequest, FlowHealthCheckResponse, FlowHttpRequest, FlowMigrationFailure, FlowMigrationResponse, FlowMigrationResult, FlowPreview, FlowPreviewResponse, FlowStatusEnum, FlowSuccessScreenResponse, FlowValidationError, FlowValidationErrorPointer, FlowsListResponse, Pagination, PaginationCursors, UpdateFlowResponse, ValidateFlowJsonResponse } from './types/flow.mjs';
9
9
  export { HttpsClientClass, HttpsClientResponseClass, ResponseHeaderValue, ResponseHeaders, ResponseJSONBody } from './types/httpsClient.mjs';
10
10
  export { LoggerInterface } from './types/logger.mjs';
11
11
  export { MediaClass, MediaResponse, MediasResponse, UploadMediaResponse } from './types/media.mjs';
@@ -23,6 +23,7 @@ export { generateXHub256Sig } from './utils/generateXHub256Sig.mjs';
23
23
  export { importConfig } from './utils/importConfig.mjs';
24
24
  export { MetaError, isMetaError } from './utils/isMetaError.mjs';
25
25
  export { objectToQueryString } from './utils/objectToQueryString.mjs';
26
+ import 'http';
26
27
  import './api/businessProfile.mjs';
27
28
  import './api/base.mjs';
28
29
  import './api/encryption.mjs';
package/dist/index.d.ts CHANGED
@@ -4,8 +4,8 @@ export { BaseClass } from './types/base.js';
4
4
  export { BusinessProfileClass, BusinessProfileData, BusinessProfileField, BusinessProfileFieldsParam, BusinessProfileResponse, UpdateBusinessProfileRequest, UploadBusinessProfileResponse, UploadHandle, UploadSession, UploadSessionResponse } from './types/businessProfile.js';
5
5
  export { WabaConfigType } from './types/config.js';
6
6
  export { EncryptionClass, EncryptionPublicKeyResponse } from './types/encryption.js';
7
- export { A as AudioMediaTypesEnum, k as BusinessVerticalEnum, a as ButtonPositionEnum, B as ButtonTypesEnum, C as CategoryEnum, b as ComponentTypesEnum, c as ConversationTypesEnum, i as CurrencyCodesEnum, j as DataLocalizationRegionEnum, D as DocumentMediaTypesEnum, H as HttpMethodsEnum, e as ImageMediaTypesEnum, I as InteractiveTypesEnum, L as LanguagesEnum, M as MessageTypesEnum, P as ParametersTypesEnum, R as ReferralSourceTypesEnum, h as RequestCodeMethodsEnum, S as StatusEnum, d as StickerMediaTypesEnum, g as SystemChangeTypesEnum, T as TemplateStatusEnum, V as VideoMediaTypesEnum, W as WabaConfigEnum, f as WebhookTypesEnum } from './enums-BYfW0iLO.js';
8
- export { CreateFlowResponse, Flow, FlowAsset, FlowAssetsResponse, FlowCategoryEnum, FlowClass, FlowMigrationFailure, FlowMigrationResponse, FlowMigrationResult, FlowPreview, FlowPreviewResponse, FlowStatusEnum, FlowValidationError, FlowValidationErrorPointer, FlowsListResponse, Pagination, PaginationCursors, UpdateFlowResponse, ValidateFlowJsonResponse } from './types/flow.js';
7
+ export { A as AudioMediaTypesEnum, k as BusinessVerticalEnum, a as ButtonPositionEnum, B as ButtonTypesEnum, C as CategoryEnum, b as ComponentTypesEnum, c as ConversationTypesEnum, i as CurrencyCodesEnum, j as DataLocalizationRegionEnum, D as DocumentMediaTypesEnum, H as HttpMethodsEnum, e as ImageMediaTypesEnum, I as InteractiveTypesEnum, L as LanguagesEnum, M as MessageTypesEnum, P as ParametersTypesEnum, R as ReferralSourceTypesEnum, h as RequestCodeMethodsEnum, S as StatusEnum, d as StickerMediaTypesEnum, g as SystemChangeTypesEnum, T as TemplateStatusEnum, V as VideoMediaTypesEnum, W as WabaConfigEnum, f as WebhookTypesEnum } from './enums-CI7vzKhn.js';
8
+ export { CreateFlowResponse, Flow, FlowActionEnum, FlowAsset, FlowAssetsResponse, FlowCategoryEnum, FlowClass, FlowDataExchangeRequest, FlowDataExchangeResponse, FlowDecryptedRequestResponse, FlowEncryptedRequestPayload, FlowEndpointRequest, FlowEndpointResponse, FlowErrorNotificationRequest, FlowErrorNotificationResponse, FlowHealthCheckRequest, FlowHealthCheckResponse, FlowHttpRequest, FlowMigrationFailure, FlowMigrationResponse, FlowMigrationResult, FlowPreview, FlowPreviewResponse, FlowStatusEnum, FlowSuccessScreenResponse, FlowValidationError, FlowValidationErrorPointer, FlowsListResponse, Pagination, PaginationCursors, UpdateFlowResponse, ValidateFlowJsonResponse } from './types/flow.js';
9
9
  export { HttpsClientClass, HttpsClientResponseClass, ResponseHeaderValue, ResponseHeaders, ResponseJSONBody } from './types/httpsClient.js';
10
10
  export { LoggerInterface } from './types/logger.js';
11
11
  export { MediaClass, MediaResponse, MediasResponse, UploadMediaResponse } from './types/media.js';
@@ -23,6 +23,7 @@ export { generateXHub256Sig } from './utils/generateXHub256Sig.js';
23
23
  export { importConfig } from './utils/importConfig.js';
24
24
  export { MetaError, isMetaError } from './utils/isMetaError.js';
25
25
  export { objectToQueryString } from './utils/objectToQueryString.js';
26
+ import 'http';
26
27
  import './api/businessProfile.js';
27
28
  import './api/base.js';
28
29
  import './api/encryption.js';