@samva/webhooks 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -2
- package/dist/decoder.gen.d.ts +4 -0
- package/dist/effect.d.ts +4 -1
- package/dist/effect.js +4 -2
- package/dist/json-schemas.gen-eya_ZDps.js +2750 -0
- package/dist/json-schemas.gen.d.ts +2 -0
- package/dist/promise.d.ts +3 -1
- package/dist/promise.js +3 -2
- package/dist/protocol-CLrYczjc.js +570 -0
- package/dist/protocol.d.ts +6 -11
- package/dist/protocol.js +2 -2
- package/dist/schemas.gen.d.ts +1484 -0
- package/dist/schemas.gen.js +1339 -0
- package/dist/types.gen.d.ts +998 -0
- package/package.json +13 -3
- package/dist/protocol-BGKUmvlI.js +0 -333
|
@@ -0,0 +1,998 @@
|
|
|
1
|
+
export type JsonValue = null | boolean | number | string | ReadonlyArray<JsonValue> | {
|
|
2
|
+
readonly [key: string]: JsonValue;
|
|
3
|
+
};
|
|
4
|
+
export type MessageSentEvent = {
|
|
5
|
+
readonly type: "message.sent";
|
|
6
|
+
readonly timestamp: string;
|
|
7
|
+
readonly data: {
|
|
8
|
+
readonly mailboxId?: string | null;
|
|
9
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
10
|
+
readonly status?: string | null;
|
|
11
|
+
readonly metadata?: {
|
|
12
|
+
readonly [x: string]: JsonValue;
|
|
13
|
+
} | null;
|
|
14
|
+
readonly cost?: number | null;
|
|
15
|
+
readonly recipient?: string | null;
|
|
16
|
+
readonly occurredAt?: string | null;
|
|
17
|
+
readonly failureReason?: string | null;
|
|
18
|
+
readonly errorCode?: string | null;
|
|
19
|
+
readonly conversationId?: string | null;
|
|
20
|
+
readonly isBillable?: boolean | null;
|
|
21
|
+
readonly messageType?: string | null;
|
|
22
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
23
|
+
readonly subject?: string | null;
|
|
24
|
+
readonly toEmails?: ReadonlyArray<string> | null;
|
|
25
|
+
readonly providerMessageId?: string | null;
|
|
26
|
+
readonly waId?: string | null;
|
|
27
|
+
readonly hasAttachments?: boolean | null;
|
|
28
|
+
readonly isAutoReply?: boolean | null;
|
|
29
|
+
readonly segments?: number | null;
|
|
30
|
+
readonly to?: string | null;
|
|
31
|
+
readonly from?: string | null;
|
|
32
|
+
readonly body?: string | null;
|
|
33
|
+
readonly direction?: "inbound" | "outbound" | null;
|
|
34
|
+
readonly errorMessage?: string | null;
|
|
35
|
+
readonly parts?: number | null;
|
|
36
|
+
readonly carrier?: string | null;
|
|
37
|
+
readonly messageId: string;
|
|
38
|
+
readonly organizationId: string;
|
|
39
|
+
} & {
|
|
40
|
+
readonly [x: string]: JsonValue;
|
|
41
|
+
};
|
|
42
|
+
} & {
|
|
43
|
+
readonly [x: string]: JsonValue;
|
|
44
|
+
};
|
|
45
|
+
export type MessageSentPayload = MessageSentEvent["data"];
|
|
46
|
+
export type MessageDeliveredEvent = {
|
|
47
|
+
readonly type: "message.delivered";
|
|
48
|
+
readonly timestamp: string;
|
|
49
|
+
readonly data: {
|
|
50
|
+
readonly mailboxId?: string | null;
|
|
51
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
52
|
+
readonly status?: string | null;
|
|
53
|
+
readonly metadata?: {
|
|
54
|
+
readonly [x: string]: JsonValue;
|
|
55
|
+
} | null;
|
|
56
|
+
readonly cost?: number | null;
|
|
57
|
+
readonly recipient?: string | null;
|
|
58
|
+
readonly occurredAt?: string | null;
|
|
59
|
+
readonly failureReason?: string | null;
|
|
60
|
+
readonly errorCode?: string | null;
|
|
61
|
+
readonly conversationId?: string | null;
|
|
62
|
+
readonly isBillable?: boolean | null;
|
|
63
|
+
readonly messageType?: string | null;
|
|
64
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
65
|
+
readonly subject?: string | null;
|
|
66
|
+
readonly toEmails?: ReadonlyArray<string> | null;
|
|
67
|
+
readonly providerMessageId?: string | null;
|
|
68
|
+
readonly waId?: string | null;
|
|
69
|
+
readonly hasAttachments?: boolean | null;
|
|
70
|
+
readonly isAutoReply?: boolean | null;
|
|
71
|
+
readonly segments?: number | null;
|
|
72
|
+
readonly to?: string | null;
|
|
73
|
+
readonly from?: string | null;
|
|
74
|
+
readonly body?: string | null;
|
|
75
|
+
readonly direction?: "inbound" | "outbound" | null;
|
|
76
|
+
readonly errorMessage?: string | null;
|
|
77
|
+
readonly parts?: number | null;
|
|
78
|
+
readonly carrier?: string | null;
|
|
79
|
+
readonly messageId: string;
|
|
80
|
+
readonly organizationId: string;
|
|
81
|
+
} & {
|
|
82
|
+
readonly [x: string]: JsonValue;
|
|
83
|
+
};
|
|
84
|
+
} & {
|
|
85
|
+
readonly [x: string]: JsonValue;
|
|
86
|
+
};
|
|
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"];
|
|
130
|
+
export type MessageFailedEvent = {
|
|
131
|
+
readonly type: "message.failed";
|
|
132
|
+
readonly timestamp: string;
|
|
133
|
+
readonly data: {
|
|
134
|
+
readonly mailboxId?: string | null;
|
|
135
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
136
|
+
readonly status?: string | null;
|
|
137
|
+
readonly metadata?: {
|
|
138
|
+
readonly [x: string]: JsonValue;
|
|
139
|
+
} | null;
|
|
140
|
+
readonly cost?: number | null;
|
|
141
|
+
readonly recipient?: string | null;
|
|
142
|
+
readonly occurredAt?: string | null;
|
|
143
|
+
readonly failureReason?: string | null;
|
|
144
|
+
readonly errorCode?: string | null;
|
|
145
|
+
readonly conversationId?: string | null;
|
|
146
|
+
readonly isBillable?: boolean | null;
|
|
147
|
+
readonly messageType?: string | null;
|
|
148
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
149
|
+
readonly subject?: string | null;
|
|
150
|
+
readonly toEmails?: ReadonlyArray<string> | null;
|
|
151
|
+
readonly providerMessageId?: string | null;
|
|
152
|
+
readonly waId?: string | null;
|
|
153
|
+
readonly hasAttachments?: boolean | null;
|
|
154
|
+
readonly isAutoReply?: boolean | null;
|
|
155
|
+
readonly segments?: number | null;
|
|
156
|
+
readonly to?: string | null;
|
|
157
|
+
readonly from?: string | null;
|
|
158
|
+
readonly body?: string | null;
|
|
159
|
+
readonly direction?: "inbound" | "outbound" | null;
|
|
160
|
+
readonly errorMessage?: string | null;
|
|
161
|
+
readonly parts?: number | null;
|
|
162
|
+
readonly carrier?: string | null;
|
|
163
|
+
readonly messageId: string;
|
|
164
|
+
readonly organizationId: string;
|
|
165
|
+
} & {
|
|
166
|
+
readonly [x: string]: JsonValue;
|
|
167
|
+
};
|
|
168
|
+
} & {
|
|
169
|
+
readonly [x: string]: JsonValue;
|
|
170
|
+
};
|
|
171
|
+
export type MessageFailedPayload = MessageFailedEvent["data"];
|
|
172
|
+
export type MessageBouncedEvent = {
|
|
173
|
+
readonly type: "message.bounced";
|
|
174
|
+
readonly timestamp: string;
|
|
175
|
+
readonly data: {
|
|
176
|
+
readonly mailboxId?: string | null;
|
|
177
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
178
|
+
readonly status?: string | null;
|
|
179
|
+
readonly metadata?: {
|
|
180
|
+
readonly [x: string]: JsonValue;
|
|
181
|
+
} | null;
|
|
182
|
+
readonly cost?: number | null;
|
|
183
|
+
readonly recipient: string;
|
|
184
|
+
readonly occurredAt: string;
|
|
185
|
+
readonly failureReason?: string | null;
|
|
186
|
+
readonly errorCode?: string | null;
|
|
187
|
+
readonly conversationId?: string | null;
|
|
188
|
+
readonly isBillable?: boolean | null;
|
|
189
|
+
readonly messageType?: string | null;
|
|
190
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
191
|
+
readonly subject?: string | null;
|
|
192
|
+
readonly toEmails?: ReadonlyArray<string> | null;
|
|
193
|
+
readonly providerMessageId?: string | null;
|
|
194
|
+
readonly waId?: string | null;
|
|
195
|
+
readonly hasAttachments?: boolean | null;
|
|
196
|
+
readonly isAutoReply?: boolean | null;
|
|
197
|
+
readonly segments?: number | null;
|
|
198
|
+
readonly to?: string | null;
|
|
199
|
+
readonly from?: string | null;
|
|
200
|
+
readonly body?: string | null;
|
|
201
|
+
readonly direction?: "inbound" | "outbound" | null;
|
|
202
|
+
readonly errorMessage?: string | null;
|
|
203
|
+
readonly parts?: number | null;
|
|
204
|
+
readonly carrier?: string | null;
|
|
205
|
+
readonly messageId: string;
|
|
206
|
+
readonly organizationId: string;
|
|
207
|
+
} & {
|
|
208
|
+
readonly [x: string]: JsonValue;
|
|
209
|
+
};
|
|
210
|
+
} & {
|
|
211
|
+
readonly [x: string]: JsonValue;
|
|
212
|
+
};
|
|
213
|
+
export type MessageBouncedPayload = MessageBouncedEvent["data"];
|
|
214
|
+
export type MessageComplainedEvent = {
|
|
215
|
+
readonly type: "message.complained";
|
|
216
|
+
readonly timestamp: string;
|
|
217
|
+
readonly data: {
|
|
218
|
+
readonly mailboxId?: string | null;
|
|
219
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
220
|
+
readonly status?: string | null;
|
|
221
|
+
readonly metadata?: {
|
|
222
|
+
readonly [x: string]: JsonValue;
|
|
223
|
+
} | null;
|
|
224
|
+
readonly cost?: number | null;
|
|
225
|
+
readonly recipient: string;
|
|
226
|
+
readonly occurredAt: string;
|
|
227
|
+
readonly failureReason?: string | null;
|
|
228
|
+
readonly errorCode?: string | null;
|
|
229
|
+
readonly conversationId?: string | null;
|
|
230
|
+
readonly isBillable?: boolean | null;
|
|
231
|
+
readonly messageType?: string | null;
|
|
232
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
233
|
+
readonly subject?: string | null;
|
|
234
|
+
readonly toEmails?: ReadonlyArray<string> | null;
|
|
235
|
+
readonly providerMessageId?: string | null;
|
|
236
|
+
readonly waId?: string | null;
|
|
237
|
+
readonly hasAttachments?: boolean | null;
|
|
238
|
+
readonly isAutoReply?: boolean | null;
|
|
239
|
+
readonly segments?: number | null;
|
|
240
|
+
readonly to?: string | null;
|
|
241
|
+
readonly from?: string | null;
|
|
242
|
+
readonly body?: string | null;
|
|
243
|
+
readonly direction?: "inbound" | "outbound" | null;
|
|
244
|
+
readonly errorMessage?: string | null;
|
|
245
|
+
readonly parts?: number | null;
|
|
246
|
+
readonly carrier?: string | null;
|
|
247
|
+
readonly messageId: string;
|
|
248
|
+
readonly organizationId: string;
|
|
249
|
+
} & {
|
|
250
|
+
readonly [x: string]: JsonValue;
|
|
251
|
+
};
|
|
252
|
+
} & {
|
|
253
|
+
readonly [x: string]: JsonValue;
|
|
254
|
+
};
|
|
255
|
+
export type MessageComplainedPayload = MessageComplainedEvent["data"];
|
|
256
|
+
export type MessageReceivedEvent = {
|
|
257
|
+
readonly type: "message.received";
|
|
258
|
+
readonly timestamp: string;
|
|
259
|
+
readonly data: {
|
|
260
|
+
readonly mailboxId?: string | null;
|
|
261
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
262
|
+
readonly status?: string | null;
|
|
263
|
+
readonly metadata?: {
|
|
264
|
+
readonly [x: string]: JsonValue;
|
|
265
|
+
} | null;
|
|
266
|
+
readonly cost?: number | null;
|
|
267
|
+
readonly recipient?: string | null;
|
|
268
|
+
readonly occurredAt?: string | null;
|
|
269
|
+
readonly failureReason?: string | null;
|
|
270
|
+
readonly errorCode?: string | null;
|
|
271
|
+
readonly conversationId?: string | null;
|
|
272
|
+
readonly isBillable?: boolean | null;
|
|
273
|
+
readonly messageType?: string | null;
|
|
274
|
+
readonly templateCategory?: "marketing" | "utility" | "authentication" | null;
|
|
275
|
+
readonly subject?: string | null;
|
|
276
|
+
readonly toEmails?: ReadonlyArray<string> | null;
|
|
277
|
+
readonly providerMessageId?: string | null;
|
|
278
|
+
readonly waId?: string | null;
|
|
279
|
+
readonly hasAttachments?: boolean | null;
|
|
280
|
+
readonly isAutoReply?: boolean | null;
|
|
281
|
+
readonly segments?: number | null;
|
|
282
|
+
readonly to?: string | null;
|
|
283
|
+
readonly from?: string | null;
|
|
284
|
+
readonly body?: string | null;
|
|
285
|
+
readonly direction?: "inbound" | "outbound" | null;
|
|
286
|
+
readonly errorMessage?: string | null;
|
|
287
|
+
readonly parts?: number | null;
|
|
288
|
+
readonly carrier?: string | null;
|
|
289
|
+
readonly messageId: string;
|
|
290
|
+
readonly organizationId: string;
|
|
291
|
+
} & {
|
|
292
|
+
readonly [x: string]: JsonValue;
|
|
293
|
+
};
|
|
294
|
+
} & {
|
|
295
|
+
readonly [x: string]: JsonValue;
|
|
296
|
+
};
|
|
297
|
+
export type MessageReceivedPayload = MessageReceivedEvent["data"];
|
|
298
|
+
export type MessageOpenedEvent = {
|
|
299
|
+
readonly type: "message.opened";
|
|
300
|
+
readonly timestamp: string;
|
|
301
|
+
readonly data: {
|
|
302
|
+
readonly messageId: string;
|
|
303
|
+
readonly organizationId: string;
|
|
304
|
+
readonly channel: "email";
|
|
305
|
+
readonly deliveryId: string;
|
|
306
|
+
readonly recipient: string;
|
|
307
|
+
readonly occurredAt: string;
|
|
308
|
+
readonly userAgent?: string | null;
|
|
309
|
+
readonly ipAddress?: string | null;
|
|
310
|
+
readonly firstOpen: boolean;
|
|
311
|
+
readonly machine: boolean;
|
|
312
|
+
readonly machineReason: "google-image-proxy" | "apple-mail-privacy" | "scanner-user-agent" | "scanner-asn" | "too-fast" | null;
|
|
313
|
+
readonly country?: string | null;
|
|
314
|
+
readonly city?: string | null;
|
|
315
|
+
readonly asn?: number | null;
|
|
316
|
+
readonly code?: string | null;
|
|
317
|
+
readonly linkIndex?: number | null;
|
|
318
|
+
readonly destinationUrl?: string | null;
|
|
319
|
+
readonly metadata?: {
|
|
320
|
+
readonly [x: string]: JsonValue;
|
|
321
|
+
} | null;
|
|
322
|
+
readonly campaignId?: string | null;
|
|
323
|
+
readonly campaignRunId?: string | null;
|
|
324
|
+
} & {
|
|
325
|
+
readonly [x: string]: JsonValue;
|
|
326
|
+
};
|
|
327
|
+
} & {
|
|
328
|
+
readonly [x: string]: JsonValue;
|
|
329
|
+
};
|
|
330
|
+
export type MessageOpenedPayload = MessageOpenedEvent["data"];
|
|
331
|
+
export type MessageClickedEvent = {
|
|
332
|
+
readonly type: "message.clicked";
|
|
333
|
+
readonly timestamp: string;
|
|
334
|
+
readonly data: {
|
|
335
|
+
readonly messageId: string;
|
|
336
|
+
readonly organizationId: string;
|
|
337
|
+
readonly channel: "email";
|
|
338
|
+
readonly deliveryId: string;
|
|
339
|
+
readonly recipient: string;
|
|
340
|
+
readonly occurredAt: string;
|
|
341
|
+
readonly userAgent?: string | null;
|
|
342
|
+
readonly ipAddress?: string | null;
|
|
343
|
+
readonly url: string;
|
|
344
|
+
readonly linkTags: {
|
|
345
|
+
readonly [x: string]: ReadonlyArray<string>;
|
|
346
|
+
};
|
|
347
|
+
readonly firstClick: boolean;
|
|
348
|
+
readonly machine: boolean;
|
|
349
|
+
readonly machineReason: "google-image-proxy" | "apple-mail-privacy" | "scanner-user-agent" | "scanner-asn" | "too-fast" | null;
|
|
350
|
+
readonly country?: string | null;
|
|
351
|
+
readonly city?: string | null;
|
|
352
|
+
readonly asn?: number | null;
|
|
353
|
+
readonly code?: string | null;
|
|
354
|
+
readonly linkIndex?: number | null;
|
|
355
|
+
readonly destinationUrl?: string | null;
|
|
356
|
+
readonly metadata?: {
|
|
357
|
+
readonly [x: string]: JsonValue;
|
|
358
|
+
} | null;
|
|
359
|
+
readonly campaignId?: string | null;
|
|
360
|
+
readonly campaignRunId?: string | null;
|
|
361
|
+
} & {
|
|
362
|
+
readonly [x: string]: JsonValue;
|
|
363
|
+
};
|
|
364
|
+
} & {
|
|
365
|
+
readonly [x: string]: JsonValue;
|
|
366
|
+
};
|
|
367
|
+
export type MessageClickedPayload = MessageClickedEvent["data"];
|
|
368
|
+
export type ContactCreatedEvent = {
|
|
369
|
+
readonly type: "contact.created";
|
|
370
|
+
readonly timestamp: string;
|
|
371
|
+
readonly data: {
|
|
372
|
+
readonly contactId: string;
|
|
373
|
+
readonly status: "active" | "paused" | "blocked" | "archived";
|
|
374
|
+
readonly name: string;
|
|
375
|
+
readonly displayName?: string | null | null;
|
|
376
|
+
readonly identities: ReadonlyArray<{
|
|
377
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
378
|
+
readonly identifier: string;
|
|
379
|
+
readonly verified: boolean;
|
|
380
|
+
} & {
|
|
381
|
+
readonly [x: string]: JsonValue;
|
|
382
|
+
}>;
|
|
383
|
+
readonly tags: ReadonlyArray<string>;
|
|
384
|
+
readonly externalId?: string | null | null;
|
|
385
|
+
readonly createdAt: string;
|
|
386
|
+
readonly updatedAt: string;
|
|
387
|
+
} & {
|
|
388
|
+
readonly [x: string]: JsonValue;
|
|
389
|
+
};
|
|
390
|
+
} & {
|
|
391
|
+
readonly [x: string]: JsonValue;
|
|
392
|
+
};
|
|
393
|
+
export type ContactCreatedPayload = ContactCreatedEvent["data"];
|
|
394
|
+
export type ContactUpdatedEvent = {
|
|
395
|
+
readonly type: "contact.updated";
|
|
396
|
+
readonly timestamp: string;
|
|
397
|
+
readonly data: {
|
|
398
|
+
readonly contactId: string;
|
|
399
|
+
readonly status: "active" | "paused" | "blocked" | "archived";
|
|
400
|
+
readonly name: string;
|
|
401
|
+
readonly displayName?: string | null | null;
|
|
402
|
+
readonly identities: ReadonlyArray<{
|
|
403
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
404
|
+
readonly identifier: string;
|
|
405
|
+
readonly verified: boolean;
|
|
406
|
+
} & {
|
|
407
|
+
readonly [x: string]: JsonValue;
|
|
408
|
+
}>;
|
|
409
|
+
readonly tags: ReadonlyArray<string>;
|
|
410
|
+
readonly externalId?: string | null | null;
|
|
411
|
+
readonly createdAt: string;
|
|
412
|
+
readonly updatedAt: string;
|
|
413
|
+
} & {
|
|
414
|
+
readonly [x: string]: JsonValue;
|
|
415
|
+
};
|
|
416
|
+
} & {
|
|
417
|
+
readonly [x: string]: JsonValue;
|
|
418
|
+
};
|
|
419
|
+
export type ContactUpdatedPayload = ContactUpdatedEvent["data"];
|
|
420
|
+
export type ContactDeletedEvent = {
|
|
421
|
+
readonly type: "contact.deleted";
|
|
422
|
+
readonly timestamp: string;
|
|
423
|
+
readonly data: {
|
|
424
|
+
readonly contactId: string;
|
|
425
|
+
readonly status: "active" | "paused" | "blocked" | "archived";
|
|
426
|
+
readonly name: string;
|
|
427
|
+
readonly displayName?: string | null | null;
|
|
428
|
+
readonly identities: ReadonlyArray<{
|
|
429
|
+
readonly channel: "sms" | "whatsapp" | "email";
|
|
430
|
+
readonly identifier: string;
|
|
431
|
+
readonly verified: boolean;
|
|
432
|
+
} & {
|
|
433
|
+
readonly [x: string]: JsonValue;
|
|
434
|
+
}>;
|
|
435
|
+
readonly tags: ReadonlyArray<string>;
|
|
436
|
+
readonly externalId?: string | null | null;
|
|
437
|
+
readonly createdAt: string;
|
|
438
|
+
readonly updatedAt: string;
|
|
439
|
+
} & {
|
|
440
|
+
readonly [x: string]: JsonValue;
|
|
441
|
+
};
|
|
442
|
+
} & {
|
|
443
|
+
readonly [x: string]: JsonValue;
|
|
444
|
+
};
|
|
445
|
+
export type ContactDeletedPayload = ContactDeletedEvent["data"];
|
|
446
|
+
export type ContactSubscribedEvent = {
|
|
447
|
+
readonly type: "contact.subscribed";
|
|
448
|
+
readonly timestamp: string;
|
|
449
|
+
readonly data: {
|
|
450
|
+
readonly organizationId: string;
|
|
451
|
+
readonly contactId: string | null;
|
|
452
|
+
readonly email: string;
|
|
453
|
+
readonly groupId: string;
|
|
454
|
+
readonly groupName: string;
|
|
455
|
+
readonly contactGroupId?: string | null;
|
|
456
|
+
readonly unsubscribeGroupId?: string | null;
|
|
457
|
+
readonly consentIp?: string | null;
|
|
458
|
+
readonly consentSource?: string | null;
|
|
459
|
+
readonly source: "link" | "api" | "manual" | "complaint";
|
|
460
|
+
readonly messageId?: string | null;
|
|
461
|
+
readonly campaignId?: string | null;
|
|
462
|
+
readonly campaignRunId?: string | null;
|
|
463
|
+
readonly occurredAt: string;
|
|
464
|
+
} & {
|
|
465
|
+
readonly [x: string]: JsonValue;
|
|
466
|
+
};
|
|
467
|
+
} & {
|
|
468
|
+
readonly [x: string]: JsonValue;
|
|
469
|
+
};
|
|
470
|
+
export type ContactSubscribedPayload = ContactSubscribedEvent["data"];
|
|
471
|
+
export type ContactUnsubscribedEvent = {
|
|
472
|
+
readonly type: "contact.unsubscribed";
|
|
473
|
+
readonly timestamp: string;
|
|
474
|
+
readonly data: {
|
|
475
|
+
readonly organizationId: string;
|
|
476
|
+
readonly contactId: string | null;
|
|
477
|
+
readonly email: string;
|
|
478
|
+
readonly groupId: string;
|
|
479
|
+
readonly groupName: string;
|
|
480
|
+
readonly contactGroupId?: string | null;
|
|
481
|
+
readonly unsubscribeGroupId?: string | null;
|
|
482
|
+
readonly consentIp?: string | null;
|
|
483
|
+
readonly consentSource?: string | null;
|
|
484
|
+
readonly source: "link" | "api" | "manual" | "complaint";
|
|
485
|
+
readonly messageId?: string | null;
|
|
486
|
+
readonly campaignId?: string | null;
|
|
487
|
+
readonly campaignRunId?: string | null;
|
|
488
|
+
readonly occurredAt: string;
|
|
489
|
+
} & {
|
|
490
|
+
readonly [x: string]: JsonValue;
|
|
491
|
+
};
|
|
492
|
+
} & {
|
|
493
|
+
readonly [x: string]: JsonValue;
|
|
494
|
+
};
|
|
495
|
+
export type ContactUnsubscribedPayload = ContactUnsubscribedEvent["data"];
|
|
496
|
+
export type ContactResubscribedEvent = {
|
|
497
|
+
readonly type: "contact.resubscribed";
|
|
498
|
+
readonly timestamp: string;
|
|
499
|
+
readonly data: {
|
|
500
|
+
readonly organizationId: string;
|
|
501
|
+
readonly contactId: string | null;
|
|
502
|
+
readonly email: string;
|
|
503
|
+
readonly groupId: string;
|
|
504
|
+
readonly groupName: string;
|
|
505
|
+
readonly contactGroupId?: string | null;
|
|
506
|
+
readonly unsubscribeGroupId?: string | null;
|
|
507
|
+
readonly consentIp?: string | null;
|
|
508
|
+
readonly consentSource?: string | null;
|
|
509
|
+
readonly source: "link" | "api" | "manual" | "complaint";
|
|
510
|
+
readonly messageId?: string | null;
|
|
511
|
+
readonly campaignId?: string | null;
|
|
512
|
+
readonly campaignRunId?: string | null;
|
|
513
|
+
readonly occurredAt: string;
|
|
514
|
+
} & {
|
|
515
|
+
readonly [x: string]: JsonValue;
|
|
516
|
+
};
|
|
517
|
+
} & {
|
|
518
|
+
readonly [x: string]: JsonValue;
|
|
519
|
+
};
|
|
520
|
+
export type ContactResubscribedPayload = ContactResubscribedEvent["data"];
|
|
521
|
+
export type ConversationCreatedEvent = {
|
|
522
|
+
readonly type: "conversation.created";
|
|
523
|
+
readonly timestamp: string;
|
|
524
|
+
readonly data: {
|
|
525
|
+
readonly conversationId: string;
|
|
526
|
+
readonly organizationId: string;
|
|
527
|
+
readonly title?: string | null | null;
|
|
528
|
+
readonly channels: ReadonlyArray<"sms" | "whatsapp" | "email">;
|
|
529
|
+
readonly primaryChannel: "sms" | "whatsapp" | "email";
|
|
530
|
+
readonly status: "active" | "waiting" | "resolved" | "escalated" | "archived";
|
|
531
|
+
readonly primaryContactId?: string | null | null;
|
|
532
|
+
readonly createdAt: string;
|
|
533
|
+
readonly updatedAt: string;
|
|
534
|
+
} & {
|
|
535
|
+
readonly [x: string]: JsonValue;
|
|
536
|
+
};
|
|
537
|
+
} & {
|
|
538
|
+
readonly [x: string]: JsonValue;
|
|
539
|
+
};
|
|
540
|
+
export type ConversationCreatedPayload = ConversationCreatedEvent["data"];
|
|
541
|
+
export type ConversationUpdatedEvent = {
|
|
542
|
+
readonly type: "conversation.updated";
|
|
543
|
+
readonly timestamp: string;
|
|
544
|
+
readonly data: {
|
|
545
|
+
readonly conversationId: string;
|
|
546
|
+
readonly organizationId: string;
|
|
547
|
+
readonly title?: string | null | null;
|
|
548
|
+
readonly channels: ReadonlyArray<"sms" | "whatsapp" | "email">;
|
|
549
|
+
readonly primaryChannel: "sms" | "whatsapp" | "email";
|
|
550
|
+
readonly status: "active" | "waiting" | "resolved" | "escalated" | "archived";
|
|
551
|
+
readonly primaryContactId?: string | null | null;
|
|
552
|
+
readonly createdAt: string;
|
|
553
|
+
readonly updatedAt: string;
|
|
554
|
+
} & {
|
|
555
|
+
readonly [x: string]: JsonValue;
|
|
556
|
+
};
|
|
557
|
+
} & {
|
|
558
|
+
readonly [x: string]: JsonValue;
|
|
559
|
+
};
|
|
560
|
+
export type ConversationUpdatedPayload = ConversationUpdatedEvent["data"];
|
|
561
|
+
export type ConversationArchivedEvent = {
|
|
562
|
+
readonly type: "conversation.archived";
|
|
563
|
+
readonly timestamp: string;
|
|
564
|
+
readonly data: {
|
|
565
|
+
readonly conversationId: string;
|
|
566
|
+
readonly organizationId: string;
|
|
567
|
+
readonly title?: string | null | null;
|
|
568
|
+
readonly channels: ReadonlyArray<"sms" | "whatsapp" | "email">;
|
|
569
|
+
readonly primaryChannel: "sms" | "whatsapp" | "email";
|
|
570
|
+
readonly status: "active" | "waiting" | "resolved" | "escalated" | "archived";
|
|
571
|
+
readonly primaryContactId?: string | null | null;
|
|
572
|
+
readonly createdAt: string;
|
|
573
|
+
readonly updatedAt: string;
|
|
574
|
+
} & {
|
|
575
|
+
readonly [x: string]: JsonValue;
|
|
576
|
+
};
|
|
577
|
+
} & {
|
|
578
|
+
readonly [x: string]: JsonValue;
|
|
579
|
+
};
|
|
580
|
+
export type ConversationArchivedPayload = ConversationArchivedEvent["data"];
|
|
581
|
+
export type WebhookCreatedEvent = {
|
|
582
|
+
readonly type: "webhook.created";
|
|
583
|
+
readonly timestamp: string;
|
|
584
|
+
readonly data: {
|
|
585
|
+
readonly webhookId: string;
|
|
586
|
+
readonly organizationId: string;
|
|
587
|
+
readonly name: string;
|
|
588
|
+
readonly url: string;
|
|
589
|
+
readonly eventTypes: ReadonlyArray<string>;
|
|
590
|
+
readonly channels: ReadonlyArray<string> | null;
|
|
591
|
+
readonly status: "active" | "disabled";
|
|
592
|
+
readonly createdAt: string;
|
|
593
|
+
readonly updatedAt: string;
|
|
594
|
+
} & {
|
|
595
|
+
readonly [x: string]: JsonValue;
|
|
596
|
+
};
|
|
597
|
+
} & {
|
|
598
|
+
readonly [x: string]: JsonValue;
|
|
599
|
+
};
|
|
600
|
+
export type WebhookCreatedPayload = WebhookCreatedEvent["data"];
|
|
601
|
+
export type WebhookUpdatedEvent = {
|
|
602
|
+
readonly type: "webhook.updated";
|
|
603
|
+
readonly timestamp: string;
|
|
604
|
+
readonly data: {
|
|
605
|
+
readonly webhookId: string;
|
|
606
|
+
readonly organizationId: string;
|
|
607
|
+
readonly name: string;
|
|
608
|
+
readonly url: string;
|
|
609
|
+
readonly eventTypes: ReadonlyArray<string>;
|
|
610
|
+
readonly channels: ReadonlyArray<string> | null;
|
|
611
|
+
readonly status: "active" | "disabled";
|
|
612
|
+
readonly createdAt: string;
|
|
613
|
+
readonly updatedAt: string;
|
|
614
|
+
} & {
|
|
615
|
+
readonly [x: string]: JsonValue;
|
|
616
|
+
};
|
|
617
|
+
} & {
|
|
618
|
+
readonly [x: string]: JsonValue;
|
|
619
|
+
};
|
|
620
|
+
export type WebhookUpdatedPayload = WebhookUpdatedEvent["data"];
|
|
621
|
+
export type WebhookDeletedEvent = {
|
|
622
|
+
readonly type: "webhook.deleted";
|
|
623
|
+
readonly timestamp: string;
|
|
624
|
+
readonly data: {
|
|
625
|
+
readonly webhookId: string;
|
|
626
|
+
readonly organizationId: string;
|
|
627
|
+
readonly name: string;
|
|
628
|
+
readonly url: string;
|
|
629
|
+
readonly eventTypes: ReadonlyArray<string>;
|
|
630
|
+
readonly channels: ReadonlyArray<string> | null;
|
|
631
|
+
readonly status: "active" | "disabled";
|
|
632
|
+
readonly createdAt: string;
|
|
633
|
+
readonly updatedAt: string;
|
|
634
|
+
} & {
|
|
635
|
+
readonly [x: string]: JsonValue;
|
|
636
|
+
};
|
|
637
|
+
} & {
|
|
638
|
+
readonly [x: string]: JsonValue;
|
|
639
|
+
};
|
|
640
|
+
export type WebhookDeletedPayload = WebhookDeletedEvent["data"];
|
|
641
|
+
export type WebhookTestEvent = {
|
|
642
|
+
readonly type: "webhook.test";
|
|
643
|
+
readonly timestamp: string;
|
|
644
|
+
readonly data: {
|
|
645
|
+
readonly [x: string]: JsonValue;
|
|
646
|
+
};
|
|
647
|
+
} & {
|
|
648
|
+
readonly [x: string]: JsonValue;
|
|
649
|
+
};
|
|
650
|
+
export type WebhookTestPayload = WebhookTestEvent["data"];
|
|
651
|
+
export type DomainUpdatedEvent = {
|
|
652
|
+
readonly type: "domain.updated";
|
|
653
|
+
readonly timestamp: string;
|
|
654
|
+
readonly data: {
|
|
655
|
+
readonly domainId: string;
|
|
656
|
+
readonly organizationId: string;
|
|
657
|
+
readonly domain: string;
|
|
658
|
+
readonly previousPhase: "dns-setup" | "provisioning" | "verifying" | "ready" | "degraded" | "failed";
|
|
659
|
+
readonly phase: "dns-setup" | "provisioning" | "verifying" | "ready" | "degraded" | "failed";
|
|
660
|
+
readonly dns: {
|
|
661
|
+
readonly observed: boolean;
|
|
662
|
+
readonly total: number;
|
|
663
|
+
readonly satisfied: number;
|
|
664
|
+
readonly missing: number;
|
|
665
|
+
readonly mismatch: number;
|
|
666
|
+
readonly unknown: number;
|
|
667
|
+
} & {
|
|
668
|
+
readonly [x: string]: JsonValue;
|
|
669
|
+
};
|
|
670
|
+
readonly provider: ({
|
|
671
|
+
readonly identity: "pending" | "verified" | "failed" | "unknown";
|
|
672
|
+
readonly dkim?: "pending" | "verified" | "failed" | "unknown" | null;
|
|
673
|
+
readonly mailFrom?: "pending" | "verified" | "failed" | "unknown" | null;
|
|
674
|
+
} & {
|
|
675
|
+
readonly [x: string]: JsonValue;
|
|
676
|
+
}) | null;
|
|
677
|
+
readonly operationId: string | null;
|
|
678
|
+
readonly checkedAt: string | null;
|
|
679
|
+
readonly nextCheckAt: string | null;
|
|
680
|
+
readonly failure: ({
|
|
681
|
+
readonly code: string;
|
|
682
|
+
readonly message: string;
|
|
683
|
+
readonly failedAt: string;
|
|
684
|
+
} & {
|
|
685
|
+
readonly [x: string]: JsonValue;
|
|
686
|
+
}) | null;
|
|
687
|
+
readonly updatedAt: string;
|
|
688
|
+
} & {
|
|
689
|
+
readonly [x: string]: JsonValue;
|
|
690
|
+
};
|
|
691
|
+
} & {
|
|
692
|
+
readonly [x: string]: JsonValue;
|
|
693
|
+
};
|
|
694
|
+
export type DomainUpdatedPayload = DomainUpdatedEvent["data"];
|
|
695
|
+
export type DomainWarmingUpdatedEvent = {
|
|
696
|
+
readonly type: "domain.warming.updated";
|
|
697
|
+
readonly timestamp: string;
|
|
698
|
+
readonly data: {
|
|
699
|
+
readonly domainId: string;
|
|
700
|
+
readonly organizationId: string;
|
|
701
|
+
readonly domain: string;
|
|
702
|
+
readonly planId: string;
|
|
703
|
+
readonly reason: "plan-created" | "policy-updated" | "window-opened" | "window-cancelled" | "paused" | "resumed" | "held" | "completed";
|
|
704
|
+
readonly status: "active" | "paused" | "completed";
|
|
705
|
+
readonly holdReason: string | null;
|
|
706
|
+
readonly batch: ({
|
|
707
|
+
readonly id: string;
|
|
708
|
+
readonly sequence: number;
|
|
709
|
+
readonly startsAt: string;
|
|
710
|
+
readonly endsAt: string;
|
|
711
|
+
readonly allowanceRecipients: number;
|
|
712
|
+
readonly dailyGrowthPercent: number;
|
|
713
|
+
readonly targetDailyRecipients: number;
|
|
714
|
+
} & {
|
|
715
|
+
readonly [x: string]: JsonValue;
|
|
716
|
+
}) | null;
|
|
717
|
+
readonly updatedAt: string;
|
|
718
|
+
} & {
|
|
719
|
+
readonly [x: string]: JsonValue;
|
|
720
|
+
};
|
|
721
|
+
} & {
|
|
722
|
+
readonly [x: string]: JsonValue;
|
|
723
|
+
};
|
|
724
|
+
export type DomainWarmingUpdatedPayload = DomainWarmingUpdatedEvent["data"];
|
|
725
|
+
export type MailboxMessageReceivedEvent = {
|
|
726
|
+
readonly type: "mailbox.message.received";
|
|
727
|
+
readonly timestamp: string;
|
|
728
|
+
readonly data: {
|
|
729
|
+
readonly mailboxId: string;
|
|
730
|
+
readonly namespaceId: string | null;
|
|
731
|
+
readonly message: {
|
|
732
|
+
readonly id: string;
|
|
733
|
+
readonly threadId: string;
|
|
734
|
+
readonly from: {
|
|
735
|
+
readonly address: string;
|
|
736
|
+
readonly name?: string | null;
|
|
737
|
+
} & {
|
|
738
|
+
readonly [x: string]: JsonValue;
|
|
739
|
+
};
|
|
740
|
+
readonly to: ReadonlyArray<string>;
|
|
741
|
+
readonly cc: ReadonlyArray<string>;
|
|
742
|
+
readonly subject: string | null;
|
|
743
|
+
readonly text: string | null;
|
|
744
|
+
readonly replyText: string | null;
|
|
745
|
+
readonly attachments: ReadonlyArray<{
|
|
746
|
+
readonly id: string;
|
|
747
|
+
readonly filename: string;
|
|
748
|
+
readonly contentType: string;
|
|
749
|
+
readonly size: number;
|
|
750
|
+
} & {
|
|
751
|
+
readonly [x: string]: JsonValue;
|
|
752
|
+
}>;
|
|
753
|
+
readonly occurredAt: string;
|
|
754
|
+
} & {
|
|
755
|
+
readonly [x: string]: JsonValue;
|
|
756
|
+
};
|
|
757
|
+
readonly thread: {
|
|
758
|
+
readonly id: string;
|
|
759
|
+
readonly subject: string | null;
|
|
760
|
+
readonly preview: string | null;
|
|
761
|
+
} & {
|
|
762
|
+
readonly [x: string]: JsonValue;
|
|
763
|
+
};
|
|
764
|
+
} & {
|
|
765
|
+
readonly [x: string]: JsonValue;
|
|
766
|
+
};
|
|
767
|
+
} & {
|
|
768
|
+
readonly [x: string]: JsonValue;
|
|
769
|
+
};
|
|
770
|
+
export type MailboxMessageReceivedPayload = MailboxMessageReceivedEvent["data"];
|
|
771
|
+
export type MailboxMessageSentEvent = {
|
|
772
|
+
readonly type: "mailbox.message.sent";
|
|
773
|
+
readonly timestamp: string;
|
|
774
|
+
readonly data: {
|
|
775
|
+
readonly mailboxId: string;
|
|
776
|
+
readonly namespaceId: string | null;
|
|
777
|
+
readonly actionId: string;
|
|
778
|
+
readonly state?: "completed";
|
|
779
|
+
readonly acceptedAt?: string;
|
|
780
|
+
readonly actor: {
|
|
781
|
+
readonly kind: "user" | "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system";
|
|
782
|
+
readonly id: string;
|
|
783
|
+
readonly displayName?: string | null;
|
|
784
|
+
readonly source: "humanUi" | "externalApi" | "externalAgent" | "extension" | "system";
|
|
785
|
+
} & {
|
|
786
|
+
readonly [x: string]: JsonValue;
|
|
787
|
+
};
|
|
788
|
+
readonly message: {
|
|
789
|
+
readonly id: string;
|
|
790
|
+
readonly threadId: string;
|
|
791
|
+
readonly from: {
|
|
792
|
+
readonly address: string;
|
|
793
|
+
readonly name?: string | null;
|
|
794
|
+
} & {
|
|
795
|
+
readonly [x: string]: JsonValue;
|
|
796
|
+
};
|
|
797
|
+
readonly to: ReadonlyArray<string>;
|
|
798
|
+
readonly cc: ReadonlyArray<string>;
|
|
799
|
+
readonly subject: string | null;
|
|
800
|
+
readonly text: string | null;
|
|
801
|
+
readonly replyText: string | null;
|
|
802
|
+
readonly attachments: ReadonlyArray<{
|
|
803
|
+
readonly id: string;
|
|
804
|
+
readonly filename: string;
|
|
805
|
+
readonly contentType: string;
|
|
806
|
+
readonly size: number;
|
|
807
|
+
} & {
|
|
808
|
+
readonly [x: string]: JsonValue;
|
|
809
|
+
}>;
|
|
810
|
+
readonly occurredAt: string;
|
|
811
|
+
} & {
|
|
812
|
+
readonly [x: string]: JsonValue;
|
|
813
|
+
};
|
|
814
|
+
} & {
|
|
815
|
+
readonly [x: string]: JsonValue;
|
|
816
|
+
};
|
|
817
|
+
} & {
|
|
818
|
+
readonly [x: string]: JsonValue;
|
|
819
|
+
};
|
|
820
|
+
export type MailboxMessageSentPayload = MailboxMessageSentEvent["data"];
|
|
821
|
+
export type MailboxActionPendingApprovalEvent = {
|
|
822
|
+
readonly type: "mailbox.action.pending_approval";
|
|
823
|
+
readonly timestamp: string;
|
|
824
|
+
readonly data: {
|
|
825
|
+
readonly mailboxId: string;
|
|
826
|
+
readonly namespaceId: string | null;
|
|
827
|
+
readonly action: {
|
|
828
|
+
readonly id: string;
|
|
829
|
+
readonly type: "sendMessage" | "reply" | "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest";
|
|
830
|
+
readonly state?: "approvalRequired";
|
|
831
|
+
readonly decision?: {
|
|
832
|
+
readonly outcome: "allow" | "requireApproval" | "deny";
|
|
833
|
+
readonly reason: string | null;
|
|
834
|
+
readonly policyId: string | null;
|
|
835
|
+
readonly source: "grant" | "installation" | "policy" | null;
|
|
836
|
+
readonly decidedAt: string;
|
|
837
|
+
} & {
|
|
838
|
+
readonly [x: string]: JsonValue;
|
|
839
|
+
};
|
|
840
|
+
readonly threadId: string | null;
|
|
841
|
+
readonly reason: string | null;
|
|
842
|
+
readonly proposedBy: {
|
|
843
|
+
readonly kind: "user" | "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system";
|
|
844
|
+
readonly id: string;
|
|
845
|
+
readonly displayName?: string | null;
|
|
846
|
+
readonly source: "humanUi" | "externalApi" | "externalAgent" | "extension" | "system";
|
|
847
|
+
} & {
|
|
848
|
+
readonly [x: string]: JsonValue;
|
|
849
|
+
};
|
|
850
|
+
readonly createdAt: string;
|
|
851
|
+
} & {
|
|
852
|
+
readonly [x: string]: JsonValue;
|
|
853
|
+
};
|
|
854
|
+
readonly draft: {
|
|
855
|
+
readonly to: ReadonlyArray<string>;
|
|
856
|
+
readonly cc: ReadonlyArray<string>;
|
|
857
|
+
readonly subject: string | null;
|
|
858
|
+
} & {
|
|
859
|
+
readonly [x: string]: JsonValue;
|
|
860
|
+
};
|
|
861
|
+
} & {
|
|
862
|
+
readonly [x: string]: JsonValue;
|
|
863
|
+
};
|
|
864
|
+
} & {
|
|
865
|
+
readonly [x: string]: JsonValue;
|
|
866
|
+
};
|
|
867
|
+
export type MailboxActionPendingApprovalPayload = MailboxActionPendingApprovalEvent["data"];
|
|
868
|
+
export type MailboxMessageQuarantinedEvent = {
|
|
869
|
+
readonly type: "mailbox.message.quarantined";
|
|
870
|
+
readonly timestamp: string;
|
|
871
|
+
readonly data: {
|
|
872
|
+
readonly mailboxId: string;
|
|
873
|
+
readonly namespaceId: string | null;
|
|
874
|
+
readonly disposition: "quarantined" | "isolated";
|
|
875
|
+
readonly reason: "spam" | "dmarc" | "virus" | "virus_unscanned" | "phishing" | "fraud" | "prompt_injection";
|
|
876
|
+
readonly source: "receipt" | "classifier";
|
|
877
|
+
readonly message: {
|
|
878
|
+
readonly id: string;
|
|
879
|
+
readonly from: {
|
|
880
|
+
readonly address: string;
|
|
881
|
+
readonly name?: string | null;
|
|
882
|
+
} & {
|
|
883
|
+
readonly [x: string]: JsonValue;
|
|
884
|
+
};
|
|
885
|
+
readonly subject: string | null;
|
|
886
|
+
readonly receivedAt: string;
|
|
887
|
+
} & {
|
|
888
|
+
readonly [x: string]: JsonValue;
|
|
889
|
+
};
|
|
890
|
+
} & {
|
|
891
|
+
readonly [x: string]: JsonValue;
|
|
892
|
+
};
|
|
893
|
+
} & {
|
|
894
|
+
readonly [x: string]: JsonValue;
|
|
895
|
+
};
|
|
896
|
+
export type MailboxMessageQuarantinedPayload = MailboxMessageQuarantinedEvent["data"];
|
|
897
|
+
export type MailboxMessageReleasedEvent = {
|
|
898
|
+
readonly type: "mailbox.message.released";
|
|
899
|
+
readonly timestamp: string;
|
|
900
|
+
readonly data: {
|
|
901
|
+
readonly mailboxId: string;
|
|
902
|
+
readonly namespaceId: string | null;
|
|
903
|
+
readonly releasedBy: {
|
|
904
|
+
readonly kind: "user" | "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system";
|
|
905
|
+
readonly id: string;
|
|
906
|
+
readonly displayName?: string | null;
|
|
907
|
+
readonly source: "humanUi" | "externalApi" | "externalAgent" | "extension" | "system";
|
|
908
|
+
} & {
|
|
909
|
+
readonly [x: string]: JsonValue;
|
|
910
|
+
};
|
|
911
|
+
readonly reason: "spam" | "dmarc" | "virus" | "virus_unscanned" | "phishing" | "fraud" | "prompt_injection";
|
|
912
|
+
readonly message: {
|
|
913
|
+
readonly id: string;
|
|
914
|
+
readonly threadId: string;
|
|
915
|
+
readonly from: {
|
|
916
|
+
readonly address: string;
|
|
917
|
+
readonly name?: string | null;
|
|
918
|
+
} & {
|
|
919
|
+
readonly [x: string]: JsonValue;
|
|
920
|
+
};
|
|
921
|
+
readonly to: ReadonlyArray<string>;
|
|
922
|
+
readonly cc: ReadonlyArray<string>;
|
|
923
|
+
readonly subject: string | null;
|
|
924
|
+
readonly text: string | null;
|
|
925
|
+
readonly replyText: string | null;
|
|
926
|
+
readonly attachments: ReadonlyArray<{
|
|
927
|
+
readonly id: string;
|
|
928
|
+
readonly filename: string;
|
|
929
|
+
readonly contentType: string;
|
|
930
|
+
readonly size: number;
|
|
931
|
+
} & {
|
|
932
|
+
readonly [x: string]: JsonValue;
|
|
933
|
+
}>;
|
|
934
|
+
readonly occurredAt: string;
|
|
935
|
+
} & {
|
|
936
|
+
readonly [x: string]: JsonValue;
|
|
937
|
+
};
|
|
938
|
+
readonly thread: {
|
|
939
|
+
readonly id: string;
|
|
940
|
+
readonly subject: string | null;
|
|
941
|
+
readonly preview: string | null;
|
|
942
|
+
} & {
|
|
943
|
+
readonly [x: string]: JsonValue;
|
|
944
|
+
};
|
|
945
|
+
} & {
|
|
946
|
+
readonly [x: string]: JsonValue;
|
|
947
|
+
};
|
|
948
|
+
} & {
|
|
949
|
+
readonly [x: string]: JsonValue;
|
|
950
|
+
};
|
|
951
|
+
export type MailboxMessageReleasedPayload = MailboxMessageReleasedEvent["data"];
|
|
952
|
+
export type MailboxMessageDiscardedEvent = {
|
|
953
|
+
readonly type: "mailbox.message.discarded";
|
|
954
|
+
readonly timestamp: string;
|
|
955
|
+
readonly data: {
|
|
956
|
+
readonly mailboxId: string;
|
|
957
|
+
readonly namespaceId: string | null;
|
|
958
|
+
readonly discardedBy: {
|
|
959
|
+
readonly kind: "user" | "apiKey" | "extension" | "externalAgent" | "samvaAgent" | "system";
|
|
960
|
+
readonly id: string;
|
|
961
|
+
readonly displayName?: string | null;
|
|
962
|
+
readonly source: "humanUi" | "externalApi" | "externalAgent" | "extension" | "system";
|
|
963
|
+
} & {
|
|
964
|
+
readonly [x: string]: JsonValue;
|
|
965
|
+
};
|
|
966
|
+
readonly disposition: "quarantined" | "isolated";
|
|
967
|
+
readonly reason: "spam" | "dmarc" | "virus" | "virus_unscanned" | "phishing" | "fraud" | "prompt_injection";
|
|
968
|
+
readonly message: {
|
|
969
|
+
readonly id: string;
|
|
970
|
+
readonly from: {
|
|
971
|
+
readonly address: string;
|
|
972
|
+
readonly name?: string | null;
|
|
973
|
+
} & {
|
|
974
|
+
readonly [x: string]: JsonValue;
|
|
975
|
+
};
|
|
976
|
+
readonly subject: string | null;
|
|
977
|
+
readonly receivedAt: string;
|
|
978
|
+
} & {
|
|
979
|
+
readonly [x: string]: JsonValue;
|
|
980
|
+
};
|
|
981
|
+
} & {
|
|
982
|
+
readonly [x: string]: JsonValue;
|
|
983
|
+
};
|
|
984
|
+
} & {
|
|
985
|
+
readonly [x: string]: JsonValue;
|
|
986
|
+
};
|
|
987
|
+
export type MailboxMessageDiscardedPayload = MailboxMessageDiscardedEvent["data"];
|
|
988
|
+
export type SamvaWebhookEvent = MessageSentEvent | MessageDeliveredEvent | MessageReadEvent | MessageFailedEvent | MessageBouncedEvent | MessageComplainedEvent | MessageReceivedEvent | MessageOpenedEvent | MessageClickedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | ContactSubscribedEvent | ContactUnsubscribedEvent | ContactResubscribedEvent | ConversationCreatedEvent | ConversationUpdatedEvent | ConversationArchivedEvent | WebhookCreatedEvent | WebhookUpdatedEvent | WebhookDeletedEvent | WebhookTestEvent | DomainUpdatedEvent | DomainWarmingUpdatedEvent | MailboxMessageReceivedEvent | MailboxMessageSentEvent | MailboxActionPendingApprovalEvent | MailboxMessageQuarantinedEvent | MailboxMessageReleasedEvent | MailboxMessageDiscardedEvent;
|
|
989
|
+
export interface UnknownWebhookEvent {
|
|
990
|
+
readonly type: string;
|
|
991
|
+
readonly timestamp: string;
|
|
992
|
+
readonly data: unknown;
|
|
993
|
+
}
|
|
994
|
+
export type WebhookEvent = SamvaWebhookEvent | UnknownWebhookEvent;
|
|
995
|
+
export type WebhookEventType = SamvaWebhookEvent["type"];
|
|
996
|
+
export type WebhookPayload<Type extends WebhookEventType> = Extract<SamvaWebhookEvent, {
|
|
997
|
+
readonly type: Type;
|
|
998
|
+
}>["data"];
|