@masters-union/outbound-sdk 0.4.12 → 0.4.14
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/index.d.mts +36 -0
- package/dist/index.d.ts +36 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -540,6 +540,21 @@ interface IncomingWebhookPayload {
|
|
|
540
540
|
}
|
|
541
541
|
/** Internal status a v2 event maps to (past-tense of `event`). */
|
|
542
542
|
type WebhookEventStatus = 'sent' | 'delivered' | 'bounced' | 'complained' | 'opened' | 'clicked' | 'rejected' | 'rendering_failed' | 'dropped' | 'unsubscribed' | 'resubscribed' | 'ping';
|
|
543
|
+
/**
|
|
544
|
+
* Why a recipient unsubscribed.
|
|
545
|
+
*
|
|
546
|
+
* The first four are chosen by the recipient on the unsubscribe page; the last two are
|
|
547
|
+
* assigned by the platform and can never be selected:
|
|
548
|
+
* - `not_specified` — the form was submitted with the optional question unanswered.
|
|
549
|
+
* - `one_click` — RFC 8058 List-Unsubscribe-Post, i.e. the mail client's own
|
|
550
|
+
* unsubscribe button. No page is rendered on that path, so no reason can be asked.
|
|
551
|
+
*
|
|
552
|
+
* Codes are stable and will not be renamed. New codes may be added, so treat this as
|
|
553
|
+
* an open set when switching on it.
|
|
554
|
+
*/
|
|
555
|
+
type UnsubscribeReason = 'too_many_emails' | 'not_relevant' | 'never_signed_up' | 'other' | 'not_specified' | 'one_click';
|
|
556
|
+
/** How an opt-out reached us: the link in the email, the mail client's header button, or the API. */
|
|
557
|
+
type UnsubscribeSource = 'link' | 'one_click' | 'api';
|
|
543
558
|
/** Curated, event-specific details. Only the keys relevant to the event are set. */
|
|
544
559
|
interface WebhookEventDetails {
|
|
545
560
|
/** bounce */
|
|
@@ -566,6 +581,27 @@ interface WebhookEventDetails {
|
|
|
566
581
|
ip?: string | null;
|
|
567
582
|
/** click */
|
|
568
583
|
link?: string | null;
|
|
584
|
+
/**
|
|
585
|
+
* unsubscribe — the reason the recipient gave, as a stable code. Branch on this,
|
|
586
|
+
* not on `unsubscribeReasonLabel`.
|
|
587
|
+
*
|
|
588
|
+
* `not_specified` means they submitted the form without answering the optional
|
|
589
|
+
* question. `one_click` means they used their mail client's own unsubscribe button
|
|
590
|
+
* (RFC 8058 List-Unsubscribe-Post), where no page is shown and so no reason can be
|
|
591
|
+
* asked — it is not a reason they chose.
|
|
592
|
+
*/
|
|
593
|
+
unsubscribeReason?: UnsubscribeReason | null;
|
|
594
|
+
/** unsubscribe — display wording for {@link unsubscribeReason}. May be reworded; do not branch on it. */
|
|
595
|
+
unsubscribeReasonLabel?: string | null;
|
|
596
|
+
/** unsubscribe — how the opt-out reached us. */
|
|
597
|
+
unsubscribeSource?: UnsubscribeSource | null;
|
|
598
|
+
/**
|
|
599
|
+
* unsubscribe — optional free text, only ever collected alongside reason `other`.
|
|
600
|
+
*
|
|
601
|
+
* Recipient-authored and therefore untrusted: it is length-capped and stripped of
|
|
602
|
+
* control characters on the way in, but escape it before rendering it anywhere.
|
|
603
|
+
*/
|
|
604
|
+
unsubscribeComment?: string | null;
|
|
569
605
|
}
|
|
570
606
|
/** A single event inside a v2 webhook delivery. */
|
|
571
607
|
interface IncomingWebhookEventV2 {
|
package/dist/index.d.ts
CHANGED
|
@@ -540,6 +540,21 @@ interface IncomingWebhookPayload {
|
|
|
540
540
|
}
|
|
541
541
|
/** Internal status a v2 event maps to (past-tense of `event`). */
|
|
542
542
|
type WebhookEventStatus = 'sent' | 'delivered' | 'bounced' | 'complained' | 'opened' | 'clicked' | 'rejected' | 'rendering_failed' | 'dropped' | 'unsubscribed' | 'resubscribed' | 'ping';
|
|
543
|
+
/**
|
|
544
|
+
* Why a recipient unsubscribed.
|
|
545
|
+
*
|
|
546
|
+
* The first four are chosen by the recipient on the unsubscribe page; the last two are
|
|
547
|
+
* assigned by the platform and can never be selected:
|
|
548
|
+
* - `not_specified` — the form was submitted with the optional question unanswered.
|
|
549
|
+
* - `one_click` — RFC 8058 List-Unsubscribe-Post, i.e. the mail client's own
|
|
550
|
+
* unsubscribe button. No page is rendered on that path, so no reason can be asked.
|
|
551
|
+
*
|
|
552
|
+
* Codes are stable and will not be renamed. New codes may be added, so treat this as
|
|
553
|
+
* an open set when switching on it.
|
|
554
|
+
*/
|
|
555
|
+
type UnsubscribeReason = 'too_many_emails' | 'not_relevant' | 'never_signed_up' | 'other' | 'not_specified' | 'one_click';
|
|
556
|
+
/** How an opt-out reached us: the link in the email, the mail client's header button, or the API. */
|
|
557
|
+
type UnsubscribeSource = 'link' | 'one_click' | 'api';
|
|
543
558
|
/** Curated, event-specific details. Only the keys relevant to the event are set. */
|
|
544
559
|
interface WebhookEventDetails {
|
|
545
560
|
/** bounce */
|
|
@@ -566,6 +581,27 @@ interface WebhookEventDetails {
|
|
|
566
581
|
ip?: string | null;
|
|
567
582
|
/** click */
|
|
568
583
|
link?: string | null;
|
|
584
|
+
/**
|
|
585
|
+
* unsubscribe — the reason the recipient gave, as a stable code. Branch on this,
|
|
586
|
+
* not on `unsubscribeReasonLabel`.
|
|
587
|
+
*
|
|
588
|
+
* `not_specified` means they submitted the form without answering the optional
|
|
589
|
+
* question. `one_click` means they used their mail client's own unsubscribe button
|
|
590
|
+
* (RFC 8058 List-Unsubscribe-Post), where no page is shown and so no reason can be
|
|
591
|
+
* asked — it is not a reason they chose.
|
|
592
|
+
*/
|
|
593
|
+
unsubscribeReason?: UnsubscribeReason | null;
|
|
594
|
+
/** unsubscribe — display wording for {@link unsubscribeReason}. May be reworded; do not branch on it. */
|
|
595
|
+
unsubscribeReasonLabel?: string | null;
|
|
596
|
+
/** unsubscribe — how the opt-out reached us. */
|
|
597
|
+
unsubscribeSource?: UnsubscribeSource | null;
|
|
598
|
+
/**
|
|
599
|
+
* unsubscribe — optional free text, only ever collected alongside reason `other`.
|
|
600
|
+
*
|
|
601
|
+
* Recipient-authored and therefore untrusted: it is length-capped and stripped of
|
|
602
|
+
* control characters on the way in, but escape it before rendering it anywhere.
|
|
603
|
+
*/
|
|
604
|
+
unsubscribeComment?: string | null;
|
|
569
605
|
}
|
|
570
606
|
/** A single event inside a v2 webhook delivery. */
|
|
571
607
|
interface IncomingWebhookEventV2 {
|