@sendly/node 3.15.3 → 3.17.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 CHANGED
@@ -64,7 +64,7 @@ interface SendMessageRequest {
64
64
  * Message status values
65
65
  * Note: "sending" was removed as it doesn't exist in the database
66
66
  */
67
- type MessageStatus = "queued" | "sent" | "delivered" | "failed" | "bounced";
67
+ type MessageStatus = "queued" | "sent" | "delivered" | "failed" | "bounced" | "retrying";
68
68
  /**
69
69
  * How the message was sent
70
70
  */
@@ -101,6 +101,14 @@ interface Message {
101
101
  * Error message if status is "failed"
102
102
  */
103
103
  error?: string | null;
104
+ /**
105
+ * Structured error code (e.g., "E001" for invalid number)
106
+ */
107
+ errorCode?: string | null;
108
+ /**
109
+ * Number of retry attempts made
110
+ */
111
+ retryCount?: number;
104
112
  /**
105
113
  * Number of SMS segments (1 per 160 chars)
106
114
  */
@@ -625,7 +633,7 @@ declare const ALL_SUPPORTED_COUNTRIES: string[];
625
633
  /**
626
634
  * Webhook event types
627
635
  */
628
- type WebhookEventType = "message.sent" | "message.delivered" | "message.failed" | "message.bounced" | "message.queued";
636
+ type WebhookEventType = "message.sent" | "message.delivered" | "message.failed" | "message.bounced" | "message.retrying" | "message.queued";
629
637
  /**
630
638
  * Webhook mode - filters which events are delivered
631
639
  * - "all": Receives all events (sandbox + production)
@@ -1928,6 +1936,25 @@ declare class WebhooksResource {
1928
1936
  * ```
1929
1937
  */
1930
1938
  test(id: string): Promise<WebhookTestResult>;
1939
+ /**
1940
+ * Reset the circuit breaker for a webhook
1941
+ *
1942
+ * Manually resets an open circuit breaker so deliveries resume immediately
1943
+ * instead of waiting for the automatic 5-minute recovery.
1944
+ *
1945
+ * @param id - Webhook ID
1946
+ * @returns Reset confirmation with updated webhook
1947
+ *
1948
+ * @example
1949
+ * ```typescript
1950
+ * const result = await sendly.webhooks.resetCircuit('whk_xxx');
1951
+ * console.log(result.message);
1952
+ * ```
1953
+ */
1954
+ resetCircuit(id: string): Promise<{
1955
+ message: string;
1956
+ webhook: Webhook;
1957
+ }>;
1931
1958
  /**
1932
1959
  * Rotate the webhook signing secret
1933
1960
  *
package/dist/index.d.ts CHANGED
@@ -64,7 +64,7 @@ interface SendMessageRequest {
64
64
  * Message status values
65
65
  * Note: "sending" was removed as it doesn't exist in the database
66
66
  */
67
- type MessageStatus = "queued" | "sent" | "delivered" | "failed" | "bounced";
67
+ type MessageStatus = "queued" | "sent" | "delivered" | "failed" | "bounced" | "retrying";
68
68
  /**
69
69
  * How the message was sent
70
70
  */
@@ -101,6 +101,14 @@ interface Message {
101
101
  * Error message if status is "failed"
102
102
  */
103
103
  error?: string | null;
104
+ /**
105
+ * Structured error code (e.g., "E001" for invalid number)
106
+ */
107
+ errorCode?: string | null;
108
+ /**
109
+ * Number of retry attempts made
110
+ */
111
+ retryCount?: number;
104
112
  /**
105
113
  * Number of SMS segments (1 per 160 chars)
106
114
  */
@@ -625,7 +633,7 @@ declare const ALL_SUPPORTED_COUNTRIES: string[];
625
633
  /**
626
634
  * Webhook event types
627
635
  */
628
- type WebhookEventType = "message.sent" | "message.delivered" | "message.failed" | "message.bounced" | "message.queued";
636
+ type WebhookEventType = "message.sent" | "message.delivered" | "message.failed" | "message.bounced" | "message.retrying" | "message.queued";
629
637
  /**
630
638
  * Webhook mode - filters which events are delivered
631
639
  * - "all": Receives all events (sandbox + production)
@@ -1928,6 +1936,25 @@ declare class WebhooksResource {
1928
1936
  * ```
1929
1937
  */
1930
1938
  test(id: string): Promise<WebhookTestResult>;
1939
+ /**
1940
+ * Reset the circuit breaker for a webhook
1941
+ *
1942
+ * Manually resets an open circuit breaker so deliveries resume immediately
1943
+ * instead of waiting for the automatic 5-minute recovery.
1944
+ *
1945
+ * @param id - Webhook ID
1946
+ * @returns Reset confirmation with updated webhook
1947
+ *
1948
+ * @example
1949
+ * ```typescript
1950
+ * const result = await sendly.webhooks.resetCircuit('whk_xxx');
1951
+ * console.log(result.message);
1952
+ * ```
1953
+ */
1954
+ resetCircuit(id: string): Promise<{
1955
+ message: string;
1956
+ webhook: Webhook;
1957
+ }>;
1931
1958
  /**
1932
1959
  * Rotate the webhook signing secret
1933
1960
  *
package/dist/index.js CHANGED
@@ -1246,6 +1246,31 @@ var WebhooksResource = class {
1246
1246
  });
1247
1247
  return transformKeys(response);
1248
1248
  }
1249
+ /**
1250
+ * Reset the circuit breaker for a webhook
1251
+ *
1252
+ * Manually resets an open circuit breaker so deliveries resume immediately
1253
+ * instead of waiting for the automatic 5-minute recovery.
1254
+ *
1255
+ * @param id - Webhook ID
1256
+ * @returns Reset confirmation with updated webhook
1257
+ *
1258
+ * @example
1259
+ * ```typescript
1260
+ * const result = await sendly.webhooks.resetCircuit('whk_xxx');
1261
+ * console.log(result.message);
1262
+ * ```
1263
+ */
1264
+ async resetCircuit(id) {
1265
+ if (!id || !id.startsWith("whk_")) {
1266
+ throw new Error("Invalid webhook ID format");
1267
+ }
1268
+ const response = await this.http.request({
1269
+ method: "POST",
1270
+ path: `/webhooks/${encodeURIComponent(id)}/reset-circuit`
1271
+ });
1272
+ return transformKeys(response);
1273
+ }
1249
1274
  /**
1250
1275
  * Rotate the webhook signing secret
1251
1276
  *
package/dist/index.mjs CHANGED
@@ -1186,6 +1186,31 @@ var WebhooksResource = class {
1186
1186
  });
1187
1187
  return transformKeys(response);
1188
1188
  }
1189
+ /**
1190
+ * Reset the circuit breaker for a webhook
1191
+ *
1192
+ * Manually resets an open circuit breaker so deliveries resume immediately
1193
+ * instead of waiting for the automatic 5-minute recovery.
1194
+ *
1195
+ * @param id - Webhook ID
1196
+ * @returns Reset confirmation with updated webhook
1197
+ *
1198
+ * @example
1199
+ * ```typescript
1200
+ * const result = await sendly.webhooks.resetCircuit('whk_xxx');
1201
+ * console.log(result.message);
1202
+ * ```
1203
+ */
1204
+ async resetCircuit(id) {
1205
+ if (!id || !id.startsWith("whk_")) {
1206
+ throw new Error("Invalid webhook ID format");
1207
+ }
1208
+ const response = await this.http.request({
1209
+ method: "POST",
1210
+ path: `/webhooks/${encodeURIComponent(id)}/reset-circuit`
1211
+ });
1212
+ return transformKeys(response);
1213
+ }
1189
1214
  /**
1190
1215
  * Rotate the webhook signing secret
1191
1216
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendly/node",
3
- "version": "3.15.3",
3
+ "version": "3.17.0",
4
4
  "description": "Official Sendly Node.js SDK for SMS messaging",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",