@zavudev/sdk 0.60.2 → 0.61.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/src/types.ts CHANGED
@@ -948,7 +948,10 @@ export type TemplateCreateRequestButtonsItemOtpType = 'COPY_CODE' | 'ONE_TAP';
948
948
  * attribution — including `ctwaClid`, the identifier Meta's Conversions API
949
949
  * needs to credit a conversion back to that ad. WhatsApp only, and only on the
950
950
  * first message of the thread: it is absent from every later message, so persist
951
- * it when it arrives.
951
+ * it when it arrives. A message that was held because the allowance was spent
952
+ * (see `POST /v1/messages`) is delivered once the team pays, carrying
953
+ * `data.heldAt`: when it was held, in Unix milliseconds. It is absent on every
954
+ * other message.
952
955
  * - `message.unsupported`: Received a message type that is not supported
953
956
  *
954
957
  * **Broadcast events:**
@@ -1137,6 +1140,14 @@ export interface WebhookMessageData {
1137
1140
  * returns it, under `content.referral`.
1138
1141
  */
1139
1142
  referral?: AdReferral;
1143
+ /**
1144
+ * When this message was held, in Unix milliseconds. Present on `message.inbound`
1145
+ * only for a message that arrived while the monthly allowance was spent and was
1146
+ * delivered later, once the team paid; absent on every other message. Compare it
1147
+ * with `providerTimestamp` (when the contact sent it) and the event's `timestamp`
1148
+ * (when it was delivered) to decide whether an automated reply still makes sense.
1149
+ */
1150
+ heldAt?: number;
1140
1151
  }
1141
1152
 
