Skip to content

Commit

Permalink
fix: 🐛 message.ts
Browse files Browse the repository at this point in the history
interactive flow message fields fix #32
  • Loading branch information
MarcosNicolau committed May 29, 2024
1 parent 1d7db50 commit eed637c
Showing 1 changed file with 54 additions and 53 deletions.
107 changes: 54 additions & 53 deletions src/types/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,60 @@ export type InteractiveMessageAction = {
*/
parameters?: {
thumbnail_product_retailer_id?: string;

/**
* Optional for Flows Messages.
*
* The current mode of the Flow, either draft or published.
*
* Default: published
*/
mode?: "draft" | "published";
/**
* Required for Flows Messages.
*/
flow_message_version?: LiteralUnion<"3">;
/**
* Required for Flows Messages.
* A token that is generated by the business to serve as an identifier.
*/
flow_token?: string;
/**
* Required for Flows Messages.
*
* Unique identifier of the Flow provided by WhatsApp.
*/
flow_id?: string;
/**
* Required for Flows Messages.
*
* Text on the CTA button, eg. "Signup".
*
* Maximum length: 20 characters (no emoji).
*/
flow_cta?: string;
/**
* Optional for Flows Messages.
*
* navigate or data_exchange. Use navigate to predefine the first screen as part of the message. Use data_exchange for advanced use-cases where the first screen is provided by your endpoint.
*
* Default: navigate
*/
flow_action?: "navigate" | "data_exchange";
/**
* Optional for Flows Messages.
* Required only if flow_action is navigate.
*/
flow_action_payload?: {
/**
* Required. The id of the first screen of the Flow.
*/
screen: string;
/**
* Optional. The input data for the first screen of the Flow. Must be a non-empty object.
*/
data?: object;
};
};
/**
* Required for List Messages and location_request_message.
Expand Down Expand Up @@ -290,59 +344,6 @@ export type InteractiveMessageAction = {
* Array of section objects. Minimum of 1, maximum of 10/
*/
sections?: InteractiveActionSection[];
/**
* Optional for Flows Messages.
*
* The current mode of the Flow, either draft or published.
*
* Default: published
*/
mode?: "draft" | "published";
/**
* Required for Flows Messages.
*/
flow_message_version?: LiteralUnion<"3">;
/**
* Required for Flows Messages.
* A token that is generated by the business to serve as an identifier.
*/
flow_token?: string;
/**
* Required for Flows Messages.
*
* Unique identifier of the Flow provided by WhatsApp.
*/
flow_id?: string;
/**
* Required for Flows Messages.
*
* Text on the CTA button, eg. "Signup".
*
* Maximum length: 20 characters (no emoji).
*/
flow_cta?: string;
/**
* Optional for Flows Messages.
*
* navigate or data_exchange. Use navigate to predefine the first screen as part of the message. Use data_exchange for advanced use-cases where the first screen is provided by your endpoint.
*
* Default: navigate
*/
flow_action?: "navigate" | "data_exchange";
/**
* Optional for Flows Messages.
* Required only if flow_action is navigate.
*/
flow_action_payload?: {
/**
* Required. The id of the first screen of the Flow.
*/
screen: string;
/**
* Optional. The input data for the first screen of the Flow. Must be a non-empty object.
*/
data?: object;
};
};

export type InteractiveMessageBody = {
Expand Down

0 comments on commit eed637c

Please sign in to comment.