@messagebird/sdk 0.33.0 → 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 +34 -20
- 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
|
*
|
|
@@ -5517,6 +5518,21 @@ type DomainUpdate = {
|
|
|
5517
5518
|
inbound?: DomainInboundConfig;
|
|
5518
5519
|
};
|
|
5519
5520
|
type SuppressionId = string;
|
|
5521
|
+
type Actor = {
|
|
5522
|
+
/**
|
|
5523
|
+
* Actor identifier.
|
|
5524
|
+
*/
|
|
5525
|
+
id: string;
|
|
5526
|
+
/**
|
|
5527
|
+
* Who or what performed the action: `user` for a member's own session, `oauth_token` for a token issued to a caller on a member's behalf, `api_key` for a workspace API key, `system` for our own automation, `sso` for an organization's SSO connection, and `service_account` for a workspace's connected Integration acting with no member behind it. Open enum: new actor types may be added over time, so treat any unrecognized value as a future type rather than an error.
|
|
5528
|
+
*/
|
|
5529
|
+
type: string;
|
|
5530
|
+
/**
|
|
5531
|
+
* The label the actor is shown under: typically a member's name or email address, or the API key's name. Null when it could not be resolved.
|
|
5532
|
+
*
|
|
5533
|
+
*/
|
|
5534
|
+
readonly display_name?: string | null;
|
|
5535
|
+
};
|
|
5520
5536
|
type InboundAddressId = string;
|
|
5521
5537
|
type InboundEmailMessageId = string;
|
|
5522
5538
|
type MailboxId = string;
|
|
@@ -7910,21 +7926,6 @@ type EventWhatsAppSent = {
|
|
|
7910
7926
|
timestamp: string;
|
|
7911
7927
|
data: EventWhatsAppSentData;
|
|
7912
7928
|
};
|
|
7913
|
-
type AuditLogActor = {
|
|
7914
|
-
/**
|
|
7915
|
-
* ID of the user, API key, integration, or system process that performed the action.
|
|
7916
|
-
*/
|
|
7917
|
-
id: string;
|
|
7918
|
-
/**
|
|
7919
|
-
* Type of actor, such as `user`, `api_key`, `service_account`, or `system`.
|
|
7920
|
-
*/
|
|
7921
|
-
type: string;
|
|
7922
|
-
/**
|
|
7923
|
-
* Display name of the actor. This is the user's email address for a `user` actor, or the name of the API key or integration that acted. Absent when it could not be resolved.
|
|
7924
|
-
*
|
|
7925
|
-
*/
|
|
7926
|
-
readonly display_name?: string | null;
|
|
7927
|
-
};
|
|
7928
7929
|
/**
|
|
7929
7930
|
* Physical type of a phone number. New number types may be added over time, so treat unrecognized values as supported types rather than errors.
|
|
7930
7931
|
*/
|
|
@@ -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.
|
|
@@ -8181,7 +8181,7 @@ type VoiceCall = {
|
|
|
8181
8181
|
/**
|
|
8182
8182
|
* Who placed the call: the API key whose credentials it used, the integration acting for the workspace, or the user who placed it from a browser or the CLI. Absent when the call was admitted only by its source IP address, or when no actor was recorded.
|
|
8183
8183
|
*/
|
|
8184
|
-
readonly actor?:
|
|
8184
|
+
readonly actor?: Actor;
|
|
8185
8185
|
/**
|
|
8186
8186
|
* Identifier of the SIP trunk that originated this call. `null` when no trunk is associated.
|
|
8187
8187
|
*/
|
|
@@ -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;
|