@sentroy-co/client-sdk 2.5.2 → 2.6.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.
- package/README.md +114 -0
- package/dist/http.d.ts +8 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +10 -0
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/audience.d.ts +60 -0
- package/dist/resources/audience.d.ts.map +1 -0
- package/dist/resources/audience.js +108 -0
- package/dist/resources/audience.js.map +1 -0
- package/dist/resources/logs.d.ts +15 -0
- package/dist/resources/logs.d.ts.map +1 -0
- package/dist/resources/logs.js +36 -0
- package/dist/resources/logs.js.map +1 -0
- package/dist/resources/suppressions.d.ts +20 -0
- package/dist/resources/suppressions.d.ts.map +1 -0
- package/dist/resources/suppressions.js +39 -0
- package/dist/resources/suppressions.js.map +1 -0
- package/dist/resources/webhooks.d.ts +21 -0
- package/dist/resources/webhooks.d.ts.map +1 -0
- package/dist/resources/webhooks.js +35 -0
- package/dist/resources/webhooks.js.map +1 -0
- package/dist/types.d.ts +128 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/http.ts +11 -0
- package/src/index.ts +30 -0
- package/src/resources/audience.ts +139 -0
- package/src/resources/logs.ts +27 -0
- package/src/resources/suppressions.ts +39 -0
- package/src/resources/webhooks.ts +47 -0
- package/src/types.ts +161 -0
package/src/types.ts
CHANGED
|
@@ -322,3 +322,164 @@ export interface StorageUsage {
|
|
|
322
322
|
buckets: StorageUsageBucket[]
|
|
323
323
|
byType: StorageUsageByType[]
|
|
324
324
|
}
|
|
325
|
+
|
|
326
|
+
// ── Audience / Contacts ───────────────────────────────────────────────────
|
|
327
|
+
|
|
328
|
+
export type ContactStatus = "active" | "unsubscribed" | "bounced"
|
|
329
|
+
|
|
330
|
+
export interface Contact {
|
|
331
|
+
id: string
|
|
332
|
+
companyId: string
|
|
333
|
+
email: string
|
|
334
|
+
name?: string
|
|
335
|
+
tags: string[]
|
|
336
|
+
status: ContactStatus
|
|
337
|
+
metadata: Record<string, unknown>
|
|
338
|
+
lastEmailedAt?: string | null
|
|
339
|
+
createdAt: string
|
|
340
|
+
updatedAt: string
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export interface ContactList {
|
|
344
|
+
id: string
|
|
345
|
+
companyId: string
|
|
346
|
+
name: string
|
|
347
|
+
description?: string
|
|
348
|
+
memberCount?: number
|
|
349
|
+
createdAt: string
|
|
350
|
+
updatedAt: string
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export interface CreateContactParams {
|
|
354
|
+
email: string
|
|
355
|
+
name?: string
|
|
356
|
+
tags?: string[]
|
|
357
|
+
metadata?: Record<string, unknown>
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface UpdateContactParams {
|
|
361
|
+
email?: string
|
|
362
|
+
name?: string
|
|
363
|
+
tags?: string[]
|
|
364
|
+
status?: ContactStatus
|
|
365
|
+
metadata?: Record<string, unknown>
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export interface ContactListParams {
|
|
369
|
+
page?: number
|
|
370
|
+
limit?: number
|
|
371
|
+
status?: ContactStatus
|
|
372
|
+
/** Comma-joined when sent over the wire — pass an array, the SDK joins. */
|
|
373
|
+
tags?: string[]
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export interface ContactListResult {
|
|
377
|
+
contacts: Contact[]
|
|
378
|
+
total: number
|
|
379
|
+
page: number
|
|
380
|
+
limit: number
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export interface CreateAudienceListParams {
|
|
384
|
+
name: string
|
|
385
|
+
description?: string
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// ── Suppressions ──────────────────────────────────────────────────────────
|
|
389
|
+
|
|
390
|
+
export interface Suppression {
|
|
391
|
+
id: string
|
|
392
|
+
email: string
|
|
393
|
+
reason: string
|
|
394
|
+
domainId: string
|
|
395
|
+
createdAt: string
|
|
396
|
+
domain?: { domain: string }
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export interface AddSuppressionParams {
|
|
400
|
+
email: string
|
|
401
|
+
/** Free-form label (e.g. "manual", "complaint"). Defaults backend-side. */
|
|
402
|
+
reason?: string
|
|
403
|
+
domainId: string
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export interface SuppressionListParams {
|
|
407
|
+
page?: number
|
|
408
|
+
limit?: number
|
|
409
|
+
domainId?: string
|
|
410
|
+
reason?: string
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// ── Webhooks ──────────────────────────────────────────────────────────────
|
|
414
|
+
|
|
415
|
+
export type WebhookEvent =
|
|
416
|
+
| "sent"
|
|
417
|
+
| "bounced"
|
|
418
|
+
| "failed"
|
|
419
|
+
| "opened"
|
|
420
|
+
| "clicked"
|
|
421
|
+
| "unsubscribed"
|
|
422
|
+
|
|
423
|
+
export interface Webhook {
|
|
424
|
+
id: string
|
|
425
|
+
url: string
|
|
426
|
+
events: string[]
|
|
427
|
+
active: boolean
|
|
428
|
+
domainId: string
|
|
429
|
+
/** Returned only on create — used to verify HMAC signatures of deliveries. */
|
|
430
|
+
secret?: string
|
|
431
|
+
createdAt: string
|
|
432
|
+
updatedAt: string
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export interface CreateWebhookParams {
|
|
436
|
+
url: string
|
|
437
|
+
events: WebhookEvent[] | string[]
|
|
438
|
+
domainId: string
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export interface UpdateWebhookParams {
|
|
442
|
+
url?: string
|
|
443
|
+
events?: WebhookEvent[] | string[]
|
|
444
|
+
active?: boolean
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// ── Logs ──────────────────────────────────────────────────────────────────
|
|
448
|
+
|
|
449
|
+
export type MailLogStatus =
|
|
450
|
+
| "queued"
|
|
451
|
+
| "processing"
|
|
452
|
+
| "sent"
|
|
453
|
+
| "bounced"
|
|
454
|
+
| "failed"
|
|
455
|
+
|
|
456
|
+
export interface MailLog {
|
|
457
|
+
id: string
|
|
458
|
+
to: string
|
|
459
|
+
from: string
|
|
460
|
+
subject: string
|
|
461
|
+
status: MailLogStatus
|
|
462
|
+
messageId: string | null
|
|
463
|
+
domainId: string
|
|
464
|
+
domain?: { domain: string }
|
|
465
|
+
templateId: string | null
|
|
466
|
+
variables: Record<string, unknown> | null
|
|
467
|
+
scheduledAt?: string | null
|
|
468
|
+
sentAt: string | null
|
|
469
|
+
bouncedAt: string | null
|
|
470
|
+
openedAt?: string | null
|
|
471
|
+
clickedAt?: string | null
|
|
472
|
+
error: string | null
|
|
473
|
+
createdAt: string
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export interface LogListParams {
|
|
477
|
+
page?: number
|
|
478
|
+
limit?: number
|
|
479
|
+
status?: MailLogStatus
|
|
480
|
+
domainId?: string
|
|
481
|
+
/** ISO timestamp lower bound (inclusive). */
|
|
482
|
+
from?: string
|
|
483
|
+
/** ISO timestamp upper bound (inclusive). */
|
|
484
|
+
to?: string
|
|
485
|
+
}
|