Skip to content

Commit

Permalink
Merge pull request #29 from velrino/fix/interface-webhook
Browse files Browse the repository at this point in the history
fix Webhook Types: Made 'filename' optional and corrected 'sha256' field. Changed 'timestamp' to string
  • Loading branch information
MarcosNicolau authored May 27, 2024
2 parents 3341ac4 + bc6f579 commit 5d61d30
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions src/types/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export type WebhookMedia = {
/**
* Name for the file on the sender's device
*/
filename: string;
ha256: string;
filename?: string;
sha256: string;
mime_type: string;
/**
* ID for the file
Expand All @@ -52,7 +52,7 @@ export type WebhookMessage = {
/**
* The time when the customer sent the message to the business in unix format
*/
timestamp: number;
timestamp: string;
/**
* When the messages type is set to audio, including voice messages, this object is included in the messages object:
*/
Expand Down Expand Up @@ -138,28 +138,28 @@ export type WebhookMessage = {
*/
interactive?: {
type: string;
/**
* Sent when a customer clicks a button
*/
button_reply?: {
/**
* Unique ID of a button
*/
id: string;
title: string;
};
/**
* Sent when a customer selects an item from a list
*/
list_reply?: {
/**
* Unique ID of the selected list item
*/
id: string;
title: string;
description: string;
};
};
/**
* Sent when a customer clicks a button
*/
button_reply?: {
/**
* Unique ID of a button
*/
id: string;
title: string;
};
/**
* Sent when a customer selects an item from a list
*/
list_reply?: {
/**
* Unique ID of the selected list item
*/
id: string;
title: string;
description: string;
};
};
/**
* Included in the messages object when a customer has placed an order. Order objects have the following properties:
*/
Expand Down Expand Up @@ -339,7 +339,7 @@ export type WebhookStatus = {
/**
* Date for the status message in unix
*/
timestamp: number;
timestamp: string;
};

export type WebhookMetadata = {
Expand All @@ -351,7 +351,7 @@ export type WebhookChange = {
value: {
messaging_product: "whatsapp";
metadata: WebhookMetadata;
errors: WebhookError[];
errors?: WebhookError[];
contacts: WebhookContact[];
messages?: WebhookMessage[];
statuses?: WebhookStatus[];
Expand Down

0 comments on commit 5d61d30

Please sign in to comment.