meta-cloud-api 1.1.3 → 1.1.5

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.
Files changed (159) hide show
  1. package/dist/base.d.ts +19 -0
  2. package/dist/base.d.ts.map +1 -0
  3. package/dist/chunk-PECeCxCb.js +15 -0
  4. package/dist/config.d.ts +80 -0
  5. package/dist/config.d.ts.map +1 -0
  6. package/dist/enums.d.ts +668 -0
  7. package/dist/enums.d.ts.map +1 -0
  8. package/dist/enums.js +681 -0
  9. package/dist/enums.js.map +1 -0
  10. package/dist/httpsClient.d.ts +21 -0
  11. package/dist/httpsClient.d.ts.map +1 -0
  12. package/dist/index.d.ts +4386 -27
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +3436 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/logger.d.ts +11 -0
  17. package/dist/logger.d.ts.map +1 -0
  18. package/dist/request.d.ts +52 -0
  19. package/dist/request.d.ts.map +1 -0
  20. package/package.json +11 -118
  21. package/dist/BusinessProfileApi-C_sEOrWM.d.ts +0 -353
  22. package/dist/EncryptionApi-CcCfeK2b.d.ts +0 -22
  23. package/dist/FlowApi-DDHrFT_Q.d.ts +0 -136
  24. package/dist/MediaApi-CY9RVo7u.d.ts +0 -90
  25. package/dist/MessageApi-CX_jN8da.d.ts +0 -171
  26. package/dist/PhoneNumberApi-B-hY7g1M.d.ts +0 -142
  27. package/dist/QrCodeApi-DRICKN04.d.ts +0 -98
  28. package/dist/RegistrationApi-CFPzU1Vw.d.ts +0 -47
  29. package/dist/TemplateApi-fCIlzBtK.d.ts +0 -161
  30. package/dist/TwoStepVerificationApi-C0jpAKfu.d.ts +0 -33
  31. package/dist/WabaApi-x5PhsLT3.d.ts +0 -175
  32. package/dist/WebhookProcessor-DEIZ2PRU.d.ts +0 -707
  33. package/dist/WhatsApp-BFsBgjJO.d.ts +0 -82
  34. package/dist/api/encryption/index.d.ts +0 -10
  35. package/dist/api/encryption/index.js +0 -2
  36. package/dist/api/encryption/index.js.map +0 -1
  37. package/dist/api/flow/index.d.ts +0 -11
  38. package/dist/api/flow/index.js +0 -2
  39. package/dist/api/flow/index.js.map +0 -1
  40. package/dist/api/index.d.ts +0 -18
  41. package/dist/api/index.js +0 -2
  42. package/dist/api/index.js.map +0 -1
  43. package/dist/api/media/index.d.ts +0 -10
  44. package/dist/api/media/index.js +0 -2
  45. package/dist/api/media/index.js.map +0 -1
  46. package/dist/api/messages/builders/index.d.ts +0 -536
  47. package/dist/api/messages/builders/index.js +0 -4
  48. package/dist/api/messages/builders/index.js.map +0 -1
  49. package/dist/api/messages/index.d.ts +0 -10
  50. package/dist/api/messages/index.js +0 -2
  51. package/dist/api/messages/index.js.map +0 -1
  52. package/dist/api/phone/index.d.ts +0 -10
  53. package/dist/api/phone/index.js +0 -2
  54. package/dist/api/phone/index.js.map +0 -1
  55. package/dist/api/profile/index.d.ts +0 -10
  56. package/dist/api/profile/index.js +0 -2
  57. package/dist/api/profile/index.js.map +0 -1
  58. package/dist/api/qrCode/index.d.ts +0 -10
  59. package/dist/api/qrCode/index.js +0 -2
  60. package/dist/api/qrCode/index.js.map +0 -1
  61. package/dist/api/registration/index.d.ts +0 -10
  62. package/dist/api/registration/index.js +0 -2
  63. package/dist/api/registration/index.js.map +0 -1
  64. package/dist/api/template/index.d.ts +0 -21
  65. package/dist/api/template/index.js +0 -2
  66. package/dist/api/template/index.js.map +0 -1
  67. package/dist/api/twoStepVerification/index.d.ts +0 -10
  68. package/dist/api/twoStepVerification/index.js +0 -2
  69. package/dist/api/twoStepVerification/index.js.map +0 -1
  70. package/dist/api/waba/index.d.ts +0 -10
  71. package/dist/api/waba/index.js +0 -2
  72. package/dist/api/waba/index.js.map +0 -1
  73. package/dist/base-BV6DyzGS.d.ts +0 -18
  74. package/dist/chunk-5577QQ7V.js +0 -2
  75. package/dist/chunk-5577QQ7V.js.map +0 -1
  76. package/dist/chunk-6DFC5L3X.js +0 -2
  77. package/dist/chunk-6DFC5L3X.js.map +0 -1
  78. package/dist/chunk-7QBIZCJ4.js +0 -2
  79. package/dist/chunk-7QBIZCJ4.js.map +0 -1
  80. package/dist/chunk-AMHQGG6Z.js +0 -2
  81. package/dist/chunk-AMHQGG6Z.js.map +0 -1
  82. package/dist/chunk-BAOZ4U74.js +0 -10
  83. package/dist/chunk-BAOZ4U74.js.map +0 -1
  84. package/dist/chunk-CRZ7EUYR.js +0 -2
  85. package/dist/chunk-CRZ7EUYR.js.map +0 -1
  86. package/dist/chunk-FKXSL2JK.js +0 -3
  87. package/dist/chunk-FKXSL2JK.js.map +0 -1
  88. package/dist/chunk-FSKBLPGE.js +0 -2
  89. package/dist/chunk-FSKBLPGE.js.map +0 -1
  90. package/dist/chunk-GM63NGNV.js +0 -2
  91. package/dist/chunk-GM63NGNV.js.map +0 -1
  92. package/dist/chunk-IYSR44P6.js +0 -2
  93. package/dist/chunk-IYSR44P6.js.map +0 -1
  94. package/dist/chunk-J2JPTKU6.js +0 -2
  95. package/dist/chunk-J2JPTKU6.js.map +0 -1
  96. package/dist/chunk-JC6YMVID.js +0 -2
  97. package/dist/chunk-JC6YMVID.js.map +0 -1
  98. package/dist/chunk-JPAV644F.js +0 -2
  99. package/dist/chunk-JPAV644F.js.map +0 -1
  100. package/dist/chunk-JXCLRKQ7.js +0 -2
  101. package/dist/chunk-JXCLRKQ7.js.map +0 -1
  102. package/dist/chunk-KMAH6636.js +0 -2
  103. package/dist/chunk-KMAH6636.js.map +0 -1
  104. package/dist/chunk-L4ESAO2S.js +0 -2
  105. package/dist/chunk-L4ESAO2S.js.map +0 -1
  106. package/dist/chunk-LV3TULSI.js +0 -2
  107. package/dist/chunk-LV3TULSI.js.map +0 -1
  108. package/dist/chunk-MJEG3K4V.js +0 -2
  109. package/dist/chunk-MJEG3K4V.js.map +0 -1
  110. package/dist/chunk-PHPQ5HP3.js +0 -2
  111. package/dist/chunk-PHPQ5HP3.js.map +0 -1
  112. package/dist/chunk-RIL6QABY.js +0 -2
  113. package/dist/chunk-RIL6QABY.js.map +0 -1
  114. package/dist/chunk-RWCVPWRC.js +0 -2
  115. package/dist/chunk-RWCVPWRC.js.map +0 -1
  116. package/dist/chunk-SNNRWNGZ.js +0 -2
  117. package/dist/chunk-SNNRWNGZ.js.map +0 -1
  118. package/dist/chunk-U5FBZ6UB.js +0 -3
  119. package/dist/chunk-U5FBZ6UB.js.map +0 -1
  120. package/dist/chunk-VHAODWCN.js +0 -2
  121. package/dist/chunk-VHAODWCN.js.map +0 -1
  122. package/dist/chunk-ZMNXRMWK.js +0 -2
  123. package/dist/chunk-ZMNXRMWK.js.map +0 -1
  124. package/dist/common-B8kp4RdL.d.ts +0 -403
  125. package/dist/common-CGbls9Y8.d.ts +0 -425
  126. package/dist/core/webhook/frameworks/express.d.ts +0 -53
  127. package/dist/core/webhook/frameworks/express.js +0 -2
  128. package/dist/core/webhook/frameworks/express.js.map +0 -1
  129. package/dist/core/webhook/frameworks/nextjs-app.d.ts +0 -48
  130. package/dist/core/webhook/frameworks/nextjs-app.js +0 -2
  131. package/dist/core/webhook/frameworks/nextjs-app.js.map +0 -1
  132. package/dist/core/webhook/frameworks/nextjs.d.ts +0 -49
  133. package/dist/core/webhook/frameworks/nextjs.js +0 -2
  134. package/dist/core/webhook/frameworks/nextjs.js.map +0 -1
  135. package/dist/core/webhook/index.d.ts +0 -29
  136. package/dist/core/webhook/index.js +0 -2
  137. package/dist/core/webhook/index.js.map +0 -1
  138. package/dist/core/whatsapp/index.d.ts +0 -42
  139. package/dist/core/whatsapp/index.js +0 -2
  140. package/dist/core/whatsapp/index.js.map +0 -1
  141. package/dist/enums-DIimUG6s.d.ts +0 -707
  142. package/dist/factory-kNha6WaY.d.ts +0 -200
  143. package/dist/handler-DbySwF0E.d.ts +0 -20
  144. package/dist/httpsClient-Cbd2Y6mg.d.ts +0 -19
  145. package/dist/isMetaError-CQLXyEL4.d.ts +0 -63
  146. package/dist/logger-BdE0Vyim.d.ts +0 -9
  147. package/dist/request-CUjrMn8R.d.ts +0 -50
  148. package/dist/types/config.d.ts +0 -78
  149. package/dist/types/config.js +0 -2
  150. package/dist/types/config.js.map +0 -1
  151. package/dist/types/enums.d.ts +0 -1
  152. package/dist/types/enums.js +0 -2
  153. package/dist/types/enums.js.map +0 -1
  154. package/dist/types/index.d.ts +0 -6
  155. package/dist/types/index.js +0 -2
  156. package/dist/types/index.js.map +0 -1
  157. package/dist/utils/index.d.ts +0 -40
  158. package/dist/utils/index.js +0 -2
  159. package/dist/utils/index.js.map +0 -1
