@samva/webhooks 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/effect.js +4 -4
- package/dist/{json-schemas.gen-BPULV030.js → json-schemas.gen-CPzGmYvg.js} +1362 -17
- package/dist/promise.js +2 -2
- package/dist/protocol-8ERuoP0F.js +730 -0
- package/dist/protocol.js +1 -1
- package/dist/schemas.gen.d.ts +756 -32
- package/dist/schemas.gen.js +580 -17
- package/dist/types.gen.d.ts +515 -17
- package/package.json +1 -1
- package/dist/protocol-D0_izLnI.js +0 -591
package/dist/types.gen.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type MessageSentEvent = {
|
|
|
6
6
|
readonly timestamp: string;
|
|
7
7
|
readonly data: {
|
|
8
8
|
readonly mailboxId?: string | null;
|
|
9
|
-
readonly channel: "email";
|
|
9
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
10
10
|
readonly status?: string | null;
|
|
11
11
|
readonly metadata?: {
|
|
12
12
|
readonly [x: string]: JsonValue;
|
|
@@ -19,16 +19,21 @@ export type MessageSentEvent = {
|
|
|
19
19
|
readonly conversationId?: string | null;
|
|
20
20
|
readonly isBillable?: boolean | null;
|
|
21
21
|
readonly messageType?: string | null;
|
|
22
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
22
23
|
readonly subject?: string | null;
|
|
23
24
|
readonly toEmails?: ReadonlyArray<string> | null;
|
|
24
25
|
readonly providerMessageId?: string | null;
|
|
26
|
+
readonly waId?: string | null;
|
|
25
27
|
readonly hasAttachments?: boolean | null;
|
|
26
28
|
readonly isAutoReply?: boolean | null;
|
|
29
|
+
readonly segments?: number | null;
|
|
27
30
|
readonly to?: string | null;
|
|
28
31
|
readonly from?: string | null;
|
|
29
32
|
readonly body?: string | null;
|
|
30
33
|
readonly direction?: "inbound" | "outbound" | null;
|
|
31
34
|
readonly errorMessage?: string | null;
|
|
35
|
+
readonly parts?: number | null;
|
|
36
|
+
readonly carrier?: string | null;
|
|
32
37
|
readonly messageId: string;
|
|
33
38
|
readonly organizationId: string;
|
|
34
39
|
} & {
|
|
@@ -43,7 +48,7 @@ export type MessageDeliveredEvent = {
|
|
|
43
48
|
readonly timestamp: string;
|
|
44
49
|
readonly data: {
|
|
45
50
|
readonly mailboxId?: string | null;
|
|
46
|
-
readonly channel: "email";
|
|
51
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
47
52
|
readonly status?: string | null;
|
|
48
53
|
readonly metadata?: {
|
|
49
54
|
readonly [x: string]: JsonValue;
|
|
@@ -56,16 +61,21 @@ export type MessageDeliveredEvent = {
|
|
|
56
61
|
readonly conversationId?: string | null;
|
|
57
62
|
readonly isBillable?: boolean | null;
|
|
58
63
|
readonly messageType?: string | null;
|
|
64
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
59
65
|
readonly subject?: string | null;
|
|
60
66
|
readonly toEmails?: ReadonlyArray<string> | null;
|
|
61
67
|
readonly providerMessageId?: string | null;
|
|
68
|
+
readonly waId?: string | null;
|
|
62
69
|
readonly hasAttachments?: boolean | null;
|
|
63
70
|
readonly isAutoReply?: boolean | null;
|
|
71
|
+
readonly segments?: number | null;
|
|
64
72
|
readonly to?: string | null;
|
|
65
73
|
readonly from?: string | null;
|
|
66
74
|
readonly body?: string | null;
|
|
67
75
|
readonly direction?: "inbound" | "outbound" | null;
|
|
68
76
|
readonly errorMessage?: string | null;
|
|
77
|
+
readonly parts?: number | null;
|
|
78
|
+
readonly carrier?: string | null;
|
|
69
79
|
readonly messageId: string;
|
|
70
80
|
readonly organizationId: string;
|
|
71
81
|
} & {
|
|
@@ -75,12 +85,54 @@ export type MessageDeliveredEvent = {
|
|
|
75
85
|
readonly [x: string]: JsonValue;
|
|
76
86
|
};
|
|
77
87
|
export type MessageDeliveredPayload = MessageDeliveredEvent["data"];
|
|
88
|
+
export type MessageReadEvent = {
|
|
89
|
+
readonly type: "message.read";
|
|
90
|
+
readonly timestamp: string;
|
|
91
|
+
readonly data: {
|
|
92
|
+
readonly mailboxId?: string | null;
|
|
93
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
94
|
+
readonly status?: string | null;
|
|
95
|
+
readonly metadata?: {
|
|
96
|
+
readonly [x: string]: JsonValue;
|
|
97
|
+
} | null;
|
|
98
|
+
readonly cost?: number | null;
|
|
99
|
+
readonly recipient?: string | null;
|
|
100
|
+
readonly occurredAt?: string | null;
|
|
101
|
+
readonly failureReason?: string | null;
|
|
102
|
+
readonly errorCode?: string | null;
|
|
103
|
+
readonly conversationId?: string | null;
|
|
104
|
+
readonly isBillable?: boolean | null;
|
|
105
|
+
readonly messageType?: string | null;
|
|
106
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
107
|
+
readonly subject?: string | null;
|
|
108
|
+
readonly toEmails?: ReadonlyArray<string> | null;
|
|
109
|
+
readonly providerMessageId?: string | null;
|
|
110
|
+
readonly waId?: string | null;
|
|
111
|
+
readonly hasAttachments?: boolean | null;
|
|
112
|
+
readonly isAutoReply?: boolean | null;
|
|
113
|
+
readonly segments?: number | null;
|
|
114
|
+
readonly to?: string | null;
|
|
115
|
+
readonly from?: string | null;
|
|
116
|
+
readonly body?: string | null;
|
|
117
|
+
readonly direction?: "inbound" | "outbound" | null;
|
|
118
|
+
readonly errorMessage?: string | null;
|
|
119
|
+
readonly parts?: number | null;
|
|
120
|
+
readonly carrier?: string | null;
|
|
121
|
+
readonly messageId: string;
|
|
122
|
+
readonly organizationId: string;
|
|
123
|
+
} & {
|
|
124
|
+
readonly [x: string]: JsonValue;
|
|
125
|
+
};
|
|
126
|
+
} & {
|
|
127
|
+
readonly [x: string]: JsonValue;
|
|
128
|
+
};
|
|
129
|
+
export type MessageReadPayload = MessageReadEvent["data"];
|
|
78
130
|
export type MessageFailedEvent = {
|
|
79
131
|
readonly type: "message.failed";
|
|
80
132
|
readonly timestamp: string;
|
|
81
133
|
readonly data: {
|
|
82
134
|
readonly mailboxId?: string | null;
|
|
83
|
-
readonly channel: "email";
|
|
135
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
84
136
|
readonly status?: string | null;
|
|
85
137
|
readonly metadata?: {
|
|
86
138
|
readonly [x: string]: JsonValue;
|
|
@@ -93,16 +145,21 @@ export type MessageFailedEvent = {
|
|
|
93
145
|
readonly conversationId?: string | null;
|
|
94
146
|
readonly isBillable?: boolean | null;
|
|
95
147
|
readonly messageType?: string | null;
|
|
148
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
96
149
|
readonly subject?: string | null;
|
|
97
150
|
readonly toEmails?: ReadonlyArray<string> | null;
|
|
98
151
|
readonly providerMessageId?: string | null;
|
|
152
|
+
readonly waId?: string | null;
|
|
99
153
|
readonly hasAttachments?: boolean | null;
|
|
100
154
|
readonly isAutoReply?: boolean | null;
|
|
155
|
+
readonly segments?: number | null;
|
|
101
156
|
readonly to?: string | null;
|
|
102
157
|
readonly from?: string | null;
|
|
103
158
|
readonly body?: string | null;
|
|
104
159
|
readonly direction?: "inbound" | "outbound" | null;
|
|
105
160
|
readonly errorMessage?: string | null;
|
|
161
|
+
readonly parts?: number | null;
|
|
162
|
+
readonly carrier?: string | null;
|
|
106
163
|
readonly messageId: string;
|
|
107
164
|
readonly organizationId: string;
|
|
108
165
|
} & {
|
|
@@ -117,7 +174,7 @@ export type MessageBouncedEvent = {
|
|
|
117
174
|
readonly timestamp: string;
|
|
118
175
|
readonly data: {
|
|
119
176
|
readonly mailboxId?: string | null;
|
|
120
|
-
readonly channel: "email";
|
|
177
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
121
178
|
readonly status?: string | null;
|
|
122
179
|
readonly metadata?: {
|
|
123
180
|
readonly [x: string]: JsonValue;
|
|
@@ -130,16 +187,21 @@ export type MessageBouncedEvent = {
|
|
|
130
187
|
readonly conversationId?: string | null;
|
|
131
188
|
readonly isBillable?: boolean | null;
|
|
132
189
|
readonly messageType?: string | null;
|
|
190
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
133
191
|
readonly subject?: string | null;
|
|
134
192
|
readonly toEmails?: ReadonlyArray<string> | null;
|
|
135
193
|
readonly providerMessageId?: string | null;
|
|
194
|
+
readonly waId?: string | null;
|
|
136
195
|
readonly hasAttachments?: boolean | null;
|
|
137
196
|
readonly isAutoReply?: boolean | null;
|
|
197
|
+
readonly segments?: number | null;
|
|
138
198
|
readonly to?: string | null;
|
|
139
199
|
readonly from?: string | null;
|
|
140
200
|
readonly body?: string | null;
|
|
141
201
|
readonly direction?: "inbound" | "outbound" | null;
|
|
142
202
|
readonly errorMessage?: string | null;
|
|
203
|
+
readonly parts?: number | null;
|
|
204
|
+
readonly carrier?: string | null;
|
|
143
205
|
readonly messageId: string;
|
|
144
206
|
readonly organizationId: string;
|
|
145
207
|
} & {
|
|
@@ -154,7 +216,7 @@ export type MessageComplainedEvent = {
|
|
|
154
216
|
readonly timestamp: string;
|
|
155
217
|
readonly data: {
|
|
156
218
|
readonly mailboxId?: string | null;
|
|
157
|
-
readonly channel: "email";
|
|
219
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
158
220
|
readonly status?: string | null;
|
|
159
221
|
readonly metadata?: {
|
|
160
222
|
readonly [x: string]: JsonValue;
|
|
@@ -167,16 +229,21 @@ export type MessageComplainedEvent = {
|
|
|
167
229
|
readonly conversationId?: string | null;
|
|
168
230
|
readonly isBillable?: boolean | null;
|
|
169
231
|
readonly messageType?: string | null;
|
|
232
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
170
233
|
readonly subject?: string | null;
|
|
171
234
|
readonly toEmails?: ReadonlyArray<string> | null;
|
|
172
235
|
readonly providerMessageId?: string | null;
|
|
236
|
+
readonly waId?: string | null;
|
|
173
237
|
readonly hasAttachments?: boolean | null;
|
|
174
238
|
readonly isAutoReply?: boolean | null;
|
|
239
|
+
readonly segments?: number | null;
|
|
175
240
|
readonly to?: string | null;
|
|
176
241
|
readonly from?: string | null;
|
|
177
242
|
readonly body?: string | null;
|
|
178
243
|
readonly direction?: "inbound" | "outbound" | null;
|
|
179
244
|
readonly errorMessage?: string | null;
|
|
245
|
+
readonly parts?: number | null;
|
|
246
|
+
readonly carrier?: string | null;
|
|
180
247
|
readonly messageId: string;
|
|
181
248
|
readonly organizationId: string;
|
|
182
249
|
} & {
|
|
@@ -191,7 +258,7 @@ export type MessageReceivedEvent = {
|
|
|
191
258
|
readonly timestamp: string;
|
|
192
259
|
readonly data: {
|
|
193
260
|
readonly mailboxId?: string | null;
|
|
194
|
-
readonly channel: "email";
|
|
261
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
195
262
|
readonly status?: string | null;
|
|
196
263
|
readonly metadata?: {
|
|
197
264
|
readonly [x: string]: JsonValue;
|
|
@@ -204,16 +271,337 @@ export type MessageReceivedEvent = {
|
|
|
204
271
|
readonly conversationId?: string | null;
|
|
205
272
|
readonly isBillable?: boolean | null;
|
|
206
273
|
readonly messageType?: string | null;
|
|
274
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
207
275
|
readonly subject?: string | null;
|
|
208
276
|
readonly toEmails?: ReadonlyArray<string> | null;
|
|
209
277
|
readonly providerMessageId?: string | null;
|
|
278
|
+
readonly waId?: string | null;
|
|
210
279
|
readonly hasAttachments?: boolean | null;
|
|
211
280
|
readonly isAutoReply?: boolean | null;
|
|
281
|
+
readonly segments?: number | null;
|
|
212
282
|
readonly to?: string | null;
|
|
213
283
|
readonly from?: string | null;
|
|
214
284
|
readonly body?: string | null;
|
|
215
285
|
readonly direction?: "inbound" | "outbound" | null;
|
|
216
286
|
readonly errorMessage?: string | null;
|
|
287
|
+
readonly parts?: number | null;
|
|
288
|
+
readonly carrier?: string | null;
|
|
289
|
+
readonly whatsapp?: ({
|
|
290
|
+
readonly text?: string | null;
|
|
291
|
+
readonly template?: ({
|
|
292
|
+
readonly name: string;
|
|
293
|
+
readonly language: string;
|
|
294
|
+
readonly components: ReadonlyArray<{
|
|
295
|
+
readonly type: "header" | "body" | "footer" | "button";
|
|
296
|
+
readonly sub_type?: "url" | "quick_reply" | "copy_code" | "flow" | null;
|
|
297
|
+
readonly index?: string | null;
|
|
298
|
+
readonly parameters: ReadonlyArray<{
|
|
299
|
+
readonly type: "text" | "currency" | "date_time" | "image" | "document" | "video" | "coupon_code" | "action";
|
|
300
|
+
readonly text?: string | null;
|
|
301
|
+
readonly currency?: ({
|
|
302
|
+
readonly fallback_value: string;
|
|
303
|
+
readonly code: string;
|
|
304
|
+
readonly amount_1000: number;
|
|
305
|
+
} & {
|
|
306
|
+
readonly [x: string]: JsonValue;
|
|
307
|
+
}) | null;
|
|
308
|
+
readonly date_time?: ({
|
|
309
|
+
readonly fallback_value: string;
|
|
310
|
+
} & {
|
|
311
|
+
readonly [x: string]: JsonValue;
|
|
312
|
+
}) | null;
|
|
313
|
+
readonly image?: ({
|
|
314
|
+
readonly link: string;
|
|
315
|
+
} & {
|
|
316
|
+
readonly [x: string]: JsonValue;
|
|
317
|
+
}) | null;
|
|
318
|
+
readonly document?: ({
|
|
319
|
+
readonly link: string;
|
|
320
|
+
readonly filename?: string | null;
|
|
321
|
+
} & {
|
|
322
|
+
readonly [x: string]: JsonValue;
|
|
323
|
+
}) | null;
|
|
324
|
+
readonly video?: ({
|
|
325
|
+
readonly link: string;
|
|
326
|
+
} & {
|
|
327
|
+
readonly [x: string]: JsonValue;
|
|
328
|
+
}) | null;
|
|
329
|
+
readonly coupon_code?: string | null;
|
|
330
|
+
readonly action?: ({
|
|
331
|
+
readonly flow_token: string;
|
|
332
|
+
} & {
|
|
333
|
+
readonly [x: string]: JsonValue;
|
|
334
|
+
}) | null;
|
|
335
|
+
} & {
|
|
336
|
+
readonly [x: string]: JsonValue;
|
|
337
|
+
}>;
|
|
338
|
+
} & {
|
|
339
|
+
readonly [x: string]: JsonValue;
|
|
340
|
+
}>;
|
|
341
|
+
} & {
|
|
342
|
+
readonly [x: string]: JsonValue;
|
|
343
|
+
}) | null;
|
|
344
|
+
readonly interactive?: ({
|
|
345
|
+
readonly type: "buttons";
|
|
346
|
+
readonly header?: ({
|
|
347
|
+
readonly type: "text";
|
|
348
|
+
readonly text: string;
|
|
349
|
+
} & {
|
|
350
|
+
readonly [x: string]: JsonValue;
|
|
351
|
+
}) | ({
|
|
352
|
+
readonly type: "image";
|
|
353
|
+
readonly url: string;
|
|
354
|
+
} & {
|
|
355
|
+
readonly [x: string]: JsonValue;
|
|
356
|
+
}) | ({
|
|
357
|
+
readonly type: "image";
|
|
358
|
+
readonly mediaId: string;
|
|
359
|
+
} & {
|
|
360
|
+
readonly [x: string]: JsonValue;
|
|
361
|
+
}) | ({
|
|
362
|
+
readonly type: "video";
|
|
363
|
+
readonly url: string;
|
|
364
|
+
} & {
|
|
365
|
+
readonly [x: string]: JsonValue;
|
|
366
|
+
}) | ({
|
|
367
|
+
readonly type: "video";
|
|
368
|
+
readonly mediaId: string;
|
|
369
|
+
} & {
|
|
370
|
+
readonly [x: string]: JsonValue;
|
|
371
|
+
}) | ({
|
|
372
|
+
readonly type: "document";
|
|
373
|
+
readonly filename?: string;
|
|
374
|
+
readonly url: string;
|
|
375
|
+
} & {
|
|
376
|
+
readonly [x: string]: JsonValue;
|
|
377
|
+
}) | ({
|
|
378
|
+
readonly type: "document";
|
|
379
|
+
readonly filename?: string;
|
|
380
|
+
readonly mediaId: string;
|
|
381
|
+
} & {
|
|
382
|
+
readonly [x: string]: JsonValue;
|
|
383
|
+
});
|
|
384
|
+
readonly body: string;
|
|
385
|
+
readonly footer?: string;
|
|
386
|
+
readonly buttons: ReadonlyArray<{
|
|
387
|
+
readonly id: string;
|
|
388
|
+
readonly title: string;
|
|
389
|
+
} & {
|
|
390
|
+
readonly [x: string]: JsonValue;
|
|
391
|
+
}>;
|
|
392
|
+
} & {
|
|
393
|
+
readonly [x: string]: JsonValue;
|
|
394
|
+
}) | ({
|
|
395
|
+
readonly type: "list";
|
|
396
|
+
readonly header?: {
|
|
397
|
+
readonly type: "text";
|
|
398
|
+
readonly text: string;
|
|
399
|
+
} & {
|
|
400
|
+
readonly [x: string]: JsonValue;
|
|
401
|
+
};
|
|
402
|
+
readonly body: string;
|
|
403
|
+
readonly footer?: string;
|
|
404
|
+
readonly button: string;
|
|
405
|
+
readonly sections: ReadonlyArray<{
|
|
406
|
+
readonly title?: string;
|
|
407
|
+
readonly rows: ReadonlyArray<{
|
|
408
|
+
readonly id: string;
|
|
409
|
+
readonly title: string;
|
|
410
|
+
readonly description?: string;
|
|
411
|
+
} & {
|
|
412
|
+
readonly [x: string]: JsonValue;
|
|
413
|
+
}>;
|
|
414
|
+
} & {
|
|
415
|
+
readonly [x: string]: JsonValue;
|
|
416
|
+
}>;
|
|
417
|
+
} & {
|
|
418
|
+
readonly [x: string]: JsonValue;
|
|
419
|
+
}) | ({
|
|
420
|
+
readonly type: "cta_url";
|
|
421
|
+
readonly header?: ({
|
|
422
|
+
readonly type: "text";
|
|
423
|
+
readonly text: string;
|
|
424
|
+
} & {
|
|
425
|
+
readonly [x: string]: JsonValue;
|
|
426
|
+
}) | ({
|
|
427
|
+
readonly type: "image";
|
|
428
|
+
readonly url: string;
|
|
429
|
+
} & {
|
|
430
|
+
readonly [x: string]: JsonValue;
|
|
431
|
+
}) | ({
|
|
432
|
+
readonly type: "image";
|
|
433
|
+
readonly mediaId: string;
|
|
434
|
+
} & {
|
|
435
|
+
readonly [x: string]: JsonValue;
|
|
436
|
+
}) | ({
|
|
437
|
+
readonly type: "video";
|
|
438
|
+
readonly url: string;
|
|
439
|
+
} & {
|
|
440
|
+
readonly [x: string]: JsonValue;
|
|
441
|
+
}) | ({
|
|
442
|
+
readonly type: "video";
|
|
443
|
+
readonly mediaId: string;
|
|
444
|
+
} & {
|
|
445
|
+
readonly [x: string]: JsonValue;
|
|
446
|
+
}) | ({
|
|
447
|
+
readonly type: "document";
|
|
448
|
+
readonly filename?: string;
|
|
449
|
+
readonly url: string;
|
|
450
|
+
} & {
|
|
451
|
+
readonly [x: string]: JsonValue;
|
|
452
|
+
}) | ({
|
|
453
|
+
readonly type: "document";
|
|
454
|
+
readonly filename?: string;
|
|
455
|
+
readonly mediaId: string;
|
|
456
|
+
} & {
|
|
457
|
+
readonly [x: string]: JsonValue;
|
|
458
|
+
});
|
|
459
|
+
readonly body: string;
|
|
460
|
+
readonly footer?: string;
|
|
461
|
+
readonly displayText: string;
|
|
462
|
+
readonly url: string;
|
|
463
|
+
} & {
|
|
464
|
+
readonly [x: string]: JsonValue;
|
|
465
|
+
}) | ({
|
|
466
|
+
readonly type: "flow";
|
|
467
|
+
readonly header?: {
|
|
468
|
+
readonly type: "text";
|
|
469
|
+
readonly text: string;
|
|
470
|
+
} & {
|
|
471
|
+
readonly [x: string]: JsonValue;
|
|
472
|
+
};
|
|
473
|
+
readonly body: string;
|
|
474
|
+
readonly footer?: string;
|
|
475
|
+
readonly flowId: string;
|
|
476
|
+
readonly cta: string;
|
|
477
|
+
readonly token?: string;
|
|
478
|
+
readonly action?: "navigate" | "data_exchange";
|
|
479
|
+
readonly screen?: string;
|
|
480
|
+
readonly data?: {
|
|
481
|
+
readonly [x: string]: JsonValue;
|
|
482
|
+
};
|
|
483
|
+
readonly flowVersionId: string;
|
|
484
|
+
readonly providerFlowId: string;
|
|
485
|
+
} & {
|
|
486
|
+
readonly [x: string]: JsonValue;
|
|
487
|
+
});
|
|
488
|
+
readonly media?: ({
|
|
489
|
+
readonly type: "image" | "video" | "audio" | "document" | "sticker";
|
|
490
|
+
readonly url: string;
|
|
491
|
+
readonly caption?: string;
|
|
492
|
+
readonly filename?: string;
|
|
493
|
+
} & {
|
|
494
|
+
readonly [x: string]: JsonValue;
|
|
495
|
+
}) | ({
|
|
496
|
+
readonly type: "image" | "video" | "audio" | "document" | "sticker";
|
|
497
|
+
readonly mediaId: string;
|
|
498
|
+
readonly caption?: string;
|
|
499
|
+
readonly filename?: string;
|
|
500
|
+
} & {
|
|
501
|
+
readonly [x: string]: JsonValue;
|
|
502
|
+
}) | ({
|
|
503
|
+
readonly type: "image" | "video" | "audio" | "document" | "sticker";
|
|
504
|
+
readonly providerMediaId: string;
|
|
505
|
+
readonly mimeType?: string | null;
|
|
506
|
+
readonly caption?: string | null;
|
|
507
|
+
readonly filename?: string;
|
|
508
|
+
} & {
|
|
509
|
+
readonly [x: string]: JsonValue;
|
|
510
|
+
}) | null;
|
|
511
|
+
readonly reaction?: {
|
|
512
|
+
readonly messageId: string | null;
|
|
513
|
+
readonly providerMessageId: string;
|
|
514
|
+
readonly emoji: string | null;
|
|
515
|
+
} & {
|
|
516
|
+
readonly [x: string]: JsonValue;
|
|
517
|
+
};
|
|
518
|
+
readonly location?: {
|
|
519
|
+
readonly latitude: number;
|
|
520
|
+
readonly longitude: number;
|
|
521
|
+
readonly name?: string;
|
|
522
|
+
readonly address?: string;
|
|
523
|
+
readonly url?: string;
|
|
524
|
+
} & {
|
|
525
|
+
readonly [x: string]: JsonValue;
|
|
526
|
+
};
|
|
527
|
+
readonly contacts?: ReadonlyArray<{
|
|
528
|
+
readonly name?: {
|
|
529
|
+
readonly formattedName?: string;
|
|
530
|
+
readonly firstName?: string;
|
|
531
|
+
readonly lastName?: string;
|
|
532
|
+
readonly middleName?: string;
|
|
533
|
+
readonly prefix?: string;
|
|
534
|
+
readonly suffix?: string;
|
|
535
|
+
} & {
|
|
536
|
+
readonly [x: string]: JsonValue;
|
|
537
|
+
};
|
|
538
|
+
readonly phones?: ReadonlyArray<{
|
|
539
|
+
readonly phone?: string;
|
|
540
|
+
readonly type?: string;
|
|
541
|
+
readonly waId?: string;
|
|
542
|
+
} & {
|
|
543
|
+
readonly [x: string]: JsonValue;
|
|
544
|
+
}>;
|
|
545
|
+
readonly emails?: ReadonlyArray<{
|
|
546
|
+
readonly email?: string;
|
|
547
|
+
readonly type?: string;
|
|
548
|
+
} & {
|
|
549
|
+
readonly [x: string]: JsonValue;
|
|
550
|
+
}>;
|
|
551
|
+
readonly urls?: ReadonlyArray<{
|
|
552
|
+
readonly url?: string;
|
|
553
|
+
readonly type?: string;
|
|
554
|
+
} & {
|
|
555
|
+
readonly [x: string]: JsonValue;
|
|
556
|
+
}>;
|
|
557
|
+
readonly org?: {
|
|
558
|
+
readonly company?: string;
|
|
559
|
+
readonly department?: string;
|
|
560
|
+
readonly title?: string;
|
|
561
|
+
} & {
|
|
562
|
+
readonly [x: string]: JsonValue;
|
|
563
|
+
};
|
|
564
|
+
readonly addresses?: ReadonlyArray<{
|
|
565
|
+
readonly street?: string;
|
|
566
|
+
readonly city?: string;
|
|
567
|
+
readonly state?: string;
|
|
568
|
+
readonly zip?: string;
|
|
569
|
+
readonly country?: string;
|
|
570
|
+
readonly countryCode?: string;
|
|
571
|
+
readonly type?: string;
|
|
572
|
+
} & {
|
|
573
|
+
readonly [x: string]: JsonValue;
|
|
574
|
+
}>;
|
|
575
|
+
readonly birthday?: string;
|
|
576
|
+
} & {
|
|
577
|
+
readonly [x: string]: JsonValue;
|
|
578
|
+
}>;
|
|
579
|
+
readonly reply?: {
|
|
580
|
+
readonly type: "button" | "list" | "template_button";
|
|
581
|
+
readonly id: string;
|
|
582
|
+
readonly title: string;
|
|
583
|
+
readonly description?: string;
|
|
584
|
+
} & {
|
|
585
|
+
readonly [x: string]: JsonValue;
|
|
586
|
+
};
|
|
587
|
+
readonly flowResponse?: {
|
|
588
|
+
readonly flowToken: string | null;
|
|
589
|
+
readonly response: {
|
|
590
|
+
readonly [x: string]: JsonValue;
|
|
591
|
+
};
|
|
592
|
+
readonly body?: string;
|
|
593
|
+
} & {
|
|
594
|
+
readonly [x: string]: JsonValue;
|
|
595
|
+
};
|
|
596
|
+
readonly context?: {
|
|
597
|
+
readonly messageId: string | null;
|
|
598
|
+
readonly providerMessageId: string;
|
|
599
|
+
} & {
|
|
600
|
+
readonly [x: string]: JsonValue;
|
|
601
|
+
};
|
|
602
|
+
} & {
|
|
603
|
+
readonly [x: string]: JsonValue;
|
|
604
|
+
}) | null;
|
|
217
605
|
readonly messageId: string;
|
|
218
606
|
readonly organizationId: string;
|
|
219
607
|
} & {
|
|
@@ -459,7 +847,7 @@ export type ContactConsentChangedEvent = {
|
|
|
459
847
|
} & {
|
|
460
848
|
readonly [x: string]: JsonValue;
|
|
461
849
|
};
|
|
462
|
-
readonly channel: "email";
|
|
850
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
463
851
|
readonly status: "opted_in" | "opted_out";
|
|
464
852
|
readonly previousStatus: "opted_in" | "opted_out" | null;
|
|
465
853
|
readonly source: string;
|
|
@@ -478,8 +866,8 @@ export type ConversationCreatedEvent = {
|
|
|
478
866
|
readonly conversationId: string;
|
|
479
867
|
readonly organizationId: string;
|
|
480
868
|
readonly title?: string | null | null;
|
|
481
|
-
readonly channels: ReadonlyArray<"email">;
|
|
482
|
-
readonly primaryChannel: "email";
|
|
869
|
+
readonly channels: ReadonlyArray<"sms" | "whatsapp" | "email">;
|
|
870
|
+
readonly primaryChannel: "sms" | "whatsapp" | "email";
|
|
483
871
|
readonly status: "active" | "waiting" | "resolved" | "escalated" | "archived";
|
|
484
872
|
readonly primaryContactId?: string | null | null;
|
|
485
873
|
readonly createdAt: string;
|
|
@@ -498,8 +886,8 @@ export type ConversationUpdatedEvent = {
|
|
|
498
886
|
readonly conversationId: string;
|
|
499
887
|
readonly organizationId: string;
|
|
500
888
|
readonly title?: string | null | null;
|
|
501
|
-
readonly channels: ReadonlyArray<"email">;
|
|
502
|
-
readonly primaryChannel: "email";
|
|
889
|
+
readonly channels: ReadonlyArray<"sms" | "whatsapp" | "email">;
|
|
890
|
+
readonly primaryChannel: "sms" | "whatsapp" | "email";
|
|
503
891
|
readonly status: "active" | "waiting" | "resolved" | "escalated" | "archived";
|
|
504
892
|
readonly primaryContactId?: string | null | null;
|
|
505
893
|
readonly createdAt: string;
|
|
@@ -518,8 +906,8 @@ export type ConversationArchivedEvent = {
|
|
|
518
906
|
readonly conversationId: string;
|
|
519
907
|
readonly organizationId: string;
|
|
520
908
|
readonly title?: string | null | null;
|
|
521
|
-
readonly channels: ReadonlyArray<"email">;
|
|
522
|
-
readonly primaryChannel: "email";
|
|
909
|
+
readonly channels: ReadonlyArray<"sms" | "whatsapp" | "email">;
|
|
910
|
+
readonly primaryChannel: "sms" | "whatsapp" | "email";
|
|
523
911
|
readonly status: "active" | "waiting" | "resolved" | "escalated" | "archived";
|
|
524
912
|
readonly primaryContactId?: string | null | null;
|
|
525
913
|
readonly createdAt: string;
|
|
@@ -675,6 +1063,116 @@ export type DomainWarmingUpdatedEvent = {
|
|
|
675
1063
|
readonly [x: string]: JsonValue;
|
|
676
1064
|
};
|
|
677
1065
|
export type DomainWarmingUpdatedPayload = DomainWarmingUpdatedEvent["data"];
|
|
1066
|
+
export type TemplateRegistrationUpdatedEvent = {
|
|
1067
|
+
readonly type: "template.registration.updated";
|
|
1068
|
+
readonly timestamp: string;
|
|
1069
|
+
readonly data: {
|
|
1070
|
+
readonly id: string;
|
|
1071
|
+
readonly templateId: string;
|
|
1072
|
+
readonly publicationId: string;
|
|
1073
|
+
readonly target: ({
|
|
1074
|
+
readonly provider: "whatsapp";
|
|
1075
|
+
readonly wabaId: string;
|
|
1076
|
+
} & {
|
|
1077
|
+
readonly [x: string]: JsonValue;
|
|
1078
|
+
}) | ({
|
|
1079
|
+
readonly provider: "dlt";
|
|
1080
|
+
readonly entityId: string;
|
|
1081
|
+
readonly headerId: string;
|
|
1082
|
+
} & {
|
|
1083
|
+
readonly [x: string]: JsonValue;
|
|
1084
|
+
});
|
|
1085
|
+
readonly name: string;
|
|
1086
|
+
readonly language: string;
|
|
1087
|
+
readonly status: "draft" | "submitted" | "approved" | "rejected" | "paused" | "disabled";
|
|
1088
|
+
readonly category: "marketing" | "utility" | "authentication" | "transactional" | "service_implicit" | "service_explicit" | "promotional";
|
|
1089
|
+
readonly providerCategory: "marketing" | "utility" | "authentication" | "transactional" | "service_implicit" | "service_explicit" | "promotional" | null;
|
|
1090
|
+
readonly providerTemplateId: string | null;
|
|
1091
|
+
readonly reason: string | null;
|
|
1092
|
+
readonly submittedAt: string | null;
|
|
1093
|
+
readonly statusChangedAt: string;
|
|
1094
|
+
readonly createdAt: string;
|
|
1095
|
+
readonly updatedAt: string;
|
|
1096
|
+
readonly organizationId: string;
|
|
1097
|
+
readonly previousStatus: "draft" | "submitted" | "approved" | "rejected" | "paused" | "disabled";
|
|
1098
|
+
} & {
|
|
1099
|
+
readonly [x: string]: JsonValue;
|
|
1100
|
+
};
|
|
1101
|
+
} & {
|
|
1102
|
+
readonly [x: string]: JsonValue;
|
|
1103
|
+
};
|
|
1104
|
+
export type TemplateRegistrationUpdatedPayload = TemplateRegistrationUpdatedEvent["data"];
|
|
1105
|
+
export type FlowRegistrationUpdatedEvent = {
|
|
1106
|
+
readonly type: "flow.registration.updated";
|
|
1107
|
+
readonly timestamp: string;
|
|
1108
|
+
readonly data: {
|
|
1109
|
+
readonly id: string;
|
|
1110
|
+
readonly flowId: string;
|
|
1111
|
+
readonly versionId: string;
|
|
1112
|
+
readonly versionNumber: number;
|
|
1113
|
+
readonly wabaId: string;
|
|
1114
|
+
readonly providerFlowId: string | null;
|
|
1115
|
+
readonly name: string;
|
|
1116
|
+
readonly status: "draft" | "published" | "throttled" | "blocked" | "deprecated";
|
|
1117
|
+
readonly validationErrors: ReadonlyArray<{
|
|
1118
|
+
readonly error: string;
|
|
1119
|
+
readonly message: string;
|
|
1120
|
+
readonly path?: string;
|
|
1121
|
+
readonly line?: number;
|
|
1122
|
+
readonly column?: number;
|
|
1123
|
+
} & {
|
|
1124
|
+
readonly [x: string]: JsonValue;
|
|
1125
|
+
}>;
|
|
1126
|
+
readonly endpointAlerts: ReadonlyArray<{
|
|
1127
|
+
readonly kind: string;
|
|
1128
|
+
readonly message: string;
|
|
1129
|
+
readonly value: number | null;
|
|
1130
|
+
readonly threshold: number | null;
|
|
1131
|
+
readonly activatedAt: string;
|
|
1132
|
+
} & {
|
|
1133
|
+
readonly [x: string]: JsonValue;
|
|
1134
|
+
}>;
|
|
1135
|
+
readonly publishedAt: string | null;
|
|
1136
|
+
readonly statusChangedAt: string;
|
|
1137
|
+
readonly createdAt: string;
|
|
1138
|
+
readonly updatedAt: string;
|
|
1139
|
+
readonly organizationId: string;
|
|
1140
|
+
readonly previousStatus: "draft" | "published" | "throttled" | "blocked" | "deprecated" | null;
|
|
1141
|
+
} & {
|
|
1142
|
+
readonly [x: string]: JsonValue;
|
|
1143
|
+
};
|
|
1144
|
+
} & {
|
|
1145
|
+
readonly [x: string]: JsonValue;
|
|
1146
|
+
};
|
|
1147
|
+
export type FlowRegistrationUpdatedPayload = FlowRegistrationUpdatedEvent["data"];
|
|
1148
|
+
export type WhatsappNumberConnectedEvent = {
|
|
1149
|
+
readonly type: "whatsapp.number.connected";
|
|
1150
|
+
readonly timestamp: string;
|
|
1151
|
+
readonly data: {
|
|
1152
|
+
readonly organizationId: string;
|
|
1153
|
+
readonly namespaceId: string | null;
|
|
1154
|
+
readonly businessAccountId: string;
|
|
1155
|
+
readonly phoneNumber: string;
|
|
1156
|
+
readonly phoneNumberId: string;
|
|
1157
|
+
readonly whatsappBusinessAccountId: string;
|
|
1158
|
+
readonly displayName: string;
|
|
1159
|
+
readonly verificationStatus: "pending" | "verified" | "failed" | "suspended";
|
|
1160
|
+
readonly reconnected: boolean;
|
|
1161
|
+
readonly setupLink: ({
|
|
1162
|
+
readonly id: string;
|
|
1163
|
+
readonly metadata: {
|
|
1164
|
+
readonly [x: string]: JsonValue;
|
|
1165
|
+
};
|
|
1166
|
+
} & {
|
|
1167
|
+
readonly [x: string]: JsonValue;
|
|
1168
|
+
}) | null;
|
|
1169
|
+
} & {
|
|
1170
|
+
readonly [x: string]: JsonValue;
|
|
1171
|
+
};
|
|
1172
|
+
} & {
|
|
1173
|
+
readonly [x: string]: JsonValue;
|
|
1174
|
+
};
|
|
1175
|
+
export type WhatsappNumberConnectedPayload = WhatsappNumberConnectedEvent["data"];
|
|
678
1176
|
export type MailboxMessageReceivedEvent = {
|
|
679
1177
|
readonly type: "mailbox.message.received";
|
|
680
1178
|
readonly timestamp: string;
|
|
@@ -683,7 +1181,7 @@ export type MailboxMessageReceivedEvent = {
|
|
|
683
1181
|
readonly namespaceId: string | null;
|
|
684
1182
|
readonly message: {
|
|
685
1183
|
readonly id: string;
|
|
686
|
-
readonly channel?: "email";
|
|
1184
|
+
readonly channel?: "email" | "whatsapp" | "sms";
|
|
687
1185
|
readonly threadId: string;
|
|
688
1186
|
readonly from: {
|
|
689
1187
|
readonly address: string;
|
|
@@ -742,7 +1240,7 @@ export type MailboxMessageSentEvent = {
|
|
|
742
1240
|
};
|
|
743
1241
|
readonly message: {
|
|
744
1242
|
readonly id: string;
|
|
745
|
-
readonly channel?: "email";
|
|
1243
|
+
readonly channel?: "email" | "whatsapp" | "sms";
|
|
746
1244
|
readonly threadId: string;
|
|
747
1245
|
readonly from: {
|
|
748
1246
|
readonly address: string;
|
|
@@ -911,7 +1409,7 @@ export type MailboxMessageReleasedEvent = {
|
|
|
911
1409
|
readonly reason: "spam" | "dmarc" | "virus" | "virus_unscanned" | "phishing" | "fraud" | "prompt_injection";
|
|
912
1410
|
readonly message: {
|
|
913
1411
|
readonly id: string;
|
|
914
|
-
readonly channel?: "email";
|
|
1412
|
+
readonly channel?: "email" | "whatsapp" | "sms";
|
|
915
1413
|
readonly threadId: string;
|
|
916
1414
|
readonly from: {
|
|
917
1415
|
readonly address: string;
|
|
@@ -1013,7 +1511,7 @@ export type JourneyWebhookEvent = {
|
|
|
1013
1511
|
readonly [x: string]: JsonValue;
|
|
1014
1512
|
};
|
|
1015
1513
|
export type JourneyWebhookPayload = JourneyWebhookEvent["data"];
|
|
1016
|
-
export type SamvaWebhookEvent = MessageSentEvent | MessageDeliveredEvent | MessageFailedEvent | MessageBouncedEvent | MessageComplainedEvent | MessageReceivedEvent | MessageOpenedEvent | MessageClickedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | ContactSubscribedEvent | ContactUnsubscribedEvent | ContactResubscribedEvent | ContactConsentChangedEvent | ConversationCreatedEvent | ConversationUpdatedEvent | ConversationArchivedEvent | WebhookCreatedEvent | WebhookUpdatedEvent | WebhookDeletedEvent | WebhookTestEvent | DomainUpdatedEvent | DomainWarmingUpdatedEvent | MailboxMessageReceivedEvent | MailboxMessageSentEvent | MailboxActionPendingApprovalEvent | MailboxActionResolvedEvent | MailboxMessageQuarantinedEvent | MailboxMessageReleasedEvent | MailboxMessageDiscardedEvent | JourneyWebhookEvent;
|
|
1514
|
+
export type SamvaWebhookEvent = MessageSentEvent | MessageDeliveredEvent | MessageReadEvent | MessageFailedEvent | MessageBouncedEvent | MessageComplainedEvent | MessageReceivedEvent | MessageOpenedEvent | MessageClickedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | ContactSubscribedEvent | ContactUnsubscribedEvent | ContactResubscribedEvent | ContactConsentChangedEvent | ConversationCreatedEvent | ConversationUpdatedEvent | ConversationArchivedEvent | WebhookCreatedEvent | WebhookUpdatedEvent | WebhookDeletedEvent | WebhookTestEvent | DomainUpdatedEvent | DomainWarmingUpdatedEvent | TemplateRegistrationUpdatedEvent | FlowRegistrationUpdatedEvent | WhatsappNumberConnectedEvent | MailboxMessageReceivedEvent | MailboxMessageSentEvent | MailboxActionPendingApprovalEvent | MailboxActionResolvedEvent | MailboxMessageQuarantinedEvent | MailboxMessageReleasedEvent | MailboxMessageDiscardedEvent | JourneyWebhookEvent;
|
|
1017
1515
|
export interface UnknownWebhookEvent {
|
|
1018
1516
|
readonly type: string;
|
|
1019
1517
|
readonly timestamp: string;
|