1142
1153
  export interface WebhookMessageDataWhatsapp {
@@ -2069,10 +2080,11 @@ export interface PhoneNumberPricing {
2069
2080
  /** One-time purchase price in USD. */
2070
2081
  upfrontPrice?: number;
2071
2082
  /**
2072
- * Whether this number qualifies as the plan-included number: a US or Canadian
2073
- * number (a +1 number) costing $20 a month or less. The benefit is one per
2074
- * account: it is never offered again once claimed, not even after the number is
2075
- * released.
2083
+ * Whether this account can claim this number as the one its paid plan includes: a
2084
+ * US or Canadian number (a +1 number) costing $20 a month or less. It depends on
2085
+ * the account as well as the number: `false` on Free, and once the benefit has
2086
+ * been claimed, which is once per account and never again, not even after the
2087
+ * number is released.
2076
2088
  */
2077
2089
  isFreeEligible?: boolean;
2078
2090
  }
@@ -2124,6 +2136,23 @@ export interface OwnedPhoneNumber {
2124
2136
  */
2125
2137
  regulatoryStatus: OwnedPhoneNumberRegulatoryStatus;
2126
2138
  nextRenewalDate?: string;
2139
+ /**
2140
+ * When the number goes back to the carrier, if it is on its way out. Absent
2141
+ * otherwise.
2142
+ *
2143
+ * - **A paid plan ended.** Without a paid plan a team keeps one number: the one
2144
+ * chosen in the dashboard when cancelling, else the one the plan included, else
2145
+ * the oldest it bought. That number is billed monthly from the balance and has
2146
+ * no `releaseAt` unless a renewal fails. Every other number keeps working,
2147
+ * unbilled, until this date, 7 days after the plan ended. Numbers you brought
2148
+ * yourself are never released.
2149
+ * - **A renewal could not be paid.** The number is suspended and released at the
2150
+ * end of a 7-day grace.
2151
+ *
2152
+ * Paying, or returning to a paid plan, before this date keeps the number. A
2153
+ * released number cannot be recovered.
2154
+ */
2155
+ releaseAt?: string;
2127
2156
  createdAt: string;
2128
2157
  updatedAt?: string;
2129
2158
  }
@@ -3062,6 +3091,13 @@ export interface SubAccountResponse {
3062
3091
  subAccount: SubAccount;
3063
3092
  }
3064
3093
 
3094
+ /**
3095
+ * The team's balance, and what stops or charges it this month. Every field past
3096
+ * `isSubAccount` is team-level, the same for every project and sub-account of the
3097
+ * team. An integration that only replies to `message.inbound` never sends while
3098
+ * incoming messages are held, so it never sees the `429` that reports them: poll
3099
+ * this instead.
3100
+ */
3065
3101
  export interface BalanceResponse {
3066
3102
  /** Team balance in cents. All charges are billed to the parent team. */
3067
3103
  balance: number;
@@ -3072,6 +3108,59 @@ export interface BalanceResponse {
3072
3108
  totalSpent?: number | null;
3073
3109
  /** Whether this API key belongs to a sub-account. */
3074
3110
  isSubAccount?: boolean;
3111
+ /**
3112
+ * Whether the team is on Free and has added funds, so app messages past the
3113
+ * allowance are billed in blocks from the balance instead of stopping.
3114
+ */
3115
+ payAsYouGo: boolean;
3116
+ /**
3117
+ * The monthly usage spend cap in cents, set in the dashboard's Billing. Null means
3118
+ * no cap. The first deposit on Free sets $50 when none was chosen.
3119
+ */
3120
+ spendCap: number | null;
3121
+ /**
3122
+ * Usage taken from the balance this calendar month (UTC), in cents: what the spend
3123
+ * cap is measured against. Renewals are not counted.
3124
+ */
3125
+ spentThisMonth: number;
3126
+ /**
3127
+ * This month's WhatsApp, Telegram, Instagram and Messenger messages, sent and
3128
+ * received.
3129
+ */
3130
+ appMessages: BalanceResponseAppMessages;
3131
+ /**
3132
+ * Incoming messages held at the allowance, or null when none are. Counts and a
3133
+ * date only, never content or senders. They are delivered once the team pays; see
3134
+ * `POST /v1/messages`.
3135
+ */
3136
+ heldInbound: BalanceResponseHeldInbound | null;
3137
+ }
3138
+
3139
+ export interface BalanceResponseAppMessages {
3140
+ /** Messages counted this month, in both directions. */
3141
+ used: number;
3142
+ /**
3143
+ * Messages the plan includes this month. Null on a paid plan, which does not cap
3144
+ * them.
3145
+ */
3146
+ included: number | null;
3147
+ /**
3148
+ * Why app messages are stopped right now, or null. `allowance`: Free without funds
3149
+ * at its allowance. `balance`: pay as you go and the balance cannot cover the next
3150
+ * block. `spend_cap`: pay as you go and the spend cap leaves no room for it. While
3151
+ * paused, sends answer `429 a2p_limit_exceeded` and incoming messages are held.
3152
+ */
3153
+ paused: BalanceResponseAppMessagesPaused | null;
3154
+ }
3155
+
3156
+ export type BalanceResponseAppMessagesPaused = 'allowance' | 'balance' | 'spend_cap';
3157
+
3158
+ export interface BalanceResponseHeldInbound {
3159
+ count: number;
3160
+ /** How many the team can have held at once (1,000). Past it new ones are refused. */
3161
+ max: number;
3162
+ /** When the oldest held message expires and is dropped. */
3163
+ nextExpiresAt: string | null;
3075
3164
  }
3076
3165
 
3077
3166
  export interface SubAccountApiKey {
@@ -3130,7 +3219,11 @@ export interface TenDlcBrand {
3130
3219
  displayName: string;
3131
3220
  /** Legal company name. */
3132
3221
  companyName?: string | null;
3133
- /** Employer Identification Number (EIN). */
3222
+ /**
3223
+ * Tax id of the business: the Employer Identification Number (EIN) for a US brand,
3224
+ * or the tax id from its own country's business register for a brand outside the
3225
+ * US.
3226
+ */
3134
3227
  ein?: string | null;
3135
3228
  firstName?: string | null;
3136
3229
  lastName?: string | null;
@@ -3174,9 +3267,14 @@ export interface TenDlcBrandCreateRequest {
3174
3267
  /** Legal company name. */
3175
3268
  companyName?: string;
3176
3269
  /**
3177
- * Employer Identification Number (format: XX-XXXXXXX). Required to submit every
3178
- * entity type except `SOLE_PROPRIETOR`: a brand without it can be created as a
3179
- * draft, and `POST /v1/10dlc/brands/{brandId}/submit` refuses it with `400`.
3270
+ * Tax id of the business. For a US brand (`country` `US`), the 9-digit Employer
3271
+ * Identification Number, as `XX-XXXXXXX` or `XXXXXXXXX`. For a brand outside the
3272
+ * US, the tax id exactly as it appears in its country's business register (for
3273
+ * example a Swiss UID, `CHE-123.456.789`): 4 to 30 characters, starting with a
3274
+ * letter or digit, made of letters, digits, spaces, `.`, `-` and `/`. Any other
3275
+ * value is refused with `400`. Required to submit every entity type except
3276
+ * `SOLE_PROPRIETOR`: a brand without it can be created as a draft, and `POST
3277
+ * /v1/10dlc/brands/{brandId}/submit` refuses it with `400`.
3180
3278
  */
3181
3279
  ein?: string;
3182
3280
  firstName?: string;
@@ -3204,6 +3302,11 @@ export interface TenDlcBrandUpdateRequest {
3204
3302
  entityType?: TenDlcEntityType;
3205
3303
  displayName?: string;
3206
3304
  companyName?: string;
3305
+ /**
3306
+ * Tax id of the business, checked against `country` (the one sent in this request,
3307
+ * or the brand's current one): the 9-digit EIN for a US brand, or the tax id from
3308
+ * its country's business register otherwise.
3309
+ */
3207
3310
  ein?: string;
3208
3311
  firstName?: string;
3209
3312
  lastName?: string;
@@ -4299,6 +4402,8 @@ export interface EscalateUrlResponse {
4299
4402
  message: string;
4300
4403
  }
4301
4404
 
4405
+ export type SendMessageError409 = MessageResponse | ErrorBody;
4406
+
4302
4407
  export interface SendMessageError429 {
4303
4408
  code?: string;
4304
4409
  message?: string;
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // Generated by zavu-codegen from apps/docs/openapi.json. Do not edit: run `bun run codegen`.
2
2
 
3
- export const VERSION = '0.60.2'; // x-release-please-version
3
+ export const VERSION = '0.61.0'; // x-release-please-version
package/types.d.mts CHANGED
@@ -866,7 +866,10 @@ export type TemplateCreateRequestButtonsItemOtpType = 'COPY_CODE' | 'ONE_TAP';
866
866
  * attribution — including `ctwaClid`, the identifier Meta's Conversions API
867
867
  * needs to credit a conversion back to that ad. WhatsApp only, and only on the
868
868
  * first message of the thread: it is absent from every later message, so persist
869
- * it when it arrives.
869
+ * it when it arrives. A message that was held because the allowance was spent
870
+ * (see `POST /v1/messages`) is delivered once the team pays, carrying
871
+ * `data.heldAt`: when it was held, in Unix milliseconds. It is absent on every
872
+ * other message.
870
873
  * - `message.unsupported`: Received a message type that is not supported
871
874
  *
872
875
  * **Broadcast events:**
@@ -1036,6 +1039,14 @@ export interface WebhookMessageData {
1036
1039
  * returns it, under `content.referral`.
1037
1040
  */
1038
1041
  referral?: AdReferral;
1042
+ /**
1043
+ * When this message was held, in Unix milliseconds. Present on `message.inbound`
1044
+ * only for a message that arrived while the monthly allowance was spent and was
1045
+ * delivered later, once the team paid; absent on every other message. Compare it
1046
+ * with `providerTimestamp` (when the contact sent it) and the event's `timestamp`
1047
+ * (when it was delivered) to decide whether an automated reply still makes sense.
1048
+ */
1049
+ heldAt?: number;
1039
1050
  }
1040
1051
  export interface WebhookMessageDataWhatsapp {
1041
1052
  /**
@@ -1865,10 +1876,11 @@ export interface PhoneNumberPricing {
1865
1876
  /** One-time purchase price in USD. */
1866
1877
  upfrontPrice?: number;
1867
1878
  /**
1868
- * Whether this number qualifies as the plan-included number: a US or Canadian
1869
- * number (a +1 number) costing $20 a month or less. The benefit is one per
1870
- * account: it is never offered again once claimed, not even after the number is
1871
- * released.
1879
+ * Whether this account can claim this number as the one its paid plan includes: a
1880
+ * US or Canadian number (a +1 number) costing $20 a month or less. It depends on
1881
+ * the account as well as the number: `false` on Free, and once the benefit has
1882
+ * been claimed, which is once per account and never again, not even after the
1883
+ * number is released.
1872
1884
  */
1873
1885
  isFreeEligible?: boolean;
1874
1886
  }
@@ -1917,6 +1929,23 @@ export interface OwnedPhoneNumber {
1917
1929
  */
1918
1930
  regulatoryStatus: OwnedPhoneNumberRegulatoryStatus;
1919
1931
  nextRenewalDate?: string;
1932
+ /**
1933
+ * When the number goes back to the carrier, if it is on its way out. Absent
1934
+ * otherwise.
1935
+ *
1936
+ * - **A paid plan ended.** Without a paid plan a team keeps one number: the one
1937
+ * chosen in the dashboard when cancelling, else the one the plan included, else
1938
+ * the oldest it bought. That number is billed monthly from the balance and has
1939
+ * no `releaseAt` unless a renewal fails. Every other number keeps working,
1940
+ * unbilled, until this date, 7 days after the plan ended. Numbers you brought
1941
+ * yourself are never released.
1942
+ * - **A renewal could not be paid.** The number is suspended and released at the
1943
+ * end of a 7-day grace.
1944
+ *
1945
+ * Paying, or returning to a paid plan, before this date keeps the number. A
1946
+ * released number cannot be recovered.
1947
+ */
1948
+ releaseAt?: string;
1920
1949
  createdAt: string;
1921
1950
  updatedAt?: string;
1922
1951
  }
@@ -2751,6 +2780,13 @@ export interface SubAccountUpdateRequest {
2751
2780
  export interface SubAccountResponse {
2752
2781
  subAccount: SubAccount;
2753
2782
  }
2783
+ /**
2784
+ * The team's balance, and what stops or charges it this month. Every field past
2785
+ * `isSubAccount` is team-level, the same for every project and sub-account of the
2786
+ * team. An integration that only replies to `message.inbound` never sends while
2787
+ * incoming messages are held, so it never sees the `429` that reports them: poll
2788
+ * this instead.
2789
+ */
2754
2790
  export interface BalanceResponse {
2755
2791
  /** Team balance in cents. All charges are billed to the parent team. */
2756
2792
  balance: number;
@@ -2761,6 +2797,56 @@ export interface BalanceResponse {
2761
2797
  totalSpent?: number | null;
2762
2798
  /** Whether this API key belongs to a sub-account. */
2763
2799
  isSubAccount?: boolean;
2800
+ /**
2801
+ * Whether the team is on Free and has added funds, so app messages past the
2802
+ * allowance are billed in blocks from the balance instead of stopping.
2803
+ */
2804
+ payAsYouGo: boolean;
2805
+ /**
2806
+ * The monthly usage spend cap in cents, set in the dashboard's Billing. Null means
2807
+ * no cap. The first deposit on Free sets $50 when none was chosen.
2808
+ */
2809
+ spendCap: number | null;
2810
+ /**
2811
+ * Usage taken from the balance this calendar month (UTC), in cents: what the spend
2812
+ * cap is measured against. Renewals are not counted.
2813
+ */
2814
+ spentThisMonth: number;
2815
+ /**
2816
+ * This month's WhatsApp, Telegram, Instagram and Messenger messages, sent and
2817
+ * received.
2818
+ */
2819
+ appMessages: BalanceResponseAppMessages;
2820
+ /**
2821
+ * Incoming messages held at the allowance, or null when none are. Counts and a
2822
+ * date only, never content or senders. They are delivered once the team pays; see
2823
+ * `POST /v1/messages`.
2824
+ */
2825
+ heldInbound: BalanceResponseHeldInbound | null;
2826
+ }
2827
+ export interface BalanceResponseAppMessages {
2828
+ /** Messages counted this month, in both directions. */
2829
+ used: number;
2830
+ /**
2831
+ * Messages the plan includes this month. Null on a paid plan, which does not cap
2832
+ * them.
2833
+ */
2834
+ included: number | null;
2835
+ /**
2836
+ * Why app messages are stopped right now, or null. `allowance`: Free without funds
2837
+ * at its allowance. `balance`: pay as you go and the balance cannot cover the next
2838
+ * block. `spend_cap`: pay as you go and the spend cap leaves no room for it. While
2839
+ * paused, sends answer `429 a2p_limit_exceeded` and incoming messages are held.
2840
+ */
2841
+ paused: BalanceResponseAppMessagesPaused | null;
2842
+ }
2843
+ export type BalanceResponseAppMessagesPaused = 'allowance' | 'balance' | 'spend_cap';
2844
+ export interface BalanceResponseHeldInbound {
2845
+ count: number;
2846
+ /** How many the team can have held at once (1,000). Past it new ones are refused. */
2847
+ max: number;
2848
+ /** When the oldest held message expires and is dropped. */
2849
+ nextExpiresAt: string | null;
2764
2850
  }
2765
2851
  export interface SubAccountApiKey {
2766
2852
  id: string;
@@ -2807,7 +2893,11 @@ export interface TenDlcBrand {
2807
2893
  displayName: string;
2808
2894
  /** Legal company name. */
2809
2895
  companyName?: string | null;
2810
- /** Employer Identification Number (EIN). */
2896
+ /**
2897
+ * Tax id of the business: the Employer Identification Number (EIN) for a US brand,
2898
+ * or the tax id from its own country's business register for a brand outside the
2899
+ * US.
2900
+ */
2811
2901
  ein?: string | null;
2812
2902
  firstName?: string | null;
2813
2903
  lastName?: string | null;
@@ -2850,9 +2940,14 @@ export interface TenDlcBrandCreateRequest {
2850
2940
  /** Legal company name. */
2851
2941
  companyName?: string;
2852
2942
  /**
2853
- * Employer Identification Number (format: XX-XXXXXXX). Required to submit every
2854
- * entity type except `SOLE_PROPRIETOR`: a brand without it can be created as a
2855
- * draft, and `POST /v1/10dlc/brands/{brandId}/submit` refuses it with `400`.
2943
+ * Tax id of the business. For a US brand (`country` `US`), the 9-digit Employer
2944
+ * Identification Number, as `XX-XXXXXXX` or `XXXXXXXXX`. For a brand outside the
2945
+ * US, the tax id exactly as it appears in its country's business register (for
2946
+ * example a Swiss UID, `CHE-123.456.789`): 4 to 30 characters, starting with a
2947
+ * letter or digit, made of letters, digits, spaces, `.`, `-` and `/`. Any other
2948
+ * value is refused with `400`. Required to submit every entity type except
2949
+ * `SOLE_PROPRIETOR`: a brand without it can be created as a draft, and `POST
2950
+ * /v1/10dlc/brands/{brandId}/submit` refuses it with `400`.
2856
2951
  */
2857
2952
  ein?: string;
2858
2953
  firstName?: string;
@@ -2879,6 +2974,11 @@ export interface TenDlcBrandUpdateRequest {
2879
2974
  entityType?: TenDlcEntityType;
2880
2975
  displayName?: string;
2881
2976
  companyName?: string;
2977
+ /**
2978
+ * Tax id of the business, checked against `country` (the one sent in this request,
2979
+ * or the brand's current one): the 9-digit EIN for a US brand, or the tax id from
2980
+ * its country's business register otherwise.
2981
+ */
2882
2982
  ein?: string;
2883
2983
  firstName?: string;
2884
2984
  lastName?: string;
@@ -3891,6 +3991,7 @@ export interface EscalateUrlResponse {
3891
3991
  url: VerifiedUrl;
3892
3992
  message: string;
3893
3993
  }
3994
+ export type SendMessageError409 = MessageResponse | ErrorBody;
3894
3995
  export interface SendMessageError429 {
3895
3996
  code?: string;
3896
3997
  message?: string;