@messagebird/sdk 0.39.0 → 0.40.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
@@ -13306,7 +13306,7 @@ type VerifyVerificationsCheckParams = NonNullable<CreateVerificationCheckData["b
13306
13306
  type VerifyVerificationsNextChannelParams = NonNullable<CreateVerificationNextChannelData["body"]>;
13307
13307
  declare class VerifyVerificationsResource extends Resource {
13308
13308
  /**
13309
- * Start a verification and send a one-time passcode to the email address, phone number, or both in `to`. Delivery uses one planned channel at a time and fails over when necessary. Calling again for the same recipient reuses the verification in progress and sends after the resend cooldown. The passcode is never returned; submit the recipient's code with `verify.verifications.check`. SMS, WhatsApp, and Telegram delivery draw on the workspace's balance.
13309
+ * Start a verification and send a one-time passcode to the email address, phone number, or both in `to`. Delivery uses one planned channel at a time and fails over when necessary. Calling again for the same recipient reuses the verification in progress and sends after the resend cooldown; each send past the cooldown spends one of the recipient's hourly send slots, so repeated resends can hit the cap and return 429. The passcode is never returned; submit the recipient's code with `verify.verifications.check`. SMS, WhatsApp, and Telegram delivery draw on the workspace's balance.
13310
13310
  *
13311
13311
  * @example Start a verification over SMS
13312
13312
  * const verification = await bird.verify.verifications.create({
@@ -13316,7 +13316,7 @@ declare class VerifyVerificationsResource extends Resource {
13316
13316
  */
13317
13317
  create(params: VerifyVerificationsCreateParams, options?: RequestOptions): APIPromise<Verification>;
13318
13318
  /**
13319
- * Check a passcode a recipient submitted. Identify the verification by the same `to` recipient used to start it; no verification ID is needed. A wrong or expired code returns HTTP 200 with `success: false` and a `reason` (for example `incorrect_code` or `expired`). A verification that has already reached a final state is no longer checkable and returns 404, as does a missing verification; malformed input or rate limiting is also an error status.
13319
+ * Check a passcode a recipient submitted. Identify the verification by the same `to` recipient used to start it; no verification ID is needed. A wrong or expired code returns HTTP 200 with `success: false` and a `reason` (for example `incorrect_code` or `expired`). A verification that has already reached a final state is no longer checkable and returns 404 `E13000`, as does a missing verification, so a 404 does not tell you the recipient failed: treat an earlier `success: true` as the outcome rather than re-checking. Malformed input or rate limiting is also an error status.
13320
13320
  *
13321
13321
  * @example Check a submitted passcode
13322
13322
  * const result = await bird.verify.verifications.check({
package/dist/index.mjs CHANGED
@@ -2819,7 +2819,7 @@ const createEmailLookup = (options) => (options.client ?? client).post({
2819
2819
  *
2820
2820
  * Creates a verification and sends the recipient a one-time passcode. Provide an email address, a phone number, or both in `to`. The service sends over one channel at a time and moves to the next planned channel if delivery fails.
2821
2821
  *
2822
- * Calling this again for the same recipient reuses the verification in progress. During the resend cooldown, it returns the current state without sending. After the cooldown, it sends a fresh passcode.
2822
+ * Calling this again for the same recipient reuses the verification in progress. During the resend cooldown, it returns the current state without sending, so nothing is charged and no send budget is spent. After the cooldown, it sends a fresh passcode, and that send draws on the recipient's hourly send cap exactly as a new verification does, so repeated resends can exhaust the cap and return `429` for the rest of that rolling hour. [Abuse guardrails](/docs/guides/verify/sending-verifications#abuse-guardrails) gives the figures.
2823
2823
  *
2824
2824
  * The `200` response contains the current state, never the passcode. Submit the recipient's passcode with [Check a verification](/docs/api/reference/create-verification-check) before `expires_at`. An invalid recipient returns `422`; exceeding the send rate limit returns `429`.
2825
2825
  *
@@ -2847,10 +2847,14 @@ const createVerification = (options) => (options.client ?? client).post({
2847
2847
  *
2848
2848
  * A wrong or expired passcode returns `200 OK` with `success: false` and a `reason` such as `incorrect_code` or `expired`. `success: true` means the verification is complete. Each verification reports its final outcome once and cannot be checked again.
2849
2849
  *
2850
- * An error status is returned only when the check cannot be evaluated. A `404`
2851
- * means no verification matches the recipient or the matching one already
2852
- * reached its final state. A `422` indicates an invalid recipient. A `429`
2853
- * means passcodes for a recipient are being checked too quickly.
2850
+ * An error status is returned only when the check cannot be evaluated. A `404
2851
+ * E13000` means no active verification matched the recipient: either none
2852
+ * exists for it, or the most recent one is already resolved as verified,
2853
+ * expired, or out of attempts. One code covers all of those, so a `404` is not
2854
+ * evidence the recipient failed to verify. Treat your own record of an earlier
2855
+ * `success: true` as the outcome, and create a new verification only if the
2856
+ * recipient still needs to verify. A `422` indicates an invalid recipient. A
2857
+ * `429` means passcodes for a recipient are being checked too quickly.
2854
2858
  *
2855
2859
  */
2856
2860
  const createVerificationCheck = (options) => (options.client ?? client).post({
@@ -2874,9 +2878,9 @@ const createVerificationCheck = (options) => (options.client ?? client).post({
2874
2878
  *
2875
2879
  * Advances an in-progress verification to the next channel in its plan and sends a fresh passcode there. Identify the verification by the same `to` recipient used to create it; no verification ID is required.
2876
2880
  *
2877
- * The send bypasses the resend cooldown, and passcodes sent earlier remain valid. The response sets `last_channel` to the most recent completed send. Concurrent requests each advance the plan by at most one channel and return committed state.
2881
+ * The send bypasses the resend cooldown and does not draw on the recipient's hourly send cap; what bounds it is the channel plan, since each call advances by at most one channel. Passcodes sent earlier remain valid. The response sets `last_channel` to the most recent completed send. Concurrent requests each advance the plan by at most one channel and return committed state.
2878
2882
  *
2879
- * A missing in-progress verification returns `404`. A plan with no further channel returns `422 NoNextChannel`; create the verification again to resend on the current channel. If every remaining channel fails, the operation returns `422 NoAvailableChannel`. Requests that exceed the send rate limit return `429`.
2883
+ * A recipient with no in-progress verification returns `404 E13000`, whether none was ever created or the most recent one is already resolved. A recipient who has already verified is in that set, so a `404` here is not evidence they still need verifying, and creating another verification would send a passcode they no longer need. A plan with no further channel returns `422 NoNextChannel`; create the verification again to resend on the current channel. If every remaining channel fails, the operation returns `422 NoAvailableChannel`. Requests that exceed the send rate limit return `429`.
2880
2884
  *
2881
2885
  */
2882
2886
  const createVerificationNextChannel = (options) => (options.client ?? client).post({
@@ -6465,7 +6469,7 @@ var VoiceResource = class extends Resource {
6465
6469
  //#region src/resources/verifyVerifications.gen.ts
6466
6470
  var VerifyVerificationsResource = class extends Resource {
6467
6471
  /**
6468
- * Start a verification and send a one-time passcode to the email address, phone number, or both in `to`. Delivery uses one planned channel at a time and fails over when necessary. Calling again for the same recipient reuses the verification in progress and sends after the resend cooldown. The passcode is never returned; submit the recipient's code with `verify.verifications.check`. SMS, WhatsApp, and Telegram delivery draw on the workspace's balance.
6472
+ * Start a verification and send a one-time passcode to the email address, phone number, or both in `to`. Delivery uses one planned channel at a time and fails over when necessary. Calling again for the same recipient reuses the verification in progress and sends after the resend cooldown; each send past the cooldown spends one of the recipient's hourly send slots, so repeated resends can hit the cap and return 429. The passcode is never returned; submit the recipient's code with `verify.verifications.check`. SMS, WhatsApp, and Telegram delivery draw on the workspace's balance.
6469
6473
  *
6470
6474
  * @example Start a verification over SMS
6471
6475
  * const verification = await bird.verify.verifications.create({
@@ -6482,7 +6486,7 @@ var VerifyVerificationsResource = class extends Resource {
6482
6486
  }));
6483
6487
  }
6484
6488
  /**
6485
- * Check a passcode a recipient submitted. Identify the verification by the same `to` recipient used to start it; no verification ID is needed. A wrong or expired code returns HTTP 200 with `success: false` and a `reason` (for example `incorrect_code` or `expired`). A verification that has already reached a final state is no longer checkable and returns 404, as does a missing verification; malformed input or rate limiting is also an error status.
6489
+ * Check a passcode a recipient submitted. Identify the verification by the same `to` recipient used to start it; no verification ID is needed. A wrong or expired code returns HTTP 200 with `success: false` and a `reason` (for example `incorrect_code` or `expired`). A verification that has already reached a final state is no longer checkable and returns 404 `E13000`, as does a missing verification, so a 404 does not tell you the recipient failed: treat an earlier `success: true` as the outcome rather than re-checking. Malformed input or rate limiting is also an error status.
6486
6490
  *
6487
6491
  * @example Check a submitted passcode
6488
6492
  * const result = await bird.verify.verifications.check({
@@ -7378,9 +7382,9 @@ var BirdClient = class {
7378
7382
  this.#headers = {
7379
7383
  ...opts.defaultHeaders,
7380
7384
  Authorization: `Bearer ${opts.apiKey}`,
7381
- "User-Agent": `bird-sdk-js/0.39.0`,
7385
+ "User-Agent": `bird-sdk-js/0.40.0`,
7382
7386
  "Bird-Surface": "sdk-js",
7383
- "Bird-Version": "0.39.0"
7387
+ "Bird-Version": "0.40.0"
7384
7388
  };
7385
7389
  const caller = detectCaller();
7386
7390
  if (caller) this.#headers["Bird-Caller"] = caller;