New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@great-detail/whatsapp

Package Overview
Dependencies
Maintainers
2
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@great-detail/whatsapp - npm Package Compare versions

Comparing version 6.9.1 to 6.9.2

dist/chunk-YTZKPZQV.js

2

dist/cli.js
#!/usr/bin/env node
import{b as p}from"./chunk-F2HWHZJT.js";import{program as d}from"commander";import E from"get-stdin";import{oraPromise as a}from"ora";var t={spinner:"simpleDotsScrolling"},i=process.env.WHATSAPP_ACCESS_TOKEN,r=process.env.WHATSAPP_PHONE_NUMBER_ID,s=new p;d.name("whatsapp").description("WhatsApp SDK CLI");var m=d.command("media").description("Media");m.command("download").description("Download Media").argument("<MEDIA_URL>","Media URL").requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).action(async(n,e)=>{let c=await(await a(()=>s.media.download(n).send({headers:{Authorization:`Bearer ${e.accessToken}`}}),{...t,text:"Downloading media"})).arrayBuffer(),l=Buffer.from(c);process.stdout.write(l)});m.command("delete").description("Delete Media").argument("<MEDIA_ID>","Media ID").option("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",r).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).action(async(n,e)=>{let o=await a(()=>s.media.delete(n,{phoneNumberID:e.phoneNumberId}).send({headers:{Authorization:`Bearer ${e.accessToken}`}}),{...t,text:"Deleting media"});console.log(await o.json())});m.command("get-url").description("Get Media URL").argument("<MEDIA_ID>","Media ID").option("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",r).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).action(async(n,e)=>{let o=await a(()=>s.media.getURL(n,{phoneNumberID:e.phoneNumberId}).send({headers:{Authorization:`Bearer ${e.accessToken}`}}),{...t,text:"Getting media URL"});console.log(await o.json())});m.command("upload").description("Upload Media").option("--filename <FILENAME>","Filename").requiredOption("--mime-type <MIME_TYPE>","MIME Type").requiredOption("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",r).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).action(async n=>{let e=await E.buffer(),o=new Blob([e],{type:n.mimeType}),c=await a(()=>s.media.upload(o,{phoneNumberID:n.phoneNumberId,mimeType:n.mimeType,filename:n.filename}).send({headers:{Authorization:`Bearer ${n.accessToken}`}}),{...t,text:"Uploading media"});console.log(await c.json())});var A=d.command("message").description("Message"),u=A.command("send");u.command("image").description("Send a media message").argument("<TO_NUMBER>","To Number").requiredOption("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",r).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).requiredOption("--media-id <MEDIA_ID>","Media ID").option("--filename <FILENAME>","Filename").option("--caption <CAPTION>","Caption").action(async(n,e)=>{let o=await a(()=>s.message({phoneNumberID:e.phoneNumberId}).image({id:e.mediaId,filename:e.filename,caption:e.caption},{toNumber:n}).send({headers:{Authorization:`Bearer ${e.accessToken}`}}),{...t,text:"Sending image"});console.log(await o.json())});u.command("text").description("Send a text message").argument("<TO_NUMBER>","To Number").requiredOption("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",r).requiredOption("--body <MESSAGE_TEXT_BODY>","Message Body").requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).action(async(n,e)=>{let o=await a(()=>s.message({phoneNumberID:e.phoneNumberId}).text({body:e.body},{toNumber:n}).send({headers:{Authorization:`Bearer ${e.accessToken}`}}),{...t,text:"Sending text message"});console.log(await o.json())});d.parseAsync();
import{b as p}from"./chunk-YTZKPZQV.js";import{program as d}from"commander";import E from"get-stdin";import{oraPromise as a}from"ora";var t={spinner:"simpleDotsScrolling"},i=process.env.WHATSAPP_ACCESS_TOKEN,r=process.env.WHATSAPP_PHONE_NUMBER_ID,s=new p;d.name("whatsapp").description("WhatsApp SDK CLI");var m=d.command("media").description("Media");m.command("download").description("Download Media").argument("<MEDIA_URL>","Media URL").requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).action(async(n,e)=>{let c=await(await a(()=>s.media.download(n).send({headers:{Authorization:`Bearer ${e.accessToken}`}}),{...t,text:"Downloading media"})).arrayBuffer(),l=Buffer.from(c);process.stdout.write(l)});m.command("delete").description("Delete Media").argument("<MEDIA_ID>","Media ID").option("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",r).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).action(async(n,e)=>{let o=await a(()=>s.media.delete(n,{phoneNumberID:e.phoneNumberId}).send({headers:{Authorization:`Bearer ${e.accessToken}`}}),{...t,text:"Deleting media"});console.log(await o.json())});m.command("get-url").description("Get Media URL").argument("<MEDIA_ID>","Media ID").option("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",r).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).action(async(n,e)=>{let o=await a(()=>s.media.getURL(n,{phoneNumberID:e.phoneNumberId}).send({headers:{Authorization:`Bearer ${e.accessToken}`}}),{...t,text:"Getting media URL"});console.log(await o.json())});m.command("upload").description("Upload Media").option("--filename <FILENAME>","Filename").requiredOption("--mime-type <MIME_TYPE>","MIME Type").requiredOption("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",r).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).action(async n=>{let e=await E.buffer(),o=new Blob([e],{type:n.mimeType}),c=await a(()=>s.media.upload(o,{phoneNumberID:n.phoneNumberId,mimeType:n.mimeType,filename:n.filename}).send({headers:{Authorization:`Bearer ${n.accessToken}`}}),{...t,text:"Uploading media"});console.log(await c.json())});var A=d.command("message").description("Message"),u=A.command("send");u.command("image").description("Send a media message").argument("<TO_NUMBER>","To Number").requiredOption("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",r).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).requiredOption("--media-id <MEDIA_ID>","Media ID").option("--filename <FILENAME>","Filename").option("--caption <CAPTION>","Caption").action(async(n,e)=>{let o=await a(()=>s.message({phoneNumberID:e.phoneNumberId}).image({id:e.mediaId,filename:e.filename,caption:e.caption},{toNumber:n}).send({headers:{Authorization:`Bearer ${e.accessToken}`}}),{...t,text:"Sending image"});console.log(await o.json())});u.command("text").description("Send a text message").argument("<TO_NUMBER>","To Number").requiredOption("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",r).requiredOption("--body <MESSAGE_TEXT_BODY>","Message Body").requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",i).action(async(n,e)=>{let o=await a(()=>s.message({phoneNumberID:e.phoneNumberId}).text({body:e.body},{toNumber:n}).send({headers:{Authorization:`Bearer ${e.accessToken}`}}),{...t,text:"Sending text message"});console.log(await o.json())});d.parseAsync();

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

