@sendly/node 3.0.0 → 3.1.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/index.d.mts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +2 -0
- package/dist/index.mjs +2 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -510,6 +510,13 @@ declare const ALL_SUPPORTED_COUNTRIES: string[];
|
|
|
510
510
|
* Webhook event types
|
|
511
511
|
*/
|
|
512
512
|
type WebhookEventType = "message.sent" | "message.delivered" | "message.failed" | "message.bounced" | "message.queued";
|
|
513
|
+
/**
|
|
514
|
+
* Webhook mode - filters which events are delivered
|
|
515
|
+
* - "all": Receives all events (sandbox + production)
|
|
516
|
+
* - "test": Only sandbox/test events (livemode: false)
|
|
517
|
+
* - "live": Only production events (livemode: true) - requires verification
|
|
518
|
+
*/
|
|
519
|
+
type WebhookMode = "all" | "test" | "live";
|
|
513
520
|
/**
|
|
514
521
|
* Circuit breaker state for webhook delivery
|
|
515
522
|
*/
|
|
@@ -530,6 +537,8 @@ interface Webhook {
|
|
|
530
537
|
events: WebhookEventType[];
|
|
531
538
|
/** Optional description */
|
|
532
539
|
description?: string;
|
|
540
|
+
/** Event mode filter */
|
|
541
|
+
mode: WebhookMode;
|
|
533
542
|
/** Whether the webhook is active */
|
|
534
543
|
isActive: boolean;
|
|
535
544
|
/** Number of consecutive failures */
|
|
@@ -574,6 +583,8 @@ interface CreateWebhookOptions {
|
|
|
574
583
|
events: WebhookEventType[];
|
|
575
584
|
/** Optional description */
|
|
576
585
|
description?: string;
|
|
586
|
+
/** Event mode filter (defaults to "all") */
|
|
587
|
+
mode?: WebhookMode;
|
|
577
588
|
/** Custom metadata */
|
|
578
589
|
metadata?: Record<string, unknown>;
|
|
579
590
|
}
|
|
@@ -587,6 +598,8 @@ interface UpdateWebhookOptions {
|
|
|
587
598
|
events?: WebhookEventType[];
|
|
588
599
|
/** New description */
|
|
589
600
|
description?: string;
|
|
601
|
+
/** Event mode filter */
|
|
602
|
+
mode?: WebhookMode;
|
|
590
603
|
/** Enable/disable webhook */
|
|
591
604
|
isActive?: boolean;
|
|
592
605
|
/** Custom metadata */
|
package/dist/index.d.ts
CHANGED
|
@@ -510,6 +510,13 @@ declare const ALL_SUPPORTED_COUNTRIES: string[];
|
|
|
510
510
|
* Webhook event types
|
|
511
511
|
*/
|
|
512
512
|
type WebhookEventType = "message.sent" | "message.delivered" | "message.failed" | "message.bounced" | "message.queued";
|
|
513
|
+
/**
|
|
514
|
+
* Webhook mode - filters which events are delivered
|
|
515
|
+
* - "all": Receives all events (sandbox + production)
|
|
516
|
+
* - "test": Only sandbox/test events (livemode: false)
|
|
517
|
+
* - "live": Only production events (livemode: true) - requires verification
|
|
518
|
+
*/
|
|
519
|
+
type WebhookMode = "all" | "test" | "live";
|
|
513
520
|
/**
|
|
514
521
|
* Circuit breaker state for webhook delivery
|
|
515
522
|
*/
|
|
@@ -530,6 +537,8 @@ interface Webhook {
|
|
|
530
537
|
events: WebhookEventType[];
|
|
531
538
|
/** Optional description */
|
|
532
539
|
description?: string;
|
|
540
|
+
/** Event mode filter */
|
|
541
|
+
mode: WebhookMode;
|
|
533
542
|
/** Whether the webhook is active */
|
|
534
543
|
isActive: boolean;
|
|
535
544
|
/** Number of consecutive failures */
|
|
@@ -574,6 +583,8 @@ interface CreateWebhookOptions {
|
|
|
574
583
|
events: WebhookEventType[];
|
|
575
584
|
/** Optional description */
|
|
576
585
|
description?: string;
|
|
586
|
+
/** Event mode filter (defaults to "all") */
|
|
587
|
+
mode?: WebhookMode;
|
|
577
588
|
/** Custom metadata */
|
|
578
589
|
metadata?: Record<string, unknown>;
|
|
579
590
|
}
|
|
@@ -587,6 +598,8 @@ interface UpdateWebhookOptions {
|
|
|
587
598
|
events?: WebhookEventType[];
|
|
588
599
|
/** New description */
|
|
589
600
|
description?: string;
|
|
601
|
+
/** Event mode filter */
|
|
602
|
+
mode?: WebhookMode;
|
|
590
603
|
/** Enable/disable webhook */
|
|
591
604
|
isActive?: boolean;
|
|
592
605
|
/** Custom metadata */
|
package/dist/index.js
CHANGED
|
@@ -1041,6 +1041,7 @@ var WebhooksResource = class {
|
|
|
1041
1041
|
url: options.url,
|
|
1042
1042
|
events: options.events,
|
|
1043
1043
|
...options.description && { description: options.description },
|
|
1044
|
+
...options.mode && { mode: options.mode },
|
|
1044
1045
|
...options.metadata && { metadata: options.metadata }
|
|
1045
1046
|
}
|
|
1046
1047
|
});
|
|
@@ -1131,6 +1132,7 @@ var WebhooksResource = class {
|
|
|
1131
1132
|
description: options.description
|
|
1132
1133
|
},
|
|
1133
1134
|
...options.isActive !== void 0 && { is_active: options.isActive },
|
|
1135
|
+
...options.mode !== void 0 && { mode: options.mode },
|
|
1134
1136
|
...options.metadata !== void 0 && { metadata: options.metadata }
|
|
1135
1137
|
}
|
|
1136
1138
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -981,6 +981,7 @@ var WebhooksResource = class {
|
|
|
981
981
|
url: options.url,
|
|
982
982
|
events: options.events,
|
|
983
983
|
...options.description && { description: options.description },
|
|
984
|
+
...options.mode && { mode: options.mode },
|
|
984
985
|
...options.metadata && { metadata: options.metadata }
|
|
985
986
|
}
|
|
986
987
|
});
|
|
@@ -1071,6 +1072,7 @@ var WebhooksResource = class {
|
|
|
1071
1072
|
description: options.description
|
|
1072
1073
|
},
|
|
1073
1074
|
...options.isActive !== void 0 && { is_active: options.isActive },
|
|
1075
|
+
...options.mode !== void 0 && { mode: options.mode },
|
|
1074
1076
|
...options.metadata !== void 0 && { metadata: options.metadata }
|
|
1075
1077
|
}
|
|
1076
1078
|
});
|