meta-cloud-api 3.8.0 → 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/api/flow/types/common.ts","../../src/api/waba/types/common.ts","../../src/types/constants.ts"],"sourcesContent":["// Docs: https://developers.facebook.com/documentation/business-messaging/whatsapp/flows/\n\nimport type { IncomingHttpHeaders, IncomingMessage } from 'node:http';\nimport type { ResponseSuccess } from '../../../types';\n\n/**\n * Enum for Flow Status\n */\nexport enum FlowStatusEnum {\n Draft = 'DRAFT',\n Published = 'PUBLISHED',\n Throttled = 'THROTTLED',\n Blocked = 'BLOCKED',\n Deprecated = 'DEPRECATED',\n}\n\n/**\n * Enum for Flow Categories\n */\nexport enum FlowCategoryEnum {\n SignUp = 'SIGN_UP',\n SignIn = 'SIGN_IN',\n AppointmentBooking = 'APPOINTMENT_BOOKING',\n LeadGeneration = 'LEAD_GENERATION',\n ContactUs = 'CONTACT_US',\n CustomerSupport = 'CUSTOMER_SUPPORT',\n Survey = 'SURVEY',\n Other = 'OTHER',\n}\n\nexport enum FlowActionEnum {\n INIT = 'INIT',\n BACK = 'BACK',\n DATA_EXCHANGE = 'data_exchange',\n}\n\n/**\n * Enum for Flow Types in webhook handlers\n * Used to register handlers for specific flow events\n */\nexport enum FlowTypeEnum {\n /** Health check/ping requests */\n Ping = 'ping',\n /** Data exchange requests */\n Change = 'data_exchange',\n /** Error notification requests */\n Error = 'error',\n /** Match all flow action types */\n All = '*',\n}\n\nexport type FlowType = (typeof FlowTypeEnum)[keyof typeof FlowTypeEnum];\n\n/**\n * Flow Validation Error Pointer\n */\nexport interface FlowValidationErrorPointer {\n line_start: number;\n line_end: number;\n column_start: number;\n column_end: number;\n path: string;\n}\n\n/**\n * Flow Validation Error\n */\nexport interface FlowValidationError {\n error: string;\n error_type: string;\n message: string;\n line_start: number;\n line_end: number;\n column_start: number;\n column_end: number;\n pointers: FlowValidationErrorPointer[];\n}\n\n/**\n * Flow Item\n */\nexport interface Flow {\n id: string;\n name: string;\n status: FlowStatusEnum;\n categories: FlowCategoryEnum[];\n validation_errors: FlowValidationError[];\n}\n\n/**\n * Pagination Cursors\n */\nexport interface PaginationCursors {\n before: string;\n after: string;\n}\n\n/**\n * Pagination Object\n */\nexport interface Pagination {\n cursors: PaginationCursors;\n}\n\n/**\n * Flows List Response\n */\nexport interface FlowsListResponse {\n data: Flow[];\n paging: Pagination;\n}\n\n/**\n * Flow Asset\n */\nexport interface FlowAsset {\n name: string;\n asset_type: string;\n download_url: string;\n}\n\n/**\n * Flow Assets Response\n */\nexport interface FlowAssetsResponse {\n data: FlowAsset[];\n paging: Pagination;\n}\n\n/**\n * Flow Preview\n */\nexport interface FlowPreview {\n preview_url: string;\n expires_at: string;\n}\n\n/**\n * Flow Preview Response\n */\nexport interface FlowPreviewResponse {\n preview: FlowPreview;\n id: string;\n}\n\n/**\n * Flow Migration Result\n */\nexport interface FlowMigrationResult {\n source_name: string;\n source_id: string;\n migrated_id: string;\n}\n\n/**\n * Flow Migration Failure\n */\nexport interface FlowMigrationFailure {\n source_name: string;\n error_code: string;\n error_message: string;\n}\n\n/**\n * Create Flow Response\n */\nexport interface CreateFlowResponse {\n id: string;\n success: boolean;\n validation_errors?: FlowValidationError[];\n}\n\n/**\n * Update Flow Response\n */\nexport interface UpdateFlowResponse {\n success: boolean;\n validation_errors?: FlowValidationError[];\n}\n\n/**\n * Flow Migration Response\n */\nexport interface FlowMigrationResponse {\n migrated_flows: FlowMigrationResult[];\n failed_flows: FlowMigrationFailure[];\n}\n\n/**\n * Validate Flow JSON Response\n */\nexport interface ValidateFlowJsonResponse {\n valid: boolean;\n success: boolean;\n validation_errors?: FlowValidationError[];\n}\n\n/**\n * WhatsApp Flow Endpoint - Encrypted Request Payload\n * Represents the raw encrypted data received from WhatsApp\n */\nexport interface FlowEncryptedRequestPayload {\n encrypted_aes_key: string;\n encrypted_flow_data: string;\n initial_vector: string;\n}\n\n/**\n * WhatsApp Flow Endpoint - Decrypted Request Response\n * Represents the successfully decrypted data and encryption keys\n */\nexport interface FlowDecryptedRequestResponse {\n decryptedBody: any;\n aesKeyBuffer: Buffer;\n initialVectorBuffer: Buffer;\n}\n\n/**\n * WhatsApp Flow Endpoint - HTTP Request with Body\n * Represents an HTTP request with the encrypted payload\n */\nexport interface FlowHttpRequest extends IncomingMessage {\n body: FlowEncryptedRequestPayload;\n headers: IncomingHttpHeaders;\n}\n\n/**\n * WhatsApp Flow Endpoint - Health Check Request\n * Represents the structure of a health check request\n */\nexport interface FlowHealthCheckRequest {\n action: 'ping';\n version: '3.0';\n}\n\n/**\n * WhatsApp Flow Endpoint - Health Check Response\n * The expected response structure for health check requests\n */\nexport interface FlowHealthCheckResponse {\n data: {\n status: 'active';\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Data Exchange Request\n * Represents the structure of a data exchange request\n */\nexport interface FlowDataExchangeRequest {\n version: '3.0';\n action: FlowActionEnum;\n screen: string;\n flow_token: string;\n data?: Record<string, any> & { error_message?: string };\n}\n\n/**\n * WhatsApp Flow Endpoint - Data Exchange Response\n * The expected response structure for data exchange requests\n */\nexport interface FlowDataExchangeResponse {\n screen?: string;\n data?: Record<string, any | { error_message?: string }>;\n}\n\n/**\n * WhatsApp Flow Endpoint - Success Screen Response\n * The expected response structure for success screen requests\n */\nexport interface FlowSuccessScreenResponse {\n screen: 'SUCCESS';\n data: {\n extension_message_response?: {\n params?: {\n flow_token: string;\n [key: string]: string;\n };\n };\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Error Notification Request\n * Represents the structure of an error notification request\n */\nexport interface FlowErrorNotificationRequest {\n version: '3.0';\n action: Exclude<FlowActionEnum, FlowActionEnum.BACK>;\n screen: string;\n flow_token: string;\n data: {\n error: string;\n error_message: string;\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Error Notification Response\n * The expected response structure for error notification requests\n */\nexport interface FlowErrorNotificationResponse {\n acknowledged: boolean;\n}\n\n/**\n * WhatsApp Flow Endpoint - Comprehensive Request Object\n * A combined type that includes all possible fields from different request types\n * with all fields being optional for flexibility\n */\nexport interface FlowEndpointRequest {\n // Common fields\n version?: '3.0';\n action?: 'ping' | FlowActionEnum;\n\n screen?: string;\n flow_token?: string;\n\n data?: Record<string, any> & {\n error_key?: string;\n error_message?: string;\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Response\n * Union type for all possible response types from a Flow endpoint\n */\nexport type FlowEndpointResponse =\n | FlowHealthCheckResponse\n | FlowDataExchangeResponse\n | FlowErrorNotificationResponse\n | FlowSuccessScreenResponse;\n\nexport interface FlowClass {\n /**\n * List Flows\n *\n * @param wabaId - The WABA ID\n * @returns Promise with the list of flows\n */\n listFlows(wabaId: string): Promise<FlowsListResponse>;\n\n /**\n * Create Flow\n *\n * @param wabaId - The WABA ID\n * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id\n * @returns Promise with the created flow ID\n */\n createFlow(\n wabaId: string,\n data: {\n name: string;\n categories?: FlowCategoryEnum[];\n endpoint_uri?: string;\n clone_flow_id?: string;\n flow_json?: string;\n publish?: boolean;\n },\n ): Promise<CreateFlowResponse>;\n\n /**\n * Get Flow\n *\n * @param flowId - The flow ID\n * @param fields - Optional fields to return\n * @param dateFormat - Optional date format\n * @returns Promise with the flow details\n */\n getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;\n\n /**\n * Update Flow Metadata\n *\n * @param flowId - The flow ID\n * @param data - The flow metadata to update\n * @returns Promise with the success status\n */\n updateFlowMetadata(\n flowId: string,\n data: {\n name?: string;\n categories?: FlowCategoryEnum[];\n endpoint_uri?: string;\n application_id?: string;\n },\n ): Promise<ResponseSuccess>;\n\n /**\n * Delete Flow\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n deleteFlow(flowId: string): Promise<ResponseSuccess>;\n\n /**\n * List Assets (Get Flow JSON URL)\n *\n * @param flowId - The flow ID\n * @returns Promise with the list of assets\n */\n listAssets(flowId: string): Promise<FlowAssetsResponse>;\n\n /**\n * Update Flow JSON\n *\n * @param flowId - The flow ID\n * @param data - The asset data including asset_type, file, and name\n * @returns Promise with the success status and validation errors\n */\n updateFlowJson(\n flowId: string,\n data: {\n file: Blob | Buffer | object;\n name?: string;\n },\n ): Promise<UpdateFlowResponse>;\n\n /**\n * Validate Flow JSON by attempting an update without publishing.\n * This is a convenience method; the API doesn't have a dedicated validation endpoint.\n *\n * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).\n * @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.\n * @returns Promise indicating if the JSON is valid and includes validation errors if any.\n */\n validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;\n\n /**\n * Publish Flow\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n publishFlow(flowId: string): Promise<ResponseSuccess>;\n\n /**\n * Deprecate Flow\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n deprecateFlow(flowId: string): Promise<ResponseSuccess>;\n\n /**\n * Migrate Flows\n *\n * @param wabaId - The destination WABA ID\n * @param data - The migration data including source_waba_id and optional source_flow_names\n * @returns Promise with migration results\n */\n migrateFlows(\n wabaId: string,\n data: {\n source_waba_id: string;\n source_flow_names?: string[];\n },\n ): Promise<FlowMigrationResponse>;\n}\n","// Docs: https://developers.facebook.com/documentation/business-messaging/whatsapp/whatsapp-business-accounts/\n\nimport type { Paging, ResponseSuccess } from '../../../types/request';\n\n/**\n * WhatsApp Business Account subscription configuration\n */\nexport type WabaSubscription = {\n whatsapp_business_api_data: {\n id: string;\n link: string;\n name: string;\n category: string;\n };\n override_callback_uri?: string;\n};\n\n/**\n * Parameters for updating WABA subscription\n */\nexport interface UpdateWabaSubscription {\n override_callback_uri: string;\n verify_token: string;\n}\n\n/**\n * Response containing all WABA subscriptions\n */\nexport interface WabaSubscriptions {\n data: Array<WabaSubscription>;\n}\n\n/**\n * WABA account review status enumeration\n */\nexport enum WabaAccountReviewStatus {\n Approved = 'APPROVED',\n Active = 'ACTIVE',\n Inactive = 'INACTIVE',\n Disabled = 'DISABLED',\n}\n\n/**\n * WABA health status for message sending capability\n */\nexport enum WabaHealthStatusCanSendMessage {\n Blocked = 'BLOCKED',\n Limited = 'LIMITED',\n Available = 'AVAILABLE',\n}\n\n/**\n * WABA account status enumeration\n */\nexport enum WabaAccountStatus {\n Approved = 'APPROVED',\n Active = 'ACTIVE',\n Inactive = 'INACTIVE',\n Disabled = 'DISABLED',\n}\n\n/**\n * Business verification status enumeration\n */\nexport enum WabaBusinessVerificationStatus {\n Verified = 'verified',\n PendingSubmission = 'pending_submission',\n Unverified = 'unverified',\n Rejected = 'rejected',\n}\n\n/**\n * WABA health status error details\n */\nexport interface WabaHealthStatusError {\n error_code?: number;\n error_description?: string;\n possible_solution?: string;\n}\n\n/**\n * WABA health status entity information\n */\nexport interface WabaHealthStatusEntity {\n entity_type?: string;\n id?: string;\n can_send_message?: string;\n errors?: WabaHealthStatusError[];\n}\n\n/**\n * Overall WABA health status\n */\nexport interface WabaHealthStatus {\n can_send_message?: WabaHealthStatusCanSendMessage;\n entities?: WabaHealthStatusEntity[];\n}\n\n/**\n * WhatsApp Business Account information\n */\nexport interface WabaAccount {\n account_review_status?: WabaAccountReviewStatus;\n id?: string;\n health_status?: WabaHealthStatus;\n status?: WabaAccountStatus;\n business_verification_status?: WabaBusinessVerificationStatus;\n message_template_namespace?: string;\n name?: string;\n ownership_type?: string;\n timezone_id?: string;\n primary_business_location?: Record<string, unknown> | string;\n currency?: string;\n country?: string;\n analytics?: Record<string, unknown>;\n is_enabled_for_insights?: boolean;\n is_shared_with_partners?: boolean;\n marketing_messages_lite_api_status?: string;\n marketing_messages_onboarding_status?: string;\n on_behalf_of_business_info?: Record<string, unknown>;\n primary_funding_id?: string;\n purchase_order_number?: string;\n whatsapp_business_manager_messaging_limit?: string;\n}\n\n/**\n * Available fields for WABA account queries\n */\nexport type WabaAccountFields =\n | 'id'\n | 'name'\n | 'timezone_id'\n | 'account_review_status'\n | 'auth_international_rate_eligibility'\n | 'business_verification_status'\n | 'country'\n | 'currency'\n | 'health_status'\n | 'status'\n | 'ownership_type'\n | 'message_template_namespace'\n | 'primary_business_location'\n | 'analytics'\n | 'is_enabled_for_insights'\n | 'is_shared_with_partners'\n | 'marketing_messages_lite_api_status'\n | 'marketing_messages_onboarding_status'\n | 'on_behalf_of_business_info'\n | 'primary_funding_id'\n | 'purchase_order_number'\n | 'whatsapp_business_manager_messaging_limit';\n\n/**\n * Parameter type for specifying which WABA account fields to retrieve\n */\nexport type WabaAccountFieldsParam = WabaAccountFields[];\n\nexport type WabaGraphObject = Record<string, unknown>;\n\nexport type WabaFieldsParam = string[] | string;\n\nexport type WabaListParams = {\n fields?: WabaFieldsParam;\n filtering?: WabaGraphObject[] | string;\n sort?: string;\n limit?: number;\n after?: string;\n before?: string;\n};\n\nexport type WabaListResponse<T = WabaGraphObject> = {\n data: T[];\n paging?: Paging;\n summary?: WabaGraphObject;\n};\n\nexport type UpdateWabaAccountRequest = {\n name?: string;\n timezone_id?: string;\n [key: string]: unknown;\n};\n\nexport type AssignedUsersListParams = WabaListParams & {\n business: string;\n};\n\nexport type AssignedUserRequest = {\n user: string;\n tasks: string[];\n};\n\nexport type RemoveAssignedUserRequest = {\n user: string;\n [key: string]: unknown;\n};\n\nexport type CreateOBOMobilityIntentRequest = {\n intent?: string;\n [key: string]: unknown;\n};\n\nexport type SetOBOMobilityIntentRequest = {\n [key: string]: unknown;\n};\n\nexport type CreateScheduleRequest = {\n name?: string;\n schedule_type?: string;\n [key: string]: unknown;\n};\n\nexport type UpdateWhatsAppBusinessProfileRequest = {\n [key: string]: unknown;\n};\n\n/**\n * Interface defining all WABA API methods\n */\nexport interface WABAClass {\n getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;\n updateWabaAccount(params: UpdateWabaAccountRequest): Promise<ResponseSuccess>;\n getWabaActivities(params?: WabaListParams): Promise<WabaListResponse>;\n getAllWabaSubscriptions(): Promise<WabaSubscriptions>;\n updateWabaSubscription(params: UpdateWabaSubscription): Promise<ResponseSuccess>;\n unsubscribeFromWaba(): Promise<ResponseSuccess>;\n getAssignedUsers(params: AssignedUsersListParams, wabaId?: string): Promise<WabaListResponse>;\n addAssignedUser(params: AssignedUserRequest, wabaId?: string): Promise<ResponseSuccess>;\n removeAssignedUser(params: RemoveAssignedUserRequest, wabaId?: string): Promise<ResponseSuccess>;\n getInProgressOnBehalfRequests(params?: WabaListParams, wabaId?: string): Promise<WabaListResponse>;\n getOBOMobilityIntent(oboMobilityIntentId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;\n createOBOMobilityIntent(params: CreateOBOMobilityIntentRequest, wabaId?: string): Promise<WabaGraphObject>;\n setOBOMobilityIntent(params: SetOBOMobilityIntentRequest, wabaId?: string): Promise<WabaGraphObject>;\n getWabaSchedules(params?: WabaListParams, wabaId?: string): Promise<WabaListResponse>;\n createWabaSchedule(params: CreateScheduleRequest, wabaId?: string): Promise<WabaGraphObject>;\n getWhatsAppBusinessBotDetails(botId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;\n getWhatsAppBusinessProfileDetails(profileId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;\n updateWhatsAppBusinessProfile(\n profileId: string,\n params: UpdateWhatsAppBusinessProfileRequest,\n ): Promise<ResponseSuccess>;\n}\n","/**\n * As-const alternatives to enums.\n *\n * Every enum in enums.ts gets a matching `as const` object and a union type here.\n * Use whichever style you prefer:\n * - Enum: CategoryEnum.Marketing\n * - Const: Category.Marketing (value: 'MARKETING')\n * - Type: CategoryType (union: 'AUTHENTICATION' | 'MARKETING' | 'UTILITY')\n */\n\n// ---- Category ----\nexport const Category = {\n Authentication: 'AUTHENTICATION',\n Marketing: 'MARKETING',\n Utility: 'UTILITY',\n} as const;\nexport type CategoryType = (typeof Category)[keyof typeof Category];\n\n// ---- MessageCategory (Direct Send) ----\nexport const MessageCategory = {\n Authentication: 'authentication',\n Service: 'service',\n Utility: 'utility',\n} as const;\nexport type MessageCategoryType = (typeof MessageCategory)[keyof typeof MessageCategory];\n\n// ---- TemplateStatus ----\nexport const TemplateStatus = {\n Approved: 'APPROVED',\n Pending: 'PENDING',\n Rejected: 'REJECTED',\n} as const;\nexport type TemplateStatusType = (typeof TemplateStatus)[keyof typeof TemplateStatus];\n\n// ---- HttpMethods ----\nexport const HttpMethods = {\n Get: 'GET',\n Post: 'POST',\n Put: 'PUT',\n Delete: 'DELETE',\n} as const;\nexport type HttpMethodsType = (typeof HttpMethods)[keyof typeof HttpMethods];\n\n// ---- MessageTypes ----\nexport const MessageTypes = {\n Audio: 'audio',\n Contacts: 'contacts',\n Document: 'document',\n Image: 'image',\n Interactive: 'interactive',\n Location: 'location',\n Reaction: 'reaction',\n Sticker: 'sticker',\n Template: 'template',\n Text: 'text',\n Video: 'video',\n Button: 'button',\n Order: 'order',\n System: 'system',\n Unsupported: 'unsupported',\n Unknown: 'unknown',\n /** @deprecated Use WebhookProcessor.onStatus() instead */\n Statuses: 'statuses',\n All: '*',\n} as const;\nexport type MessageTypesType = (typeof MessageTypes)[keyof typeof MessageTypes];\n\n// ---- ParametersTypes ----\nexport const ParametersTypes = {\n Action: 'ACTION',\n CouponCode: 'COUPON_CODE',\n Currency: 'CURRENCY',\n DateTime: 'DATE_TIME',\n Document: 'DOCUMENT',\n ExpirationTimeMs: 'EXPIRATION_TIME_MS',\n Image: 'IMAGE',\n LimitedTimeOffer: 'LIMITED_TIME_OFFER',\n Location: 'LOCATION',\n OrderStatus: 'ORDER_STATUS',\n Payload: 'PAYLOAD',\n Product: 'PRODUCT',\n Text: 'TEXT',\n TtlMinutes: 'TTL_MINUTES',\n Video: 'VIDEO',\n WebviewInteraction: 'WEBVIEW_INTERACTION',\n WebviewPresentation: 'WEBVIEW_PRESENTATION',\n} as const;\nexport type ParametersTypesType = (typeof ParametersTypes)[keyof typeof ParametersTypes];\n\n// ---- InteractiveTypes ----\nexport const InteractiveTypes = {\n Button: 'button',\n List: 'list',\n Product: 'product',\n ProductList: 'product_list',\n CtaUrl: 'cta_url',\n Carousel: 'carousel',\n LocationRequest: 'location_request_message',\n AddressMessage: 'address_message',\n Flow: 'flow',\n VoiceCall: 'voice_call',\n} as const;\nexport type InteractiveTypesType = (typeof InteractiveTypes)[keyof typeof InteractiveTypes];\n\n// ---- ButtonPosition ----\nexport const ButtonPosition = {\n First: 1,\n Second: 2,\n Third: 3,\n Fourth: 4,\n Fifth: 5,\n} as const;\nexport type ButtonPositionType = (typeof ButtonPosition)[keyof typeof ButtonPosition];\n\n// ---- SubType ----\nexport const SubType = {\n Catalog: 'CATALOG',\n CopyCode: 'COPY_CODE',\n Flow: 'FLOW',\n Mpm: 'MPM',\n OrderDetails: 'ORDER_DETAILS',\n QuickReply: 'QUICK_REPLY',\n Reminder: 'REMINDER',\n Url: 'URL',\n VoiceCall: 'VOICE_CALL',\n} as const;\nexport type SubTypeType = (typeof SubType)[keyof typeof SubType];\n\n// ---- ComponentTypes (template) ----\nexport const ComponentType = {\n Header: 'HEADER',\n Body: 'BODY',\n Button: 'BUTTON',\n Footer: 'FOOTER',\n} as const;\nexport type ComponentTypeType = (typeof ComponentType)[keyof typeof ComponentType];\n\n// ---- ConversationTypes ----\nexport const ConversationTypes = {\n BusinessInitiated: 'business_initiated',\n CustomerInitiated: 'customer_initiated',\n ReferralConversion: 'referral_conversion',\n} as const;\nexport type ConversationTypesType = (typeof ConversationTypes)[keyof typeof ConversationTypes];\n\n// ---- Status ----\nexport const Status = {\n Delivered: 'delivered',\n Read: 'read',\n Sent: 'sent',\n} as const;\nexport type StatusType = (typeof Status)[keyof typeof Status];\n\n// ---- VideoMediaTypes ----\nexport const VideoMediaTypes = {\n Mp4: 'video/mp4',\n Threegp: 'video/3gp',\n} as const;\nexport type VideoMediaTypesType = (typeof VideoMediaTypes)[keyof typeof VideoMediaTypes];\n\n// ---- StickerMediaTypes ----\nexport const StickerMediaTypes = {\n Webp: 'image/webp',\n} as const;\nexport type StickerMediaTypesType = (typeof StickerMediaTypes)[keyof typeof StickerMediaTypes];\n\n// ---- ImageMediaTypes ----\nexport const ImageMediaTypes = {\n Jpeg: 'image/jpeg',\n Png: 'image/png',\n} as const;\nexport type ImageMediaTypesType = (typeof ImageMediaTypes)[keyof typeof ImageMediaTypes];\n\n// ---- DocumentMediaTypes ----\nexport const DocumentMediaTypes = {\n Text: 'text/plain',\n Pdf: 'application/pdf',\n Ppt: 'application/vnd.ms-powerpoint',\n Word: 'application/msword',\n Excel: 'application/vnd.ms-excel',\n OpenDoc: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n OpenPres: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n OpenSheet: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n} as const;\nexport type DocumentMediaTypesType = (typeof DocumentMediaTypes)[keyof typeof DocumentMediaTypes];\n\n// ---- AudioMediaTypes ----\nexport const AudioMediaTypes = {\n Aac: 'audio/aac',\n Mp4: 'audio/mp4',\n Mpeg: 'audio/mpeg',\n Amr: 'audio/amr',\n Ogg: 'audio/ogg',\n} as const;\nexport type AudioMediaTypesType = (typeof AudioMediaTypes)[keyof typeof AudioMediaTypes];\n\n// ---- WebhookTypes ----\nexport const WebhookTypes = {\n Audio: 'audio',\n Button: 'button',\n Document: 'document',\n Text: 'text',\n Image: 'image',\n Interactive: 'interactive',\n Order: 'order',\n Sticker: 'sticker',\n System: 'system',\n Unknown: 'unknown',\n Video: 'video',\n} as const;\nexport type WebhookTypesType = (typeof WebhookTypes)[keyof typeof WebhookTypes];\n\n// ---- SystemChangeTypes ----\nexport const SystemChangeTypes = {\n /** @deprecated Meta renamed this to `user_changed_number`. Use `UserChangedNumber`. */\n CustomerChangedNumber: 'customer_changed_number',\n /** @deprecated Meta renamed this to `user_identity_changed`. Use `UserIdentityChanged`. */\n CustomerIdentityChanged: 'customer_identity_changed',\n UserChangedNumber: 'user_changed_number',\n UserIdentityChanged: 'user_identity_changed',\n /** The user's business-scoped user ID (BSUID) changed. */\n UserChangedUserId: 'user_changed_user_id',\n} as const;\nexport type SystemChangeTypesType = (typeof SystemChangeTypes)[keyof typeof SystemChangeTypes];\n\n// ---- ReferralSourceTypes ----\nexport const ReferralSourceTypes = {\n Ad: 'ad',\n Post: 'post',\n} as const;\nexport type ReferralSourceTypesType = (typeof ReferralSourceTypes)[keyof typeof ReferralSourceTypes];\n\n// ---- RequestCodeMethods ----\nexport const RequestCodeMethods = {\n Sms: 'SMS',\n Voice: 'VOICE',\n} as const;\nexport type RequestCodeMethodsType = (typeof RequestCodeMethods)[keyof typeof RequestCodeMethods];\n\n// ---- Languages ----\nexport const Languages = {\n Afrikaans: 'af',\n Albanian: 'sq',\n Arabic: 'ar',\n Azerbaijani: 'az',\n Bengali: 'bn',\n Bulgarian: 'bg',\n Catalan: 'ca',\n Chinese_CHN: 'zh_CN',\n Chinese_HKG: 'zh_HK',\n Chinese_TAI: 'zh_TW',\n Croatian: 'hr',\n Czech: 'cs',\n Danish: 'da',\n Dutch: 'nl',\n English: 'en',\n English_UK: 'en_GB',\n English_US: 'en_US',\n Estonian: 'et',\n Filipino: 'fil',\n Finnish: 'fi',\n French: 'fr',\n Georgian: 'ka',\n German: 'de',\n Greek: 'el',\n Gujarati: 'gu',\n Hausa: 'ha',\n Hebrew: 'he',\n Hindi: 'hi',\n Hungarian: 'hu',\n Indonesian: 'id',\n Irish: 'ga',\n Italian: 'it',\n Japanese: 'ja',\n Kannada: 'kn',\n Kazakh: 'kk',\n Kinyarwanda: 'rw_RW',\n Korean: 'ko',\n Kyrgyz_Kyrgyzstan: 'ky_KG',\n Lao: 'lo',\n Latvian: 'lv',\n Lithuanian: 'lt',\n Macedonian: 'mk',\n Malay: 'ms',\n Malayalam: 'ml',\n Marathi: 'mr',\n Norwegian: 'nb',\n Persian: 'fa',\n Polish: 'pl',\n Portuguese_BR: 'pt_BR',\n Portuguese_POR: 'pt_PT',\n Punjabi: 'pa',\n Romanian: 'ro',\n Russian: 'ru',\n Serbian: 'sr',\n Slovak: 'sk',\n Slovenian: 'sl',\n Spanish: 'es',\n Spanish_ARG: 'es_AR',\n Spanish_SPA: 'es_ES',\n Spanish_MEX: 'es_MX',\n Swahili: 'sw',\n Swedish: 'sv',\n Tamil: 'ta',\n Telugu: 'te',\n Thai: 'th',\n Turkish: 'tr',\n Ukrainian: 'uk',\n Urdu: 'ur',\n Uzbek: 'uz',\n Vietnamese: 'vi',\n Zulu: 'zu',\n} as const;\nexport type LanguagesType = (typeof Languages)[keyof typeof Languages];\n\n// ---- DataLocalizationRegion ----\nexport const DataLocalizationRegion = {\n AU: 'AU',\n ID: 'ID',\n IN: 'IN',\n JP: 'JP',\n SG: 'SG',\n KR: 'KR',\n DE: 'DE',\n CH: 'CH',\n GB: 'GB',\n BR: 'BR',\n BH: 'BH',\n ZA: 'ZA',\n AE: 'AE',\n CA: 'CA',\n} as const;\nexport type DataLocalizationRegionType = (typeof DataLocalizationRegion)[keyof typeof DataLocalizationRegion];\n"],"mappings":"yoBAQA,IAAY,EAAL,SAAA,EAAA,OACH,GAAA,MAAA,QACA,EAAA,UAAA,YACA,EAAA,UAAA,YACA,EAAA,QAAA,UACA,EAAA,WAAA,cACJ,EAAA,CAAA,CAAA,EAKY,EAAL,SAAA,EAAA,OACH,GAAA,OAAA,UACA,EAAA,OAAA,UACA,EAAA,mBAAA,sBACA,EAAA,eAAA,kBACA,EAAA,UAAA,aACA,EAAA,gBAAA,mBACA,EAAA,OAAA,SACA,EAAA,MAAA,SACJ,EAAA,CAAA,CAAA,EAEY,EAAL,SAAA,EAAA,OACH,GAAA,KAAA,OACA,EAAA,KAAA,OACA,EAAA,cAAA,iBACJ,EAAA,CAAA,CAAA,EAMY,EAAL,SAAA,EAAA,OAEH,GAAA,KAAA,OAEA,EAAA,OAAA,gBAEA,EAAA,MAAA,QAEA,EAAA,IAAA,KACJ,EAAA,CAAA,CAAA,ECdY,EAAL,SAAA,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SAAU,KACV,SAAU,MACV,QAAS,KACT,OAAQ,KACR,SAAU,KACV,OAAQ,KACR,MAAO,KACP,SAAU,KACV,MAAO,KACP,OAAQ,KACR,MAAO,KACP,UAAW,KACX,WAAY,KACZ,MAAO,KACP,QAAS,KACT,SAAU,KACV,QAAS,KACT,OAAQ,KACR,YAAa,QACb,OAAQ,KACR,kBAAmB,QACnB,IAAK,KACL,QAAS,KACT,WAAY,KACZ,WAAY,KACZ,MAAO,KACP,UAAW,KACX,QAAS,KACT,UAAW,KACX,QAAS,KACT,OAAQ,KACR,cAAe,QACf,eAAgB,QAChB,QAAS,KACT,SAAU,KACV,QAAS,KACT,QAAS,KACT,OAAQ,KACR,UAAW,KACX,QAAS,KACT,YAAa,QACb,YAAa,QACb,YAAa,QACb,QAAS,KACT,QAAS,KACT,MAAO,KACP,OAAQ,KACR,KAAM,KACN,QAAS,KACT,UAAW,KACX,KAAM,KACN,MAAO,KACP,WAAY,KACZ,KAAM,IACV,EAIa,GAAyB,CAClC,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,IACR"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/api/flow/types/common.ts","../../src/api/waba/types/common.ts","../../src/types/constants.ts"],"sourcesContent":["// Docs: https://developers.facebook.com/documentation/business-messaging/whatsapp/flows/\n\nimport type { IncomingHttpHeaders, IncomingMessage } from 'node:http';\nimport type { ResponseSuccess } from '../../../types';\n\n/**\n * Enum for Flow Status\n */\nexport enum FlowStatusEnum {\n Draft = 'DRAFT',\n Published = 'PUBLISHED',\n Throttled = 'THROTTLED',\n Blocked = 'BLOCKED',\n Deprecated = 'DEPRECATED',\n}\n\n/**\n * Enum for Flow Categories\n */\nexport enum FlowCategoryEnum {\n SignUp = 'SIGN_UP',\n SignIn = 'SIGN_IN',\n AppointmentBooking = 'APPOINTMENT_BOOKING',\n LeadGeneration = 'LEAD_GENERATION',\n ContactUs = 'CONTACT_US',\n CustomerSupport = 'CUSTOMER_SUPPORT',\n Survey = 'SURVEY',\n Other = 'OTHER',\n}\n\nexport enum FlowActionEnum {\n INIT = 'INIT',\n BACK = 'BACK',\n DATA_EXCHANGE = 'data_exchange',\n}\n\n/**\n * Enum for Flow Types in webhook handlers\n * Used to register handlers for specific flow events\n */\nexport enum FlowTypeEnum {\n /** Health check/ping requests */\n Ping = 'ping',\n /** Data exchange requests */\n Change = 'data_exchange',\n /** Error notification requests */\n Error = 'error',\n /** Match all flow action types */\n All = '*',\n}\n\nexport type FlowType = (typeof FlowTypeEnum)[keyof typeof FlowTypeEnum];\n\n/**\n * Flow Validation Error Pointer\n */\nexport interface FlowValidationErrorPointer {\n line_start: number;\n line_end: number;\n column_start: number;\n column_end: number;\n path: string;\n}\n\n/**\n * Flow Validation Error\n */\nexport interface FlowValidationError {\n error: string;\n error_type: string;\n message: string;\n line_start: number;\n line_end: number;\n column_start: number;\n column_end: number;\n pointers: FlowValidationErrorPointer[];\n}\n\n/**\n * Flow Item\n */\nexport interface Flow {\n id: string;\n name: string;\n status: FlowStatusEnum;\n categories: FlowCategoryEnum[];\n validation_errors: FlowValidationError[];\n}\n\n/**\n * Pagination Cursors\n */\nexport interface PaginationCursors {\n before: string;\n after: string;\n}\n\n/**\n * Pagination Object\n */\nexport interface Pagination {\n cursors: PaginationCursors;\n}\n\n/**\n * Flows List Response\n */\nexport interface FlowsListResponse {\n data: Flow[];\n paging: Pagination;\n}\n\n/**\n * Flow Asset\n */\nexport interface FlowAsset {\n name: string;\n asset_type: string;\n download_url: string;\n}\n\n/**\n * Flow Assets Response\n */\nexport interface FlowAssetsResponse {\n data: FlowAsset[];\n paging: Pagination;\n}\n\n/**\n * Flow Preview\n */\nexport interface FlowPreview {\n preview_url: string;\n expires_at: string;\n}\n\n/**\n * Flow Preview Response\n */\nexport interface FlowPreviewResponse {\n preview: FlowPreview;\n id: string;\n}\n\n/**\n * Flow Migration Result\n */\nexport interface FlowMigrationResult {\n source_name: string;\n source_id: string;\n migrated_id: string;\n}\n\n/**\n * Flow Migration Failure\n */\nexport interface FlowMigrationFailure {\n source_name: string;\n error_code: string;\n error_message: string;\n}\n\n/**\n * Create Flow Response\n */\nexport interface CreateFlowResponse {\n id: string;\n success: boolean;\n validation_errors?: FlowValidationError[];\n}\n\n/**\n * Update Flow Response\n */\nexport interface UpdateFlowResponse {\n success: boolean;\n validation_errors?: FlowValidationError[];\n}\n\n/**\n * Flow Migration Response\n */\nexport interface FlowMigrationResponse {\n migrated_flows: FlowMigrationResult[];\n failed_flows: FlowMigrationFailure[];\n}\n\n/**\n * Validate Flow JSON Response\n */\nexport interface ValidateFlowJsonResponse {\n valid: boolean;\n success: boolean;\n validation_errors?: FlowValidationError[];\n}\n\n/**\n * WhatsApp Flow Endpoint - Encrypted Request Payload\n * Represents the raw encrypted data received from WhatsApp\n */\nexport interface FlowEncryptedRequestPayload {\n encrypted_aes_key: string;\n encrypted_flow_data: string;\n initial_vector: string;\n}\n\n/**\n * WhatsApp Flow Endpoint - Decrypted Request Response\n * Represents the successfully decrypted data and encryption keys\n */\nexport interface FlowDecryptedRequestResponse {\n decryptedBody: any;\n aesKeyBuffer: Buffer;\n initialVectorBuffer: Buffer;\n}\n\n/**\n * WhatsApp Flow Endpoint - HTTP Request with Body\n * Represents an HTTP request with the encrypted payload\n */\nexport interface FlowHttpRequest extends IncomingMessage {\n body: FlowEncryptedRequestPayload;\n headers: IncomingHttpHeaders;\n}\n\n/**\n * WhatsApp Flow Endpoint - Health Check Request\n * Represents the structure of a health check request\n */\nexport interface FlowHealthCheckRequest {\n action: 'ping';\n version: '3.0';\n}\n\n/**\n * WhatsApp Flow Endpoint - Health Check Response\n * The expected response structure for health check requests\n */\nexport interface FlowHealthCheckResponse {\n data: {\n status: 'active';\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Data Exchange Request\n * Represents the structure of a data exchange request\n */\nexport interface FlowDataExchangeRequest {\n version: '3.0';\n action: FlowActionEnum;\n screen: string;\n flow_token: string;\n data?: Record<string, any> & { error_message?: string };\n}\n\n/**\n * WhatsApp Flow Endpoint - Data Exchange Response\n * The expected response structure for data exchange requests\n */\nexport interface FlowDataExchangeResponse {\n screen?: string;\n data?: Record<string, any | { error_message?: string }>;\n}\n\n/**\n * WhatsApp Flow Endpoint - Success Screen Response\n * The expected response structure for success screen requests\n */\nexport interface FlowSuccessScreenResponse {\n screen: 'SUCCESS';\n data: {\n extension_message_response?: {\n params?: {\n flow_token: string;\n [key: string]: string;\n };\n };\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Error Notification Request\n * Represents the structure of an error notification request\n */\nexport interface FlowErrorNotificationRequest {\n version: '3.0';\n action: Exclude<FlowActionEnum, FlowActionEnum.BACK>;\n screen: string;\n flow_token: string;\n data: {\n error: string;\n error_message: string;\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Error Notification Response\n * The expected response structure for error notification requests\n */\nexport interface FlowErrorNotificationResponse {\n acknowledged: boolean;\n}\n\n/**\n * WhatsApp Flow Endpoint - Comprehensive Request Object\n * A combined type that includes all possible fields from different request types\n * with all fields being optional for flexibility\n */\nexport interface FlowEndpointRequest {\n // Common fields\n version?: '3.0';\n action?: 'ping' | FlowActionEnum;\n\n screen?: string;\n flow_token?: string;\n\n data?: Record<string, any> & {\n error_key?: string;\n error_message?: string;\n };\n}\n\n/**\n * WhatsApp Flow Endpoint - Response\n * Union type for all possible response types from a Flow endpoint\n */\nexport type FlowEndpointResponse =\n | FlowHealthCheckResponse\n | FlowDataExchangeResponse\n | FlowErrorNotificationResponse\n | FlowSuccessScreenResponse;\n\nexport interface FlowClass {\n /**\n * List Flows\n *\n * @param wabaId - The WABA ID\n * @returns Promise with the list of flows\n */\n listFlows(wabaId: string): Promise<FlowsListResponse>;\n\n /**\n * Create Flow\n *\n * @param wabaId - The WABA ID\n * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id\n * @returns Promise with the created flow ID\n */\n createFlow(\n wabaId: string,\n data: {\n name: string;\n categories?: FlowCategoryEnum[];\n endpoint_uri?: string;\n clone_flow_id?: string;\n flow_json?: string;\n publish?: boolean;\n },\n ): Promise<CreateFlowResponse>;\n\n /**\n * Get Flow\n *\n * @param flowId - The flow ID\n * @param fields - Optional fields to return\n * @param dateFormat - Optional date format\n * @returns Promise with the flow details\n */\n getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;\n\n /**\n * Update Flow Metadata\n *\n * @param flowId - The flow ID\n * @param data - The flow metadata to update\n * @returns Promise with the success status\n */\n updateFlowMetadata(\n flowId: string,\n data: {\n name?: string;\n categories?: FlowCategoryEnum[];\n endpoint_uri?: string;\n application_id?: string;\n },\n ): Promise<ResponseSuccess>;\n\n /**\n * Delete Flow\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n deleteFlow(flowId: string): Promise<ResponseSuccess>;\n\n /**\n * List Assets (Get Flow JSON URL)\n *\n * @param flowId - The flow ID\n * @returns Promise with the list of assets\n */\n listAssets(flowId: string): Promise<FlowAssetsResponse>;\n\n /**\n * Update Flow JSON\n *\n * @param flowId - The flow ID\n * @param data - The asset data including asset_type, file, and name\n * @returns Promise with the success status and validation errors\n */\n updateFlowJson(\n flowId: string,\n data: {\n file: Blob | Uint8Array | object;\n name?: string;\n },\n ): Promise<UpdateFlowResponse>;\n\n /**\n * Validate Flow JSON by attempting an update without publishing.\n * This is a convenience method; the API doesn't have a dedicated validation endpoint.\n *\n * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).\n * @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.\n * @returns Promise indicating if the JSON is valid and includes validation errors if any.\n */\n validateFlowJson(flowId: string, flowJsonData: Blob | Uint8Array | object): Promise<ValidateFlowJsonResponse>;\n\n /**\n * Publish Flow\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n publishFlow(flowId: string): Promise<ResponseSuccess>;\n\n /**\n * Deprecate Flow\n *\n * @param flowId - The flow ID\n * @returns Promise with the success status\n */\n deprecateFlow(flowId: string): Promise<ResponseSuccess>;\n\n /**\n * Migrate Flows\n *\n * @param wabaId - The destination WABA ID\n * @param data - The migration data including source_waba_id and optional source_flow_names\n * @returns Promise with migration results\n */\n migrateFlows(\n wabaId: string,\n data: {\n source_waba_id: string;\n source_flow_names?: string[];\n },\n ): Promise<FlowMigrationResponse>;\n}\n","// Docs: https://developers.facebook.com/documentation/business-messaging/whatsapp/whatsapp-business-accounts/\n\nimport type { Paging, ResponseSuccess } from '../../../types/request';\n\n/**\n * WhatsApp Business Account subscription configuration\n */\nexport type WabaSubscription = {\n whatsapp_business_api_data: {\n id: string;\n link: string;\n name: string;\n category: string;\n };\n override_callback_uri?: string;\n};\n\n/**\n * Parameters for updating WABA subscription\n */\nexport interface UpdateWabaSubscription {\n override_callback_uri: string;\n verify_token: string;\n}\n\n/**\n * Response containing all WABA subscriptions\n */\nexport interface WabaSubscriptions {\n data: Array<WabaSubscription>;\n}\n\n/**\n * WABA account review status enumeration\n */\nexport enum WabaAccountReviewStatus {\n Approved = 'APPROVED',\n Active = 'ACTIVE',\n Inactive = 'INACTIVE',\n Disabled = 'DISABLED',\n}\n\n/**\n * WABA health status for message sending capability\n */\nexport enum WabaHealthStatusCanSendMessage {\n Blocked = 'BLOCKED',\n Limited = 'LIMITED',\n Available = 'AVAILABLE',\n}\n\n/**\n * WABA account status enumeration\n */\nexport enum WabaAccountStatus {\n Approved = 'APPROVED',\n Active = 'ACTIVE',\n Inactive = 'INACTIVE',\n Disabled = 'DISABLED',\n}\n\n/**\n * Business verification status enumeration\n */\nexport enum WabaBusinessVerificationStatus {\n Verified = 'verified',\n PendingSubmission = 'pending_submission',\n Unverified = 'unverified',\n Rejected = 'rejected',\n}\n\n/**\n * WABA health status error details\n */\nexport interface WabaHealthStatusError {\n error_code?: number;\n error_description?: string;\n possible_solution?: string;\n}\n\n/**\n * WABA health status entity information\n */\nexport interface WabaHealthStatusEntity {\n entity_type?: string;\n id?: string;\n can_send_message?: string;\n errors?: WabaHealthStatusError[];\n}\n\n/**\n * Overall WABA health status\n */\nexport interface WabaHealthStatus {\n can_send_message?: WabaHealthStatusCanSendMessage;\n entities?: WabaHealthStatusEntity[];\n}\n\n/**\n * WhatsApp Business Account information\n */\nexport interface WabaAccount {\n account_review_status?: WabaAccountReviewStatus;\n id?: string;\n health_status?: WabaHealthStatus;\n status?: WabaAccountStatus;\n business_verification_status?: WabaBusinessVerificationStatus;\n message_template_namespace?: string;\n name?: string;\n ownership_type?: string;\n timezone_id?: string;\n primary_business_location?: Record<string, unknown> | string;\n currency?: string;\n country?: string;\n analytics?: Record<string, unknown>;\n is_enabled_for_insights?: boolean;\n is_shared_with_partners?: boolean;\n marketing_messages_lite_api_status?: string;\n marketing_messages_onboarding_status?: string;\n on_behalf_of_business_info?: Record<string, unknown>;\n primary_funding_id?: string;\n purchase_order_number?: string;\n whatsapp_business_manager_messaging_limit?: string;\n}\n\n/**\n * Available fields for WABA account queries\n */\nexport type WabaAccountFields =\n | 'id'\n | 'name'\n | 'timezone_id'\n | 'account_review_status'\n | 'auth_international_rate_eligibility'\n | 'business_verification_status'\n | 'country'\n | 'currency'\n | 'health_status'\n | 'status'\n | 'ownership_type'\n | 'message_template_namespace'\n | 'primary_business_location'\n | 'analytics'\n | 'is_enabled_for_insights'\n | 'is_shared_with_partners'\n | 'marketing_messages_lite_api_status'\n | 'marketing_messages_onboarding_status'\n | 'on_behalf_of_business_info'\n | 'primary_funding_id'\n | 'purchase_order_number'\n | 'whatsapp_business_manager_messaging_limit';\n\n/**\n * Parameter type for specifying which WABA account fields to retrieve\n */\nexport type WabaAccountFieldsParam = WabaAccountFields[];\n\nexport type WabaGraphObject = Record<string, unknown>;\n\nexport type WabaFieldsParam = string[] | string;\n\nexport type WabaListParams = {\n fields?: WabaFieldsParam;\n filtering?: WabaGraphObject[] | string;\n sort?: string;\n limit?: number;\n after?: string;\n before?: string;\n};\n\nexport type WabaListResponse<T = WabaGraphObject> = {\n data: T[];\n paging?: Paging;\n summary?: WabaGraphObject;\n};\n\nexport type UpdateWabaAccountRequest = {\n name?: string;\n timezone_id?: string;\n [key: string]: unknown;\n};\n\nexport type AssignedUsersListParams = WabaListParams & {\n business: string;\n};\n\nexport type AssignedUserRequest = {\n user: string;\n tasks: string[];\n};\n\nexport type RemoveAssignedUserRequest = {\n user: string;\n [key: string]: unknown;\n};\n\nexport type CreateOBOMobilityIntentRequest = {\n intent?: string;\n [key: string]: unknown;\n};\n\nexport type SetOBOMobilityIntentRequest = {\n [key: string]: unknown;\n};\n\nexport type CreateScheduleRequest = {\n name?: string;\n schedule_type?: string;\n [key: string]: unknown;\n};\n\nexport type UpdateWhatsAppBusinessProfileRequest = {\n [key: string]: unknown;\n};\n\n/**\n * Interface defining all WABA API methods\n */\nexport interface WABAClass {\n getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;\n updateWabaAccount(params: UpdateWabaAccountRequest): Promise<ResponseSuccess>;\n getWabaActivities(params?: WabaListParams): Promise<WabaListResponse>;\n getAllWabaSubscriptions(): Promise<WabaSubscriptions>;\n updateWabaSubscription(params: UpdateWabaSubscription): Promise<ResponseSuccess>;\n unsubscribeFromWaba(): Promise<ResponseSuccess>;\n getAssignedUsers(params: AssignedUsersListParams, wabaId?: string): Promise<WabaListResponse>;\n addAssignedUser(params: AssignedUserRequest, wabaId?: string): Promise<ResponseSuccess>;\n removeAssignedUser(params: RemoveAssignedUserRequest, wabaId?: string): Promise<ResponseSuccess>;\n getInProgressOnBehalfRequests(params?: WabaListParams, wabaId?: string): Promise<WabaListResponse>;\n getOBOMobilityIntent(oboMobilityIntentId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;\n createOBOMobilityIntent(params: CreateOBOMobilityIntentRequest, wabaId?: string): Promise<WabaGraphObject>;\n setOBOMobilityIntent(params: SetOBOMobilityIntentRequest, wabaId?: string): Promise<WabaGraphObject>;\n getWabaSchedules(params?: WabaListParams, wabaId?: string): Promise<WabaListResponse>;\n createWabaSchedule(params: CreateScheduleRequest, wabaId?: string): Promise<WabaGraphObject>;\n getWhatsAppBusinessBotDetails(botId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;\n getWhatsAppBusinessProfileDetails(profileId: string, fields?: WabaFieldsParam): Promise<WabaGraphObject>;\n updateWhatsAppBusinessProfile(\n profileId: string,\n params: UpdateWhatsAppBusinessProfileRequest,\n ): Promise<ResponseSuccess>;\n}\n","/**\n * As-const alternatives to enums.\n *\n * Every enum in enums.ts gets a matching `as const` object and a union type here.\n * Use whichever style you prefer:\n * - Enum: CategoryEnum.Marketing\n * - Const: Category.Marketing (value: 'MARKETING')\n * - Type: CategoryType (union: 'AUTHENTICATION' | 'MARKETING' | 'UTILITY')\n */\n\n// ---- Category ----\nexport const Category = {\n Authentication: 'AUTHENTICATION',\n Marketing: 'MARKETING',\n Utility: 'UTILITY',\n} as const;\nexport type CategoryType = (typeof Category)[keyof typeof Category];\n\n// ---- MessageCategory (Direct Send) ----\nexport const MessageCategory = {\n Authentication: 'authentication',\n Service: 'service',\n Utility: 'utility',\n} as const;\nexport type MessageCategoryType = (typeof MessageCategory)[keyof typeof MessageCategory];\n\n// ---- TemplateStatus ----\nexport const TemplateStatus = {\n Approved: 'APPROVED',\n Pending: 'PENDING',\n Rejected: 'REJECTED',\n} as const;\nexport type TemplateStatusType = (typeof TemplateStatus)[keyof typeof TemplateStatus];\n\n// ---- HttpMethods ----\nexport const HttpMethods = {\n Get: 'GET',\n Post: 'POST',\n Put: 'PUT',\n Delete: 'DELETE',\n} as const;\nexport type HttpMethodsType = (typeof HttpMethods)[keyof typeof HttpMethods];\n\n// ---- MessageTypes ----\nexport const MessageTypes = {\n Audio: 'audio',\n Contacts: 'contacts',\n Document: 'document',\n Image: 'image',\n Interactive: 'interactive',\n Location: 'location',\n Reaction: 'reaction',\n Sticker: 'sticker',\n Template: 'template',\n Text: 'text',\n Video: 'video',\n Button: 'button',\n Order: 'order',\n System: 'system',\n Unsupported: 'unsupported',\n Unknown: 'unknown',\n /** @deprecated Use WebhookProcessor.onStatus() instead */\n Statuses: 'statuses',\n All: '*',\n} as const;\nexport type MessageTypesType = (typeof MessageTypes)[keyof typeof MessageTypes];\n\n// ---- ParametersTypes ----\nexport const ParametersTypes = {\n Action: 'ACTION',\n CouponCode: 'COUPON_CODE',\n Currency: 'CURRENCY',\n DateTime: 'DATE_TIME',\n Document: 'DOCUMENT',\n ExpirationTimeMs: 'EXPIRATION_TIME_MS',\n Image: 'IMAGE',\n LimitedTimeOffer: 'LIMITED_TIME_OFFER',\n Location: 'LOCATION',\n OrderStatus: 'ORDER_STATUS',\n Payload: 'PAYLOAD',\n Product: 'PRODUCT',\n Text: 'TEXT',\n TtlMinutes: 'TTL_MINUTES',\n Video: 'VIDEO',\n WebviewInteraction: 'WEBVIEW_INTERACTION',\n WebviewPresentation: 'WEBVIEW_PRESENTATION',\n} as const;\nexport type ParametersTypesType = (typeof ParametersTypes)[keyof typeof ParametersTypes];\n\n// ---- InteractiveTypes ----\nexport const InteractiveTypes = {\n Button: 'button',\n List: 'list',\n Product: 'product',\n ProductList: 'product_list',\n CtaUrl: 'cta_url',\n Carousel: 'carousel',\n LocationRequest: 'location_request_message',\n AddressMessage: 'address_message',\n Flow: 'flow',\n VoiceCall: 'voice_call',\n} as const;\nexport type InteractiveTypesType = (typeof InteractiveTypes)[keyof typeof InteractiveTypes];\n\n// ---- ButtonPosition ----\nexport const ButtonPosition = {\n First: 1,\n Second: 2,\n Third: 3,\n Fourth: 4,\n Fifth: 5,\n} as const;\nexport type ButtonPositionType = (typeof ButtonPosition)[keyof typeof ButtonPosition];\n\n// ---- SubType ----\nexport const SubType = {\n Catalog: 'CATALOG',\n CopyCode: 'COPY_CODE',\n Flow: 'FLOW',\n Mpm: 'MPM',\n OrderDetails: 'ORDER_DETAILS',\n QuickReply: 'QUICK_REPLY',\n Reminder: 'REMINDER',\n Url: 'URL',\n VoiceCall: 'VOICE_CALL',\n} as const;\nexport type SubTypeType = (typeof SubType)[keyof typeof SubType];\n\n// ---- ComponentTypes (template) ----\nexport const ComponentType = {\n Header: 'HEADER',\n Body: 'BODY',\n Button: 'BUTTON',\n Footer: 'FOOTER',\n} as const;\nexport type ComponentTypeType = (typeof ComponentType)[keyof typeof ComponentType];\n\n// ---- ConversationTypes ----\nexport const ConversationTypes = {\n BusinessInitiated: 'business_initiated',\n CustomerInitiated: 'customer_initiated',\n ReferralConversion: 'referral_conversion',\n} as const;\nexport type ConversationTypesType = (typeof ConversationTypes)[keyof typeof ConversationTypes];\n\n// ---- Status ----\nexport const Status = {\n Delivered: 'delivered',\n Read: 'read',\n Sent: 'sent',\n} as const;\nexport type StatusType = (typeof Status)[keyof typeof Status];\n\n// ---- VideoMediaTypes ----\nexport const VideoMediaTypes = {\n Mp4: 'video/mp4',\n Threegp: 'video/3gp',\n} as const;\nexport type VideoMediaTypesType = (typeof VideoMediaTypes)[keyof typeof VideoMediaTypes];\n\n// ---- StickerMediaTypes ----\nexport const StickerMediaTypes = {\n Webp: 'image/webp',\n} as const;\nexport type StickerMediaTypesType = (typeof StickerMediaTypes)[keyof typeof StickerMediaTypes];\n\n// ---- ImageMediaTypes ----\nexport const ImageMediaTypes = {\n Jpeg: 'image/jpeg',\n Png: 'image/png',\n} as const;\nexport type ImageMediaTypesType = (typeof ImageMediaTypes)[keyof typeof ImageMediaTypes];\n\n// ---- DocumentMediaTypes ----\nexport const DocumentMediaTypes = {\n Text: 'text/plain',\n Pdf: 'application/pdf',\n Ppt: 'application/vnd.ms-powerpoint',\n Word: 'application/msword',\n Excel: 'application/vnd.ms-excel',\n OpenDoc: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n OpenPres: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n OpenSheet: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n} as const;\nexport type DocumentMediaTypesType = (typeof DocumentMediaTypes)[keyof typeof DocumentMediaTypes];\n\n// ---- AudioMediaTypes ----\nexport const AudioMediaTypes = {\n Aac: 'audio/aac',\n Mp4: 'audio/mp4',\n Mpeg: 'audio/mpeg',\n Amr: 'audio/amr',\n Ogg: 'audio/ogg',\n} as const;\nexport type AudioMediaTypesType = (typeof AudioMediaTypes)[keyof typeof AudioMediaTypes];\n\n// ---- WebhookTypes ----\nexport const WebhookTypes = {\n Audio: 'audio',\n Button: 'button',\n Document: 'document',\n Text: 'text',\n Image: 'image',\n Interactive: 'interactive',\n Order: 'order',\n Sticker: 'sticker',\n System: 'system',\n Unknown: 'unknown',\n Video: 'video',\n} as const;\nexport type WebhookTypesType = (typeof WebhookTypes)[keyof typeof WebhookTypes];\n\n// ---- SystemChangeTypes ----\nexport const SystemChangeTypes = {\n /** @deprecated Meta renamed this to `user_changed_number`. Use `UserChangedNumber`. */\n CustomerChangedNumber: 'customer_changed_number',\n /** @deprecated Meta renamed this to `user_identity_changed`. Use `UserIdentityChanged`. */\n CustomerIdentityChanged: 'customer_identity_changed',\n UserChangedNumber: 'user_changed_number',\n UserIdentityChanged: 'user_identity_changed',\n /** The user's business-scoped user ID (BSUID) changed. */\n UserChangedUserId: 'user_changed_user_id',\n} as const;\nexport type SystemChangeTypesType = (typeof SystemChangeTypes)[keyof typeof SystemChangeTypes];\n\n// ---- ReferralSourceTypes ----\nexport const ReferralSourceTypes = {\n Ad: 'ad',\n Post: 'post',\n} as const;\nexport type ReferralSourceTypesType = (typeof ReferralSourceTypes)[keyof typeof ReferralSourceTypes];\n\n// ---- RequestCodeMethods ----\nexport const RequestCodeMethods = {\n Sms: 'SMS',\n Voice: 'VOICE',\n} as const;\nexport type RequestCodeMethodsType = (typeof RequestCodeMethods)[keyof typeof RequestCodeMethods];\n\n// ---- Languages ----\nexport const Languages = {\n Afrikaans: 'af',\n Albanian: 'sq',\n Arabic: 'ar',\n Azerbaijani: 'az',\n Bengali: 'bn',\n Bulgarian: 'bg',\n Catalan: 'ca',\n Chinese_CHN: 'zh_CN',\n Chinese_HKG: 'zh_HK',\n Chinese_TAI: 'zh_TW',\n Croatian: 'hr',\n Czech: 'cs',\n Danish: 'da',\n Dutch: 'nl',\n English: 'en',\n English_UK: 'en_GB',\n English_US: 'en_US',\n Estonian: 'et',\n Filipino: 'fil',\n Finnish: 'fi',\n French: 'fr',\n Georgian: 'ka',\n German: 'de',\n Greek: 'el',\n Gujarati: 'gu',\n Hausa: 'ha',\n Hebrew: 'he',\n Hindi: 'hi',\n Hungarian: 'hu',\n Indonesian: 'id',\n Irish: 'ga',\n Italian: 'it',\n Japanese: 'ja',\n Kannada: 'kn',\n Kazakh: 'kk',\n Kinyarwanda: 'rw_RW',\n Korean: 'ko',\n Kyrgyz_Kyrgyzstan: 'ky_KG',\n Lao: 'lo',\n Latvian: 'lv',\n Lithuanian: 'lt',\n Macedonian: 'mk',\n Malay: 'ms',\n Malayalam: 'ml',\n Marathi: 'mr',\n Norwegian: 'nb',\n Persian: 'fa',\n Polish: 'pl',\n Portuguese_BR: 'pt_BR',\n Portuguese_POR: 'pt_PT',\n Punjabi: 'pa',\n Romanian: 'ro',\n Russian: 'ru',\n Serbian: 'sr',\n Slovak: 'sk',\n Slovenian: 'sl',\n Spanish: 'es',\n Spanish_ARG: 'es_AR',\n Spanish_SPA: 'es_ES',\n Spanish_MEX: 'es_MX',\n Swahili: 'sw',\n Swedish: 'sv',\n Tamil: 'ta',\n Telugu: 'te',\n Thai: 'th',\n Turkish: 'tr',\n Ukrainian: 'uk',\n Urdu: 'ur',\n Uzbek: 'uz',\n Vietnamese: 'vi',\n Zulu: 'zu',\n} as const;\nexport type LanguagesType = (typeof Languages)[keyof typeof Languages];\n\n// ---- DataLocalizationRegion ----\nexport const DataLocalizationRegion = {\n AU: 'AU',\n ID: 'ID',\n IN: 'IN',\n JP: 'JP',\n SG: 'SG',\n KR: 'KR',\n DE: 'DE',\n CH: 'CH',\n GB: 'GB',\n BR: 'BR',\n BH: 'BH',\n ZA: 'ZA',\n AE: 'AE',\n CA: 'CA',\n} as const;\nexport type DataLocalizationRegionType = (typeof DataLocalizationRegion)[keyof typeof DataLocalizationRegion];\n"],"mappings":"yoBAQA,IAAY,EAAL,SAAA,EAAA,OACH,GAAA,MAAA,QACA,EAAA,UAAA,YACA,EAAA,UAAA,YACA,EAAA,QAAA,UACA,EAAA,WAAA,cACJ,EAAA,CAAA,CAAA,EAKY,EAAL,SAAA,EAAA,OACH,GAAA,OAAA,UACA,EAAA,OAAA,UACA,EAAA,mBAAA,sBACA,EAAA,eAAA,kBACA,EAAA,UAAA,aACA,EAAA,gBAAA,mBACA,EAAA,OAAA,SACA,EAAA,MAAA,SACJ,EAAA,CAAA,CAAA,EAEY,EAAL,SAAA,EAAA,OACH,GAAA,KAAA,OACA,EAAA,KAAA,OACA,EAAA,cAAA,iBACJ,EAAA,CAAA,CAAA,EAMY,EAAL,SAAA,EAAA,OAEH,GAAA,KAAA,OAEA,EAAA,OAAA,gBAEA,EAAA,MAAA,QAEA,EAAA,IAAA,KACJ,EAAA,CAAA,CAAA,ECdY,EAAL,SAAA,EAAA,OACH,GAAA,SAAA,WACA,EAAA,OAAA,SACA,EAAA,SAAA,WACA,EAAA,SAAA,YACJ,EAAA,CAAA,CAAA,EAKY,EAAL,SAAA,EAAA,OACH,GAAA,QAAA,UACA,EAAA,QAAA,UACA,EAAA,UAAA,aACJ,EAAA,CAAA,CAAA,EAKY,EAAL,SAAA,EAAA,OACH,GAAA,SAAA,WACA,EAAA,OAAA,SACA,EAAA,SAAA,WACA,EAAA,SAAA,YACJ,EAAA,CAAA,CAAA,EAKY,EAAL,SAAA,EAAA,OACH,GAAA,SAAA,WACA,EAAA,kBAAA,qBACA,EAAA,WAAA,aACA,EAAA,SAAA,YACJ,EAAA,CAAA,CAAA,EC1DA,MAAa,EAAW,CACpB,eAAgB,iBAChB,UAAW,YACX,QAAS,SACb,EAIa,EAAkB,CAC3B,eAAgB,iBAChB,QAAS,UACT,QAAS,SACb,EAIa,EAA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ACX,KAAM,KACN,MAAO,KACP,WAAY,KACZ,KAAM,IACV,EAIa,GAAyB,CAClC,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,IACR"}
@@ -1,6 +1,83 @@
1
1
  //#region src/utils/buildFieldsQueryString.d.ts
