Huge News!Announcing our $40M Series B led by Abstract Ventures.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 7.0.2 to 7.0.3

dist/chunk-4GPT2GSB.js

2

dist/cli.js
#!/usr/bin/env node
import{a as c}from"./chunk-C6HFTFLD.js";import{program as r}from"commander";import d from"get-stdin";var a=process.env.WHATSAPP_ACCESS_TOKEN,m=process.env.WHATSAPP_PHONE_NUMBER_ID,i=new c;r.name("whatsapp").description("WhatsApp SDK CLI");var t=r.command("media").description("Media");t.command("download").description("Download Media").argument("<MEDIA_URL>","Media URL").requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",a).action(async e=>{let o=await(await i.media.download(e)).arrayBuffer(),s=Buffer.from(o);process.stdout.write(s)});t.command("delete").description("Delete Media").argument("<MEDIA_ID>","Media ID").option("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",m).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",a).action(async(e,n)=>{let o=await i.media.delete({mediaID:e,phoneNumberID:n.phoneNumberId});console.log(await o.json())});t.command("get-url").description("Get Media URL").argument("<MEDIA_ID>","Media ID").option("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",m).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",a).action(async(e,n)=>{let o=await i.media.getURL({mediaID:e,phoneNumberID:n.phoneNumberId});console.log(await o.json())});t.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",m).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",a).action(async e=>{let n=await d.buffer(),o=new Blob([n],{type:e.mimeType}),s=await i.media.upload({file:o,phoneNumberID:e.phoneNumberId,mimeType:e.mimeType,filename:e.filename});console.log(await s.json())});r.parseAsync();
import{a as c}from"./chunk-4GPT2GSB.js";import{program as r}from"commander";import d from"get-stdin";var a=process.env.WHATSAPP_ACCESS_TOKEN,m=process.env.WHATSAPP_PHONE_NUMBER_ID,i=new c;r.name("whatsapp").description("WhatsApp SDK CLI");var t=r.command("media").description("Media");t.command("download").description("Download Media").argument("<MEDIA_URL>","Media URL").requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",a).action(async e=>{let o=await(await i.media.download(e)).arrayBuffer(),s=Buffer.from(o);process.stdout.write(s)});t.command("delete").description("Delete Media").argument("<MEDIA_ID>","Media ID").option("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",m).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",a).action(async(e,n)=>{let o=await i.media.delete({mediaID:e,phoneNumberID:n.phoneNumberId});console.log(await o.json())});t.command("get-url").description("Get Media URL").argument("<MEDIA_ID>","Media ID").option("--phone-number-id <PHONE_NUMBER_ID>","From Phone Number ID",m).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",a).action(async(e,n)=>{let o=await i.media.getURL({mediaID:e,phoneNumberID:n.phoneNumberId});console.log(await o.json())});t.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",m).requiredOption("--access-token <ACCESS_TOKEN>","WhatsApp Access Token",a).action(async e=>{let n=await d.buffer(),o=new Blob([n],{type:e.mimeType}),s=await i.media.upload({file:o,phoneNumberID:e.phoneNumberId,mimeType:e.mimeType,filename:e.filename});console.log(await s.json())});r.parseAsync();

@@ -60,3 +60,3 @@ import * as ky from 'ky';

interface MethodOptions$1 {
interface MethodOptions$2 {
request?: Options$1;

@@ -76,3 +76,3 @@ }

*/
upload({ phoneNumberID, file, filename, mimeType, request, }: MethodOptions$1 & MediaUploadOptions): ky.ResponsePromise<MediaUploadPayload>;
upload({ phoneNumberID, file, filename, mimeType, request, }: MethodOptions$2 & MediaUploadOptions): ky.ResponsePromise<MediaUploadPayload>;
/**

@@ -87,4 +87,4 @@ * Retrieve Media URL.

*/
getURL({ mediaID, phoneNumberID, request, }: MethodOptions$1 & MediaGetURLOptions): ky.ResponsePromise<MediaGetURLPayload>;
delete({ mediaID, phoneNumberID, request, }: MethodOptions$1 & MediaDeleteOptions): ky.ResponsePromise<MediaDeletePayload>;
getURL({ mediaID, phoneNumberID, request, }: MethodOptions$2 & MediaGetURLOptions): ky.ResponsePromise<MediaGetURLPayload>;
delete({ mediaID, phoneNumberID, request, }: MethodOptions$2 & MediaDeleteOptions): ky.ResponsePromise<MediaDeletePayload>;
/**

@@ -112,3 +112,3 @@ * Download Media.

*/
download({ mediaURL, request }: MethodOptions$1 & DownloadOptions): ky.ResponsePromise<unknown>;
download({ mediaURL, request }: MethodOptions$2 & DownloadOptions): ky.ResponsePromise<unknown>;
}

@@ -571,3 +571,3 @@

