@messagebird/sdk 0.38.0 → 0.38.2
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 +8 -8
- package/dist/index.mjs +11 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3700,7 +3700,7 @@ type WhatsAppMessageTemplateComponent = {
|
|
|
3700
3700
|
*/
|
|
3701
3701
|
type: string;
|
|
3702
3702
|
/**
|
|
3703
|
-
* The values that fill this part's placeholders. A positional template takes them in `{{n}}` placeholder order; a template with named parameters requires each parameter's `name` to match one the template declares, and order then carries no meaning. Send it on every part except `carousel`, which carries its values on `cards`.
|
|
3703
|
+
* The values that fill this part's placeholders. A positional template takes them in `{{n}}` placeholder order; a template with named parameters requires each parameter's `name` to match one the template declares, and order then carries no meaning. Send it on every part except `carousel`, which carries its values on `cards`. Send no `button` part at all for a button that takes no value, such as a `quick_reply` or `request_contact_info` button, or a `url` button whose address has no placeholder: a part the template has no slot for is refused here, before the message is sent and charged.
|
|
3704
3704
|
*
|
|
3705
3705
|
*/
|
|
3706
3706
|
parameters?: Array<WhatsAppMessageTemplateComponentParameter>;
|
|
@@ -4117,37 +4117,37 @@ type WhatsAppMessageSendRequest = {
|
|
|
4117
4117
|
*/
|
|
4118
4118
|
template?: WhatsAppTemplateSend;
|
|
4119
4119
|
/**
|
|
4120
|
-
* Free-form text to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again.
|
|
4120
|
+
* Free-form text to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again. A send into a closed window is refused with a `422` `WhatsAppServiceWindowClosed` before anything is created or charged; one whose window closes between accept and dispatch fails asynchronously, with `service_window_expired` on the message's `last_error`.
|
|
4121
4121
|
*
|
|
4122
4122
|
*/
|
|
4123
4123
|
text?: WhatsAppTextSend;
|
|
4124
4124
|
/**
|
|
4125
|
-
* A free-form image to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again.
|
|
4125
|
+
* A free-form image to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again. A send into a closed window is refused with a `422` `WhatsAppServiceWindowClosed` before anything is created or charged; one whose window closes between accept and dispatch fails asynchronously, with `service_window_expired` on the message's `last_error`.
|
|
4126
4126
|
*
|
|
4127
4127
|
*/
|
|
4128
4128
|
image?: WhatsAppImageSend;
|
|
4129
4129
|
/**
|
|
4130
|
-
* A free-form video to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again.
|
|
4130
|
+
* A free-form video to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again. A send into a closed window is refused with a `422` `WhatsAppServiceWindowClosed` before anything is created or charged; one whose window closes between accept and dispatch fails asynchronously, with `service_window_expired` on the message's `last_error`.
|
|
4131
4131
|
*
|
|
4132
4132
|
*/
|
|
4133
4133
|
video?: WhatsAppVideoSend;
|
|
4134
4134
|
/**
|
|
4135
|
-
* Free-form audio to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again.
|
|
4135
|
+
* Free-form audio to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again. A send into a closed window is refused with a `422` `WhatsAppServiceWindowClosed` before anything is created or charged; one whose window closes between accept and dispatch fails asynchronously, with `service_window_expired` on the message's `last_error`.
|
|
4136
4136
|
*
|
|
4137
4137
|
*/
|
|
4138
4138
|
audio?: WhatsAppAudioSend;
|
|
4139
4139
|
/**
|
|
4140
|
-
* A free-form sticker to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again.
|
|
4140
|
+
* A free-form sticker to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again. A send into a closed window is refused with a `422` `WhatsAppServiceWindowClosed` before anything is created or charged; one whose window closes between accept and dispatch fails asynchronously, with `service_window_expired` on the message's `last_error`.
|
|
4141
4141
|
*
|
|
4142
4142
|
*/
|
|
4143
4143
|
sticker?: WhatsAppStickerSend;
|
|
4144
4144
|
/**
|
|
4145
|
-
* A free-form document to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again.
|
|
4145
|
+
* A free-form document to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again. A send into a closed window is refused with a `422` `WhatsAppServiceWindowClosed` before anything is created or charged; one whose window closes between accept and dispatch fails asynchronously, with `service_window_expired` on the message's `last_error`.
|
|
4146
4146
|
*
|
|
4147
4147
|
*/
|
|
4148
4148
|
document?: WhatsAppDocumentSend;
|
|
4149
4149
|
/**
|
|
4150
|
-
* A free-form location to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again.
|
|
4150
|
+
* A free-form location to send instead of a template. Deliverable only inside an open 24-hour customer service window, which the contact opens by messaging or calling you and resets each time they do it again. A send into a closed window is refused with a `422` `WhatsAppServiceWindowClosed` before anything is created or charged; one whose window closes between accept and dispatch fails asynchronously, with `service_window_expired` on the message's `last_error`.
|
|
4151
4151
|
*
|
|
4152
4152
|
*/
|
|
4153
4153
|
location?: WhatsAppLocationSend;
|
package/dist/index.mjs
CHANGED
|
@@ -2951,9 +2951,13 @@ const listWhatsAppMessages = (options) => (options?.client ?? client).get({
|
|
|
2951
2951
|
*
|
|
2952
2952
|
* **Free-form content** is deliverable only inside an open 24-hour customer
|
|
2953
2953
|
* service window, which the contact opens by messaging or calling you and
|
|
2954
|
-
* resets each time they do it again.
|
|
2955
|
-
*
|
|
2956
|
-
*
|
|
2954
|
+
* resets each time they do it again. Bird tracks that window, so a send into a
|
|
2955
|
+
* closed one is refused with a `422` `WhatsAppServiceWindowClosed` before
|
|
2956
|
+
* anything is created or charged;
|
|
2957
|
+
* send a template instead, which reopens the window once the contact replies.
|
|
2958
|
+
* A window that closes between accept and dispatch still fails
|
|
2959
|
+
* asynchronously, carrying `service_window_expired` on the message's
|
|
2960
|
+
* `last_error`. Every free-form send requires `from`.
|
|
2957
2961
|
*
|
|
2958
2962
|
* The `202` response is the accepted message, echoing the resolved content; it
|
|
2959
2963
|
* is not a delivery confirmation. Follow delivery with
|
|
@@ -2968,6 +2972,8 @@ const listWhatsAppMessages = (options) => (options?.client ?? client).get({
|
|
|
2968
2972
|
* - Parameter values that do not match the template's declared placeholders.
|
|
2969
2973
|
* - A `from` this workspace cannot send from.
|
|
2970
2974
|
* - A recipient that is neither a valid phone number nor a business-scoped user ID.
|
|
2975
|
+
* - Free-form content sent into a closed customer service window
|
|
2976
|
+
* (`WhatsAppServiceWindowClosed`).
|
|
2971
2977
|
*
|
|
2972
2978
|
* A send from a workspace with no wallet balance fails with a `402`.
|
|
2973
2979
|
*
|
|
@@ -7372,9 +7378,9 @@ var BirdClient = class {
|
|
|
7372
7378
|
this.#headers = {
|
|
7373
7379
|
...opts.defaultHeaders,
|
|
7374
7380
|
Authorization: `Bearer ${opts.apiKey}`,
|
|
7375
|
-
"User-Agent": `bird-sdk-js/0.38.
|
|
7381
|
+
"User-Agent": `bird-sdk-js/0.38.2`,
|
|
7376
7382
|
"Bird-Surface": "sdk-js",
|
|
7377
|
-
"Bird-Version": "0.38.
|
|
7383
|
+
"Bird-Version": "0.38.2"
|
|
7378
7384
|
};
|
|
7379
7385
|
const caller = detectCaller();
|
|
7380
7386
|
if (caller) this.#headers["Bird-Caller"] = caller;
|