@@ -1,136 +0,0 @@
1
- import { B as BaseAPI } from './base-BV6DyzGS.js';
2
- import { WabaConfigType } from './types/config.js';
3
- import { e as RequesterClass, d as ResponseSuccess } from './request-CUjrMn8R.js';
4
- import { g as FlowClass, x as FlowsListResponse, b as FlowCategoryEnum, D as CreateFlowResponse, d as Flow, w as FlowPreviewResponse, f as FlowAssetsResponse, U as UpdateFlowResponse, V as ValidateFlowJsonResponse, u as FlowMigrationResponse } from './common-B8kp4RdL.js';
5
-
6
- /**
7
- * API for managing WhatsApp Flows.
8
- *
9
- * This API allows you to:
10
- * - List flows
11
- * - Create flows
12
- * - Get flow details and previews
13
- * - Update flow metadata and JSON
14
- * - Delete flows
15
- * - Publish and deprecate flows
16
- * - Migrate flows between WABAs
17
- * - Validate flow JSON
18
- */
19
- declare class FlowApi extends BaseAPI implements FlowClass {
20
- constructor(config: WabaConfigType, client: RequesterClass);
21
- /**
22
- * List Flows
23
- *
24
- * @param wabaId - The WABA ID
25
- * @returns Promise with the list of flows
26
- */
27
- listFlows(wabaId: string): Promise<FlowsListResponse>;
28
- /**
29
- * Create Flow
30
- *
31
- * @param wabaId - The WABA ID
32
- * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
33
- * @returns Promise with the created flow ID and validation errors if any
34
- */
35
- createFlow(wabaId: string, data: {
36
- name: string;
37
- categories?: FlowCategoryEnum[];
38
- endpoint_uri?: string;
39
- clone_flow_id?: string;
40
- flow_json?: string;
41
- publish?: boolean;
42
- }): Promise<CreateFlowResponse>;
43
- /**
44
- * Get Flow details
45
- *
46
- * @param flowId - The flow ID
47
- * @param fields - Optional fields to return (e.g., 'name,status,preview.invalidate(false)')
48
- * @param dateFormat - Optional date format
49
- * @returns Promise with the flow details or preview response
50
- */
51
- getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
52
- /**
53
- * Get Flow Preview URL
54
- *
55
- * @param flowId - The flow ID
56
- * @param invalidate - Optional. If true, invalidates existing preview and generates a new one. Defaults to false.
57
- * @returns Promise with the flow preview details
58
- */
59
- getFlowPreview(flowId: string, invalidate?: boolean): Promise<FlowPreviewResponse>;
60
- /**
61
- * Update Flow Metadata
62
- *
63
- * @param flowId - The flow ID
64
- * @param data - The flow metadata to update (name, categories, endpoint_uri, application_id)
65
- * @returns Promise with the success status
66
- */
67
- updateFlowMetadata(flowId: string, data: {
68
- name?: string;
69
- categories?: FlowCategoryEnum[];
70
- endpoint_uri?: string;
71
- application_id?: string;
72
- }): Promise<ResponseSuccess>;
73
- /**
74
- * Delete Flow (only works if the Flow is in DRAFT status)
75
- *
76
- * @param flowId - The flow ID
77
- * @returns Promise with the success status
78
- */
79
- deleteFlow(flowId: string): Promise<ResponseSuccess>;
80
- /**
81
- * List Assets (e.g., get Flow JSON download URL)
82
- *
83
- * @param flowId - The flow ID
84
- * @returns Promise with the list of assets
85
- */
86
- listAssets(flowId: string): Promise<FlowAssetsResponse>;
87
- /**
88
- * Update Flow JSON by uploading a file, buffer, JSON object, or Blob.
89
- *
90
- * @param flowId - The flow ID
91
- * @param data - Object containing the file data and optional name.
92
- * @param data.file - The Flow JSON content as a Buffer, JSON object, or Blob.
93
- * @param data.name - Optional name for the asset, defaults to 'flow.json'.
94
- * @returns Promise with the success status and validation errors, if any.
95
- */
96
- updateFlowJson(flowId: string, data: {
97
- file: Blob | Buffer | object;
98
- name?: string;
99
- }): Promise<UpdateFlowResponse>;
100
- /**
101
- * Validate Flow JSON by attempting an update without publishing.
102
- * This is a convenience method; the API doesn't have a dedicated validation endpoint.
103
- *
104
- * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).
105
- * @param flowJsonData - The Flow JSON content as a file path (string), Buffer, JSON object, or Blob.
106
- * @returns Promise indicating if the JSON is valid and includes validation errors if any.
107
- */
108
- validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
109
- /**
110
- * Publish Flow
111
- *
112
- * @param flowId - The flow ID
113
- * @returns Promise with the success status
114
- */
115
- publishFlow(flowId: string): Promise<ResponseSuccess>;
116
- /**
117
- * Deprecate Flow
118
- *
119
- * @param flowId - The flow ID
120
- * @returns Promise with the success status
121
- */
122
- deprecateFlow(flowId: string): Promise<ResponseSuccess>;
123
- /**
124
- * Migrate Flows between WABAs
125
- *
126
- * @param destinationWabaId - The destination WABA ID
127
- * @param data - The migration data including source_waba_id and optional source_flow_names
128
- * @returns Promise with migration results (successes and failures)
129
- */
130
- migrateFlows(destinationWabaId: string, data: {
131
- source_waba_id: string;
132
- source_flow_names?: string[];
133
- }): Promise<FlowMigrationResponse>;
134
- }
135
-
136
- export { FlowApi as F };
@@ -1,90 +0,0 @@
1
- import { B as BaseAPI } from './base-BV6DyzGS.js';
2
- import { WabaConfigType } from './types/config.js';
3
- import { d as ResponseSuccess, e as RequesterClass } from './request-CUjrMn8R.js';
4
-
5
- type MediaResponse = {
6
- id: string;
7
- url: string;
8
- mime_type: string;
9
- sha256: string;
10
- file_size: number;
11
- messaging_product: 'whatsapp';
12
- };
13
- type MediasResponse = {
14
- data: MediaResponse[];
15
- paging: {
16
- cursors: {
17
- before: string;
18
- after: string;
19
- };
20
- };
21
- };
22
- type UploadMediaResponse = {
23
- id: string;
24
- };
25
- interface MediaClass {
26
- getMediaById(mediaId: string, phone_number_id?: string): Promise<MediaResponse>;
27
- uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
28
- deleteMedia(mediaId: string, phone_number_id?: string): Promise<ResponseSuccess>;
29
- downloadMedia(mediaUrl: string): Promise<Blob>;
30
- }
31
-
32
- /**
33
- * API for managing WhatsApp Media.
34
- *
35
- * This API allows you to:
36
- * - Get media information by ID
37
- * - Upload media files
38
- * - Delete media files
39
- * - Download media files from URLs
40
- */
41
- declare class MediaApi extends BaseAPI implements MediaClass {
42
- private readonly endpoint;
43
- constructor(config: WabaConfigType, client: RequesterClass);
44
- /**
45
- * Retrieve media information by media ID.
46
- *
47
- * @param mediaId The media ID to retrieve information for
48
- * @param phone_number_id Optional phone number ID (defaults to configured one)
49
- * @returns Media information including URL, mime type, file size, etc.
50
- *
51
- * @example
52
- * const mediaInfo = await whatsappClient.media.getMediaById('media_id_123');
53
- */
54
- getMediaById(mediaId: string, phone_number_id?: string): Promise<MediaResponse>;
55
- /**
56
- * Upload a media file to WhatsApp.
57
- *
58
- * @param file The file to upload
59
- * @param messagingProduct The messaging product (default: 'whatsapp')
60
- * @returns Upload response containing the media ID
61
- *
62
- * @example
63
- * const file = new File([buffer], 'image.jpg', { type: 'image/jpeg' });
64
- * const result = await whatsappClient.media.uploadMedia(file);
65
- */
66
- uploadMedia(file: File, messagingProduct?: string): Promise<UploadMediaResponse>;
67
- /**
68
- * Delete a media file.
69
- *
70
- * @param mediaId The media ID to delete
71
- * @param phone_number_id Optional phone number ID (defaults to configured one)
72
- * @returns Response indicating success or failure
73
- *
74
- * @example
75
- * await whatsappClient.media.deleteMedia('media_id_123');
76
- */
77
- deleteMedia(mediaId: string, phone_number_id?: string): Promise<ResponseSuccess>;
78
- /**
79
- * Download media from a URL.
80
- *
81
- * @param mediaUrl The URL to download media from
82
- * @returns Blob containing the media data
83
- *
84
- * @example
85
- * const blob = await whatsappClient.media.downloadMedia('https://...');
86
- */
87
- downloadMedia(mediaUrl: string): Promise<Blob>;
88
- }
89
-
90
- export { MediaApi as M, type UploadMediaResponse as U, type MediaClass as a, type MediaResponse as b, type MediasResponse as c };
@@ -1,171 +0,0 @@
1
- import { B as BaseAPI } from './base-BV6DyzGS.js';
2
- import { WabaConfigType } from './types/config.js';
3
- import { M as MessageTypesEnum, b as ComponentTypesEnum, f as InteractiveTypesEnum } from './enums-DIimUG6s.js';
4
- import { e as RequesterClass } from './request-CUjrMn8R.js';
5
- import { b as MessagesClass, A as AudioMediaObject, C as ContactObject, D as DocumentMediaObject, I as ImageMediaObject, f as InteractiveObject, L as LocationObject, g as MessageTemplateObject, e as StickerMediaObject, d as TextObject, V as VideoMediaObject, M as MessageRequestBody, a as MessageRequestParams, c as MessagesResponse, T as TextMessageParams, S as StatusParams, R as ReactionParams } from './common-CGbls9Y8.js';
6
-
7
- /**
8
- * Maps each message type to its appropriate payload type
9
- */
10
- type MessagePayloadType<T extends MessageTypesEnum> = T extends MessageTypesEnum.Audio ? AudioMediaObject : T extends MessageTypesEnum.Contacts ? [ContactObject] : T extends MessageTypesEnum.Document ? DocumentMediaObject : T extends MessageTypesEnum.Image ? ImageMediaObject : T extends MessageTypesEnum.Interactive ? InteractiveObject : T extends MessageTypesEnum.Location ? LocationObject : T extends MessageTypesEnum.Template ? MessageTemplateObject<ComponentTypesEnum> : T extends MessageTypesEnum.Sticker ? StickerMediaObject : T extends MessageTypesEnum.Text ? TextObject : T extends MessageTypesEnum.Video ? VideoMediaObject : T extends MessageTypesEnum.Reaction ? {
11
- message_id: string;
12
- emoji: string;
13
- } : never;
14
- declare class MessagesApi extends BaseAPI implements MessagesClass {
15
- private readonly commonMethod;
16
- private readonly commonEndpoint;
17
- constructor(config: WabaConfigType, client: RequesterClass);
18
- /**
19
- * Builds the request body for WhatsApp API messages
20
- * @param type The type of message to send
21
- * @param payload The message payload object
22
- * @param to The recipient's phone number
23
- * @param replyMessageId Optional message ID to reply to
24
- * @returns The formatted request body
25
- */
26
- bodyBuilder<T extends MessageTypesEnum>(type: T, payload: MessagePayloadType<T>, to: string, replyMessageId?: string): MessageRequestBody<T>;
27
- /**
28
- * Sends a request to the WhatsApp API
29
- * @param body The request body to send
30
- * @returns Promise with the API response
31
- */
32
- private send;
33
- /**
34
- * Sends an audio message via WhatsApp
35
- * @param params The audio message parameter object
36
- * @returns Promise with the message response
37
- */
38
- audio(params: MessageRequestParams<AudioMediaObject>): Promise<MessagesResponse>;
39
- /**
40
- * Sends a contact card via WhatsApp
41
- * @param params The contact message parameter object
42
- * @returns Promise with the message response
43
- */
44
- contacts(params: MessageRequestParams<[ContactObject]>): Promise<MessagesResponse>;
45
- /**
46
- * Sends a document via WhatsApp
47
- * @param params The document message parameter object
48
- * @returns Promise with the message response
49
- */
50
- document(params: MessageRequestParams<DocumentMediaObject>): Promise<MessagesResponse>;
51
- /**
52
- * Sends an image via WhatsApp
53
- * @param params The image message parameter object
54
- * @returns Promise with the message response
55
- */
56
- image(params: MessageRequestParams<ImageMediaObject>): Promise<MessagesResponse>;
57
- /**
58
- * Sends an interactive message via WhatsApp
59
- * @param params The interactive message parameter object
60
- * @returns Promise with the message response
61
- */
62
- interactive(params: MessageRequestParams<InteractiveObject>): Promise<MessagesResponse>;
63
- /**
64
- * Sends a location via WhatsApp
65
- * @param params The location message parameter object
66
- * @returns Promise with the message response
67
- */
68
- location(params: MessageRequestParams<LocationObject>): Promise<MessagesResponse>;
69
- /**
70
- * Sends a sticker via WhatsApp
71
- * @param params The sticker message parameter object
72
- * @returns Promise with the message response
73
- */
74
- sticker(params: MessageRequestParams<StickerMediaObject>): Promise<MessagesResponse>;
75
- /**
76
- * Sends a template message via WhatsApp
77
- * @param params The template message parameter object
78
- * @returns Promise with the message response
79
- */
80
- template(params: MessageRequestParams<MessageTemplateObject<ComponentTypesEnum>>): Promise<MessagesResponse>;
81
- /**
82
- * Sends a text message via WhatsApp
83
- * @param params The text message parameter object
84
- * @returns Promise with the message response
85
- */
86
- text(params: TextMessageParams): Promise<MessagesResponse>;
87
- /**
88
- * Sends a video message via WhatsApp
89
- * @param params The video message parameter object
90
- * @returns Promise with the message response
91
- */
92
- video(params: MessageRequestParams<VideoMediaObject>): Promise<MessagesResponse>;
93
- /**
94
- * Updates message status (mark as read, etc.)
95
- * @param params The status update parameters
96
- * @returns Promise with the API response
97
- */
98
- status(params: StatusParams): Promise<MessagesResponse>;
99
- /**
100
- * Marks a message as read
101
- * @param params Object containing messageId
102
- * @returns Promise with the API response
103
- */
104
- markAsRead(params: {
105
- messageId: string;
106
- }): Promise<MessagesResponse>;
107
- /**
108
- * Shows typing indicator
109
- * @param params Object containing messageId
110
- * @returns Promise with the API response
111
- */
112
- showTypingIndicator(params: {
113
- messageId: string;
114
- }): Promise<MessagesResponse>;
115
- /**
116
- * Sends a list interactive message
117
- * @param params The list interactive message parameters
118
- * @returns Promise with the message response
119
- */
120
- interactiveList(params: MessageRequestParams<InteractiveObject & {
121
- type: InteractiveTypesEnum.List;
122
- }>): Promise<MessagesResponse>;
123
- /**
124
- * Sends a CTA URL interactive message
125
- * @param params The CTA URL interactive message parameters
126
- * @returns Promise with the message response
127
- */
128
- interactiveCtaUrl(params: MessageRequestParams<InteractiveObject & {
129
- type: InteractiveTypesEnum.CtaUrl;
130
- }>): Promise<MessagesResponse>;
131
- /**
132
- * Sends a location request interactive message
133
- * @param params The location request interactive message parameters
134
- * @returns Promise with the message response
135
- */
136
- interactiveLocationRequest(params: MessageRequestParams<InteractiveObject & {
137
- type: InteractiveTypesEnum.LocationRequest;
138
- }>): Promise<MessagesResponse>;
139
- /**
140
- * Sends an address message interactive message
141
- * @param params The address message interactive message parameters
142
- * @returns Promise with the message response
143
- */
144
- interactiveAddressMessage(params: MessageRequestParams<InteractiveObject & {
145
- type: InteractiveTypesEnum.AddressMessage;
146
- }>): Promise<MessagesResponse>;
147
- /**
148
- * Sends a reply buttons interactive message
149
- * @param params The reply buttons interactive message parameters
150
- * @returns Promise with the message response
151
- */
152
- interactiveReplyButtons(params: MessageRequestParams<InteractiveObject & {
153
- type: InteractiveTypesEnum.Button;
154
- }>): Promise<MessagesResponse>;
155
- /**
156
- * Sends a flow interactive message
157
- * @param params The flow interactive message parameters
158
- * @returns Promise with the message response
159
- */
160
- interactiveFlow(params: MessageRequestParams<InteractiveObject & {
161
- type: InteractiveTypesEnum.Flow;
162
- }>): Promise<MessagesResponse>;
163
- /**
164
- * Sends a reaction to a message
165
- * @param params The reaction parameters
166
- * @returns Promise with the message response
167
- */
168
- reaction(params: ReactionParams): Promise<MessagesResponse>;
169
- }
170
-
171
- export { MessagesApi as M };
@@ -1,142 +0,0 @@
1
- import { B as BaseAPI } from './base-BV6DyzGS.js';
2
- import { WabaConfigType } from './types/config.js';
3
- import { P as Paging, d as ResponseSuccess, e as RequesterClass } from './request-CUjrMn8R.js';
4
-
5
- type QualityRating = 'GREEN' | 'YELLOW' | 'RED' | 'NA';
6
- type AccountMode = 'LIVE' | 'SANDBOX';
7
- type CodeVerificationStatus = 'NOT_VERIFIED' | 'VERIFIED' | 'EXPIRED' | 'PENDING' | 'DELETED' | 'MIGRATED' | 'BANNED' | 'RESTRICTED' | 'RATE_LIMITED' | 'FLAGGED' | 'CONNECTED' | 'DISCONNECTED' | 'UNKNOWN' | 'UNVERIFIED';
8
- type MessagingLimitTier = 'TIER_50' | 'TIER_250' | 'TIER_1K' | 'TIER_10K' | 'TIER_100K' | 'TIER_UNLIMITED';
9
- type PlatformType = 'CLOUD_API' | 'ON_PREMISE' | 'NOT_APPLICABLE';
10
- type ThroughputLevel = 'STANDARD' | 'HIGH' | 'NOT_APPLICABLE';
11
- type HealthStatusEntity = {
12
- entity_type: string;
13
- id: string;
14
- can_send_message: string;
15
- additional_info?: string[];
16
- errors?: Array<{
17
- error_code: number;
18
- error_description: string;
19
- possible_solution: string;
20
- }>;
21
- };
22
- type HealthStatus = {
23
- can_send_message: string;
24
- entities: HealthStatusEntity[];
25
- };
26
- type QualityScore = {
27
- score: QualityRating;
28
- };
29
- type Throughput = {
30
- level: ThroughputLevel;
31
- };
32
- type PhoneNumberResponse = {
33
- display_phone_number: string;
34
- id: string;
35
- quality_rating: QualityRating;
36
- verified_name: string;
37
- account_mode?: AccountMode;
38
- certificate?: string;
39
- code_verification_status?: CodeVerificationStatus;
40
- conversational_automation?: Record<string, unknown>;
41
- eligibility_for_api_business_global_search?: string;
42
- health_status?: HealthStatus;
43
- is_official_business_account?: boolean;
44
- is_on_biz_app?: boolean;
45
- is_pin_enabled?: boolean;
46
- is_preverified_number?: boolean;
47
- last_onboarded_time?: string;
48
- messaging_limit_tier?: MessagingLimitTier;
49
- name_status?: string;
50
- new_certificate?: string;
51
- new_name_status?: string;
52
- platform_type?: PlatformType;
53
- quality_score?: QualityScore;
54
- search_visibility?: string;
55
- status?: CodeVerificationStatus;
56
- throughput?: Throughput;
57
- };
58
- type Cursors = {
59
- before: string;
60
- after: string;
61
- };
62
- type PhoneNumbersResponse = {
63
- data: PhoneNumberResponse[];
64
- paging: Paging;
65
- };
66
- type RequestVerificationCodeRequest = {
67
- code_method: 'SMS' | 'VOICE';
68
- language: string;
69
- };
70
- type VerifyCodeRequest = {
71
- code: string;
72
- };
73
- type TwoStepVerificationParams = {
74
- pin: string;
75
- };
76
- interface PhoneNumberClass {
77
- getPhoneNumberById(fields?: string): Promise<PhoneNumberResponse>;
78
- getPhoneNumbers(): Promise<PhoneNumbersResponse>;
79
- requestVerificationCode(params: RequestVerificationCodeRequest): Promise<ResponseSuccess>;
80
- verifyCode(params: VerifyCodeRequest): Promise<ResponseSuccess>;
81
- }
82
-
83
- /**
84
- * API for managing WhatsApp Phone Numb ers.
85
- *
86
- * This API allows you to:
87
- * - Get phone number information by ID
88
- * - Get all phone numbers for a business account
89
- * - Request verification codes for phone numbers
90
- * - Verify phone numbers with codes
91
- */
92
- declare class PhoneNumberApi extends BaseAPI implements PhoneNumberClass {
93
- private readonly endpoint;
94
- constructor(config: WabaConfigType, client: RequesterClass);
95
- /**
96
- * Get phone number information by ID.
97
- *
98
- * @param fields Optional comma-separated list of fields to include in the response
99
- * @returns Phone number information including verification status, quality rating, etc.
100
- *
101
- * @example
102
- * const phoneNumber = await whatsappClient.phoneNumber.getPhoneNumberById();
103
- * const phoneNumberWithFields = await whatsappClient.phoneNumber.getPhoneNumberById('display_phone_number,verified_name');
104
- */
105
- getPhoneNumberById(fields?: string): Promise<PhoneNumberResponse>;
106
- /**
107
- * Get all phone numbers for the business account.
108
- *
109
- * @returns List of phone numbers associated with the business account
110
- *
111
- * @example
112
- * const phoneNumbers = await whatsappClient.phoneNumber.getPhoneNumbers();
113
- */
114
- getPhoneNumbers(): Promise<PhoneNumbersResponse>;
115
- /**
116
- * Request a verification code for the phone number.
117
- *
118
- * @param request Verification code request containing method and language
119
- * @returns Response indicating success or failure
120
- *
121
- * @example
122
- * await whatsappClient.phoneNumber.requestVerificationCode({
123
- * code_method: 'SMS',
124
- * language: 'en_US'
125
- * });
126
- */
127
- requestVerificationCode(request: RequestVerificationCodeRequest): Promise<ResponseSuccess>;
128
- /**
129
- * Verify the phone number with the received code.
130
- *
131
- * @param request Verification request containing the code
132
- * @returns Response indicating success or failure
133
- *
134
- * @example
135
- * await whatsappClient.phoneNumber.verifyCode({
136
- * code: '123456'
137
- * });
138
- */
139
- verifyCode(request: VerifyCodeRequest): Promise<ResponseSuccess>;
140
- }
141
-
142
- export { type AccountMode as A, type CodeVerificationStatus as C, type HealthStatus as H, type MessagingLimitTier as M, PhoneNumberApi as P, type QualityRating as Q, type RequestVerificationCodeRequest as R, type Throughput as T, type VerifyCodeRequest as V, type Cursors as a, type HealthStatusEntity as b, type PhoneNumberClass as c, type PhoneNumberResponse as d, type PhoneNumbersResponse as e, type PlatformType as f, type QualityScore as g, type ThroughputLevel as h, type TwoStepVerificationParams as i };
@@ -1,98 +0,0 @@
1
- import { B as BaseAPI } from './base-BV6DyzGS.js';
2
- import { WabaConfigType } from './types/config.js';
3
- import { b as ResponseData, d as ResponseSuccess, e as RequesterClass } from './request-CUjrMn8R.js';
4
-
5
- type QrCodeResponse = {
6
- code: string;
7
- prefilled_message: string;
8
- deep_link_url: string;
9
- qr_image_url?: string;
10
- };
11
- type QrCodesResponse = ResponseData<QrCodeResponse[]>;
12
- type CreateQrCodeRequest = {
13
- prefilled_message: string;
14
- generate_qr_image?: 'SVG' | 'PNG';
15
- };
16
- type UpdateQrCodeRequest = {
17
- code: string;
18
- prefilled_message: string;
19
- };
20
- interface QrCodeClass {
21
- createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
22
- getQrCodes(): Promise<QrCodesResponse>;
23
- getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
24
- updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
25
- deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
26
- }
27
-
28
- /**
29
- * API for managing WhatsApp QR Codes.
30
- *
31
- * This API allows you to:
32
- * - Create QR codes with prefilled messages
33
- * - Get all QR codes
34
- * - Get specific QR code details
35
- * - Update QR code messages
36
- * - Delete QR codes
37
- */
38
- declare class QrCodeApi extends BaseAPI implements QrCodeClass {
39
- private readonly endpoint;
40
- constructor(config: WabaConfigType, client: RequesterClass);
41
- /**
42
- * Create a new QR code with a prefilled message.
43
- *
44
- * @param request The QR code creation request
45
- * @returns QR code information including code, deep link URL, and optional image URL
46
- *
47
- * @example
48
- * const qrCode = await whatsappClient.qrCode.createQrCode({
49
- * prefilled_message: 'Hello from WhatsApp!',
50
- * generate_qr_image: 'PNG'
51
- * });
52
- */
53
- createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
54
- /**
55
- * Get all QR codes for the current phone number.
56
- *
57
- * @returns List of all QR codes
58
- *
59
- * @example
60
- * const qrCodes = await whatsappClient.qrCode.getQrCodes();
61
- */
62
- getQrCodes(): Promise<QrCodesResponse>;
63
- /**
64
- * Get a specific QR code by ID.
65
- *
66
- * @param qrCodeId The QR code ID to retrieve
67
- * @returns QR code information
68
- *
69
- * @example
70
- * const qrCode = await whatsappClient.qrCode.getQrCode('qr_code_123');
71
- */
72
- getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
73
- /**
74
- * Update an existing QR code's prefilled message.
75
- *
76
- * @param request The QR code update request containing code and new message
77
- * @returns Updated QR code information
78
- *
79
- * @example
80
- * const updatedQrCode = await whatsappClient.qrCode.updateQrCode({
81
- * code: 'existing_qr_code',
82
- * prefilled_message: 'Updated message!'
83
- * });
84
- */
85
- updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
86
- /**
87
- * Delete a QR code.
88
- *
89
- * @param qrCodeId The QR code ID to delete
90
- * @returns Response indicating success or failure
91
- *
92
- * @example
93
- * await whatsappClient.qrCode.deleteQrCode('qr_code_123');
94
- */
95
- deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
96
- }
97
-
98
- export { type CreateQrCodeRequest as C, QrCodeApi as Q, type UpdateQrCodeRequest as U, type QrCodeClass as a, type QrCodeResponse as b, type QrCodesResponse as c };
@@ -1,47 +0,0 @@
1
- import { B as BaseAPI } from './base-BV6DyzGS.js';
2
- import { WabaConfigType } from './types/config.js';
3
- import { D as DataLocalizationRegionEnum } from './enums-DIimUG6s.js';
4
- import { d as ResponseSuccess, e as RequesterClass } from './request-CUjrMn8R.js';
5
-
6
- type RegistrationRequest = {
7
- messaging_product: 'whatsapp';
8
- pin: string;
9
- data_localization_region?: DataLocalizationRegionEnum;
10
- };
11
- interface RegistrationClass {
12
- register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess>;
13
- deregister(): Promise<ResponseSuccess>;
14
- }
15
-
16
- /**
17
- * API for managing WhatsApp Business Account registration.
18
- *
19
- * This API allows you to:
20
- * - Register a WhatsApp Business Account with a PIN
21
- * - Deregister a WhatsApp Business Account
22
- */
23
- declare class RegistrationApi extends BaseAPI implements RegistrationClass {
24
- constructor(config: WabaConfigType, client: RequesterClass);
25
- /**
26
- * Register a WhatsApp Business Account using a PIN.
27
- *
28
- * @param pin The registration PIN received via SMS or voice call
29
- * @param dataLocalizationRegion Optional data localization region
30
- * @returns Response indicating success or failure
31
- *
32
- * @example
33
- * await whatsappClient.registration.register('123456', DataLocalizationRegionEnum.Asia);
34
- */
35
- register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess>;
36
- /**
37
- * Deregister a WhatsApp Business Account.
38
- *
39
- * @returns Response indicating success or failure
40
- *
41
- * @example
42
- * await whatsappClient.registration.deregister();
43
- */
44
- deregister(): Promise<ResponseSuccess>;
45
- }
46
-
47
- export { RegistrationApi as R, type RegistrationClass as a, type RegistrationRequest as b };