interface MethodOptions {
interface MethodOptions$1 {
request?: Options$1;

@@ -579,4 +579,4 @@ }

protected getEndpoint(phoneNumberID: PhoneNumberID): string;
createStatus({ phoneNumberID, request, ...status }: MethodOptions & CreateStatusOptions): ky.ResponsePromise<CreateStatusPayload>;
createMessage({ to, phoneNumberID, context, recipientType, request, ...message }: MethodOptions & CreateMessageOptions): ky.ResponsePromise<CreateMessagePayload>;
createStatus({ phoneNumberID, request, ...status }: MethodOptions$1 & CreateStatusOptions): ky.ResponsePromise<CreateStatusPayload>;
createMessage({ to, phoneNumberID, context, recipientType, request, ...message }: MethodOptions$1 & CreateMessageOptions): ky.ResponsePromise<CreateMessagePayload>;
}

@@ -600,2 +600,40 @@

*/
type CreateSubscriptionOptions = {
businessAccountID: BusinessAccountID;
};
type CreateSubscriptionPayload = {
success: boolean;
};
type ListSubscriptionsOptions = {
businessAccountID: BusinessAccountID;
};
type ListSubscriptionsPayload = {
data: {
whatsapp_business_api_data: {
id: string;
link?: string | null;
name: string;
};
}[];
};
interface MethodOptions {
request?: Options$1;
}
declare class SubscribedApps {
protected _request: Options$1;
constructor(_request: Options$1);
protected getEndpoint(businessAccountID: BusinessAccountID): string;
createSubscription({ businessAccountID, request, }: MethodOptions & CreateSubscriptionOptions): ky.ResponsePromise<CreateSubscriptionPayload>;
listSubscriptions({ businessAccountID, request, }: MethodOptions & ListSubscriptionsOptions): ky.ResponsePromise<ListSubscriptionsPayload>;
}
/**
* WhatsApp NodeJS SDK.
*
* @author Great Detail Ltd <info@greatdetail.com>
* @author Dom Webber <dom.webber@hotmail.com>
* @see https://greatdetail.com
*/
type EventNotificationMessageIdentity = {

@@ -1231,2 +1269,3 @@ /**

message: Message;
subscribedApps: SubscribedApps;
media: Media;

@@ -1237,2 +1276,2 @@ webhook: Webhook;

export { type AccountID, type BusinessAccountID, Client, Client as CloudAPI, type ConversationType, type CreateMessageContact, type CreateMessageLocation, type CreateMessageMedia, type CreateMessageOptions, type CreateMessagePayload, type CreateMessageText, type CreateStatusOptions, type CreateStatusPayload, type EventNotificationMessageIdentity, type EventNotificationMessageMedia, type EventNotificationMessageReferral, type EventNotificationMessageSystem, type EventNotificationMessageText, type MediaDeleteOptions, type MediaDeletePayload, type MediaGetURLOptions, type MediaGetURLPayload, type MediaID, type MediaUploadOptions, type MediaUploadPayload, type MessageID, type MessageRecipientType, type MessageStatusType, MessageType, type PhoneNumberID, type PhoneNumberString, type WebhookEventNotification, type WhatsappError, Client as default };
export { type AccountID, type BusinessAccountID, Client, Client as CloudAPI, type ConversationType, type CreateMessageContact, type CreateMessageLocation, type CreateMessageMedia, type CreateMessageOptions, type CreateMessagePayload, type CreateMessageText, type CreateStatusOptions, type CreateStatusPayload, type CreateSubscriptionOptions, type CreateSubscriptionPayload, type EventNotificationMessageIdentity, type EventNotificationMessageMedia, type EventNotificationMessageReferral, type EventNotificationMessageSystem, type EventNotificationMessageText, type ListSubscriptionsOptions, type ListSubscriptionsPayload, type MediaDeleteOptions, type MediaDeletePayload, type MediaGetURLOptions, type MediaGetURLPayload, type MediaID, type MediaUploadOptions, type MediaUploadPayload, type MessageID, type MessageRecipientType, type MessageStatusType, MessageType, type PhoneNumberID, type PhoneNumberString, type WebhookEventNotification, type WhatsappError, Client as default };

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

import{a}from"./chunk-C6HFTFLD.js";export{a as Client,a as CloudAPI,a as default};
import{a}from"./chunk-4GPT2GSB.js";export{a as Client,a as CloudAPI,a as default};
{
"name": "@great-detail/whatsapp",
"version": "7.0.2",
"version": "7.0.3",
"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.",

@@ -41,2 +41,7 @@ # Node.js SDK for WhatsApp Business Platform APIs

},
request: {
headers: {
Authorization: "Bearer ...",
},
},
});

@@ -96,3 +101,3 @@ ```

| :--- | :-------: | --------------: |
| v7.X | v20 | v18+ |
| v7.x | v20 | v18+ |

@@ -109,2 +114,20 @@ Whilst the SDK may work with alternative versions of the Graph API, it is

## TODO
There are a number of features supported by the WhatsApp Business Cloud API that
are yet to be implemented in this SDK. Please feel free to contribute via a Pull
Request, or note your interest in particular features by creating an issue for
it.
- [ ] Interactive Message Types.
- [ ] Template Message Types.
- [ ] Button Message Types.
- [ ] Flow Message Types.
- [ ] List Message Types.
- [ ] WABA Webhook Subscription Management.
- [ ] WABA Extended Credit Management.
- [ ] WABA Phone Number Management.
- [ ] WABA System User Management?
- [ ] Considering Authentication usage improvements.
## License

@@ -111,0 +134,0 @@

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc