@messagebird/sdk 0.15.0 → 0.16.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
@@ -4251,15 +4251,15 @@ type WhatsAppMessageTemplateComponent = {
4251
4251
  */
4252
4252
  type WhatsAppLanguage = string;
4253
4253
  /**
4254
- * A WhatsApp template's name the stable handle used to reference the template when sending. Lowercase letters, numbers, and underscores.
4254
+ * A template's slug: its permanent, workspace-unique handle and API address. Lowercase letters, numbers, hyphens, and underscores. Fixed at creation, so anything that references it never breaks; the display name is the label to change freely.
4255
4255
  *
4256
4256
  */
4257
- type WhatsAppTemplateName = string;
4257
+ type TemplateSlug = string;
4258
4258
  type WhatsAppTemplateSend = {
4259
4259
  /**
4260
- * The template to send, by its name (for example `bird_otp`).
4260
+ * The template to send, by its slug (for example `bird_otp`).
4261
4261
  */
4262
- name: WhatsAppTemplateName;
4262
+ slug: TemplateSlug;
4263
4263
  /**
4264
4264
  * Language code of the template variant to send (for example `en` or `pt_BR`). May be omitted when the template has a single language; when it is stocked in several, omitting the language returns a `422` that names the available codes. The accepted message echoes the resolved language.
4265
4265
  *
@@ -4296,14 +4296,14 @@ type WhatsAppMessageStatus = "scheduled" | "accepted" | "sent" | "delivered" | "
4296
4296
  */
4297
4297
  type WhatsAppTemplateCategory = string;
4298
4298
  /**
4299
- * The template a message was sent from. On reads `name`, `language`, `category`, and `components` are always present; `components` is an empty array for an authentication template (the filled-in values, for example a verification code, are never returned).
4299
+ * The template a message was sent from. On reads `slug`, `language`, `category`, and `components` are always present; `components` is an empty array for an authentication template (the filled-in values, for example a verification code, are never returned).
4300
4300
  *
4301
4301
  */
4302
4302
  type WhatsAppMessageTemplate = {
4303
4303
  /**
4304
4304
  * The template's stable handle (for example `bird_otp`).
4305
4305
  */
4306
- readonly name: WhatsAppTemplateName;
4306
+ readonly slug: TemplateSlug;
4307
4307
  /**
4308
4308
  * Content classification applied to messages sent from this template.
4309
4309
  */
@@ -5130,11 +5130,6 @@ type EmailMessageBatchRequest = Array<EmailMessageSendRequest>;
5130
5130
  * A language tag in BCP-47 form, for example `en` or `pt-BR`.
5131
5131
  */
5132
5132
  type LanguageTag = string;
5133
- /**
5134
- * A template's slug: its permanent, workspace-unique handle and API address. Lowercase letters, numbers, hyphens, and underscores. Fixed at creation, so anything that references it never breaks; the display name is the label to change freely.
5135
- *
5136
- */
5137
- type TemplateSlug = string;
5138
5133
  type EmailTemplateSend = unknown & {
5139
5134
  /**
5140
5135
  * The template to send, by its id.
@@ -8625,7 +8620,7 @@ declare class WhatsappResource extends WhatsappResourceBase {
8625
8620
  * const msg = await bird.whatsapp.send({
8626
8621
  * to: "+15551234567",
8627
8622
  * template: {
8628
- * name: "bird_otp",
8623
+ * slug: "bird_otp",
8629
8624
  * components: [
8630
8625
  * { type: "body", parameters: [{ type: "text", text: "123456" }] },
8631
8626
  * ],
package/dist/index.mjs CHANGED
@@ -2056,7 +2056,7 @@ const listWhatsAppMessages = (options) => (options?.client ?? client).get({
2056
2056
  * [List events for a WhatsApp message](/docs/api/reference/list-whats-app-message-events),
2057
2057
  * or `whatsapp.*` webhook events.
2058
2058
  *
2059
- * A template name or language the catalogue does not stock, parameter values
2059
+ * A template slug or language the catalogue does not stock, parameter values
2060
2060
  * that do not match the template's declared placeholders, and a recipient
2061
2061
  * that is not a valid phone number each return a `422`.
2062
2062
  *
@@ -4623,7 +4623,7 @@ var WhatsappResource = class extends WhatsappResourceBase {
4623
4623
  * const msg = await bird.whatsapp.send({
4624
4624
  * to: "+15551234567",
4625
4625
  * template: {
4626
- * name: "bird_otp",
4626
+ * slug: "bird_otp",
4627
4627
  * components: [
4628
4628
  * { type: "body", parameters: [{ type: "text", text: "123456" }] },
4629
4629
  * ],
@@ -5040,9 +5040,9 @@ var BirdClient = class {
5040
5040
  this.#headers = {
5041
5041
  ...opts.defaultHeaders,
5042
5042
  Authorization: `Bearer ${opts.apiKey}`,
5043
- "User-Agent": `bird-sdk-js/0.15.0`,
5043
+ "User-Agent": `bird-sdk-js/0.16.0`,
5044
5044
  "Bird-Surface": "sdk-js",
5045
- "Bird-Version": "0.15.0"
5045
+ "Bird-Version": "0.16.0"
5046
5046
  };
5047
5047
  const caller = detectCaller();
5048
5048
  if (caller) this.#headers["Bird-Caller"] = caller;