@messagebird/sdk 0.33.1 → 0.34.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 +18 -4
- package/dist/index.mjs +9 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4069,6 +4069,7 @@ type WhatsAppEventList = {
|
|
|
4069
4069
|
*/
|
|
4070
4070
|
data: Array<WhatsAppEvent>;
|
|
4071
4071
|
};
|
|
4072
|
+
type NumbersDedicatedAllocationId = string;
|
|
4072
4073
|
/**
|
|
4073
4074
|
* The window and bucket grain the response covers, echoed from the request, plus the freshness boundary the data is current to.
|
|
4074
4075
|
*
|
|
@@ -8034,7 +8035,6 @@ type AvailableNumber = {
|
|
|
8034
8035
|
*/
|
|
8035
8036
|
type NumbersOrderStatus$1 = "charging" | "ordering" | "pending" | "completed" | "failed" | (string & {});
|
|
8036
8037
|
type NumbersOrderId = string;
|
|
8037
|
-
type NumbersDedicatedAllocationId = string;
|
|
8038
8038
|
type NumbersOrder = {
|
|
8039
8039
|
/**
|
|
8040
8040
|
* Identifier of this purchase order.
|
|
@@ -9690,11 +9690,25 @@ type ListWhatsAppMessagesData = {
|
|
|
9690
9690
|
*/
|
|
9691
9691
|
direction?: MessageDirection;
|
|
9692
9692
|
/**
|
|
9693
|
-
* Filter by contact
|
|
9693
|
+
* Filter by recipient, exact match. The recipient is the contact on an outbound message and your business number on an inbound one, matching the `to` each message returns. Accepts an E.164 phone number, or a business-scoped user ID to name the contact. Only a contact is ever identified by a business-scoped user ID, so `to=<business-scoped user ID>` matches outbound messages only.
|
|
9694
|
+
*
|
|
9695
|
+
*/
|
|
9696
|
+
to?: string;
|
|
9697
|
+
/**
|
|
9698
|
+
* Filter by sender, exact match. The sender is your business number on an outbound message and the contact on an inbound one, matching the `from` each message returns. Accepts an E.164 phone number, or a business-scoped user ID to name the contact. Only a contact is ever identified by a business-scoped user ID, so `from=<business-scoped user ID>` matches inbound messages only.
|
|
9699
|
+
*
|
|
9700
|
+
*/
|
|
9701
|
+
from?: string;
|
|
9702
|
+
/**
|
|
9703
|
+
* Deprecated: use `to` or `from` instead, which also match a business-scoped user ID. Filters by contact phone number (E.164 exact match), in either direction.
|
|
9704
|
+
*
|
|
9705
|
+
*
|
|
9706
|
+
* @deprecated
|
|
9694
9707
|
*/
|
|
9695
9708
|
phone_number?: string;
|
|
9696
9709
|
/**
|
|
9697
|
-
* Filter by business-scoped user ID (Meta identifier).
|
|
9710
|
+
* Filter by business-scoped user ID (Meta identifier), matching the contact in either direction. `to` and `from` also accept one, but each matches a single end of the message.
|
|
9711
|
+
*
|
|
9698
9712
|
*/
|
|
9699
9713
|
bsuid?: string;
|
|
9700
9714
|
/**
|
|
@@ -12630,7 +12644,7 @@ declare class WhatsappResourceBase extends Resource {
|
|
|
12630
12644
|
*/
|
|
12631
12645
|
get(messageId: string, options?: RequestOptions): APIPromise<WhatsAppMessage>;
|
|
12632
12646
|
/**
|
|
12633
|
-
* List WhatsApp messages, newest first, as a cursor page ({data, next_cursor, …}). Each message carries the one content it was built from: a template, or free-form text, image, video, audio, sticker, document or location. Pass next_cursor back as starting_after to fetch the next page. Filter by direction, status,
|
|
12647
|
+
* List WhatsApp messages, newest first, as a cursor page ({data, next_cursor, …}). Each message carries the one content it was built from: a template, or free-form text, image, video, audio, sticker, document or location. Pass next_cursor back as starting_after to fetch the next page. Filter by direction, status, recipient (to), sender (from), business-scoped user ID (bsuid), template category, or tag. to and from each accept a phone number or a business-scoped user ID; pair either with direction to search a single side of the message. Use whatsapp_get for one message's current state.
|
|
12634
12648
|
*
|
|
12635
12649
|
* @example Iterate delivered messages
|
|
12636
12650
|
* for await (const msg of bird.whatsapp.list({ status: ["delivered"] })) {
|
package/dist/index.mjs
CHANGED
|
@@ -2798,8 +2798,12 @@ const createVerificationNextChannel = (options) => (options.client ?? client).po
|
|
|
2798
2798
|
* `image`, `video`, `audio`, `sticker`, `document` or `location`. An inbound
|
|
2799
2799
|
* message whose content WhatsApp models and we do not carries `unsupported`
|
|
2800
2800
|
* instead, naming the type rather than reading back empty.
|
|
2801
|
-
* Filter by direction, status,
|
|
2802
|
-
* business-scoped user ID, template category, tag, or creation
|
|
2801
|
+
* Filter by direction, status, recipient (`to`), sender (`from`),
|
|
2802
|
+
* business-scoped user ID (`bsuid`), template category, tag, or creation
|
|
2803
|
+
* time. `to` and `from` name the same ends of the message the response
|
|
2804
|
+
* does, and each accepts an E.164 phone number or a business-scoped user
|
|
2805
|
+
* ID. Pair either with `direction` to search a single side of the message.
|
|
2806
|
+
* Pass the response's `next_cursor` back as
|
|
2803
2807
|
* `starting_after` to fetch the next page. To follow a single message's
|
|
2804
2808
|
* delivery, use
|
|
2805
2809
|
* [Get a WhatsApp message](/docs/api/reference/get-whatsapp-message)
|
|
@@ -6110,7 +6114,7 @@ var WhatsappResourceBase = class extends Resource {
|
|
|
6110
6114
|
}));
|
|
6111
6115
|
}
|
|
6112
6116
|
/**
|
|
6113
|
-
* List WhatsApp messages, newest first, as a cursor page ({data, next_cursor, …}). Each message carries the one content it was built from: a template, or free-form text, image, video, audio, sticker, document or location. Pass next_cursor back as starting_after to fetch the next page. Filter by direction, status,
|
|
6117
|
+
* List WhatsApp messages, newest first, as a cursor page ({data, next_cursor, …}). Each message carries the one content it was built from: a template, or free-form text, image, video, audio, sticker, document or location. Pass next_cursor back as starting_after to fetch the next page. Filter by direction, status, recipient (to), sender (from), business-scoped user ID (bsuid), template category, or tag. to and from each accept a phone number or a business-scoped user ID; pair either with direction to search a single side of the message. Use whatsapp_get for one message's current state.
|
|
6114
6118
|
*
|
|
6115
6119
|
* @example Iterate delivered messages
|
|
6116
6120
|
* for await (const msg of bird.whatsapp.list({ status: ["delivered"] })) {
|
|
@@ -7128,9 +7132,9 @@ var BirdClient = class {
|
|
|
7128
7132
|
this.#headers = {
|
|
7129
7133
|
...opts.defaultHeaders,
|
|
7130
7134
|
Authorization: `Bearer ${opts.apiKey}`,
|
|
7131
|
-
"User-Agent": `bird-sdk-js/0.
|
|
7135
|
+
"User-Agent": `bird-sdk-js/0.34.0`,
|
|
7132
7136
|
"Bird-Surface": "sdk-js",
|
|
7133
|
-
"Bird-Version": "0.
|
|
7137
|
+
"Bird-Version": "0.34.0"
|
|
7134
7138
|
};
|
|
7135
7139
|
const caller = detectCaller();
|
|
7136
7140
|
if (caller) this.#headers["Bird-Caller"] = caller;
|