chargebee 3.23.1 → 3.25.0-beta.1
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/CHANGELOG.md +97 -0
- package/README.md +39 -0
- package/cjs/RequestWrapper.js +27 -0
- package/cjs/chargebee.cjs.js +3 -0
- package/cjs/chargebee.cjs.worker.js +2 -0
- package/cjs/chargebeeZodValidationError.js +18 -0
- package/cjs/createChargebee.js +5 -0
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +80 -2
- package/cjs/schema/addon.schema.js +153 -0
- package/cjs/schema/address.schema.js +35 -0
- package/cjs/schema/alert.schema.js +38 -0
- package/cjs/schema/attached_item.schema.js +58 -0
- package/cjs/schema/business_entity.schema.js +46 -0
- package/cjs/schema/card.schema.js +165 -0
- package/cjs/schema/comment.schema.js +69 -0
- package/cjs/schema/coupon.schema.js +209 -0
- package/cjs/schema/coupon_code.schema.js +14 -0
- package/cjs/schema/coupon_set.schema.js +28 -0
- package/cjs/schema/credit_note.schema.js +288 -0
- package/cjs/schema/currency.schema.js +32 -0
- package/cjs/schema/customer.schema.js +986 -0
- package/cjs/schema/customer_entitlement.schema.js +14 -0
- package/cjs/schema/differential_price.schema.js +68 -0
- package/cjs/schema/entitlement.schema.js +27 -0
- package/cjs/schema/entitlement_override.schema.js +33 -0
- package/cjs/schema/estimate.schema.js +1525 -0
- package/cjs/schema/export.schema.js +1545 -0
- package/cjs/schema/feature.schema.js +37 -0
- package/cjs/schema/gift.schema.js +277 -0
- package/cjs/schema/hosted_page.schema.js +1649 -0
- package/cjs/schema/in_app_subscription.schema.js +68 -0
- package/cjs/schema/index.js +80 -0
- package/cjs/schema/invoice.schema.js +1467 -0
- package/cjs/schema/item.schema.js +91 -0
- package/cjs/schema/item_entitlement.schema.js +45 -0
- package/cjs/schema/item_family.schema.js +21 -0
- package/cjs/schema/item_price.schema.js +190 -0
- package/cjs/schema/non_subscription.schema.js +28 -0
- package/cjs/schema/offer_event.schema.js +13 -0
- package/cjs/schema/offer_fulfillment.schema.js +20 -0
- package/cjs/schema/omnichannel_one_time_order.schema.js +26 -0
- package/cjs/schema/omnichannel_subscription.schema.js +89 -0
- package/cjs/schema/omnichannel_subscription_item.schema.js +13 -0
- package/cjs/schema/order.schema.js +273 -0
- package/cjs/schema/payment_intent.schema.js +117 -0
- package/cjs/schema/payment_schedule_scheme.schema.js +20 -0
- package/cjs/schema/payment_source.schema.js +358 -0
- package/cjs/schema/payment_voucher.schema.js +57 -0
- package/cjs/schema/personalized_offer.schema.js +28 -0
- package/cjs/schema/plan.schema.js +225 -0
- package/cjs/schema/portal_session.schema.js +22 -0
- package/cjs/schema/price_variant.schema.js +36 -0
- package/cjs/schema/pricing_page_session.schema.js +135 -0
- package/cjs/schema/promotional_credit.schema.js +78 -0
- package/cjs/schema/purchase.schema.js +272 -0
- package/cjs/schema/quote.schema.js +1557 -0
- package/cjs/schema/ramp.schema.js +209 -0
- package/cjs/schema/recorded_purchase.schema.js +32 -0
- package/cjs/schema/resource_migration.schema.js +14 -0
- package/cjs/schema/site_migration_detail.schema.js +81 -0
- package/cjs/schema/subscription.schema.js +2993 -0
- package/cjs/schema/subscription_entitlement.schema.js +25 -0
- package/cjs/schema/time_machine.schema.js +17 -0
- package/cjs/schema/transaction.schema.js +70 -0
- package/cjs/schema/unbilled_charge.schema.js +113 -0
- package/cjs/schema/usage.schema.js +93 -0
- package/cjs/schema/usage_charge.schema.js +17 -0
- package/cjs/schema/usage_event.schema.js +28 -0
- package/cjs/schema/usage_file.schema.js +13 -0
- package/cjs/schema/usage_summary.schema.js +17 -0
- package/cjs/schema/virtual_bank_account.schema.js +43 -0
- package/cjs/schema/webhook_endpoint.schema.js +504 -0
- package/cjs/validationLoader.js +59 -0
- package/esm/RequestWrapper.js +27 -0
- package/esm/chargebee.esm.js +2 -0
- package/esm/chargebee.esm.worker.js +1 -0
- package/esm/chargebeeZodValidationError.js +14 -0
- package/esm/createChargebee.js +5 -0
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +80 -2
- package/esm/schema/addon.schema.js +150 -0
- package/esm/schema/address.schema.js +32 -0
- package/esm/schema/alert.schema.js +35 -0
- package/esm/schema/attached_item.schema.js +55 -0
- package/esm/schema/business_entity.schema.js +43 -0
- package/esm/schema/card.schema.js +162 -0
- package/esm/schema/comment.schema.js +66 -0
- package/esm/schema/coupon.schema.js +206 -0
- package/esm/schema/coupon_code.schema.js +11 -0
- package/esm/schema/coupon_set.schema.js +25 -0
- package/esm/schema/credit_note.schema.js +285 -0
- package/esm/schema/currency.schema.js +29 -0
- package/esm/schema/customer.schema.js +983 -0
- package/esm/schema/customer_entitlement.schema.js +11 -0
- package/esm/schema/differential_price.schema.js +65 -0
- package/esm/schema/entitlement.schema.js +24 -0
- package/esm/schema/entitlement_override.schema.js +30 -0
- package/esm/schema/estimate.schema.js +1522 -0
- package/esm/schema/export.schema.js +1542 -0
- package/esm/schema/feature.schema.js +34 -0
- package/esm/schema/gift.schema.js +274 -0
- package/esm/schema/hosted_page.schema.js +1646 -0
- package/esm/schema/in_app_subscription.schema.js +65 -0
- package/esm/schema/index.js +64 -0
- package/esm/schema/invoice.schema.js +1464 -0
- package/esm/schema/item.schema.js +88 -0
- package/esm/schema/item_entitlement.schema.js +42 -0
- package/esm/schema/item_family.schema.js +18 -0
- package/esm/schema/item_price.schema.js +187 -0
- package/esm/schema/non_subscription.schema.js +25 -0
- package/esm/schema/offer_event.schema.js +10 -0
- package/esm/schema/offer_fulfillment.schema.js +17 -0
- package/esm/schema/omnichannel_one_time_order.schema.js +23 -0
- package/esm/schema/omnichannel_subscription.schema.js +86 -0
- package/esm/schema/omnichannel_subscription_item.schema.js +10 -0
- package/esm/schema/order.schema.js +270 -0
- package/esm/schema/payment_intent.schema.js +114 -0
- package/esm/schema/payment_schedule_scheme.schema.js +17 -0
- package/esm/schema/payment_source.schema.js +355 -0
- package/esm/schema/payment_voucher.schema.js +54 -0
- package/esm/schema/personalized_offer.schema.js +25 -0
- package/esm/schema/plan.schema.js +222 -0
- package/esm/schema/portal_session.schema.js +19 -0
- package/esm/schema/price_variant.schema.js +33 -0
- package/esm/schema/pricing_page_session.schema.js +132 -0
- package/esm/schema/promotional_credit.schema.js +75 -0
- package/esm/schema/purchase.schema.js +269 -0
- package/esm/schema/quote.schema.js +1554 -0
- package/esm/schema/ramp.schema.js +206 -0
- package/esm/schema/recorded_purchase.schema.js +29 -0
- package/esm/schema/resource_migration.schema.js +11 -0
- package/esm/schema/site_migration_detail.schema.js +78 -0
- package/esm/schema/subscription.schema.js +2990 -0
- package/esm/schema/subscription_entitlement.schema.js +22 -0
- package/esm/schema/time_machine.schema.js +14 -0
- package/esm/schema/transaction.schema.js +67 -0
- package/esm/schema/unbilled_charge.schema.js +110 -0
- package/esm/schema/usage.schema.js +90 -0
- package/esm/schema/usage_charge.schema.js +14 -0
- package/esm/schema/usage_event.schema.js +25 -0
- package/esm/schema/usage_file.schema.js +10 -0
- package/esm/schema/usage_summary.schema.js +14 -0
- package/esm/schema/virtual_bank_account.schema.js +40 -0
- package/esm/schema/webhook_endpoint.schema.js +501 -0
- package/esm/validationLoader.js +56 -0
- package/package.json +5 -2
- package/types/core.d.ts +34 -8
- package/types/index.d.ts +20 -0
- package/types/resources/Alert.d.ts +110 -4
- package/types/resources/AlertStatus.d.ts +43 -2
- package/types/resources/Card.d.ts +1 -0
- package/types/resources/Content.d.ts +2 -0
- package/types/resources/Customer.d.ts +16 -2
- package/types/resources/Estimate.d.ts +16 -2
- package/types/resources/Event.d.ts +4 -2
- package/types/resources/FilterCondition.d.ts +10 -0
- package/types/resources/Gift.d.ts +16 -2
- package/types/resources/Invoice.d.ts +17 -2
- package/types/resources/PaymentIntent.d.ts +42 -6
- package/types/resources/PaymentSource.d.ts +11 -2
- package/types/resources/Purchase.d.ts +8 -1
- package/types/resources/Quote.d.ts +2 -0
- package/types/resources/QuoteEntitlement.d.ts +16 -0
- package/types/resources/Subscription.d.ts +56 -7
- package/types/resources/VirtualBankAccount.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,100 @@
|
|
|
1
|
+
### v3.25.0-beta.1 (2026-05-14)
|
|
2
|
+
* * *
|
|
3
|
+
|
|
4
|
+
### Experimental
|
|
5
|
+
- **Zod-backed request validation (beta)** — Enable `enableValidation` on the client to validate outgoing request payloads against generated Zod schemas before each API call; invalid payloads raise `ChargebeeZodValidationError` with the original `ZodError` for inspection.
|
|
6
|
+
- **Runtime dependency** — Added [`zod`](https://www.npmjs.com/package/zod) (v4) as a dependency to support the above.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### v3.24.0 (2026-05-04)
|
|
10
|
+
* * *
|
|
11
|
+
### New Resources:
|
|
12
|
+
- [`QuoteEntitlement`](https://apidocs.chargebee.com/docs/api/quote_entitlements) has been added.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### New Actions:
|
|
16
|
+
- [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
17
|
+
- [`retrieve_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/retrieve-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
18
|
+
- [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
19
|
+
- [`delete_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/delete-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
20
|
+
- [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
21
|
+
- [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
22
|
+
- [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) has been added to [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses).
|
|
23
|
+
- [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) has been added to [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses).
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### New Attributes:
|
|
27
|
+
- [`alarm_status`](https://apidocs.chargebee.com/docs/api/alert_statuses/alert-status-object#alarm_status) has been added to [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses).
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### New Parameters:
|
|
31
|
+
- [`limit`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#limit) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
32
|
+
- [`offset`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#offset) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
33
|
+
- [`status`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#status) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
34
|
+
- [`type`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#type) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
35
|
+
- [`limit`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#limit) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
36
|
+
- [`offset`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#offset) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
37
|
+
- [`id`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#id) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
38
|
+
- [`type`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#type) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
39
|
+
- [`subscription_id`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#subscription_id) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
40
|
+
- [`status`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#status) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
41
|
+
- [`limit`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#limit) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses).
|
|
42
|
+
- [`offset`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#offset) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses).
|
|
43
|
+
- [`alarm_status`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#alarm_status) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses).
|
|
44
|
+
- [`alert_id`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#alert_id) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses).
|
|
45
|
+
- [`limit`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert#limit) has been added as query parameter to [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses).
|
|
46
|
+
- [`offset`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert#offset) has been added as query parameter to [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses).
|
|
47
|
+
- [`alarm_status`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert#alarm_status) has been added as query parameter to [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses).
|
|
48
|
+
- [`exclude`](https://apidocs.chargebee.com/docs/api/invoices/list-invoices#exclude) has been added as query parameter to [`list_invoices`](https://apidocs.chargebee.com/docs/api/invoices/list-invoices) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices).
|
|
49
|
+
- [`threshold`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert#threshold) has been added as request body parameter to [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
50
|
+
- [`status`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert#status) has been added as request body parameter to [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
51
|
+
- [`threshold`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#threshold) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
52
|
+
- [`filter_conditions`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#filter_conditions) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
53
|
+
- [`type`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#type) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
54
|
+
- [`name`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#name) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
55
|
+
- [`description`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#description) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
56
|
+
- [`metered_feature_id`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#metered_feature_id) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
57
|
+
- [`subscription_id`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#subscription_id) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
58
|
+
- [`meta`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#meta) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
59
|
+
- [`defer_payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent#defer_payment_method_type) has been added as request body parameter to [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents).
|
|
60
|
+
- [`net_term_days`](https://apidocs.chargebee.com/docs/api/quotes/edit-quote-for-charge-items-and-charges#net_term_days) has been added as request body parameter to [`edit_quote_for_charge_items_and_charges`](https://apidocs.chargebee.com/docs/api/quotes/edit-quote-for-charge-items-and-charges) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes).
|
|
61
|
+
- [`net_term_days`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-charge-and-charge-items#net_term_days) has been added as request body parameter to [`create_a_quote_for_charge_and_charge_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-charge-and-charge-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes).
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Deleted Attributes:
|
|
65
|
+
- `alarm_triggered_at` has been removed from [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
66
|
+
- `scope` has been removed from [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
67
|
+
- `alert_status` has been removed from [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses).
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### New Enums:
|
|
71
|
+
- `within_limit` and `in_alarm` have been added as new values enum `AlarmStatus`.
|
|
72
|
+
- `moyasar` and `payway` have been added as new values enum `Gateway`.
|
|
73
|
+
- `absolute` and `percentage` have been added as new values enum `Mode`.
|
|
74
|
+
- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values enum `PaymentMethod`.
|
|
75
|
+
- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values enum `PaymentMethodType`.
|
|
76
|
+
- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values enum `Type`.
|
|
77
|
+
- `mada` has been added as a new value to enum attribute [`card_type`](https://apidocs.chargebee.com/docs/api/cards/card-object#card_type) in [`Card`](https://apidocs.chargebee.com/docs/api/cards).
|
|
78
|
+
- `rate_limited` has been added as a new value to enum attribute [`webhook_status`](https://apidocs.chargebee.com/docs/api/events/event-object#webhook_status) in [`Event`](https://apidocs.chargebee.com/docs/api/events).
|
|
79
|
+
- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum attribute [`payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents).
|
|
80
|
+
- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum attribute [`active_payment_attempt.payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#active_payment_attempt_payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents).
|
|
81
|
+
- `mada` has been added as a new value to enum attribute [`card.brand`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#card_brand) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources).
|
|
82
|
+
- `plan_price`, `addon_price`, `charge_price`, and `charge` have been added as new values to enum attribute [`entity_type`](https://apidocs.chargebee.com/docs/api/quote_entitlements/quote-entitlement-object#entity_type) in [`QuoteEntitlement`](https://apidocs.chargebee.com/docs/api/quote_entitlements).
|
|
83
|
+
- `disabled` and `enabled` have been added as new values to enum query parameter `status.is` in [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
84
|
+
- `enabled` and `disabled` have been added as new values to enum request body parameter `status` in [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
85
|
+
- `disabled` and `enabled` have been added as new values to enum query parameter `status.is` in [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
86
|
+
- `plan_price_id` has been added as a new value to enum request body parameter `filter_conditions.field` in [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
87
|
+
- `not_equals` and `equals` have been added as new values to enum request body parameter `filter_conditions.operator` in [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
|
|
88
|
+
- `rate_limited` has been added as a new value to enum query parameter `webhook_status.is` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events).
|
|
89
|
+
- `rate_limited` has been added as a new value to enum query parameter `webhook_status.is_not` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events).
|
|
90
|
+
- `rate_limited` has been added as a new value to enum query parameter `webhook_status.in` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events).
|
|
91
|
+
- `rate_limited` has been added as a new value to enum query parameter `webhook_status.not_in` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events).
|
|
92
|
+
- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum request body parameter `payment_method_type` in [`update_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents).
|
|
93
|
+
- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum request body parameter `payment_method_type` in [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents).
|
|
94
|
+
- `mada` has been added as a new value to enum request body parameter `card.brand` in [`create_using_permanent_token`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-permanent-token) of [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources).
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
1
98
|
### v3.23.1 (2026-04-22)
|
|
2
99
|
* * *
|
|
3
100
|
|
package/README.md
CHANGED
|
@@ -124,6 +124,45 @@ try {
|
|
|
124
124
|
}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
+
### Request parameter validation (Zod)
|
|
128
|
+
|
|
129
|
+
When `enableValidation` is set to `true`, the SDK validates parameters for **every** API request against Zod schemas **before** the HTTP call is made. If you omit the params object on a call, it is validated as `{}`. This is **off by default**. Schemas are included for API actions that support them; actions without a bundled schema behave as usual.
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
import Chargebee, { ChargebeeZodValidationError } from 'chargebee';
|
|
133
|
+
|
|
134
|
+
const chargebee = new Chargebee({
|
|
135
|
+
site: '{{site}}',
|
|
136
|
+
apiKey: '{{api-key}}',
|
|
137
|
+
enableValidation: true,
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
try {
|
|
141
|
+
await chargebee.customer.create({
|
|
142
|
+
id: 'a'.repeat(100),
|
|
143
|
+
auto_collection: 'invalid',
|
|
144
|
+
});
|
|
145
|
+
} catch (err) {
|
|
146
|
+
if (err instanceof ChargebeeZodValidationError) {
|
|
147
|
+
console.error(err.message);
|
|
148
|
+
console.error(err.actionName);
|
|
149
|
+
console.error(err.zodError.issues);
|
|
150
|
+
} else {
|
|
151
|
+
throw err;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Invalid parameters produce a `ChargebeeZodValidationError`. The error message lists every problem (field path and message). You can also inspect `actionName` (the API action, for example `create`) and `zodError` (Zod’s `ZodError`, including `issues`) for structured handling.
|
|
157
|
+
|
|
158
|
+
**Example message:**
|
|
159
|
+
|
|
160
|
+
```text
|
|
161
|
+
ChargebeeZodValidationError: [Chargebee] Validation failed for 'create': id: Too big: expected string to have <=50 characters; auto_collection: Invalid option: expected one of "on"|"off"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
The same `ChargebeeZodValidationError` shape applies to any action with a schema when parameters are invalid (for example bad filters or limits on `list`).
|
|
165
|
+
|
|
127
166
|
### Using filters in the List API
|
|
128
167
|
|
|
129
168
|
For pagination, `offset` is the parameter that is being used. The value used for this parameter must be the value returned for `next_offset` parameter in the previous API call.
|
package/cjs/RequestWrapper.js
CHANGED
|
@@ -4,6 +4,8 @@ exports.RequestWrapper = void 0;
|
|
|
4
4
|
const util_js_1 = require("./util.js");
|
|
5
5
|
const coreCommon_js_1 = require("./coreCommon.js");
|
|
6
6
|
const node_buffer_1 = require("node:buffer");
|
|
7
|
+
const chargebeeZodValidationError_js_1 = require("./chargebeeZodValidationError.js");
|
|
8
|
+
const validationLoader_js_1 = require("./validationLoader.js");
|
|
7
9
|
class RequestWrapper {
|
|
8
10
|
constructor(args, apiCall, envArg) {
|
|
9
11
|
this.getRequest = () => {
|
|
@@ -23,6 +25,17 @@ class RequestWrapper {
|
|
|
23
25
|
}
|
|
24
26
|
return idParam;
|
|
25
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Validate parameters against the action's Zod schema when enableValidation is true.
|
|
30
|
+
* Query params are validated as `params ?? {}`; body params are validated when `params` is non-null.
|
|
31
|
+
* Throws a descriptive error listing every validation violation.
|
|
32
|
+
*/
|
|
33
|
+
static _validateParams(params, schema, actionName) {
|
|
34
|
+
const result = schema.safeParse(params);
|
|
35
|
+
if (!result.success) {
|
|
36
|
+
throw new chargebeeZodValidationError_js_1.ChargebeeZodValidationError(actionName, result.error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
26
39
|
static parseRetryAfter(retryAfter) {
|
|
27
40
|
if (!retryAfter)
|
|
28
41
|
return null;
|
|
@@ -42,6 +55,20 @@ class RequestWrapper {
|
|
|
42
55
|
? this.args[1]
|
|
43
56
|
: this.args[0];
|
|
44
57
|
let headers = this.apiCall.hasIdInUrl ? this.args[2] : this.args[1];
|
|
58
|
+
// Lazy-load Zod schema when enableValidation is true
|
|
59
|
+
if (env.enableValidation &&
|
|
60
|
+
this.apiCall.resourceKey &&
|
|
61
|
+
this.apiCall.actionName) {
|
|
62
|
+
const schema = await (0, validationLoader_js_1.getSchema)(this.apiCall.resourceKey, this.apiCall.actionName);
|
|
63
|
+
if (schema) {
|
|
64
|
+
if (this.apiCall.httpMethod === 'GET') {
|
|
65
|
+
RequestWrapper._validateParams(params !== null && params !== void 0 ? params : {}, schema, this.apiCall.methodName);
|
|
66
|
+
}
|
|
67
|
+
else if (params != null) {
|
|
68
|
+
RequestWrapper._validateParams(params, schema, this.apiCall.methodName);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
45
72
|
Object.assign(this.httpHeaders, headers);
|
|
46
73
|
if (this.apiCall.httpMethod === 'POST' &&
|
|
47
74
|
!this.httpHeaders['chargebee-idempotency-key'] &&
|
package/cjs/chargebee.cjs.js
CHANGED
|
@@ -4,6 +4,7 @@ const createChargebee_js_1 = require("./createChargebee.js");
|
|
|
4
4
|
const FetchClient_js_1 = require("./net/FetchClient.js");
|
|
5
5
|
const handler_js_1 = require("./resources/webhook/handler.js");
|
|
6
6
|
const auth_js_1 = require("./resources/webhook/auth.js");
|
|
7
|
+
const chargebeeZodValidationError_js_1 = require("./chargebeeZodValidationError.js");
|
|
7
8
|
const httpClient = new FetchClient_js_1.FetchHttpClient();
|
|
8
9
|
const Chargebee = (0, createChargebee_js_1.CreateChargebee)(httpClient);
|
|
9
10
|
module.exports = Chargebee;
|
|
@@ -18,3 +19,5 @@ module.exports.WebhookError = handler_js_1.WebhookError;
|
|
|
18
19
|
module.exports.WebhookAuthenticationError = handler_js_1.WebhookAuthenticationError;
|
|
19
20
|
module.exports.WebhookPayloadValidationError = handler_js_1.WebhookPayloadValidationError;
|
|
20
21
|
module.exports.WebhookPayloadParseError = handler_js_1.WebhookPayloadParseError;
|
|
22
|
+
// Export validation error class
|
|
23
|
+
module.exports.ChargebeeZodValidationError = chargebeeZodValidationError_js_1.ChargebeeZodValidationError;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WebhookPayloadParseError = exports.WebhookPayloadValidationError = exports.WebhookAuthenticationError = exports.WebhookError = exports.basicAuthValidator = exports.WebhookContentType = exports.WebhookEventType = void 0;
|
|
4
4
|
const createChargebee_js_1 = require("./createChargebee.js");
|
|
5
5
|
const FetchClient_js_1 = require("./net/FetchClient.js");
|
|
6
|
+
const chargebeeZodValidationError_js_1 = require("./chargebeeZodValidationError.js");
|
|
6
7
|
const httpClient = new FetchClient_js_1.FetchHttpClient();
|
|
7
8
|
const Chargebee = (0, createChargebee_js_1.CreateChargebee)(httpClient);
|
|
8
9
|
module.exports = Chargebee;
|
|
@@ -19,3 +20,4 @@ Object.defineProperty(exports, "WebhookError", { enumerable: true, get: function
|
|
|
19
20
|
Object.defineProperty(exports, "WebhookAuthenticationError", { enumerable: true, get: function () { return handler_js_2.WebhookAuthenticationError; } });
|
|
20
21
|
Object.defineProperty(exports, "WebhookPayloadValidationError", { enumerable: true, get: function () { return handler_js_2.WebhookPayloadValidationError; } });
|
|
21
22
|
Object.defineProperty(exports, "WebhookPayloadParseError", { enumerable: true, get: function () { return handler_js_2.WebhookPayloadParseError; } });
|
|
23
|
+
module.exports.ChargebeeZodValidationError = chargebeeZodValidationError_js_1.ChargebeeZodValidationError;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChargebeeZodValidationError = void 0;
|
|
4
|
+
class ChargebeeZodValidationError extends Error {
|
|
5
|
+
constructor(actionName, zodError) {
|
|
6
|
+
var _a;
|
|
7
|
+
const messages = zodError.issues
|
|
8
|
+
.map((e) => `${e.path.join('.')}: ${e.message}`)
|
|
9
|
+
.join('; ');
|
|
10
|
+
super(`[Chargebee] Validation failed for '${actionName}': ${messages}`);
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
this.name = 'ChargebeeZodValidationError';
|
|
13
|
+
this.actionName = actionName;
|
|
14
|
+
this.zodError = zodError;
|
|
15
|
+
(_a = Error.captureStackTrace) === null || _a === void 0 ? void 0 : _a.call(Error, this, this.constructor);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ChargebeeZodValidationError = ChargebeeZodValidationError;
|
package/cjs/createChargebee.js
CHANGED
|
@@ -96,6 +96,11 @@ const CreateChargebee = (httpClient) => {
|
|
|
96
96
|
jsonKeys: metaArr[7],
|
|
97
97
|
options: metaArr[8],
|
|
98
98
|
};
|
|
99
|
+
if (this._env.enableValidation) {
|
|
100
|
+
// Store resource and action for lazy schema loading in RequestWrapper
|
|
101
|
+
apiCall.resourceKey = res;
|
|
102
|
+
apiCall.actionName = metaArr[0];
|
|
103
|
+
}
|
|
99
104
|
this[res][apiCall.methodName] = this._createApiFunc(apiCall, this._env);
|
|
100
105
|
}
|
|
101
106
|
}
|
package/cjs/environment.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.Environment = {
|
|
|
11
11
|
hostSuffix: '.chargebee.com',
|
|
12
12
|
apiPath: '/api/v2',
|
|
13
13
|
timeout: DEFAULT_TIME_OUT,
|
|
14
|
-
clientVersion: 'v3.
|
|
14
|
+
clientVersion: 'v3.25.0-beta.1',
|
|
15
15
|
port: DEFAULT_PORT,
|
|
16
16
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
17
17
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
|
@@ -3032,6 +3032,7 @@ exports.Endpoints = {
|
|
|
3032
3032
|
quotedDeltaRamp: [],
|
|
3033
3033
|
billingConfiguration: [],
|
|
3034
3034
|
quoteLineGroup: [],
|
|
3035
|
+
quoteEntitlement: [],
|
|
3035
3036
|
cpqQuoteSignature: [],
|
|
3036
3037
|
plan: [
|
|
3037
3038
|
[
|
|
@@ -4975,8 +4976,85 @@ exports.Endpoints = {
|
|
|
4975
4976
|
{},
|
|
4976
4977
|
],
|
|
4977
4978
|
],
|
|
4978
|
-
alert: [
|
|
4979
|
-
|
|
4979
|
+
alert: [
|
|
4980
|
+
[
|
|
4981
|
+
'create',
|
|
4982
|
+
'POST',
|
|
4983
|
+
'/alerts',
|
|
4984
|
+
null,
|
|
4985
|
+
false,
|
|
4986
|
+
null,
|
|
4987
|
+
false,
|
|
4988
|
+
{},
|
|
4989
|
+
{
|
|
4990
|
+
isIdempotent: true,
|
|
4991
|
+
},
|
|
4992
|
+
],
|
|
4993
|
+
['retrieve', 'GET', '/alerts', null, true, null, false, {}, {}],
|
|
4994
|
+
['list', 'GET', '/alerts', null, false, null, false, {}, {}],
|
|
4995
|
+
[
|
|
4996
|
+
'update',
|
|
4997
|
+
'POST',
|
|
4998
|
+
'/alerts',
|
|
4999
|
+
null,
|
|
5000
|
+
true,
|
|
5001
|
+
null,
|
|
5002
|
+
false,
|
|
5003
|
+
{},
|
|
5004
|
+
{
|
|
5005
|
+
isIdempotent: true,
|
|
5006
|
+
},
|
|
5007
|
+
],
|
|
5008
|
+
[
|
|
5009
|
+
'delete',
|
|
5010
|
+
'POST',
|
|
5011
|
+
'/alerts',
|
|
5012
|
+
'/delete',
|
|
5013
|
+
true,
|
|
5014
|
+
null,
|
|
5015
|
+
false,
|
|
5016
|
+
{},
|
|
5017
|
+
{
|
|
5018
|
+
isIdempotent: true,
|
|
5019
|
+
},
|
|
5020
|
+
],
|
|
5021
|
+
[
|
|
5022
|
+
'application_alertsForSubscription',
|
|
5023
|
+
'GET',
|
|
5024
|
+
'/subscriptions',
|
|
5025
|
+
'/applicable_alerts',
|
|
5026
|
+
true,
|
|
5027
|
+
null,
|
|
5028
|
+
false,
|
|
5029
|
+
{},
|
|
5030
|
+
{},
|
|
5031
|
+
],
|
|
5032
|
+
],
|
|
5033
|
+
filterCondition: [],
|
|
5034
|
+
alertStatus: [
|
|
5035
|
+
[
|
|
5036
|
+
'alert_statusesForSubscription',
|
|
5037
|
+
'GET',
|
|
5038
|
+
'/subscriptions',
|
|
5039
|
+
'/alert_statuses',
|
|
5040
|
+
true,
|
|
5041
|
+
null,
|
|
5042
|
+
false,
|
|
5043
|
+
{},
|
|
5044
|
+
{},
|
|
5045
|
+
],
|
|
5046
|
+
[
|
|
5047
|
+
'alert_statusesForAlert',
|
|
5048
|
+
'GET',
|
|
5049
|
+
'/alerts',
|
|
5050
|
+
'/alert_statuses',
|
|
5051
|
+
true,
|
|
5052
|
+
null,
|
|
5053
|
+
false,
|
|
5054
|
+
{},
|
|
5055
|
+
{},
|
|
5056
|
+
],
|
|
5057
|
+
],
|
|
4980
5058
|
impactedCustomer: [],
|
|
4981
5059
|
subscriptionEntitlementsUpdatedDetail: [],
|
|
4982
5060
|
subscriptionEntitlementsCreatedDetail: [],
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated Zod schemas: Addon
|
|
3
|
+
// Actions: create, update, copy
|
|
4
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CopyAddonBodySchema = exports.UpdateAddonBodySchema = exports.CreateAddonBodySchema = void 0;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
//Addon.create
|
|
9
|
+
const CreateAddonMetaDataSchema = zod_1.z.looseObject({});
|
|
10
|
+
const CreateAddonTiersSchema = zod_1.z.object({
|
|
11
|
+
starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
12
|
+
ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
13
|
+
price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
|
|
14
|
+
starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
15
|
+
ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
16
|
+
price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
|
|
17
|
+
});
|
|
18
|
+
const CreateAddonTaxProvidersFieldsSchema = zod_1.z.object({
|
|
19
|
+
provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
20
|
+
field_id: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
21
|
+
field_value: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
22
|
+
});
|
|
23
|
+
const CreateAddonBodySchema = zod_1.z.looseObject({
|
|
24
|
+
id: zod_1.z.string().max(100),
|
|
25
|
+
name: zod_1.z.string().max(100),
|
|
26
|
+
invoice_name: zod_1.z.string().max(100).optional(),
|
|
27
|
+
description: zod_1.z.string().max(2000).optional(),
|
|
28
|
+
charge_type: zod_1.z.enum(['recurring', 'non_recurring']),
|
|
29
|
+
price: zod_1.z.number().int().min(0).optional(),
|
|
30
|
+
currency_code: zod_1.z.string().max(3).optional(),
|
|
31
|
+
period: zod_1.z.number().int().min(1).optional(),
|
|
32
|
+
period_unit: zod_1.z
|
|
33
|
+
.enum(['day', 'week', 'month', 'year', 'not_applicable'])
|
|
34
|
+
.optional(),
|
|
35
|
+
pricing_model: zod_1.z
|
|
36
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
37
|
+
.optional(),
|
|
38
|
+
type: zod_1.z
|
|
39
|
+
.enum(['on_off', 'quantity', 'tiered', 'volume', 'stairstep'])
|
|
40
|
+
.optional(),
|
|
41
|
+
unit: zod_1.z.string().max(30).optional(),
|
|
42
|
+
enabled_in_portal: zod_1.z.boolean().default(true).optional(),
|
|
43
|
+
taxable: zod_1.z.boolean().default(true).optional(),
|
|
44
|
+
tax_profile_id: zod_1.z.string().max(50).optional(),
|
|
45
|
+
avalara_sale_type: zod_1.z
|
|
46
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
47
|
+
.optional(),
|
|
48
|
+
avalara_transaction_type: zod_1.z.number().int().optional(),
|
|
49
|
+
avalara_service_type: zod_1.z.number().int().optional(),
|
|
50
|
+
tax_code: zod_1.z.string().max(50).optional(),
|
|
51
|
+
hsn_code: zod_1.z.string().max(50).optional(),
|
|
52
|
+
taxjar_product_code: zod_1.z.string().max(50).optional(),
|
|
53
|
+
invoice_notes: zod_1.z.string().max(2000).optional(),
|
|
54
|
+
meta_data: CreateAddonMetaDataSchema.optional(),
|
|
55
|
+
sku: zod_1.z.string().max(100).optional(),
|
|
56
|
+
accounting_code: zod_1.z.string().max(100).optional(),
|
|
57
|
+
accounting_category1: zod_1.z.string().max(100).optional(),
|
|
58
|
+
accounting_category2: zod_1.z.string().max(100).optional(),
|
|
59
|
+
accounting_category3: zod_1.z.string().max(100).optional(),
|
|
60
|
+
accounting_category4: zod_1.z.string().max(100).optional(),
|
|
61
|
+
is_shippable: zod_1.z.boolean().default(false).optional(),
|
|
62
|
+
shipping_frequency_period: zod_1.z.number().int().min(1).optional(),
|
|
63
|
+
shipping_frequency_period_unit: zod_1.z
|
|
64
|
+
.enum(['year', 'month', 'week', 'day'])
|
|
65
|
+
.optional(),
|
|
66
|
+
included_in_mrr: zod_1.z.boolean().optional(),
|
|
67
|
+
show_description_in_invoices: zod_1.z.boolean().default(false).optional(),
|
|
68
|
+
show_description_in_quotes: zod_1.z.boolean().default(false).optional(),
|
|
69
|
+
price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
70
|
+
proration_type: zod_1.z
|
|
71
|
+
.enum(['site_default', 'partial_term', 'full_term'])
|
|
72
|
+
.optional(),
|
|
73
|
+
status: zod_1.z.enum(['active', 'archived']).optional(),
|
|
74
|
+
tiers: CreateAddonTiersSchema.optional(),
|
|
75
|
+
tax_providers_fields: CreateAddonTaxProvidersFieldsSchema.optional(),
|
|
76
|
+
});
|
|
77
|
+
exports.CreateAddonBodySchema = CreateAddonBodySchema;
|
|
78
|
+
//Addon.update
|
|
79
|
+
const UpdateAddonMetaDataSchema = zod_1.z.looseObject({});
|
|
80
|
+
const UpdateAddonTiersSchema = zod_1.z.object({
|
|
81
|
+
starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
82
|
+
ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
83
|
+
price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
|
|
84
|
+
starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
85
|
+
ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
86
|
+
price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
|
|
87
|
+
});
|
|
88
|
+
const UpdateAddonTaxProvidersFieldsSchema = zod_1.z.object({
|
|
89
|
+
provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
90
|
+
field_id: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
91
|
+
field_value: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
92
|
+
});
|
|
93
|
+
const UpdateAddonBodySchema = zod_1.z.looseObject({
|
|
94
|
+
name: zod_1.z.string().max(100).optional(),
|
|
95
|
+
invoice_name: zod_1.z.string().max(100).optional(),
|
|
96
|
+
description: zod_1.z.string().max(2000).optional(),
|
|
97
|
+
charge_type: zod_1.z.enum(['recurring', 'non_recurring']).optional(),
|
|
98
|
+
price: zod_1.z.number().int().min(0).optional(),
|
|
99
|
+
currency_code: zod_1.z.string().max(3).optional(),
|
|
100
|
+
period: zod_1.z.number().int().min(1).optional(),
|
|
101
|
+
period_unit: zod_1.z
|
|
102
|
+
.enum(['day', 'week', 'month', 'year', 'not_applicable'])
|
|
103
|
+
.optional(),
|
|
104
|
+
pricing_model: zod_1.z
|
|
105
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
106
|
+
.optional(),
|
|
107
|
+
type: zod_1.z
|
|
108
|
+
.enum(['on_off', 'quantity', 'tiered', 'volume', 'stairstep'])
|
|
109
|
+
.optional(),
|
|
110
|
+
unit: zod_1.z.string().max(30).optional(),
|
|
111
|
+
enabled_in_portal: zod_1.z.boolean().default(true).optional(),
|
|
112
|
+
taxable: zod_1.z.boolean().default(true).optional(),
|
|
113
|
+
tax_profile_id: zod_1.z.string().max(50).optional(),
|
|
114
|
+
avalara_sale_type: zod_1.z
|
|
115
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
116
|
+
.optional(),
|
|
117
|
+
avalara_transaction_type: zod_1.z.number().int().optional(),
|
|
118
|
+
avalara_service_type: zod_1.z.number().int().optional(),
|
|
119
|
+
tax_code: zod_1.z.string().max(50).optional(),
|
|
120
|
+
hsn_code: zod_1.z.string().max(50).optional(),
|
|
121
|
+
taxjar_product_code: zod_1.z.string().max(50).optional(),
|
|
122
|
+
invoice_notes: zod_1.z.string().max(2000).optional(),
|
|
123
|
+
meta_data: UpdateAddonMetaDataSchema.optional(),
|
|
124
|
+
sku: zod_1.z.string().max(100).optional(),
|
|
125
|
+
accounting_code: zod_1.z.string().max(100).optional(),
|
|
126
|
+
accounting_category1: zod_1.z.string().max(100).optional(),
|
|
127
|
+
accounting_category2: zod_1.z.string().max(100).optional(),
|
|
128
|
+
accounting_category3: zod_1.z.string().max(100).optional(),
|
|
129
|
+
accounting_category4: zod_1.z.string().max(100).optional(),
|
|
130
|
+
is_shippable: zod_1.z.boolean().default(false).optional(),
|
|
131
|
+
shipping_frequency_period: zod_1.z.number().int().min(1).optional(),
|
|
132
|
+
shipping_frequency_period_unit: zod_1.z
|
|
133
|
+
.enum(['year', 'month', 'week', 'day'])
|
|
134
|
+
.optional(),
|
|
135
|
+
included_in_mrr: zod_1.z.boolean().optional(),
|
|
136
|
+
show_description_in_invoices: zod_1.z.boolean().default(false).optional(),
|
|
137
|
+
show_description_in_quotes: zod_1.z.boolean().default(false).optional(),
|
|
138
|
+
price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
139
|
+
proration_type: zod_1.z
|
|
140
|
+
.enum(['site_default', 'partial_term', 'full_term'])
|
|
141
|
+
.optional(),
|
|
142
|
+
tiers: UpdateAddonTiersSchema.optional(),
|
|
143
|
+
tax_providers_fields: UpdateAddonTaxProvidersFieldsSchema.optional(),
|
|
144
|
+
});
|
|
145
|
+
exports.UpdateAddonBodySchema = UpdateAddonBodySchema;
|
|
146
|
+
//Addon.copy
|
|
147
|
+
const CopyAddonBodySchema = zod_1.z.looseObject({
|
|
148
|
+
from_site: zod_1.z.string().max(50),
|
|
149
|
+
id_at_from_site: zod_1.z.string().max(100),
|
|
150
|
+
id: zod_1.z.string().max(100).optional(),
|
|
151
|
+
for_site_merging: zod_1.z.boolean().default(false).optional(),
|
|
152
|
+
});
|
|
153
|
+
exports.CopyAddonBodySchema = CopyAddonBodySchema;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated Zod schemas: Address
|
|
3
|
+
// Actions: retrieve, update
|
|
4
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UpdateAddressBodySchema = exports.RetrieveAddressBodySchema = void 0;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
//Address.retrieve
|
|
9
|
+
const RetrieveAddressBodySchema = zod_1.z.looseObject({
|
|
10
|
+
subscription_id: zod_1.z.string().max(50),
|
|
11
|
+
label: zod_1.z.string().max(50),
|
|
12
|
+
});
|
|
13
|
+
exports.RetrieveAddressBodySchema = RetrieveAddressBodySchema;
|
|
14
|
+
//Address.update
|
|
15
|
+
const UpdateAddressBodySchema = zod_1.z.looseObject({
|
|
16
|
+
subscription_id: zod_1.z.string().max(50),
|
|
17
|
+
label: zod_1.z.string().max(50),
|
|
18
|
+
first_name: zod_1.z.string().max(150).optional(),
|
|
19
|
+
last_name: zod_1.z.string().max(150).optional(),
|
|
20
|
+
email: zod_1.z.string().email().max(70).optional(),
|
|
21
|
+
company: zod_1.z.string().max(250).optional(),
|
|
22
|
+
phone: zod_1.z.string().max(50).optional(),
|
|
23
|
+
addr: zod_1.z.string().max(150).optional(),
|
|
24
|
+
extended_addr: zod_1.z.string().max(150).optional(),
|
|
25
|
+
extended_addr2: zod_1.z.string().max(150).optional(),
|
|
26
|
+
city: zod_1.z.string().max(50).optional(),
|
|
27
|
+
state_code: zod_1.z.string().max(50).optional(),
|
|
28
|
+
state: zod_1.z.string().max(50).optional(),
|
|
29
|
+
zip: zod_1.z.string().max(20).optional(),
|
|
30
|
+
country: zod_1.z.string().max(50).optional(),
|
|
31
|
+
validation_status: zod_1.z
|
|
32
|
+
.enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
|
|
33
|
+
.optional(),
|
|
34
|
+
});
|
|
35
|
+
exports.UpdateAddressBodySchema = UpdateAddressBodySchema;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated Zod schemas: Alert
|
|
3
|
+
// Actions: create, update
|
|
4
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UpdateAlertBodySchema = exports.CreateAlertBodySchema = void 0;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
//Alert.create
|
|
9
|
+
const CreateAlertThresholdSchema = zod_1.z.object({
|
|
10
|
+
mode: zod_1.z.enum(['absolute', 'percentage']),
|
|
11
|
+
value: zod_1.z.number(),
|
|
12
|
+
});
|
|
13
|
+
const CreateAlertFilterConditionsSchema = zod_1.z.object({
|
|
14
|
+
field: zod_1.z.array(zod_1.z.enum(['plan_price_id']).optional()).optional(),
|
|
15
|
+
operator: zod_1.z.array(zod_1.z.enum(['equals', 'not_equals']).optional()).optional(),
|
|
16
|
+
value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
|
|
17
|
+
});
|
|
18
|
+
const CreateAlertBodySchema = zod_1.z.looseObject({
|
|
19
|
+
type: zod_1.z.enum(['usage_exceeded']),
|
|
20
|
+
name: zod_1.z.string().max(50),
|
|
21
|
+
description: zod_1.z.string().max(65000).optional(),
|
|
22
|
+
metered_feature_id: zod_1.z.string().max(50),
|
|
23
|
+
subscription_id: zod_1.z.string().max(50).optional(),
|
|
24
|
+
meta: zod_1.z.string().max(65000).optional(),
|
|
25
|
+
threshold: CreateAlertThresholdSchema.optional(),
|
|
26
|
+
filter_conditions: CreateAlertFilterConditionsSchema.optional(),
|
|
27
|
+
});
|
|
28
|
+
exports.CreateAlertBodySchema = CreateAlertBodySchema;
|
|
29
|
+
//Alert.update
|
|
30
|
+
const UpdateAlertThresholdSchema = zod_1.z.object({
|
|
31
|
+
mode: zod_1.z.enum(['absolute', 'percentage']).optional(),
|
|
32
|
+
value: zod_1.z.number().optional(),
|
|
33
|
+
});
|
|
34
|
+
const UpdateAlertBodySchema = zod_1.z.looseObject({
|
|
35
|
+
status: zod_1.z.enum(['enabled', 'disabled']).optional(),
|
|
36
|
+
threshold: UpdateAlertThresholdSchema.optional(),
|
|
37
|
+
});
|
|
38
|
+
exports.UpdateAlertBodySchema = UpdateAlertBodySchema;
|