@messagebird/sdk 0.24.0 → 0.25.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 +91 -27
- package/dist/index.mjs +32 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -998,10 +998,10 @@ type EventSmsUndeliveredData = EventSmsBase & {
|
|
|
998
998
|
error: SmsError;
|
|
999
999
|
};
|
|
1000
1000
|
/**
|
|
1001
|
-
* Bird-stable failure reason. `invalid_destination`: the number is not assigned, ported out, or malformed. `unreachable`: handset off or out of coverage. `blocked_by_carrier`: the carrier filtered the message. `blocked_by_recipient`: the recipient device blocked the sender. `landline_unreachable`: the destination is a landline that does not accept SMS. `content_rejected`: the carrier rejected the content. `sender_unregistered`: the sender is not registered for the destination. `recipient_opted_out`: the recipient is on a suppression list. `provider_unavailable`: an upstream failure after retries. `insufficient_balance`: the workspace wallet had insufficient balance to send the message. `unknown`: an unmapped failure.
|
|
1001
|
+
* Bird-stable failure reason. Open enum: Bird adds reasons as the carrier platform's own buckets are covered, so treat an unrecognized value as a future reason rather than an error. `invalid_destination`: the number is not assigned, ported out, or malformed. `unreachable`: handset off or out of coverage. `blocked_by_carrier`: the carrier filtered the message. `blocked_by_recipient`: the recipient device blocked the sender. `landline_unreachable`: the destination is a landline that does not accept SMS. `content_rejected`: the carrier rejected the content. `sender_unregistered`: the sender is not registered for the destination. `recipient_opted_out`: the recipient is on a suppression list. `provider_unavailable`: an upstream failure after retries. `insufficient_balance`: the workspace wallet had insufficient balance to send the message. `unknown`: an unmapped failure.
|
|
1002
1002
|
*
|
|
1003
1003
|
*/
|
|
1004
|
-
type SmsErrorCode = "invalid_destination" | "unreachable" | "blocked_by_carrier" | "blocked_by_recipient" | "landline_unreachable" | "content_rejected" | "sender_unregistered" | "recipient_opted_out" | "provider_unavailable" | "insufficient_balance" | "unknown";
|
|
1004
|
+
type SmsErrorCode = "invalid_destination" | "unreachable" | "blocked_by_carrier" | "blocked_by_recipient" | "landline_unreachable" | "content_rejected" | "sender_unregistered" | "recipient_opted_out" | "provider_unavailable" | "insufficient_balance" | "unknown" | (string & {});
|
|
1005
1005
|
/**
|
|
1006
1006
|
* Failure detail for a message that could not be delivered or was rejected.
|
|
1007
1007
|
*/
|
|
@@ -1012,7 +1012,7 @@ type SmsError = {
|
|
|
1012
1012
|
*/
|
|
1013
1013
|
description: string;
|
|
1014
1014
|
/**
|
|
1015
|
-
* Raw
|
|
1015
|
+
* Raw provider-supplied error code, finer-grained than the `code` that normalizes it. Not a Bird-defined value, so quote it to support when asking why a message failed. Null when the provider sent none, including any failure decided before one was reached.
|
|
1016
1016
|
*/
|
|
1017
1017
|
carrier_error_code?: string | null;
|
|
1018
1018
|
/**
|
|
@@ -1178,7 +1178,12 @@ type EventSmsFailed = {
|
|
|
1178
1178
|
/**
|
|
1179
1179
|
* Payload of the sms.expired event.
|
|
1180
1180
|
*/
|
|
1181
|
-
type EventSmsExpiredData = EventSmsBase
|
|
1181
|
+
type EventSmsExpiredData = EventSmsBase & {
|
|
1182
|
+
/**
|
|
1183
|
+
* Why the message was still undelivered when its validity period elapsed. Typically `unreachable`, the handset having stayed off or out of coverage for the whole window.
|
|
1184
|
+
*/
|
|
1185
|
+
error: SmsError;
|
|
1186
|
+
};
|
|
1182
1187
|
/**
|
|
1183
1188
|
* The message's validity period elapsed before it could be delivered.
|
|
1184
1189
|
*/
|
|
@@ -4315,36 +4320,70 @@ type WhatsAppMessageSendRequest = {
|
|
|
4315
4320
|
};
|
|
4316
4321
|
};
|
|
4317
4322
|
/**
|
|
4318
|
-
* The
|
|
4323
|
+
* The values that fill one block of one carousel card.
|
|
4324
|
+
*/
|
|
4325
|
+
type WhatsAppMessageTemplateCardComponent = {
|
|
4326
|
+
/**
|
|
4327
|
+
* Which part of the card this fills in: `header` for the card's image or video, `body` for its text, `button` for a button's variable.
|
|
4328
|
+
*
|
|
4329
|
+
*/
|
|
4330
|
+
type: string;
|
|
4331
|
+
/**
|
|
4332
|
+
* The values that fill this part's placeholders, in placeholder order.
|
|
4333
|
+
*/
|
|
4334
|
+
parameters?: Array<WhatsAppMessageTemplateComponentParameter>;
|
|
4335
|
+
};
|
|
4336
|
+
/**
|
|
4337
|
+
* The kind of value a template parameter carries, which follows the block it fills. `text` is a plain string substituted into a placeholder, including a coupon button's code, which the recipient copies from the button. `image`, `video`, `gif` and `document` carry a media header's file in `url`, each matching its header's `format`. `location` fills a location header and carries a point on the map. Open enum: more kinds may be added over time.
|
|
4319
4338
|
*
|
|
4320
4339
|
*/
|
|
4321
|
-
type WhatsAppTemplateParameterType$1 = "text" | (string & {});
|
|
4340
|
+
type WhatsAppTemplateParameterType$1 = "text" | "image" | "video" | "gif" | "document" | "location" | (string & {});
|
|
4322
4341
|
type WhatsAppMessageTemplateComponentParameter = {
|
|
4323
4342
|
/**
|
|
4324
|
-
* The kind of value this parameter carries
|
|
4343
|
+
* The kind of value this parameter carries, which decides which of the fields below to send.
|
|
4325
4344
|
*/
|
|
4326
4345
|
type: WhatsAppTemplateParameterType$1;
|
|
4327
4346
|
/**
|
|
4328
|
-
* The value substituted into the placeholder, as a plain string.
|
|
4347
|
+
* The value substituted into the placeholder, as a plain string. Send it on a `text` parameter.
|
|
4329
4348
|
*/
|
|
4330
|
-
text
|
|
4349
|
+
text?: string;
|
|
4350
|
+
/**
|
|
4351
|
+
* Public `https` URL of the file a media header shows. Send it on an `image`, `video`, `gif` or `document` parameter. WhatsApp fetches it at send time, so it must still be reachable then, the same way a free-form media message's `url` must.
|
|
4352
|
+
*
|
|
4353
|
+
*/
|
|
4354
|
+
url?: string;
|
|
4331
4355
|
/**
|
|
4332
4356
|
* Required when the template declares named parameters: the placeholder this value fills (for example `first_name`), matching exactly one of the names the template declares. Name every parameter in that case; order does not matter once names are supplied. Omit this field for a positional template, which takes its values in `{{n}}` order instead. Sending the wrong set of names, or leaving one out that the template requires, returns a `422` `WhatsAppTemplateParameterMismatch`.
|
|
4333
4357
|
*
|
|
4334
4358
|
*/
|
|
4335
4359
|
name?: string;
|
|
4336
4360
|
};
|
|
4361
|
+
/**
|
|
4362
|
+
* The values that fill one card of a carousel. Cards fill in the order the template was approved with, so send one entry per card and keep them in that order.
|
|
4363
|
+
*
|
|
4364
|
+
*/
|
|
4365
|
+
type WhatsAppMessageTemplateCard = {
|
|
4366
|
+
/**
|
|
4367
|
+
* The values that fill this card's blocks.
|
|
4368
|
+
*/
|
|
4369
|
+
components: Array<WhatsAppMessageTemplateCardComponent>;
|
|
4370
|
+
};
|
|
4337
4371
|
type WhatsAppMessageTemplateComponent = {
|
|
4338
4372
|
/**
|
|
4339
|
-
* Which part of the template this fills in: `body` for the main text, `button` for a button's variable, `header` for the header
|
|
4373
|
+
* Which part of the template this fills in: `body` for the main text, `button` for a button's variable, `header` for the header's text, media or location, `carousel` for the cards.
|
|
4340
4374
|
*
|
|
4341
4375
|
*/
|
|
4342
4376
|
type: string;
|
|
4343
4377
|
/**
|
|
4344
|
-
* 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.
|
|
4378
|
+
* 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`.
|
|
4345
4379
|
*
|
|
4346
4380
|
*/
|
|
4347
4381
|
parameters?: Array<WhatsAppMessageTemplateComponentParameter>;
|
|
4382
|
+
/**
|
|
4383
|
+
* The values that fill each card of a carousel. Send it only on a `carousel` part. A carousel sends exactly the number of cards its template was approved with, so every card needs an entry.
|
|
4384
|
+
*
|
|
4385
|
+
*/
|
|
4386
|
+
cards?: Array<WhatsAppMessageTemplateCard>;
|
|
4348
4387
|
};
|
|
4349
4388
|
/**
|
|
4350
4389
|
* A language tag in BCP-47 form, for example `en` or `pt-BR`.
|
|
@@ -4366,7 +4405,7 @@ type WhatsAppTemplateSend = unknown & {
|
|
|
4366
4405
|
*/
|
|
4367
4406
|
slug?: TemplateSlug;
|
|
4368
4407
|
/**
|
|
4369
|
-
* Which of the template's languages to send, as a BCP-47 tag (for example `en` or `pt-BR`). Meta's underscore form (`pt_BR`) is accepted and normalized; the accepted message echoes the canonical BCP-47 form. May be omitted
|
|
4408
|
+
* Which of the template's languages to send, as a BCP-47 tag (for example `en` or `pt-BR`). Meta's underscore form (`pt_BR`) is accepted and normalized; the accepted message echoes the canonical BCP-47 form. May be omitted, in which case the template's default language is sent. A language the template is not stocked in returns a `422` that names the available tags.
|
|
4370
4409
|
*
|
|
4371
4410
|
*/
|
|
4372
4411
|
language?: LanguageTag;
|
|
@@ -4377,7 +4416,7 @@ type WhatsAppTemplateSend = unknown & {
|
|
|
4377
4416
|
components?: Array<WhatsAppMessageTemplateComponent>;
|
|
4378
4417
|
};
|
|
4379
4418
|
/**
|
|
4380
|
-
* Delivery status. `accepted` (the initial status of an outbound send) means Bird accepted the request and it is queued for sending. `sent` means it was handed to the WhatsApp network. `delivered` is confirmed delivery to the recipient's device. `failed` is a terminal permanent failure. `rejected` means Bird refused the message before sending it to WhatsApp, because the recipient is on the workspace's suppression list, the wallet had insufficient balance, or the destination is unpriced. A rejected message was not sent and not charged. There is no `read` status: a read receipt is reported as `read_at` and a `whatsapp.read` event, not a status value. The remaining values are reserved and not returned today: `scheduled` (queued to send at a future time)
|
|
4419
|
+
* Delivery status. `accepted` (the initial status of an outbound send) means Bird accepted the request and it is queued for sending. `sent` means it was handed to the WhatsApp network. `delivered` is confirmed delivery to the recipient's device. `failed` is a terminal permanent failure. `rejected` means Bird refused the message before sending it to WhatsApp, because the recipient is on the workspace's suppression list, the wallet had insufficient balance, or the destination is unpriced. A rejected message was not sent and not charged. There is no `read` status: a read receipt is reported as `read_at` and a `whatsapp.read` event, not a status value. `received` is the status of an inbound message, one a contact sent you. The remaining values are reserved and not returned today: `scheduled` (queued to send at a future time) and `canceled` (a scheduled message canceled before sending).
|
|
4381
4420
|
*
|
|
4382
4421
|
*/
|
|
4383
4422
|
type WhatsAppMessageStatus = "scheduled" | "accepted" | "sent" | "delivered" | "failed" | "rejected" | "canceled" | "received";
|
|
@@ -4453,7 +4492,7 @@ type WhatsAppMessage = {
|
|
|
4453
4492
|
*/
|
|
4454
4493
|
readonly read_at?: string | null;
|
|
4455
4494
|
/**
|
|
4456
|
-
* What the message cost, split into Bird's charge and any third-party fees passed through. Null
|
|
4495
|
+
* What the message cost, split into Bird's charge and any third-party fees passed through. Null on an inbound message, which is never priced, on an outbound message that has not been priced yet, and on one rejected before pricing. The rate depends on the message category and the recipient's country.
|
|
4457
4496
|
*/
|
|
4458
4497
|
readonly cost?: MessageCost;
|
|
4459
4498
|
/**
|
|
@@ -4573,7 +4612,7 @@ type SmsTemplateVersionId = string;
|
|
|
4573
4612
|
*/
|
|
4574
4613
|
type TemplateVariable = {
|
|
4575
4614
|
/**
|
|
4576
|
-
* The
|
|
4615
|
+
* The parameter key this slot is filled with.
|
|
4577
4616
|
*/
|
|
4578
4617
|
readonly key: string;
|
|
4579
4618
|
/**
|
|
@@ -4582,7 +4621,7 @@ type TemplateVariable = {
|
|
|
4582
4621
|
*/
|
|
4583
4622
|
readonly type: string;
|
|
4584
4623
|
/**
|
|
4585
|
-
* Whether the slot must be supplied when sending.
|
|
4624
|
+
* Whether the slot must be supplied when sending. A send that leaves a required slot unset is rejected.
|
|
4586
4625
|
*
|
|
4587
4626
|
*/
|
|
4588
4627
|
readonly required: boolean;
|
|
@@ -4771,7 +4810,7 @@ type SmsMessage = {
|
|
|
4771
4810
|
*/
|
|
4772
4811
|
readonly mcc_mnc?: string;
|
|
4773
4812
|
/**
|
|
4774
|
-
* Failure detail on a
|
|
4813
|
+
* Failure detail on a message that failed, was rejected, was not delivered, or expired. Absent otherwise.
|
|
4775
4814
|
*/
|
|
4776
4815
|
last_error?: SmsError;
|
|
4777
4816
|
/**
|
|
@@ -4947,11 +4986,11 @@ type Contact = {
|
|
|
4947
4986
|
*/
|
|
4948
4987
|
phone: string | null;
|
|
4949
4988
|
/**
|
|
4950
|
-
* The contact's first name. Available in broadcast templates as
|
|
4989
|
+
* The contact's first name. Available in broadcast templates as `bird.contact.first_name`.
|
|
4951
4990
|
*/
|
|
4952
4991
|
first_name?: string | null;
|
|
4953
4992
|
/**
|
|
4954
|
-
* The contact's last name. Available in broadcast templates as
|
|
4993
|
+
* The contact's last name. Available in broadcast templates as `bird.contact.last_name`.
|
|
4955
4994
|
*/
|
|
4956
4995
|
last_name?: string | null;
|
|
4957
4996
|
/**
|
|
@@ -4959,7 +4998,7 @@ type Contact = {
|
|
|
4959
4998
|
*/
|
|
4960
4999
|
external_id?: string | null;
|
|
4961
5000
|
/**
|
|
4962
|
-
* Custom property values for this contact, available
|
|
5001
|
+
* Custom property values for this contact, available in broadcast templates as `bird.contact.<key>`. Each key is a property created via the contact properties API, and each value is a string, number, boolean, or RFC 3339 datetime matching the property's declared type (strings up to 500 characters). Total size is capped at 2 KB serialized. Values stored under a property that was later archived remain readable here.
|
|
4963
5002
|
*
|
|
4964
5003
|
*/
|
|
4965
5004
|
data?: {
|
|
@@ -5014,7 +5053,7 @@ type ContactPropertyUpdateRequest = {
|
|
|
5014
5053
|
};
|
|
5015
5054
|
type ContactPropertyCreateRequest = {
|
|
5016
5055
|
/**
|
|
5017
|
-
* The property key, used as the key in contact data and as the
|
|
5056
|
+
* The property key, used as the key in contact data and as the attribute in the `bird.contact.<key>` broadcast template variable. Lowercase letters, digits, and underscores, starting with a letter. Cannot be changed after creation.
|
|
5018
5057
|
*/
|
|
5019
5058
|
key: string;
|
|
5020
5059
|
type: ContactPropertyType;
|
|
@@ -5037,7 +5076,7 @@ type ContactProperty = {
|
|
|
5037
5076
|
*/
|
|
5038
5077
|
readonly id: ContactPropertyId;
|
|
5039
5078
|
/**
|
|
5040
|
-
* The property key, used as the key in contact data and as the
|
|
5079
|
+
* The property key, used as the key in contact data and as the attribute in the `bird.contact.<key>` broadcast template variable. Lowercase letters, digits, and underscores, starting with a letter. Cannot be changed after creation.
|
|
5041
5080
|
*/
|
|
5042
5081
|
key: string;
|
|
5043
5082
|
type: ContactPropertyType;
|
|
@@ -5276,7 +5315,7 @@ type EmailTemplateSend = unknown & {
|
|
|
5276
5315
|
*/
|
|
5277
5316
|
language?: LanguageTag;
|
|
5278
5317
|
/**
|
|
5279
|
-
* Values for the template's
|
|
5318
|
+
* Values for the template's parameters, keyed by parameter name. A parameter name is a single word, and every parameter the template's `variables` lists needs a value here: a send that omits one is rejected rather than delivered with a blank. Send everything `variables` lists rather than only what you expect the chosen language to use, since languages need not reference the same parameters and a value no language uses is ignored. Cap: 16 KB serialized.
|
|
5280
5319
|
*
|
|
5281
5320
|
*/
|
|
5282
5321
|
parameters?: {
|
|
@@ -5337,7 +5376,7 @@ type EmailMessageSendRequest = {
|
|
|
5337
5376
|
[key: string]: unknown;
|
|
5338
5377
|
};
|
|
5339
5378
|
/**
|
|
5340
|
-
*
|
|
5379
|
+
* Parameter values used to personalize inline content. A parameter is a single word, and a token in the subject or body (for example `{{ animal }}`) is replaced with the value of that name at send time. Shared across all recipients of this send. A token with no matching key renders empty. Cap: 16 KB serialized. When sending a stored `template`, put the values in `template.parameters` instead.
|
|
5341
5380
|
*
|
|
5342
5381
|
*/
|
|
5343
5382
|
parameters?: {
|
|
@@ -7587,7 +7626,7 @@ type ListVoiceCallsData = {
|
|
|
7587
7626
|
*/
|
|
7588
7627
|
direction?: VoiceCallDirection;
|
|
7589
7628
|
/**
|
|
7590
|
-
* Return only calls with one of these statuses, comma-separated.
|
|
7629
|
+
* Return only calls with one of these statuses, comma-separated. In-flight and final statuses may be combined freely.
|
|
7591
7630
|
*
|
|
7592
7631
|
*/
|
|
7593
7632
|
status?: Array<VoiceCallStatus>;
|
|
@@ -8966,7 +9005,7 @@ declare class WhatsappResource extends WhatsappResourceBase {
|
|
|
8966
9005
|
type VoiceListQuery = NonNullable<ListVoiceCallsData["query"]>;
|
|
8967
9006
|
declare class VoiceResource extends Resource {
|
|
8968
9007
|
/**
|
|
8969
|
-
* List the workspace's calls, newest first. Filter to `ringing`/`in_progress` for the calls in progress right now,
|
|
9008
|
+
* List the workspace's calls, newest first. Filter to `ringing`/`in_progress` for the calls in progress right now, to final statuses for completed records, or to any mix of the two. Use `from`/`to` for one known party number in international form, and `number` to search either side by fragment. These are per-call records: for rates and totals over a period use voice_stats_summary rather than summing them here, and voice_get to follow one call to settlement.
|
|
8970
9009
|
*
|
|
8971
9010
|
* @example Iterate the calls happening right now
|
|
8972
9011
|
* for await (const call of bird.voice.list({ status: ["ringing", "in_progress"] })) {
|
|
@@ -9385,6 +9424,26 @@ declare const EmailEventType: {
|
|
|
9385
9424
|
};
|
|
9386
9425
|
/** A known EmailEventType value. */
|
|
9387
9426
|
type EmailEventTypeValue = (typeof EmailEventType)[keyof typeof EmailEventType];
|
|
9427
|
+
/**
|
|
9428
|
+
* Values of SMSErrorCode known at this SDK version. The wire value is an open
|
|
9429
|
+
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
9430
|
+
* these with a `default` branch rather than treating the set as closed.
|
|
9431
|
+
*/
|
|
9432
|
+
declare const SMSErrorCode: {
|
|
9433
|
+
readonly BlockedByCarrier: "blocked_by_carrier";
|
|
9434
|
+
readonly BlockedByRecipient: "blocked_by_recipient";
|
|
9435
|
+
readonly ContentRejected: "content_rejected";
|
|
9436
|
+
readonly InsufficientBalance: "insufficient_balance";
|
|
9437
|
+
readonly InvalidDestination: "invalid_destination";
|
|
9438
|
+
readonly LandlineUnreachable: "landline_unreachable";
|
|
9439
|
+
readonly ProviderUnavailable: "provider_unavailable";
|
|
9440
|
+
readonly RecipientOptedOut: "recipient_opted_out";
|
|
9441
|
+
readonly SenderUnregistered: "sender_unregistered";
|
|
9442
|
+
readonly Unknown: "unknown";
|
|
9443
|
+
readonly Unreachable: "unreachable";
|
|
9444
|
+
};
|
|
9445
|
+
/** A known SMSErrorCode value. */
|
|
9446
|
+
type SMSErrorCodeValue = (typeof SMSErrorCode)[keyof typeof SMSErrorCode];
|
|
9388
9447
|
/**
|
|
9389
9448
|
* Values of VerificationAttemptFailureReason known at this SDK version. The wire value is an open
|
|
9390
9449
|
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
@@ -9457,10 +9516,15 @@ type WhatsAppTemplateCategoryValue = (typeof WhatsAppTemplateCategory)[keyof typ
|
|
|
9457
9516
|
* these with a `default` branch rather than treating the set as closed.
|
|
9458
9517
|
*/
|
|
9459
9518
|
declare const WhatsAppTemplateParameterType: {
|
|
9519
|
+
readonly Document: "document";
|
|
9520
|
+
readonly Gif: "gif";
|
|
9521
|
+
readonly Image: "image";
|
|
9522
|
+
readonly Location: "location";
|
|
9460
9523
|
readonly Text: "text";
|
|
9524
|
+
readonly Video: "video";
|
|
9461
9525
|
};
|
|
9462
9526
|
/** A known WhatsAppTemplateParameterType value. */
|
|
9463
9527
|
type WhatsAppTemplateParameterTypeValue = (typeof WhatsAppTemplateParameterType)[keyof typeof WhatsAppTemplateParameterType];
|
|
9464
9528
|
//#endregion
|
|
9465
|
-
export { type APIPromise, type Audience, type AudienceAddContactsParams, type AudienceCreateParams, type AudienceListContactsQuery, type AudienceListQuery, type AudienceMember, type AudienceRemoveContactsParams, type AudienceUpdateParams, BirdAPIError, BirdAuthError, BirdBadRequestError, BirdBillingError, BirdClient, type BirdClientOptions, BirdConflictError, BirdConnectionError, BirdError, BirdInternalError, BirdMisdirectedError, BirdNotFoundError, BirdNotImplementedError, BirdPayloadTooLargeError, BirdPermissionError, BirdPreconditionError, BirdRateLimitError, type BirdRequest, type BirdResponse, BirdServiceUnavailableError, BirdTimeoutError, BirdValidationError, type BirdWebhookEvent, BirdWebhookVerificationError, type Contact, type ContactBatchParams, type ContactCreateParams, type ContactListQuery, type ContactProperty, type ContactPropertyCreateParams, type ContactPropertyListQuery, type ContactPropertyUpdateParams, type ContactUpdateParams, type ContactUpsertResult, type CursorPage, type DnsRecord, type Domain, type DomainCapabilities, type DomainCreateParams, type DomainDkim, type DomainListQuery, type DomainUpdateParams, type EmailChannelDefaults, EmailEventType, type EmailEventTypeValue, type EmailListQuery, type EmailMailboxLabelList, type EmailMailboxesCreateParams, type EmailMailboxesListQuery, type EmailMailboxesMessagesCreateParams, type EmailMailboxesReceiveRulesCreateParams, type EmailMailboxesReceiveRulesListQuery, type EmailMailboxesStatsQuery, type EmailMailboxesUpdateParams, type EmailMailboxesUpdateQuery, type EmailMessage, type EmailSendBatchParams, type EmailSendBatchResult, type EmailSendParams, type EmailStatsByBounceCodeQuery, type EmailStatsByBounceCodeResponse, type EmailStatsByBroadcastQuery, type EmailStatsByBroadcastResponse, type EmailStatsByCategoryQuery, type EmailStatsByCategoryResponse, type EmailStatsByClientQuery, type EmailStatsByClientResponse, type EmailStatsByComplaintTypeQuery, type EmailStatsByComplaintTypeResponse, type EmailStatsByLocationQuery, type EmailStatsByLocationResponse, type EmailStatsByMailboxProviderQuery, type EmailStatsByMailboxProviderRegionQuery, type EmailStatsByMailboxProviderRegionResponse, type EmailStatsByMailboxProviderResponse, type EmailStatsByRecipientDomainQuery, type EmailStatsByRecipientDomainResponse, type EmailStatsBySendingDomainQuery, type EmailStatsBySendingDomainResponse, type EmailStatsBySendingIpQuery, type EmailStatsBySendingIpResponse, type EmailStatsByTagQuery, type EmailStatsByTemplateQuery, type EmailStatsByTemplateResponse, type EmailStatsDailyQuery, type EmailStatsHourlyQuery, type EmailStatsResponse, type EmailStatsSummary, type EmailStatsSummaryQuery, type EmailStatsTagsResponse, type EmailThread, type EmailThreadMessage, type EmailThreadMessageAttachmentList, type EmailThreadMessageBody, type EmailThreadsDeleteQuery, type EmailThreadsListQuery, type EmailThreadsMessagesListQuery, type EmailThreadsMessagesReplyParams, type EmailThreadsUpdateParams, type ErrorDetail, type ErrorNextAction, type Mailbox, type MailboxStatsResponse, type PaginatedPromise, type RealtimeBatchPublishResult, type RealtimeChannelGetQuery, type RealtimeChannelInclude, type RealtimeChannelInfo, type RealtimeChannelListItem, type RealtimeChannelListQuery, type RealtimeChannelMember, type RealtimeChannelMembers, type RealtimeChannelsList, type RealtimeOptions, type RealtimePublishBatchParams, type RealtimePublishParams, type RealtimePublishResult, type ReceiveRule, type RequestOptions, type SafeResult, type SmsListQuery, type SmsMessage, type SmsSendBatchParams, type SmsSendBatchResult, type SmsSendParams, type SmsTemplate, type SmsTemplateList, type SmsTemplateListQuery, type UnmetGate, type Verification, VerificationAttemptFailureReason, type VerificationAttemptFailureReasonValue, VerificationChannel, type VerificationChannelValue, type VerificationCheckResult, VerificationTerminalReason, type VerificationTerminalReasonValue, type VerifyVerificationsCheckParams, type VerifyVerificationsCreateParams, type VerifyVerificationsNextChannelParams, WebhookEventType, type WebhookEventTypeValue, type WebhookHeaders, type WebhookOptions, WhatsAppErrorCode, type WhatsAppErrorCodeValue, type WhatsAppEventList, type WhatsAppMessage, WhatsAppTemplateCategory, type WhatsAppTemplateCategoryValue, WhatsAppTemplateParameterType, type WhatsAppTemplateParameterTypeValue, type WhatsappListEventsQuery, type WhatsappListQuery, type WhatsappSendParams, baseUrlForRegion, regionFromApiKey };
|
|
9529
|
+
export { type APIPromise, type Audience, type AudienceAddContactsParams, type AudienceCreateParams, type AudienceListContactsQuery, type AudienceListQuery, type AudienceMember, type AudienceRemoveContactsParams, type AudienceUpdateParams, BirdAPIError, BirdAuthError, BirdBadRequestError, BirdBillingError, BirdClient, type BirdClientOptions, BirdConflictError, BirdConnectionError, BirdError, BirdInternalError, BirdMisdirectedError, BirdNotFoundError, BirdNotImplementedError, BirdPayloadTooLargeError, BirdPermissionError, BirdPreconditionError, BirdRateLimitError, type BirdRequest, type BirdResponse, BirdServiceUnavailableError, BirdTimeoutError, BirdValidationError, type BirdWebhookEvent, BirdWebhookVerificationError, type Contact, type ContactBatchParams, type ContactCreateParams, type ContactListQuery, type ContactProperty, type ContactPropertyCreateParams, type ContactPropertyListQuery, type ContactPropertyUpdateParams, type ContactUpdateParams, type ContactUpsertResult, type CursorPage, type DnsRecord, type Domain, type DomainCapabilities, type DomainCreateParams, type DomainDkim, type DomainListQuery, type DomainUpdateParams, type EmailChannelDefaults, EmailEventType, type EmailEventTypeValue, type EmailListQuery, type EmailMailboxLabelList, type EmailMailboxesCreateParams, type EmailMailboxesListQuery, type EmailMailboxesMessagesCreateParams, type EmailMailboxesReceiveRulesCreateParams, type EmailMailboxesReceiveRulesListQuery, type EmailMailboxesStatsQuery, type EmailMailboxesUpdateParams, type EmailMailboxesUpdateQuery, type EmailMessage, type EmailSendBatchParams, type EmailSendBatchResult, type EmailSendParams, type EmailStatsByBounceCodeQuery, type EmailStatsByBounceCodeResponse, type EmailStatsByBroadcastQuery, type EmailStatsByBroadcastResponse, type EmailStatsByCategoryQuery, type EmailStatsByCategoryResponse, type EmailStatsByClientQuery, type EmailStatsByClientResponse, type EmailStatsByComplaintTypeQuery, type EmailStatsByComplaintTypeResponse, type EmailStatsByLocationQuery, type EmailStatsByLocationResponse, type EmailStatsByMailboxProviderQuery, type EmailStatsByMailboxProviderRegionQuery, type EmailStatsByMailboxProviderRegionResponse, type EmailStatsByMailboxProviderResponse, type EmailStatsByRecipientDomainQuery, type EmailStatsByRecipientDomainResponse, type EmailStatsBySendingDomainQuery, type EmailStatsBySendingDomainResponse, type EmailStatsBySendingIpQuery, type EmailStatsBySendingIpResponse, type EmailStatsByTagQuery, type EmailStatsByTemplateQuery, type EmailStatsByTemplateResponse, type EmailStatsDailyQuery, type EmailStatsHourlyQuery, type EmailStatsResponse, type EmailStatsSummary, type EmailStatsSummaryQuery, type EmailStatsTagsResponse, type EmailThread, type EmailThreadMessage, type EmailThreadMessageAttachmentList, type EmailThreadMessageBody, type EmailThreadsDeleteQuery, type EmailThreadsListQuery, type EmailThreadsMessagesListQuery, type EmailThreadsMessagesReplyParams, type EmailThreadsUpdateParams, type ErrorDetail, type ErrorNextAction, type Mailbox, type MailboxStatsResponse, type PaginatedPromise, type RealtimeBatchPublishResult, type RealtimeChannelGetQuery, type RealtimeChannelInclude, type RealtimeChannelInfo, type RealtimeChannelListItem, type RealtimeChannelListQuery, type RealtimeChannelMember, type RealtimeChannelMembers, type RealtimeChannelsList, type RealtimeOptions, type RealtimePublishBatchParams, type RealtimePublishParams, type RealtimePublishResult, type ReceiveRule, type RequestOptions, SMSErrorCode, type SMSErrorCodeValue, type SafeResult, type SmsListQuery, type SmsMessage, type SmsSendBatchParams, type SmsSendBatchResult, type SmsSendParams, type SmsTemplate, type SmsTemplateList, type SmsTemplateListQuery, type UnmetGate, type Verification, VerificationAttemptFailureReason, type VerificationAttemptFailureReasonValue, VerificationChannel, type VerificationChannelValue, type VerificationCheckResult, VerificationTerminalReason, type VerificationTerminalReasonValue, type VerifyVerificationsCheckParams, type VerifyVerificationsCreateParams, type VerifyVerificationsNextChannelParams, WebhookEventType, type WebhookEventTypeValue, type WebhookHeaders, type WebhookOptions, WhatsAppErrorCode, type WhatsAppErrorCodeValue, type WhatsAppEventList, type WhatsAppMessage, WhatsAppTemplateCategory, type WhatsAppTemplateCategoryValue, WhatsAppTemplateParameterType, type WhatsAppTemplateParameterTypeValue, type WhatsappListEventsQuery, type WhatsappListQuery, type WhatsappSendParams, baseUrlForRegion, regionFromApiKey };
|
|
9466
9530
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -3189,9 +3189,9 @@ const listMailboxLabels = (options) => (options.client ?? client).get({
|
|
|
3189
3189
|
*
|
|
3190
3190
|
* Returns a paginated list of the workspace's calls, ordered by start time descending.
|
|
3191
3191
|
*
|
|
3192
|
-
* The `status` filter selects
|
|
3192
|
+
* The `status` filter selects where in the lifecycle you look, and any combination is a single page: in-flight statuses (`ringing`, `in_progress`), final ones, or both together. Omit it and you get completed calls, which is what this list has always returned.
|
|
3193
3193
|
*
|
|
3194
|
-
*
|
|
3194
|
+
* A call in flight carries no economics yet: `duration_ms`, `billable_ms`, `ended_at`, and `cost` are null until it ends. It keeps the same `id` throughout, so the same call answers under one identity from the first ring to settlement.
|
|
3195
3195
|
*
|
|
3196
3196
|
*/
|
|
3197
3197
|
const listVoiceCalls = (options) => (options?.client ?? client).get({
|
|
@@ -4841,7 +4841,7 @@ var WhatsappResource = class extends WhatsappResourceBase {
|
|
|
4841
4841
|
//#region src/resources/voice.gen.ts
|
|
4842
4842
|
var VoiceResource = class extends Resource {
|
|
4843
4843
|
/**
|
|
4844
|
-
* List the workspace's calls, newest first. Filter to `ringing`/`in_progress` for the calls in progress right now,
|
|
4844
|
+
* List the workspace's calls, newest first. Filter to `ringing`/`in_progress` for the calls in progress right now, to final statuses for completed records, or to any mix of the two. Use `from`/`to` for one known party number in international form, and `number` to search either side by fragment. These are per-call records: for rates and totals over a period use voice_stats_summary rather than summing them here, and voice_get to follow one call to settlement.
|
|
4845
4845
|
*
|
|
4846
4846
|
* @example Iterate the calls happening right now
|
|
4847
4847
|
* for await (const call of bird.voice.list({ status: ["ringing", "in_progress"] })) {
|
|
@@ -5238,9 +5238,9 @@ var BirdClient = class {
|
|
|
5238
5238
|
this.#headers = {
|
|
5239
5239
|
...opts.defaultHeaders,
|
|
5240
5240
|
Authorization: `Bearer ${opts.apiKey}`,
|
|
5241
|
-
"User-Agent": `bird-sdk-js/0.
|
|
5241
|
+
"User-Agent": `bird-sdk-js/0.25.0`,
|
|
5242
5242
|
"Bird-Surface": "sdk-js",
|
|
5243
|
-
"Bird-Version": "0.
|
|
5243
|
+
"Bird-Version": "0.25.0"
|
|
5244
5244
|
};
|
|
5245
5245
|
const caller = detectCaller();
|
|
5246
5246
|
if (caller) this.#headers["Bird-Caller"] = caller;
|
|
@@ -5406,6 +5406,24 @@ const EmailEventType = {
|
|
|
5406
5406
|
EmailUnsubscribed: "email.unsubscribed"
|
|
5407
5407
|
};
|
|
5408
5408
|
/**
|
|
5409
|
+
* Values of SMSErrorCode known at this SDK version. The wire value is an open
|
|
5410
|
+
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
5411
|
+
* these with a `default` branch rather than treating the set as closed.
|
|
5412
|
+
*/
|
|
5413
|
+
const SMSErrorCode = {
|
|
5414
|
+
BlockedByCarrier: "blocked_by_carrier",
|
|
5415
|
+
BlockedByRecipient: "blocked_by_recipient",
|
|
5416
|
+
ContentRejected: "content_rejected",
|
|
5417
|
+
InsufficientBalance: "insufficient_balance",
|
|
5418
|
+
InvalidDestination: "invalid_destination",
|
|
5419
|
+
LandlineUnreachable: "landline_unreachable",
|
|
5420
|
+
ProviderUnavailable: "provider_unavailable",
|
|
5421
|
+
RecipientOptedOut: "recipient_opted_out",
|
|
5422
|
+
SenderUnregistered: "sender_unregistered",
|
|
5423
|
+
Unknown: "unknown",
|
|
5424
|
+
Unreachable: "unreachable"
|
|
5425
|
+
};
|
|
5426
|
+
/**
|
|
5409
5427
|
* Values of VerificationAttemptFailureReason known at this SDK version. The wire value is an open
|
|
5410
5428
|
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
5411
5429
|
* these with a `default` branch rather than treating the set as closed.
|
|
@@ -5466,8 +5484,15 @@ const WhatsAppTemplateCategory = {
|
|
|
5466
5484
|
* string: a value added by a newer server deserializes unchanged, so switch on
|
|
5467
5485
|
* these with a `default` branch rather than treating the set as closed.
|
|
5468
5486
|
*/
|
|
5469
|
-
const WhatsAppTemplateParameterType = {
|
|
5487
|
+
const WhatsAppTemplateParameterType = {
|
|
5488
|
+
Document: "document",
|
|
5489
|
+
Gif: "gif",
|
|
5490
|
+
Image: "image",
|
|
5491
|
+
Location: "location",
|
|
5492
|
+
Text: "text",
|
|
5493
|
+
Video: "video"
|
|
5494
|
+
};
|
|
5470
5495
|
//#endregion
|
|
5471
|
-
export { BirdAPIError, BirdAuthError, BirdBadRequestError, BirdBillingError, BirdClient, BirdConflictError, BirdConnectionError, BirdError, BirdInternalError, BirdMisdirectedError, BirdNotFoundError, BirdNotImplementedError, BirdPayloadTooLargeError, BirdPermissionError, BirdPreconditionError, BirdRateLimitError, BirdServiceUnavailableError, BirdTimeoutError, BirdValidationError, BirdWebhookVerificationError, EmailEventType, VerificationAttemptFailureReason, VerificationChannel, VerificationTerminalReason, WebhookEventType, WhatsAppErrorCode, WhatsAppTemplateCategory, WhatsAppTemplateParameterType, baseUrlForRegion, regionFromApiKey };
|
|
5496
|
+
export { BirdAPIError, BirdAuthError, BirdBadRequestError, BirdBillingError, BirdClient, BirdConflictError, BirdConnectionError, BirdError, BirdInternalError, BirdMisdirectedError, BirdNotFoundError, BirdNotImplementedError, BirdPayloadTooLargeError, BirdPermissionError, BirdPreconditionError, BirdRateLimitError, BirdServiceUnavailableError, BirdTimeoutError, BirdValidationError, BirdWebhookVerificationError, EmailEventType, SMSErrorCode, VerificationAttemptFailureReason, VerificationChannel, VerificationTerminalReason, WebhookEventType, WhatsAppErrorCode, WhatsAppTemplateCategory, WhatsAppTemplateParameterType, baseUrlForRegion, regionFromApiKey };
|
|
5472
5497
|
|
|
5473
5498
|
//# sourceMappingURL=index.mjs.map
|