@messagebird/sdk 0.35.0 → 0.37.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
@@ -639,9 +639,11 @@ type LanguageTag = string;
639
639
  type EmailTemplateId = string;
640
640
  type EmailTemplateVersionId = string;
641
641
  /**
642
- * Structured key/value label attached to a message. Surfaces in list filters, the event log, and webhook payloads. Use tags for low-cardinality filtering dimensions (category, experiment ID, template ID). For arbitrary per-send context that does not need to be filterable, use `metadata`.
642
+ * Structured key/value label attached to a message or a call. Use tags for low-cardinality filtering dimensions (category, experiment ID, template ID); they surface in the list filter of whatever carries them.
643
643
  *
644
- * The send request defines the tag-count limit. Tag names are unique within a send; supplying the same name twice is rejected.
644
+ * On a message they also surface in the event log and in webhook payloads, and a message can carry `metadata` beside them for arbitrary per-send context that does not need to be filterable. A call has none of those three: its tags are set on the wire when the call is placed, and the call record is the one place you read them back.
645
+ *
646
+ * Whatever carries the tags defines how many it may have. Tag names are unique: a send that repeats one is rejected, and on a call the first instance of a name wins.
645
647
  *
646
648
  */
647
649
  type Tag = {
@@ -2107,10 +2109,25 @@ type SmsSuppressionCreate = {
2107
2109
  originator: string;
2108
2110
  };
2109
2111
  /**
2110
- * Action taken when an inbound message matches the rule. `stop` unsubscribes the sender, `start` resubscribes them, `help` sends your support information, and `custom` sends the reply you configured. Built-in compliance rules fix the operation for `stop`, `start`, and `help`. This is an open enum. Accept unrecognized values.
2112
+ * What Bird does when an inbound message matches the rule.
2113
+ *
2114
+ * - `stop` unsubscribes the sender from further messages.
2115
+ * - `start` resubscribes them.
2116
+ * - `help` replies with your support information.
2117
+ * - `info` replies with your program information. It behaves exactly as `help` does and is
2118
+ * separate so a country whose INFO answer must differ from its HELP answer can carry both.
2119
+ * Where Bird ships no `info` rule for a country, INFO is one of that country's `help`
2120
+ * keywords and answers with the `help` reply.
2121
+ * - `confirm` marks a double opt-in reply. It sends nothing today, so answer it from your own
2122
+ * handler.
2123
+ * - `custom` replies with the text you configured and has no other effect.
2124
+ *
2125
+ * Bird's built-in rules fix the operation for `stop`, `start` and `help`; you can change their
2126
+ * reply but not what they do. The same holds for `info` in any country where Bird ships an
2127
+ * `info` rule. This is an open enum. Accept unrecognized values.
2111
2128
  *
2112
2129
  */
2113
- type SmsKeywordOperation = "stop" | "start" | "help" | "custom" | (string & {});
2130
+ type SmsKeywordOperation = "stop" | "start" | "help" | "info" | "confirm" | "custom" | (string & {});
2114
2131
  /**
2115
2132
  * Whether the rule is one of Bird's defaults (`system`) or one your workspace created (`workspace`). A `workspace` rule takes precedence over Bird's default for the same country, so it is how you replace a reply without losing the keywords Bird ships.
2116
2133
  *
@@ -7970,7 +7987,7 @@ type EventWhatsAppSent = {
7970
7987
  */
7971
7988
  type NumberType$1 = "mobile" | "local" | "national" | "short_code" | "short_code_fteu" | "toll_free" | (string & {});
7972
7989
  /**
7973
- * Channel capability supported by a phone number. New capabilities may be added over time, so treat unrecognized values as supported capabilities rather than errors.
7990
+ * A capability supported by a phone number. New capabilities may be added over time, so treat unrecognized values as supported capabilities rather than errors.
7974
7991
  */
7975
7992
  type NumberCapability$1 = "sms" | "mms" | "voice" | (string & {});
7976
7993
  /**
@@ -8013,7 +8030,7 @@ type Number = {
8013
8030
  */
8014
8031
  readonly number_type: NumberType$1;
8015
8032
  /**
8016
- * Channel capabilities supported by this number.
8033
+ * Capabilities supported by this number.
8017
8034
  */
8018
8035
  readonly capabilities: Array<NumberCapability$1>;
8019
8036
  /**
@@ -8056,7 +8073,7 @@ type AvailableNumber = {
8056
8073
  */
8057
8074
  number_type: NumberType$1;
8058
8075
  /**
8059
- * Channel capabilities supported by this number.
8076
+ * Capabilities supported by this number.
8060
8077
  */
8061
8078
  capabilities: Array<NumberCapability$1>;
8062
8079
  };
@@ -8234,6 +8251,10 @@ type VoiceCall = {
8234
8251
  * Why we refused the call before dialing a carrier. Absent when the call connected or failed at the carrier; see `sip_response_code` for the carrier response.
8235
8252
  */
8236
8253
  readonly rejection_reason?: VoiceCallRejectionReason;
8254
+ /**
8255
+ * Your own `{name, value}` labels for this call, taken from the `X-Bird-Call-Tag` headers on the INVITE that placed it. Set them to organise calls by a dimension of your own (campaign, queue, agent, cost centre), then filter this list by them with `tag`. Read-only here: a call is labelled when it is placed, and never afterwards. What is here may be less than what was sent, and the call still goes through either way: a tag whose name or value breaks the rules below is dropped, anything past the first five is ignored, and a name sent more than once keeps its first value. Absent when the call carried none, and on calls recorded before this field existed.
8256
+ */
8257
+ readonly tags?: Array<Tag>;
8237
8258
  /**
8238
8259
  * When the call was initiated.
8239
8260
  */
@@ -8430,7 +8451,7 @@ type ListEmailMessagesData = {
8430
8451
  */
8431
8452
  starting_after?: string;
8432
8453
  /**
8433
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
8454
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
8434
8455
  */
8435
8456
  ending_before?: string;
8436
8457
  /**
@@ -8446,7 +8467,7 @@ type ListEmailMessagesData = {
8446
8467
  */
8447
8468
  status?: EmailMessageStatus;
8448
8469
  /**
8449
- * Filter by tag. Accepts `name` to match any message carrying that tag name, or `name:value` to match a specific tag pair (for example `category:welcome`). Repeat the parameter to add more tags. A message must match every tag listed to be returned.
8470
+ * Filter by tag. Accepts `name` to match any record carrying that tag name, or `name:value` to match a specific tag pair (for example `category:welcome`). Repeat the parameter to add more tags. A record must match every tag listed to be returned.
8450
8471
  *
8451
8472
  */
8452
8473
  tag?: Array<string>;
@@ -8500,7 +8521,7 @@ type ListContactsData = {
8500
8521
  */
8501
8522
  starting_after?: string;
8502
8523
  /**
8503
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
8524
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
8504
8525
  */
8505
8526
  ending_before?: string;
8506
8527
  /**
@@ -8594,7 +8615,7 @@ type ListContactPropertiesData = {
8594
8615
  */
8595
8616
  starting_after?: string;
8596
8617
  /**
8597
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
8618
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
8598
8619
  */
8599
8620
  ending_before?: string;
8600
8621
  };
@@ -8666,7 +8687,7 @@ type ListAudiencesData = {
8666
8687
  */
8667
8688
  starting_after?: string;
8668
8689
  /**
8669
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
8690
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
8670
8691
  */
8671
8692
  ending_before?: string;
8672
8693
  };
@@ -8743,7 +8764,7 @@ type ListAudienceContactsData = {
8743
8764
  */
8744
8765
  starting_after?: string;
8745
8766
  /**
8746
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
8767
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
8747
8768
  */
8748
8769
  ending_before?: string;
8749
8770
  };
@@ -8816,7 +8837,7 @@ type ListSmsMessagesData = {
8816
8837
  */
8817
8838
  starting_after?: string;
8818
8839
  /**
8819
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
8840
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
8820
8841
  */
8821
8842
  ending_before?: string;
8822
8843
  /**
@@ -8854,7 +8875,7 @@ type ListSmsMessagesData = {
8854
8875
  */
8855
8876
  from?: string;
8856
8877
  /**
8857
- * Filter by tag. Accepts `name` to match any message carrying that tag name, or `name:value` to match a specific tag pair (for example `category:welcome`). Repeat the parameter to add more tags. A message must match every tag listed to be returned.
8878
+ * Filter by tag. Accepts `name` to match any record carrying that tag name, or `name:value` to match a specific tag pair (for example `category:welcome`). Repeat the parameter to add more tags. A record must match every tag listed to be returned.
8858
8879
  *
8859
8880
  */
8860
8881
  tag?: Array<string>;
@@ -8929,7 +8950,7 @@ type ListSmsSuppressionsData = {
8929
8950
  */
8930
8951
  starting_after?: string;
8931
8952
  /**
8932
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
8953
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
8933
8954
  */
8934
8955
  ending_before?: string;
8935
8956
  };
@@ -9708,7 +9729,7 @@ type ListWhatsAppMessagesData = {
9708
9729
  */
9709
9730
  starting_after?: string;
9710
9731
  /**
9711
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
9732
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
9712
9733
  */
9713
9734
  ending_before?: string;
9714
9735
  /**
@@ -9755,7 +9776,7 @@ type ListWhatsAppMessagesData = {
9755
9776
  */
9756
9777
  category?: WhatsAppTemplateCategory$1;
9757
9778
  /**
9758
- * Filter by tag. Accepts `name` to match any message carrying that tag name, or `name:value` to match a specific tag pair (for example `category:welcome`). Repeat the parameter to add more tags. A message must match every tag listed to be returned.
9779
+ * Filter by tag. Accepts `name` to match any record carrying that tag name, or `name:value` to match a specific tag pair (for example `category:welcome`). Repeat the parameter to add more tags. A record must match every tag listed to be returned.
9759
9780
  *
9760
9781
  */
9761
9782
  tag?: Array<string>;
@@ -10461,7 +10482,7 @@ type ListDomainsData = {
10461
10482
  */
10462
10483
  starting_after?: string;
10463
10484
  /**
10464
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
10485
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
10465
10486
  */
10466
10487
  ending_before?: string;
10467
10488
  /**
@@ -10553,7 +10574,7 @@ type ListMailboxesData = {
10553
10574
  */
10554
10575
  starting_after?: string;
10555
10576
  /**
10556
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
10577
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
10557
10578
  */
10558
10579
  ending_before?: string;
10559
10580
  };
@@ -10667,7 +10688,7 @@ type ListMailboxReceiveRulesData = {
10667
10688
  */
10668
10689
  starting_after?: string;
10669
10690
  /**
10670
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
10691
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
10671
10692
  */
10672
10693
  ending_before?: string;
10673
10694
  };
@@ -10747,7 +10768,7 @@ type ListEmailThreadsData = {
10747
10768
  */
10748
10769
  starting_after?: string;
10749
10770
  /**
10750
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
10771
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
10751
10772
  */
10752
10773
  ending_before?: string;
10753
10774
  };
@@ -10843,7 +10864,7 @@ type ListEmailThreadMessagesData = {
10843
10864
  */
10844
10865
  starting_after?: string;
10845
10866
  /**
10846
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
10867
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
10847
10868
  */
10848
10869
  ending_before?: string;
10849
10870
  };
@@ -10907,7 +10928,7 @@ type ListWorkspaceNumbersData = {
10907
10928
  */
10908
10929
  prefix?: string;
10909
10930
  /**
10910
- * Filter by channel capability. Repeat the parameter to require several at once: `capabilities=sms&capabilities=voice` returns only numbers that support both.
10931
+ * Filter by capability. Repeat the parameter to require several at once: `capabilities=sms&capabilities=voice` returns only numbers that support both.
10911
10932
  */
10912
10933
  capabilities?: Array<string>;
10913
10934
  /**
@@ -10919,7 +10940,7 @@ type ListWorkspaceNumbersData = {
10919
10940
  */
10920
10941
  starting_after?: string;
10921
10942
  /**
10922
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
10943
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
10923
10944
  */
10924
10945
  ending_before?: string;
10925
10946
  };
@@ -10948,7 +10969,7 @@ type ListAvailableNumbersData = {
10948
10969
  */
10949
10970
  prefix?: string;
10950
10971
  /**
10951
- * Filter by channel capability. Repeat the parameter to require several at once: `capabilities=sms&capabilities=voice` returns only numbers that support both.
10972
+ * Filter by capability. Repeat the parameter to require several at once: `capabilities=sms&capabilities=voice` returns only numbers that support both.
10952
10973
  */
10953
10974
  capabilities?: Array<string>;
10954
10975
  /**
@@ -10960,7 +10981,7 @@ type ListAvailableNumbersData = {
10960
10981
  */
10961
10982
  starting_after?: string;
10962
10983
  /**
10963
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
10984
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
10964
10985
  */
10965
10986
  ending_before?: string;
10966
10987
  };
@@ -10989,7 +11010,7 @@ type ListNumbersOrdersData = {
10989
11010
  */
10990
11011
  starting_after?: string;
10991
11012
  /**
10992
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
11013
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
10993
11014
  */
10994
11015
  ending_before?: string;
10995
11016
  };
@@ -11057,6 +11078,11 @@ type ListVoiceCallsData = {
11057
11078
  * Return only calls where the calling or called number contains this value. Matches a partial number, so a country or area-code prefix returns every call to or from it. Combines with `from`/`to`, which match one side exactly.
11058
11079
  */
11059
11080
  number?: string;
11081
+ /**
11082
+ * Filter by tag. Accepts `name` to match any record carrying that tag name, or `name:value` to match a specific tag pair (for example `category:welcome`). Repeat the parameter to add more tags. A record must match every tag listed to be returned.
11083
+ *
11084
+ */
11085
+ tag?: Array<string>;
11060
11086
  /**
11061
11087
  * Return only calls that started at or after this instant, inclusive. RFC 3339 timestamp.
11062
11088
  */
@@ -11074,7 +11100,7 @@ type ListVoiceCallsData = {
11074
11100
  */
11075
11101
  starting_after?: string;
11076
11102
  /**
11077
- * Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.
11103
+ * Cursor from the `prev_cursor` or `refresh_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order. `prev_cursor` returns the preceding page. `refresh_cursor` anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
11078
11104
  */
11079
11105
  ending_before?: string;
11080
11106
  };
@@ -13497,8 +13523,10 @@ type SMSErrorCodeValue = (typeof SMSErrorCode)[keyof typeof SMSErrorCode];
13497
13523
  * these with a `default` branch rather than treating the set as closed.
13498
13524
  */
13499
13525
  declare const SMSKeywordOperation: {
13526
+ readonly Confirm: "confirm";
13500
13527
  readonly Custom: "custom";
13501
13528
  readonly Help: "help";
13529
+ readonly Info: "info";
13502
13530
  readonly Start: "start";
13503
13531
  readonly Stop: "stop";
13504
13532
  };
package/dist/index.mjs CHANGED
@@ -7132,9 +7132,9 @@ var BirdClient = class {
7132
7132
  this.#headers = {
7133
7133
  ...opts.defaultHeaders,
7134
7134
  Authorization: `Bearer ${opts.apiKey}`,
7135
- "User-Agent": `bird-sdk-js/0.35.0`,
7135
+ "User-Agent": `bird-sdk-js/0.37.0`,
7136
7136
  "Bird-Surface": "sdk-js",
7137
- "Bird-Version": "0.35.0"
7137
+ "Bird-Version": "0.37.0"
7138
7138
  };
7139
7139
  const caller = detectCaller();
7140
7140
  if (caller) this.#headers["Bird-Caller"] = caller;
@@ -7414,8 +7414,10 @@ const SMSErrorCode = {
7414
7414
  * these with a `default` branch rather than treating the set as closed.
7415
7415
  */
7416
7416
  const SMSKeywordOperation = {
7417
+ Confirm: "confirm",
7417
7418
  Custom: "custom",
7418
7419
  Help: "help",
7420
+ Info: "info",
7419
7421
  Start: "start",
7420
7422
  Stop: "stop"
7421
7423
  };