2
2
  declare function buildFieldsQueryString(fields?: string[] | string): string;
3
3
  //#endregion
4
+ //#region src/utils/rateLimit.d.ts
5
+ /**
6
+ * Usage percentages reported by Meta. Each value is the share (0-100+) of the allowance used in the
7
+ * current rolling window.
8
+ */
9
+ interface RateLimitUsage {
10
+ /** Percentage of calls made (`call_count`). */
11
+ callCount?: number;
12
+ /** Percentage of total CPU time used (`total_cputime`). */
13
+ totalCputime?: number;
14
+ /** Percentage of total time used (`total_time`). */
15
+ totalTime?: number;
16
+ }
17
+ /** One entry of the `X-Business-Use-Case-Usage` header. */
18
+ interface BusinessUseCaseUsage extends RateLimitUsage {
19
+ /** The business object the entry belongs to (for WhatsApp, usually the WABA or phone number ID). */
20
+ businessId: string;
21
+ /** Rate limit type, e.g. `whatsapp_business_management` or `whatsapp`. */
22
+ type?: string;
23
+ /**
24
+ * `estimated_time_to_regain_access`: "Time, in minutes, until calls will no longer be throttled."
25
+ * `0` when not throttled.
26
+ */
27
+ estimatedTimeToRegainAccessMinutes?: number;
28
+ /** `ads_api_access_tier`, only sent for Marketing API use cases. */
29
+ adsApiAccessTier?: string;
30
+ }
31
+ /**
32
+ * Rate limit information parsed from a Graph API response.
33
+ *
34
+ * WhatsApp Cloud API responses carry `x-business-use-case-usage` (types
35
+ * `whatsapp_business_management` and `whatsapp`) and `x-app-usage`; throttled responses may add
36
+ * `Retry-After` (seconds).
37
+ */
38
+ interface RateLimitInfo {
39
+ /** Parsed `X-App-Usage` header (platform rate limits). */
40
+ appUsage?: RateLimitUsage;
41
+ /** Parsed `X-Business-Use-Case-Usage` header, flattened across business IDs. Empty when absent. */
42
+ businessUseCaseUsage: BusinessUseCaseUsage[];
43
+ /** Parsed `Retry-After` header in milliseconds (seconds or HTTP-date form). */
44
+ retryAfterMs?: number;
45
+ /**
46
+ * Highest usage percentage across every parsed metric, handy for alerting before Meta starts
47
+ * throttling (it throttles at 100).
48
+ */
49
+ maxUsagePercent?: number;
50
+ /**
51
+ * How long Meta asks you to wait, in milliseconds: the larger of `retryAfterMs` and the largest
52
+ * `estimatedTimeToRegainAccessMinutes`. Undefined when Meta gave no wait time.
53
+ */
54
+ retryDelayMs?: number;
55
+ }
56
+ /** Headers accepted by {@link parseRateLimitHeaders}. */
57
+ type RateLimitHeadersInput = Headers | Record<string, string | string[] | undefined> | {
58
+ get(name: string): string | null;
59
+ };
60
+ /**
61
+ * Parses a `Retry-After` value (delta-seconds or HTTP-date) into milliseconds.
62
+ * Returns undefined for missing or malformed values.
63
+ */
64
+ declare function parseRetryAfter(value: string | null | undefined, now?: number): number | undefined;
65
+ /**
66
+ * Parses Meta's rate limit headers (`X-App-Usage`, `X-Business-Use-Case-Usage`, `Retry-After`).
67
+ * Header names are matched case-insensitively. Malformed JSON or values are ignored, never thrown.
68
+ *
69
+ * Returns undefined when none of the headers are present.
70
+ *
71
+ * @see {@link https://developers.facebook.com/docs/graph-api/overview/rate-limiting/ | Graph API rate limiting}
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const info = parseRateLimitHeaders(response.headers);
76
+ * if ((info?.maxUsagePercent ?? 0) > 80) slowDown();
77
+ * ```
78
+ */
79
+ declare function parseRateLimitHeaders(headers: RateLimitHeadersInput | null | undefined): RateLimitInfo | undefined;
80
+ //#endregion
4
81
  //#region src/types/enums.d.ts