import{a,b,c}from"./chunk-F2HWHZJT.js";export{b as CloudAPI,c as IncomingMessageType,a as OutgoingMessageType,b as default};
import{a,b,c}from"./chunk-YTZKPZQV.js";export{b as CloudAPI,c as IncomingMessageType,a as OutgoingMessageType,b as default};
{
"name": "@great-detail/whatsapp",
"version": "6.9.1",
"version": "6.9.2",
"type": "module",

@@ -5,0 +5,0 @@ "description": "SDK for interfacing with WhatsApp Business Platform in Typescript or Node.js using the Cloud API, hosted by Meta.",

@@ -272,9 +272,2 @@ /**

const xHubSignature1 = request.headers["x-hub-signature"]
?.toString()
.replace("sha1=", "");
if (xHubSignature1) {
throw CloudAPIWebhookError.invalidXHubSignature();
}
const xHubSignature256 = request.headers["x-hub-signature-256"]

@@ -305,11 +298,2 @@ ?.toString()

const generatedSignature1 = createHmac("sha1", appSecret)
.update(bodyString)
.digest("hex");
const isAuthentic1 = xHubSignature1 === generatedSignature1;
this._logger?.debug(
`Comparing SHA-1 signatures for integrity check: "${xHubSignature1}" === "${generatedSignature1}" (${isAuthentic1})`,
);
return isAuthentic256;

@@ -316,0 +300,0 @@ };

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc