@ariaflowagents/messaging-meta 0.8.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 (106) hide show
  1. package/README.md +236 -0
  2. package/dist/graph-api/client.d.ts +125 -0
  3. package/dist/graph-api/client.d.ts.map +1 -0
  4. package/dist/graph-api/client.js +204 -0
  5. package/dist/graph-api/client.js.map +1 -0
  6. package/dist/graph-api/errors.d.ts +41 -0
  7. package/dist/graph-api/errors.d.ts.map +1 -0
  8. package/dist/graph-api/errors.js +72 -0
  9. package/dist/graph-api/errors.js.map +1 -0
  10. package/dist/graph-api/index.d.ts +15 -0
  11. package/dist/graph-api/index.d.ts.map +1 -0
  12. package/dist/graph-api/index.js +11 -0
  13. package/dist/graph-api/index.js.map +1 -0
  14. package/dist/graph-api/rate-limiter.d.ts +90 -0
  15. package/dist/graph-api/rate-limiter.d.ts.map +1 -0
  16. package/dist/graph-api/rate-limiter.js +172 -0
  17. package/dist/graph-api/rate-limiter.js.map +1 -0
  18. package/dist/graph-api/retry.d.ts +55 -0
  19. package/dist/graph-api/retry.d.ts.map +1 -0
  20. package/dist/graph-api/retry.js +103 -0
  21. package/dist/graph-api/retry.js.map +1 -0
  22. package/dist/index.d.ts +36 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +38 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/instagram/client.d.ts +365 -0
  27. package/dist/instagram/client.d.ts.map +1 -0
  28. package/dist/instagram/client.js +857 -0
  29. package/dist/instagram/client.js.map +1 -0
  30. package/dist/instagram/format.d.ts +62 -0
  31. package/dist/instagram/format.d.ts.map +1 -0
  32. package/dist/instagram/format.js +92 -0
  33. package/dist/instagram/format.js.map +1 -0
  34. package/dist/instagram/ice-breakers.d.ts +63 -0
  35. package/dist/instagram/ice-breakers.d.ts.map +1 -0
  36. package/dist/instagram/ice-breakers.js +87 -0
  37. package/dist/instagram/ice-breakers.js.map +1 -0
  38. package/dist/instagram/index.d.ts +44 -0
  39. package/dist/instagram/index.d.ts.map +1 -0
  40. package/dist/instagram/index.js +46 -0
  41. package/dist/instagram/index.js.map +1 -0
  42. package/dist/instagram/types.d.ts +188 -0
  43. package/dist/instagram/types.d.ts.map +1 -0
  44. package/dist/instagram/types.js +19 -0
  45. package/dist/instagram/types.js.map +1 -0
  46. package/dist/messenger/client.d.ts +339 -0
  47. package/dist/messenger/client.d.ts.map +1 -0
  48. package/dist/messenger/client.js +782 -0
  49. package/dist/messenger/client.js.map +1 -0
  50. package/dist/messenger/format.d.ts +69 -0
  51. package/dist/messenger/format.d.ts.map +1 -0
  52. package/dist/messenger/format.js +98 -0
  53. package/dist/messenger/format.js.map +1 -0
  54. package/dist/messenger/index.d.ts +34 -0
  55. package/dist/messenger/index.d.ts.map +1 -0
  56. package/dist/messenger/index.js +35 -0
  57. package/dist/messenger/index.js.map +1 -0
  58. package/dist/messenger/types.d.ts +181 -0
  59. package/dist/messenger/types.d.ts.map +1 -0
  60. package/dist/messenger/types.js +10 -0
  61. package/dist/messenger/types.js.map +1 -0
  62. package/dist/server.d.ts +31 -0
  63. package/dist/server.d.ts.map +1 -0
  64. package/dist/server.js +29 -0
  65. package/dist/server.js.map +1 -0
  66. package/dist/webhook/index.d.ts +10 -0
  67. package/dist/webhook/index.d.ts.map +1 -0
  68. package/dist/webhook/index.js +8 -0
  69. package/dist/webhook/index.js.map +1 -0
  70. package/dist/webhook/normalizer.d.ts +169 -0
  71. package/dist/webhook/normalizer.d.ts.map +1 -0
  72. package/dist/webhook/normalizer.js +301 -0
  73. package/dist/webhook/normalizer.js.map +1 -0
  74. package/dist/webhook/verifier.d.ts +45 -0
  75. package/dist/webhook/verifier.d.ts.map +1 -0
  76. package/dist/webhook/verifier.js +62 -0
  77. package/dist/webhook/verifier.js.map +1 -0
  78. package/dist/whatsapp/client.d.ts +481 -0
  79. package/dist/whatsapp/client.d.ts.map +1 -0
  80. package/dist/whatsapp/client.js +1043 -0
  81. package/dist/whatsapp/client.js.map +1 -0
  82. package/dist/whatsapp/flows.d.ts +74 -0
  83. package/dist/whatsapp/flows.d.ts.map +1 -0
  84. package/dist/whatsapp/flows.js +77 -0
  85. package/dist/whatsapp/flows.js.map +1 -0
  86. package/dist/whatsapp/format.d.ts +78 -0
  87. package/dist/whatsapp/format.d.ts.map +1 -0
  88. package/dist/whatsapp/format.js +195 -0
  89. package/dist/whatsapp/format.js.map +1 -0
  90. package/dist/whatsapp/index.d.ts +39 -0
  91. package/dist/whatsapp/index.d.ts.map +1 -0
  92. package/dist/whatsapp/index.js +42 -0
  93. package/dist/whatsapp/index.js.map +1 -0
  94. package/dist/whatsapp/split.d.ts +35 -0
  95. package/dist/whatsapp/split.d.ts.map +1 -0
  96. package/dist/whatsapp/split.js +76 -0
  97. package/dist/whatsapp/split.js.map +1 -0
  98. package/dist/whatsapp/templates.d.ts +129 -0
  99. package/dist/whatsapp/templates.d.ts.map +1 -0
  100. package/dist/whatsapp/templates.js +125 -0
  101. package/dist/whatsapp/templates.js.map +1 -0
  102. package/dist/whatsapp/types.d.ts +440 -0
  103. package/dist/whatsapp/types.d.ts.map +1 -0
  104. package/dist/whatsapp/types.js +11 -0
  105. package/dist/whatsapp/types.js.map +1 -0
  106. package/package.json +31 -0
@@ -0,0 +1,440 @@
1
+ /**
2
+ * @module whatsapp/types
3
+ *
4
+ * Comprehensive TypeScript types mirroring Meta's WhatsApp Cloud API.
5
+ *
6
+ * These types cover configuration, message payloads (text, media, interactive,
7
+ * template, location, contacts), business profile management, WhatsApp Flows,
8
+ * and API response shapes.
9
+ */
10
+ import type { MediaCache } from '@ariaflowagents/messaging';
11
+ import type { Logger } from '../graph-api/client.js';
12
+ import type { RetryConfig } from '../graph-api/retry.js';
13
+ import type { RateLimiterConfig } from '../graph-api/rate-limiter.js';
14
+ /**
15
+ * Configuration for creating a {@link WhatsAppClient}.
16
+ *
17
+ * The `accessToken` and `appSecret` are obtained from the Meta Developer
18
+ * Dashboard. The `phoneNumberId` identifies which WhatsApp Business phone
19
+ * number to send messages from, and `verifyToken` is the custom string
20
+ * you set when configuring the webhook subscription.
21
+ */
22
+ export interface WhatsAppClientConfig {
23
+ /** Long-lived or system-user access token for the Graph API. */
24
+ accessToken: string;
25
+ /** App secret for webhook signature verification. */
26
+ appSecret: string;
27
+ /** WhatsApp Business phone number ID (sender identity). */
28
+ phoneNumberId: string;
29
+ /** Custom verify token for webhook subscription validation. */
30
+ verifyToken: string;
31
+ /** Graph API version (e.g. `"v21.0"`). Default `"v21.0"`. */
32
+ apiVersion?: string;
33
+ /** Base URL for the Graph API. Default `"https://graph.facebook.com"`. */
34
+ baseUrl?: string;
35
+ /** Optional structured logger. */
36
+ logger?: Logger;
37
+ /** Retry behaviour configuration. */
38
+ retry?: Partial<RetryConfig>;
39
+ /** Rate limiter configuration. */
40
+ rateLimiter?: Partial<RateLimiterConfig>;
41
+ /** Optional in-memory media cache for downloaded attachments. */
42
+ mediaCache?: MediaCache;
43
+ }
44
+ /**
45
+ * Composite thread identifier for a WhatsApp conversation.
46
+ *
47
+ * Uniquely identifies a conversation between a specific WhatsApp Business
48
+ * phone number and a user.
49
+ */
50
+ export interface WhatsAppThreadId {
51
+ /** The WhatsApp Business phone number ID. */
52
+ phoneNumberId: string;
53
+ /** The user's WhatsApp ID (E.164 phone number). */
54
+ userWaId: string;
55
+ }
56
+ /** Raw response from the WhatsApp Cloud API messages endpoint. */
57
+ export interface WhatsAppSendResponse {
58
+ /** Always `"whatsapp"`. */
59
+ messaging_product: 'whatsapp';
60
+ /** Contact mapping between input numbers and WhatsApp IDs. */
61
+ contacts: Array<{
62
+ input: string;
63
+ wa_id: string;
64
+ }>;
65
+ /** The sent message(s) with their platform-assigned IDs. */
66
+ messages: Array<{
67
+ id: string;
68
+ }>;
69
+ }
70
+ /**
71
+ * A template message to send via the WhatsApp Cloud API.
72
+ *
73
+ * Templates must be pre-approved by Meta before they can be used.
74
+ * They are the only message type allowed outside the 24-hour
75
+ * customer service window.
76
+ */
77
+ export interface TemplateMessage {
78
+ /** The approved template name. */
79
+ name: string;
80
+ /** Language configuration. */
81
+ language: TemplateLanguage;
82
+ /** Optional template components (header, body, buttons). */
83
+ components?: TemplateComponent[];
84
+ }
85
+ /** Language specification for a template message. */
86
+ export interface TemplateLanguage {
87
+ /** BCP 47 language code (e.g. `"en_US"`, `"es"`). */
88
+ code: string;
89
+ /** Language fallback policy. Default `"deterministic"`. */
90
+ policy?: string;
91
+ }
92
+ /** A single component within a template message. */
93
+ export interface TemplateComponent {
94
+ /** Component type. */
95
+ type: 'header' | 'body' | 'button';
96
+ /** Dynamic parameters to fill into the component. */
97
+ parameters?: TemplateParameter[];
98
+ /** Button sub-type (e.g. `"quick_reply"`, `"url"`). Required for buttons. */
99
+ sub_type?: string;
100
+ /** Button index (0-based). Required for buttons. */
101
+ index?: number;
102
+ }
103
+ /** A dynamic parameter within a template component. */
104
+ export interface TemplateParameter {
105
+ /** The parameter data type. */
106
+ type: 'text' | 'image' | 'video' | 'document' | 'currency' | 'date_time' | 'payload' | 'action';
107
+ /** Text value (when `type` is `"text"`). */
108
+ text?: string;
109
+ /** Image media object (when `type` is `"image"`). */
110
+ image?: MediaObject;
111
+ /** Video media object (when `type` is `"video"`). */
112
+ video?: MediaObject;
113
+ /** Document media object (when `type` is `"document"`). */
114
+ document?: MediaObject & {
115
+ filename?: string;
116
+ };
117
+ /** Currency value (when `type` is `"currency"`). */
118
+ currency?: {
119
+ fallback_value: string;
120
+ code: string;
121
+ amount_1000: number;
122
+ };
123
+ /** Date/time value (when `type` is `"date_time"`). */
124
+ date_time?: {
125
+ fallback_value: string;
126
+ };
127
+ /** Quick-reply button payload (when `type` is `"payload"`). */
128
+ payload?: string;
129
+ /** Action payload (when `type` is `"action"`). */
130
+ action?: Record<string, unknown>;
131
+ }
132
+ /**
133
+ * A media object used within WhatsApp messages.
134
+ *
135
+ * Specify either `id` (for previously uploaded media) or `link` (for
136
+ * publicly accessible URLs). Both should not be provided simultaneously.
137
+ */
138
+ export interface MediaObject {
139
+ /** Media ID from a previous upload. */
140
+ id?: string;
141
+ /** Public URL to the media file. */
142
+ link?: string;
143
+ /** Caption text displayed alongside the media. */
144
+ caption?: string;
145
+ /** Filename for document media. */
146
+ filename?: string;
147
+ /** MIME type of the media. */
148
+ mime_type?: string;
149
+ }
150
+ /**
151
+ * A list-style interactive message with expandable sections.
152
+ *
153
+ * Supports up to 10 sections with up to 10 rows each. The `button` text
154
+ * appears on the collapsed list control.
155
+ */
156
+ export interface ListMessage {
157
+ /** Optional header (text only for lists). */
158
+ header?: {
159
+ type: 'text';
160
+ text: string;
161
+ };
162
+ /** Body text (required, max 1024 chars). */
163
+ body: {
164
+ text: string;
165
+ };
166
+ /** Optional footer text (max 60 chars). */
167
+ footer?: {
168
+ text: string;
169
+ };
170
+ /** Text displayed on the list expand button (max 20 chars). */
171
+ button: string;
172
+ /** List sections containing selectable rows. */
173
+ sections: ListSection[];
174
+ }
175
+ /** A section within a list interactive message. */
176
+ export interface ListSection {
177
+ /** Section title. */
178
+ title: string;
179
+ /** Rows within this section. */
180
+ rows: ListRow[];
181
+ }
182
+ /** A single row within a list section. */
183
+ export interface ListRow {
184
+ /** Unique row identifier (returned in the interactive reply). */
185
+ id: string;
186
+ /** Row title (max 24 chars). */
187
+ title: string;
188
+ /** Optional description (max 72 chars). */
189
+ description?: string;
190
+ }
191
+ /**
192
+ * A button-style interactive message with up to 3 reply buttons.
193
+ *
194
+ * Supports text, image, video, or document headers.
195
+ */
196
+ export interface ButtonMessage {
197
+ /** Optional header content. */
198
+ header?: {
199
+ type: 'text';
200
+ text: string;
201
+ } | {
202
+ type: 'image';
203
+ image: MediaObject;
204
+ } | {
205
+ type: 'video';
206
+ video: MediaObject;
207
+ } | {
208
+ type: 'document';
209
+ document: MediaObject;
210
+ };
211
+ /** Body text (required, max 1024 chars). */
212
+ body: {
213
+ text: string;
214
+ };
215
+ /** Optional footer text (max 60 chars). */
216
+ footer?: {
217
+ text: string;
218
+ };
219
+ /** Reply buttons (max 3). */
220
+ buttons: ReplyButton[];
221
+ }
222
+ /** A reply button within a button interactive message. */
223
+ export interface ReplyButton {
224
+ /** Unique button identifier (returned in the interactive reply). */
225
+ id: string;
226
+ /** Button display text (max 20 chars). */
227
+ title: string;
228
+ }
229
+ /**
230
+ * A call-to-action URL button interactive message.
231
+ *
232
+ * Opens the specified URL when the user taps the button.
233
+ */
234
+ export interface CTAButtonMessage {
235
+ /** Optional header (text only). */
236
+ header?: {
237
+ type: 'text';
238
+ text: string;
239
+ };
240
+ /** Body text (required). */
241
+ body: {
242
+ text: string;
243
+ };
244
+ /** Optional footer text. */
245
+ footer?: {
246
+ text: string;
247
+ };
248
+ /** Must be `"cta_url"`. */
249
+ name: 'cta_url';
250
+ /** URL button parameters. */
251
+ parameters: {
252
+ /** Text displayed on the button. */
253
+ display_text: string;
254
+ /** URL to open when the button is tapped. */
255
+ url: string;
256
+ };
257
+ }
258
+ /**
259
+ * Input for sending a WhatsApp Flow as an interactive message.
260
+ *
261
+ * WhatsApp Flows are multi-screen forms that run natively within WhatsApp.
262
+ */
263
+ export interface FlowInteractiveInput {
264
+ /** Body text for the flow message. */
265
+ body: {
266
+ text: string;
267
+ };
268
+ /** Optional footer text. */
269
+ footer?: {
270
+ text: string;
271
+ };
272
+ /** The WhatsApp Flow ID. */
273
+ flowId: string;
274
+ /** Call-to-action button text that opens the flow. */
275
+ flowCta: string;
276
+ /** Unique token for this flow session. */
277
+ flowToken: string;
278
+ /** Flow action type. */
279
+ flowAction: 'navigate' | 'data_exchange';
280
+ /** Optional initial data for the flow. */
281
+ flowActionPayload?: Record<string, unknown>;
282
+ }
283
+ /** A location payload for sending a map pin. */
284
+ export interface LocationPayload {
285
+ /** Latitude in decimal degrees. */
286
+ latitude: number;
287
+ /** Longitude in decimal degrees. */
288
+ longitude: number;
289
+ /** Location name (displayed as title). */
290
+ name?: string;
291
+ /** Street address. */
292
+ address?: string;
293
+ }
294
+ /** A contact card payload for sending contact information. */
295
+ export interface ContactPayload {
296
+ /** Contact name (at least `formatted_name` is required). */
297
+ name: {
298
+ formatted_name: string;
299
+ first_name?: string;
300
+ last_name?: string;
301
+ };
302
+ /** Phone numbers. */
303
+ phones?: Array<{
304
+ phone: string;
305
+ type?: string;
306
+ }>;
307
+ /** Email addresses. */
308
+ emails?: Array<{
309
+ email: string;
310
+ type?: string;
311
+ }>;
312
+ }
313
+ /** WhatsApp Business profile fields. */
314
+ export interface BusinessProfile {
315
+ /** About text (max 139 chars). */
316
+ about?: string;
317
+ /** Business address. */
318
+ address?: string;
319
+ /** Business description (max 256 chars). */
320
+ description?: string;
321
+ /** Business email. */
322
+ email?: string;
323
+ /** Always `"whatsapp"`. */
324
+ messaging_product?: string;
325
+ /** URL of the profile picture. */
326
+ profile_picture_url?: string;
327
+ /** Business vertical/industry. */
328
+ vertical?: string;
329
+ /** Website URLs (max 2). */
330
+ websites?: string[];
331
+ }
332
+ /**
333
+ * A template definition for creating or updating message templates
334
+ * via the WhatsApp Business Management API.
335
+ */
336
+ export interface TemplateDefinition {
337
+ /** Template name (lowercase, underscores only). */
338
+ name: string;
339
+ /** BCP 47 language code. */
340
+ language: string;
341
+ /** Template category. */
342
+ category: 'AUTHENTICATION' | 'MARKETING' | 'UTILITY';
343
+ /** Template components (header, body, footer, buttons). */
344
+ components: TemplateDefinitionComponent[];
345
+ /** Whether Meta can auto-recategorize the template. */
346
+ allow_category_change?: boolean;
347
+ }
348
+ /** A component within a template definition. */
349
+ export interface TemplateDefinitionComponent {
350
+ /** Component type (e.g. `"HEADER"`, `"BODY"`, `"FOOTER"`, `"BUTTONS"`). */
351
+ type: string;
352
+ /** Text content for text-based components. */
353
+ text?: string;
354
+ /** Header format (`"TEXT"`, `"IMAGE"`, `"VIDEO"`, `"DOCUMENT"`). */
355
+ format?: string;
356
+ /** Button definitions for button components. */
357
+ buttons?: Array<{
358
+ type: string;
359
+ text?: string;
360
+ url?: string;
361
+ phone_number?: string;
362
+ }>;
363
+ /** Example data for template approval. */
364
+ example?: Record<string, unknown>;
365
+ /** Additional component-specific fields. */
366
+ [key: string]: unknown;
367
+ }
368
+ /** Information about an existing message template. */
369
+ export interface TemplateInfo {
370
+ /** Template ID. */
371
+ id: string;
372
+ /** Template name. */
373
+ name: string;
374
+ /** BCP 47 language code. */
375
+ language: string;
376
+ /** Approval status (e.g. `"APPROVED"`, `"PENDING"`, `"REJECTED"`). */
377
+ status: string;
378
+ /** Template category. */
379
+ category: string;
380
+ /** Template components. */
381
+ components: TemplateDefinitionComponent[];
382
+ }
383
+ /** Input for creating a new WhatsApp Flow. */
384
+ export interface FlowDefinition {
385
+ /** Flow name. */
386
+ name: string;
387
+ /** Flow categories. */
388
+ categories?: string[];
389
+ /** Clone from an existing flow. */
390
+ clone_flow_id?: string;
391
+ }
392
+ /** Information about an existing WhatsApp Flow. */
393
+ export interface FlowInfo {
394
+ /** Flow ID. */
395
+ id: string;
396
+ /** Flow name. */
397
+ name: string;
398
+ /** Flow status (e.g. `"DRAFT"`, `"PUBLISHED"`, `"DEPRECATED"`). */
399
+ status: string;
400
+ /** Flow categories. */
401
+ categories: string[];
402
+ }
403
+ /** Assets associated with a WhatsApp Flow. */
404
+ export interface FlowAssets {
405
+ /** Array of flow asset entries. */
406
+ data: Array<{
407
+ /** Asset name (usually `"flow.json"`). */
408
+ name: string;
409
+ /** Asset type identifier. */
410
+ asset_type: string;
411
+ /** URL to download the asset. */
412
+ download_url: string;
413
+ }>;
414
+ }
415
+ /** Response from the WhatsApp media info endpoint. */
416
+ export interface WhatsAppMediaResponse {
417
+ /** Media ID. */
418
+ id: string;
419
+ /** Temporary download URL (valid for a short period). */
420
+ url: string;
421
+ /** MIME type of the media. */
422
+ mime_type: string;
423
+ /** SHA-256 hash of the media content. */
424
+ sha256: string;
425
+ /** File size in bytes. */
426
+ file_size: number;
427
+ }
428
+ /**
429
+ * Options for the {@link WhatsAppClient.sendTextOrTemplate} method.
430
+ *
431
+ * Attempts to send a free-form text message first; if the 24-hour window
432
+ * has closed, falls back to the specified template.
433
+ */
434
+ export interface TextOrTemplateOptions {
435
+ /** The text message to attempt first. */
436
+ text: string;
437
+ /** The template to fall back to if the messaging window is closed. */
438
+ fallbackTemplate: TemplateMessage;
439
+ }
440
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/whatsapp/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAMtE;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,aAAa,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7B,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzC,iEAAiE;IACjE,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD,kEAA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,iCAAiC;QACjC,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;CACJ;AAMD,sDAAsD;AACtD,MAAM,WAAW,qBAAqB;IACpC,gBAAgB;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAC;IACZ,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,gBAAgB,EAAE,eAAe,CAAC;CACnC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @module whatsapp/types
3
+ *
4
+ * Comprehensive TypeScript types mirroring Meta's WhatsApp Cloud API.
5
+ *
6
+ * These types cover configuration, message payloads (text, media, interactive,
7
+ * template, location, contacts), business profile management, WhatsApp Flows,
8
+ * and API response shapes.
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/whatsapp/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@ariaflowagents/messaging-meta",
3
+ "version": "0.8.1",
4
+ "description": "Meta platform clients (WhatsApp, Messenger, Instagram) for AriaFlow messaging",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
10
+ "./whatsapp": { "types": "./dist/whatsapp/index.d.ts", "default": "./dist/whatsapp/index.js" },
11
+ "./messenger": { "types": "./dist/messenger/index.d.ts", "default": "./dist/messenger/index.js" },
12
+ "./instagram": { "types": "./dist/instagram/index.d.ts", "default": "./dist/instagram/index.js" },
13
+ "./server": { "types": "./dist/server.d.ts", "default": "./dist/server.js" }
14
+ },
15
+ "publishConfig": { "access": "public" },
16
+ "files": ["dist", "README.md"],
17
+ "scripts": {
18
+ "build": "tsc -p tsconfig.json",
19
+ "clean": "rm -rf dist",
20
+ "test": "bun test",
21
+ "prepublishOnly": "npm run clean && npm run build"
22
+ },
23
+ "dependencies": {
24
+ "@ariaflowagents/messaging": "^0.8.0"
25
+ },
26
+ "devDependencies": {
27
+ "@ariaflowagents/messaging": "workspace:*",
28
+ "typescript": "^5.8.2",
29
+ "@types/node": "^22.13.4"
30
+ }
31
+ }