@zernio/node 0.2.1502 → 0.2.1504
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/README.md +5 -1
- package/dist/index.d.mts +317 -10
- package/dist/index.d.ts +317 -10
- package/dist/index.js +29 -1
- package/dist/index.mjs +29 -1
- package/package.json +1 -1
- package/src/client.ts +8 -0
- package/src/generated/sdk.gen.ts +96 -8
- package/src/generated/types.gen.ts +325 -9
|
@@ -3420,6 +3420,50 @@ export type scope = 'full' | 'profiles';
|
|
|
3420
3420
|
*/
|
|
3421
3421
|
export type permission = 'read-write' | 'read';
|
|
3422
3422
|
|
|
3423
|
+
export type AutoRecharge = {
|
|
3424
|
+
/**
|
|
3425
|
+
* Whether auto-recharge is on. Charges happen only when this is true and disabledReason is null.
|
|
3426
|
+
*/
|
|
3427
|
+
enabled: boolean;
|
|
3428
|
+
/**
|
|
3429
|
+
* Recharge when the balance drops below this, in cents.
|
|
3430
|
+
*/
|
|
3431
|
+
belowCents: number;
|
|
3432
|
+
/**
|
|
3433
|
+
* Recharge back up to this, in cents. The charge is toCents minus the balance, plus tax.
|
|
3434
|
+
*/
|
|
3435
|
+
toCents: number;
|
|
3436
|
+
/**
|
|
3437
|
+
* Most auto-recharge may add per calendar month (UTC), before tax; null for no limit.
|
|
3438
|
+
*/
|
|
3439
|
+
monthlyLimitCents: (number) | null;
|
|
3440
|
+
/**
|
|
3441
|
+
* Low-balance email threshold, sent once per drop below it; null for none.
|
|
3442
|
+
*/
|
|
3443
|
+
alertBelowCents: (number) | null;
|
|
3444
|
+
/**
|
|
3445
|
+
* `payment_failed` after four failed charges in a row. Updating the card clears it.
|
|
3446
|
+
*/
|
|
3447
|
+
disabledReason: ('payment_failed') | null;
|
|
3448
|
+
/**
|
|
3449
|
+
* Failed charges in a row; 0 once one goes through.
|
|
3450
|
+
*/
|
|
3451
|
+
retryCount: number;
|
|
3452
|
+
/**
|
|
3453
|
+
* When a declined recharge is tried again; null when none is waiting.
|
|
3454
|
+
*/
|
|
3455
|
+
nextRetryAt: (string) | null;
|
|
3456
|
+
/**
|
|
3457
|
+
* Auto-recharge top-ups this calendar month (UTC), paid or being paid, before tax.
|
|
3458
|
+
*/
|
|
3459
|
+
monthRechargedCents: number;
|
|
3460
|
+
};
|
|
3461
|
+
|
|
3462
|
+
/**
|
|
3463
|
+
* `payment_failed` after four failed charges in a row. Updating the card clears it.
|
|
3464
|
+
*/
|
|
3465
|
+
export type disabledReason = 'payment_failed';
|
|
3466
|
+
|
|
3423
3467
|
/**
|
|
3424
3468
|
* Meta bid strategy. Same enum applies at campaign and ad-set level; ad-set value (when set)
|
|
3425
3469
|
* overrides campaign-level. Cross-field rules:
|
|
@@ -16316,7 +16360,7 @@ export type TreasuryTopup = {
|
|
|
16316
16360
|
*/
|
|
16317
16361
|
feeCoveredByZernio?: boolean;
|
|
16318
16362
|
/**
|
|
16319
|
-
* The amount you asked for. A top-up
|
|
16363
|
+
* The amount you asked for. A top-up credits exactly this and charges it plus tax (taxCents). Top-ups from 2026-11-02 to 2026-11-05 charged a card fee on top and credited what Stripe delivered; older ones charged this amount and credited it minus the fee.
|
|
16320
16364
|
*/
|
|
16321
16365
|
amountCents?: number;
|
|
16322
16366
|
/**
|
|
@@ -16324,7 +16368,11 @@ export type TreasuryTopup = {
|
|
|
16324
16368
|
*/
|
|
16325
16369
|
feeCents?: (number) | null;
|
|
16326
16370
|
/**
|
|
16327
|
-
*
|
|
16371
|
+
* Tax charged on top of amountCents once paid (VAT where it applies, since 2026-11-05); 0 before payment, when reverse charged, outside the EU, and on older top-ups.
|
|
16372
|
+
*/
|
|
16373
|
+
taxCents?: number;
|
|
16374
|
+
/**
|
|
16375
|
+
* What your card was charged: amountCents plus taxCents, or amountCents plus the card fee on a top-up from 2026-11-02 to 2026-11-05.
|
|
16328
16376
|
*/
|
|
16329
16377
|
chargedCents?: number;
|
|
16330
16378
|
/**
|
|
@@ -16342,7 +16390,7 @@ export type TreasuryTopup = {
|
|
|
16342
16390
|
createdAt?: string;
|
|
16343
16391
|
succeededAt?: (string) | null;
|
|
16344
16392
|
/**
|
|
16345
|
-
*
|
|
16393
|
+
* The paid payment has an invoice (getTopupInvoice): every balance top-up paid since 2026-11-05 (unless charged without one for a Stripe credit balance), and Checkout payments before 2026-10-29. Every paid payment has a card receipt (getTopupReceipt).
|
|
16346
16394
|
*/
|
|
16347
16395
|
hasInvoice?: boolean;
|
|
16348
16396
|
};
|
|
@@ -24725,10 +24773,57 @@ export type GetBalanceError = ({
|
|
|
24725
24773
|
required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks' | 'commerce' | 'creator_campaigns' | 'money' | 'calendar' | 'files';
|
|
24726
24774
|
});
|
|
24727
24775
|
|
|
24776
|
+
export type GetAutoRechargeResponse = (AutoRecharge);
|
|
24777
|
+
|
|
24778
|
+
export type GetAutoRechargeError = ({
|
|
24779
|
+
error?: string;
|
|
24780
|
+
code?: 'insufficient_permissions' | 'unclassified_resource';
|
|
24781
|
+
/**
|
|
24782
|
+
* The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
|
|
24783
|
+
*/
|
|
24784
|
+
required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks' | 'commerce' | 'creator_campaigns' | 'money' | 'calendar' | 'files';
|
|
24785
|
+
} | unknown);
|
|
24786
|
+
|
|
24787
|
+
export type UpdateAutoRechargeData = {
|
|
24788
|
+
body: {
|
|
24789
|
+
/**
|
|
24790
|
+
* Turns auto-recharge on or off. A rule switched off by failed charges stays off until the card is updated.
|
|
24791
|
+
*/
|
|
24792
|
+
enabled?: boolean;
|
|
24793
|
+
/**
|
|
24794
|
+
* Recharge when the balance drops below this, in cents. At least $5.
|
|
24795
|
+
*/
|
|
24796
|
+
belowCents?: number;
|
|
24797
|
+
/**
|
|
24798
|
+
* Recharge back up to this, in cents. More than $5 above belowCents.
|
|
24799
|
+
*/
|
|
24800
|
+
toCents?: number;
|
|
24801
|
+
/**
|
|
24802
|
+
* Most auto-recharge may add per calendar month (UTC), before tax. Null for no limit.
|
|
24803
|
+
*/
|
|
24804
|
+
monthlyLimitCents?: (number) | null;
|
|
24805
|
+
/**
|
|
24806
|
+
* Email the billing owner once each time the balance drops below this. Null for no email.
|
|
24807
|
+
*/
|
|
24808
|
+
alertBelowCents?: (number) | null;
|
|
24809
|
+
};
|
|
24810
|
+
};
|
|
24811
|
+
|
|
24812
|
+
export type UpdateAutoRechargeResponse = (AutoRecharge);
|
|
24813
|
+
|
|
24814
|
+
export type UpdateAutoRechargeError = (ErrorResponse | {
|
|
24815
|
+
error?: string;
|
|
24816
|
+
code?: 'insufficient_permissions' | 'unclassified_resource';
|
|
24817
|
+
/**
|
|
24818
|
+
* The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
|
|
24819
|
+
*/
|
|
24820
|
+
required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks' | 'commerce' | 'creator_campaigns' | 'money' | 'calendar' | 'files';
|
|
24821
|
+
} | unknown);
|
|
24822
|
+
|
|
24728
24823
|
export type CreateTopupData = {
|
|
24729
24824
|
body: {
|
|
24730
24825
|
/**
|
|
24731
|
-
* Amount to
|
|
24826
|
+
* Amount to credit to your balance, in cents: $5 to $100,000. Tax is charged on top; no card fee.
|
|
24732
24827
|
*/
|
|
24733
24828
|
amountCents: number;
|
|
24734
24829
|
/**
|
|
@@ -24758,15 +24853,31 @@ export type CreateTopupData = {
|
|
|
24758
24853
|
export type CreateTopupResponse = ({
|
|
24759
24854
|
topupId: string;
|
|
24760
24855
|
/**
|
|
24761
|
-
*
|
|
24856
|
+
* Credited to your balance once paid.
|
|
24762
24857
|
*/
|
|
24763
24858
|
amountCents: number;
|
|
24859
|
+
/**
|
|
24860
|
+
* Tax added on top of amountCents (VAT where it applies). 0 when reverse charged or outside the EU.
|
|
24861
|
+
*/
|
|
24862
|
+
taxCents: number;
|
|
24863
|
+
/**
|
|
24864
|
+
* What the card is charged: amountCents + taxCents.
|
|
24865
|
+
*/
|
|
24866
|
+
totalCents: number;
|
|
24867
|
+
/**
|
|
24868
|
+
* The tax and its rate, for example "VAT 21%". Null when no tax is charged.
|
|
24869
|
+
*/
|
|
24870
|
+
taxLabel: (string) | null;
|
|
24871
|
+
/**
|
|
24872
|
+
* True for an EU business with a valid VAT id: no VAT is charged and the invoice says reverse charge.
|
|
24873
|
+
*/
|
|
24874
|
+
reverseCharge: boolean;
|
|
24764
24875
|
/**
|
|
24765
24876
|
* Always 0: there is no card fee. Kept for older clients.
|
|
24766
24877
|
*/
|
|
24767
24878
|
feeCents: number;
|
|
24768
24879
|
/**
|
|
24769
|
-
*
|
|
24880
|
+
* Same as totalCents. Kept for older clients.
|
|
24770
24881
|
*/
|
|
24771
24882
|
chargedCents: number;
|
|
24772
24883
|
/**
|
|
@@ -24859,6 +24970,102 @@ export type ListTopupsError = (ErrorResponse | {
|
|
|
24859
24970
|
required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks' | 'commerce' | 'creator_campaigns' | 'money' | 'calendar' | 'files';
|
|
24860
24971
|
});
|
|
24861
24972
|
|
|
24973
|
+
export type PreviewTopupData = {
|
|
24974
|
+
body: {
|
|
24975
|
+
/**
|
|
24976
|
+
* Amount to credit to your balance, in cents.
|
|
24977
|
+
*/
|
|
24978
|
+
amountCents: number;
|
|
24979
|
+
};
|
|
24980
|
+
};
|
|
24981
|
+
|
|
24982
|
+
export type PreviewTopupResponse = ({
|
|
24983
|
+
/**
|
|
24984
|
+
* Credited to your balance.
|
|
24985
|
+
*/
|
|
24986
|
+
amountCents: number;
|
|
24987
|
+
/**
|
|
24988
|
+
* Tax added on top (VAT where it applies).
|
|
24989
|
+
*/
|
|
24990
|
+
taxCents: number;
|
|
24991
|
+
/**
|
|
24992
|
+
* What the card would be charged: amountCents + taxCents.
|
|
24993
|
+
*/
|
|
24994
|
+
totalCents: number;
|
|
24995
|
+
/**
|
|
24996
|
+
* The tax and its rate, for example "VAT 21%". Null when no tax is charged.
|
|
24997
|
+
*/
|
|
24998
|
+
taxLabel: (string) | null;
|
|
24999
|
+
/**
|
|
25000
|
+
* True for an EU business with a valid VAT id: no VAT, reverse charge.
|
|
25001
|
+
*/
|
|
25002
|
+
reverseCharge: boolean;
|
|
25003
|
+
});
|
|
25004
|
+
|
|
25005
|
+
export type PreviewTopupError = (ErrorResponse | {
|
|
25006
|
+
/**
|
|
25007
|
+
* Human-readable error message suitable for end-user display.
|
|
25008
|
+
*/
|
|
25009
|
+
error: string;
|
|
25010
|
+
/**
|
|
25011
|
+
* Machine-readable error code. Stable across versions.
|
|
25012
|
+
*/
|
|
25013
|
+
code: 'PAYMENT_REQUIRED';
|
|
25014
|
+
/**
|
|
25015
|
+
* Discriminator for which gate fired.
|
|
25016
|
+
*/
|
|
25017
|
+
reason: 'free_tier_exceeded' | 'twitter_passthrough' | 'enterprise_required' | 'card_verification_required';
|
|
25018
|
+
/**
|
|
25019
|
+
* Link to the relevant documentation page.
|
|
25020
|
+
*/
|
|
25021
|
+
documentation_url?: string;
|
|
25022
|
+
/**
|
|
25023
|
+
* Deep-link to send the end-user to. For
|
|
25024
|
+
* `free_tier_exceeded` and `twitter_passthrough` this opens
|
|
25025
|
+
* the add-payment-method drawer on the Zernio billing page.
|
|
25026
|
+
* For `enterprise_required` this is the Zernio enterprise
|
|
25027
|
+
* contact page.
|
|
25028
|
+
*
|
|
25029
|
+
*/
|
|
25030
|
+
dashboard_url?: string;
|
|
25031
|
+
/**
|
|
25032
|
+
* Structured context for SDK clients that want to render their own UX. Keys vary by `reason`.
|
|
25033
|
+
*/
|
|
25034
|
+
details?: {
|
|
25035
|
+
/**
|
|
25036
|
+
* How many accounts the free tier allows. Only set when reason=free_tier_exceeded.
|
|
25037
|
+
*/
|
|
25038
|
+
free_tier_account_limit?: number;
|
|
25039
|
+
/**
|
|
25040
|
+
* How many accounts the team currently has connected. Set when reason=free_tier_exceeded or reason=enterprise_required.
|
|
25041
|
+
*/
|
|
25042
|
+
current_account_count?: number;
|
|
25043
|
+
/**
|
|
25044
|
+
* Whether the team currently has a card on file in Stripe. Set when reason=free_tier_exceeded or reason=twitter_passthrough.
|
|
25045
|
+
*/
|
|
25046
|
+
has_payment_method?: boolean;
|
|
25047
|
+
/**
|
|
25048
|
+
* One-time card verification charge in USD cents, credited to usage. Only set when reason=card_verification_required.
|
|
25049
|
+
*/
|
|
25050
|
+
verification_amount_cents?: number;
|
|
25051
|
+
/**
|
|
25052
|
+
* The negotiated connected-account cap from the
|
|
25053
|
+
* team's enterprise contract. Self-service teams
|
|
25054
|
+
* have no cap and never receive this reason. Only
|
|
25055
|
+
* set when reason=enterprise_required.
|
|
25056
|
+
*
|
|
25057
|
+
*/
|
|
25058
|
+
effective_account_limit?: number;
|
|
25059
|
+
};
|
|
25060
|
+
} | {
|
|
25061
|
+
error?: string;
|
|
25062
|
+
code?: 'insufficient_permissions' | 'unclassified_resource';
|
|
25063
|
+
/**
|
|
25064
|
+
* The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
|
|
25065
|
+
*/
|
|
25066
|
+
required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks' | 'commerce' | 'creator_campaigns' | 'money' | 'calendar' | 'files';
|
|
25067
|
+
});
|
|
25068
|
+
|
|
24862
25069
|
export type GetTopupReceiptData = {
|
|
24863
25070
|
path: {
|
|
24864
25071
|
topupId: string;
|
|
@@ -24885,7 +25092,11 @@ export type GetTopupReceiptResponse = ({
|
|
|
24885
25092
|
*/
|
|
24886
25093
|
feeCents: (number) | null;
|
|
24887
25094
|
/**
|
|
24888
|
-
*
|
|
25095
|
+
* Tax charged on top of amountCents, as in the top-up list.
|
|
25096
|
+
*/
|
|
25097
|
+
taxCents?: number;
|
|
25098
|
+
/**
|
|
25099
|
+
* What the card was charged, tax included: the total on the receipt.
|
|
24889
25100
|
*/
|
|
24890
25101
|
chargedCents: number;
|
|
24891
25102
|
});
|
|
@@ -24956,6 +25167,103 @@ export type GetTopupReceiptError = (ErrorResponse | {
|
|
|
24956
25167
|
error?: string;
|
|
24957
25168
|
});
|
|
24958
25169
|
|
|
25170
|
+
export type GetTopupInvoiceData = {
|
|
25171
|
+
path: {
|
|
25172
|
+
topupId: string;
|
|
25173
|
+
};
|
|
25174
|
+
};
|
|
25175
|
+
|
|
25176
|
+
export type GetTopupInvoiceResponse = ({
|
|
25177
|
+
url: string;
|
|
25178
|
+
format: 'pdf' | 'page';
|
|
25179
|
+
/**
|
|
25180
|
+
* The invoice PDF.
|
|
25181
|
+
*/
|
|
25182
|
+
pdfUrl: (string) | null;
|
|
25183
|
+
/**
|
|
25184
|
+
* The invoice's Stripe-hosted page.
|
|
25185
|
+
*/
|
|
25186
|
+
pageUrl: (string) | null;
|
|
25187
|
+
/**
|
|
25188
|
+
* Amount added to your balance, as in the top-up list.
|
|
25189
|
+
*/
|
|
25190
|
+
amountCents: number;
|
|
25191
|
+
/**
|
|
25192
|
+
* Tax charged on top of amountCents.
|
|
25193
|
+
*/
|
|
25194
|
+
taxCents: number;
|
|
25195
|
+
/**
|
|
25196
|
+
* What the card was charged, tax included.
|
|
25197
|
+
*/
|
|
25198
|
+
chargedCents: number;
|
|
25199
|
+
});
|
|
25200
|
+
|
|
25201
|
+
export type GetTopupInvoiceError = (ErrorResponse | {
|
|
25202
|
+
/**
|
|
25203
|
+
* Human-readable error message suitable for end-user display.
|
|
25204
|
+
*/
|
|
25205
|
+
error: string;
|
|
25206
|
+
/**
|
|
25207
|
+
* Machine-readable error code. Stable across versions.
|
|
25208
|
+
*/
|
|
25209
|
+
code: 'PAYMENT_REQUIRED';
|
|
25210
|
+
/**
|
|
25211
|
+
* Discriminator for which gate fired.
|
|
25212
|
+
*/
|
|
25213
|
+
reason: 'free_tier_exceeded' | 'twitter_passthrough' | 'enterprise_required' | 'card_verification_required';
|
|
25214
|
+
/**
|
|
25215
|
+
* Link to the relevant documentation page.
|
|
25216
|
+
*/
|
|
25217
|
+
documentation_url?: string;
|
|
25218
|
+
/**
|
|
25219
|
+
* Deep-link to send the end-user to. For
|
|
25220
|
+
* `free_tier_exceeded` and `twitter_passthrough` this opens
|
|
25221
|
+
* the add-payment-method drawer on the Zernio billing page.
|
|
25222
|
+
* For `enterprise_required` this is the Zernio enterprise
|
|
25223
|
+
* contact page.
|
|
25224
|
+
*
|
|
25225
|
+
*/
|
|
25226
|
+
dashboard_url?: string;
|
|
25227
|
+
/**
|
|
25228
|
+
* Structured context for SDK clients that want to render their own UX. Keys vary by `reason`.
|
|
25229
|
+
*/
|
|
25230
|
+
details?: {
|
|
25231
|
+
/**
|
|
25232
|
+
* How many accounts the free tier allows. Only set when reason=free_tier_exceeded.
|
|
25233
|
+
*/
|
|
25234
|
+
free_tier_account_limit?: number;
|
|
25235
|
+
/**
|
|
25236
|
+
* How many accounts the team currently has connected. Set when reason=free_tier_exceeded or reason=enterprise_required.
|
|
25237
|
+
*/
|
|
25238
|
+
current_account_count?: number;
|
|
25239
|
+
/**
|
|
25240
|
+
* Whether the team currently has a card on file in Stripe. Set when reason=free_tier_exceeded or reason=twitter_passthrough.
|
|
25241
|
+
*/
|
|
25242
|
+
has_payment_method?: boolean;
|
|
25243
|
+
/**
|
|
25244
|
+
* One-time card verification charge in USD cents, credited to usage. Only set when reason=card_verification_required.
|
|
25245
|
+
*/
|
|
25246
|
+
verification_amount_cents?: number;
|
|
25247
|
+
/**
|
|
25248
|
+
* The negotiated connected-account cap from the
|
|
25249
|
+
* team's enterprise contract. Self-service teams
|
|
25250
|
+
* have no cap and never receive this reason. Only
|
|
25251
|
+
* set when reason=enterprise_required.
|
|
25252
|
+
*
|
|
25253
|
+
*/
|
|
25254
|
+
effective_account_limit?: number;
|
|
25255
|
+
};
|
|
25256
|
+
} | {
|
|
25257
|
+
error?: string;
|
|
25258
|
+
code?: 'insufficient_permissions' | 'unclassified_resource';
|
|
25259
|
+
/**
|
|
25260
|
+
* The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
|
|
25261
|
+
*/
|
|
25262
|
+
required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks' | 'commerce' | 'creator_campaigns' | 'money' | 'calendar' | 'files';
|
|
25263
|
+
} | {
|
|
25264
|
+
error?: string;
|
|
25265
|
+
});
|
|
25266
|
+
|
|
24959
25267
|
export type GetTopupStatementData = {
|
|
24960
25268
|
path: {
|
|
24961
25269
|
topupId: string;
|
|
@@ -24966,17 +25274,25 @@ export type GetTopupStatementResponse = ({
|
|
|
24966
25274
|
url: string;
|
|
24967
25275
|
format: 'pdf' | 'page';
|
|
24968
25276
|
/**
|
|
24969
|
-
* The
|
|
25277
|
+
* The invoice PDF.
|
|
24970
25278
|
*/
|
|
24971
25279
|
pdfUrl: (string) | null;
|
|
24972
25280
|
/**
|
|
24973
|
-
* The
|
|
25281
|
+
* The invoice's Stripe-hosted page.
|
|
24974
25282
|
*/
|
|
24975
25283
|
pageUrl: (string) | null;
|
|
24976
25284
|
/**
|
|
24977
25285
|
* Amount added to your balance, as in the top-up list.
|
|
24978
25286
|
*/
|
|
24979
25287
|
amountCents: number;
|
|
25288
|
+
/**
|
|
25289
|
+
* Tax charged on top of amountCents.
|
|
25290
|
+
*/
|
|
25291
|
+
taxCents: number;
|
|
25292
|
+
/**
|
|
25293
|
+
* What the card was charged, tax included.
|
|
25294
|
+
*/
|
|
25295
|
+
chargedCents: number;
|
|
24980
25296
|
});
|
|
24981
25297
|
|
|
24982
25298
|
export type GetTopupStatementError = (ErrorResponse | {
|