meta-cloud-api 3.8.0 → 3.9.0

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.
package/dist/index.d.mts CHANGED
@@ -1,7 +1,81 @@
1
- import { Agent } from "node:https";
2
1
  import { IncomingHttpHeaders, IncomingMessage } from "node:http";
3
2
 
4
- //#region src/types/enums.d.ts
3
+ //#region src/utils/rateLimit.d.ts
4
+ /**
5
+ * Usage percentages reported by Meta. Each value is the share (0-100+) of the allowance used in the
6
+ * current rolling window.
7
+ */
8
+ interface RateLimitUsage {
9
+ /** Percentage of calls made (`call_count`). */
10
+ callCount?: number;
11
+ /** Percentage of total CPU time used (`total_cputime`). */
12
+ totalCputime?: number;
13
+ /** Percentage of total time used (`total_time`). */
14
+ totalTime?: number;
15
+ }
16
+ /** One entry of the `X-Business-Use-Case-Usage` header. */
17
+ interface BusinessUseCaseUsage extends RateLimitUsage {
18
+ /** The business object the entry belongs to (for WhatsApp, usually the WABA or phone number ID). */
19
+ businessId: string;
20
+ /** Rate limit type, e.g. `whatsapp_business_management` or `whatsapp`. */
21
+ type?: string;
22
+ /**
23
+ * `estimated_time_to_regain_access`: "Time, in minutes, until calls will no longer be throttled."
24
+ * `0` when not throttled.
25
+ */
26
+ estimatedTimeToRegainAccessMinutes?: number;
27
+ /** `ads_api_access_tier`, only sent for Marketing API use cases. */
28
+ adsApiAccessTier?: string;
29
+ }
30
+ /**
31
+ * Rate limit information parsed from a Graph API response.
32
+ *
33
+ * WhatsApp Cloud API responses carry `x-business-use-case-usage` (types
34
+ * `whatsapp_business_management` and `whatsapp`) and `x-app-usage`; throttled responses may add
35
+ * `Retry-After` (seconds).
36
+ */
37
+ interface RateLimitInfo {
38
+ /** Parsed `X-App-Usage` header (platform rate limits). */
39
+ appUsage?: RateLimitUsage;
40
+ /** Parsed `X-Business-Use-Case-Usage` header, flattened across business IDs. Empty when absent. */
41
+ businessUseCaseUsage: BusinessUseCaseUsage[];
42
+ /** Parsed `Retry-After` header in milliseconds (seconds or HTTP-date form). */
43
+ retryAfterMs?: number;
44
+ /**
45
+ * Highest usage percentage across every parsed metric, handy for alerting before Meta starts
46
+ * throttling (it throttles at 100).
47
+ */
48
+ maxUsagePercent?: number;
49
+ /**
50
+ * How long Meta asks you to wait, in milliseconds: the larger of `retryAfterMs` and the largest
51
+ * `estimatedTimeToRegainAccessMinutes`. Undefined when Meta gave no wait time.
52
+ */
53
+ retryDelayMs?: number;
54
+ }
55
+ /** Headers accepted by {@link parseRateLimitHeaders}. */
56
+ type RateLimitHeadersInput = Headers | Record<string, string | string[] | undefined> | {
57
+ get(name: string): string | null;
58
+ };
59
+ /**
60
+ * Parses a `Retry-After` value (delta-seconds or HTTP-date) into milliseconds.
61
+ * Returns undefined for missing or malformed values.
62
+ */
63
+ declare function parseRetryAfter(value: string | null | undefined, now?: number): number | undefined;
64
+ /**
65
+ * Parses Meta's rate limit headers (`X-App-Usage`, `X-Business-Use-Case-Usage`, `Retry-After`).
66
+ * Header names are matched case-insensitively. Malformed JSON or values are ignored, never thrown.
67
+ *
68
+ * Returns undefined when none of the headers are present.
69
+ *
70
+ * @see {@link https://developers.facebook.com/docs/graph-api/overview/rate-limiting/ | Graph API rate limiting}
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const info = parseRateLimitHeaders(response.headers);
75
+ * if ((info?.maxUsagePercent ?? 0) > 80) slowDown();
76
+ * ```
77
+ */
78
+ declare function parseRateLimitHeaders(headers: RateLimitHeadersInput | null | undefined): RateLimitInfo | undefined;
5
79
  declare namespace enums_d_exports {
6
80
  export { AudioMediaTypesEnum, BusinessVerticalEnum, ButtonPositionEnum, CategoryEnum, ComponentTypesEnum, ConversationTypesEnum, CurrencyCodesEnum, DataLocalizationRegionEnum, DocumentMediaTypesEnum, HttpMethodsEnum, ImageMediaTypesEnum, InteractiveTypesEnum, LanguagesEnum, MessageCategoryEnum, MessageTypesEnum, ParametersTypesEnum, ReferralSourceTypesEnum, RequestCodeMethodsEnum, StatusEnum, StickerMediaTypesEnum, SubTypeEnum, SystemChangeTypesEnum, TemplateStatusEnum, VideoMediaTypesEnum, WabaConfigEnum, WebhookTypesEnum };
7
81
  }
@@ -735,6 +809,68 @@ interface RetryConfig {
735
809
  * Defaults to 1000 (1 second).
736
810
  */
737
811
  initialDelayMs?: number;
812
+ /**
813
+ * Wait as long as Meta asks before retrying a throttled request. When a throttling response
814
+ * carries `Retry-After` (seconds) or `X-Business-Use-Case-Usage` with
815
+ * `estimated_time_to_regain_access` (minutes), the retry waits the larger of the backoff delay and
816
+ * that server delay, capped at {@link RetryConfig.maxServerDelayMs}. It never adds attempts.
817
+ * Defaults to `true`; set `false` to use the backoff delay only.
818
+ */
819
+ respectServerDelay?: boolean;
820
+ /**
821
+ * Upper bound in milliseconds for a server-provided wait. A longer wait is shortened to this
822
+ * value, so the retry may still be throttled; inspect `error.rateLimit` to reschedule instead.
823
+ * Defaults to 30000 (30 seconds).
824
+ */
825
+ maxServerDelayMs?: number;
826
+ }
827
+ /** Request details passed to {@link WhatsAppConfig.onRateLimitInfo}. */
828
+ interface RateLimitInfoContext {
829
+ /** HTTP method of the request. */
830
+ method: string;
831
+ /** Endpoint path or absolute URL as passed to the requester. */
832
+ endpoint: string;
833
+ /** HTTP status code of the response. */
834
+ statusCode: number;
835
+ }
836
+ /** Callback receiving rate limit information parsed from every response that carries it. */
837
+ type RateLimitInfoListener = (info: RateLimitInfo, context: RateLimitInfoContext) => void | Promise<void>;
838
+ /**
839
+ * Storage used to drop duplicate webhook deliveries. Meta retries deliveries,
840
+ * so the same message or status can arrive more than once.
841
+ *
842
+ * `setIfAbsent` must be atomic: store `key` for `ttlSeconds` only if it is not
843
+ * already there, and resolve `true` when it stored the key (first delivery) or
844
+ * `false` when the key already existed (duplicate). It maps 1:1 to Redis
845
+ * `SET key 1 NX EX ttlSeconds`, which replies `OK` only when the key was set.
846
+ *
847
+ * @example
848
+ * ```typescript
849
+ * const store: DedupeStore = {
850
+ * async setIfAbsent(key, ttlSeconds) {
851
+ * return (await redis.set(`wa:${key}`, '1', { NX: true, EX: ttlSeconds })) === 'OK';
852
+ * },
853
+ * };
854
+ * ```
855
+ */
856
+ interface DedupeStore {
857
+ /** Atomically store `key` for `ttlSeconds` if absent. Resolves `true` if stored, `false` if it existed. */
858
+ setIfAbsent(key: string, ttlSeconds: number): Promise<boolean>;
859
+ /** Optional read-only check. The webhook processor never calls it; it is there for inspection and tests. */
860
+ has?(key: string): Promise<boolean>;
861
+ }
862
+ /**
863
+ * Opt-in deduplication of webhook deliveries. See {@link DedupeStore}.
864
+ */
865
+ interface WebhookDedupeConfig {
866
+ /**
867
+ * Where seen keys are kept. Defaults to an in-memory store that is bounded
868
+ * and only sees deliveries made to this process: with several instances
869
+ * behind a load balancer, pass a shared store such as Redis.
870
+ */
871
+ store?: DedupeStore;
872
+ /** How long a key is remembered, in seconds. Defaults to 86400 (24 hours). */
873
+ ttlSeconds?: number;
738
874
  }
