@messagebird/sdk 0.21.2 → 0.23.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @messagebird/sdk
2
2
 
3
- The official TypeScript SDK for the [Bird](https://bird.com) API fully typed, edge-ready, ESM.
3
+ The official TypeScript SDK for the [Bird](https://bird.com) API: email, SMS, WhatsApp, verification, and Realtime, over one typed client. Fully typed, edge-ready, ESM.
4
4
 
5
5
  📚 **Documentation:** https://bird.com/docs/sdks/typescript
6
6
 
package/dist/index.d.mts CHANGED
@@ -4508,42 +4508,29 @@ type SmsBatchSummary = {
4508
4508
  accepted_count: number;
4509
4509
  };
4510
4510
  /**
4511
- * Per-component cost breakdown. Returned on single-message reads; omitted from list rows.
4511
+ * What was charged for a message, split into the components that make it up. Null until at least one component has been priced.
4512
+ *
4512
4513
  */
4513
- type SmsCostBreakdown = {
4514
- /**
4515
- * Per-segment price as a decimal string.
4516
- */
4517
- per_segment: string;
4518
- /**
4519
- * Number of billable segments.
4520
- */
4521
- segments: number;
4514
+ type MessageCost = {
4522
4515
  /**
4523
- * ISO 3166-1 alpha-2 destination country the price was resolved for.
4524
- */
4525
- country_code: string;
4526
- /**
4527
- * Carrier surcharge component as a decimal string (for example US 10DLC fees). `0.0000` when none applies.
4516
+ * Total charged, as a decimal string: the sum of the components below. Net of tax, which applies to your wallet balance rather than to an individual charge.
4517
+ *
4528
4518
  */
4529
- carrier_surcharge: string;
4530
- };
4531
- /**
4532
- * Cost of the message. Null until the message has been priced; the cost is populated as the message is processed, not at the moment it is accepted.
4533
- */
4534
- type SmsCost = {
4519
+ readonly amount: string;
4535
4520
  /**
4536
- * ISO 4217 currency code for the cost amount. Omitted when the cost is not denominated in a currency (for example a zero-priced internal send).
4521
+ * ISO 4217 currency code. Every component is denominated in this currency.
4537
4522
  */
4538
- readonly currency_code?: CurrencyCode;
4523
+ readonly currency_code: CurrencyCode;
4539
4524
  /**
4540
- * Total cost as a decimal string: the per-segment rate multiplied by the segment count, plus any surcharges.
4525
+ * What Bird charged to carry the message, as a decimal string. Null when this component was not priced; `"0.00000"` when it priced at zero.
4526
+ *
4541
4527
  */
4542
- readonly amount: string;
4528
+ readonly transaction_amount: string | null;
4543
4529
  /**
4544
- * Per-component cost breakdown. Returned on single-message reads; omitted from list rows.
4530
+ * Third-party fees Bird passes on, as a decimal string, such as US 10DLC carrier surcharges. Null when this component was not priced; `"0.00000"` when it priced at zero.
4531
+ *
4545
4532
  */
4546
- breakdown?: SmsCostBreakdown;
4533
+ readonly passthrough_amount: string | null;
4547
4534
  } | null;
4548
4535
  /**
4549
4536
  * Segment breakdown for the message body. Segment count drives billing.
@@ -4601,9 +4588,9 @@ type SmsMessage = {
4601
4588
  */
4602
4589
  segments: SmsSegments;
4603
4590
  /**
4604
- * Cost of the message. Null until the message has been priced.
4591
+ * What the message cost, split into Bird's charge and any third-party fees passed through. Null until the message has been priced.
4605
4592
  */
4606
- cost?: SmsCost;
4593
+ cost?: MessageCost;
4607
4594
  /**
4608
4595
  * Structured `{name, value}` filter labels applied to this message.
4609
4596
  */
@@ -6277,6 +6264,10 @@ type ListWhatsAppMessagesData = {
6277
6264
  * Filter by business-scoped user ID (Meta identifier).
6278
6265
  */
6279
6266
  bsuid?: string;
6267
+ /**
6268
+ * Filter by category.
6269
+ */
6270
+ category?: WhatsAppTemplateCategory$1;
6280
6271
  /**
6281
6272
  * Filter by tag. Accepts `name` to match any message carrying that tag name, or `name:value` to match a specific tag pair (e.g. `category:welcome`). Repeat the parameter to AND-combine several tag filters.
6282
6273
  *
@@ -8676,7 +8667,7 @@ declare class WhatsappResourceBase extends Resource {
8676
8667
  */
8677
8668
  get(messageId: string, options?: RequestOptions): APIPromise<WhatsAppMessage>;
8678
8669
  /**
8679
- * List WhatsApp messages, newest first, as a cursor page ({data, next_cursor, …}). Pass next_cursor back as starting_after to fetch the next page. Filter by direction, status, contact phone number, bsuid, or tag. Use whatsapp_get for one message's current state.
8670
+ * List WhatsApp messages, newest first, as a cursor page ({data, next_cursor, …}). Pass next_cursor back as starting_after to fetch the next page. Filter by direction, status, contact phone number, bsuid, template category, or tag. Use whatsapp_get for one message's current state.
8680
8671
  *
8681
8672
  * @example Iterate delivered messages
8682
8673
  * for await (const msg of bird.whatsapp.list({ status: ["delivered"] })) {
package/dist/index.mjs CHANGED
@@ -2140,7 +2140,7 @@ const createVerificationCheck = (options) => (options.client ?? client).post({
2140
2140
  /**
2141
2141
  * List WhatsApp messages
2142
2142
  *
2143
- * Returns the workspace's WhatsApp messages as a cursor-paginated list, newest first. Filter by direction, status, contact phone number, business-scoped user ID, tag, or creation time; pass the response's `next_cursor` back as `starting_after` to fetch the next page. To follow a single message's delivery, use [Get a WhatsApp message](/docs/api/reference/get-whats-app-message) instead.
2143
+ * Returns the workspace's WhatsApp messages as a cursor-paginated list, newest first. Filter by direction, status, contact phone number, business-scoped user ID, template category, tag, or creation time; pass the response's `next_cursor` back as `starting_after` to fetch the next page. To follow a single message's delivery, use [Get a WhatsApp message](/docs/api/reference/get-whats-app-message) instead.
2144
2144
  *
2145
2145
  */
2146
2146
  const listWhatsAppMessages = (options) => (options?.client ?? client).get({
@@ -4701,7 +4701,7 @@ var WhatsappResourceBase = class extends Resource {
4701
4701
  }));
4702
4702
  }
4703
4703
  /**
4704
- * List WhatsApp messages, newest first, as a cursor page ({data, next_cursor, …}). Pass next_cursor back as starting_after to fetch the next page. Filter by direction, status, contact phone number, bsuid, or tag. Use whatsapp_get for one message's current state.
4704
+ * List WhatsApp messages, newest first, as a cursor page ({data, next_cursor, …}). Pass next_cursor back as starting_after to fetch the next page. Filter by direction, status, contact phone number, bsuid, template category, or tag. Use whatsapp_get for one message's current state.
4705
4705
  *
4706
4706
  * @example Iterate delivered messages
4707
4707
  * for await (const msg of bird.whatsapp.list({ status: ["delivered"] })) {
@@ -5109,9 +5109,9 @@ var BirdClient = class {
5109
5109
  this.#headers = {
5110
5110
  ...opts.defaultHeaders,
5111
5111
  Authorization: `Bearer ${opts.apiKey}`,
5112
- "User-Agent": `bird-sdk-js/0.21.2`,
5112
+ "User-Agent": `bird-sdk-js/0.23.0`,
5113
5113
  "Bird-Surface": "sdk-js",
5114
- "Bird-Version": "0.21.2"
5114
+ "Bird-Version": "0.23.0"
5115
5115
  };
5116
5116
  const caller = detectCaller();
5117
5117
  if (caller) this.#headers["Bird-Caller"] = caller;