import { RpcMethod } from './commonTypes'; export type WhatsAppService_RegisterWABA = RpcMethod; export type WhatsAppService_RegisterWABATwilio = RpcMethod; export type WhatsAppService_AuthResponseCode = RpcMethod; export type WhatsAppService_FetchCatalog = RpcMethod; export interface WhatsAppService { /** Connects a WhatsApp Business Account to an application code via Meta Cloud API, storing the WABA and phone-number IDs, subscribing the number to Pushwoosh webhooks and registering it with Meta. Use for direct Meta onboarding; use connect_whatsapp_account_twilio for Twilio-routed senders. */ RegisterWABA: WhatsAppService_RegisterWABA; /** Connects a WhatsApp Business Account through Twilio for an application code, provisioning a Twilio subaccount, messaging service and sender. Use when the WhatsApp number is routed via Twilio rather than Meta Cloud API directly. */ RegisterWABATwilio: WhatsAppService_RegisterWABATwilio; /** Completes WhatsApp embedded signup by exchanging the Meta OAuth authorization code for an access token and storing it on the application code. Call after the Meta login dialog redirects back with a code, before connect_whatsapp_account. */ AuthResponseCode: WhatsAppService_AuthResponseCode; /** Returns the WhatsApp Business catalog and its products for an application code by querying Meta. Use to list products available for WhatsApp product messages; a WABA has at most one catalog. */ FetchCatalog: WhatsAppService_FetchCatalog; } export type RegisterWABARequest = { /** application code */ application?: string; /** WhatsApp Business Account (WABA) ID from Meta */ wabaId?: string; /** Meta phone number ID of the WhatsApp sender */ phonenumberId?: string; }; export type RegisterWABAResponse = {}; export type AuthResponseCodeRequest = { /** application code */ application?: string; /** OAuth authorization code returned by the Meta login dialog */ code?: string; }; export type AuthResponseCodeResponse = {}; export type RegisterWABATwilioRequest = { /** application code */ application?: string; /** WhatsApp Business Account (WABA) ID from Meta */ wabaId?: string; /** Meta phone number ID of the WhatsApp sender */ phonenumberId?: string; }; export type RegisterWABATwilioResponse = {}; export type FetchCatalogRequest = { /** application code */ application?: string; }; export type FetchCatalogResponse = { /** WABA can have only one catalog */ catalog: Catalog; products: Product[]; }; export type Catalog = { id: string; name: string; productCount: number; }; export type Product = { id: string; name: string; description: string; url: string; imageUrl: string; retailerId: string; price: string; brand: string; };