meta-cloud-api 3.7.1 → 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/README.md +35 -4
- package/dist/index.d.mts +777 -224
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/dist/node/chunk.mjs +1 -0
- package/dist/node/index.d.mts +10393 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.mjs +23 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/testing/index.d.ts +377 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/node/index.js +3 -0
- package/dist/types/index.d.ts +283 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +264 -4
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -4
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/node/index.d.ts +682 -0
- package/dist/utils/node/index.d.ts.map +1 -0
- package/dist/utils/node/index.js +16 -0
- package/dist/utils/node/index.js.map +1 -0
- package/package.json +31 -6
package/dist/types/index.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ interface GeneralHeaderInterface {
|
|
|
24
24
|
}
|
|
25
25
|
interface RequesterResponseInterface<T> {
|
|
26
26
|
json: () => Promise<T>;
|
|
27
|
+
/** The underlying fetch `Response`, for non-JSON bodies such as media downloads. */
|
|
28
|
+
rawResponse: () => Response;
|
|
27
29
|
}
|
|
28
30
|
interface ResponseSuccess {
|
|
29
31
|
success: boolean;
|
|
@@ -412,7 +414,7 @@ type GroupListParams = {
|
|
|
412
414
|
type UpdateGroupSettingsRequest = {
|
|
413
415
|
subject?: string;
|
|
414
416
|
description?: string;
|
|
415
|
-
profilePictureFile?: Blob |
|
|
417
|
+
profilePictureFile?: Blob | Uint8Array;
|
|
416
418
|
};
|
|
417
419
|
type GroupSettingsResponse = ResponseSuccess;
|
|
418
420
|
interface GroupsClass {
|
|
@@ -882,6 +884,59 @@ interface ReactionParams {
|
|
|
882
884
|
recipientType?: MessageRecipientType;
|
|
883
885
|
}
|
|
884
886
|
//#endregion
|
|
887
|
+
//#region src/utils/rateLimit.d.ts
|
|
888
|
+
/**
|
|
889
|
+
* Usage percentages reported by Meta. Each value is the share (0-100+) of the allowance used in the
|
|
890
|
+
* current rolling window.
|
|
891
|
+
*/
|
|
892
|
+
interface RateLimitUsage {
|
|
893
|
+
/** Percentage of calls made (`call_count`). */
|
|
894
|
+
callCount?: number;
|
|
895
|
+
/** Percentage of total CPU time used (`total_cputime`). */
|
|
896
|
+
totalCputime?: number;
|
|
897
|
+
/** Percentage of total time used (`total_time`). */
|
|
898
|
+
totalTime?: number;
|
|
899
|
+
}
|
|
900
|
+
/** One entry of the `X-Business-Use-Case-Usage` header. */
|
|
901
|
+
interface BusinessUseCaseUsage extends RateLimitUsage {
|
|
902
|
+
/** The business object the entry belongs to (for WhatsApp, usually the WABA or phone number ID). */
|
|
903
|
+
businessId: string;
|
|
904
|
+
/** Rate limit type, e.g. `whatsapp_business_management` or `whatsapp`. */
|
|
905
|
+
type?: string;
|
|
906
|
+
/**
|
|
907
|
+
* `estimated_time_to_regain_access`: "Time, in minutes, until calls will no longer be throttled."
|
|
908
|
+
* `0` when not throttled.
|
|
909
|
+
*/
|
|
910
|
+
estimatedTimeToRegainAccessMinutes?: number;
|
|
911
|
+
/** `ads_api_access_tier`, only sent for Marketing API use cases. */
|
|
912
|
+
adsApiAccessTier?: string;
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Rate limit information parsed from a Graph API response.
|
|
916
|
+
*
|
|
917
|
+
* WhatsApp Cloud API responses carry `x-business-use-case-usage` (types
|
|
918
|
+
* `whatsapp_business_management` and `whatsapp`) and `x-app-usage`; throttled responses may add
|
|
919
|
+
* `Retry-After` (seconds).
|
|
920
|
+
*/
|
|
921
|
+
interface RateLimitInfo {
|
|
922
|
+
/** Parsed `X-App-Usage` header (platform rate limits). */
|
|
923
|
+
appUsage?: RateLimitUsage;
|
|
924
|
+
/** Parsed `X-Business-Use-Case-Usage` header, flattened across business IDs. Empty when absent. */
|
|
925
|
+
businessUseCaseUsage: BusinessUseCaseUsage[];
|
|
926
|
+
/** Parsed `Retry-After` header in milliseconds (seconds or HTTP-date form). */
|
|
927
|
+
retryAfterMs?: number;
|
|
928
|
+
/**
|
|
929
|
+
* Highest usage percentage across every parsed metric, handy for alerting before Meta starts
|
|
930
|
+
* throttling (it throttles at 100).
|
|
931
|
+
*/
|
|
932
|
+
maxUsagePercent?: number;
|
|
933
|
+
/**
|
|
934
|
+
* How long Meta asks you to wait, in milliseconds: the larger of `retryAfterMs` and the largest
|
|
935
|
+
* `estimatedTimeToRegainAccessMinutes`. Undefined when Meta gave no wait time.
|
|
936
|
+
*/
|
|
937
|
+
retryDelayMs?: number;
|
|
938
|
+
}
|
|
939
|
+
//#endregion
|
|
885
940
|
//#region src/types/config.d.ts
|
|
886
941
|
/**
|
|
887
942
|
* Configuration for automatic retry behavior on throttling errors.
|
|
@@ -916,6 +971,68 @@ interface RetryConfig {
|
|
|
916
971
|
* Defaults to 1000 (1 second).
|
|
917
972
|
*/
|
|
918
973
|
initialDelayMs?: number;
|
|
974
|
+
/**
|
|
975
|
+
* Wait as long as Meta asks before retrying a throttled request. When a throttling response
|
|
976
|
+
* carries `Retry-After` (seconds) or `X-Business-Use-Case-Usage` with
|
|
977
|
+
* `estimated_time_to_regain_access` (minutes), the retry waits the larger of the backoff delay and
|
|
978
|
+
* that server delay, capped at {@link RetryConfig.maxServerDelayMs}. It never adds attempts.
|
|
979
|
+
* Defaults to `true`; set `false` to use the backoff delay only.
|
|
980
|
+
*/
|
|
981
|
+
respectServerDelay?: boolean;
|
|
982
|
+
/**
|
|
983
|
+
* Upper bound in milliseconds for a server-provided wait. A longer wait is shortened to this
|
|
984
|
+
* value, so the retry may still be throttled; inspect `error.rateLimit` to reschedule instead.
|
|
985
|
+
* Defaults to 30000 (30 seconds).
|
|
986
|
+
*/
|
|
987
|
+
maxServerDelayMs?: number;
|
|
988
|
+
}
|
|
989
|
+
/** Request details passed to {@link WhatsAppConfig.onRateLimitInfo}. */
|
|
990
|
+
interface RateLimitInfoContext {
|
|
991
|
+
/** HTTP method of the request. */
|
|
992
|
+
method: string;
|
|
993
|
+
/** Endpoint path or absolute URL as passed to the requester. */
|
|
994
|
+
endpoint: string;
|
|
995
|
+
/** HTTP status code of the response. */
|
|
996
|
+
statusCode: number;
|
|
997
|
+
}
|
|
998
|
+
/** Callback receiving rate limit information parsed from every response that carries it. */
|
|
999
|
+
type RateLimitInfoListener = (info: RateLimitInfo, context: RateLimitInfoContext) => void | Promise<void>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Storage used to drop duplicate webhook deliveries. Meta retries deliveries,
|
|
1002
|
+
* so the same message or status can arrive more than once.
|
|
1003
|
+
*
|
|
1004
|
+
* `setIfAbsent` must be atomic: store `key` for `ttlSeconds` only if it is not
|
|
1005
|
+
* already there, and resolve `true` when it stored the key (first delivery) or
|
|
1006
|
+
* `false` when the key already existed (duplicate). It maps 1:1 to Redis
|
|
1007
|
+
* `SET key 1 NX EX ttlSeconds`, which replies `OK` only when the key was set.
|
|
1008
|
+
*
|
|
1009
|
+
* @example
|
|
1010
|
+
* ```typescript
|
|
1011
|
+
* const store: DedupeStore = {
|
|
1012
|
+
* async setIfAbsent(key, ttlSeconds) {
|
|
1013
|
+
* return (await redis.set(`wa:${key}`, '1', { NX: true, EX: ttlSeconds })) === 'OK';
|
|
1014
|
+
* },
|
|
1015
|
+
* };
|
|
1016
|
+
* ```
|
|
1017
|
+
*/
|
|
1018
|
+
interface DedupeStore {
|
|
1019
|
+
/** Atomically store `key` for `ttlSeconds` if absent. Resolves `true` if stored, `false` if it existed. */
|
|
1020
|
+
setIfAbsent(key: string, ttlSeconds: number): Promise<boolean>;
|
|
1021
|
+
/** Optional read-only check. The webhook processor never calls it; it is there for inspection and tests. */
|
|
1022
|
+
has?(key: string): Promise<boolean>;
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Opt-in deduplication of webhook deliveries. See {@link DedupeStore}.
|
|
1026
|
+
*/
|
|
1027
|
+
interface WebhookDedupeConfig {
|
|
1028
|
+
/**
|
|
1029
|
+
* Where seen keys are kept. Defaults to an in-memory store that is bounded
|
|
1030
|
+
* and only sees deliveries made to this process: with several instances
|
|
1031
|
+
* behind a load balancer, pass a shared store such as Redis.
|
|
1032
|
+
*/
|
|
1033
|
+
store?: DedupeStore;
|
|
1034
|
+
/** How long a key is remembered, in seconds. Defaults to 86400 (24 hours). */
|
|
1035
|
+
ttlSeconds?: number;
|
|
919
1036
|
}
|
|
920
1037
|
type WhatsAppConfig = {
|
|
921
1038
|
accessToken: string;
|
|
@@ -933,6 +1050,36 @@ type WhatsAppConfig = {
|
|
|
933
1050
|
privatePem?: string;
|
|
934
1051
|
passphrase?: string; /** Automatic retry configuration for throttling errors. */
|
|
935
1052
|
retry?: RetryConfig;
|
|
1053
|
+
/**
|
|
1054
|
+
* Called with the parsed `X-App-Usage` / `X-Business-Use-Case-Usage` / `Retry-After` headers of
|
|
1055
|
+
* every response (successful or not) that carries at least one of them. Errors thrown by the
|
|
1056
|
+
* callback are ignored. See also `whatsapp.getLastRateLimitInfo()`.
|
|
1057
|
+
*/
|
|
1058
|
+
onRateLimitInfo?: RateLimitInfoListener;
|
|
1059
|
+
/**
|
|
1060
|
+
* Reject webhook POSTs whose `X-Hub-Signature-256` header is not a valid
|
|
1061
|
+
* HMAC-SHA256 of the raw body keyed with `appSecret`. Requires `appSecret`.
|
|
1062
|
+
*
|
|
1063
|
+
* Off by default for backward compatibility. Turn it on in production:
|
|
1064
|
+
* without it anyone who knows your webhook URL can post fake messages.
|
|
1065
|
+
*
|
|
1066
|
+
* Express users must keep the raw body, since re-serialized JSON will not match:
|
|
1067
|
+
* `app.use(express.json({ verify: (req, _res, buf) => { req.rawBody = buf.toString(); } }))`.
|
|
1068
|
+
*/
|
|
1069
|
+
verifyWebhookSignature?: boolean;
|
|
1070
|
+
/**
|
|
1071
|
+
* Skip handlers for webhook deliveries that were already seen (Meta retries
|
|
1072
|
+
* deliveries). Duplicates still get a 200 response. Used by
|
|
1073
|
+
* `WebhookProcessor` and the framework adapters only.
|
|
1074
|
+
*
|
|
1075
|
+
* Keys: `message:<id>` for messages, `status:<id>:<status>` for statuses,
|
|
1076
|
+
* and the call or echo ids for `calls`, `smb_message_echoes` and
|
|
1077
|
+
* `message_echoes`. Other fields have no natural id and are never deduped.
|
|
1078
|
+
*
|
|
1079
|
+
* `true` uses the defaults (in-memory store, single instance only, 24 hour TTL).
|
|
1080
|
+
* Off by default.
|
|
1081
|
+
*/
|
|
1082
|
+
dedupe?: boolean | WebhookDedupeConfig;
|
|
936
1083
|
};
|
|
937
1084
|
type WabaConfigType = {
|
|
938
1085
|
/**
|
|
@@ -996,6 +1143,10 @@ type WabaConfigType = {
|
|
|
996
1143
|
* Passed through from WhatsAppConfig.
|
|
997
1144
|
*/
|
|
998
1145
|
retry?: RetryConfig;
|
|
1146
|
+
/**
|
|
1147
|
+
* Rate limit header listener. Passed through from WhatsAppConfig.
|
|
1148
|
+
*/
|
|
1149
|
+
onRateLimitInfo?: RateLimitInfoListener;
|
|
999
1150
|
};
|
|
1000
1151
|
//#endregion
|
|
1001
1152
|
//#region src/types/base.d.ts
|
|
@@ -1213,9 +1364,29 @@ type MediasResponse = {
|
|
|
1213
1364
|
type UploadMediaResponse = {
|
|
1214
1365
|
id: string;
|
|
1215
1366
|
};
|
|
1367
|
+
/**
|
|
1368
|
+
* Media content accepted by `uploadMedia`.
|
|
1369
|
+
*
|
|
1370
|
+
* A `ReadableStream` is read fully into memory before the upload starts: Meta's endpoint takes
|
|
1371
|
+
* `multipart/form-data`, and `fetch` can only send a `FormData` part from a `Blob`.
|
|
1372
|
+
*/
|
|
1373
|
+
type UploadMediaInput = Blob | File | Uint8Array | ArrayBuffer | ReadableStream<Uint8Array>;
|
|
1374
|
+
interface UploadMediaOptions {
|
|
1375
|
+
/**
|
|
1376
|
+
* MIME type sent as the `type` field and as the file part's content type, e.g. `image/jpeg`.
|
|
1377
|
+
* Required for `Uint8Array`, `ArrayBuffer` and `ReadableStream` input, and for a `Blob` without a
|
|
1378
|
+
* `type`. Overrides the `type` of a `Blob`/`File`.
|
|
1379
|
+
*/
|
|
1380
|
+
type?: string;
|
|
1381
|
+
/** File name of the multipart part. Defaults to the `File` name, otherwise `file`. */
|
|
1382
|
+
filename?: string;
|
|
1383
|
+
/** Messaging product. Defaults to `'whatsapp'`. */
|
|
1384
|
+
messagingProduct?: string;
|
|
1385
|
+
}
|
|
1216
1386
|
interface MediaClass {
|
|
1217
1387
|
getMediaById(mediaId: string): Promise<MediaResponse>;
|
|
1218
1388
|
uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
|
|
1389
|
+
uploadMedia(file: UploadMediaInput, options?: UploadMediaOptions): Promise<UploadMediaResponse>;
|
|
1219
1390
|
deleteMedia(mediaId: string): Promise<ResponseSuccess>;
|
|
1220
1391
|
downloadMedia(mediaUrl: string): Promise<Blob>;
|
|
1221
1392
|
}
|
|
@@ -1678,7 +1849,7 @@ declare class BusinessProfileClass extends BaseClass {
|
|
|
1678
1849
|
* @param uploadId The ID of the upload session.
|
|
1679
1850
|
* @param file The binary data of the file.
|
|
1680
1851
|
*/
|
|
1681
|
-
uploadMedia(uploadId: string, file:
|
|
1852
|
+
uploadMedia(uploadId: string, file: Uint8Array): Promise<UploadBusinessProfileResponse>;
|
|
1682
1853
|
/**
|
|
1683
1854
|
* Get the upload handle information.
|
|
1684
1855
|
* @param uploadId The ID of the upload session.
|
|
@@ -3414,6 +3585,65 @@ interface TrackingEventsWebhookValue {
|
|
|
3414
3585
|
field: 'tracking_events';
|
|
3415
3586
|
value: TrackingEventsValue;
|
|
3416
3587
|
}
|
|
3588
|
+
/**
|
|
3589
|
+
* Known `user_actions[].action_type` values. Open enum: Meta adds values
|
|
3590
|
+
* without a breaking change, so ignore action types you do not recognize
|
|
3591
|
+
* instead of treating them as errors.
|
|
3592
|
+
*
|
|
3593
|
+
* - `marketing_messages_link_click` — the user tapped the body or call-to-action of a marketing message.
|
|
3594
|
+
* - `landing_page_view` — the tapped link opened its landing page in the WhatsApp In-App Browser.
|
|
3595
|
+
*/
|
|
3596
|
+
type UserActionType = 'marketing_messages_link_click' | 'landing_page_view' | string;
|
|
3597
|
+
/**
|
|
3598
|
+
* Payload container for every user action on a marketing message. The name
|
|
3599
|
+
* reflects its original click-only use; branch on `action_type` to tell a
|
|
3600
|
+
* click from a landing page view.
|
|
3601
|
+
*/
|
|
3602
|
+
interface MarketingMessagesLinkClickData {
|
|
3603
|
+
/**
|
|
3604
|
+
* Which part of the message was tapped: the call-to-action or the body.
|
|
3605
|
+
* Click events only — absent on a landing page view.
|
|
3606
|
+
*/
|
|
3607
|
+
click_component?: 'cta' | 'body';
|
|
3608
|
+
/**
|
|
3609
|
+
* Product ID assigned in Ads Manager or the Marketing API.
|
|
3610
|
+
* Click events only — absent on a landing page view.
|
|
3611
|
+
*/
|
|
3612
|
+
product_id?: string;
|
|
3613
|
+
/**
|
|
3614
|
+
* Unique identifier for the click that opened the In-App Browser; also
|
|
3615
|
+
* appended to the destination URL. Shared by the click event and its
|
|
3616
|
+
* landing page view, so use it to correlate them when `tracking_token`
|
|
3617
|
+
* is missing. The key is omitted (not null) when unavailable.
|
|
3618
|
+
*/
|
|
3619
|
+
click_id?: string;
|
|
3620
|
+
/**
|
|
3621
|
+
* Internal Meta token for processing and tracking. A landing page view
|
|
3622
|
+
* carries the same `tracking_token` as its click event. The key is omitted
|
|
3623
|
+
* when unavailable.
|
|
3624
|
+
*/
|
|
3625
|
+
tracking_token?: string;
|
|
3626
|
+
}
|
|
3627
|
+
interface UserAction {
|
|
3628
|
+
/** Name of the action. @see UserActionType */
|
|
3629
|
+
action_type: UserActionType;
|
|
3630
|
+
/** Unix timestamp, in seconds, of when Meta recorded the action */
|
|
3631
|
+
timestamp: string;
|
|
3632
|
+
/** Action payload. Present on click and landing page view actions. */
|
|
3633
|
+
marketing_messages_link_click_data?: MarketingMessagesLinkClickData;
|
|
3634
|
+
}
|
|
3635
|
+
/**
|
|
3636
|
+
* `messages` field value carrying marketing message user actions.
|
|
3637
|
+
* Neither event order nor pairing is guaranteed: a landing page view may
|
|
3638
|
+
* arrive before, after, or without its click event, and both correlation
|
|
3639
|
+
* keys can be absent.
|
|
3640
|
+
*/
|
|
3641
|
+
interface UserActionsWebhookValue {
|
|
3642
|
+
messaging_product: 'whatsapp';
|
|
3643
|
+
metadata: WebhookMetadata;
|
|
3644
|
+
/** User actions on marketing messages */
|
|
3645
|
+
user_actions: UserAction[];
|
|
3646
|
+
}
|
|
3417
3647
|
//#endregion
|
|
3418
3648
|
//#region src/core/webhook/types/messageEchoes.d.ts
|
|
3419
3649
|
/**
|
|
@@ -3570,6 +3800,12 @@ interface StatusWebhook {
|
|
|
3570
3800
|
* utility or non-template message delivered inside an open group
|
|
3571
3801
|
* customer service window; from October 1, 2026, a group service
|
|
3572
3802
|
* delivery inside the business phone number's free tier.
|
|
3803
|
+
*
|
|
3804
|
+
* From October 1, 2026 reaction messages are the only service message
|
|
3805
|
+
* type that is never charged and do not count toward the free tier, and
|
|
3806
|
+
* eligible governments and non-profits keep service messages free beyond
|
|
3807
|
+
* the tier through December 31, 2027. Meta documents no distinct `type`
|
|
3808
|
+
* for those exemptions, so do not infer eligibility from this value.
|
|
3573
3809
|
*/
|
|
3574
3810
|
type: 'regular' | 'free_customer_service' | 'free_entry_point' | 'free_group_customer_service';
|
|
3575
3811
|
/**
|
|
@@ -3988,6 +4224,44 @@ interface TemplateCorrectCategoryDetectionWebhookValue {
|
|
|
3988
4224
|
value: TemplateCorrectCategoryDetectionValue;
|
|
3989
4225
|
}
|
|
3990
4226
|
//#endregion
|
|
4227
|
+
//#region src/core/webhook/types/webhookFields.d.ts
|
|
4228
|
+
declare const WebhookField: {
|
|
4229
|
+
readonly Messages: "messages";
|
|
4230
|
+
readonly AccountUpdate: "account_update";
|
|
4231
|
+
readonly AccountReviewUpdate: "account_review_update";
|
|
4232
|
+
readonly AccountAlerts: "account_alerts";
|
|
4233
|
+
readonly AccountSettingsUpdate: "account_settings_update";
|
|
4234
|
+
readonly BusinessCapabilityUpdate: "business_capability_update";
|
|
4235
|
+
readonly BusinessStatusUpdate: "business_status_update";
|
|
4236
|
+
readonly BusinessUsernameUpdates: "business_username_updates";
|
|
4237
|
+
readonly PhoneNumberNameUpdate: "phone_number_name_update";
|
|
4238
|
+
readonly PhoneNumberQualityUpdate: "phone_number_quality_update";
|
|
4239
|
+
readonly MessageTemplateStatusUpdate: "message_template_status_update";
|
|
4240
|
+
readonly MessageTemplateQualityUpdate: "message_template_quality_update";
|
|
4241
|
+
readonly MessageTemplateComponentsUpdate: "message_template_components_update";
|
|
4242
|
+
readonly TemplateCategoryUpdate: "template_category_update";
|
|
4243
|
+
readonly TemplateCorrectCategoryDetection: "template_correct_category_detection";
|
|
4244
|
+
readonly Flows: "flows";
|
|
4245
|
+
readonly Security: "security";
|
|
4246
|
+
readonly History: "history";
|
|
4247
|
+
readonly SmbMessageEchoes: "smb_message_echoes";
|
|
4248
|
+
readonly SmbAppStateSync: "smb_app_state_sync";
|
|
4249
|
+
readonly AutomaticEvents: "automatic_events";
|
|
4250
|
+
readonly TrackingEvents: "tracking_events";
|
|
4251
|
+
readonly Calls: "calls";
|
|
4252
|
+
readonly GroupLifecycleUpdate: "group_lifecycle_update";
|
|
4253
|
+
readonly GroupParticipantsUpdate: "group_participants_update";
|
|
4254
|
+
readonly GroupSettingsUpdate: "group_settings_update";
|
|
4255
|
+
readonly GroupStatusUpdate: "group_status_update";
|
|
4256
|
+
readonly MessageEchoes: "message_echoes";
|
|
4257
|
+
readonly MessagingHandovers: "messaging_handovers";
|
|
4258
|
+
readonly PartnerSolutions: "partner_solutions";
|
|
4259
|
+
readonly PaymentConfigurationUpdate: "payment_configuration_update";
|
|
4260
|
+
readonly Standby: "standby";
|
|
4261
|
+
readonly UserPreferences: "user_preferences";
|
|
4262
|
+
};
|
|
4263
|
+
type WebhookFieldType = (typeof WebhookField)[keyof typeof WebhookField];
|
|
4264
|
+
//#endregion
|
|
3991
4265
|
//#region src/core/webhook/types/index.d.ts
|
|
3992
4266
|
/**
|
|
3993
4267
|
* Webhook value for incoming messages
|
|
@@ -4020,9 +4294,11 @@ interface ErrorWebhookValue {
|
|
|
4020
4294
|
errors: Array<WebhookError>;
|
|
4021
4295
|
}
|
|
4022
4296
|
/**
|
|
4023
|
-
* Union type for all webhook value types
|
|
4297
|
+
* Union type for all webhook value types delivered on the `messages` field.
|
|
4298
|
+
* `UserActionsWebhookValue` carries marketing message click and landing page
|
|
4299
|
+
* view actions (`user_actions`) instead of messages or statuses.
|
|
4024
4300
|
*/
|
|
4025
|
-
type WebhookValue = MessageWebhookValue | StatusWebhookValue | ErrorWebhookValue;
|
|
4301
|
+
type WebhookValue = MessageWebhookValue | StatusWebhookValue | ErrorWebhookValue | UserActionsWebhookValue;
|
|
4026
4302
|
/**
|
|
4027
4303
|
* Union type for all webhook field values
|
|
4028
4304
|
*/
|
|
@@ -4455,7 +4731,7 @@ interface FlowClass {
|
|
|
4455
4731
|
* @returns Promise with the success status and validation errors
|
|
4456
4732
|
*/
|
|
4457
4733
|
updateFlowJson(flowId: string, data: {
|
|
4458
|
-
file: Blob |
|
|
4734
|
+
file: Blob | Uint8Array | object;
|
|
4459
4735
|
name?: string;
|
|
4460
4736
|
}): Promise<UpdateFlowResponse>;
|
|
4461
4737
|
/**
|
|
@@ -4466,7 +4742,7 @@ interface FlowClass {
|
|
|
4466
4742
|
* @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.
|
|
4467
4743
|
* @returns Promise indicating if the JSON is valid and includes validation errors if any.
|
|
4468
4744
|
*/
|
|
4469
|
-
validateFlowJson(flowId: string, flowJsonData: Blob |
|
|
4745
|
+
validateFlowJson(flowId: string, flowJsonData: Blob | Uint8Array | object): Promise<ValidateFlowJsonResponse>;
|
|
4470
4746
|
/**
|
|
4471
4747
|
* Publish Flow
|
|
4472
4748
|
*
|
|
@@ -4805,5 +5081,5 @@ interface LoggerInterface {
|
|
|
4805
5081
|
debug(...data: any[]): void;
|
|
4806
5082
|
}
|
|
4807
5083
|
//#endregion
|
|
4808
|
-
export { type AcceptCallRequest, type AccountMode, type ApiPermissionErrorCode, type AudioMediaObject, AudioMediaTypes, AudioMediaTypesEnum, AudioMediaTypesType, type AudioMessage, type AuthenticationTemplateOptions, type BaseClass, type BlockUsersClass, type BlockUsersResponse, type BlockedUserInfo, type BodyOptions, type BusinessProfileClass, type BusinessProfileData, type BusinessProfileField, type BusinessProfileFieldsParam, type BusinessProfileResponse, BusinessVerticalEnum, type ButtonMessage, type ButtonOptions, ButtonPosition, ButtonPositionEnum, ButtonPositionType, type CallAction, type CallActionResponse, type CallHours, type CallHoursDay, type CallHoursStatus, type CallIconVisibility, type CallPermission, type CallPermissionAction, type CallPermissionLimit, type CallPermissionsResponse, type CallSdpType, type CallSession, type CallbackPermissionStatus, type CallingClass, type CallingSettings, type CallingSettingsResponse, type CallingStatus, CarouselCard, type CarouselOptions, CatalogButton, type CatalogTemplateOptions, Category, CategoryEnum, CategoryType, type CodeVerificationStatus, type CommerceClass, type CommerceSetting, type CommerceSettingsResponse, ComponentType, ComponentTypeType, ComponentTypes, ComponentTypesEnum, type ContactObject, type ContactsMessage, ConversationTypes, ConversationTypesEnum, ConversationTypesType, CopyCodeButton, type CouponTemplateOptions, type CreateFlowResponse, type CreateQrCodeRequest, CurrencyCodesEnum, type CurrencyParameter, type Cursors, DataLocalizationRegion, DataLocalizationRegionEnum, DataLocalizationRegionType, type DateTimeParameter, type DocumentMediaObject, DocumentMediaTypes, DocumentMediaTypesEnum, DocumentMediaTypesType, type DocumentMessage, type EncryptionPublicKeyResponse, type ErrorWebhookValue, type FailedUserInfo, type Flow, FlowActionEnum, 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 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 GeneralHeaderInterface, type GeneralMessageBody, type GeneralRequestBody, 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 GroupSettingsResponse, type GroupsClass, type HeaderOptions, type HealthStatus, type HealthStatusEntity, type HolidaySchedule, type HostPlatform, HttpMethods, HttpMethodsEnum, HttpMethodsType, type HttpsClientClass, type HttpsClientResponseClass, type ImageMediaObject, ImageMediaTypes, ImageMediaTypesEnum, ImageMediaTypesType, type ImageMessage, type InitiateCallRequest, type InitiateCallResponse, type InteractiveButtonReplyMessage, type InteractiveListReplyMessage, type InteractiveMessage, type InteractiveObject, InteractiveTypes, InteractiveTypesEnum, InteractiveTypesType, Languages, LanguagesEnum, LanguagesType, type LimitedTimeOfferOptions, type LimitedTimeOfferTemplateOptions, type ListBlockedUsersParams, type ListBlockedUsersResponse, type LocationMessage, type LocationObject, type LocationParameter, type LoggerInterface, MPMButton, type MPMTemplateOptions, type MarketingMessageBidSpec, type MarketingMessageRequest, type MarketingMessagesClass, type MediaCardCarouselTemplateOptions, MediaCarouselCard, MediaClass, type MediaParameter, MediaResponse, MediasResponse, MessageCategory, MessageCategoryEnum, MessageCategoryType, type MessageRecipientType, type MessageRequestBody, type MessageRequestParams, type MessageTemplateObject, MessageTypes, MessageTypesEnum, MessageTypesType, type MessageWebhookValue, type MessagesClass, type MessagesResponse, type MessagingLimitTier, type MetaError, type MetaErrorData, type MetaErrorDetail, OTPButton, type OTPTemplateOptions, type OrderMessage, type Pagination, type PaginationCursors, type Paging, ParametersTypes, ParametersTypesEnum, ParametersTypesType, type PaymentConfiguration, type PaymentConfigurationCode, type PaymentConfigurationCreateRequest, type PaymentConfigurationCreateResponse, type PaymentConfigurationDeleteRequest, type PaymentConfigurationOauthLinkRequest, type PaymentConfigurationOauthLinkResponse, type PaymentConfigurationProvider, type PaymentConfigurationStatus, type PaymentConfigurationUpdateRequest, type PaymentConfigurationUpdateResponse, type PaymentConfigurationsResponse, type PaymentsClass, PhoneNumberButton, type PhoneNumberClass, type PhoneNumberField, type PhoneNumberFieldsParam, type PhoneNumberFilter, type PhoneNumberResponse, type PhoneNumberSort, type PhoneNumberStatus, type PhoneNumbersListParams, type PhoneNumbersResponse, type PlatformType, type PreAcceptCallRequest, type ProductCardCarouselTemplateOptions, ProductCarouselCard, type ProductParameter, type ProductSection, type QrCodeClass, type QrCodeResponse, type QrCodesResponse, type QualityRating, type QualityScore, QuickReplyButton, type ReactionMessage, type ReactionParams, ReferralSourceTypes, ReferralSourceTypesEnum, ReferralSourceTypesType, type RegistrationClass, type RegistrationRequest, type RejectCallRequest, RequestCodeMethods, RequestCodeMethodsEnum, RequestCodeMethodsType, type RequestVerificationCodeRequest, type RequesterClass, type RequesterResponseInterface, type ResponseData, type ResponseHeaderValue, type ResponseHeaders, type ResponseJSONBody, type ResponsePagination, type ResponseSuccess, SPMButton, type SPMTemplateOptions, type SipServer, type SipSettings, type SipStatus, Status, StatusEnum, type StatusParams, type StatusResponse, StatusType, type StatusWebhook, type StatusWebhookValue, type StickerMediaObject, StickerMediaTypes, StickerMediaTypesEnum, StickerMediaTypesType, type StickerMessage, SubType, SubTypeEnum, SubTypeType, SystemChangeTypes, SystemChangeTypesEnum, SystemChangeTypesType, type SystemMessage, 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 TextMessageParams, type TextObject, type TextParameter, type Throughput, type ThroughputLevel, type TwoStepVerificationClass, type TwoStepVerificationParams, type TwoStepVerificationRequest, URLButton, type UnifiedCertStatus, type UnsupportedMessage, type UpdateBusinessProfileRequest, type UpdateCallingSettingsRequest, type UpdateCommerceSettingsRequest, type UpdateFlowResponse, type UpdateGroupSettingsRequest, type UpdateQrCodeRequest, type UpdateWabaSubscription, UploadMediaResponse, type ValidateFlowJsonResponse, type VerifyCodeRequest, type VideoMediaObject, VideoMediaTypes, VideoMediaTypesEnum, VideoMediaTypesType, type VideoMessage, type WABAClass, type WabaAccount, type WabaAccountFields, type WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaBusinessVerificationStatus, WabaConfigEnum, type WabaConfigType, type WabaHealthStatus, WabaHealthStatusCanSendMessage, type WabaHealthStatusEntity, type WabaHealthStatusError, type WabaSubscription, type WabaSubscriptions, type WebhookContact, type WebhookEvent, type WebhookMessage, type WebhookPayload, WebhookTypes, WebhookTypesEnum, WebhookTypesType, type WebhookValue, type WeeklyOperatingHours, type WhatsAppConfig, type WhatsAppErrorCode, type WhatsAppMessage };
|
|
5084
|
+
export { type AcceptCallRequest, type AccountMode, type ApiPermissionErrorCode, type AudioMediaObject, AudioMediaTypes, AudioMediaTypesEnum, AudioMediaTypesType, type AudioMessage, type AuthenticationTemplateOptions, type BaseClass, type BlockUsersClass, type BlockUsersResponse, type BlockedUserInfo, type BodyOptions, type BusinessProfileClass, type BusinessProfileData, type BusinessProfileField, type BusinessProfileFieldsParam, type BusinessProfileResponse, BusinessVerticalEnum, type ButtonMessage, type ButtonOptions, ButtonPosition, ButtonPositionEnum, ButtonPositionType, type CallAction, type CallActionResponse, type CallHours, type CallHoursDay, type CallHoursStatus, type CallIconVisibility, type CallPermission, type CallPermissionAction, type CallPermissionLimit, type CallPermissionsResponse, type CallSdpType, type CallSession, type CallbackPermissionStatus, type CallingClass, type CallingSettings, type CallingSettingsResponse, type CallingStatus, CarouselCard, type CarouselOptions, CatalogButton, type CatalogTemplateOptions, Category, CategoryEnum, CategoryType, type CodeVerificationStatus, type CommerceClass, type CommerceSetting, type CommerceSettingsResponse, ComponentType, ComponentTypeType, ComponentTypes, ComponentTypesEnum, type ContactObject, type ContactsMessage, ConversationTypes, ConversationTypesEnum, ConversationTypesType, CopyCodeButton, type CouponTemplateOptions, type CreateFlowResponse, type CreateQrCodeRequest, CurrencyCodesEnum, type CurrencyParameter, type Cursors, DataLocalizationRegion, DataLocalizationRegionEnum, DataLocalizationRegionType, type DateTimeParameter, type DedupeStore, type DocumentMediaObject, DocumentMediaTypes, DocumentMediaTypesEnum, DocumentMediaTypesType, type DocumentMessage, type EncryptionPublicKeyResponse, type ErrorWebhookValue, type FailedUserInfo, type Flow, FlowActionEnum, 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 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 GeneralHeaderInterface, type GeneralMessageBody, type GeneralRequestBody, 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 GroupSettingsResponse, type GroupsClass, type HeaderOptions, type HealthStatus, type HealthStatusEntity, type HolidaySchedule, type HostPlatform, HttpMethods, HttpMethodsEnum, HttpMethodsType, type HttpsClientClass, type HttpsClientResponseClass, type ImageMediaObject, ImageMediaTypes, ImageMediaTypesEnum, ImageMediaTypesType, type ImageMessage, type InitiateCallRequest, type InitiateCallResponse, type InteractiveButtonReplyMessage, type InteractiveListReplyMessage, type InteractiveMessage, type InteractiveObject, InteractiveTypes, InteractiveTypesEnum, InteractiveTypesType, Languages, LanguagesEnum, LanguagesType, type LimitedTimeOfferOptions, type LimitedTimeOfferTemplateOptions, type ListBlockedUsersParams, type ListBlockedUsersResponse, type LocationMessage, type LocationObject, type LocationParameter, type LoggerInterface, MPMButton, type MPMTemplateOptions, type MarketingMessageBidSpec, type MarketingMessageRequest, type MarketingMessagesClass, type MarketingMessagesLinkClickData, type MediaCardCarouselTemplateOptions, MediaCarouselCard, MediaClass, type MediaParameter, MediaResponse, MediasResponse, MessageCategory, MessageCategoryEnum, MessageCategoryType, type MessageRecipientType, type MessageRequestBody, type MessageRequestParams, type MessageTemplateObject, MessageTypes, MessageTypesEnum, MessageTypesType, type MessageWebhookValue, type MessagesClass, type MessagesResponse, type MessagingLimitTier, type MetaError, type MetaErrorData, type MetaErrorDetail, OTPButton, type OTPTemplateOptions, type OrderMessage, type Pagination, type PaginationCursors, type Paging, ParametersTypes, ParametersTypesEnum, ParametersTypesType, type PaymentConfiguration, type PaymentConfigurationCode, type PaymentConfigurationCreateRequest, type PaymentConfigurationCreateResponse, type PaymentConfigurationDeleteRequest, type PaymentConfigurationOauthLinkRequest, type PaymentConfigurationOauthLinkResponse, type PaymentConfigurationProvider, type PaymentConfigurationStatus, type PaymentConfigurationUpdateRequest, type PaymentConfigurationUpdateResponse, type PaymentConfigurationsResponse, type PaymentsClass, PhoneNumberButton, type PhoneNumberClass, type PhoneNumberField, type PhoneNumberFieldsParam, type PhoneNumberFilter, type PhoneNumberResponse, type PhoneNumberSort, type PhoneNumberStatus, type PhoneNumbersListParams, type PhoneNumbersResponse, type PlatformType, type PreAcceptCallRequest, type ProductCardCarouselTemplateOptions, ProductCarouselCard, type ProductParameter, type ProductSection, type QrCodeClass, type QrCodeResponse, type QrCodesResponse, type QualityRating, type QualityScore, QuickReplyButton, type RateLimitInfoContext, type RateLimitInfoListener, type ReactionMessage, type ReactionParams, ReferralSourceTypes, ReferralSourceTypesEnum, ReferralSourceTypesType, type RegistrationClass, type RegistrationRequest, type RejectCallRequest, RequestCodeMethods, RequestCodeMethodsEnum, RequestCodeMethodsType, type RequestVerificationCodeRequest, type RequesterClass, type RequesterResponseInterface, type ResponseData, type ResponseHeaderValue, type ResponseHeaders, type ResponseJSONBody, type ResponsePagination, type ResponseSuccess, type RetryConfig, SPMButton, type SPMTemplateOptions, type SipServer, type SipSettings, type SipStatus, Status, StatusEnum, type StatusParams, type StatusResponse, StatusType, type StatusWebhook, type StatusWebhookValue, type StickerMediaObject, StickerMediaTypes, StickerMediaTypesEnum, StickerMediaTypesType, type StickerMessage, SubType, SubTypeEnum, SubTypeType, SystemChangeTypes, SystemChangeTypesEnum, SystemChangeTypesType, type SystemMessage, 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 TextMessageParams, type TextObject, type TextParameter, type Throughput, type ThroughputLevel, type TwoStepVerificationClass, type TwoStepVerificationParams, type TwoStepVerificationRequest, URLButton, type UnifiedCertStatus, type UnsupportedMessage, type UpdateBusinessProfileRequest, type UpdateCallingSettingsRequest, type UpdateCommerceSettingsRequest, type UpdateFlowResponse, type UpdateGroupSettingsRequest, type UpdateQrCodeRequest, type UpdateWabaSubscription, UploadMediaInput, UploadMediaOptions, UploadMediaResponse, type UserAction, type UserActionType, type UserActionsWebhookValue, type ValidateFlowJsonResponse, type VerifyCodeRequest, type VideoMediaObject, VideoMediaTypes, VideoMediaTypesEnum, VideoMediaTypesType, type VideoMessage, type WABAClass, type WabaAccount, type WabaAccountFields, type WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaBusinessVerificationStatus, WabaConfigEnum, type WabaConfigType, type WabaHealthStatus, WabaHealthStatusCanSendMessage, type WabaHealthStatusEntity, type WabaHealthStatusError, type WabaSubscription, type WabaSubscriptions, type WebhookContact, type WebhookDedupeConfig, type WebhookEvent, type WebhookFieldType, type WebhookFieldValue, type WebhookMessage, type WebhookPayload, WebhookTypes, WebhookTypesEnum, WebhookTypesType, type WebhookValue, type WeeklyOperatingHours, type WhatsAppConfig, type WhatsAppErrorCode, type WhatsAppMessage };
|
|
4809
5085
|
//# sourceMappingURL=index.d.ts.map
|