739
875
  type WhatsAppConfig = {
740
876
  accessToken: string;
@@ -752,6 +888,12 @@ type WhatsAppConfig = {
752
888
  privatePem?: string;
753
889
  passphrase?: string; /** Automatic retry configuration for throttling errors. */
754
890
  retry?: RetryConfig;
891
+ /**
892
+ * Called with the parsed `X-App-Usage` / `X-Business-Use-Case-Usage` / `Retry-After` headers of
893
+ * every response (successful or not) that carries at least one of them. Errors thrown by the
894
+ * callback are ignored. See also `whatsapp.getLastRateLimitInfo()`.
895
+ */
896
+ onRateLimitInfo?: RateLimitInfoListener;
755
897
  /**
756
898
  * Reject webhook POSTs whose `X-Hub-Signature-256` header is not a valid
757
899
  * HMAC-SHA256 of the raw body keyed with `appSecret`. Requires `appSecret`.
@@ -763,6 +905,19 @@ type WhatsAppConfig = {
763
905
  * `app.use(express.json({ verify: (req, _res, buf) => { req.rawBody = buf.toString(); } }))`.
764
906
  */
765
907
  verifyWebhookSignature?: boolean;
908
+ /**
909
+ * Skip handlers for webhook deliveries that were already seen (Meta retries
910
+ * deliveries). Duplicates still get a 200 response. Used by
911
+ * `WebhookProcessor` and the framework adapters only.
912
+ *
913
+ * Keys: `message:<id>` for messages, `status:<id>:<status>` for statuses,
914
+ * and the call or echo ids for `calls`, `smb_message_echoes` and
915
+ * `message_echoes`. Other fields have no natural id and are never deduped.
916
+ *
917
+ * `true` uses the defaults (in-memory store, single instance only, 24 hour TTL).
918
+ * Off by default.
919
+ */
920
+ dedupe?: boolean | WebhookDedupeConfig;
766
921
  };
767
922
  type WabaConfigType = {
768
923
  /**
@@ -826,6 +981,10 @@ type WabaConfigType = {
826
981
  * Passed through from WhatsAppConfig.
827
982
  */
828
983
  retry?: RetryConfig;
984
+ /**
985
+ * Rate limit header listener. Passed through from WhatsAppConfig.
986
+ */
987
+ onRateLimitInfo?: RateLimitInfoListener;
829
988
  };
830
989
  //#endregion
831
990
  //#region src/types/request.d.ts
@@ -851,6 +1010,8 @@ interface GeneralHeaderInterface {
851
1010
  }
852
1011
  interface RequesterResponseInterface<T> {
853
1012
  json: () => Promise<T>;
1013
+ /** The underlying fetch `Response`, for non-JSON bodies such as media downloads. */
1014
+ rawResponse: () => Response;
854
1015
  }
855
1016
  interface ResponseSuccess {
856
1017
  success: boolean;
@@ -899,6 +1060,8 @@ declare class BaseAPI implements BaseClass {
899
1060
  protected client: RequesterClass;
900
1061
  constructor(config: WabaConfigType, client: RequesterClass);
901
1062
  protected sendJson<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
1063
+ /** Send a request and return the raw `Response` (for binary bodies). Errors still throw `WhatsAppError`s. */
1064
+ protected sendRaw(method: HttpMethodsEnum, endpoint: string, timeout: number): Promise<Response>;
902
1065
  protected sendFormData<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body?: any): Promise<T>;
903
1066
  protected sendUrlEncodedForm<T>(method: HttpMethodsEnum, endpoint: string, timeout: number, body: UrlEncodedFormBody): Promise<T>;
904
1067
  }
@@ -1712,7 +1875,7 @@ type GroupParticipantsRequest = {
1712
1875
  type UpdateGroupSettingsRequest = {
1713
1876
  subject?: string;
1714
1877
  description?: string;
1715
- profilePictureFile?: Blob | Buffer;
1878
+ profilePictureFile?: Blob | Uint8Array;
1716
1879
  };
1717
1880
  type GroupSettingsResponse = ResponseSuccess;
1718
1881
  interface GroupsClass {
@@ -2398,9 +2561,29 @@ type MediasResponse = {
2398
2561
  type UploadMediaResponse = {
2399
2562
  id: string;
2400
2563
  };
2564
+ /**
2565
+ * Media content accepted by `uploadMedia`.
2566
+ *
2567
+ * A `ReadableStream` is read fully into memory before the upload starts: Meta's endpoint takes
2568
+ * `multipart/form-data`, and `fetch` can only send a `FormData` part from a `Blob`.
2569
+ */
2570
+ type UploadMediaInput = Blob | File | Uint8Array | ArrayBuffer | ReadableStream<Uint8Array>;
2571
+ interface UploadMediaOptions {
2572
+ /**
2573
+ * MIME type sent as the `type` field and as the file part's content type, e.g. `image/jpeg`.
2574
+ * Required for `Uint8Array`, `ArrayBuffer` and `ReadableStream` input, and for a `Blob` without a
2575
+ * `type`. Overrides the `type` of a `Blob`/`File`.
2576
+ */
2577
+ type?: string;
2578
+ /** File name of the multipart part. Defaults to the `File` name, otherwise `file`. */
2579
+ filename?: string;
2580
+ /** Messaging product. Defaults to `'whatsapp'`. */
2581
+ messagingProduct?: string;
2582
+ }
2401
2583
  interface MediaClass {
2402
2584
  getMediaById(mediaId: string): Promise<MediaResponse>;
2403
2585
  uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
2586
+ uploadMedia(file: UploadMediaInput, options?: UploadMediaOptions): Promise<UploadMediaResponse>;
2404
2587
  deleteMedia(mediaId: string): Promise<ResponseSuccess>;
2405
2588
  downloadMedia(mediaUrl: string): Promise<Blob>;
2406
2589
  }
@@ -2762,9 +2945,9 @@ interface UploadMediaParams {
2762
2945
  */
2763
2946
  uploadId: string;
2764
2947
  /**
2765
- * The binary data of the file (Buffer).
2948
+ * The binary data of the file (`Uint8Array`; a Node.js `Buffer` works).
2766
2949
  */
2767
- file: Buffer;
2950
+ file: Uint8Array;
2768
2951
  }
2769
2952
  /**
2770
2953
  * Request parameters for getting upload handle.
@@ -2909,7 +3092,7 @@ declare class BusinessProfileClass extends BaseClass {
2909
3092
  * @param uploadId The ID of the upload session.
2910
3093
  * @param file The binary data of the file.
2911
3094
  */
2912
- uploadMedia(uploadId: string, file: Buffer): Promise<UploadBusinessProfileResponse>;
3095
+ uploadMedia(uploadId: string, file: Uint8Array): Promise<UploadBusinessProfileResponse>;
2913
3096
  /**
2914
3097
  * Get the upload handle information.
2915
3098
  * @param uploadId The ID of the upload session.
@@ -5372,6 +5555,21 @@ type WebhookValue = MessageWebhookValue | StatusWebhookValue | ErrorWebhookValue
5372
5555
  * Union type for all webhook field values
5373
5556
  */
5374
5557
  type WebhookFieldValue = AccountUpdateWebhookValue | AccountReviewUpdateWebhookValue | AccountAlertsWebhookValue | AccountSettingsUpdateWebhookValue | AutomaticEventsWebhookValue | BusinessCapabilityUpdateWebhookValue | BusinessStatusUpdateWebhookValue | BusinessUsernameUpdatesWebhookValue | CallsWebhookValue | FlowsWebhookValue | GroupLifecycleUpdateWebhookValue | GroupParticipantsUpdateWebhookValue | GroupSettingsUpdateWebhookValue | GroupStatusUpdateWebhookValue | HistoryWebhookValue | MessageEchoesWebhookValue | MessageTemplateComponentsUpdateWebhookValue | MessageTemplateQualityUpdateWebhookValue | MessageTemplateStatusUpdateWebhookValue | MessagingHandoversWebhookValue | PartnerSolutionsWebhookValue | PaymentConfigurationUpdateWebhookValue | PhoneNumberNameUpdateWebhookValue | PhoneNumberQualityUpdateWebhookValue | SecurityWebhookValue | SmbAppStateSyncWebhookValue | SmbMessageEchoesWebhookValue | StandbyWebhookValue | TemplateCategoryUpdateWebhookValue | TemplateCorrectCategoryDetectionWebhookValue | TrackingEventsWebhookValue | UserPreferencesWebhookValue;
5558
+ /**
5559
+ * Maps every webhook field except `messages` to the type of its `value`.
5560
+ * `messages` is left out because the SDK splits it into messages, statuses and
5561
+ * user actions (see `onMessage`, `onStatus` and `onUserAction`).
5562
+ *
5563
+ * @example
5564
+ * ```typescript
5565
+ * type Calls = WebhookFieldValueMap['calls']; // CallsWebhookValue['value']
5566
+ * ```
5567
+ */
5568
+ type WebhookFieldValueMap = { [F in WebhookFieldValue['field']]: Extract<WebhookFieldValue, {
5569
+ field: F;
5570
+ }>['value'] };
5571
+ /** Webhook field names accepted by `WebhookProcessor.on()`: every field except `messages`. */
5572
+ type NonMessageWebhookField = keyof WebhookFieldValueMap;
5375
5573
  interface WebhookPayload {
5376
5574
  object: 'whatsapp_business_account';
5377
5575
  entry: Array<{
@@ -5462,6 +5660,11 @@ declare class WhatsAppError extends Error {
5462
5660
  declare class WhatsAppApiError extends WhatsAppError {
5463
5661
  readonly error: MetaErrorData;
5464
5662
  readonly statusCode?: number;
5663
+ /**
5664
+ * Rate limit headers of the failed response, when it carried any. Set by the SDK's requester;
5665
+ * use `rateLimit.retryDelayMs` to reschedule a throttled call.
5666
+ */
5667
+ rateLimit?: RateLimitInfo;
5465
5668
  constructor(message: string, error: MetaErrorData, statusCode?: number);
5466
5669
  }
5467
5670
  declare class WhatsAppAuthorizationError extends WhatsAppApiError {
@@ -6197,7 +6400,7 @@ interface FlowClass {
6197
6400
  * @returns Promise with the success status and validation errors
6198
6401
  */
6199
6402
  updateFlowJson(flowId: string, data: {
6200
- file: Blob | Buffer | object;
6403
+ file: Blob | Uint8Array | object;
6201
6404
  name?: string;
6202
6405
  }): Promise<UpdateFlowResponse>;
6203
6406
  /**
@@ -6208,7 +6411,7 @@ interface FlowClass {
6208
6411
  * @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.
6209
6412
  * @returns Promise indicating if the JSON is valid and includes validation errors if any.
6210
6413
  */
6211
- validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
6414
+ validateFlowJson(flowId: string, flowJsonData: Blob | Uint8Array | object): Promise<ValidateFlowJsonResponse>;
6212
6415
  /**
6213
6416
  * Publish Flow
6214
6417
  *
@@ -6462,7 +6665,7 @@ declare class FlowApi extends BaseAPI implements FlowClass {
6462
6665
  * ```
6463
6666
  */
6464
6667
  updateFlowJson(flowId: string, data: {
6465
- file: Blob | Buffer | object;
6668
+ file: Blob | Uint8Array | object;
6466
6669
  name?: string;
6467
6670
  }): Promise<UpdateFlowResponse>;
6468
6671
  /**
@@ -6492,7 +6695,7 @@ declare class FlowApi extends BaseAPI implements FlowClass {
6492
6695
  * }
6493
6696
  * ```
6494
6697
  */
6495
- validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
6698
+ validateFlowJson(flowId: string, flowJsonData: Blob | Uint8Array | object): Promise<ValidateFlowJsonResponse>;
6496
6699
  /**
6497
6700
  * Publish a flow.
6498
6701
  *
@@ -6822,11 +7025,24 @@ declare class MediaApi extends BaseAPI implements MediaClass {
6822
7025
  * messages containing that media. Media is automatically encrypted and stored
6823
7026
  * on Meta's servers.
6824
7027
  *
6825
- * **Endpoint:** `POST /{PHONE_NUMBER_ID}/media`
7028
+ * **Endpoint:** `POST /{PHONE_NUMBER_ID}/media` (`multipart/form-data` with `file`, `type` and
7029
+ * `messaging_product`)
7030
+ *
7031
+ * Accepts a `File`, `Blob`, `Uint8Array` (including a Node.js `Buffer`), `ArrayBuffer` or web
7032
+ * `ReadableStream<Uint8Array>` on every runtime. Pass the MIME type in `options.type` unless the
7033
+ * input is a `Blob`/`File` that already has one.
7034
+ *
7035
+ * **Memory:** a `ReadableStream` is read fully into a `Blob` before the request is sent. Meta
7036
+ * requires a multipart body and `fetch` only accepts `Blob` parts in `FormData`, so the upload is
7037
+ * not streamed end to end. Peak memory can exceed the file size (Meta caps media at 100 MB for
7038
+ * documents, 16 MB for audio/video, 5 MB for images). Buffering once also lets a throttled upload
7039
+ * be retried. Blob construction snapshots byte inputs; allow room for these copies.
6826
7040
  *
6827
- * @param file - The `File` object to upload. The `type` property must match a supported MIME type.
6828
- * @param messagingProduct - The messaging product identifier (defaults to `'whatsapp'`)
7041
+ * @param file - The content to upload
7042
+ * @param optionsOrMessagingProduct - Upload options, or the messaging product string (legacy form,
7043
+ * defaults to `'whatsapp'`)
6829
7044
  * @returns A promise resolving to the upload response containing the assigned `id` (media ID)
7045
+ * @throws WhatsAppValidationError when no MIME type is available or the input type is unsupported
6830
7046
  *
6831
7047
  * @see {@link https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#upload-media | Upload Media Reference}
6832
7048
  *
@@ -6834,11 +7050,14 @@ declare class MediaApi extends BaseAPI implements MediaClass {
6834
7050
  * ```ts
6835
7051
  * const file = new File([buffer], 'image.jpg', { type: 'image/jpeg' });
6836
7052
  * const { id } = await client.media.uploadMedia(file);
6837
- * // Use the media ID to send an image message
6838
- * await client.messages.image({ body: { id }, to: '1234567890' });
7053
+ *
7054
+ * // Bytes or a web stream (e.g. a fetch() body) need a MIME type
7055
+ * const res = await fetch('https://example.com/report.pdf');
7056
+ * await client.media.uploadMedia(res.body!, { type: 'application/pdf', filename: 'report.pdf' });
6839
7057
  * ```
6840
7058
  */
6841
7059
  uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
7060
+ uploadMedia(file: UploadMediaInput, options?: UploadMediaOptions): Promise<UploadMediaResponse>;
6842
7061
  /**
6843
7062
  * Deletes a media file from WhatsApp servers.
6844
7063
  *
@@ -8119,7 +8338,7 @@ declare class BusinessProfileApi extends BaseAPI implements BusinessProfileClass
8119
8338
  * );
8120
8339
  * ```
8121
8340
  */
8122
- uploadMedia(uploadId: string, file: Buffer): Promise<UploadBusinessProfileResponse>;
8341
+ uploadMedia(uploadId: string, file: Uint8Array): Promise<UploadBusinessProfileResponse>;
8123
8342
  /**
8124
8343
  * Get the upload handle for a completed upload.
8125
8344
  *
@@ -8853,7 +9072,7 @@ type EncryptionKeyPair = {
8853
9072
  */
8854
9073
  declare function generateEncryption(passphrase?: string): EncryptionKeyPair;
8855
9074
  /**
8856
- * Decrypt a WhatsApp Flow request
9075
+ * Decrypt a WhatsApp Flow request (Node.js only; see {@link decryptFlowRequestAsync} for every runtime)
8857
9076
  * @param body - Encrypted request body containing encrypted_aes_key, encrypted_flow_data, and initial_vector
8858
9077
  * @param config - WABA configuration containing FLOW_API_PRIVATE_PEM and FLOW_API_PASSPHRASE
8859
9078
  * @returns Decrypted flow request body, AES key buffer, and initial vector buffer
@@ -8865,7 +9084,7 @@ declare function decryptFlowRequest(body: any, config: WabaConfigType): {
8865
9084
  initialVectorBuffer: Buffer;
8866
9085
  };
8867
9086
  /**
8868
- * Encrypt a WhatsApp Flow response
9087
+ * Encrypt a WhatsApp Flow response (Node.js only; see {@link encryptFlowResponseAsync} for every runtime)
8869
9088
  * @param response - Response object to encrypt
8870
9089
  * @param aesKeyBuffer - AES key buffer from the decrypted request
8871
9090
  * @param initialVectorBuffer - Initial vector buffer from the decrypted request
@@ -8873,11 +9092,42 @@ declare function decryptFlowRequest(body: any, config: WabaConfigType): {
8873
9092
  * @throws {Error} If encryption fails
8874
9093
  */
8875
9094
  declare function encryptFlowResponse(response: any, aesKeyBuffer: Buffer, initialVectorBuffer: Buffer): string;
9095
+ /**
9096
+ * Result of {@link decryptFlowRequestAsync}. Pass `aesKeyBuffer` and
9097
+ * `initialVectorBuffer` to {@link encryptFlowResponseAsync}.
9098
+ */
9099
+ type DecryptedFlowRequest = {
9100
+ decryptedBody: FlowEndpointRequest;
9101
+ aesKeyBuffer: Uint8Array<ArrayBuffer>;
9102
+ initialVectorBuffer: Uint8Array<ArrayBuffer>;
9103
+ };
9104
+ /**
9105
+ * Decrypt a WhatsApp Flow request with Web Crypto. Works on Node.js, Bun, Deno,
9106
+ * Cloudflare Workers and Vercel Edge.
9107
+ *
9108
+ * On runtimes without `node:crypto` the private key must be an unencrypted
9109
+ * PKCS#8 PEM (`-----BEGIN PRIVATE KEY-----`); the passphrase is then ignored.
9110
+ *
9111
+ * @param body - Encrypted request body containing encrypted_aes_key, encrypted_flow_data, and initial_vector
9112
+ * @param config - WABA configuration containing FLOW_API_PRIVATE_PEM and (for encrypted keys) FLOW_API_PASSPHRASE
9113
+ * @throws {Error} If required encryption properties are missing or decryption fails
9114
+ */
9115
+ declare function decryptFlowRequestAsync(body: any, config: WabaConfigType): Promise<DecryptedFlowRequest>;
9116
+ /**
9117
+ * Encrypt a WhatsApp Flow response with Web Crypto. Works on every runtime.
9118
+ * @param response - Response object to encrypt
9119
+ * @param aesKeyBuffer - AES key from {@link decryptFlowRequestAsync} (a Node.js Buffer also works)
9120
+ * @param initialVectorBuffer - Initial vector from {@link decryptFlowRequestAsync} (a Node.js Buffer also works)
9121
+ * @returns Base64-encoded encrypted response
9122
+ */
9123
+ declare function encryptFlowResponseAsync(response: any, aesKeyBuffer: Uint8Array, initialVectorBuffer: Uint8Array): Promise<string>;
8876
9124
  //#endregion
8877
9125
  //#region src/utils/http/httpsClient.d.ts
8878
9126
  declare class HttpsClient implements HttpsClientClass {
8879
- agent: Agent;
8880
- constructor();
9127
+ /**
9128
+ * Kept for backwards compatibility. Requests go through the global `fetch`,
9129
+ * which manages its own connection pool, so there is nothing to clear.
9130
+ */
8881
9131
  clearSockets(): boolean;
8882
9132
  sendRequest(hostname: string, path: string, method: HttpMethodsEnum, headers: HeadersInit, timeout: number, body?: BodyInit | null): Promise<HttpsClientResponseClass>;
8883
9133
  }
@@ -8893,7 +9143,16 @@ declare class Requester implements RequesterClass {
8893
9143
  host: Readonly<string>;
8894
9144
  protocol: Readonly<string>;
8895
9145
  private retryConfig;
8896
- constructor(apiVersion: string, phoneNumberId: number, accessToken: string, businessAcctId: string, userAgent: string, retryConfig?: RetryConfig);
9146
+ private onRateLimitInfo;
9147
+ private lastRateLimitInfo;
9148
+ constructor(apiVersion: string, phoneNumberId: number, accessToken: string, businessAcctId: string, userAgent: string, retryConfig?: RetryConfig, onRateLimitInfo?: RateLimitInfoListener);
9149
+ /**
9150
+ * Rate limit headers of the most recent response that carried any, or undefined.
9151
+ * With concurrent requests this is whichever response finished last; use the
9152
+ * `onRateLimitInfo` config callback to see every response.
9153
+ */
9154
+ getLastRateLimitInfo(): RateLimitInfo | undefined;
9155
+ private captureRateLimitInfo;
8897
9156
  buildHeader(contentType: string, additionalHeaders?: Record<string, string>): HeadersInit;
8898
9157
  buildCAPIPath(endpoint: string): string;
8899
9158
  private normalizeApiVersion;
@@ -8943,6 +9202,13 @@ declare class WhatsApp {
8943
9202
  updateTimeout(timeout: number): void;
8944
9203
  updateSenderNumberId(phoneNumberId: number): void;
8945
9204
  updateAccessToken(accessToken: string): void;
9205
+ /**
9206
+ * Rate limit headers (`X-App-Usage`, `X-Business-Use-Case-Usage`, `Retry-After`) of the most
9207
+ * recent response that carried any, or undefined before the first such response. With
9208
+ * concurrent requests this reflects whichever finished last; pass `onRateLimitInfo` in the
9209
+ * config to observe every response.
9210
+ */
9211
+ getLastRateLimitInfo(): RateLimitInfo | undefined;
8946
9212
  /**
8947
9213
  * Get SDK version
8948
9214
  */
@@ -8986,6 +9252,35 @@ declare class WhatsApp {
8986
9252
  generateEncryption(passphrase?: string): EncryptionKeyPair;
8987
9253
  }
8988
9254
  //#endregion
9255
+ //#region src/core/webhook/dedupe.d.ts
9256
+ interface MemoryDedupeStoreOptions {
9257
+ /** Most keys kept at once; the least recently seen key is dropped first. Defaults to 10,000. */
9258
+ maxEntries?: number;
9259
+ }
9260
+ /**
9261
+ * Bounded in-memory {@link DedupeStore} with per-key TTL and least recently
9262
+ * seen eviction. This is the default store for `dedupe`.
9263
+ *
9264
+ * Single instance only: it lives in this process's memory, so it does not see
9265
+ * deliveries handled by other instances and forgets everything on restart (and
9266
+ * on each cold start of a serverless function). Use a shared store such as
9267
+ * Redis when you run more than one instance.
9268
+ */
9269
+ declare class MemoryDedupeStore implements DedupeStore {
9270
+ private readonly maxEntries;
9271
+ /** key -> expiry time in ms. Map order doubles as recency order (oldest first). */
9272
+ private readonly entries;
9273
+ constructor(options?: MemoryDedupeStoreOptions);
9274
+ has(key: string): Promise<boolean>;
9275
+ setIfAbsent(key: string, ttlSeconds: number): Promise<boolean>;
9276
+ /** Number of keys currently held (expired keys may still be counted until evicted). */
9277
+ get size(): number;
9278
+ /** Forget every key. */
9279
+ clear(): void;
9280
+ private lookup;
9281
+ private evict;
9282
+ }
9283
+ //#endregion
8989
9284
  //#region src/core/webhook/utils/webhookUtils.d.ts
8990
9285
  /**
8991
9286
  * Processed message with metadata for handlers
@@ -9030,135 +9325,12 @@ type ProcessedUserAction = {
9030
9325
  action: UserAction;
9031
9326
  };
9032
9327
  /**
9033
- * Processed webhook field types for specialized handlers
9328
+ * What a handler for a non-`messages` webhook field receives: the WhatsApp
9329
+ * Business Account id and the change's `value`, typed by field name.
9034
9330
  */
9035
- type ProcessedAccountUpdate = {
9036
- wabaId: string;
9037
- value: AccountUpdateWebhookValue['value'];
9038
- };
9039
- type ProcessedAccountReviewUpdate = {
9040
- wabaId: string;
9041
- value: AccountReviewUpdateWebhookValue['value'];
9042
- };
9043
- type ProcessedAccountAlerts = {
9044
- wabaId: string;
9045
- value: AccountAlertsWebhookValue['value'];
9046
- };
9047
- type ProcessedBusinessCapabilityUpdate = {
9048
- wabaId: string;
9049
- value: BusinessCapabilityUpdateWebhookValue['value'];
9050
- };
9051
- type ProcessedPhoneNumberNameUpdate = {
9052
- wabaId: string;
9053
- value: PhoneNumberNameUpdateWebhookValue['value'];
9054
- };
9055
- type ProcessedPhoneNumberQualityUpdate = {
9056
- wabaId: string;
9057
- value: PhoneNumberQualityUpdateWebhookValue['value'];
9058
- };
9059
- type ProcessedMessageTemplateStatusUpdate = {
9060
- wabaId: string;
9061
- value: MessageTemplateStatusUpdateWebhookValue['value'];
9062
- };
9063
- type ProcessedTemplateCategoryUpdate = {
9064
- wabaId: string;
9065
- value: TemplateCategoryUpdateWebhookValue['value'];
9066
- };
9067
- type ProcessedMessageTemplateQualityUpdate = {
9068
- wabaId: string;
9069
- value: MessageTemplateQualityUpdateWebhookValue['value'];
9070
- };
9071
- type ProcessedFlows = {
9072
- wabaId: string;
9073
- value: FlowsWebhookValue['value'];
9074
- };
9075
- type ProcessedSecurity = {
9076
- wabaId: string;
9077
- value: SecurityWebhookValue['value'];
9078
- };
9079
- type ProcessedHistory = {
9080
- wabaId: string;
9081
- value: HistoryWebhookValue['value'];
9082
- };
9083
- type ProcessedSmbMessageEchoes = {
9084
- wabaId: string;
9085
- value: SmbMessageEchoesWebhookValue['value'];
9086
- };
9087
- type ProcessedSmbAppStateSync = {
9088
- wabaId: string;
9089
- value: SmbAppStateSyncWebhookValue['value'];
9090
- };
9091
- type ProcessedAccountSettingsUpdate = {
9092
- wabaId: string;
9093
- value: AccountSettingsUpdateWebhookValue['value'];
9094
- };
9095
- type ProcessedAutomaticEvents = {
9096
- wabaId: string;
9097
- value: AutomaticEventsWebhookValue['value'];
9098
- };
9099
- type ProcessedBusinessStatusUpdate = {
9100
- wabaId: string;
9101
- value: BusinessStatusUpdateWebhookValue['value'];
9102
- };
9103
- type ProcessedBusinessUsernameUpdates = {
9104
- wabaId: string;
9105
- value: BusinessUsernameUpdatesWebhookValue['value'];
9106
- };
9107
- type ProcessedCalls = {
9108
- wabaId: string;
9109
- value: CallsWebhookValue['value'];
9110
- };
9111
- type ProcessedGroupLifecycleUpdate = {
9112
- wabaId: string;
9113
- value: GroupLifecycleUpdateWebhookValue['value'];
9114
- };
9115
- type ProcessedGroupParticipantsUpdate = {
9116
- wabaId: string;
9117
- value: GroupParticipantsUpdateWebhookValue['value'];
9118
- };
9119
- type ProcessedGroupSettingsUpdate = {
9120
- wabaId: string;
9121
- value: GroupSettingsUpdateWebhookValue['value'];
9122
- };
9123
- type ProcessedGroupStatusUpdate = {
9124
- wabaId: string;
9125
- value: GroupStatusUpdateWebhookValue['value'];
9126
- };
9127
- type ProcessedMessageEchoes = {
9128
- wabaId: string;
9129
- value: MessageEchoesWebhookValue['value'];
9130
- };
9131
- type ProcessedMessageTemplateComponentsUpdate = {
9132
- wabaId: string;
9133
- value: MessageTemplateComponentsUpdateWebhookValue['value'];
9134
- };
9135
- type ProcessedMessagingHandovers = {
9136
- wabaId: string;
9137
- value: MessagingHandoversWebhookValue['value'];
9138
- };
9139
- type ProcessedPartnerSolutions = {
9331
+ type ProcessedWebhookField<F extends NonMessageWebhookField> = {
9140
9332
  wabaId: string;
9141
- value: PartnerSolutionsWebhookValue['value'];
9142
- };
9143
- type ProcessedPaymentConfigurationUpdate = {
9144
- wabaId: string;
9145
- value: PaymentConfigurationUpdateWebhookValue['value'];
9146
- };
9147
- type ProcessedStandby = {
9148
- wabaId: string;
9149
- value: StandbyWebhookValue['value'];
9150
- };
9151
- type ProcessedTemplateCorrectCategoryDetection = {
9152
- wabaId: string;
9153
- value: TemplateCorrectCategoryDetectionWebhookValue['value'];
9154
- };
9155
- type ProcessedTrackingEvents = {
9156
- wabaId: string;
9157
- value: TrackingEventsWebhookValue['value'];
9158
- };
9159
- type ProcessedUserPreferences = {
9160
- wabaId: string;
9161
- value: UserPreferencesWebhookValue['value'];
9333
+ value: WebhookFieldValueMap[F];
9162
9334
  };
9163
9335
  type TextProcessedMessage = ProcessedMessage & {
9164
9336
  message: Extract<WhatsAppMessage, {
@@ -9245,38 +9417,50 @@ type StatusHandler = WebhookHandler<ProcessedStatus>;
9245
9417
  type UserActionHandler = WebhookHandler<ProcessedUserAction>;
9246
9418
  type FlowHandler = WebhookHandler<FlowEndpointRequest, any>;
9247
9419
  type RawWebhookHandler = WebhookHandler<WebhookPayload>;
9248
- type AccountUpdateHandler = WebhookHandler<ProcessedAccountUpdate>;
9249
- type AccountReviewUpdateHandler = WebhookHandler<ProcessedAccountReviewUpdate>;
9250
- type AccountAlertsHandler = WebhookHandler<ProcessedAccountAlerts>;
9251
- type BusinessCapabilityUpdateHandler = WebhookHandler<ProcessedBusinessCapabilityUpdate>;
9252
- type PhoneNumberNameUpdateHandler = WebhookHandler<ProcessedPhoneNumberNameUpdate>;
9253
- type PhoneNumberQualityUpdateHandler = WebhookHandler<ProcessedPhoneNumberQualityUpdate>;
9254
- type MessageTemplateStatusUpdateHandler = WebhookHandler<ProcessedMessageTemplateStatusUpdate>;
9255
- type TemplateCategoryUpdateHandler = WebhookHandler<ProcessedTemplateCategoryUpdate>;
9256
- type MessageTemplateQualityUpdateHandler = WebhookHandler<ProcessedMessageTemplateQualityUpdate>;
9257
- type FlowsHandler = WebhookHandler<ProcessedFlows>;
9258
- type SecurityHandler = WebhookHandler<ProcessedSecurity>;
9259
- type HistoryHandler = WebhookHandler<ProcessedHistory>;
9260
- type SmbMessageEchoesHandler = WebhookHandler<ProcessedSmbMessageEchoes>;
9261
- type SmbAppStateSyncHandler = WebhookHandler<ProcessedSmbAppStateSync>;
9262
- type AccountSettingsUpdateHandler = WebhookHandler<ProcessedAccountSettingsUpdate>;
9263
- type AutomaticEventsHandler = WebhookHandler<ProcessedAutomaticEvents>;
9264
- type BusinessStatusUpdateHandler = WebhookHandler<ProcessedBusinessStatusUpdate>;
9265
- type BusinessUsernameUpdatesHandler = WebhookHandler<ProcessedBusinessUsernameUpdates>;
9266
- type CallsHandler = WebhookHandler<ProcessedCalls>;
9267
- type GroupLifecycleUpdateHandler = WebhookHandler<ProcessedGroupLifecycleUpdate>;
9268
- type GroupParticipantsUpdateHandler = WebhookHandler<ProcessedGroupParticipantsUpdate>;
9269
- type GroupSettingsUpdateHandler = WebhookHandler<ProcessedGroupSettingsUpdate>;
9270
- type GroupStatusUpdateHandler = WebhookHandler<ProcessedGroupStatusUpdate>;
9271
- type MessageEchoesHandler = WebhookHandler<ProcessedMessageEchoes>;
9272
- type MessageTemplateComponentsUpdateHandler = WebhookHandler<ProcessedMessageTemplateComponentsUpdate>;
9273
- type MessagingHandoversHandler = WebhookHandler<ProcessedMessagingHandovers>;
9274
- type PartnerSolutionsHandler = WebhookHandler<ProcessedPartnerSolutions>;
9275
- type PaymentConfigurationUpdateHandler = WebhookHandler<ProcessedPaymentConfigurationUpdate>;
9276
- type StandbyHandler = WebhookHandler<ProcessedStandby>;
9277
- type TemplateCorrectCategoryDetectionHandler = WebhookHandler<ProcessedTemplateCorrectCategoryDetection>;
9278
- type TrackingEventsHandler = WebhookHandler<ProcessedTrackingEvents>;
9279
- type UserPreferencesHandler = WebhookHandler<ProcessedUserPreferences>;
9420
+ /** Handler for a non-`messages` webhook field; `processed.value` is typed by the field name. */
9421
+ type WebhookFieldHandler<F extends NonMessageWebhookField> = WebhookHandler<ProcessedWebhookField<F>>;
9422
+ /** Registered field handlers keyed by field name, as kept by `WebhookProcessor`. */
9423
+ type WebhookFieldHandlerMap = ReadonlyMap<NonMessageWebhookField, AnyWebhookFieldHandler>;
9424
+ /**
9425
+ * Field handler with the field type erased, for storage in a map. `on()`
9426
+ * guarantees each stored handler matches its key.
9427
+ */
9428
+ type AnyWebhookFieldHandler = WebhookHandler<{
9429
+ wabaId: string;
9430
+ value: any;
9431
+ }>;
9432
+ type AccountUpdateHandler = WebhookFieldHandler<'account_update'>;
9433
+ type AccountReviewUpdateHandler = WebhookFieldHandler<'account_review_update'>;
9434
+ type AccountAlertsHandler = WebhookFieldHandler<'account_alerts'>;
9435
+ type BusinessCapabilityUpdateHandler = WebhookFieldHandler<'business_capability_update'>;
9436
+ type PhoneNumberNameUpdateHandler = WebhookFieldHandler<'phone_number_name_update'>;
9437
+ type PhoneNumberQualityUpdateHandler = WebhookFieldHandler<'phone_number_quality_update'>;
9438
+ type MessageTemplateStatusUpdateHandler = WebhookFieldHandler<'message_template_status_update'>;
9439
+ type TemplateCategoryUpdateHandler = WebhookFieldHandler<'template_category_update'>;
9440
+ type MessageTemplateQualityUpdateHandler = WebhookFieldHandler<'message_template_quality_update'>;
9441
+ type FlowsHandler = WebhookFieldHandler<'flows'>;
9442
+ type SecurityHandler = WebhookFieldHandler<'security'>;
9443
+ type HistoryHandler = WebhookFieldHandler<'history'>;
9444
+ type SmbMessageEchoesHandler = WebhookFieldHandler<'smb_message_echoes'>;
9445
+ type SmbAppStateSyncHandler = WebhookFieldHandler<'smb_app_state_sync'>;
9446
+ type AccountSettingsUpdateHandler = WebhookFieldHandler<'account_settings_update'>;
9447
+ type AutomaticEventsHandler = WebhookFieldHandler<'automatic_events'>;
9448
+ type BusinessStatusUpdateHandler = WebhookFieldHandler<'business_status_update'>;
9449
+ type BusinessUsernameUpdatesHandler = WebhookFieldHandler<'business_username_updates'>;
9450
+ type CallsHandler = WebhookFieldHandler<'calls'>;
9451
+ type GroupLifecycleUpdateHandler = WebhookFieldHandler<'group_lifecycle_update'>;
9452
+ type GroupParticipantsUpdateHandler = WebhookFieldHandler<'group_participants_update'>;
9453
+ type GroupSettingsUpdateHandler = WebhookFieldHandler<'group_settings_update'>;
9454
+ type GroupStatusUpdateHandler = WebhookFieldHandler<'group_status_update'>;
9455
+ type MessageEchoesHandler = WebhookFieldHandler<'message_echoes'>;
9456
+ type MessageTemplateComponentsUpdateHandler = WebhookFieldHandler<'message_template_components_update'>;
9457
+ type MessagingHandoversHandler = WebhookFieldHandler<'messaging_handovers'>;
9458
+ type PartnerSolutionsHandler = WebhookFieldHandler<'partner_solutions'>;
9459
+ type PaymentConfigurationUpdateHandler = WebhookFieldHandler<'payment_configuration_update'>;
9460
+ type StandbyHandler = WebhookFieldHandler<'standby'>;
9461
+ type TemplateCorrectCategoryDetectionHandler = WebhookFieldHandler<'template_correct_category_detection'>;
9462
+ type TrackingEventsHandler = WebhookFieldHandler<'tracking_events'>;
9463
+ type UserPreferencesHandler = WebhookFieldHandler<'user_preferences'>;
9280
9464
  type TextMessageHandler = WebhookHandler<TextProcessedMessage>;
9281
9465
  type ImageMessageHandler = WebhookHandler<ImageProcessedMessage>;
9282
9466
  type VideoMessageHandler = WebhookHandler<VideoProcessedMessage>;
@@ -9291,16 +9475,11 @@ type ReactionMessageHandler = WebhookHandler<ReactionProcessedMessage>;
9291
9475
  type OrderMessageHandler = WebhookHandler<OrderProcessedMessage>;
9292
9476
  type SystemMessageHandler = WebhookHandler<SystemProcessedMessage>;
9293
9477
  /**
9294
- * Process webhook messages
9478
+ * Named handler options accepted by {@link processWebhookMessages}, one per
9479
+ * webhook field except `messages`. Kept for backward compatibility; new code
9480
+ * can pass `fieldHandlers` instead.
9295
9481
  */
9296
- declare function processWebhookMessages(request: Request, whatsapp: WhatsApp, handlers: {
9297
- messageHandlers: Map<MessageTypesEnum, MessageHandler>;
9298
- statusHandler?: StatusHandler;
9299
- userActionHandler?: UserActionHandler;
9300
- preProcessHandler?: MessageHandler;
9301
- postProcessHandler?: MessageHandler;
9302
- rawHandler?: RawWebhookHandler;
9303
- rawHandlerFields?: WebhookFieldType[];
9482
+ type WebhookFieldHandlerOptions = {
9304
9483
  accountUpdateHandler?: AccountUpdateHandler;
9305
9484
  accountReviewUpdateHandler?: AccountReviewUpdateHandler;
9306
9485
  accountAlertsHandler?: AccountAlertsHandler;
@@ -9333,7 +9512,33 @@ declare function processWebhookMessages(request: Request, whatsapp: WhatsApp, ha
9333
9512
  templateCorrectCategoryDetectionHandler?: TemplateCorrectCategoryDetectionHandler;
9334
9513
  trackingEventsHandler?: TrackingEventsHandler;
9335
9514
  userPreferencesHandler?: UserPreferencesHandler;
9336
- }, options?: WebhookSignatureOptions): Promise<Response>;
9515
+ };
9516
+ /** Dedupe settings for {@link processWebhookMessages}. */
9517
+ type WebhookDedupeOptions = {
9518
+ store: DedupeStore; /** Defaults to 86400 (24 hours). */
9519
+ ttlSeconds?: number;
9520
+ };
9521
+ /** Options for {@link processWebhookMessages}. */
9522
+ type ProcessWebhookOptions = WebhookSignatureOptions & {
9523
+ /** Skip handlers for deliveries already seen. Duplicates still get a 200 response. */dedupe?: WebhookDedupeOptions;
9524
+ };
9525
+ /**
9526
+ * Process webhook messages
9527
+ */
9528
+ declare function processWebhookMessages(request: Request, whatsapp: WhatsApp, handlers: {
9529
+ messageHandlers: Map<MessageTypesEnum, MessageHandler>;
9530
+ statusHandler?: StatusHandler;
9531
+ userActionHandler?: UserActionHandler;
9532
+ preProcessHandler?: MessageHandler;
9533
+ postProcessHandler?: MessageHandler;
9534
+ rawHandler?: RawWebhookHandler;
9535
+ rawHandlerFields?: WebhookFieldType[];
9536
+ /**
9537
+ * Handlers for non-`messages` fields keyed by field name. Takes
9538
+ * precedence over the named `xxxHandler` option for the same field.
9539
+ */
9540
+ fieldHandlers?: WebhookFieldHandlerMap;
9541
+ } & WebhookFieldHandlerOptions, options?: ProcessWebhookOptions): Promise<Response>;
9337
9542
  /**
9338
9543
  * Handle flow requests
9339
9544
  */
@@ -9344,8 +9549,13 @@ type WebhookSignatureOptions = {
9344
9549
  };
9345
9550
  /**
9346
9551
  * Check an `X-Hub-Signature-256` header (`sha256=<hex>`) against the raw
9347
- * request body. Constant-time; returns false instead of throwing on
9348
- * malformed or wrong-length input.
9552
+ * request body using Web Crypto, so it works on every runtime. Constant-time;
9553
+ * resolves to false instead of throwing on malformed or wrong-length input.
9554
+ */
9555
+ declare function verifyWebhookSignature(rawBody: string, signatureHeader: string | null, appSecret: string): Promise<boolean>;
9556
+ /**
9557
+ * Synchronous variant of {@link verifyWebhookSignature}. Needs `node:crypto`
9558
+ * (Node.js >= 20.12, Bun, Deno); prefer the async variant on edge runtimes.
9349
9559
  */
9350
9560
  declare function isValidWebhookSignature(rawBody: string, signatureHeader: string | null, appSecret: string): boolean;
9351
9561
  /**
@@ -9372,39 +9582,10 @@ declare class WebhookProcessor {
9372
9582
  private postProcessHandler;
9373
9583
  private rawHandler;
9374
9584
  private flowHandlers;
9375
- private accountUpdateHandler;
9376
- private accountReviewUpdateHandler;
9377
- private accountAlertsHandler;
9378
- private businessCapabilityUpdateHandler;
9379
- private phoneNumberNameUpdateHandler;
9380
- private phoneNumberQualityUpdateHandler;
9381
- private messageTemplateStatusUpdateHandler;
9382
- private templateCategoryUpdateHandler;
9383
- private messageTemplateQualityUpdateHandler;
9384
- private flowsHandler;
9385
- private securityHandler;
9386
- private historyHandler;
9387
- private smbMessageEchoesHandler;
9388
- private smbAppStateSyncHandler;
9389
- private accountSettingsUpdateHandler;
9390
- private automaticEventsHandler;
9391
- private businessStatusUpdateHandler;
9392
- private businessUsernameUpdatesHandler;
9393
- private callsHandler;
9394
- private groupLifecycleUpdateHandler;
9395
- private groupParticipantsUpdateHandler;
9396
- private groupSettingsUpdateHandler;
9397
- private groupStatusUpdateHandler;
9398
- private messageEchoesHandler;
9399
- private messageTemplateComponentsUpdateHandler;
9400
- private messagingHandoversHandler;
9401
- private partnerSolutionsHandler;
9402
- private paymentConfigurationUpdateHandler;
9403
- private standbyHandler;
9404
- private templateCorrectCategoryDetectionHandler;
9405
- private trackingEventsHandler;
9406
- private userPreferencesHandler;
9585
+ /** Handlers for every webhook field except `messages`, keyed by field name. */
9586
+ private fieldHandlers;
9407
9587
  private verifySignature;
9588
+ private dedupe;
9408
9589
  constructor(config: WhatsAppConfig);
9409
9590
  processVerification(mode: string | null, token: string | null, challenge: string | null): Promise<WebhookResponse>;
9410
9591
  processWebhook(request: Request): Promise<WebhookResponse>;
@@ -9423,6 +9604,29 @@ declare class WebhookProcessor {
9423
9604
  onMessagePostProcess(handler: MessageHandler): void;
9424
9605
  onRaw(handler: RawWebhookHandler, fields?: WebhookFieldType[]): void;
9425
9606
  onFlow(type: FlowTypeEnum, handler: FlowHandler): void;
9607
+ /**
9608
+ * Register a handler for any webhook field except `messages`. The type of
9609
+ * `processed.value` follows from the field name. Replaces any handler
9610
+ * already registered for that field, including one set with the matching
9611
+ * `onXxx` method (for example `onCalls` is `on('calls', handler)`).
9612
+ *
9613
+ * `messages` is not accepted: use `onMessage`, the typed message methods
9614
+ * (`onText`, ...), `onStatus` or `onUserAction`, which split that field
9615
+ * into messages, statuses and user actions.
9616
+ *
9617
+ * @example
9618
+ * ```typescript
9619
+ * processor.on('calls', async (whatsapp, { value }) => {
9620
+ * for (const call of value.calls) console.log(call.id, call.event);
9621
+ * });
9622
+ * ```
9623
+ */
9624
+ on<F extends NonMessageWebhookField>(field: F, handler: WebhookFieldHandler<F>): void;
9625
+ /**
9626
+ * Remove the handler for a webhook field registered with `on()` or the
9627
+ * matching `onXxx` method. `messages` is not accepted (see {@link on}).
9628
+ */
9629
+ off(field: NonMessageWebhookField): void;
9426
9630
  /**
9427
9631
  * Register a handler for text messages
9428
9632
  * @param handler Type-safe handler that receives text messages with guaranteed text field
@@ -9720,26 +9924,108 @@ declare function expressWebhookHandler(config: ExpressWebhookConfig): {
9720
9924
  destroy: () => void;
9721
9925
  };
9722
9926
  //#endregion
9723
- //#region src/core/webhook/frameworks/nextjs-app/nextjs-app.d.ts
9724
- interface NextRequest extends Request {
9725
- nextUrl: {
9726
- searchParams: URLSearchParams;
9927
+ //#region src/core/webhook/frameworks/fastify/fastify.d.ts
9928
+ interface FastifyWebhookRequest {
9929
+ method: string;
9930
+ url: string;
9931
+ headers: Record<string, string | string[] | undefined>;
9932
+ body?: unknown;
9933
+ query?: unknown;
9934
+ /**
9935
+ * The unparsed request body. Fastify does not keep it by default: set it in
9936
+ * a content-type parser or with the `fastify-raw-body` plugin. Required for
9937
+ * `verifyWebhookSignature: true`, because re-serializing the parsed body
9938
+ * does not reproduce the bytes Meta signed.
9939
+ */
9940
+ rawBody?: string | Uint8Array;
9941
+ }
9942
+ interface FastifyWebhookReply {
9943
+ code(statusCode: number): FastifyWebhookReply;
9944
+ header(name: string, value: string): FastifyWebhookReply;
9945
+ send(payload?: any): FastifyWebhookReply;
9946
+ }
9947
+ interface FastifyWebhookConfig extends WhatsAppConfig {}
9948
+ /** The object returned by {@link fastifyWebhookHandler}. */
9949
+ type FastifyWebhookHandlers = ReturnType<typeof createHandlers$2>;
9950
+ /**
9951
+ * Fastify webhook handler.
9952
+ *
9953
+ * @example
9954
+ * const wa = fastifyWebhookHandler(config);
9955
+ * wa.processor.onText(async (whatsapp, { message }) => { ... });
9956
+ * app.get('/webhook', wa.GET);
9957
+ * app.post('/webhook', wa.POST);
9958
+ * app.post('/flow', wa.flow);
9959
+ */
9960
+ declare function fastifyWebhookHandler(config: FastifyWebhookConfig): FastifyWebhookHandlers;
9961
+ declare function createHandlers$2(config: FastifyWebhookConfig, key: string): {
9962
+ GET: (request: FastifyWebhookRequest, reply: FastifyWebhookReply) => Promise<FastifyWebhookReply>;
9963
+ POST: (request: FastifyWebhookRequest, reply: FastifyWebhookReply) => Promise<FastifyWebhookReply>;
9964
+ webhook: (request: FastifyWebhookRequest, reply: FastifyWebhookReply) => Promise<FastifyWebhookReply>;
9965
+ flow: (request: FastifyWebhookRequest, reply: FastifyWebhookReply) => Promise<FastifyWebhookReply>;
9966
+ processor: WebhookProcessor;
9967
+ /**
9968
+ * Destroy this handler instance: removes all registered handlers
9969
+ * and clears it from the singleton cache so the next call creates a fresh instance.
9970
+ */
9971
+ destroy: () => void;
9972
+ };
9973
+ //#endregion
9974
+ //#region src/core/webhook/frameworks/hono/hono.d.ts
9975
+ /**
9976
+ * The part of Hono's `Context` this adapter uses, typed locally so `hono` is
9977
+ * not a dependency. Any Hono `Context` satisfies it: `c.req.raw` is the
9978
+ * underlying web `Request`.
9979
+ */
9980
+ interface HonoWebhookContext {
9981
+ req: {
9982
+ raw: Request; /** Hono's cached body reader, used when middleware already consumed `raw`. */
9983
+ text?: () => Promise<string>;
9727
9984
  };
9728
9985
  }
9986
+ interface HonoWebhookConfig extends WhatsAppConfig {}
9987
+ /** The object returned by {@link honoWebhookHandler}. */
9988
+ type HonoWebhookHandlers = ReturnType<typeof createHandlers$1>;
9989
+ /**
9990
+ * Hono webhook handler. Works on every runtime Hono runs on (Node.js, Bun,
9991
+ * Deno, Cloudflare Workers, Vercel Edge).
9992
+ *
9993
+ * @example
9994
+ * const wa = honoWebhookHandler(config);
9995
+ * wa.processor.onText(async (whatsapp, { message }) => { ... });
9996
+ * app.get('/webhook', wa.GET);
9997
+ * app.post('/webhook', wa.POST);
9998
+ * app.post('/flow', wa.flow);
9999
+ */
10000
+ declare function honoWebhookHandler(config: HonoWebhookConfig): HonoWebhookHandlers;
10001
+ declare function createHandlers$1(config: HonoWebhookConfig, key: string): {
10002
+ GET: (c: HonoWebhookContext) => Promise<Response>;
10003
+ POST: (c: HonoWebhookContext) => Promise<Response>;
10004
+ webhook: (c: HonoWebhookContext) => Promise<Response>;
10005
+ flow: (c: HonoWebhookContext) => Promise<Response>;
10006
+ processor: WebhookProcessor;
10007
+ /**
10008
+ * Destroy this handler instance: removes all registered handlers
10009
+ * and clears it from the singleton cache so the next call creates a fresh instance.
10010
+ */
10011
+ destroy: () => void;
10012
+ };
10013
+ //#endregion
10014
+ //#region src/core/webhook/frameworks/nextjs-app/nextjs-app.d.ts
9729
10015
  interface NextJsAppWebhookConfig extends WhatsAppConfig {}
9730
10016
  /** The object returned by {@link nextjsAppWebhookHandler}. */
9731
10017
  type NextJsAppWebhookHandlers = ReturnType<typeof createHandlers>;
9732
10018
  declare function nextjsAppWebhookHandler(config: NextJsAppWebhookConfig): NextJsAppWebhookHandlers;
9733
10019
  declare function createHandlers(config: NextJsAppWebhookConfig, key: string): {
9734
- GET: (request: NextRequest) => Promise<Response>;
9735
- POST: (request: NextRequest) => Promise<Response>;
10020
+ GET: (request: Request) => Promise<Response>;
10021
+ POST: (request: Request) => Promise<Response>;
9736
10022
  webhook: {
9737
- GET: (request: NextRequest) => Promise<Response>;
9738
- POST: (request: NextRequest) => Promise<Response>;
10023
+ GET: (request: Request) => Promise<Response>;
10024
+ POST: (request: Request) => Promise<Response>;
9739
10025
  };
9740
10026
  flow: {
9741
- GET: (request: NextRequest) => Promise<Response>;
9742
- POST: (request: NextRequest) => Promise<Response>;
10027
+ GET: (request: Request) => Promise<Response>;
10028
+ POST: (request: Request) => Promise<Response>;
9743
10029
  };
9744
10030
  processor: WebhookProcessor;
9745
10031
  /**
@@ -9798,7 +10084,14 @@ declare function nextjsPagesWebhookHandler<TRequest extends BaseApiRequest, TRes
9798
10084
  declare function extractMessageText(message: WhatsAppMessage): string;
9799
10085
  //#endregion
9800
10086
  //#region src/core/webhook/utils/generateXHub256Sig.d.ts
10087
+ /**
10088
+ * Compute the hex HMAC-SHA256 that Meta sends in `X-Hub-Signature-256`
10089
+ * (without the `sha256=` prefix). Needs `node:crypto`; use
10090
+ * {@link generateXHub256SigAsync} on edge runtimes.
10091
+ */
9801
10092
  declare const generateXHub256Sig: (body: string, appSecret: string) => string;
10093
+ /** Web Crypto variant of {@link generateXHub256Sig}; works on every runtime. */
10094
+ declare const generateXHub256SigAsync: (body: string, appSecret: string) => Promise<string>;
9802
10095
  //#endregion
9803
10096
  //#region src/core/webhook/utils/messageHelpers.d.ts
9804
10097
  declare function isTextMessage(msg: WhatsAppMessage): msg is TextMessage;
@@ -9920,16 +10213,136 @@ declare function buildFieldsQueryString(fields?: string[] | string): string;
9920
10213
  */
9921
10214
  declare function formatConfigTable(config: WabaConfigType): string;
9922
10215
  //#endregion
10216
+ //#region src/utils/customerServiceWindow.d.ts
10217
+ /**
10218
+ * Length of the customer service window: 24 hours.
10219
+ *
10220
+ * "When a WhatsApp user messages you or calls you, a 24-hour timer called a customer service window
10221
+ * starts. If the user messages or calls you again before the timer expires, the timer resets to
10222
+ * 24 hours. [...] When the window closes, you can only send pre-approved template messages."
10223
+ *
10224
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/send-messages/ | Send messages: customer service windows}
10225
+ */
10226
+ declare const CUSTOMER_SERVICE_WINDOW_MS: number;
10227
+ /**
10228
+ * SDK fallback length of a free entry point (FEP) window: 72 hours.
10229
+ * Prefer the expiry supplied by Meta; this fallback does not establish billing eligibility.
10230
+ *
10231
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing/ | Pricing: free entry point windows}
10232
+ */
10233
+ declare const FREE_ENTRY_POINT_WINDOW_MS: number;
10234
+ /**
10235
+ * Longest free entry point window Meta documents: up to 7 days for conversations started from an
10236
+ * ad that clicks to WhatsApp.
10237
+ *
10238
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing/ | Pricing: free entry point windows}
10239
+ */
10240
+ declare const MAX_FREE_ENTRY_POINT_WINDOW_MS: number;
10241
+ /**
10242
+ * A point in time accepted by the window helpers:
10243
+ * - `Date`
10244
+ * - `number`: Unix epoch in milliseconds, or in seconds when below `1e11` (before the year 5138 in
10245
+ * seconds, before March 1973 in milliseconds), so both `Date.now()` and webhook timestamps work
10246
+ * - `string`: a numeric string such as the webhook `messages[].timestamp` (`"1727856000"`, Unix
10247
+ * seconds, same rule as numbers), or any string `Date.parse` understands (ISO 8601)
10248
+ */
10249
+ type WindowTimestamp = Date | number | string;
10250
+ /** State of a messaging window at a given instant. */
10251
+ interface MessagingWindow {
10252
+ /** True while the window is open (`now < expiresAt`). */
10253
+ isOpen: boolean;
10254
+ /** When the window closes, or `null` when there is no window (no inbound message yet). */
10255
+ expiresAt: Date | null;
10256
+ /** Milliseconds until the window closes, `0` once closed. Never more than the window length. */
10257
+ remainingMs: number;
10258
+ }
10259
+ interface CustomerServiceWindowOptions {
10260
+ /** The instant to evaluate. Defaults to `Date.now()`. */
10261
+ now?: WindowTimestamp;
10262
+ /**
10263
+ * Treat the window as closing this many milliseconds early. Use it to absorb clock drift between
10264
+ * your servers and Meta and the time a send spends in flight. Defaults to `0`.
10265
+ */
10266
+ safetyMarginMs?: number;
10267
+ }
10268
+ interface FreeEntryPointWindowOptions extends CustomerServiceWindowOptions {
10269
+ /**
10270
+ * Window length. Defaults to {@link FREE_ENTRY_POINT_WINDOW_MS} (72 hours). Meta may keep a
10271
+ * click-to-WhatsApp ad window open for up to {@link MAX_FREE_ENTRY_POINT_WINDOW_MS} (7 days)
10272
+ * without saying how long a given window lasts, so prefer `expiresAt` when you have it.
10273
+ */
10274
+ durationMs?: number;
10275
+ /**
10276
+ * Exact expiry when known, for example the status webhook's `conversation.expiration_timestamp`
10277
+ * (Unix seconds). Overrides `durationMs`.
10278
+ */
10279
+ expiresAt?: WindowTimestamp;
10280
+ }
10281
+ /**
10282
+ * Returns the state of the 24-hour customer service window opened by the user's last inbound
10283
+ * message (or call).
10284
+ *
10285
+ * Free-form (non-template) messages can only be sent while it is open; outside it only approved
10286
+ * template messages are delivered (Meta rejects others with error `131047`). The window is exactly
10287
+ * 24 hours from the user's last message: at `lastInboundAt + 24h` it is closed.
10288
+ *
10289
+ * Pass the webhook message `timestamp` (Unix seconds string) of the latest message from the user.
10290
+ * Messages you send do not extend the window. Pass `null`/`undefined` when the user has never
10291
+ * messaged you; that returns a closed window with `expiresAt: null`.
10292
+ *
10293
+ * A free entry point window does not reopen this window: "the customer service window is independent
10294
+ * of the FEP window, so if the customer service window closes, you will only be able to send template
10295
+ * messages." Use {@link getFreeEntryPointWindow} for the pricing side.
10296
+ *
10297
+ * @throws WhatsAppValidationError when a timestamp or `safetyMarginMs` is malformed.
10298
+ *
10299
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/send-messages/ | Send messages: customer service windows}
10300
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing/ | Pricing}
10301
+ *
10302
+ * @example
10303
+ * ```ts
10304
+ * const { isOpen, expiresAt } = getCustomerServiceWindow(message.timestamp);
10305
+ * if (!isOpen) await sendTemplateInstead();
10306
+ * ```
10307
+ */
10308
+ declare function getCustomerServiceWindow(lastInboundAt: WindowTimestamp | null | undefined, options?: CustomerServiceWindowOptions): MessagingWindow;
10309
+ /**
10310
+ * True when a free-form (non-template) message can be sent: the customer service window opened by
10311
+ * the user's last inbound message is still open. See {@link getCustomerServiceWindow}.
10312
+ *
10313
+ * @throws WhatsAppValidationError when a timestamp or `safetyMarginMs` is malformed.
10314
+ */
10315
+ declare function canSendFreeformMessage(lastInboundAt: WindowTimestamp | null | undefined, options?: CustomerServiceWindowOptions): boolean;
10316
+ /**
10317
+ * Returns the state of a free entry point (FEP) window.
10318
+ *
10319
+ * For eligible click-to-WhatsApp ad traffic, replying within the customer service window opens
10320
+ * a billing window from the time of your reply. Pass that first reply time as `openedAt`.
10321
+ *
10322
+ * Meta documents windows lasting up to 7 days for ads that click to WhatsApp. This helper uses
10323
+ * a 72-hour fallback estimate. Pass `expiresAt` (the status webhook's
10324
+ * `conversation.expiration_timestamp`) when you have it, or set `durationMs`.
10325
+ *
10326
+ * This is a billing window only. It does not allow free-form messages after the customer service
10327
+ * window closes; check {@link canSendFreeformMessage} for that.
10328
+ *
10329
+ * @throws WhatsAppValidationError when a timestamp, `durationMs` or `safetyMarginMs` is malformed.
10330
+ *
10331
+ * @see {@link https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing/ | Pricing: free entry point windows}
10332
+ */
10333
+ declare function getFreeEntryPointWindow(openedAt: WindowTimestamp | null | undefined, options?: FreeEntryPointWindowOptions): MessagingWindow;
10334
+ //#endregion
9923
10335
  //#region src/utils/logger.d.ts
9924
10336
  declare class Logger implements LoggerInterface {
9925
10337
  private name;
9926
- private debug;
10338
+ private debugEnabled;
9927
10339
  constructor(name: string, debug?: boolean);
9928
10340
  private formatData;
9929
10341
  log(...data: any[]): void;
9930
10342
  error(...data: any[]): void;
9931
10343
  warn(...data: any[]): void;
9932
10344
  info(...data: any[]): void;
10345
+ debug(...data: any[]): void;
9933
10346
  }
9934
10347
  //#endregion
9935
10348
  //#region src/utils/objectToQueryString.d.ts
@@ -9976,5 +10389,5 @@ declare function isFlowErrorRequest(request: FlowEndpointRequest): request is Fl
9976
10389
  */
9977
10390
  declare function isFlowPingRequest(request: FlowEndpointRequest): request is FlowHealthCheckRequest;
9978
10391
  //#endregion
9979
- export { AUTHORIZATION_ERROR_CODES, type AcceptCallRequest, AcceptSolutionRequest, AccountMode, AddPhoneNumbersRequest, type ApiPermissionErrorCode, AssignedUserRequest, AssignedUsersListParams, type AudioMediaObject, AudioMediaTypes, AudioMediaTypesEnum, AudioMediaTypesType, type AudioMessage, type AudioMessageHandler, type AudioProcessedMessage, type AuthenticationTemplateOptions, BLOCK_USER_ERROR_CODES, type BaseApiRequest, type BaseApiResponse, type BaseClass, BlockUserObject, BlockUsersApi, BlockUsersClass, BlockUsersRequest, BlockUsersResponse, BlockedUserInfo, type BodyOptions, BusinessApi, BusinessClass, BusinessComplianceInfoResponse, BusinessFieldsParam, BusinessGraphListResponse, BusinessGraphObject, BusinessListParams, BusinessProfileApi, type BusinessProfileClass, type BusinessProfileData, type BusinessProfileField, type BusinessProfileFieldsParam, type BusinessProfileResponse, BusinessVerticalEnum, type ButtonMessage, type ButtonMessageHandler, type ButtonOptions, ButtonPosition, ButtonPositionEnum, ButtonPositionType, type ButtonProcessedMessage, CALLING_ERROR_CODES, type CallAction, type CallActionResponse, type CallAnnouncementLanguage, type CallCaptureStatus, type CallHours, type CallHoursDay, type CallHoursStatus, type CallIconVisibility, type CallPermission, type CallPermissionAction, type CallPermissionLimit, type CallPermissionsResponse, type CallRecordingConfig, type CallSdpType, type CallSession, type CallTranscriptionConfig, type CallbackPermissionStatus, CallingApi, type CallingClass, type CallingSettings, type CallingSettingsResponse, type CallingStatus, CarouselCard, type CarouselOptions, CatalogButton, type CatalogTemplateOptions, Category, CategoryEnum, CategoryType, CodeVerificationStatus, CommerceApi, type CommerceClass, type CommerceSetting, type CommerceSettingsResponse, ComponentType, ComponentTypeType, ComponentTypes, ComponentTypesEnum, ContactBookApi, ContactBookClass, type ContactInfo, type ContactObject, type ContactsMessage, type ContactsMessageHandler, type ContactsProcessedMessage, ConversationTypes, ConversationTypesEnum, ConversationTypesType, ConversationalAutomationRequest, ConversationalAutomationResponse, ConversationalCommand, ConversationalPrompt, CopyCodeButton, type CouponTemplateOptions, type CreateFlowResponse, CreateOBOMobilityIntentRequest, CreatePhoneNumberRequest, CreatePhoneNumberResponse, type CreateQrCodeRequest, CreateScheduleRequest, type CreateUploadSessionParams, CreateWhatsAppBusinessSolutionRequest, CurrencyCodesEnum, type CurrencyParameter, CursorPaginationParams, Cursors, DataLocalizationRegion, DataLocalizationRegionEnum, DataLocalizationRegionType, type DateTimeParameter, DeleteContactBookEntryParams, DeleteContactBookEntryResponse, type DirectSendCategory, type DirectSendConfig, type DirectSendOptions, type DocumentMediaObject, DocumentMediaTypes, DocumentMediaTypesEnum, DocumentMediaTypesType, type DocumentMessage, type DocumentMessageHandler, type DocumentProcessedMessage, type EncryptedMessageRequest, type EncryptedMessagesResponse, EncryptionApi, type EncryptionClass, type EncryptionKeyPair, type EncryptionPublicKeyResponse, type ErrorWebhookValue, type ExpressRequest, type ExpressResponse, type ExpressWebhookConfig, FLOW_ERROR_CODES, FailedUserInfo, type Flow, FlowActionEnum, FlowApi, type FlowAsset, type FlowAssetsResponse, FlowButton, FlowCategoryEnum, type FlowClass, type FlowDataExchangeRequest, type FlowDataExchangeResponse, type FlowDecryptedRequestResponse, type FlowEncryptedRequestPayload, type FlowEndpointRequest, type FlowEndpointResponse, type FlowErrorNotificationRequest, type FlowErrorNotificationResponse, type FlowHandler, type FlowHealthCheckRequest, type FlowHealthCheckResponse, type FlowHttpRequest, type FlowMigrationFailure, type FlowMigrationResponse, type FlowMigrationResult, type FlowPreview, type FlowPreviewResponse, FlowStatusEnum, type FlowSuccessScreenResponse, type FlowType, FlowTypeEnum, type FlowValidationError, type FlowValidationErrorPointer, type FlowsListResponse, type FooterOptions, GROUP_ERROR_CODES, type GeneralHeaderInterface, type GeneralMessageBody, type GeneralRequestBody, type GetUploadHandleParams, GraphObject, type GroupCreateRequest, type GroupCreateResponse, type GroupInfoField, type GroupInfoFieldsParam, type GroupInfoResponse, type GroupInviteLinkResponse, type GroupJoinApprovalMode, type GroupJoinRequest, type GroupJoinRequestError, type GroupJoinRequestFailure, type GroupJoinRequestsActionResponse, type GroupJoinRequestsResponse, type GroupListParams, type GroupListResponse, type GroupMessage, type GroupParticipant, type GroupParticipantInput, type GroupParticipantsRequest, type GroupSettingsResponse, GroupsApi, type GroupsClass, type HeaderOptions, HealthStatus, HealthStatusEntity, type HolidaySchedule, HostPlatform, HttpMethods, HttpMethodsEnum, HttpMethodsType, type HttpsClientClass, type HttpsClientResponseClass, INTEGRITY_ERROR_CODES, type ImageMediaObject, ImageMediaTypes, ImageMediaTypesEnum, ImageMediaTypesType, type ImageMessage, type ImageMessageHandler, type ImageProcessedMessage, type InitiateCallRequest, type InitiateCallResponse, type InteractiveButtonReplyMessage, type InteractiveListReplyMessage, type InteractiveMessage, type InteractiveMessageHandler, type InteractiveObject, type InteractiveProcessedMessage, type InteractiveReply, InteractiveTypes, InteractiveTypesEnum, InteractiveTypesType, Languages, LanguagesEnum, LanguagesType, type LimitedTimeOfferOptions, type LimitedTimeOfferTemplateOptions, ListBlockedUsersParams, ListBlockedUsersResponse, type LocationInfo, type LocationMessage, type LocationMessageHandler, type LocationObject, type LocationParameter, type LocationProcessedMessage, Logger, type LoggerInterface, MPMButton, type MPMTemplateOptions, type MarketingMessageBidSpec, type MarketingMessageRequest, MarketingMessagesApi, type MarketingMessagesClass, type MarketingMessagesLinkClickData, MediaApi, type MediaCardCarouselTemplateOptions, MediaCarouselCard, MediaClass, type MediaInfo, type MediaParameter, MediaResponse, MediasResponse, MessagesApi as MessageApi, MessagesApi, MessageCategory, MessageCategoryEnum, MessageCategoryType, type MessageHandler, MessageHistoryApi, MessageHistoryClass, MessageHistoryEventListParams, MessageHistoryFieldsParam, MessageHistoryItem, MessageHistoryListParams, MessageHistoryResponse, type MessageRecipientType, type MessageRequestBody, type MessageRequestParams, type MessageStatus, MessageTemplateObject, MessageTemplateRequestBody, MessageTypes, MessageTypesEnum, MessageTypesType, type MessageWebhookValue, type MessagesClass, type MessagesResponse, MessagingLimitTier, type MetaError, type MetaErrorData, type MetaErrorDetail, type NextFunction, type NextJsAppWebhookConfig, type NextJsAppWebhookHandlers, type NextJsWebhookConfig, OTPButton, type OTPTemplateOptions, OfficialBusinessAccountAction, OfficialBusinessAccountApplicationData, OfficialBusinessAccountStatusResponse, OnboardPartnersToMMLiteRequest, type OrderInfo, type OrderMessage, type OrderMessageHandler, type OrderProcessedMessage, type Pagination, type PaginationCursors, type Paging, PagingCursors, PagingInfo, ParametersTypes, ParametersTypesEnum, ParametersTypesType, PassThreadControlParams, type PaymentConfiguration, type PaymentConfigurationCode, type PaymentConfigurationCreateRequest, type PaymentConfigurationCreateResponse, type PaymentConfigurationDeleteRequest, type PaymentConfigurationOauthLinkRequest, type PaymentConfigurationOauthLinkResponse, type PaymentConfigurationProvider, type PaymentConfigurationStatus, type PaymentConfigurationUpdateRequest, type PaymentConfigurationUpdateResponse, type PaymentConfigurationsResponse, PaymentsApi, type PaymentsClass, PhoneNumberApi, PhoneNumberButton, PhoneNumberClass, PhoneNumberField, PhoneNumberFieldsParam, PhoneNumberFilter, PhoneNumberResponse, PhoneNumberSettingsFieldsParam, PhoneNumberSettingsParams, PhoneNumberSettingsResponse, PhoneNumberSort, PhoneNumberStatus, PhoneNumbersListParams, PhoneNumbersResponse, PlatformType, type PreAcceptCallRequest, type ProcessedMessage, type ProcessedStatus, type ProcessedUserAction, type ProductCardCarouselTemplateOptions, ProductCarouselCard, type ProductParameter, type ProductSection, QrCodeApi, type QrCodeClass, type QrCodeResponse, type QrCodesResponse, QualityRating, QualityScore, QuickReplyButton, type ReactionInfo, type ReactionMessage, type ReactionMessageHandler, type ReactionParams, type ReactionProcessedMessage, ReferralSourceTypes, ReferralSourceTypesEnum, ReferralSourceTypesType, RegistrationApi, type RegistrationClass, type RegistrationRequest, type RejectCallRequest, RejectSolutionRequest, ReleaseThreadControlParams, RemoveAssignedUserRequest, RequestCodeMethods, RequestCodeMethodsEnum, RequestCodeMethodsType, RequestPreVerifiedPhoneNumberCodeRequest, RequestVerificationCodeRequest, type RequesterClass, type RequesterResponseInterface, type ResponseData, type ResponseHeaderValue, type ResponseHeaders, type ResponseJSONBody, type ResponsePagination, type ResponseSuccess, SEND_MESSAGE_ERROR_CODES, SPMButton, type SPMTemplateOptions, SetOBOMobilityIntentRequest, SetSolutionMigrationIntentRequest, SharePreVerifiedPhoneNumberRequest, type SipServer, type SipSettings, type SipStatus, SolutionDeactivationRequest, SolutionFieldsParam, SolutionGraphObject, SolutionListParams, SolutionListResponse, SolutionMigrationIntent, SolutionsApi, SolutionsClass, Status, StatusEnum, type StatusHandler, type StatusParams, type StatusResponse, StatusType, type StatusWebhook, type StatusWebhookValue, type StickerMediaObject, StickerMediaTypes, StickerMediaTypesEnum, StickerMediaTypesType, type StickerMessage, type StickerMessageHandler, type StickerProcessedMessage, SubType, SubTypeEnum, SubTypeType, SystemChangeTypes, SystemChangeTypesEnum, SystemChangeTypesType, type SystemMessage, type SystemMessageHandler, type SystemProcessedMessage, THROTTLING_ERROR_CODES, TakeThreadControlParams, TemplateApi, TemplateBidSpec, TemplateBody, TemplateButton, TemplateButtons, TemplateCarousel, TemplateClass, TemplateDeleteParams, TemplateFooter, TemplateFormat, TemplateGetParams, TemplateHeader, TemplateHeaderExample, TemplateLimitedTimeOffer, TemplateOptimizationSpec, type TemplateOptions, type TemplateParameter, TemplateRequestBody, TemplateResponse, TemplateStatus, TemplateStatusEnum, TemplateStatusType, type TerminateCallRequest, type TextMessage, type TextMessageHandler, type TextMessageParams, type TextObject, type TextParameter, type TextProcessedMessage, ThreadControlApi, ThreadControlBaseParams, ThreadControlClass, ThreadControlResponse, ThreadControlRole, ThreadControlUserIdentifier, Throughput, ThroughputLevel, ThroughputResponse, TwoStepVerificationApi, type TwoStepVerificationClass, TwoStepVerificationParams, type TwoStepVerificationRequest, URLButton, UnblockUsersRequest, UnifiedCertStatus, type UnsupportedMessage, UpdateBusinessComplianceInfoRequest, type UpdateBusinessProfileRequest, type UpdateCallingSettingsRequest, type UpdateCommerceSettingsRequest, type UpdateFlowResponse, type UpdateGroupSettingsRequest, UpdateOfficialBusinessAccountStatusRequest, UpdatePhoneNumberSettingsRequest, UpdatePhoneNumberStatusRequest, type UpdateQrCodeRequest, UpdateUsernameRequest, UpdateWabaAccountRequest, UpdateWabaSubscription, UpdateWhatsAppBusinessProfileRequest, type UploadBusinessProfileResponse, type UploadHandle, type UploadMediaParams, UploadMediaResponse, type UploadSession, type UploadSessionResponse, type UserAction, type UserActionHandler, type UserActionType, type UserActionsWebhookValue, UsernameResponse, UsernameStatus, UsernameSuggestionsResponse, UsernameTransferAction, type ValidateFlowJsonResponse, VerifyCodeRequest, VerifyPreVerifiedPhoneNumberCodeRequest, type VideoMediaObject, VideoMediaTypes, VideoMediaTypesEnum, VideoMediaTypesType, type VideoMessage, type VideoMessageHandler, type VideoProcessedMessage, WABAClass, WHATSAPP_ERROR_CODES, WabaAccount, WabaAccountFields, WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaApi, WabaBusinessVerificationStatus, WabaConfigEnum, type WabaConfigType, WabaFieldsParam, WabaGraphObject, WabaHealthStatus, WabaHealthStatusCanSendMessage, WabaHealthStatusEntity, WabaHealthStatusError, WabaListParams, WabaListResponse, WabaSubscription, WabaSubscriptions, type WebhookContact, type WebhookEvent, type WebhookHandlerContext, type WebhookMessage, type WebhookPayload, WebhookProcessor, type WebhookResponse, type WebhookSignatureOptions, WebhookTypes, WebhookTypesEnum, WebhookTypesType, type WebhookValue, type WeeklyOperatingHours, WhatsApp, WhatsApp as default, WhatsAppApiError, WhatsAppAuthorizationError, WhatsAppBlockUserError, WhatsAppCallingError, type WhatsAppConfig, WhatsAppError, type WhatsAppErrorCode, WhatsAppFlowError, WhatsAppGroupError, WhatsAppIntegrityError, type WhatsAppMessage, WhatsAppNetworkError, WhatsAppSendMessageError, WhatsAppThrottlingError, WhatsAppUnknownError, WhatsAppValidationError, buildFieldsQueryString, constructFullUrl, createAuthenticationTemplate, createCatalogTemplate, createCouponTemplate, createLimitedTimeOfferTemplate, createMPMTemplate, createMediaCardCarouselTemplate, createOTPTemplate, createProductCardCarouselTemplate, createSPMTemplate, createTemplate, createWhatsAppApiError, decryptFlowRequest, encryptFlowResponse, expressWebhookHandler, extractMessageText, formatConfigTable, generateEncryption, generateXHub256Sig, getContactsInfo, getInteractiveReply, getLocationInfo, getMediaInfo, getOrderInfo, getReactionInfo, isApiPermissionErrorCode, isAudioMessage, isAuthorizationErrorCode, isBlockUserErrorCode, isButtonMessage, isButtonReply, isCallingErrorCode, isContactsMessage, isDocumentMessage, isFlowDataExchangeRequest, isFlowErrorCode, isFlowErrorRequest, isFlowPingRequest, isGroupErrorCode, isImageMessage, isIntegrityErrorCode, isInteractiveMessage, isListReply, isLocationMessage, isMetaError, isNfmReply, isOrderMessage, isReactionMessage, isSendMessageErrorCode, isStickerMessage, isSystemMessage, isTextMessage, isThrottlingErrorCode, isValidWebhookSignature, isVideoMessage, isWhatsAppApiErrorResponse, isWhatsAppAuthorizationError, isWhatsAppBlockUserError, isWhatsAppCallingError, isWhatsAppErrorCode, isWhatsAppFlowError, isWhatsAppGroupError, isWhatsAppIntegrityError, isWhatsAppSendMessageError, isWhatsAppThrottlingError, nextjsAppWebhookHandler, nextjsPagesWebhookHandler, normalizeMetaError, objectToQueryString, processFlowRequest, processWebhookMessages };
10392
+ export { AUTHORIZATION_ERROR_CODES, type AcceptCallRequest, AcceptSolutionRequest, AccountMode, AddPhoneNumbersRequest, type ApiPermissionErrorCode, AssignedUserRequest, AssignedUsersListParams, type AudioMediaObject, AudioMediaTypes, AudioMediaTypesEnum, AudioMediaTypesType, type AudioMessage, type AudioMessageHandler, type AudioProcessedMessage, type AuthenticationTemplateOptions, BLOCK_USER_ERROR_CODES, type BaseApiRequest, type BaseApiResponse, type BaseClass, BlockUserObject, BlockUsersApi, BlockUsersClass, BlockUsersRequest, BlockUsersResponse, BlockedUserInfo, type BodyOptions, BusinessApi, BusinessClass, BusinessComplianceInfoResponse, BusinessFieldsParam, BusinessGraphListResponse, BusinessGraphObject, BusinessListParams, BusinessProfileApi, type BusinessProfileClass, type BusinessProfileData, type BusinessProfileField, type BusinessProfileFieldsParam, type BusinessProfileResponse, type BusinessUseCaseUsage, BusinessVerticalEnum, type ButtonMessage, type ButtonMessageHandler, type ButtonOptions, ButtonPosition, ButtonPositionEnum, ButtonPositionType, type ButtonProcessedMessage, CALLING_ERROR_CODES, CUSTOMER_SERVICE_WINDOW_MS, type CallAction, type CallActionResponse, type CallAnnouncementLanguage, type CallCaptureStatus, type CallHours, type CallHoursDay, type CallHoursStatus, type CallIconVisibility, type CallPermission, type CallPermissionAction, type CallPermissionLimit, type CallPermissionsResponse, type CallRecordingConfig, type CallSdpType, type CallSession, type CallTranscriptionConfig, type CallbackPermissionStatus, CallingApi, type CallingClass, type CallingSettings, type CallingSettingsResponse, type CallingStatus, CarouselCard, type CarouselOptions, CatalogButton, type CatalogTemplateOptions, Category, CategoryEnum, CategoryType, CodeVerificationStatus, CommerceApi, type CommerceClass, type CommerceSetting, type CommerceSettingsResponse, ComponentType, ComponentTypeType, ComponentTypes, ComponentTypesEnum, ContactBookApi, ContactBookClass, type ContactInfo, type ContactObject, type ContactsMessage, type ContactsMessageHandler, type ContactsProcessedMessage, ConversationTypes, ConversationTypesEnum, ConversationTypesType, ConversationalAutomationRequest, ConversationalAutomationResponse, ConversationalCommand, ConversationalPrompt, CopyCodeButton, type CouponTemplateOptions, type CreateFlowResponse, CreateOBOMobilityIntentRequest, CreatePhoneNumberRequest, CreatePhoneNumberResponse, type CreateQrCodeRequest, CreateScheduleRequest, type CreateUploadSessionParams, CreateWhatsAppBusinessSolutionRequest, CurrencyCodesEnum, type CurrencyParameter, CursorPaginationParams, Cursors, type CustomerServiceWindowOptions, DataLocalizationRegion, DataLocalizationRegionEnum, DataLocalizationRegionType, type DateTimeParameter, type DecryptedFlowRequest, type DedupeStore, DeleteContactBookEntryParams, DeleteContactBookEntryResponse, type DirectSendCategory, type DirectSendConfig, type DirectSendOptions, type DocumentMediaObject, DocumentMediaTypes, DocumentMediaTypesEnum, DocumentMediaTypesType, type DocumentMessage, type DocumentMessageHandler, type DocumentProcessedMessage, type EncryptedMessageRequest, type EncryptedMessagesResponse, EncryptionApi, type EncryptionClass, type EncryptionKeyPair, type EncryptionPublicKeyResponse, type ErrorWebhookValue, type ExpressRequest, type ExpressResponse, type ExpressWebhookConfig, FLOW_ERROR_CODES, FREE_ENTRY_POINT_WINDOW_MS, FailedUserInfo, type FastifyWebhookConfig, type FastifyWebhookHandlers, type FastifyWebhookReply, type FastifyWebhookRequest, type Flow, FlowActionEnum, FlowApi, type FlowAsset, type FlowAssetsResponse, FlowButton, FlowCategoryEnum, type FlowClass, type FlowDataExchangeRequest, type FlowDataExchangeResponse, type FlowDecryptedRequestResponse, type FlowEncryptedRequestPayload, type FlowEndpointRequest, type FlowEndpointResponse, type FlowErrorNotificationRequest, type FlowErrorNotificationResponse, type FlowHandler, type FlowHealthCheckRequest, type FlowHealthCheckResponse, type FlowHttpRequest, type FlowMigrationFailure, type FlowMigrationResponse, type FlowMigrationResult, type FlowPreview, type FlowPreviewResponse, FlowStatusEnum, type FlowSuccessScreenResponse, type FlowType, FlowTypeEnum, type FlowValidationError, type FlowValidationErrorPointer, type FlowsListResponse, type FooterOptions, type FreeEntryPointWindowOptions, GROUP_ERROR_CODES, type GeneralHeaderInterface, type GeneralMessageBody, type GeneralRequestBody, type GetUploadHandleParams, GraphObject, type GroupCreateRequest, type GroupCreateResponse, type GroupInfoField, type GroupInfoFieldsParam, type GroupInfoResponse, type GroupInviteLinkResponse, type GroupJoinApprovalMode, type GroupJoinRequest, type GroupJoinRequestError, type GroupJoinRequestFailure, type GroupJoinRequestsActionResponse, type GroupJoinRequestsResponse, type GroupListParams, type GroupListResponse, type GroupMessage, type GroupParticipant, type GroupParticipantInput, type GroupParticipantsRequest, type GroupSettingsResponse, GroupsApi, type GroupsClass, type HeaderOptions, HealthStatus, HealthStatusEntity, type HolidaySchedule, type HonoWebhookConfig, type HonoWebhookContext, type HonoWebhookHandlers, HostPlatform, HttpMethods, HttpMethodsEnum, HttpMethodsType, type HttpsClientClass, type HttpsClientResponseClass, INTEGRITY_ERROR_CODES, type ImageMediaObject, ImageMediaTypes, ImageMediaTypesEnum, ImageMediaTypesType, type ImageMessage, type ImageMessageHandler, type ImageProcessedMessage, type InitiateCallRequest, type InitiateCallResponse, type InteractiveButtonReplyMessage, type InteractiveListReplyMessage, type InteractiveMessage, type InteractiveMessageHandler, type InteractiveObject, type InteractiveProcessedMessage, type InteractiveReply, InteractiveTypes, InteractiveTypesEnum, InteractiveTypesType, Languages, LanguagesEnum, LanguagesType, type LimitedTimeOfferOptions, type LimitedTimeOfferTemplateOptions, ListBlockedUsersParams, ListBlockedUsersResponse, type LocationInfo, type LocationMessage, type LocationMessageHandler, type LocationObject, type LocationParameter, type LocationProcessedMessage, Logger, type LoggerInterface, MAX_FREE_ENTRY_POINT_WINDOW_MS, MPMButton, type MPMTemplateOptions, type MarketingMessageBidSpec, type MarketingMessageRequest, MarketingMessagesApi, type MarketingMessagesClass, type MarketingMessagesLinkClickData, MediaApi, type MediaCardCarouselTemplateOptions, MediaCarouselCard, MediaClass, type MediaInfo, type MediaParameter, MediaResponse, MediasResponse, MemoryDedupeStore, type MemoryDedupeStoreOptions, MessagesApi as MessageApi, MessagesApi, MessageCategory, MessageCategoryEnum, MessageCategoryType, type MessageHandler, MessageHistoryApi, MessageHistoryClass, MessageHistoryEventListParams, MessageHistoryFieldsParam, MessageHistoryItem, MessageHistoryListParams, MessageHistoryResponse, type MessageRecipientType, type MessageRequestBody, type MessageRequestParams, type MessageStatus, MessageTemplateObject, MessageTemplateRequestBody, MessageTypes, MessageTypesEnum, MessageTypesType, type MessageWebhookValue, type MessagesClass, type MessagesResponse, MessagingLimitTier, type MessagingWindow, type MetaError, type MetaErrorData, type MetaErrorDetail, type NextFunction, type NextJsAppWebhookConfig, type NextJsAppWebhookHandlers, type NextJsWebhookConfig, type NonMessageWebhookField, OTPButton, type OTPTemplateOptions, OfficialBusinessAccountAction, OfficialBusinessAccountApplicationData, OfficialBusinessAccountStatusResponse, OnboardPartnersToMMLiteRequest, type OrderInfo, type OrderMessage, type OrderMessageHandler, type OrderProcessedMessage, type Pagination, type PaginationCursors, type Paging, PagingCursors, PagingInfo, ParametersTypes, ParametersTypesEnum, ParametersTypesType, PassThreadControlParams, type PaymentConfiguration, type PaymentConfigurationCode, type PaymentConfigurationCreateRequest, type PaymentConfigurationCreateResponse, type PaymentConfigurationDeleteRequest, type PaymentConfigurationOauthLinkRequest, type PaymentConfigurationOauthLinkResponse, type PaymentConfigurationProvider, type PaymentConfigurationStatus, type PaymentConfigurationUpdateRequest, type PaymentConfigurationUpdateResponse, type PaymentConfigurationsResponse, PaymentsApi, type PaymentsClass, PhoneNumberApi, PhoneNumberButton, PhoneNumberClass, PhoneNumberField, PhoneNumberFieldsParam, PhoneNumberFilter, PhoneNumberResponse, PhoneNumberSettingsFieldsParam, PhoneNumberSettingsParams, PhoneNumberSettingsResponse, PhoneNumberSort, PhoneNumberStatus, PhoneNumbersListParams, PhoneNumbersResponse, PlatformType, type PreAcceptCallRequest, type ProcessWebhookOptions, type ProcessedMessage, type ProcessedStatus, type ProcessedUserAction, type ProcessedWebhookField, type ProductCardCarouselTemplateOptions, ProductCarouselCard, type ProductParameter, type ProductSection, QrCodeApi, type QrCodeClass, type QrCodeResponse, type QrCodesResponse, QualityRating, QualityScore, QuickReplyButton, type RateLimitHeadersInput, type RateLimitInfo, type RateLimitInfoContext, type RateLimitInfoListener, type RateLimitUsage, type ReactionInfo, type ReactionMessage, type ReactionMessageHandler, type ReactionParams, type ReactionProcessedMessage, ReferralSourceTypes, ReferralSourceTypesEnum, ReferralSourceTypesType, RegistrationApi, type RegistrationClass, type RegistrationRequest, type RejectCallRequest, RejectSolutionRequest, ReleaseThreadControlParams, RemoveAssignedUserRequest, RequestCodeMethods, RequestCodeMethodsEnum, RequestCodeMethodsType, RequestPreVerifiedPhoneNumberCodeRequest, RequestVerificationCodeRequest, type RequesterClass, type RequesterResponseInterface, type ResponseData, type ResponseHeaderValue, type ResponseHeaders, type ResponseJSONBody, type ResponsePagination, type ResponseSuccess, type RetryConfig, SEND_MESSAGE_ERROR_CODES, SPMButton, type SPMTemplateOptions, SetOBOMobilityIntentRequest, SetSolutionMigrationIntentRequest, SharePreVerifiedPhoneNumberRequest, type SipServer, type SipSettings, type SipStatus, SolutionDeactivationRequest, SolutionFieldsParam, SolutionGraphObject, SolutionListParams, SolutionListResponse, SolutionMigrationIntent, SolutionsApi, SolutionsClass, Status, StatusEnum, type StatusHandler, type StatusParams, type StatusResponse, StatusType, type StatusWebhook, type StatusWebhookValue, type StickerMediaObject, StickerMediaTypes, StickerMediaTypesEnum, StickerMediaTypesType, type StickerMessage, type StickerMessageHandler, type StickerProcessedMessage, SubType, SubTypeEnum, SubTypeType, SystemChangeTypes, SystemChangeTypesEnum, SystemChangeTypesType, type SystemMessage, type SystemMessageHandler, type SystemProcessedMessage, THROTTLING_ERROR_CODES, TakeThreadControlParams, TemplateApi, TemplateBidSpec, TemplateBody, TemplateButton, TemplateButtons, TemplateCarousel, TemplateClass, TemplateDeleteParams, TemplateFooter, TemplateFormat, TemplateGetParams, TemplateHeader, TemplateHeaderExample, TemplateLimitedTimeOffer, TemplateOptimizationSpec, type TemplateOptions, type TemplateParameter, TemplateRequestBody, TemplateResponse, TemplateStatus, TemplateStatusEnum, TemplateStatusType, type TerminateCallRequest, type TextMessage, type TextMessageHandler, type TextMessageParams, type TextObject, type TextParameter, type TextProcessedMessage, ThreadControlApi, ThreadControlBaseParams, ThreadControlClass, ThreadControlResponse, ThreadControlRole, ThreadControlUserIdentifier, Throughput, ThroughputLevel, ThroughputResponse, TwoStepVerificationApi, type TwoStepVerificationClass, TwoStepVerificationParams, type TwoStepVerificationRequest, URLButton, UnblockUsersRequest, UnifiedCertStatus, type UnsupportedMessage, UpdateBusinessComplianceInfoRequest, type UpdateBusinessProfileRequest, type UpdateCallingSettingsRequest, type UpdateCommerceSettingsRequest, type UpdateFlowResponse, type UpdateGroupSettingsRequest, UpdateOfficialBusinessAccountStatusRequest, UpdatePhoneNumberSettingsRequest, UpdatePhoneNumberStatusRequest, type UpdateQrCodeRequest, UpdateUsernameRequest, UpdateWabaAccountRequest, UpdateWabaSubscription, UpdateWhatsAppBusinessProfileRequest, type UploadBusinessProfileResponse, type UploadHandle, UploadMediaInput, UploadMediaOptions, type UploadMediaParams, UploadMediaResponse, type UploadSession, type UploadSessionResponse, type UserAction, type UserActionHandler, type UserActionType, type UserActionsWebhookValue, UsernameResponse, UsernameStatus, UsernameSuggestionsResponse, UsernameTransferAction, type ValidateFlowJsonResponse, VerifyCodeRequest, VerifyPreVerifiedPhoneNumberCodeRequest, type VideoMediaObject, VideoMediaTypes, VideoMediaTypesEnum, VideoMediaTypesType, type VideoMessage, type VideoMessageHandler, type VideoProcessedMessage, WABAClass, WHATSAPP_ERROR_CODES, WabaAccount, WabaAccountFields, WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaApi, WabaBusinessVerificationStatus, WabaConfigEnum, type WabaConfigType, WabaFieldsParam, WabaGraphObject, WabaHealthStatus, WabaHealthStatusCanSendMessage, WabaHealthStatusEntity, WabaHealthStatusError, WabaListParams, WabaListResponse, WabaSubscription, WabaSubscriptions, type WebhookContact, type WebhookDedupeConfig, type WebhookDedupeOptions, type WebhookEvent, type WebhookFieldHandler, type WebhookFieldHandlerMap, type WebhookFieldHandlerOptions, type WebhookFieldType, type WebhookFieldValue, type WebhookFieldValueMap, type WebhookHandlerContext, type WebhookMessage, type WebhookPayload, WebhookProcessor, type WebhookResponse, type WebhookSignatureOptions, WebhookTypes, WebhookTypesEnum, WebhookTypesType, type WebhookValue, type WeeklyOperatingHours, WhatsApp, WhatsApp as default, WhatsAppApiError, WhatsAppAuthorizationError, WhatsAppBlockUserError, WhatsAppCallingError, type WhatsAppConfig, WhatsAppError, type WhatsAppErrorCode, WhatsAppFlowError, WhatsAppGroupError, WhatsAppIntegrityError, type WhatsAppMessage, WhatsAppNetworkError, WhatsAppSendMessageError, WhatsAppThrottlingError, WhatsAppUnknownError, WhatsAppValidationError, type WindowTimestamp, buildFieldsQueryString, canSendFreeformMessage, constructFullUrl, createAuthenticationTemplate, createCatalogTemplate, createCouponTemplate, createLimitedTimeOfferTemplate, createMPMTemplate, createMediaCardCarouselTemplate, createOTPTemplate, createProductCardCarouselTemplate, createSPMTemplate, createTemplate, createWhatsAppApiError, decryptFlowRequest, decryptFlowRequestAsync, encryptFlowResponse, encryptFlowResponseAsync, expressWebhookHandler, extractMessageText, fastifyWebhookHandler, formatConfigTable, generateEncryption, generateXHub256Sig, generateXHub256SigAsync, getContactsInfo, getCustomerServiceWindow, getFreeEntryPointWindow, getInteractiveReply, getLocationInfo, getMediaInfo, getOrderInfo, getReactionInfo, honoWebhookHandler, isApiPermissionErrorCode, isAudioMessage, isAuthorizationErrorCode, isBlockUserErrorCode, isButtonMessage, isButtonReply, isCallingErrorCode, isContactsMessage, isDocumentMessage, isFlowDataExchangeRequest, isFlowErrorCode, isFlowErrorRequest, isFlowPingRequest, isGroupErrorCode, isImageMessage, isIntegrityErrorCode, isInteractiveMessage, isListReply, isLocationMessage, isMetaError, isNfmReply, isOrderMessage, isReactionMessage, isSendMessageErrorCode, isStickerMessage, isSystemMessage, isTextMessage, isThrottlingErrorCode, isValidWebhookSignature, isVideoMessage, isWhatsAppApiErrorResponse, isWhatsAppAuthorizationError, isWhatsAppBlockUserError, isWhatsAppCallingError, isWhatsAppErrorCode, isWhatsAppFlowError, isWhatsAppGroupError, isWhatsAppIntegrityError, isWhatsAppSendMessageError, isWhatsAppThrottlingError, nextjsAppWebhookHandler, nextjsPagesWebhookHandler, normalizeMetaError, objectToQueryString, parseRateLimitHeaders, parseRetryAfter, processFlowRequest, processWebhookMessages, verifyWebhookSignature };
9980
10393
  //# sourceMappingURL=index.d.mts.map