Socket
Socket
Sign inDemoInstall

whatsapp-api-js

Package Overview
Dependencies
0
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.6.0 to 3.0.0-beta.0

2

lib/cjs/index.js

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{default:()=>WhatsAppAPI});module.exports=__toCommonJS(src_exports);var import_utils=require("./utils.js");class WhatsAppAPI{token;appSecret;webhookVerifyToken;v;fetch;subtle;parsed;offload_functions;secure;on={};constructor({token,appSecret,webhookVerifyToken,v="v19.0",parsed=!0,offload_functions=!0,secure=!0,ponyfill={}}){if(this.token=token,this.secure=!!secure,this.secure){if(this.appSecret=appSecret,typeof ponyfill.subtle!="object"&&(typeof crypto!="object"||typeof crypto?.subtle!="object"))throw new Error("subtle is not defined in the enviroment. Consider using a setup helper, defined at 'whatsapp-api-js/setup', or provide a valid ponyfill object with the argument 'ponyfill.subtle'.");this.subtle=ponyfill.subtle||crypto.subtle}if(webhookVerifyToken&&(this.webhookVerifyToken=webhookVerifyToken),typeof ponyfill.fetch!="function"&&typeof fetch!="function")throw new Error("fetch is not defined in the enviroment. Consider using a setup helper, defined at 'whatsapp-api-js/setup', or provide a valid ponyfill object with the argument 'ponyfill.fetch'.");this.fetch=ponyfill.fetch||fetch,this.v=v,this.parsed=!!parsed,this.offload_functions=!!offload_functions}async sendMessage(phoneID,to,message,context,biz_opaque_callback_data){const type=message._type,request={messaging_product:"whatsapp",type,to};request[type]=message._build(),context&&(request.context={message_id:context}),biz_opaque_callback_data&&(request.biz_opaque_callback_data=biz_opaque_callback_data);const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/messages`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify(request)}),response=this.parsed?await(await promise).json():void 0,args={phoneID,to,type,message,request,id:response&&"messages"in response?response.messages[0].id:void 0,response};return this.user_function(this.on?.sent,args),response??promise}async broadcastMessage(phoneID,to,message,batch_size=50,delay=1e3){const responses=[];if(batch_size<1)throw new RangeError("batch_size must be greater than 0");if(delay<0)throw new RangeError("delay must be greater or equal to 0");for(let i=0;i<to.length;i+=batch_size){i!==0&&await new Promise(resolve=>setTimeout(resolve,delay));for(const u of to.slice(i,i+batch_size))responses.push(this.sendMessage(phoneID,u,message))}return responses}async markAsRead(phoneID,messageId){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/messages`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify({messaging_product:"whatsapp",status:"read",message_id:messageId})});return this.getBody(promise)}async createQR(phoneID,message,format="png"){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls?generate_qr_image=${format}&prefilled_message=${message}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async retrieveQR(phoneID,id){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id??""}`,{headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async updateQR(phoneID,id,message){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id}?prefilled_message=${message}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async deleteQR(phoneID,id){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id}`,{method:"DELETE",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async retrieveMedia(id,phoneID){const params=phoneID?`phone_number_id=${phoneID}`:"",promise=this.fetch(`https://graph.facebook.com/${this.v}/${id}?${params}`,{headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async uploadMedia(phoneID,form,check=!0){if(check){if(!form||typeof form!="object"||!("get"in form)||typeof form.get!="function")throw new TypeError("File's Form must be an instance of FormData");const file=form.get("file");if(!file.type)throw new Error("File's Blob must have a type specified");if(!["audio/aac","audio/mp4","audio/mpeg","audio/amr","audio/ogg","text/plain","application/pdf","application/vnd.ms-powerpoint","application/msword","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","image/jpeg","image/png","video/mp4","video/3gp","image/webp"].includes(file.type))throw new Error(`Invalid media type: ${file.type}`);const validMediaSizes={audio:16e6,text:1e8,application:1e8,image:5e6,video:16e6,sticker:5e5},mediaType=file.type==="image/webp"?"sticker":file.type.split("/")[0];if(file.size&&file.size>validMediaSizes[mediaType])throw new Error(`File is too big (${file.size} bytes) for a ${mediaType} (${validMediaSizes[mediaType]} bytes limit)`)}const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/media?messaging_product=whatsapp`,{method:"POST",body:form,headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"multipart/form-data"}});return this.getBody(promise)}fetchMedia(url){return this._authenicatedRequest(new URL(url))}async deleteMedia(id,phoneID){const params=phoneID?`phone_number_id=${phoneID}`:"",promise=this.fetch(`https://graph.facebook.com/${this.v}/${id}?${params}`,{method:"DELETE",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async post(data,raw_body,signature){if(this.secure){if(!this.appSecret)throw 500;if(!this.subtle)throw 501;if(!raw_body)throw 400;if(signature=signature?.split("sha256=")[1],!signature)throw 401;const encoder=new TextEncoder,keyBuffer=encoder.encode(this.appSecret),key=await this.subtle.importKey("raw",keyBuffer,{name:"HMAC",hash:"SHA-256"},!0,["sign","verify"]),data2=encoder.encode((0,import_utils.escapeUnicode)(raw_body)),result=await this.subtle.sign("HMAC",key,data2.buffer),check=Array.from(new Uint8Array(result)).map(b=>b.toString(16).padStart(2,"0")).join("");if(signature!==check)throw 401}if(!data.object)throw 400;const value=data.entry[0].changes[0].value,phoneID=value.metadata.phone_number_id;if("messages"in value){const message=value.messages[0],contact=value.contacts?.[0],from=contact?.wa_id??message.from,name=contact?.profile.name,args={phoneID,from,message,name,raw:data,reply:(response,context=!1,biz_opaque_callback_data)=>this.sendMessage(phoneID,from,response,context?message.id:void 0,biz_opaque_callback_data),Whatsapp:this};this.user_function(this.on?.message,args)}else if("statuses"in value){const statuses=value.statuses[0],phone=statuses.recipient_id,status=statuses.status,id=statuses.id,conversation=statuses.conversation,pricing=statuses.pricing,error=statuses.errors?.[0],biz_opaque_callback_data=statuses.biz_opaque_callback_data,args={phoneID,phone,status,id,conversation,pricing,error,biz_opaque_callback_data,raw:data};this.user_function(this.on?.status,args)}return 200}get(params){if(!this.webhookVerifyToken)throw 500;const{"hub.mode":mode,"hub.verify_token":token,"hub.challenge":challenge}=params;if(!mode||!token)throw 400;if(mode==="subscribe"&&token===this.webhookVerifyToken)return challenge;throw 403}_authenicatedRequest(url){if(!url)throw new Error("URL must be specified");return this.fetch(url,{headers:{Authorization:`Bearer ${this.token}`}})}async getBody(promise){return this.parsed?await(await promise).json():promise}user_function(f,...a){f&&(this.offload_functions?this.offload(f,...a):f(...a))}offload(f,...a){Promise.resolve().then(()=>f(...a))}}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{WhatsAppAPI:()=>WhatsAppAPI});module.exports=__toCommonJS(src_exports);var import_utils=require("./utils.js"),import_types=require("./types.js");class WhatsAppAPI{token;appSecret;webhookVerifyToken;v;fetch;subtle;parsed;offload_functions;secure;on={};constructor({token,appSecret,webhookVerifyToken,v,parsed=!0,offload_functions=!0,secure=!0,ponyfill={}}){if(this.token=token,this.secure=!!secure,this.secure){if(this.appSecret=appSecret,typeof ponyfill.subtle!="object"&&(typeof crypto!="object"||typeof crypto?.subtle!="object"))throw new Error("subtle is not defined in the enviroment. Consider using a setup helper, defined at 'whatsapp-api-js/setup', or provide a valid ponyfill object with the argument 'ponyfill.subtle'.");this.subtle=ponyfill.subtle||crypto.subtle}if(webhookVerifyToken&&(this.webhookVerifyToken=webhookVerifyToken),typeof ponyfill.fetch!="function"&&typeof fetch!="function")throw new Error("fetch is not defined in the enviroment. Consider using a setup helper, defined at 'whatsapp-api-js/setup', or provide a valid ponyfill object with the argument 'ponyfill.fetch'.");this.fetch=ponyfill.fetch||fetch,v?this.v=v:(console.warn(`[whatsapp-api-js] Cloud API version not defined. In production, it's strongly recommended pinning it to the desired version with the "v" argument. Defaulting to "${import_types.DEFAULT_API_VERSION}".`),this.v=import_types.DEFAULT_API_VERSION),this.parsed=!!parsed,this.offload_functions=!!offload_functions}async sendMessage(phoneID,to,message,context,biz_opaque_callback_data){const type=message._type,request={messaging_product:"whatsapp",type,to};request[type]=message._build(),context&&(request.context={message_id:context}),biz_opaque_callback_data&&(request.biz_opaque_callback_data=biz_opaque_callback_data);const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/messages`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify(request)}),response=this.parsed?await(await promise).json():void 0,args={phoneID,to,type,message,request,id:response&&"messages"in response?response.messages[0].id:void 0,response};return this.user_function(this.on?.sent,args),response??promise}async broadcastMessage(phoneID,to,message,batch_size=50,delay=1e3){const responses=[];if(batch_size<1)throw new RangeError("batch_size must be greater than 0");if(delay<0)throw new RangeError("delay must be greater or equal to 0");for(let i=0;i<to.length;i+=batch_size){i!==0&&await new Promise(resolve=>setTimeout(resolve,delay));for(const u of to.slice(i,i+batch_size))responses.push(this.sendMessage(phoneID,u,message))}return responses}async markAsRead(phoneID,messageId){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/messages`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify({messaging_product:"whatsapp",status:"read",message_id:messageId})});return this.getBody(promise)}async createQR(phoneID,message,format="png"){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls?generate_qr_image=${format}&prefilled_message=${message}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async retrieveQR(phoneID,id){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id??""}`,{headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async updateQR(phoneID,id,message){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id}?prefilled_message=${message}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async deleteQR(phoneID,id){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id}`,{method:"DELETE",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async retrieveMedia(id,phoneID){const params=phoneID?`phone_number_id=${phoneID}`:"",promise=this.fetch(`https://graph.facebook.com/${this.v}/${id}?${params}`,{headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async uploadMedia(phoneID,form,check=!0){if(check){if(!form||typeof form!="object"||!("get"in form)||typeof form.get!="function")throw new TypeError("File's Form must be an instance of FormData");const file=form.get("file");if(!file.type)throw new Error("File's Blob must have a type specified");if(!["audio/aac","audio/mp4","audio/mpeg","audio/amr","audio/ogg","text/plain","application/pdf","application/vnd.ms-powerpoint","application/msword","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","image/jpeg","image/png","video/mp4","video/3gp","image/webp"].includes(file.type))throw new Error(`Invalid media type: ${file.type}`);const validMediaSizes={audio:16e6,text:1e8,application:1e8,image:5e6,video:16e6,sticker:5e5},mediaType=file.type==="image/webp"?"sticker":file.type.split("/")[0];if(file.size&&file.size>validMediaSizes[mediaType])throw new Error(`File is too big (${file.size} bytes) for a ${mediaType} (${validMediaSizes[mediaType]} bytes limit)`)}const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/media?messaging_product=whatsapp`,{method:"POST",body:form,headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"multipart/form-data"}});return this.getBody(promise)}fetchMedia(url){return this._authenicatedRequest(new URL(url))}async deleteMedia(id,phoneID){const params=phoneID?`phone_number_id=${phoneID}`:"",promise=this.fetch(`https://graph.facebook.com/${this.v}/${id}?${params}`,{method:"DELETE",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async post(data,raw_body,signature){if(this.secure){if(!this.appSecret)throw 500;if(!this.subtle)throw 501;if(!raw_body)throw 400;if(signature=signature?.split("sha256=")[1],!signature)throw 401;const encoder=new TextEncoder,keyBuffer=encoder.encode(this.appSecret),key=await this.subtle.importKey("raw",keyBuffer,{name:"HMAC",hash:"SHA-256"},!0,["sign","verify"]),data2=encoder.encode((0,import_utils.escapeUnicode)(raw_body)),result=await this.subtle.sign("HMAC",key,data2.buffer),check=Array.from(new Uint8Array(result)).map(b=>b.toString(16).padStart(2,"0")).join("");if(signature!==check)throw 401}if(!data.object)throw 400;const value=data.entry[0].changes[0].value,phoneID=value.metadata.phone_number_id;if("messages"in value){const message=value.messages[0],contact=value.contacts?.[0],from=contact?.wa_id??message.from,name=contact?.profile.name,args={phoneID,from,message,name,raw:data,reply:(response,context=!1,biz_opaque_callback_data)=>this.sendMessage(phoneID,from,response,context?message.id:void 0,biz_opaque_callback_data),Whatsapp:this};this.user_function(this.on?.message,args)}else if("statuses"in value){const statuses=value.statuses[0],phone=statuses.recipient_id,status=statuses.status,id=statuses.id,conversation=statuses.conversation,pricing=statuses.pricing,error=statuses.errors?.[0],biz_opaque_callback_data=statuses.biz_opaque_callback_data,args={phoneID,phone,status,id,conversation,pricing,error,biz_opaque_callback_data,raw:data};this.user_function(this.on?.status,args)}return 200}get(params){if(!this.webhookVerifyToken)throw 500;const{"hub.mode":mode,"hub.verify_token":token,"hub.challenge":challenge}=params;if(!mode||!token)throw 400;if(mode==="subscribe"&&token===this.webhookVerifyToken)return challenge;throw 403}_authenicatedRequest(url){if(!url)throw new Error("URL must be specified");return this.fetch(url,{headers:{Authorization:`Bearer ${this.token}`}})}async getBody(promise){return this.parsed?await(await promise).json():promise}user_function(f,...a){f&&(this.offload_functions?this.offload(f,...a):f(...a))}offload(f,...a){Promise.resolve().then(()=>f(...a))}}0&&(module.exports={WhatsAppAPI});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var interactive_exports={};__export(interactive_exports,{ActionButtons:()=>ActionButtons,ActionCTA:()=>ActionCTA,ActionCatalog:()=>ActionCatalog,ActionDataExchangeFlow:()=>ActionDataExchangeFlow,ActionFlow:()=>ActionFlow,ActionList:()=>ActionList,ActionLocation:()=>ActionLocation,ActionNavigateFlow:()=>ActionNavigateFlow,ActionProduct:()=>ActionProduct,Body:()=>Body,Button:()=>Button,Footer:()=>Footer,Header:()=>Header,Interactive:()=>Interactive,ListSection:()=>ListSection,Row:()=>Row});module.exports=__toCommonJS(interactive_exports);var import_types=require("../types.js"),import_globals=require("./globals.js");class Interactive extends import_types.ClientMessage{action;body;header;footer;type;get _type(){return"interactive"}constructor(action,body,header,footer){if(super(),action._type!=="product"&&!body)throw new Error("Interactive must have a body component");if(action._type==="product"&&header)throw new Error("Interactive must not have a header component if action is a single product");if(action._type==="product_list"&&header?.type!=="text")throw new Error("Interactive must have a text header component if action is a product list");if(header&&action._type!=="button"&&header?.type!=="text")throw new Error("Interactive header must be of type text");this.type=action._type,this.action=action,body&&(this.body=body),header&&(this.header=header),footer&&(this.footer=footer)}}class Body{text;constructor(text){if(text.length>1024)throw new Error("Body text must be less than 1024 characters");this.text=text}}class Footer{text;constructor(text){if(text.length>60)throw new Error("Footer text must be 60 characters or less");this.text=text}}class Header{type;text;image;document;video;constructor(object){if(typeof object=="string"){if(object.length>60)throw new Error("Header text must be 60 characters or less");this.type="text"}else if(this.type=object._type,object.caption)throw new Error(`Header ${this.type} must not have a caption`);this[this.type]=object}}class ActionButtons extends import_types.ClientLimitedMessageComponent{buttons;get _type(){return"button"}constructor(...button){super("Reply buttons","button",button,3);const ids=button.map(b=>b[b.type].id);if(ids.length!==new Set(ids).size)throw new Error("Reply buttons must have unique ids");const titles=button.map(b=>b[b.type].title);if(titles.length!==new Set(titles).size)throw new Error("Reply buttons must have unique titles");this.buttons=button}}class Button{type;reply;constructor(id,title){if(id.length>256)throw new Error("Button id must be 256 characters or less");if(/^ | $/.test(id))throw new Error("Button id cannot have leading or trailing spaces");if(!title.length)throw new Error("Button title cannot be an empty string");if(title.length>20)throw new Error("Button title must be 20 characters or less");this.type="reply",this.reply={title,id}}}class ActionList extends import_types.ClientLimitedMessageComponent{button;sections;get _type(){return"list"}constructor(button,...sections){if(super("Action","sections",sections,10),!button.length)throw new Error("Button content cannot be an empty string");if(button.length>20)throw new Error("Button content must be 20 characters or less");if(sections.length>1&&!sections.every(obj=>!!obj.title))throw new Error("All sections must have a title if more than 1 section is provided");this.button=button,this.sections=sections}}class ListSection extends import_types.Section{rows;constructor(title,...rows){super("ListSection","rows",rows,10,title),this.rows=rows}}class Row{id;title;description;constructor(id,title,description){if(id.length>200)throw new Error("Row id must be 200 characters or less");if(title.length>24)throw new Error("Row title must be 24 characters or less");if(description&&description.length>72)throw new Error("Row description must be 72 characters or less");this.id=id,this.title=title,description&&(this.description=description)}}class ActionCatalog{name;parameters;get _type(){return"catalog_message"}constructor(thumbnail){this.name="catalog_message",thumbnail&&(this.parameters={thumbnail_product_retailer_id:thumbnail.product_retailer_id})}}class ActionProduct{catalog_id;product_retailer_id;sections;get _type(){return this.product_retailer_id?"product":"product_list"}constructor(catalog_id,...products){const is_sections=(0,import_globals.isProductSections)(products);if(is_sections&&products.length>1){if(products.length>10)throw new Error("Catalog must have between 1 and 10 product sections");for(const obj of products)if(!obj.title)throw new Error("All sections must have a title if more than 1 section is provided")}this.catalog_id=catalog_id,is_sections?this.sections=products:this.product_retailer_id=products[0].product_retailer_id}}class ActionCTA{name="cta_url";parameters;get _type(){return"cta_url"}constructor(display_text,url){this.parameters={display_text,url}}}class ActionFlow{name="flow";parameters;get _type(){return"flow"}constructor(parameters){if(!parameters.flow_cta.length||parameters.flow_cta.length>20)throw new Error("Flow CTA must be between 1 and 20 characters");if(/\p{Extended_Pictographic}/u.test(parameters.flow_cta))throw new Error("Flow CTA must not contain emoji");this.parameters=parameters}}class ActionNavigateFlow extends ActionFlow{constructor(flow_token,flow_id,flow_cta,screen,data,mode="published",flow_message_version="3"){if(super({mode,flow_message_version,flow_token,flow_id,flow_cta,flow_action:"navigate",flow_action_payload:{screen,data}}),data&&!Object.keys(data))throw new Error("Flow data must be a non-empty object if provided")}}class ActionDataExchangeFlow extends ActionFlow{constructor(flow_token,flow_id,flow_cta,mode="published",flow_message_version="3"){super({mode,flow_message_version,flow_token,flow_id,flow_cta,flow_action:"data_exchange"})}}class ActionLocation{name="send_location";get _type(){return"location_request_message"}}0&&(module.exports={ActionButtons,ActionCTA,ActionCatalog,ActionDataExchangeFlow,ActionFlow,ActionList,ActionLocation,ActionNavigateFlow,ActionProduct,Body,Button,Footer,Header,Interactive,ListSection,Row});
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var interactive_exports={};__export(interactive_exports,{ActionButtons:()=>ActionButtons,ActionCTA:()=>ActionCTA,ActionCatalog:()=>ActionCatalog,ActionDataExchangeFlow:()=>ActionDataExchangeFlow,ActionFlow:()=>ActionFlow,ActionList:()=>ActionList,ActionLocation:()=>ActionLocation,ActionNavigateFlow:()=>ActionNavigateFlow,ActionProduct:()=>ActionProduct,ActionProductList:()=>ActionProductList,Body:()=>Body,Button:()=>Button,Footer:()=>Footer,Header:()=>Header,Interactive:()=>Interactive,ListSection:()=>ListSection,Row:()=>Row});module.exports=__toCommonJS(interactive_exports);var import_types=require("../types.js");class Interactive extends import_types.ClientMessage{action;body;header;footer;type;get _type(){return"interactive"}constructor(action,body,header,footer){if(super(),header&&["list","product_list","cta_url","flow"].includes(action._type)&&header.type!=="text")throw new Error(`Header of type text is required for ${action._type} action`);this.type=action._type,this.action=action,body&&(this.body=body),header&&(this.header=header),footer&&(this.footer=footer)}}class Body{text;constructor(text){if(text.length>1024)throw new Error("Body text must be less than 1024 characters");this.text=text}}class Footer{text;constructor(text){if(text.length>60)throw new Error("Footer text must be 60 characters or less");this.text=text}}class Header{type;text;image;document;video;constructor(object){if(typeof object=="string"){if(object.length>60)throw new Error("Header text must be 60 characters or less");this.type="text"}else if(this.type=object._type,object.caption)throw new Error(`Header ${this.type} must not have a caption`);this[this.type]=object}}class ActionButtons extends import_types.ClientLimitedMessageComponent{buttons;get _type(){return"button"}constructor(...button){super("Reply buttons","button",button,3);const ids=button.map(b=>b[b.type].id);if(ids.length!==new Set(ids).size)throw new Error("Reply buttons must have unique ids");const titles=button.map(b=>b[b.type].title);if(titles.length!==new Set(titles).size)throw new Error("Reply buttons must have unique titles");this.buttons=button}}class Button{type;reply;constructor(id,title){if(id.length>256)throw new Error("Button id must be 256 characters or less");if(/^ | $/.test(id))throw new Error("Button id cannot have leading or trailing spaces");if(!title.length)throw new Error("Button title cannot be an empty string");if(title.length>20)throw new Error("Button title must be 20 characters or less");this.type="reply",this.reply={title,id}}}class ActionList extends import_types.ClientLimitedMessageComponent{button;sections;get _type(){return"list"}constructor(button,...sections){if(super("Action","sections",sections,10),!button.length)throw new Error("Button content cannot be an empty string");if(button.length>20)throw new Error("Button content must be 20 characters or less");if(sections.length>1&&!sections.every(obj=>!!obj.title))throw new Error("All sections must have a title if more than 1 section is provided");this.button=button,this.sections=sections}}class ListSection extends import_types.Section{rows;constructor(title,...rows){super("ListSection","rows",rows,10,title),this.rows=rows}}class Row{id;title;description;constructor(id,title,description){if(id.length>200)throw new Error("Row id must be 200 characters or less");if(title.length>24)throw new Error("Row title must be 24 characters or less");if(description&&description.length>72)throw new Error("Row description must be 72 characters or less");this.id=id,this.title=title,description&&(this.description=description)}}class ActionCatalog{name;parameters;get _type(){return"catalog_message"}constructor(thumbnail){this.name="catalog_message",thumbnail&&(this.parameters={thumbnail_product_retailer_id:thumbnail.product_retailer_id})}}class ActionProduct{catalog_id;product_retailer_id;get _type(){return"product"}constructor(catalog_id,product){this.catalog_id=catalog_id,this.product_retailer_id=product.product_retailer_id}}class ActionProductList extends import_types.ClientLimitedMessageComponent{catalog_id;sections;get _type(){return"product_list"}constructor(catalog_id,...sections){if(super("ActionProductList","sections",sections,10),sections.length>1){for(const obj of sections)if(!obj.title)throw new Error("All sections must have a title if more than 1 section is provided")}this.catalog_id=catalog_id,this.sections=sections}}class ActionCTA{name="cta_url";parameters;get _type(){return"cta_url"}constructor(display_text,url){this.parameters={display_text,url}}}class ActionFlow{name="flow";parameters;get _type(){return"flow"}constructor(parameters){if(!parameters.flow_cta.length||parameters.flow_cta.length>20)throw new Error("Flow CTA must be between 1 and 20 characters");if(/\p{Extended_Pictographic}/u.test(parameters.flow_cta))throw new Error("Flow CTA must not contain emoji");this.parameters=parameters}}class ActionNavigateFlow extends ActionFlow{constructor(flow_token,flow_id,flow_cta,screen,data,mode="published",flow_message_version="3"){if(super({mode,flow_message_version,flow_token,flow_id,flow_cta,flow_action:"navigate",flow_action_payload:{screen,data}}),data&&!Object.keys(data))throw new Error("Flow data must be a non-empty object if provided")}}class ActionDataExchangeFlow extends ActionFlow{constructor(flow_token,flow_id,flow_cta,mode="published",flow_message_version="3"){super({mode,flow_message_version,flow_token,flow_id,flow_cta,flow_action:"data_exchange"})}}class ActionLocation{name="send_location";get _type(){return"location_request_message"}}0&&(module.exports={ActionButtons,ActionCTA,ActionCatalog,ActionDataExchangeFlow,ActionFlow,ActionList,ActionLocation,ActionNavigateFlow,ActionProduct,ActionProductList,Body,Button,Footer,Header,Interactive,ListSection,Row});
//# sourceMappingURL=interactive.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var location_exports={};__export(location_exports,{Location:()=>Location,default:()=>Location});module.exports=__toCommonJS(location_exports);var import_types=require("../types.js");class Location extends import_types.ClientMessage{longitude;latitude;name;address;get _type(){return"location"}constructor(longitude,latitude,name,address){super(),this.longitude=longitude,this.latitude=latitude,name&&(this.name=name),address&&(this.address=address)}}0&&(module.exports={Location});
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var location_exports={};__export(location_exports,{Location:()=>Location});module.exports=__toCommonJS(location_exports);var import_types=require("../types.js");class Location extends import_types.ClientMessage{longitude;latitude;name;address;get _type(){return"location"}constructor(longitude,latitude,name,address){super(),this.longitude=longitude,this.latitude=latitude,name&&(this.name=name),address&&(this.address=address)}}0&&(module.exports={Location});
//# sourceMappingURL=location.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var reaction_exports={};__export(reaction_exports,{Reaction:()=>Reaction,default:()=>Reaction});module.exports=__toCommonJS(reaction_exports);var import_types=require("../types.js");class Reaction extends import_types.ClientMessage{message_id;emoji;get _type(){return"reaction"}constructor(message_id,emoji=""){if(super(),emoji&&!/^\p{Extended_Pictographic}$/u.test(emoji))throw new Error("Reaction emoji must be a single emoji");this.message_id=message_id,this.emoji=emoji}}0&&(module.exports={Reaction});
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var reaction_exports={};__export(reaction_exports,{Reaction:()=>Reaction});module.exports=__toCommonJS(reaction_exports);var import_types=require("../types.js");class Reaction extends import_types.ClientMessage{message_id;emoji;get _type(){return"reaction"}constructor(message_id,emoji=""){if(super(),emoji&&!/^\p{Extended_Pictographic}$/u.test(emoji))throw new Error("Reaction emoji must be a single emoji");this.message_id=message_id,this.emoji=emoji}}0&&(module.exports={Reaction});
//# sourceMappingURL=reaction.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var text_exports={};__export(text_exports,{Text:()=>Text,default:()=>Text});module.exports=__toCommonJS(text_exports);var import_types=require("../types.js");class Text extends import_types.ClientMessage{body;preview_url;get _type(){return"text"}constructor(body,preview_url){if(super(),body.length>4096)throw new Error("Text body must be less than 4096 characters");this.body=body,preview_url&&(this.preview_url=preview_url)}}0&&(module.exports={Text});
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var text_exports={};__export(text_exports,{Text:()=>Text});module.exports=__toCommonJS(text_exports);var import_types=require("../types.js");class Text extends import_types.ClientMessage{body;preview_url;get _type(){return"text"}constructor(body,preview_url){if(super(),body.length>4096)throw new Error("Text body must be less than 4096 characters");this.body=body,preview_url&&(this.preview_url=preview_url)}}0&&(module.exports={Text});
//# sourceMappingURL=text.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var adonis_exports={};__export(adonis_exports,{default:()=>WhatsAppAPI});module.exports=__toCommonJS(adonis_exports);var import_globals=require("./globals.js"),import_utils=require("../utils.js");class WhatsAppAPI extends import_globals.WhatsAppAPIMiddleware{async handle_post(req){try{return await this.post(req.body(),req.raw()??"",req.header("x-hub-signature-256")??"")}catch(e){return(0,import_utils.isInteger)(e)?e:500}}handle_get(req){try{return this.get(req.qs())}catch(e){throw(0,import_utils.isInteger)(e)?e:500}}}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var adonis_exports={};__export(adonis_exports,{WhatsAppAPI:()=>WhatsAppAPI});module.exports=__toCommonJS(adonis_exports);var import_globals=require("./globals.js"),import_utils=require("../utils.js");class WhatsAppAPI extends import_globals.WhatsAppAPIMiddleware{async handle_post(req){try{return await this.post(req.body(),req.raw()??"",req.header("x-hub-signature-256")??"")}catch(e){return(0,import_utils.isInteger)(e)?e:500}}handle_get(req){try{return this.get(req.qs())}catch(e){throw(0,import_utils.isInteger)(e)?e:500}}}0&&(module.exports={WhatsAppAPI});
//# sourceMappingURL=adonis.js.map

@@ -1,2 +0,2 @@

"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var bun_exports={};__export(bun_exports,{default:()=>WhatsAppAPI});module.exports=__toCommonJS(bun_exports);var import_web_standard=__toESM(require("./web-standard.js"),1);class WhatsAppAPI extends import_web_standard.default{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var bun_exports={};__export(bun_exports,{WhatsAppAPI:()=>WhatsAppAPI});module.exports=__toCommonJS(bun_exports);var import_web_standard=require("./web-standard.js");class WhatsAppAPI extends import_web_standard.WhatsAppAPI{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}0&&(module.exports={WhatsAppAPI});
//# sourceMappingURL=bun.js.map

@@ -1,2 +0,2 @@

"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var deno_exports={};__export(deno_exports,{default:()=>WhatsAppAPI});module.exports=__toCommonJS(deno_exports);var import_web_standard=__toESM(require("./web-standard.js"),1);class WhatsAppAPI extends import_web_standard.default{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var deno_exports={};__export(deno_exports,{WhatsAppAPI:()=>WhatsAppAPI});module.exports=__toCommonJS(deno_exports);var import_web_standard=require("./web-standard.js");class WhatsAppAPI extends import_web_standard.WhatsAppAPI{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}0&&(module.exports={WhatsAppAPI});
//# sourceMappingURL=deno.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var express_exports={};__export(express_exports,{default:()=>WhatsAppAPI});module.exports=__toCommonJS(express_exports);var import_globals=require("./globals.js"),import_utils=require("../utils.js");class WhatsAppAPI extends import_globals.WhatsAppAPIMiddleware{async handle_post(req){try{return this.post(JSON.parse(req.body??"{}"),req.body,req.header("x-hub-signature-256"))}catch(e){return(0,import_utils.isInteger)(e)?e:500}}handle_get(req){try{return this.get(req.query)}catch(e){throw(0,import_utils.isInteger)(e)?e:500}}}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var express_exports={};__export(express_exports,{WhatsAppAPI:()=>WhatsAppAPI});module.exports=__toCommonJS(express_exports);var import_globals=require("./globals.js"),import_utils=require("../utils.js");class WhatsAppAPI extends import_globals.WhatsAppAPIMiddleware{async handle_post(req){try{return this.post(JSON.parse(req.body??"{}"),req.body,req.header("x-hub-signature-256"))}catch(e){return(0,import_utils.isInteger)(e)?e:500}}handle_get(req){try{return this.get(req.query)}catch(e){throw(0,import_utils.isInteger)(e)?e:500}}}0&&(module.exports={WhatsAppAPI});
//# sourceMappingURL=express.js.map

@@ -1,2 +0,2 @@

"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var globals_exports={};__export(globals_exports,{WhatsAppAPIMiddleware:()=>WhatsAppAPIMiddleware});module.exports=__toCommonJS(globals_exports);var import__=__toESM(require("../index.js"),1);class WhatsAppAPIMiddleware extends import__.default{}0&&(module.exports={WhatsAppAPIMiddleware});
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var globals_exports={};__export(globals_exports,{WhatsAppAPIMiddleware:()=>WhatsAppAPIMiddleware});module.exports=__toCommonJS(globals_exports);var import__=require("../index.js");class WhatsAppAPIMiddleware extends import__.WhatsAppAPI{}0&&(module.exports={WhatsAppAPIMiddleware});
//# sourceMappingURL=globals.js.map

@@ -1,2 +0,2 @@

"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var middleware_exports={};__export(middleware_exports,{AdonisMiddleware:()=>import_adonis.default,BunMiddleware:()=>import_bun.default,DenoMiddleware:()=>import_deno.default,ExpressMiddleware:()=>import_express.default,NodeHTTPMiddleware:()=>import_node_http.default,SvelteKitMiddleware:()=>import_sveltekit.default,VercelMiddleware:()=>import_vercel.default,WebStandardMiddleware:()=>import_web_standard.default,WhatsAppAPIMiddleware:()=>import_globals.WhatsAppAPIMiddleware});module.exports=__toCommonJS(middleware_exports);var import_globals=require("./globals.js"),import_express=__toESM(require("./express.js"),1),import_adonis=__toESM(require("./adonis.js"),1),import_vercel=__toESM(require("./vercel.js"),1),import_deno=__toESM(require("./deno.js"),1),import_bun=__toESM(require("./bun.js"),1),import_sveltekit=__toESM(require("./sveltekit.js"),1),import_web_standard=__toESM(require("./web-standard.js"),1),import_node_http=__toESM(require("./node-http.js"),1);0&&(module.exports={AdonisMiddleware,BunMiddleware,DenoMiddleware,ExpressMiddleware,NodeHTTPMiddleware,SvelteKitMiddleware,VercelMiddleware,WebStandardMiddleware,WhatsAppAPIMiddleware});
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var middleware_exports={};__export(middleware_exports,{AdonisMiddleware:()=>import_adonis.WhatsAppAPI,BunMiddleware:()=>import_bun.WhatsAppAPI,DenoMiddleware:()=>import_deno.WhatsAppAPI,ExpressMiddleware:()=>import_express.WhatsAppAPI,NodeHTTPMiddleware:()=>import_node_http.WhatsAppAPI,SvelteKitMiddleware:()=>import_sveltekit.WhatsAppAPI,VercelMiddleware:()=>import_vercel.WhatsAppAPI,WebStandardMiddleware:()=>import_web_standard.WhatsAppAPI,WhatsAppAPIMiddleware:()=>import_globals.WhatsAppAPIMiddleware});module.exports=__toCommonJS(middleware_exports);var import_globals=require("./globals.js"),import_express=require("./express.js"),import_adonis=require("./adonis.js"),import_vercel=require("./vercel.js"),import_deno=require("./deno.js"),import_bun=require("./bun.js"),import_sveltekit=require("./sveltekit.js"),import_web_standard=require("./web-standard.js"),import_node_http=require("./node-http.js");0&&(module.exports={AdonisMiddleware,BunMiddleware,DenoMiddleware,ExpressMiddleware,NodeHTTPMiddleware,SvelteKitMiddleware,VercelMiddleware,WebStandardMiddleware,WhatsAppAPIMiddleware});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var node_http_exports={};__export(node_http_exports,{default:()=>WhatsAppAPI});module.exports=__toCommonJS(node_http_exports);var import_globals=require("./globals.js"),import_utils=require("../utils.js");class WhatsAppAPI extends import_globals.WhatsAppAPIMiddleware{async handle_post(req){async function parseBody(readable){const chunks=[];for await(const chunk of readable)chunks.push(typeof chunk=="string"?Buffer.from(chunk):chunk);return Buffer.concat(chunks).toString("utf-8")}try{const body=await parseBody(req),signature=req.headers["x-hub-signature-256"];if(typeof signature!="string")throw 400;return this.post(JSON.parse(body||"{}"),body,signature)}catch(e){return(0,import_utils.isInteger)(e)?e:500}}handle_get(req){try{return this.get(Object.fromEntries(new URL(req.url,`http://${req.headers.host}`).searchParams))}catch(e){throw(0,import_utils.isInteger)(e)?e:500}}}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var node_http_exports={};__export(node_http_exports,{WhatsAppAPI:()=>WhatsAppAPI});module.exports=__toCommonJS(node_http_exports);var import_globals=require("./globals.js"),import_utils=require("../utils.js");class WhatsAppAPI extends import_globals.WhatsAppAPIMiddleware{async handle_post(req){async function parseBody(readable){const chunks=[];for await(const chunk of readable)chunks.push(typeof chunk=="string"?Buffer.from(chunk):chunk);return Buffer.concat(chunks).toString("utf-8")}try{const body=await parseBody(req),signature=req.headers["x-hub-signature-256"];if(typeof signature!="string")throw 400;return this.post(JSON.parse(body||"{}"),body,signature)}catch(e){return(0,import_utils.isInteger)(e)?e:500}}handle_get(req){try{return this.get(Object.fromEntries(new URL(req.url,`http://${req.headers.host}`).searchParams))}catch(e){throw(0,import_utils.isInteger)(e)?e:500}}}0&&(module.exports={WhatsAppAPI});
//# sourceMappingURL=node-http.js.map

@@ -1,2 +0,2 @@

"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var sveltekit_exports={};__export(sveltekit_exports,{default:()=>WhatsAppAPI});module.exports=__toCommonJS(sveltekit_exports);var import_web_standard=__toESM(require("./web-standard.js"),1);class WhatsAppAPI extends import_web_standard.default{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var sveltekit_exports={};__export(sveltekit_exports,{WhatsAppAPI:()=>WhatsAppAPI});module.exports=__toCommonJS(sveltekit_exports);var import_web_standard=require("./web-standard.js");class WhatsAppAPI extends import_web_standard.WhatsAppAPI{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}0&&(module.exports={WhatsAppAPI});
//# sourceMappingURL=sveltekit.js.map

@@ -1,2 +0,2 @@

"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var vercel_exports={};__export(vercel_exports,{default:()=>WhatsAppAPI});module.exports=__toCommonJS(vercel_exports);var import_node_http=__toESM(require("./node-http.js"),1),import_utils=require("../utils.js");class WhatsAppAPI extends import_node_http.default{handle_post(req){return super.handle_post(req)}handle_get(req){try{return this.get(req.query)}catch(e){throw(0,import_utils.isInteger)(e)?e:500}}}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var vercel_exports={};__export(vercel_exports,{WhatsAppAPI:()=>WhatsAppAPI});module.exports=__toCommonJS(vercel_exports);var import_node_http=require("./node-http.js"),import_utils=require("../utils.js");class WhatsAppAPI extends import_node_http.WhatsAppAPI{handle_post(req){return super.handle_post(req)}handle_get(req){try{return this.get(req.query)}catch(e){throw(0,import_utils.isInteger)(e)?e:500}}}0&&(module.exports={WhatsAppAPI});
//# sourceMappingURL=vercel.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var web_standard_exports={};__export(web_standard_exports,{default:()=>WhatsAppAPI});module.exports=__toCommonJS(web_standard_exports);var import_globals=require("./globals.js"),import_utils=require("../utils.js");class WhatsAppAPI extends import_globals.WhatsAppAPIMiddleware{async handle_post(req){try{const body=await req.text();return this.post(JSON.parse(body||"{}"),body,req.headers.get("x-hub-signature-256")??"")}catch(e){return(0,import_utils.isInteger)(e)?e:500}}handle_get(req){try{return this.get(Object.fromEntries(new URL(req.url).searchParams))}catch(e){throw(0,import_utils.isInteger)(e)?e:500}}}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var web_standard_exports={};__export(web_standard_exports,{WhatsAppAPI:()=>WhatsAppAPI});module.exports=__toCommonJS(web_standard_exports);var import_globals=require("./globals.js"),import_utils=require("../utils.js");class WhatsAppAPI extends import_globals.WhatsAppAPIMiddleware{async handle_post(req){try{const body=await req.text();return this.post(JSON.parse(body||"{}"),body,req.headers.get("x-hub-signature-256")??"")}catch(e){return(0,import_utils.isInteger)(e)?e:500}}handle_get(req){try{return this.get(Object.fromEntries(new URL(req.url).searchParams))}catch(e){throw(0,import_utils.isInteger)(e)?e:500}}}0&&(module.exports={WhatsAppAPI});
//# sourceMappingURL=web-standard.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var bun_exports={};__export(bun_exports,{default:()=>Bun});module.exports=__toCommonJS(bun_exports);function Bun(settings){return settings}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var bun_exports={};__export(bun_exports,{Bun:()=>Bun});module.exports=__toCommonJS(bun_exports);function Bun(settings){return settings}0&&(module.exports={Bun});
//# sourceMappingURL=bun.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var deno_exports={};__export(deno_exports,{default:()=>Deno});module.exports=__toCommonJS(deno_exports);function Deno(settings){return settings}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var deno_exports={};__export(deno_exports,{Deno:()=>Deno});module.exports=__toCommonJS(deno_exports);function Deno(settings){return settings}0&&(module.exports={Deno});
//# sourceMappingURL=deno.js.map

@@ -1,2 +0,2 @@

"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var setup_exports={};__export(setup_exports,{Bun:()=>import_bun.default,Deno:()=>import_deno.default,Web:()=>import_web.default});module.exports=__toCommonJS(setup_exports);var import_bun=__toESM(require("./bun"),1),import_deno=__toESM(require("./deno"),1),import_web=__toESM(require("./web"),1);__reExport(setup_exports,require("./node"),module.exports);0&&(module.exports={Bun,Deno,Web,...require("./node")});
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default"));var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var setup_exports={};module.exports=__toCommonJS(setup_exports);__reExport(setup_exports,require("./bun"),module.exports);__reExport(setup_exports,require("./deno"),module.exports);__reExport(setup_exports,require("./web"),module.exports);__reExport(setup_exports,require("./node"),module.exports);0&&(module.exports={...require("./bun"),...require("./deno"),...require("./web"),...require("./node")});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var web_exports={};__export(web_exports,{default:()=>Web});module.exports=__toCommonJS(web_exports);function Web(settings){return settings}
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var web_exports={};__export(web_exports,{Web:()=>Web});module.exports=__toCommonJS(web_exports);function Web(settings){return settings}0&&(module.exports={Web});
//# sourceMappingURL=web.js.map

@@ -1,2 +0,2 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var types_exports={};__export(types_exports,{ClientLimitedMessageComponent:()=>ClientLimitedMessageComponent,ClientMessage:()=>ClientMessage,ContactComponent:()=>ContactComponent,ContactMultipleComponent:()=>ContactMultipleComponent,ContactUniqueComponent:()=>ContactUniqueComponent,Section:()=>Section});module.exports=__toCommonJS(types_exports);class ClientMessage{_build(){return JSON.stringify(this)}}class ClientLimitedMessageComponent{constructor(p,c,a,n){if(a.length>n)throw new Error(`${p} can't have more than ${n} ${c}`)}}class Section extends ClientLimitedMessageComponent{title;constructor(name,keys_name,elements,max,title,title_length=24){if(super(name,keys_name,elements,max),title){if(title.length>title_length)throw new Error(`${name} title must be ${title_length} characters or less`);this.title=title}}}class ContactComponent{_build(){return this}}class ContactMultipleComponent extends ContactComponent{get _many(){return!0}}class ContactUniqueComponent extends ContactComponent{get _many(){return!1}}0&&(module.exports={ClientLimitedMessageComponent,ClientMessage,ContactComponent,ContactMultipleComponent,ContactUniqueComponent,Section});
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var types_exports={};__export(types_exports,{ClientLimitedMessageComponent:()=>ClientLimitedMessageComponent,ClientMessage:()=>ClientMessage,ContactComponent:()=>ContactComponent,ContactMultipleComponent:()=>ContactMultipleComponent,ContactUniqueComponent:()=>ContactUniqueComponent,DEFAULT_API_VERSION:()=>DEFAULT_API_VERSION,Section:()=>Section});module.exports=__toCommonJS(types_exports);const DEFAULT_API_VERSION="v19.0";class ClientMessage{_build(){return JSON.stringify(this)}}class ClientLimitedMessageComponent{constructor(p,c,a,n){if(a.length>n)throw new Error(`${p} can't have more than ${n} ${c}`)}}class Section extends ClientLimitedMessageComponent{title;constructor(name,keys_name,elements,max,title,title_length=24){if(super(name,keys_name,elements,max),title){if(title.length>title_length)throw new Error(`${name} title must be ${title_length} characters or less`);this.title=title}}}class ContactComponent{_build(){return this}}class ContactMultipleComponent extends ContactComponent{get _many(){return!0}}class ContactUniqueComponent extends ContactComponent{get _many(){return!1}}0&&(module.exports={ClientLimitedMessageComponent,ClientMessage,ContactComponent,ContactMultipleComponent,ContactUniqueComponent,DEFAULT_API_VERSION,Section});
//# sourceMappingURL=types.js.map

@@ -1,2 +0,2 @@

import{escapeUnicode}from"./utils.js";class WhatsAppAPI{token;appSecret;webhookVerifyToken;v;fetch;subtle;parsed;offload_functions;secure;on={};constructor({token,appSecret,webhookVerifyToken,v="v19.0",parsed=!0,offload_functions=!0,secure=!0,ponyfill={}}){if(this.token=token,this.secure=!!secure,this.secure){if(this.appSecret=appSecret,typeof ponyfill.subtle!="object"&&(typeof crypto!="object"||typeof crypto?.subtle!="object"))throw new Error("subtle is not defined in the enviroment. Consider using a setup helper, defined at 'whatsapp-api-js/setup', or provide a valid ponyfill object with the argument 'ponyfill.subtle'.");this.subtle=ponyfill.subtle||crypto.subtle}if(webhookVerifyToken&&(this.webhookVerifyToken=webhookVerifyToken),typeof ponyfill.fetch!="function"&&typeof fetch!="function")throw new Error("fetch is not defined in the enviroment. Consider using a setup helper, defined at 'whatsapp-api-js/setup', or provide a valid ponyfill object with the argument 'ponyfill.fetch'.");this.fetch=ponyfill.fetch||fetch,this.v=v,this.parsed=!!parsed,this.offload_functions=!!offload_functions}async sendMessage(phoneID,to,message,context,biz_opaque_callback_data){const type=message._type,request={messaging_product:"whatsapp",type,to};request[type]=message._build(),context&&(request.context={message_id:context}),biz_opaque_callback_data&&(request.biz_opaque_callback_data=biz_opaque_callback_data);const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/messages`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify(request)}),response=this.parsed?await(await promise).json():void 0,args={phoneID,to,type,message,request,id:response&&"messages"in response?response.messages[0].id:void 0,response};return this.user_function(this.on?.sent,args),response??promise}async broadcastMessage(phoneID,to,message,batch_size=50,delay=1e3){const responses=[];if(batch_size<1)throw new RangeError("batch_size must be greater than 0");if(delay<0)throw new RangeError("delay must be greater or equal to 0");for(let i=0;i<to.length;i+=batch_size){i!==0&&await new Promise(resolve=>setTimeout(resolve,delay));for(const u of to.slice(i,i+batch_size))responses.push(this.sendMessage(phoneID,u,message))}return responses}async markAsRead(phoneID,messageId){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/messages`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify({messaging_product:"whatsapp",status:"read",message_id:messageId})});return this.getBody(promise)}async createQR(phoneID,message,format="png"){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls?generate_qr_image=${format}&prefilled_message=${message}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async retrieveQR(phoneID,id){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id??""}`,{headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async updateQR(phoneID,id,message){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id}?prefilled_message=${message}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async deleteQR(phoneID,id){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id}`,{method:"DELETE",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async retrieveMedia(id,phoneID){const params=phoneID?`phone_number_id=${phoneID}`:"",promise=this.fetch(`https://graph.facebook.com/${this.v}/${id}?${params}`,{headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async uploadMedia(phoneID,form,check=!0){if(check){if(!form||typeof form!="object"||!("get"in form)||typeof form.get!="function")throw new TypeError("File's Form must be an instance of FormData");const file=form.get("file");if(!file.type)throw new Error("File's Blob must have a type specified");if(!["audio/aac","audio/mp4","audio/mpeg","audio/amr","audio/ogg","text/plain","application/pdf","application/vnd.ms-powerpoint","application/msword","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","image/jpeg","image/png","video/mp4","video/3gp","image/webp"].includes(file.type))throw new Error(`Invalid media type: ${file.type}`);const validMediaSizes={audio:16e6,text:1e8,application:1e8,image:5e6,video:16e6,sticker:5e5},mediaType=file.type==="image/webp"?"sticker":file.type.split("/")[0];if(file.size&&file.size>validMediaSizes[mediaType])throw new Error(`File is too big (${file.size} bytes) for a ${mediaType} (${validMediaSizes[mediaType]} bytes limit)`)}const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/media?messaging_product=whatsapp`,{method:"POST",body:form,headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"multipart/form-data"}});return this.getBody(promise)}fetchMedia(url){return this._authenicatedRequest(new URL(url))}async deleteMedia(id,phoneID){const params=phoneID?`phone_number_id=${phoneID}`:"",promise=this.fetch(`https://graph.facebook.com/${this.v}/${id}?${params}`,{method:"DELETE",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async post(data,raw_body,signature){if(this.secure){if(!this.appSecret)throw 500;if(!this.subtle)throw 501;if(!raw_body)throw 400;if(signature=signature?.split("sha256=")[1],!signature)throw 401;const encoder=new TextEncoder,keyBuffer=encoder.encode(this.appSecret),key=await this.subtle.importKey("raw",keyBuffer,{name:"HMAC",hash:"SHA-256"},!0,["sign","verify"]),data2=encoder.encode(escapeUnicode(raw_body)),result=await this.subtle.sign("HMAC",key,data2.buffer),check=Array.from(new Uint8Array(result)).map(b=>b.toString(16).padStart(2,"0")).join("");if(signature!==check)throw 401}if(!data.object)throw 400;const value=data.entry[0].changes[0].value,phoneID=value.metadata.phone_number_id;if("messages"in value){const message=value.messages[0],contact=value.contacts?.[0],from=contact?.wa_id??message.from,name=contact?.profile.name,args={phoneID,from,message,name,raw:data,reply:(response,context=!1,biz_opaque_callback_data)=>this.sendMessage(phoneID,from,response,context?message.id:void 0,biz_opaque_callback_data),Whatsapp:this};this.user_function(this.on?.message,args)}else if("statuses"in value){const statuses=value.statuses[0],phone=statuses.recipient_id,status=statuses.status,id=statuses.id,conversation=statuses.conversation,pricing=statuses.pricing,error=statuses.errors?.[0],biz_opaque_callback_data=statuses.biz_opaque_callback_data,args={phoneID,phone,status,id,conversation,pricing,error,biz_opaque_callback_data,raw:data};this.user_function(this.on?.status,args)}return 200}get(params){if(!this.webhookVerifyToken)throw 500;const{"hub.mode":mode,"hub.verify_token":token,"hub.challenge":challenge}=params;if(!mode||!token)throw 400;if(mode==="subscribe"&&token===this.webhookVerifyToken)return challenge;throw 403}_authenicatedRequest(url){if(!url)throw new Error("URL must be specified");return this.fetch(url,{headers:{Authorization:`Bearer ${this.token}`}})}async getBody(promise){return this.parsed?await(await promise).json():promise}user_function(f,...a){f&&(this.offload_functions?this.offload(f,...a):f(...a))}offload(f,...a){Promise.resolve().then(()=>f(...a))}}export{WhatsAppAPI as default};
import{escapeUnicode}from"./utils.js";import{DEFAULT_API_VERSION}from"./types.js";class WhatsAppAPI{token;appSecret;webhookVerifyToken;v;fetch;subtle;parsed;offload_functions;secure;on={};constructor({token,appSecret,webhookVerifyToken,v,parsed=!0,offload_functions=!0,secure=!0,ponyfill={}}){if(this.token=token,this.secure=!!secure,this.secure){if(this.appSecret=appSecret,typeof ponyfill.subtle!="object"&&(typeof crypto!="object"||typeof crypto?.subtle!="object"))throw new Error("subtle is not defined in the enviroment. Consider using a setup helper, defined at 'whatsapp-api-js/setup', or provide a valid ponyfill object with the argument 'ponyfill.subtle'.");this.subtle=ponyfill.subtle||crypto.subtle}if(webhookVerifyToken&&(this.webhookVerifyToken=webhookVerifyToken),typeof ponyfill.fetch!="function"&&typeof fetch!="function")throw new Error("fetch is not defined in the enviroment. Consider using a setup helper, defined at 'whatsapp-api-js/setup', or provide a valid ponyfill object with the argument 'ponyfill.fetch'.");this.fetch=ponyfill.fetch||fetch,v?this.v=v:(console.warn(`[whatsapp-api-js] Cloud API version not defined. In production, it's strongly recommended pinning it to the desired version with the "v" argument. Defaulting to "${DEFAULT_API_VERSION}".`),this.v=DEFAULT_API_VERSION),this.parsed=!!parsed,this.offload_functions=!!offload_functions}async sendMessage(phoneID,to,message,context,biz_opaque_callback_data){const type=message._type,request={messaging_product:"whatsapp",type,to};request[type]=message._build(),context&&(request.context={message_id:context}),biz_opaque_callback_data&&(request.biz_opaque_callback_data=biz_opaque_callback_data);const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/messages`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify(request)}),response=this.parsed?await(await promise).json():void 0,args={phoneID,to,type,message,request,id:response&&"messages"in response?response.messages[0].id:void 0,response};return this.user_function(this.on?.sent,args),response??promise}async broadcastMessage(phoneID,to,message,batch_size=50,delay=1e3){const responses=[];if(batch_size<1)throw new RangeError("batch_size must be greater than 0");if(delay<0)throw new RangeError("delay must be greater or equal to 0");for(let i=0;i<to.length;i+=batch_size){i!==0&&await new Promise(resolve=>setTimeout(resolve,delay));for(const u of to.slice(i,i+batch_size))responses.push(this.sendMessage(phoneID,u,message))}return responses}async markAsRead(phoneID,messageId){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/messages`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify({messaging_product:"whatsapp",status:"read",message_id:messageId})});return this.getBody(promise)}async createQR(phoneID,message,format="png"){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls?generate_qr_image=${format}&prefilled_message=${message}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async retrieveQR(phoneID,id){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id??""}`,{headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async updateQR(phoneID,id,message){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id}?prefilled_message=${message}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async deleteQR(phoneID,id){const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/message_qrdls/${id}`,{method:"DELETE",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async retrieveMedia(id,phoneID){const params=phoneID?`phone_number_id=${phoneID}`:"",promise=this.fetch(`https://graph.facebook.com/${this.v}/${id}?${params}`,{headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async uploadMedia(phoneID,form,check=!0){if(check){if(!form||typeof form!="object"||!("get"in form)||typeof form.get!="function")throw new TypeError("File's Form must be an instance of FormData");const file=form.get("file");if(!file.type)throw new Error("File's Blob must have a type specified");if(!["audio/aac","audio/mp4","audio/mpeg","audio/amr","audio/ogg","text/plain","application/pdf","application/vnd.ms-powerpoint","application/msword","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","image/jpeg","image/png","video/mp4","video/3gp","image/webp"].includes(file.type))throw new Error(`Invalid media type: ${file.type}`);const validMediaSizes={audio:16e6,text:1e8,application:1e8,image:5e6,video:16e6,sticker:5e5},mediaType=file.type==="image/webp"?"sticker":file.type.split("/")[0];if(file.size&&file.size>validMediaSizes[mediaType])throw new Error(`File is too big (${file.size} bytes) for a ${mediaType} (${validMediaSizes[mediaType]} bytes limit)`)}const promise=this.fetch(`https://graph.facebook.com/${this.v}/${phoneID}/media?messaging_product=whatsapp`,{method:"POST",body:form,headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"multipart/form-data"}});return this.getBody(promise)}fetchMedia(url){return this._authenicatedRequest(new URL(url))}async deleteMedia(id,phoneID){const params=phoneID?`phone_number_id=${phoneID}`:"",promise=this.fetch(`https://graph.facebook.com/${this.v}/${id}?${params}`,{method:"DELETE",headers:{Authorization:`Bearer ${this.token}`}});return this.getBody(promise)}async post(data,raw_body,signature){if(this.secure){if(!this.appSecret)throw 500;if(!this.subtle)throw 501;if(!raw_body)throw 400;if(signature=signature?.split("sha256=")[1],!signature)throw 401;const encoder=new TextEncoder,keyBuffer=encoder.encode(this.appSecret),key=await this.subtle.importKey("raw",keyBuffer,{name:"HMAC",hash:"SHA-256"},!0,["sign","verify"]),data2=encoder.encode(escapeUnicode(raw_body)),result=await this.subtle.sign("HMAC",key,data2.buffer),check=Array.from(new Uint8Array(result)).map(b=>b.toString(16).padStart(2,"0")).join("");if(signature!==check)throw 401}if(!data.object)throw 400;const value=data.entry[0].changes[0].value,phoneID=value.metadata.phone_number_id;if("messages"in value){const message=value.messages[0],contact=value.contacts?.[0],from=contact?.wa_id??message.from,name=contact?.profile.name,args={phoneID,from,message,name,raw:data,reply:(response,context=!1,biz_opaque_callback_data)=>this.sendMessage(phoneID,from,response,context?message.id:void 0,biz_opaque_callback_data),Whatsapp:this};this.user_function(this.on?.message,args)}else if("statuses"in value){const statuses=value.statuses[0],phone=statuses.recipient_id,status=statuses.status,id=statuses.id,conversation=statuses.conversation,pricing=statuses.pricing,error=statuses.errors?.[0],biz_opaque_callback_data=statuses.biz_opaque_callback_data,args={phoneID,phone,status,id,conversation,pricing,error,biz_opaque_callback_data,raw:data};this.user_function(this.on?.status,args)}return 200}get(params){if(!this.webhookVerifyToken)throw 500;const{"hub.mode":mode,"hub.verify_token":token,"hub.challenge":challenge}=params;if(!mode||!token)throw 400;if(mode==="subscribe"&&token===this.webhookVerifyToken)return challenge;throw 403}_authenicatedRequest(url){if(!url)throw new Error("URL must be specified");return this.fetch(url,{headers:{Authorization:`Bearer ${this.token}`}})}async getBody(promise){return this.parsed?await(await promise).json():promise}user_function(f,...a){f&&(this.offload_functions?this.offload(f,...a):f(...a))}offload(f,...a){Promise.resolve().then(()=>f(...a))}}export{WhatsAppAPI};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import{ClientMessage,ClientLimitedMessageComponent,Section}from"../types.js";import{isProductSections}from"./globals.js";class Interactive extends ClientMessage{action;body;header;footer;type;get _type(){return"interactive"}constructor(action,body,header,footer){if(super(),action._type!=="product"&&!body)throw new Error("Interactive must have a body component");if(action._type==="product"&&header)throw new Error("Interactive must not have a header component if action is a single product");if(action._type==="product_list"&&header?.type!=="text")throw new Error("Interactive must have a text header component if action is a product list");if(header&&action._type!=="button"&&header?.type!=="text")throw new Error("Interactive header must be of type text");this.type=action._type,this.action=action,body&&(this.body=body),header&&(this.header=header),footer&&(this.footer=footer)}}class Body{text;constructor(text){if(text.length>1024)throw new Error("Body text must be less than 1024 characters");this.text=text}}class Footer{text;constructor(text){if(text.length>60)throw new Error("Footer text must be 60 characters or less");this.text=text}}class Header{type;text;image;document;video;constructor(object){if(typeof object=="string"){if(object.length>60)throw new Error("Header text must be 60 characters or less");this.type="text"}else if(this.type=object._type,object.caption)throw new Error(`Header ${this.type} must not have a caption`);this[this.type]=object}}class ActionButtons extends ClientLimitedMessageComponent{buttons;get _type(){return"button"}constructor(...button){super("Reply buttons","button",button,3);const ids=button.map(b=>b[b.type].id);if(ids.length!==new Set(ids).size)throw new Error("Reply buttons must have unique ids");const titles=button.map(b=>b[b.type].title);if(titles.length!==new Set(titles).size)throw new Error("Reply buttons must have unique titles");this.buttons=button}}class Button{type;reply;constructor(id,title){if(id.length>256)throw new Error("Button id must be 256 characters or less");if(/^ | $/.test(id))throw new Error("Button id cannot have leading or trailing spaces");if(!title.length)throw new Error("Button title cannot be an empty string");if(title.length>20)throw new Error("Button title must be 20 characters or less");this.type="reply",this.reply={title,id}}}class ActionList extends ClientLimitedMessageComponent{button;sections;get _type(){return"list"}constructor(button,...sections){if(super("Action","sections",sections,10),!button.length)throw new Error("Button content cannot be an empty string");if(button.length>20)throw new Error("Button content must be 20 characters or less");if(sections.length>1&&!sections.every(obj=>!!obj.title))throw new Error("All sections must have a title if more than 1 section is provided");this.button=button,this.sections=sections}}class ListSection extends Section{rows;constructor(title,...rows){super("ListSection","rows",rows,10,title),this.rows=rows}}class Row{id;title;description;constructor(id,title,description){if(id.length>200)throw new Error("Row id must be 200 characters or less");if(title.length>24)throw new Error("Row title must be 24 characters or less");if(description&&description.length>72)throw new Error("Row description must be 72 characters or less");this.id=id,this.title=title,description&&(this.description=description)}}class ActionCatalog{name;parameters;get _type(){return"catalog_message"}constructor(thumbnail){this.name="catalog_message",thumbnail&&(this.parameters={thumbnail_product_retailer_id:thumbnail.product_retailer_id})}}class ActionProduct{catalog_id;product_retailer_id;sections;get _type(){return this.product_retailer_id?"product":"product_list"}constructor(catalog_id,...products){const is_sections=isProductSections(products);if(is_sections&&products.length>1){if(products.length>10)throw new Error("Catalog must have between 1 and 10 product sections");for(const obj of products)if(!obj.title)throw new Error("All sections must have a title if more than 1 section is provided")}this.catalog_id=catalog_id,is_sections?this.sections=products:this.product_retailer_id=products[0].product_retailer_id}}class ActionCTA{name="cta_url";parameters;get _type(){return"cta_url"}constructor(display_text,url){this.parameters={display_text,url}}}class ActionFlow{name="flow";parameters;get _type(){return"flow"}constructor(parameters){if(!parameters.flow_cta.length||parameters.flow_cta.length>20)throw new Error("Flow CTA must be between 1 and 20 characters");if(/\p{Extended_Pictographic}/u.test(parameters.flow_cta))throw new Error("Flow CTA must not contain emoji");this.parameters=parameters}}class ActionNavigateFlow extends ActionFlow{constructor(flow_token,flow_id,flow_cta,screen,data,mode="published",flow_message_version="3"){if(super({mode,flow_message_version,flow_token,flow_id,flow_cta,flow_action:"navigate",flow_action_payload:{screen,data}}),data&&!Object.keys(data))throw new Error("Flow data must be a non-empty object if provided")}}class ActionDataExchangeFlow extends ActionFlow{constructor(flow_token,flow_id,flow_cta,mode="published",flow_message_version="3"){super({mode,flow_message_version,flow_token,flow_id,flow_cta,flow_action:"data_exchange"})}}class ActionLocation{name="send_location";get _type(){return"location_request_message"}}export{ActionButtons,ActionCTA,ActionCatalog,ActionDataExchangeFlow,ActionFlow,ActionList,ActionLocation,ActionNavigateFlow,ActionProduct,Body,Button,Footer,Header,Interactive,ListSection,Row};
import{ClientMessage,ClientLimitedMessageComponent,Section}from"../types.js";class Interactive extends ClientMessage{action;body;header;footer;type;get _type(){return"interactive"}constructor(action,body,header,footer){if(super(),header&&["list","product_list","cta_url","flow"].includes(action._type)&&header.type!=="text")throw new Error(`Header of type text is required for ${action._type} action`);this.type=action._type,this.action=action,body&&(this.body=body),header&&(this.header=header),footer&&(this.footer=footer)}}class Body{text;constructor(text){if(text.length>1024)throw new Error("Body text must be less than 1024 characters");this.text=text}}class Footer{text;constructor(text){if(text.length>60)throw new Error("Footer text must be 60 characters or less");this.text=text}}class Header{type;text;image;document;video;constructor(object){if(typeof object=="string"){if(object.length>60)throw new Error("Header text must be 60 characters or less");this.type="text"}else if(this.type=object._type,object.caption)throw new Error(`Header ${this.type} must not have a caption`);this[this.type]=object}}class ActionButtons extends ClientLimitedMessageComponent{buttons;get _type(){return"button"}constructor(...button){super("Reply buttons","button",button,3);const ids=button.map(b=>b[b.type].id);if(ids.length!==new Set(ids).size)throw new Error("Reply buttons must have unique ids");const titles=button.map(b=>b[b.type].title);if(titles.length!==new Set(titles).size)throw new Error("Reply buttons must have unique titles");this.buttons=button}}class Button{type;reply;constructor(id,title){if(id.length>256)throw new Error("Button id must be 256 characters or less");if(/^ | $/.test(id))throw new Error("Button id cannot have leading or trailing spaces");if(!title.length)throw new Error("Button title cannot be an empty string");if(title.length>20)throw new Error("Button title must be 20 characters or less");this.type="reply",this.reply={title,id}}}class ActionList extends ClientLimitedMessageComponent{button;sections;get _type(){return"list"}constructor(button,...sections){if(super("Action","sections",sections,10),!button.length)throw new Error("Button content cannot be an empty string");if(button.length>20)throw new Error("Button content must be 20 characters or less");if(sections.length>1&&!sections.every(obj=>!!obj.title))throw new Error("All sections must have a title if more than 1 section is provided");this.button=button,this.sections=sections}}class ListSection extends Section{rows;constructor(title,...rows){super("ListSection","rows",rows,10,title),this.rows=rows}}class Row{id;title;description;constructor(id,title,description){if(id.length>200)throw new Error("Row id must be 200 characters or less");if(title.length>24)throw new Error("Row title must be 24 characters or less");if(description&&description.length>72)throw new Error("Row description must be 72 characters or less");this.id=id,this.title=title,description&&(this.description=description)}}class ActionCatalog{name;parameters;get _type(){return"catalog_message"}constructor(thumbnail){this.name="catalog_message",thumbnail&&(this.parameters={thumbnail_product_retailer_id:thumbnail.product_retailer_id})}}class ActionProduct{catalog_id;product_retailer_id;get _type(){return"product"}constructor(catalog_id,product){this.catalog_id=catalog_id,this.product_retailer_id=product.product_retailer_id}}class ActionProductList extends ClientLimitedMessageComponent{catalog_id;sections;get _type(){return"product_list"}constructor(catalog_id,...sections){if(super("ActionProductList","sections",sections,10),sections.length>1){for(const obj of sections)if(!obj.title)throw new Error("All sections must have a title if more than 1 section is provided")}this.catalog_id=catalog_id,this.sections=sections}}class ActionCTA{name="cta_url";parameters;get _type(){return"cta_url"}constructor(display_text,url){this.parameters={display_text,url}}}class ActionFlow{name="flow";parameters;get _type(){return"flow"}constructor(parameters){if(!parameters.flow_cta.length||parameters.flow_cta.length>20)throw new Error("Flow CTA must be between 1 and 20 characters");if(/\p{Extended_Pictographic}/u.test(parameters.flow_cta))throw new Error("Flow CTA must not contain emoji");this.parameters=parameters}}class ActionNavigateFlow extends ActionFlow{constructor(flow_token,flow_id,flow_cta,screen,data,mode="published",flow_message_version="3"){if(super({mode,flow_message_version,flow_token,flow_id,flow_cta,flow_action:"navigate",flow_action_payload:{screen,data}}),data&&!Object.keys(data))throw new Error("Flow data must be a non-empty object if provided")}}class ActionDataExchangeFlow extends ActionFlow{constructor(flow_token,flow_id,flow_cta,mode="published",flow_message_version="3"){super({mode,flow_message_version,flow_token,flow_id,flow_cta,flow_action:"data_exchange"})}}class ActionLocation{name="send_location";get _type(){return"location_request_message"}}export{ActionButtons,ActionCTA,ActionCatalog,ActionDataExchangeFlow,ActionFlow,ActionList,ActionLocation,ActionNavigateFlow,ActionProduct,ActionProductList,Body,Button,Footer,Header,Interactive,ListSection,Row};
//# sourceMappingURL=interactive.js.map

@@ -1,2 +0,2 @@

import{ClientMessage}from"../types.js";class Location extends ClientMessage{longitude;latitude;name;address;get _type(){return"location"}constructor(longitude,latitude,name,address){super(),this.longitude=longitude,this.latitude=latitude,name&&(this.name=name),address&&(this.address=address)}}export{Location,Location as default};
import{ClientMessage}from"../types.js";class Location extends ClientMessage{longitude;latitude;name;address;get _type(){return"location"}constructor(longitude,latitude,name,address){super(),this.longitude=longitude,this.latitude=latitude,name&&(this.name=name),address&&(this.address=address)}}export{Location};
//# sourceMappingURL=location.js.map

@@ -1,2 +0,2 @@

import{ClientMessage}from"../types.js";class Reaction extends ClientMessage{message_id;emoji;get _type(){return"reaction"}constructor(message_id,emoji=""){if(super(),emoji&&!/^\p{Extended_Pictographic}$/u.test(emoji))throw new Error("Reaction emoji must be a single emoji");this.message_id=message_id,this.emoji=emoji}}export{Reaction,Reaction as default};
import{ClientMessage}from"../types.js";class Reaction extends ClientMessage{message_id;emoji;get _type(){return"reaction"}constructor(message_id,emoji=""){if(super(),emoji&&!/^\p{Extended_Pictographic}$/u.test(emoji))throw new Error("Reaction emoji must be a single emoji");this.message_id=message_id,this.emoji=emoji}}export{Reaction};
//# sourceMappingURL=reaction.js.map

@@ -1,2 +0,2 @@

import{ClientMessage}from"../types.js";class Text extends ClientMessage{body;preview_url;get _type(){return"text"}constructor(body,preview_url){if(super(),body.length>4096)throw new Error("Text body must be less than 4096 characters");this.body=body,preview_url&&(this.preview_url=preview_url)}}export{Text,Text as default};
import{ClientMessage}from"../types.js";class Text extends ClientMessage{body;preview_url;get _type(){return"text"}constructor(body,preview_url){if(super(),body.length>4096)throw new Error("Text body must be less than 4096 characters");this.body=body,preview_url&&(this.preview_url=preview_url)}}export{Text};
//# sourceMappingURL=text.js.map

@@ -1,2 +0,2 @@

import{WhatsAppAPIMiddleware}from"./globals.js";import{isInteger}from"../utils.js";class WhatsAppAPI extends WhatsAppAPIMiddleware{async handle_post(req){try{return await this.post(req.body(),req.raw()??"",req.header("x-hub-signature-256")??"")}catch(e){return isInteger(e)?e:500}}handle_get(req){try{return this.get(req.qs())}catch(e){throw isInteger(e)?e:500}}}export{WhatsAppAPI as default};
import{WhatsAppAPIMiddleware}from"./globals.js";import{isInteger}from"../utils.js";class WhatsAppAPI extends WhatsAppAPIMiddleware{async handle_post(req){try{return await this.post(req.body(),req.raw()??"",req.header("x-hub-signature-256")??"")}catch(e){return isInteger(e)?e:500}}handle_get(req){try{return this.get(req.qs())}catch(e){throw isInteger(e)?e:500}}}export{WhatsAppAPI};
//# sourceMappingURL=adonis.js.map

@@ -1,2 +0,2 @@

import WebStandardMiddleware from"./web-standard.js";class WhatsAppAPI extends WebStandardMiddleware{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}export{WhatsAppAPI as default};
import{WhatsAppAPI as WebStandardMiddleware}from"./web-standard.js";class WhatsAppAPI extends WebStandardMiddleware{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}export{WhatsAppAPI};
//# sourceMappingURL=bun.js.map

@@ -1,2 +0,2 @@

import WebStandardMiddleware from"./web-standard.js";class WhatsAppAPI extends WebStandardMiddleware{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}export{WhatsAppAPI as default};
import{WhatsAppAPI as WebStandardMiddleware}from"./web-standard.js";class WhatsAppAPI extends WebStandardMiddleware{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}export{WhatsAppAPI};
//# sourceMappingURL=deno.js.map

@@ -1,2 +0,2 @@

import{WhatsAppAPIMiddleware}from"./globals.js";import{isInteger}from"../utils.js";class WhatsAppAPI extends WhatsAppAPIMiddleware{async handle_post(req){try{return this.post(JSON.parse(req.body??"{}"),req.body,req.header("x-hub-signature-256"))}catch(e){return isInteger(e)?e:500}}handle_get(req){try{return this.get(req.query)}catch(e){throw isInteger(e)?e:500}}}export{WhatsAppAPI as default};
import{WhatsAppAPIMiddleware}from"./globals.js";import{isInteger}from"../utils.js";class WhatsAppAPI extends WhatsAppAPIMiddleware{async handle_post(req){try{return this.post(JSON.parse(req.body??"{}"),req.body,req.header("x-hub-signature-256"))}catch(e){return isInteger(e)?e:500}}handle_get(req){try{return this.get(req.query)}catch(e){throw isInteger(e)?e:500}}}export{WhatsAppAPI};
//# sourceMappingURL=express.js.map

@@ -1,2 +0,2 @@

import WhatsAppAPI from"../index.js";class WhatsAppAPIMiddleware extends WhatsAppAPI{}export{WhatsAppAPIMiddleware};
import{WhatsAppAPI}from"../index.js";class WhatsAppAPIMiddleware extends WhatsAppAPI{}export{WhatsAppAPIMiddleware};
//# sourceMappingURL=globals.js.map

@@ -1,2 +0,2 @@

import{WhatsAppAPIMiddleware}from"./globals.js";import{default as default2}from"./express.js";import{default as default3}from"./adonis.js";import{default as default4}from"./vercel.js";import{default as default5}from"./deno.js";import{default as default6}from"./bun.js";import{default as default7}from"./sveltekit.js";import{default as default8}from"./web-standard.js";import{default as default9}from"./node-http.js";export{default3 as AdonisMiddleware,default6 as BunMiddleware,default5 as DenoMiddleware,default2 as ExpressMiddleware,default9 as NodeHTTPMiddleware,default7 as SvelteKitMiddleware,default4 as VercelMiddleware,default8 as WebStandardMiddleware,WhatsAppAPIMiddleware};
import{WhatsAppAPIMiddleware}from"./globals.js";import{WhatsAppAPI}from"./express.js";import{WhatsAppAPI as WhatsAppAPI2}from"./adonis.js";import{WhatsAppAPI as WhatsAppAPI3}from"./vercel.js";import{WhatsAppAPI as WhatsAppAPI4}from"./deno.js";import{WhatsAppAPI as WhatsAppAPI5}from"./bun.js";import{WhatsAppAPI as WhatsAppAPI6}from"./sveltekit.js";import{WhatsAppAPI as WhatsAppAPI7}from"./web-standard.js";import{WhatsAppAPI as WhatsAppAPI8}from"./node-http.js";export{WhatsAppAPI2 as AdonisMiddleware,WhatsAppAPI5 as BunMiddleware,WhatsAppAPI4 as DenoMiddleware,WhatsAppAPI as ExpressMiddleware,WhatsAppAPI8 as NodeHTTPMiddleware,WhatsAppAPI6 as SvelteKitMiddleware,WhatsAppAPI3 as VercelMiddleware,WhatsAppAPI7 as WebStandardMiddleware,WhatsAppAPIMiddleware};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import{WhatsAppAPIMiddleware}from"./globals.js";import{isInteger}from"../utils.js";class WhatsAppAPI extends WhatsAppAPIMiddleware{async handle_post(req){async function parseBody(readable){const chunks=[];for await(const chunk of readable)chunks.push(typeof chunk=="string"?Buffer.from(chunk):chunk);return Buffer.concat(chunks).toString("utf-8")}try{const body=await parseBody(req),signature=req.headers["x-hub-signature-256"];if(typeof signature!="string")throw 400;return this.post(JSON.parse(body||"{}"),body,signature)}catch(e){return isInteger(e)?e:500}}handle_get(req){try{return this.get(Object.fromEntries(new URL(req.url,`http://${req.headers.host}`).searchParams))}catch(e){throw isInteger(e)?e:500}}}export{WhatsAppAPI as default};
import{WhatsAppAPIMiddleware}from"./globals.js";import{isInteger}from"../utils.js";class WhatsAppAPI extends WhatsAppAPIMiddleware{async handle_post(req){async function parseBody(readable){const chunks=[];for await(const chunk of readable)chunks.push(typeof chunk=="string"?Buffer.from(chunk):chunk);return Buffer.concat(chunks).toString("utf-8")}try{const body=await parseBody(req),signature=req.headers["x-hub-signature-256"];if(typeof signature!="string")throw 400;return this.post(JSON.parse(body||"{}"),body,signature)}catch(e){return isInteger(e)?e:500}}handle_get(req){try{return this.get(Object.fromEntries(new URL(req.url,`http://${req.headers.host}`).searchParams))}catch(e){throw isInteger(e)?e:500}}}export{WhatsAppAPI};
//# sourceMappingURL=node-http.js.map

@@ -1,2 +0,2 @@

import WebStandardMiddleware from"./web-standard.js";class WhatsAppAPI extends WebStandardMiddleware{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}export{WhatsAppAPI as default};
import{WhatsAppAPI as WebStandardMiddleware}from"./web-standard.js";class WhatsAppAPI extends WebStandardMiddleware{async handle_post(req){return super.handle_post(req)}handle_get(req){return super.handle_get(req)}}export{WhatsAppAPI};
//# sourceMappingURL=sveltekit.js.map

@@ -1,2 +0,2 @@

import NodeHTTPMiddleware from"./node-http.js";import{isInteger}from"../utils.js";class WhatsAppAPI extends NodeHTTPMiddleware{handle_post(req){return super.handle_post(req)}handle_get(req){try{return this.get(req.query)}catch(e){throw isInteger(e)?e:500}}}export{WhatsAppAPI as default};
import{WhatsAppAPI as NodeHTTPMiddleware}from"./node-http.js";import{isInteger}from"../utils.js";class WhatsAppAPI extends NodeHTTPMiddleware{handle_post(req){return super.handle_post(req)}handle_get(req){try{return this.get(req.query)}catch(e){throw isInteger(e)?e:500}}}export{WhatsAppAPI};
//# sourceMappingURL=vercel.js.map

@@ -1,2 +0,2 @@

import{WhatsAppAPIMiddleware}from"./globals.js";import{isInteger}from"../utils.js";class WhatsAppAPI extends WhatsAppAPIMiddleware{async handle_post(req){try{const body=await req.text();return this.post(JSON.parse(body||"{}"),body,req.headers.get("x-hub-signature-256")??"")}catch(e){return isInteger(e)?e:500}}handle_get(req){try{return this.get(Object.fromEntries(new URL(req.url).searchParams))}catch(e){throw isInteger(e)?e:500}}}export{WhatsAppAPI as default};
import{WhatsAppAPIMiddleware}from"./globals.js";import{isInteger}from"../utils.js";class WhatsAppAPI extends WhatsAppAPIMiddleware{async handle_post(req){try{const body=await req.text();return this.post(JSON.parse(body||"{}"),body,req.headers.get("x-hub-signature-256")??"")}catch(e){return isInteger(e)?e:500}}handle_get(req){try{return this.get(Object.fromEntries(new URL(req.url).searchParams))}catch(e){throw isInteger(e)?e:500}}}export{WhatsAppAPI};
//# sourceMappingURL=web-standard.js.map

@@ -1,2 +0,2 @@

function Bun(settings){return settings}export{Bun as default};
function Bun(settings){return settings}export{Bun};
//# sourceMappingURL=bun.js.map

@@ -1,2 +0,2 @@

function Deno(settings){return settings}export{Deno as default};
function Deno(settings){return settings}export{Deno};
//# sourceMappingURL=deno.js.map

@@ -1,2 +0,2 @@

import{default as default2}from"./bun";import{default as default3}from"./deno";import{default as default4}from"./web";export*from"./node";export{default2 as Bun,default3 as Deno,default4 as Web};
export*from"./bun";export*from"./deno";export*from"./web";export*from"./node";
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

function Web(settings){return settings}export{Web as default};
function Web(settings){return settings}export{Web};
//# sourceMappingURL=web.js.map

@@ -1,2 +0,2 @@

class ClientMessage{_build(){return JSON.stringify(this)}}class ClientLimitedMessageComponent{constructor(p,c,a,n){if(a.length>n)throw new Error(`${p} can't have more than ${n} ${c}`)}}class Section extends ClientLimitedMessageComponent{title;constructor(name,keys_name,elements,max,title,title_length=24){if(super(name,keys_name,elements,max),title){if(title.length>title_length)throw new Error(`${name} title must be ${title_length} characters or less`);this.title=title}}}class ContactComponent{_build(){return this}}class ContactMultipleComponent extends ContactComponent{get _many(){return!0}}class ContactUniqueComponent extends ContactComponent{get _many(){return!1}}export{ClientLimitedMessageComponent,ClientMessage,ContactComponent,ContactMultipleComponent,ContactUniqueComponent,Section};
const DEFAULT_API_VERSION="v19.0";class ClientMessage{_build(){return JSON.stringify(this)}}class ClientLimitedMessageComponent{constructor(p,c,a,n){if(a.length>n)throw new Error(`${p} can't have more than ${n} ${c}`)}}class Section extends ClientLimitedMessageComponent{title;constructor(name,keys_name,elements,max,title,title_length=24){if(super(name,keys_name,elements,max),title){if(title.length>title_length)throw new Error(`${name} title must be ${title_length} characters or less`);this.title=title}}}class ContactComponent{_build(){return this}}class ContactMultipleComponent extends ContactComponent{get _many(){return!0}}class ContactUniqueComponent extends ContactComponent{get _many(){return!1}}export{ClientLimitedMessageComponent,ClientMessage,ContactComponent,ContactMultipleComponent,ContactUniqueComponent,DEFAULT_API_VERSION,Section};
//# sourceMappingURL=types.js.map
import type { ClientMessage, ClientMessageRequest, ServerMessage, ServerMessageResponse, ServerConversation, ServerPricing, ServerError, PostData } from "./types";
import type WhatsAppAPI from "./index";
import type { WhatsAppAPI } from "./index";
/**

@@ -4,0 +4,0 @@ * Callback for "sent" event

@@ -7,3 +7,3 @@ /** @module WhatsAppAPI */

*/
export default class WhatsAppAPI {
export declare class WhatsAppAPI {
/**

@@ -89,4 +89,4 @@ * The API token

* ```ts
* import WhatsAppAPI from "whatsapp-api-js";
* import Text from "whatsapp-api-js/messages/text";
* import { WhatsAppAPI } from "whatsapp-api-js";
* import { Text } from "whatsapp-api-js/messages/text";
*

@@ -126,4 +126,4 @@ * const Whatsapp = new WhatsAppAPI({

* ```ts
* import WhatsAppAPI from "whatsapp-api-js";
* import Text from "whatsapp-api-js/messages/text";
* import { WhatsAppAPI } from "whatsapp-api-js";
* import { Text } from "whatsapp-api-js/messages/text";
*

@@ -216,3 +216,3 @@ * const Whatsapp = new WhatsAppAPI({

* ```ts
* import WhatsAppAPI from "whatsapp-api-js";
* import { WhatsAppAPI } from "whatsapp-api-js";
*

@@ -252,3 +252,3 @@ * const token = "token";

* ```ts
* import WhatsAppAPI from "whatsapp-api-js";
* import { WhatsAppAPI } from "whatsapp-api-js";
*

@@ -282,3 +282,3 @@ * const token = "token";

* // Simple http example implementation with Whatsapp.post() on Node@^19
* import WhatsAppAPI from "whatsapp-api-js";
* import { WhatsAppAPI } from "whatsapp-api-js";
* import { NodeNext } from "whatsapp-api-js/setup/node";

@@ -285,0 +285,0 @@ *

@@ -6,2 +6,3 @@ import { Section } from "../types.js";

* @internal
* @deprecated - Unused with the release of ActionProductList
*/

@@ -8,0 +9,0 @@ export declare function isProductSections(obj: unknown[]): obj is ProductSection[];

@@ -12,15 +12,15 @@ import { ClientMessage, ClientLimitedMessageComponent, Section, type InteractiveAction } from "../types.js";

/**
* The action component of the interactive message
* The action for the interactive message
*/
readonly action: InteractiveAction;
/**
* The body component of the interactive message
* The body for the interactive message
*/
readonly body?: Body;
/**
* The header component of the interactive message
* The header for the interactive message
*/
readonly header?: Header;
/**
* The footer component of the interactive message
* The footer for the interactive message
*/

@@ -38,14 +38,75 @@ readonly footer?: Footer;

/**
* Create an Interactive object for the API
* Creates an Interactive Reply Buttons object for the API
*
* @param action - The action component of the interactive message
* @param body - The body component of the interactive message, it may be undefined if not needed.
* @param header - The header component of the interactive message, it may be undefined if not needed.
* @param footer - The footer component of the interactive message, it may be undefined if not needed.
* @throws If body is not provided, unless action is an {@link ActionProduct} with a single product
* @throws If header is provided for an {@link ActionProduct} with a single product
* @throws If header of type text is not provided for an {@link ActionProduct} with a product list
* @throws If header is not of type text, unless action is an {@link ActionButtons}
* @param action - The action for the interactive message
* @param body - The body for the interactive message
* @param header - The header for the interactive message, it may be undefined if not needed
* @param footer - The footer for the interactive message, it may be undefined if not needed
*/
constructor(action: InteractiveAction, body?: Body, header?: Header, footer?: Footer);
constructor(action: ActionButtons, body: Body, header?: Header, footer?: Footer);
/**
* Creates an Interactive List object for the API
*
* @param action - The action for the interactive message
* @param body - The body for the interactive message
* @param header - The header of type text for the interactive message, it may be undefined if not needed
* @param footer - The footer for the interactive message, it may be undefined if not needed
* @throws If a header is provided and it's not of type "text"
*/
constructor(action: ActionList, body: Body, header?: Header, footer?: Footer);
/**
* Creates an Interactive Catalog object for the API
*
* @param action - The action for the interactive message
* @param body - The body for the interactive message
* @param header - Undefined
* @param footer - The footer for the interactive message, it may be undefined if not needed
*/
constructor(action: ActionCatalog, body: Body, header?: undefined, footer?: Footer);
/**
* Creates an Interactive Single Product object for the API
*
* @param action - The action for the interactive message
* @param body - The body for the interactive message
* @param header - Undefined
* @param footer - The footer for the interactive message, it may be undefined if not needed
*/
constructor(action: ActionProduct, body?: Body, header?: undefined, footer?: Footer);
/**
* Creates an Interactive Multi Product object for the API
*
* @param action - The action for the interactive message
* @param body - The body for the interactive message
* @param header - The header of type text for the interactive message
* @param footer - The footer for the interactive message, it may be undefined if not needed
* @throws If header is not of type "text"
*/
constructor(action: ActionProductList, body: Body, header: Header, footer?: Footer);
/**
* Creates an Interactive CTA object for the API
*
* @param action - The action for the interactive message
* @param body - The body for the interactive message
* @param header - The header of type text for the interactive message, it may be undefined if not needed
* @param footer - The footer for the interactive message, it may be undefined if not needed
* @throws If a header is provided and it's not of type "text"
*/
constructor(action: ActionCTA, body: Body, header?: Header, footer?: Footer);
/**
* Creates an Interactive Flow object for the API
*
* @param action - The action for the interactive message
* @param body - The body for the interactive message
* @param header - The header of type text for the interactive message, it may be undefined if not needed
* @param footer - The footer for the interactive message, it may be undefined if not needed
* @throws If a header is provided and it's not of type "text"
*/
constructor(action: ActionFlow, body: Body, header?: Header, footer?: Footer);
/**
* Creates an Interactive Flow object for the API
*
* @param action - The action for the interactive message
* @param body - The body of the interactive message
*/
constructor(action: ActionLocation, body: Body);
}

@@ -310,23 +371,46 @@ /**

/**
* The product to be added to the catalog
* The product to show in the message
*/
readonly product_retailer_id?: string;
readonly product_retailer_id: string;
/**
* The section to be added to the catalog
* @override
* @internal
*/
readonly sections?: ProductSection[];
get _type(): "product";
/**
* Builds a Single Product component for an Interactive message
*
* @param catalog_id - The catalog id
* @param product - The product to show in the message
*/
constructor(catalog_id: string, product: Product);
}
/**
* Action API object
*
* @group Interactive
*/
export declare class ActionProductList extends ClientLimitedMessageComponent<ProductSection, 10> implements InteractiveAction {
/**
* The id of the catalog from where to get the products
*/
readonly catalog_id: string;
/**
* The sections to show in the message
*/
readonly sections: ProductSection[];
/**
* @override
* @internal
*/
get _type(): "product" | "product_list";
get _type(): "product_list";
/**
* Builds a Multi or Single Product component for an Interactive message
* Builds a Multi Product component for an Interactive message
*
* @param catalog_id - The catalog id
* @param products - The products to add to the catalog. It can be a _single_ Product object, or a list of ProductSections.
* @throws If products is a product list and more than 10 sections are provided
* @throws If products is a product list with more than 1 section and at least one section is missing a title
* @param sections - The product sections to show in the message
* @throws If more than 10 product sections are provided
* @throws If more than 1 product section is provided and at least one section is missing a title
*/
constructor(catalog_id: string, ...products: [Product] | AtLeastOne<ProductSection>);
constructor(catalog_id: string, ...sections: AtLeastOne<ProductSection>);
}

@@ -333,0 +417,0 @@ /**

@@ -7,3 +7,3 @@ import { ClientMessage } from "../types.js";

*/
export default class Location extends ClientMessage {
export declare class Location extends ClientMessage {
/**

@@ -40,3 +40,2 @@ * The latitude of the location

}
export { Location };
//# sourceMappingURL=location.d.ts.map

@@ -7,3 +7,3 @@ import { ClientMessage } from "../types.js";

*/
export default class Reaction extends ClientMessage {
export declare class Reaction extends ClientMessage {
/**

@@ -31,3 +31,2 @@ * The message's id to react to

}
export { Reaction };
//# sourceMappingURL=reaction.d.ts.map
import { ClientMessage, ClientLimitedMessageComponent, type ClientBuildableMessageComponent, type ClientTypedMessageComponent } from "../types.js";
import type { AtLeastOne, XOR } from "../utils";
import type Location from "./location";
import type { Location } from "./location";
import type { Document, Image, Video } from "./media";

@@ -218,3 +218,3 @@ import { Product, ProductSection } from "./globals.js";

*
* @param parameters - The variable for the url button.
* @param parameter - The variable for the url button.
* @throws If parameter is an empty string.

@@ -237,3 +237,3 @@ */

*
* @param parameters - Parameter for the component.
* @param parameter - Parameter for the component.
* @throws If parameter is an empty string.

@@ -293,3 +293,3 @@ */

*
* @param parameters - The coupon's code of the button to copy.
* @param parameter - The coupon's code of the button to copy.
* @throws If parameter is an empty string.

@@ -296,0 +296,0 @@ */

@@ -7,3 +7,3 @@ import { ClientMessage } from "../types.js";

*/
export default class Text extends ClientMessage {
export declare class Text extends ClientMessage {
/**

@@ -31,3 +31,2 @@ * Body of the message. Maximum length: 4096 characters.

}
export { Text };
//# sourceMappingURL=text.d.ts.map

@@ -6,3 +6,3 @@ import { WhatsAppAPIMiddleware } from "./globals.js";

*/
export default class WhatsAppAPI extends WhatsAppAPIMiddleware {
export declare class WhatsAppAPI extends WhatsAppAPIMiddleware {
/**

@@ -14,3 +14,3 @@ * POST request handler for AdonisJS

* import Route from "@ioc:Adonis/Core/Route";
* import WhatsAppAPI from "whatsapp-api-js/middleware/adonis";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/adonis";
*

@@ -39,3 +39,3 @@ * const Whatsapp = new WhatsAppAPI({

* import Route from "@ioc:Adonis/Core/Route";
* import WhatsAppAPI from "whatsapp-api-js/middleware/adonis";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/adonis";
*

@@ -42,0 +42,0 @@ * const Whatsapp = new WhatsAppAPI({

@@ -1,6 +0,6 @@

import WebStandardMiddleware from "./web-standard.js";
import { WhatsAppAPI as WebStandardMiddleware } from "./web-standard.js";
/**
* Bun server middleware for WhatsAppAPI
*/
export default class WhatsAppAPI extends WebStandardMiddleware {
export declare class WhatsAppAPI extends WebStandardMiddleware {
/**

@@ -11,3 +11,3 @@ * POST request handler for Bun server

* ```ts
* import WhatsAppAPI from "whatsapp-api-js/middleware/bun";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/bun";
*

@@ -38,3 +38,3 @@ * const Whatsapp = new WhatsAppAPI({

* ```ts
* import WhatsAppAPI from "whatsapp-api-js/middleware/bun";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/bun";
*

@@ -41,0 +41,0 @@ * const Whatsapp = new WhatsAppAPI({

@@ -1,6 +0,6 @@

import WebStandardMiddleware from "./web-standard.js";
import { WhatsAppAPI as WebStandardMiddleware } from "./web-standard.js";
/**
* Deno server middleware for WhatsAppAPI
*/
export default class WhatsAppAPI extends WebStandardMiddleware {
export declare class WhatsAppAPI extends WebStandardMiddleware {
/**

@@ -11,3 +11,3 @@ * POST request handler for Deno server

* ```ts
* import WhatsAppAPI from "whatsapp-api-js/middleware/deno";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/deno";
*

@@ -38,3 +38,3 @@ * const Whatsapp = new WhatsAppAPI({

* ```ts
* import WhatsAppAPI from "whatsapp-api-js/middleware/deno";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/deno";
*

@@ -41,0 +41,0 @@ * const Whatsapp = new WhatsAppAPI({

@@ -6,3 +6,3 @@ import { WhatsAppAPIMiddleware } from "./globals.js";

*/
export default class WhatsAppAPI extends WhatsAppAPIMiddleware {
export declare class WhatsAppAPI extends WhatsAppAPIMiddleware {
/**

@@ -18,3 +18,3 @@ * POST request handler for Express.js

* import express from "express";
* import WhatsAppAPI from "whatsapp-api-js/middleware/express";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/express";
*

@@ -49,3 +49,3 @@ * const app = express();

* import express from "express";
* import WhatsAppAPI from "whatsapp-api-js/middleware/express";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/express";
*

@@ -52,0 +52,0 @@ * const app = express();

@@ -1,2 +0,2 @@

import WhatsAppAPI from "../index.js";
import { WhatsAppAPI } from "../index.js";
/**

@@ -3,0 +3,0 @@ * The abstract class for the middlewares, it extends the WhatsAppAPI class

@@ -9,3 +9,3 @@ /**

* ```ts
* import WhatsAppAPI from "whatsapp-api-js/middleware/deno";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/deno";
*

@@ -32,10 +32,10 @@ * const Whatsapp = new WhatsAppAPI({

export { WhatsAppAPIMiddleware } from "./globals.js";
export { default as ExpressMiddleware } from "./express.js";
export { default as AdonisMiddleware } from "./adonis.js";
export { default as VercelMiddleware } from "./vercel.js";
export { default as DenoMiddleware } from "./deno.js";
export { default as BunMiddleware } from "./bun.js";
export { default as SvelteKitMiddleware } from "./sveltekit.js";
export { default as WebStandardMiddleware } from "./web-standard.js";
export { default as NodeHTTPMiddleware } from "./node-http.js";
export { WhatsAppAPI as ExpressMiddleware } from "./express.js";
export { WhatsAppAPI as AdonisMiddleware } from "./adonis.js";
export { WhatsAppAPI as VercelMiddleware } from "./vercel.js";
export { WhatsAppAPI as DenoMiddleware } from "./deno.js";
export { WhatsAppAPI as BunMiddleware } from "./bun.js";
export { WhatsAppAPI as SvelteKitMiddleware } from "./sveltekit.js";
export { WhatsAppAPI as WebStandardMiddleware } from "./web-standard.js";
export { WhatsAppAPI as NodeHTTPMiddleware } from "./node-http.js";
//# sourceMappingURL=index.d.ts.map

@@ -7,3 +7,3 @@ /// <reference types="node" />

*/
export default class WhatsAppAPI extends WhatsAppAPIMiddleware {
export declare class WhatsAppAPI extends WhatsAppAPIMiddleware {
/**

@@ -15,3 +15,3 @@ * POST request handler for node:http server

* import { createServer, type IncomingMessage, type ServerResponse } from 'node:http';
* import WhatsAppAPI from "whatsapp-api-js/middleware/node-http";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/node-http";
*

@@ -45,3 +45,3 @@ * const Whatsapp = new WhatsAppAPI({

* import { createServer, IncomingMessage, ServerResponse } from 'node:http';
* import WhatsAppAPI from "whatsapp-api-js/middleware/node-http";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/node-http";
*

@@ -48,0 +48,0 @@ * const server = createServer((request: IncomingMessage, response: ServerResponse) => {

@@ -1,2 +0,2 @@

import WebStandardMiddleware from "./web-standard.js";
import { WhatsAppAPI as WebStandardMiddleware } from "./web-standard.js";
/**

@@ -7,3 +7,3 @@ * SvelteKit Endpoints middleware for WhatsAppAPI

*/
export default class WhatsAppAPI extends WebStandardMiddleware {
export declare class WhatsAppAPI extends WebStandardMiddleware {
/**

@@ -14,3 +14,3 @@ * POST request handler for SvelteKit RequestHandler

* ```ts
* import WhatsAppAPI from 'whatsapp-api-js/middleware/sveltekit';
* import { WhatsAppAPI } from 'whatsapp-api-js/middleware/sveltekit';
*

@@ -41,3 +41,3 @@ * import type { RequestHandler } from './$types';

* ```ts
* import WhatsAppAPI from 'whatsapp-api-js/middleware/sveltekit';
* import { WhatsAppAPI } from 'whatsapp-api-js/middleware/sveltekit';
*

@@ -44,0 +44,0 @@ * import type { RequestHandler } from './$types';

@@ -1,2 +0,2 @@

import NodeHTTPMiddleware from "./node-http.js";
import { WhatsAppAPI as NodeHTTPMiddleware } from "./node-http.js";
import type { VercelRequest } from "@vercel/node";

@@ -6,3 +6,3 @@ /**

*/
export default class WhatsAppAPI extends NodeHTTPMiddleware {
export declare class WhatsAppAPI extends NodeHTTPMiddleware {
/**

@@ -17,3 +17,3 @@ * POST request handler for Vercel serverless functions

* import type { VercelRequest, VercelResponse } from "@vercel/node";
* import WhatsAppAPI from "whatsapp-api-js/middleware/vercel";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/vercel";
*

@@ -51,3 +51,3 @@ * const Whatsapp = new WhatsAppAPI({

* import type { VercelRequest, VercelResponse } from "@vercel/node";
* import WhatsAppAPI from "whatsapp-api-js/middleware/vercel";
* import { WhatsAppAPI } from "whatsapp-api-js/middleware/vercel";
*

@@ -54,0 +54,0 @@ * const Whatsapp = new WhatsAppAPI({

@@ -5,3 +5,3 @@ import { WhatsAppAPIMiddleware } from "./globals.js";

*/
export default class WhatsAppAPI extends WhatsAppAPIMiddleware {
export declare class WhatsAppAPI extends WhatsAppAPIMiddleware {
/**

@@ -8,0 +8,0 @@ * POST request handler for Web Standard API http server

@@ -10,3 +10,3 @@ import type { WhatsAppAPIConstructorArguments } from "../types";

*/
export default function Bun(settings: WhatsAppAPIConstructorArguments): WhatsAppAPIConstructorArguments;
export declare function Bun(settings: WhatsAppAPIConstructorArguments): WhatsAppAPIConstructorArguments;
//# sourceMappingURL=bun.d.ts.map

@@ -10,3 +10,3 @@ import type { WhatsAppAPIConstructorArguments } from "../types";

*/
export default function Deno(settings: WhatsAppAPIConstructorArguments): WhatsAppAPIConstructorArguments;
export declare function Deno(settings: WhatsAppAPIConstructorArguments): WhatsAppAPIConstructorArguments;
//# sourceMappingURL=deno.d.ts.map

@@ -9,3 +9,3 @@ /**

* ```ts
* import WhatsAppAPI from "whatsapp-api-js";
* import { WhatsAppAPI } from "whatsapp-api-js";
* import { NodeNext } from "whatsapp-api-js/setup/node";

@@ -19,6 +19,6 @@ *

*/
export { default as Bun } from "./bun";
export { default as Deno } from "./deno";
export { default as Web } from "./web";
export * from "./bun";
export * from "./deno";
export * from "./web";
export * from "./node";
//# sourceMappingURL=index.d.ts.map

@@ -12,3 +12,3 @@ import type { WhatsAppAPIConstructorArguments } from "../types";

*/
export default function Web(settings: WhatsAppAPIConstructorArguments): WhatsAppAPIConstructorArguments;
export declare function Web(settings: WhatsAppAPIConstructorArguments): WhatsAppAPIConstructorArguments;
//# sourceMappingURL=web.d.ts.map

@@ -10,2 +10,3 @@ /**

import type { AtLeastOne } from "./utils";
export declare const DEFAULT_API_VERSION = "v19.0";
/**

@@ -62,3 +63,3 @@ * The main constructor arguments for the API

/**
* The version of the API, defaults to v19.0
* The version of the API, defaults to {@link DEFAULT_API_VERSION}.
*/

@@ -171,2 +172,3 @@ v?: string;

* @param n - The maximum length
* @throws `${p} can't have more than ${n} ${c}`
*/

@@ -173,0 +175,0 @@ constructor(p: string, c: string, a: Array<T>, n: N);

{
"name": "whatsapp-api-js",
"version": "2.6.0",
"version": "3.0.0-beta.0",
"author": "Secreto31126",

@@ -136,23 +136,23 @@ "description": "A TypeScript server agnostic Whatsapp's Official API framework",

"devDependencies": {
"@adonisjs/http-server": "7.0.2",
"@adonisjs/http-server": "7.1.0",
"@types/express": "4.17.21",
"@types/node": "18.19.10",
"@typescript-eslint/eslint-plugin": "6.19.1",
"@typescript-eslint/parser": "6.19.1",
"@vercel/node": "3.0.17",
"@types/node": "18.19.19",
"@typescript-eslint/eslint-plugin": "7.1.0",
"@typescript-eslint/parser": "7.1.0",
"@vercel/node": "3.0.20",
"all-contributors-cli": "6.26.1",
"c8": "9.1.0",
"dotenv": "16.4.1",
"esbuild": "0.19.0",
"eslint": "8.56.0",
"dotenv": "16.4.5",
"esbuild": "0.20.1",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-tsdoc": "0.2.17",
"glob": "10.3.10",
"mocha": "10.2.0",
"prettier": "3.2.4",
"mocha": "10.3.0",
"prettier": "3.2.5",
"sinon": "17.0.1",
"typedoc": "0.25.7",
"typedoc": "0.25.9",
"typescript": "5.3.3",
"undici": "6.5.0"
"undici": "6.6.2"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc