meta-cloud-api 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +405 -0
  3. package/dist/BusinessProfileApi-WXscSgo-.d.ts +353 -0
  4. package/dist/EncryptionApi-D7pt-OXT.d.ts +22 -0
  5. package/dist/FlowApi-UAvzhJfV.d.ts +136 -0
  6. package/dist/MediaApi-BrEKpqi_.d.ts +90 -0
  7. package/dist/MessageApi-Circorzz.d.ts +587 -0
  8. package/dist/PhoneNumberApi-DKlu9PHl.d.ts +142 -0
  9. package/dist/QrCodeApi-7vDwIBHR.d.ts +98 -0
  10. package/dist/RegistrationApi-qO_qoti9.d.ts +47 -0
  11. package/dist/TemplateApi-xGgIZt89.d.ts +161 -0
  12. package/dist/TwoStepVerificationApi-DfNPIz-C.d.ts +33 -0
  13. package/dist/WabaApi-DqQi_68m.d.ts +175 -0
  14. package/dist/WebhookProcessor-ByAe7Kf_.d.ts +707 -0
  15. package/dist/WhatsApp-BIBtT-y9.d.ts +82 -0
  16. package/dist/api/encryption/index.d.ts +10 -0
  17. package/dist/api/encryption/index.js +2 -0
  18. package/dist/api/encryption/index.js.map +1 -0
  19. package/dist/api/flow/index.d.ts +10 -0
  20. package/dist/api/flow/index.js +2 -0
  21. package/dist/api/flow/index.js.map +1 -0
  22. package/dist/api/index.d.ts +16 -0
  23. package/dist/api/index.js +2 -0
  24. package/dist/api/index.js.map +1 -0
  25. package/dist/api/media/index.d.ts +10 -0
  26. package/dist/api/media/index.js +2 -0
  27. package/dist/api/media/index.js.map +1 -0
  28. package/dist/api/messages/index.d.ts +10 -0
  29. package/dist/api/messages/index.js +2 -0
  30. package/dist/api/messages/index.js.map +1 -0
  31. package/dist/api/phone/index.d.ts +10 -0
  32. package/dist/api/phone/index.js +2 -0
  33. package/dist/api/phone/index.js.map +1 -0
  34. package/dist/api/profile/index.d.ts +10 -0
  35. package/dist/api/profile/index.js +2 -0
  36. package/dist/api/profile/index.js.map +1 -0
  37. package/dist/api/qrCode/index.d.ts +10 -0
  38. package/dist/api/qrCode/index.js +2 -0
  39. package/dist/api/qrCode/index.js.map +1 -0
  40. package/dist/api/registration/index.d.ts +10 -0
  41. package/dist/api/registration/index.js +2 -0
  42. package/dist/api/registration/index.js.map +1 -0
  43. package/dist/api/template/index.d.ts +215 -0
  44. package/dist/api/template/index.js +2 -0
  45. package/dist/api/template/index.js.map +1 -0
  46. package/dist/api/twoStepVerification/index.d.ts +10 -0
  47. package/dist/api/twoStepVerification/index.js +2 -0
  48. package/dist/api/twoStepVerification/index.js.map +1 -0
  49. package/dist/api/waba/index.d.ts +10 -0
  50. package/dist/api/waba/index.js +2 -0
  51. package/dist/api/waba/index.js.map +1 -0
  52. package/dist/base-CdGDdVEl.d.ts +18 -0
  53. package/dist/chunk-7QBIZCJ4.js +2 -0
  54. package/dist/chunk-7QBIZCJ4.js.map +1 -0
  55. package/dist/chunk-AMHQGG6Z.js +2 -0
  56. package/dist/chunk-AMHQGG6Z.js.map +1 -0
  57. package/dist/chunk-B7DCL6I7.js +10 -0
  58. package/dist/chunk-B7DCL6I7.js.map +1 -0
  59. package/dist/chunk-CRZ7EUYR.js +2 -0
  60. package/dist/chunk-CRZ7EUYR.js.map +1 -0
  61. package/dist/chunk-FKXSL2JK.js +3 -0
  62. package/dist/chunk-FKXSL2JK.js.map +1 -0
  63. package/dist/chunk-FSKBLPGE.js +2 -0
  64. package/dist/chunk-FSKBLPGE.js.map +1 -0
  65. package/dist/chunk-HJGN3PO4.js +3 -0
  66. package/dist/chunk-HJGN3PO4.js.map +1 -0
  67. package/dist/chunk-IYSR44P6.js +2 -0
  68. package/dist/chunk-IYSR44P6.js.map +1 -0
  69. package/dist/chunk-JC6YMVID.js +2 -0
  70. package/dist/chunk-JC6YMVID.js.map +1 -0
  71. package/dist/chunk-JPAV644F.js +2 -0
  72. package/dist/chunk-JPAV644F.js.map +1 -0
  73. package/dist/chunk-JXCLRKQ7.js +2 -0
  74. package/dist/chunk-JXCLRKQ7.js.map +1 -0
  75. package/dist/chunk-KMAH6636.js +2 -0
  76. package/dist/chunk-KMAH6636.js.map +1 -0
  77. package/dist/chunk-L4ESAO2S.js +2 -0
  78. package/dist/chunk-L4ESAO2S.js.map +1 -0
  79. package/dist/chunk-LV3TULSI.js +2 -0
  80. package/dist/chunk-LV3TULSI.js.map +1 -0
  81. package/dist/chunk-MJEG3K4V.js +2 -0
  82. package/dist/chunk-MJEG3K4V.js.map +1 -0
  83. package/dist/chunk-NLF2JGYY.js +2 -0
  84. package/dist/chunk-NLF2JGYY.js.map +1 -0
  85. package/dist/chunk-OA2SW4AF.js +2 -0
  86. package/dist/chunk-OA2SW4AF.js.map +1 -0
  87. package/dist/chunk-PHPQ5HP3.js +2 -0
  88. package/dist/chunk-PHPQ5HP3.js.map +1 -0
  89. package/dist/chunk-RIL6QABY.js +2 -0
  90. package/dist/chunk-RIL6QABY.js.map +1 -0
  91. package/dist/chunk-RWCVPWRC.js +2 -0
  92. package/dist/chunk-RWCVPWRC.js.map +1 -0
  93. package/dist/chunk-SNNRWNGZ.js +2 -0
  94. package/dist/chunk-SNNRWNGZ.js.map +1 -0
  95. package/dist/chunk-UCBYECNQ.js +2 -0
  96. package/dist/chunk-UCBYECNQ.js.map +1 -0
  97. package/dist/chunk-VHAODWCN.js +2 -0
  98. package/dist/chunk-VHAODWCN.js.map +1 -0
  99. package/dist/chunk-WGGN32O2.js +2 -0
  100. package/dist/chunk-WGGN32O2.js.map +1 -0
  101. package/dist/common-DDXsNyLF.d.ts +376 -0
  102. package/dist/core/webhook/frameworks/express.d.ts +48 -0
  103. package/dist/core/webhook/frameworks/express.js +2 -0
  104. package/dist/core/webhook/frameworks/express.js.map +1 -0
  105. package/dist/core/webhook/frameworks/nextjs.d.ts +44 -0
  106. package/dist/core/webhook/frameworks/nextjs.js +2 -0
  107. package/dist/core/webhook/frameworks/nextjs.js.map +1 -0
  108. package/dist/core/webhook/index.d.ts +26 -0
  109. package/dist/core/webhook/index.js +2 -0
  110. package/dist/core/webhook/index.js.map +1 -0
  111. package/dist/core/whatsapp/index.d.ts +40 -0
  112. package/dist/core/whatsapp/index.js +2 -0
  113. package/dist/core/whatsapp/index.js.map +1 -0
  114. package/dist/enums-BZd9T2ul.d.ts +707 -0
  115. package/dist/httpsClient-v4gmltzS.d.ts +19 -0
  116. package/dist/index.d.ts +22 -0
  117. package/dist/index.js +2 -0
  118. package/dist/index.js.map +1 -0
  119. package/dist/logger-BdE0Vyim.d.ts +9 -0
  120. package/dist/request-vYMaEfk5.d.ts +50 -0
  121. package/dist/types/config.d.ts +78 -0
  122. package/dist/types/config.js +2 -0
  123. package/dist/types/config.js.map +1 -0
  124. package/dist/types/enums.d.ts +1 -0
  125. package/dist/types/enums.js +2 -0
  126. package/dist/types/enums.js.map +1 -0
  127. package/dist/types/index.d.ts +6 -0
  128. package/dist/types/index.js +2 -0
  129. package/dist/types/index.js.map +1 -0
  130. package/dist/utils/index.d.ts +98 -0
  131. package/dist/utils/index.js +2 -0
  132. package/dist/utils/index.js.map +1 -0
  133. package/package.json +240 -8
@@ -0,0 +1,376 @@
1
+ import { e as ResponseSuccess } from './request-vYMaEfk5.js';
2
+
3
+ /**
4
+ * Enum for Flow Status
5
+ */
6
+ declare enum FlowStatusEnum {
7
+ Draft = "DRAFT",
8
+ Published = "PUBLISHED",
9
+ Throttled = "THROTTLED",
10
+ Blocked = "BLOCKED",
11
+ Deprecated = "DEPRECATED"
12
+ }
13
+ /**
14
+ * Enum for Flow Categories
15
+ */
16
+ declare enum FlowCategoryEnum {
17
+ SignUp = "SIGN_UP",
18
+ SignIn = "SIGN_IN",
19
+ AppointmentBooking = "APPOINTMENT_BOOKING",
20
+ LeadGeneration = "LEAD_GENERATION",
21
+ ContactUs = "CONTACT_US",
22
+ CustomerSupport = "CUSTOMER_SUPPORT",
23
+ Survey = "SURVEY",
24
+ Other = "OTHER"
25
+ }
26
+ declare enum FlowActionEnum {
27
+ INIT = "INIT",
28
+ BACK = "BACK",
29
+ DATA_EXCHANGE = "data_exchange"
30
+ }
31
+ /**
32
+ * Enum for Flow Types in webhook handlers
33
+ * Used to register handlers for specific flow events
34
+ */
35
+ declare enum FlowTypeEnum {
36
+ /** Health check/ping requests */
37
+ Ping = "ping",
38
+ /** Data exchange requests */
39
+ Change = "data_exchange",
40
+ /** Error notification requests */
41
+ Error = "error",
42
+ /** Match all flow action types */
43
+ All = "*"
44
+ }
45
+ type FlowType = (typeof FlowTypeEnum)[keyof typeof FlowTypeEnum];
46
+ /**
47
+ * Flow Validation Error Pointer
48
+ */
49
+ interface FlowValidationErrorPointer {
50
+ line_start: number;
51
+ line_end: number;
52
+ column_start: number;
53
+ column_end: number;
54
+ path: string;
55
+ }
56
+ /**
57
+ * Flow Validation Error
58
+ */
59
+ interface FlowValidationError {
60
+ error: string;
61
+ error_type: string;
62
+ message: string;
63
+ line_start: number;
64
+ line_end: number;
65
+ column_start: number;
66
+ column_end: number;
67
+ pointers: FlowValidationErrorPointer[];
68
+ }
69
+ /**
70
+ * Flow Item
71
+ */
72
+ interface Flow {
73
+ id: string;
74
+ name: string;
75
+ status: FlowStatusEnum;
76
+ categories: FlowCategoryEnum[];
77
+ validation_errors: FlowValidationError[];
78
+ }
79
+ /**
80
+ * Pagination Cursors
81
+ */
82
+ interface PaginationCursors {
83
+ before: string;
84
+ after: string;
85
+ }
86
+ /**
87
+ * Pagination Object
88
+ */
89
+ interface Pagination {
90
+ cursors: PaginationCursors;
91
+ }
92
+ /**
93
+ * Flows List Response
94
+ */
95
+ interface FlowsListResponse {
96
+ data: Flow[];
97
+ paging: Pagination;
98
+ }
99
+ /**
100
+ * Flow Asset
101
+ */
102
+ interface FlowAsset {
103
+ name: string;
104
+ asset_type: string;
105
+ download_url: string;
106
+ }
107
+ /**
108
+ * Flow Assets Response
109
+ */
110
+ interface FlowAssetsResponse {
111
+ data: FlowAsset[];
112
+ paging: Pagination;
113
+ }
114
+ /**
115
+ * Flow Preview
116
+ */
117
+ interface FlowPreview {
118
+ preview_url: string;
119
+ expires_at: string;
120
+ }
121
+ /**
122
+ * Flow Preview Response
123
+ */
124
+ interface FlowPreviewResponse {
125
+ preview: FlowPreview;
126
+ id: string;
127
+ }
128
+ /**
129
+ * Flow Migration Result
130
+ */
131
+ interface FlowMigrationResult {
132
+ source_name: string;
133
+ source_id: string;
134
+ migrated_id: string;
135
+ }
136
+ /**
137
+ * Flow Migration Failure
138
+ */
139
+ interface FlowMigrationFailure {
140
+ source_name: string;
141
+ error_code: string;
142
+ error_message: string;
143
+ }
144
+ /**
145
+ * Create Flow Response
146
+ */
147
+ interface CreateFlowResponse {
148
+ id: string;
149
+ success: boolean;
150
+ validation_errors?: FlowValidationError[];
151
+ }
152
+ /**
153
+ * Update Flow Response
154
+ */
155
+ interface UpdateFlowResponse {
156
+ success: boolean;
157
+ validation_errors?: FlowValidationError[];
158
+ }
159
+ /**
160
+ * Flow Migration Response
161
+ */
162
+ interface FlowMigrationResponse {
163
+ migrated_flows: FlowMigrationResult[];
164
+ failed_flows: FlowMigrationFailure[];
165
+ }
166
+ /**
167
+ * Validate Flow JSON Response
168
+ */
169
+ interface ValidateFlowJsonResponse {
170
+ valid: boolean;
171
+ success: boolean;
172
+ validation_errors?: FlowValidationError[];
173
+ }
174
+ /**
175
+ * WhatsApp Flow Endpoint - Health Check Request
176
+ * Represents the structure of a health check request
177
+ */
178
+ interface FlowHealthCheckRequest {
179
+ action: 'ping';
180
+ version: '3.0';
181
+ }
182
+ /**
183
+ * WhatsApp Flow Endpoint - Health Check Response
184
+ * The expected response structure for health check requests
185
+ */
186
+ interface FlowHealthCheckResponse {
187
+ data: {
188
+ status: 'active';
189
+ };
190
+ }
191
+ /**
192
+ * WhatsApp Flow Endpoint - Data Exchange Request
193
+ * Represents the structure of a data exchange request
194
+ */
195
+ interface FlowDataExchangeRequest {
196
+ version: '3.0';
197
+ action: FlowActionEnum;
198
+ screen: string;
199
+ flow_token: string;
200
+ data?: Record<string, any> & {
201
+ error_message?: string;
202
+ };
203
+ }
204
+ /**
205
+ * WhatsApp Flow Endpoint - Data Exchange Response
206
+ * The expected response structure for data exchange requests
207
+ */
208
+ interface FlowDataExchangeResponse {
209
+ screen?: string;
210
+ data?: Record<string, any | {
211
+ error_message?: string;
212
+ }>;
213
+ }
214
+ /**
215
+ * WhatsApp Flow Endpoint - Success Screen Response
216
+ * The expected response structure for success screen requests
217
+ */
218
+ interface FlowSuccessScreenResponse {
219
+ screen: 'SUCCESS';
220
+ data: {
221
+ extension_message_response?: {
222
+ params?: {
223
+ flow_token: string;
224
+ [key: string]: string;
225
+ };
226
+ };
227
+ };
228
+ }
229
+ /**
230
+ * WhatsApp Flow Endpoint - Error Notification Request
231
+ * Represents the structure of an error notification request
232
+ */
233
+ interface FlowErrorNotificationRequest {
234
+ version: '3.0';
235
+ action: Exclude<FlowActionEnum, FlowActionEnum.BACK>;
236
+ screen: string;
237
+ flow_token: string;
238
+ data: {
239
+ error: string;
240
+ error_message: string;
241
+ };
242
+ }
243
+ /**
244
+ * WhatsApp Flow Endpoint - Error Notification Response
245
+ * The expected response structure for error notification requests
246
+ */
247
+ interface FlowErrorNotificationResponse {
248
+ acknowledged: boolean;
249
+ }
250
+ /**
251
+ * WhatsApp Flow Endpoint - Comprehensive Request Object
252
+ * A combined type that includes all possible fields from different request types
253
+ * with all fields being optional for flexibility
254
+ */
255
+ interface FlowEndpointRequest {
256
+ version?: '3.0';
257
+ action?: 'ping' | FlowActionEnum;
258
+ screen?: string;
259
+ flow_token?: string;
260
+ data?: Record<string, any> & {
261
+ error_key?: string;
262
+ error_message?: string;
263
+ };
264
+ }
265
+ /**
266
+ * WhatsApp Flow Endpoint - Response
267
+ * Union type for all possible response types from a Flow endpoint
268
+ */
269
+ type FlowEndpointResponse = FlowHealthCheckResponse | FlowDataExchangeResponse | FlowErrorNotificationResponse | FlowSuccessScreenResponse;
270
+ interface FlowClass {
271
+ /**
272
+ * List Flows
273
+ *
274
+ * @param wabaId - The WABA ID
275
+ * @returns Promise with the list of flows
276
+ */
277
+ listFlows(wabaId: string): Promise<FlowsListResponse>;
278
+ /**
279
+ * Create Flow
280
+ *
281
+ * @param wabaId - The WABA ID
282
+ * @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
283
+ * @returns Promise with the created flow ID
284
+ */
285
+ createFlow(wabaId: string, data: {
286
+ name: string;
287
+ categories?: FlowCategoryEnum[];
288
+ endpoint_uri?: string;
289
+ clone_flow_id?: string;
290
+ flow_json?: string;
291
+ publish?: boolean;
292
+ }): Promise<CreateFlowResponse>;
293
+ /**
294
+ * Get Flow
295
+ *
296
+ * @param flowId - The flow ID
297
+ * @param fields - Optional fields to return
298
+ * @param dateFormat - Optional date format
299
+ * @returns Promise with the flow details
300
+ */
301
+ getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
302
+ /**
303
+ * Update Flow Metadata
304
+ *
305
+ * @param flowId - The flow ID
306
+ * @param data - The flow metadata to update
307
+ * @returns Promise with the success status
308
+ */
309
+ updateFlowMetadata(flowId: string, data: {
310
+ name?: string;
311
+ categories?: FlowCategoryEnum[];
312
+ endpoint_uri?: string;
313
+ application_id?: string;
314
+ }): Promise<ResponseSuccess>;
315
+ /**
316
+ * Delete Flow
317
+ *
318
+ * @param flowId - The flow ID
319
+ * @returns Promise with the success status
320
+ */
321
+ deleteFlow(flowId: string): Promise<ResponseSuccess>;
322
+ /**
323
+ * List Assets (Get Flow JSON URL)
324
+ *
325
+ * @param flowId - The flow ID
326
+ * @returns Promise with the list of assets
327
+ */
328
+ listAssets(flowId: string): Promise<FlowAssetsResponse>;
329
+ /**
330
+ * Update Flow JSON
331
+ *
332
+ * @param flowId - The flow ID
333
+ * @param data - The asset data including asset_type, file, and name
334
+ * @returns Promise with the success status and validation errors
335
+ */
336
+ updateFlowJson(flowId: string, data: {
337
+ file: Blob | Buffer | object;
338
+ name?: string;
339
+ }): Promise<UpdateFlowResponse>;
340
+ /**
341
+ * Validate Flow JSON by attempting an update without publishing.
342
+ * This is a convenience method; the API doesn't have a dedicated validation endpoint.
343
+ *
344
+ * @param flowId - The ID of the Flow (must exist, can be in DRAFT status).
345
+ * @param flowJsonData - The Flow JSON content as a Buffer, JSON object, or Blob.
346
+ * @returns Promise indicating if the JSON is valid and includes validation errors if any.
347
+ */
348
+ validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
349
+ /**
350
+ * Publish Flow
351
+ *
352
+ * @param flowId - The flow ID
353
+ * @returns Promise with the success status
354
+ */
355
+ publishFlow(flowId: string): Promise<ResponseSuccess>;
356
+ /**
357
+ * Deprecate Flow
358
+ *
359
+ * @param flowId - The flow ID
360
+ * @returns Promise with the success status
361
+ */
362
+ deprecateFlow(flowId: string): Promise<ResponseSuccess>;
363
+ /**
364
+ * Migrate Flows
365
+ *
366
+ * @param wabaId - The destination WABA ID
367
+ * @param data - The migration data including source_waba_id and optional source_flow_names
368
+ * @returns Promise with migration results
369
+ */
370
+ migrateFlows(wabaId: string, data: {
371
+ source_waba_id: string;
372
+ source_flow_names?: string[];
373
+ }): Promise<FlowMigrationResponse>;
374
+ }
375
+
376
+ export { type CreateFlowResponse as C, type Flow as F, type UpdateFlowResponse as U, type ValidateFlowJsonResponse as V, type FlowType as a, FlowActionEnum as b, type FlowAssetsResponse as c, FlowCategoryEnum as d, type FlowClass as e, type FlowEndpointRequest as f, type FlowEndpointResponse as g, type FlowMigrationResponse as h, type FlowPreviewResponse as i, type FlowsListResponse as j, FlowStatusEnum as k, FlowTypeEnum as l, type FlowValidationError as m, type FlowDataExchangeRequest as n, type FlowErrorNotificationRequest as o, type FlowHealthCheckRequest as p };
@@ -0,0 +1,48 @@
1
+ import { WhatsAppConfig } from '../../../types/config.js';
2
+ import { c as WebhookProcessor } from '../../../WebhookProcessor-ByAe7Kf_.js';
3
+ import '../../../enums-BZd9T2ul.js';
4
+ import '../../../common-DDXsNyLF.js';
5
+ import '../../../request-vYMaEfk5.js';
6
+ import '../../../WhatsApp-BIBtT-y9.js';
7
+ import '../../../httpsClient-v4gmltzS.js';
8
+ import 'https';
9
+ import '../../../EncryptionApi-D7pt-OXT.js';
10
+ import '../../../base-CdGDdVEl.js';
11
+ import '../../../FlowApi-UAvzhJfV.js';
12
+ import '../../../MediaApi-BrEKpqi_.js';
13
+ import '../../../MessageApi-Circorzz.js';
14
+ import '../../../PhoneNumberApi-DKlu9PHl.js';
15
+ import '../../../BusinessProfileApi-WXscSgo-.js';
16
+ import '../../../QrCodeApi-7vDwIBHR.js';
17
+ import '../../../RegistrationApi-qO_qoti9.js';
18
+ import '../../../TemplateApi-xGgIZt89.js';
19
+ import '../../../TwoStepVerificationApi-DfNPIz-C.js';
20
+ import '../../../WabaApi-DqQi_68m.js';
21
+
22
+ interface ExpressRequest {
23
+ method: string;
24
+ url: string;
25
+ headers: Record<string, string | string[] | undefined>;
26
+ body?: any;
27
+ query: Record<string, any>;
28
+ rawBody?: any;
29
+ }
30
+ interface ExpressResponse {
31
+ status(code: number): ExpressResponse;
32
+ json(data: any): ExpressResponse;
33
+ send(data?: any): ExpressResponse;
34
+ setHeader(name: string, value: string): void;
35
+ }
36
+ interface NextFunction {
37
+ (error?: any): void;
38
+ }
39
+ interface ExpressWebhookConfig extends WhatsAppConfig {
40
+ path?: string;
41
+ }
42
+ declare function webhookHandler(config: ExpressWebhookConfig): {
43
+ webhook: (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => Promise<ExpressResponse | undefined>;
44
+ flow: (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => Promise<ExpressResponse | undefined>;
45
+ processor: WebhookProcessor;
46
+ };
47
+
48
+ export { type ExpressRequest, type ExpressResponse, type ExpressWebhookConfig, type NextFunction, webhookHandler };
@@ -0,0 +1,2 @@
1
+ export{a as webhookHandler}from'../../../chunk-OA2SW4AF.js';import'../../../chunk-HJGN3PO4.js';import'../../../chunk-WGGN32O2.js';import'../../../chunk-B7DCL6I7.js';import'../../../chunk-FKXSL2JK.js';import'../../../chunk-AMHQGG6Z.js';import'../../../chunk-JPAV644F.js';import'../../../chunk-PHPQ5HP3.js';import'../../../chunk-IYSR44P6.js';import'../../../chunk-SNNRWNGZ.js';import'../../../chunk-L4ESAO2S.js';import'../../../chunk-7QBIZCJ4.js';import'../../../chunk-JXCLRKQ7.js';import'../../../chunk-LV3TULSI.js';import'../../../chunk-CRZ7EUYR.js';import'../../../chunk-JC6YMVID.js';import'../../../chunk-NLF2JGYY.js';import'../../../chunk-FSKBLPGE.js';import'../../../chunk-VHAODWCN.js';import'../../../chunk-MJEG3K4V.js';import'../../../chunk-RIL6QABY.js';import'../../../chunk-KMAH6636.js';//# sourceMappingURL=express.js.map
2
+ //# sourceMappingURL=express.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"express.js"}
@@ -0,0 +1,44 @@
1
+ import { WhatsAppConfig } from '../../../types/config.js';
2
+ import { c as WebhookProcessor } from '../../../WebhookProcessor-ByAe7Kf_.js';
3
+ import '../../../enums-BZd9T2ul.js';
4
+ import '../../../common-DDXsNyLF.js';
5
+ import '../../../request-vYMaEfk5.js';
6
+ import '../../../WhatsApp-BIBtT-y9.js';
7
+ import '../../../httpsClient-v4gmltzS.js';
8
+ import 'https';
9
+ import '../../../EncryptionApi-D7pt-OXT.js';
10
+ import '../../../base-CdGDdVEl.js';
11
+ import '../../../FlowApi-UAvzhJfV.js';
12
+ import '../../../MediaApi-BrEKpqi_.js';
13
+ import '../../../MessageApi-Circorzz.js';
14
+ import '../../../PhoneNumberApi-DKlu9PHl.js';
15
+ import '../../../BusinessProfileApi-WXscSgo-.js';
16
+ import '../../../QrCodeApi-7vDwIBHR.js';
17
+ import '../../../RegistrationApi-qO_qoti9.js';
18
+ import '../../../TemplateApi-xGgIZt89.js';
19
+ import '../../../TwoStepVerificationApi-DfNPIz-C.js';
20
+ import '../../../WabaApi-DqQi_68m.js';
21
+
22
+ interface BaseApiRequest {
23
+ method?: string;
24
+ url?: string;
25
+ headers: Record<string, string | string[] | undefined>;
26
+ body?: any;
27
+ query: Partial<Record<string, string | string[]>>;
28
+ rawBody?: any;
29
+ }
30
+ interface BaseApiResponse {
31
+ status(code: number): any;
32
+ json(data: any): void | any;
33
+ send(data?: any): void | any;
34
+ setHeader(name: string, value: string): void;
35
+ }
36
+ interface NextJsWebhookConfig extends WhatsAppConfig {
37
+ }
38
+ declare function webhookHandler<TRequest extends BaseApiRequest, TResponse extends BaseApiResponse>(config: NextJsWebhookConfig): {
39
+ webhook: (req: TRequest, res: TResponse) => Promise<any>;
40
+ flow: (req: TRequest, res: TResponse) => Promise<any>;
41
+ processor: WebhookProcessor;
42
+ };
43
+
44
+ export { type BaseApiRequest, type BaseApiResponse, type NextJsWebhookConfig, webhookHandler };
@@ -0,0 +1,2 @@
1
+ export{a as webhookHandler}from'../../../chunk-UCBYECNQ.js';import'../../../chunk-HJGN3PO4.js';import'../../../chunk-WGGN32O2.js';import'../../../chunk-B7DCL6I7.js';import'../../../chunk-FKXSL2JK.js';import'../../../chunk-AMHQGG6Z.js';import'../../../chunk-JPAV644F.js';import'../../../chunk-PHPQ5HP3.js';import'../../../chunk-IYSR44P6.js';import'../../../chunk-SNNRWNGZ.js';import'../../../chunk-L4ESAO2S.js';import'../../../chunk-7QBIZCJ4.js';import'../../../chunk-JXCLRKQ7.js';import'../../../chunk-LV3TULSI.js';import'../../../chunk-CRZ7EUYR.js';import'../../../chunk-JC6YMVID.js';import'../../../chunk-NLF2JGYY.js';import'../../../chunk-FSKBLPGE.js';import'../../../chunk-VHAODWCN.js';import'../../../chunk-MJEG3K4V.js';import'../../../chunk-RIL6QABY.js';import'../../../chunk-KMAH6636.js';//# sourceMappingURL=nextjs.js.map
2
+ //# sourceMappingURL=nextjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"nextjs.js"}
@@ -0,0 +1,26 @@
1
+ export { ExpressRequest, ExpressResponse, webhookHandler as ExpressWebhook, ExpressWebhookConfig, NextFunction } from './frameworks/express.js';
2
+ export { webhookHandler as NextJsWebhook, NextJsWebhookConfig } from './frameworks/nextjs.js';
3
+ export { F as FlowHandler, e as MessageHandler, M as MessageStatus, W as WebhookContact, a as WebhookEvent, b as WebhookMessage, c as WebhookProcessor, d as WebhookResponse, g as constructFullUrl, f as processFlowRequest, p as processWebhookMessages } from '../../WebhookProcessor-ByAe7Kf_.js';
4
+ import '../../types/config.js';
5
+ import '../../enums-BZd9T2ul.js';
6
+ import '../../common-DDXsNyLF.js';
7
+ import '../../request-vYMaEfk5.js';
8
+ import '../../WhatsApp-BIBtT-y9.js';
9
+ import '../../httpsClient-v4gmltzS.js';
10
+ import 'https';
11
+ import '../../EncryptionApi-D7pt-OXT.js';
12
+ import '../../base-CdGDdVEl.js';
13
+ import '../../FlowApi-UAvzhJfV.js';
14
+ import '../../MediaApi-BrEKpqi_.js';
15
+ import '../../MessageApi-Circorzz.js';
16
+ import '../../PhoneNumberApi-DKlu9PHl.js';
17
+ import '../../BusinessProfileApi-WXscSgo-.js';
18
+ import '../../QrCodeApi-7vDwIBHR.js';
19
+ import '../../RegistrationApi-qO_qoti9.js';
20
+ import '../../TemplateApi-xGgIZt89.js';
21
+ import '../../TwoStepVerificationApi-DfNPIz-C.js';
22
+ import '../../WabaApi-DqQi_68m.js';
23
+
24
+ declare const generateXHub256Sig: (body: string, appSecret: string) => string;
25
+
26
+ export { generateXHub256Sig };
@@ -0,0 +1,2 @@
1
+ export{a as generateXHub256Sig}from'../../chunk-RWCVPWRC.js';export{a as ExpressWebhook}from'../../chunk-OA2SW4AF.js';export{a as NextJsWebhook}from'../../chunk-UCBYECNQ.js';export{d as WebhookProcessor,c as constructFullUrl,b as processFlowRequest,a as processWebhookMessages}from'../../chunk-HJGN3PO4.js';import'../../chunk-WGGN32O2.js';import'../../chunk-B7DCL6I7.js';import'../../chunk-FKXSL2JK.js';import'../../chunk-AMHQGG6Z.js';import'../../chunk-JPAV644F.js';import'../../chunk-PHPQ5HP3.js';import'../../chunk-IYSR44P6.js';import'../../chunk-SNNRWNGZ.js';import'../../chunk-L4ESAO2S.js';import'../../chunk-7QBIZCJ4.js';import'../../chunk-JXCLRKQ7.js';import'../../chunk-LV3TULSI.js';import'../../chunk-CRZ7EUYR.js';import'../../chunk-JC6YMVID.js';import'../../chunk-NLF2JGYY.js';import'../../chunk-FSKBLPGE.js';import'../../chunk-VHAODWCN.js';import'../../chunk-MJEG3K4V.js';import'../../chunk-RIL6QABY.js';import'../../chunk-KMAH6636.js';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,40 @@
1
+ import { E as EncryptionApi } from '../../EncryptionApi-D7pt-OXT.js';
2
+ import { F as FlowApi } from '../../FlowApi-UAvzhJfV.js';
3
+ import { WhatsAppConfig } from '../../types/config.js';
4
+ import { M as MediaApi } from '../../MediaApi-BrEKpqi_.js';
5
+ import { M as MessagesApi } from '../../MessageApi-Circorzz.js';
6
+ import { P as PhoneNumberApi } from '../../PhoneNumberApi-DKlu9PHl.js';
7
+ import { B as BusinessProfileApi } from '../../BusinessProfileApi-WXscSgo-.js';
8
+ import { Q as QrCodeApi } from '../../QrCodeApi-7vDwIBHR.js';
9
+ import { R as RegistrationApi } from '../../RegistrationApi-qO_qoti9.js';
10
+ import { T as TemplateApi } from '../../TemplateApi-xGgIZt89.js';
11
+ import { T as TwoStepVerificationApi } from '../../TwoStepVerificationApi-DfNPIz-C.js';
12
+ import { W as WabaApi } from '../../WabaApi-DqQi_68m.js';
13
+ export { W as WhatsApp } from '../../WhatsApp-BIBtT-y9.js';
14
+ import '../../base-CdGDdVEl.js';
15
+ import '../../enums-BZd9T2ul.js';
16
+ import '../../request-vYMaEfk5.js';
17
+ import '../../common-DDXsNyLF.js';
18
+ import '../../httpsClient-v4gmltzS.js';
19
+ import 'https';
20
+
21
+ declare class WhatsAppClass {
22
+ constructor(config?: WhatsAppConfig);
23
+ readonly messages: MessagesApi;
24
+ readonly templates: TemplateApi;
25
+ readonly phoneNumber: PhoneNumberApi;
26
+ readonly qrCode: QrCodeApi;
27
+ readonly encryption: EncryptionApi;
28
+ readonly twoStepVerification: TwoStepVerificationApi;
29
+ readonly registration: RegistrationApi;
30
+ readonly media: MediaApi;
31
+ readonly waba: WabaApi;
32
+ readonly flow: FlowApi;
33
+ readonly businessProfile: BusinessProfileApi;
34
+ updateTimeout(ms: number): boolean;
35
+ updatePhoneNumberId(phoneNumberId: number): boolean;
36
+ updateAccessToken(accessToken: string): boolean;
37
+ updateWabaId(wabaId: string): boolean;
38
+ }
39
+
40
+ export { WhatsAppClass };
@@ -0,0 +1,2 @@
1
+ export{b as WhatsApp}from'../../chunk-B7DCL6I7.js';import'../../chunk-FKXSL2JK.js';import'../../chunk-AMHQGG6Z.js';import'../../chunk-JPAV644F.js';import'../../chunk-PHPQ5HP3.js';import'../../chunk-IYSR44P6.js';import'../../chunk-SNNRWNGZ.js';import'../../chunk-L4ESAO2S.js';import'../../chunk-7QBIZCJ4.js';import'../../chunk-JXCLRKQ7.js';import'../../chunk-LV3TULSI.js';import'../../chunk-CRZ7EUYR.js';import'../../chunk-JC6YMVID.js';import'../../chunk-NLF2JGYY.js';import'../../chunk-FSKBLPGE.js';import'../../chunk-VHAODWCN.js';import'../../chunk-MJEG3K4V.js';import'../../chunk-RIL6QABY.js';import'../../chunk-KMAH6636.js';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}