5
82
  declare enum WabaConfigEnum {
6
83
  AppId = "M4D_APP_ID",
@@ -54,7 +131,32 @@ interface RetryConfig {
54
131
  * Defaults to 1000 (1 second).
55
132
  */
56
133
  initialDelayMs?: number;
134
+ /**
135
+ * Wait as long as Meta asks before retrying a throttled request. When a throttling response
136
+ * carries `Retry-After` (seconds) or `X-Business-Use-Case-Usage` with
137
+ * `estimated_time_to_regain_access` (minutes), the retry waits the larger of the backoff delay and
138
+ * that server delay, capped at {@link RetryConfig.maxServerDelayMs}. It never adds attempts.
139
+ * Defaults to `true`; set `false` to use the backoff delay only.
140
+ */
141
+ respectServerDelay?: boolean;
142
+ /**
143
+ * Upper bound in milliseconds for a server-provided wait. A longer wait is shortened to this
144
+ * value, so the retry may still be throttled; inspect `error.rateLimit` to reschedule instead.
145
+ * Defaults to 30000 (30 seconds).
146
+ */
147
+ maxServerDelayMs?: number;
57
148
  }
149
+ /** Request details passed to {@link WhatsAppConfig.onRateLimitInfo}. */
150
+ interface RateLimitInfoContext {
151
+ /** HTTP method of the request. */
152
+ method: string;
153
+ /** Endpoint path or absolute URL as passed to the requester. */
154
+ endpoint: string;
155
+ /** HTTP status code of the response. */
156
+ statusCode: number;
157
+ }
158
+ /** Callback receiving rate limit information parsed from every response that carries it. */
159
+ type RateLimitInfoListener = (info: RateLimitInfo, context: RateLimitInfoContext) => void | Promise<void>;
58
160
  type WabaConfigType = {
59
161
  /**
60
162
  * The Meta for Developers business application Id for this registered application.
@@ -117,6 +219,10 @@ type WabaConfigType = {
117
219
  * Passed through from WhatsAppConfig.
118
220
  */
119
221
  retry?: RetryConfig;
222
+ /**
223
+ * Rate limit header listener. Passed through from WhatsAppConfig.
224
+ */
225
+ onRateLimitInfo?: RateLimitInfoListener;
120
226
  };
121
227
  //#endregion
122
228
  //#region src/utils/configTable.d.ts
@@ -128,6 +234,125 @@ type WabaConfigType = {
128
234
  */
129
235
  declare function formatConfigTable(config: WabaConfigType): string;
130
236
  //#endregion
237
+ //#region src/utils/customerServiceWindow.d.ts
238
+ /**
239
+ * Length of the customer service window: 24 hours.
240
+ *
241
+ * "When a WhatsApp user messages you or calls you, a 24-hour timer called a customer service window
242
+ * starts. If the user messages or calls you again before the timer expires, the timer resets to
243
+ * 24 hours. [...] When the window closes, you can only send pre-approved template messages."
244
+ *
245
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/send-messages/ | Send messages: customer service windows}
246
+ */
247
+ declare const CUSTOMER_SERVICE_WINDOW_MS: number;
248
+ /**
249
+ * SDK fallback length of a free entry point (FEP) window: 72 hours.
250
+ * Prefer the expiry supplied by Meta; this fallback does not establish billing eligibility.
251
+ *
252
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing/ | Pricing: free entry point windows}
253
+ */
254
+ declare const FREE_ENTRY_POINT_WINDOW_MS: number;
255
+ /**
256
+ * Longest free entry point window Meta documents: up to 7 days for conversations started from an
257
+ * ad that clicks to WhatsApp.
258
+ *
259
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing/ | Pricing: free entry point windows}
260
+ */
261
+ declare const MAX_FREE_ENTRY_POINT_WINDOW_MS: number;
262
+ /**
263
+ * A point in time accepted by the window helpers:
264
+ * - `Date`
265
+ * - `number`: Unix epoch in milliseconds, or in seconds when below `1e11` (before the year 5138 in
266
+ * seconds, before March 1973 in milliseconds), so both `Date.now()` and webhook timestamps work
267
+ * - `string`: a numeric string such as the webhook `messages[].timestamp` (`"1727856000"`, Unix
268
+ * seconds, same rule as numbers), or any string `Date.parse` understands (ISO 8601)
269
+ */
270
+ type WindowTimestamp = Date | number | string;
271
+ /** State of a messaging window at a given instant. */
272
+ interface MessagingWindow {
273
+ /** True while the window is open (`now < expiresAt`). */
274
+ isOpen: boolean;
275
+ /** When the window closes, or `null` when there is no window (no inbound message yet). */
276
+ expiresAt: Date | null;
277
+ /** Milliseconds until the window closes, `0` once closed. Never more than the window length. */
278
+ remainingMs: number;
279
+ }
280
+ interface CustomerServiceWindowOptions {
281
+ /** The instant to evaluate. Defaults to `Date.now()`. */
282
+ now?: WindowTimestamp;
283
+ /**
284
+ * Treat the window as closing this many milliseconds early. Use it to absorb clock drift between
285
+ * your servers and Meta and the time a send spends in flight. Defaults to `0`.
286
+ */
287
+ safetyMarginMs?: number;
288
+ }
289
+ interface FreeEntryPointWindowOptions extends CustomerServiceWindowOptions {
290
+ /**
291
+ * Window length. Defaults to {@link FREE_ENTRY_POINT_WINDOW_MS} (72 hours). Meta may keep a
292
+ * click-to-WhatsApp ad window open for up to {@link MAX_FREE_ENTRY_POINT_WINDOW_MS} (7 days)
293
+ * without saying how long a given window lasts, so prefer `expiresAt` when you have it.
294
+ */
295
+ durationMs?: number;
296
+ /**
297
+ * Exact expiry when known, for example the status webhook's `conversation.expiration_timestamp`
298
+ * (Unix seconds). Overrides `durationMs`.
299
+ */
300
+ expiresAt?: WindowTimestamp;
301
+ }
302
+ /**
303
+ * Returns the state of the 24-hour customer service window opened by the user's last inbound
304
+ * message (or call).
305
+ *
306
+ * Free-form (non-template) messages can only be sent while it is open; outside it only approved
307
+ * template messages are delivered (Meta rejects others with error `131047`). The window is exactly
308
+ * 24 hours from the user's last message: at `lastInboundAt + 24h` it is closed.
309
+ *
310
+ * Pass the webhook message `timestamp` (Unix seconds string) of the latest message from the user.
311
+ * Messages you send do not extend the window. Pass `null`/`undefined` when the user has never
312
+ * messaged you; that returns a closed window with `expiresAt: null`.
313
+ *
314
+ * A free entry point window does not reopen this window: "the customer service window is independent
315
+ * of the FEP window, so if the customer service window closes, you will only be able to send template
316
+ * messages." Use {@link getFreeEntryPointWindow} for the pricing side.
317
+ *
318
+ * @throws WhatsAppValidationError when a timestamp or `safetyMarginMs` is malformed.
319
+ *
320
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/send-messages/ | Send messages: customer service windows}
321
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing/ | Pricing}
322
+ *
323
+ * @example
324
+ * ```ts
325
+ * const { isOpen, expiresAt } = getCustomerServiceWindow(message.timestamp);
326
+ * if (!isOpen) await sendTemplateInstead();
327
+ * ```
328
+ */
329
+ declare function getCustomerServiceWindow(lastInboundAt: WindowTimestamp | null | undefined, options?: CustomerServiceWindowOptions): MessagingWindow;
330
+ /**
331
+ * True when a free-form (non-template) message can be sent: the customer service window opened by
332
+ * the user's last inbound message is still open. See {@link getCustomerServiceWindow}.
333
+ *
334
+ * @throws WhatsAppValidationError when a timestamp or `safetyMarginMs` is malformed.
335
+ */
336
+ declare function canSendFreeformMessage(lastInboundAt: WindowTimestamp | null | undefined, options?: CustomerServiceWindowOptions): boolean;
337
+ /**
338
+ * Returns the state of a free entry point (FEP) window.
339
+ *
340
+ * For eligible click-to-WhatsApp ad traffic, replying within the customer service window opens
341
+ * a billing window from the time of your reply. Pass that first reply time as `openedAt`.
342
+ *
343
+ * Meta documents windows lasting up to 7 days for ads that click to WhatsApp. This helper uses
344
+ * a 72-hour fallback estimate. Pass `expiresAt` (the status webhook's
345
+ * `conversation.expiration_timestamp`) when you have it, or set `durationMs`.
346
+ *
347
+ * This is a billing window only. It does not allow free-form messages after the customer service
348
+ * window closes; check {@link canSendFreeformMessage} for that.
349
+ *
350
+ * @throws WhatsAppValidationError when a timestamp, `durationMs` or `safetyMarginMs` is malformed.
351
+ *
352
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing/ | Pricing: free entry point windows}
353
+ */
354
+ declare function getFreeEntryPointWindow(openedAt: WindowTimestamp | null | undefined, options?: FreeEntryPointWindowOptions): MessagingWindow;
355
+ //#endregion
131
356
  //#region src/utils/isMetaError.d.ts
132
357
  type MetaErrorData = {
133
358
  message: string;
@@ -170,6 +395,11 @@ declare class WhatsAppError extends Error {
170
395
  declare class WhatsAppApiError extends WhatsAppError {
171
396
  readonly error: MetaErrorData;
172
397
  readonly statusCode?: number;
398
+ /**
399
+ * Rate limit headers of the failed response, when it carried any. Set by the SDK's requester;
400
+ * use `rateLimit.retryDelayMs` to reschedule a throttled call.
401
+ */
402
+ rateLimit?: RateLimitInfo;
173
403
  constructor(message: string, error: MetaErrorData, statusCode?: number);
174
404
  }
175
405
  declare class WhatsAppAuthorizationError extends WhatsAppApiError {
@@ -245,13 +475,14 @@ interface LoggerInterface {
245
475
  //#region src/utils/logger.d.ts
246
476
  declare class Logger implements LoggerInterface {
247
477
  private name;
248
- private debug;
478
+ private debugEnabled;
249
479
  constructor(name: string, debug?: boolean);
250
480
  private formatData;
251
481
  log(...data: any[]): void;
252
482
  error(...data: any[]): void;
253
483
  warn(...data: any[]): void;
254
484
  info(...data: any[]): void;
485
+ debug(...data: any[]): void;
255
486
  }
256
487
  //#endregion
257
488
  //#region src/utils/objectToQueryString.d.ts
@@ -356,7 +587,7 @@ type EncryptionKeyPair = {
356
587
  */
357
588
  declare function generateEncryption(passphrase?: string): EncryptionKeyPair;
358
589
  /**
359
- * Decrypt a WhatsApp Flow request
590
+ * Decrypt a WhatsApp Flow request (Node.js only; see {@link decryptFlowRequestAsync} for every runtime)
360
591
  * @param body - Encrypted request body containing encrypted_aes_key, encrypted_flow_data, and initial_vector
361
592
  * @param config - WABA configuration containing FLOW_API_PRIVATE_PEM and FLOW_API_PASSPHRASE
362
593
  * @returns Decrypted flow request body, AES key buffer, and initial vector buffer
@@ -368,7 +599,7 @@ declare function decryptFlowRequest(body: any, config: WabaConfigType): {
368
599
  initialVectorBuffer: Buffer;
369
600
  };
370
601
  /**
371
- * Encrypt a WhatsApp Flow response
602
+ * Encrypt a WhatsApp Flow response (Node.js only; see {@link encryptFlowResponseAsync} for every runtime)
372
603
  * @param response - Response object to encrypt
373
604
  * @param aesKeyBuffer - AES key buffer from the decrypted request
374
605
  * @param initialVectorBuffer - Initial vector buffer from the decrypted request
@@ -376,6 +607,35 @@ declare function decryptFlowRequest(body: any, config: WabaConfigType): {
376
607
  * @throws {Error} If encryption fails
377
608
  */
378
609
  declare function encryptFlowResponse(response: any, aesKeyBuffer: Buffer, initialVectorBuffer: Buffer): string;
610
+ /**
611
+ * Result of {@link decryptFlowRequestAsync}. Pass `aesKeyBuffer` and
612
+ * `initialVectorBuffer` to {@link encryptFlowResponseAsync}.
613
+ */
614
+ type DecryptedFlowRequest = {
615
+ decryptedBody: FlowEndpointRequest;
616
+ aesKeyBuffer: Uint8Array<ArrayBuffer>;
617
+ initialVectorBuffer: Uint8Array<ArrayBuffer>;
618
+ };
619
+ /**
620
+ * Decrypt a WhatsApp Flow request with Web Crypto. Works on Node.js, Bun, Deno,
621
+ * Cloudflare Workers and Vercel Edge.
622
+ *
623
+ * On runtimes without `node:crypto` the private key must be an unencrypted
624
+ * PKCS#8 PEM (`-----BEGIN PRIVATE KEY-----`); the passphrase is then ignored.
625
+ *
626
+ * @param body - Encrypted request body containing encrypted_aes_key, encrypted_flow_data, and initial_vector
627
+ * @param config - WABA configuration containing FLOW_API_PRIVATE_PEM and (for encrypted keys) FLOW_API_PASSPHRASE
628
+ * @throws {Error} If required encryption properties are missing or decryption fails
629
+ */
630
+ declare function decryptFlowRequestAsync(body: any, config: WabaConfigType): Promise<DecryptedFlowRequest>;
631
+ /**
632
+ * Encrypt a WhatsApp Flow response with Web Crypto. Works on every runtime.
633
+ * @param response - Response object to encrypt
634
+ * @param aesKeyBuffer - AES key from {@link decryptFlowRequestAsync} (a Node.js Buffer also works)
635
+ * @param initialVectorBuffer - Initial vector from {@link decryptFlowRequestAsync} (a Node.js Buffer also works)
636
+ * @returns Base64-encoded encrypted response
637
+ */
638
+ declare function encryptFlowResponseAsync(response: any, aesKeyBuffer: Uint8Array, initialVectorBuffer: Uint8Array): Promise<string>;
379
639
  //#endregion
380
640
  //#region src/utils/flowTypeGuards.d.ts
381
641
  declare const DATA_EXCHANGE_ACTIONS: readonly [FlowActionEnum.DATA_EXCHANGE, FlowActionEnum.INIT, FlowActionEnum.BACK];
@@ -418,5 +678,5 @@ declare function isFlowErrorRequest(request: FlowEndpointRequest): request is Fl
418
678
  */
419
679
  declare function isFlowPingRequest(request: FlowEndpointRequest): request is FlowHealthCheckRequest;
420
680
  //#endregion
421
- export { AUTHORIZATION_ERROR_CODES, type ApiPermissionErrorCode, BLOCK_USER_ERROR_CODES, CALLING_ERROR_CODES, type EncryptionKeyPair, FLOW_ERROR_CODES, GROUP_ERROR_CODES, INTEGRITY_ERROR_CODES, Logger, type MetaError, type MetaErrorData, SEND_MESSAGE_ERROR_CODES, THROTTLING_ERROR_CODES, WHATSAPP_ERROR_CODES, WhatsAppApiError, WhatsAppAuthorizationError, WhatsAppBlockUserError, WhatsAppCallingError, WhatsAppError, type WhatsAppErrorCode, WhatsAppFlowError, WhatsAppGroupError, WhatsAppIntegrityError, WhatsAppNetworkError, WhatsAppSendMessageError, WhatsAppThrottlingError, WhatsAppUnknownError, WhatsAppValidationError, buildFieldsQueryString, createWhatsAppApiError, decryptFlowRequest, encryptFlowResponse, formatConfigTable, generateEncryption, isApiPermissionErrorCode, isAuthorizationErrorCode, isBlockUserErrorCode, isCallingErrorCode, isFlowDataExchangeRequest, isFlowErrorCode, isFlowErrorRequest, isFlowPingRequest, isGroupErrorCode, isIntegrityErrorCode, isMetaError, isSendMessageErrorCode, isThrottlingErrorCode, isWhatsAppApiErrorResponse, isWhatsAppAuthorizationError, isWhatsAppBlockUserError, isWhatsAppCallingError, isWhatsAppErrorCode, isWhatsAppFlowError, isWhatsAppGroupError, isWhatsAppIntegrityError, isWhatsAppSendMessageError, isWhatsAppThrottlingError, normalizeMetaError, objectToQueryString };
681
+ export { AUTHORIZATION_ERROR_CODES, type ApiPermissionErrorCode, BLOCK_USER_ERROR_CODES, type BusinessUseCaseUsage, CALLING_ERROR_CODES, CUSTOMER_SERVICE_WINDOW_MS, type CustomerServiceWindowOptions, type DecryptedFlowRequest, type EncryptionKeyPair, FLOW_ERROR_CODES, FREE_ENTRY_POINT_WINDOW_MS, type FreeEntryPointWindowOptions, GROUP_ERROR_CODES, INTEGRITY_ERROR_CODES, Logger, MAX_FREE_ENTRY_POINT_WINDOW_MS, type MessagingWindow, type MetaError, type MetaErrorData, type RateLimitHeadersInput, type RateLimitInfo, type RateLimitUsage, SEND_MESSAGE_ERROR_CODES, THROTTLING_ERROR_CODES, WHATSAPP_ERROR_CODES, WhatsAppApiError, WhatsAppAuthorizationError, WhatsAppBlockUserError, WhatsAppCallingError, WhatsAppError, type WhatsAppErrorCode, WhatsAppFlowError, WhatsAppGroupError, WhatsAppIntegrityError, WhatsAppNetworkError, WhatsAppSendMessageError, WhatsAppThrottlingError, WhatsAppUnknownError, WhatsAppValidationError, type WindowTimestamp, buildFieldsQueryString, canSendFreeformMessage, createWhatsAppApiError, decryptFlowRequest, decryptFlowRequestAsync, encryptFlowResponse, encryptFlowResponseAsync, formatConfigTable, generateEncryption, getCustomerServiceWindow, getFreeEntryPointWindow, isApiPermissionErrorCode, isAuthorizationErrorCode, isBlockUserErrorCode, isCallingErrorCode, isFlowDataExchangeRequest, isFlowErrorCode, isFlowErrorRequest, isFlowPingRequest, isGroupErrorCode, isIntegrityErrorCode, isMetaError, isSendMessageErrorCode, isThrottlingErrorCode, isWhatsAppApiErrorResponse, isWhatsAppAuthorizationError, isWhatsAppBlockUserError, isWhatsAppCallingError, isWhatsAppErrorCode, isWhatsAppFlowError, isWhatsAppGroupError, isWhatsAppIntegrityError, isWhatsAppSendMessageError, isWhatsAppThrottlingError, normalizeMetaError, objectToQueryString, parseRateLimitHeaders, parseRetryAfter };
422
682
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/utils/buildFieldsQueryString.ts","../../src/types/enums.ts","../../src/types/config.ts","../../src/utils/configTable.ts","../../src/utils/isMetaError.ts","../../src/types/logger.ts","../../src/utils/logger.ts","../../src/utils/objectToQueryString.ts","../../src/api/flow/types/common.ts","../../src/utils/flowEncryptionUtils.ts","../../src/utils/flowTypeGuards.ts"],"mappings":";iBAAgB,sBAAA,CAAuB,MAA0B;;;aC2HrD,cAAA;EACR,KAAA;EACA,IAAA;EACA,SAAA;EACA,aAAA;EACA,cAAA;EACA,UAAA;EACA,WAAA;EACA,eAAA;EACA,wBAAA;EACA,YAAA;EACA,mBAAA;EACA,cAAA;EACA,KAAA;EACA,UAAA;EACA,UAAA;AAAA;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D,kBAAA,CACZ,IAAA,OACA,MAAA,EAAQ,cAAA;EAER,aAAA,EAAe,mBAAA;EACf,YAAA,EAAc,MAAA;EACd,mBAAA,EAAqB,MAAA;AAAA;;;;;;;;;iBAiLT,mBAAA,CAAoB,QAAA,OAAe,YAAA,EAAc,MAAA,EAAQ,mBAAA,EAAqB,MAAM;;;cC9T9F,qBAAA,YAAqB,cAAA,CAAA,aAAA,EAAA,cAAA,CAAA,IAAA,EAAA,cAAA,CAAA,IAAA;AAAA,cAGrB,aAAA,YAAa,cAAA,CAAA,aAAA,EAAA,cAAA,CAAA,IAAA;;;AV9B8C;;;;AC2HjE;iBSpFgB,yBAAA,CAA0B,OAAA,EAAS,mBAAA,GAAsB,OAAA,IAAW,uBAAA;EAChF,MAAA,UAAgB,qBAAA;EAChB,MAAA;EACA,UAAA;EACA,IAAA,GAAO,MAAA;AAAA;;;;;;;;iBAgCK,kBAAA,CAAmB,OAAA,EAAS,mBAAA,GAAsB,OAAA,IAAW,4BAAA;EACzE,MAAA,UAAgB,aAAA;EAChB,MAAA;EACA,UAAA;EACA,IAAA;IACI,KAAA;IACA,aAAA;EAAA;AAAA;;ARhER;;;;;;iBQmGgB,iBAAA,CAAkB,OAAA,EAAS,mBAAA,GAAsB,OAAA,IAAW,sBAAsB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/utils/buildFieldsQueryString.ts","../../src/utils/rateLimit.ts","../../src/types/enums.ts","../../src/types/config.ts","../../src/utils/configTable.ts","../../src/utils/customerServiceWindow.ts","../../src/utils/isMetaError.ts","../../src/types/logger.ts","../../src/utils/logger.ts","../../src/utils/objectToQueryString.ts","../../src/api/flow/types/common.ts","../../src/utils/flowEncryptionUtils.ts","../../src/utils/flowTypeGuards.ts"],"mappings":";iBAAgB,sBAAA,CAAuB,MAA0B;;;;AAAjE;;;UCMiB,cAAA;EDNgD;ECQ7D,SAAA;;EAEA,YAAA;EAJa;EAMb,SAAA;AAAA;;UAIa,oBAAA,SAA6B,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