@messagebird/sdk 0.34.0 → 0.36.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
@@ -368,6 +368,8 @@ type WebhookEvent = ({
368
368
  } & EventSmsSent) | ({
369
369
  type: "sms.undelivered";
370
370
  } & EventSmsUndelivered) | ({
371
+ type: "sms_suppression.created";
372
+ } & EventSmsSuppressionCreated) | ({
371
373
  type: "verify.attempt.delivered";
372
374
  } & EventVerifyAttemptDelivered) | ({
373
375
  type: "verify.attempt.sent";
@@ -2105,10 +2107,25 @@ type SmsSuppressionCreate = {
2105
2107
  originator: string;
2106
2108
  };
2107
2109
  /**
2108
- * Action taken when an inbound message matches the rule. `stop` unsubscribes the sender, `start` resubscribes them, `help` sends your support information, and `custom` sends the reply you configured. Built-in compliance rules fix the operation for `stop`, `start`, and `help`. This is an open enum. Accept unrecognized values.
2110
+ * What Bird does when an inbound message matches the rule.
2111
+ *
2112
+ * - `stop` unsubscribes the sender from further messages.
2113
+ * - `start` resubscribes them.
2114
+ * - `help` replies with your support information.
2115
+ * - `info` replies with your program information. It behaves exactly as `help` does and is
2116
+ * separate so a country whose INFO answer must differ from its HELP answer can carry both.
2117
+ * Where Bird ships no `info` rule for a country, INFO is one of that country's `help`
2118
+ * keywords and answers with the `help` reply.
2119
+ * - `confirm` marks a double opt-in reply. It sends nothing today, so answer it from your own
2120
+ * handler.
2121
+ * - `custom` replies with the text you configured and has no other effect.
2122
+ *
2123
+ * Bird's built-in rules fix the operation for `stop`, `start` and `help`; you can change their
2124
+ * reply but not what they do. The same holds for `info` in any country where Bird ships an
2125
+ * `info` rule. This is an open enum. Accept unrecognized values.
2109
2126
  *
2110
2127
  */
2111
- type SmsKeywordOperation = "stop" | "start" | "help" | "custom" | (string & {});
2128
+ type SmsKeywordOperation = "stop" | "start" | "help" | "info" | "confirm" | "custom" | (string & {});
2112
2129
  /**
2113
2130
  * Whether the rule is one of Bird's defaults (`system`) or one your workspace created (`workspace`). A `workspace` rule takes precedence over Bird's default for the same country, so it is how you replace a reply without losing the keywords Bird ships.
2114
2131
  *
@@ -7353,6 +7370,43 @@ type EventSmsUndelivered = {
7353
7370
  timestamp: string;
7354
7371
  data: EventSmsUndeliveredData;
7355
7372
  };
7373
+ /**
7374
+ * Always `sms_suppression.created` for this event.
7375
+ */
7376
+ type SmsSuppressionCreatedEventType = "sms_suppression.created";
7377
+ /**
7378
+ * Payload of the sms_suppression.created event.
7379
+ */
7380
+ type EventSmsSuppressionCreatedData = {
7381
+ /**
7382
+ * The suppression episode that was opened.
7383
+ */
7384
+ suppression_id: SmsSuppressionId;
7385
+ /**
7386
+ * The subscriber, in E.164 format.
7387
+ */
7388
+ destination: string;
7389
+ /**
7390
+ * The sender this stops. An SMS suppression is the exact (sender, recipient) pair, so your other senders still reach this subscriber.
7391
+ */
7392
+ originator: string;
7393
+ reason: SmsSuppressionReason;
7394
+ /**
7395
+ * The workspace the suppression belongs to.
7396
+ */
7397
+ workspace_id: WorkspaceId;
7398
+ };
7399
+ /**
7400
+ * A destination was added to the workspace's SMS suppression ledger: a subscriber's STOP, a carrier opt-out, or a manual add.
7401
+ */
7402
+ type EventSmsSuppressionCreated = {
7403
+ type: SmsSuppressionCreatedEventType;
7404
+ /**
7405
+ * When the episode's opening statement took effect (`effective_at`).
7406
+ */
7407
+ timestamp: string;
7408
+ data: EventSmsSuppressionCreatedData;
7409
+ };
7356
7410
  /**
7357
7411
  * Identity fields shared by every Verify lifecycle event payload.
7358
7412
  */
@@ -13285,6 +13339,7 @@ declare const WebhookEventType: {
13285
13339
  readonly SmsReceived: "sms.received";
13286
13340
  readonly SmsRejected: "sms.rejected";
13287
13341
  readonly SmsSent: "sms.sent";
13342
+ readonly SmsSuppressionCreated: "sms_suppression.created";
13288
13343
  readonly SmsUndelivered: "sms.undelivered";
13289
13344
  readonly VerifyAttemptDelivered: "verify.attempt.delivered";
13290
13345
  readonly VerifyAttemptSent: "verify.attempt.sent";
@@ -13457,8 +13512,10 @@ type SMSErrorCodeValue = (typeof SMSErrorCode)[keyof typeof SMSErrorCode];
13457
13512
  * these with a `default` branch rather than treating the set as closed.
13458
13513
  */
13459
13514
  declare const SMSKeywordOperation: {
13515
+ readonly Confirm: "confirm";
13460
13516
  readonly Custom: "custom";
13461
13517
  readonly Help: "help";
13518
+ readonly Info: "info";
13462
13519
  readonly Start: "start";
13463
13520
  readonly Stop: "stop";
13464
13521
  };
package/dist/index.mjs CHANGED
@@ -7132,9 +7132,9 @@ var BirdClient = class {
7132
7132
  this.#headers = {
7133
7133
  ...opts.defaultHeaders,
7134
7134
  Authorization: `Bearer ${opts.apiKey}`,
7135
- "User-Agent": `bird-sdk-js/0.34.0`,
7135
+ "User-Agent": `bird-sdk-js/0.36.0`,
7136
7136
  "Bird-Surface": "sdk-js",
7137
- "Bird-Version": "0.34.0"
7137
+ "Bird-Version": "0.36.0"
7138
7138
  };
7139
7139
  const caller = detectCaller();
7140
7140
  if (caller) this.#headers["Bird-Caller"] = caller;
@@ -7265,6 +7265,7 @@ const WebhookEventType = {
7265
7265
  SmsReceived: "sms.received",
7266
7266
  SmsRejected: "sms.rejected",
7267
7267
  SmsSent: "sms.sent",
7268
+ SmsSuppressionCreated: "sms_suppression.created",
7268
7269
  SmsUndelivered: "sms.undelivered",
7269
7270
  VerifyAttemptDelivered: "verify.attempt.delivered",
7270
7271
  VerifyAttemptSent: "verify.attempt.sent",
@@ -7413,8 +7414,10 @@ const SMSErrorCode = {
7413
7414
  * these with a `default` branch rather than treating the set as closed.
7414
7415
  */
7415
7416
  const SMSKeywordOperation = {
7417
+ Confirm: "confirm",
7416
7418
  Custom: "custom",
7417
7419
  Help: "help",
7420
+ Info: "info",
7418
7421
  Start: "start",
7419
7422
  Stop: "stop"
7420
7423
  };