chargebee 3.25.0-beta.1 → 3.26.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/CHANGELOG.md +103 -4
- package/README.md +0 -39
- package/cjs/RequestWrapper.js +1 -28
- package/cjs/chargebee.cjs.js +0 -3
- package/cjs/chargebee.cjs.worker.js +0 -2
- package/cjs/createChargebee.js +0 -5
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +121 -3
- package/cjs/resources/webhook/eventType.js +2 -0
- package/esm/RequestWrapper.js +1 -28
- package/esm/chargebee.esm.js +0 -2
- package/esm/chargebee.esm.worker.js +0 -1
- package/esm/createChargebee.js +0 -5
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +121 -3
- package/esm/resources/webhook/eventType.js +2 -0
- package/package.json +1 -4
- package/types/core.d.ts +24 -6
- package/types/index.d.ts +8 -17
- package/types/resources/Content.d.ts +4 -1
- package/types/resources/CreditNote.d.ts +1 -0
- package/types/resources/Customer.d.ts +14 -4
- package/types/resources/Estimate.d.ts +14 -4
- package/types/resources/Event.d.ts +2 -0
- package/types/resources/Gift.d.ts +23 -6
- package/types/resources/GrantBlock.d.ts +59 -0
- package/types/resources/HostedPage.d.ts +6 -1
- package/types/resources/Invoice.d.ts +14 -5
- package/types/resources/LedgerAccountBalance.d.ts +50 -0
- package/types/resources/LedgerOperation.d.ts +141 -0
- package/types/resources/OmnichannelSubscription.d.ts +8 -0
- package/types/resources/OmnichannelSubscriptionItem.d.ts +1 -0
- package/types/resources/PaymentIntent.d.ts +35 -10
- package/types/resources/PaymentSource.d.ts +7 -2
- package/types/resources/PromotionalGrant.d.ts +37 -0
- package/types/resources/Purchase.d.ts +7 -2
- package/types/resources/Subscription.d.ts +49 -14
- package/types/resources/WebhookEvent.d.ts +22 -4
- package/cjs/chargebeeZodValidationError.js +0 -18
- package/cjs/schema/addon.schema.js +0 -153
- package/cjs/schema/address.schema.js +0 -35
- package/cjs/schema/alert.schema.js +0 -38
- package/cjs/schema/attached_item.schema.js +0 -58
- package/cjs/schema/business_entity.schema.js +0 -46
- package/cjs/schema/card.schema.js +0 -165
- package/cjs/schema/comment.schema.js +0 -69
- package/cjs/schema/coupon.schema.js +0 -209
- package/cjs/schema/coupon_code.schema.js +0 -14
- package/cjs/schema/coupon_set.schema.js +0 -28
- package/cjs/schema/credit_note.schema.js +0 -288
- package/cjs/schema/currency.schema.js +0 -32
- package/cjs/schema/customer.schema.js +0 -986
- package/cjs/schema/customer_entitlement.schema.js +0 -14
- package/cjs/schema/differential_price.schema.js +0 -68
- package/cjs/schema/entitlement.schema.js +0 -27
- package/cjs/schema/entitlement_override.schema.js +0 -33
- package/cjs/schema/estimate.schema.js +0 -1525
- package/cjs/schema/export.schema.js +0 -1545
- package/cjs/schema/feature.schema.js +0 -37
- package/cjs/schema/gift.schema.js +0 -277
- package/cjs/schema/hosted_page.schema.js +0 -1649
- package/cjs/schema/in_app_subscription.schema.js +0 -68
- package/cjs/schema/index.js +0 -80
- package/cjs/schema/invoice.schema.js +0 -1467
- package/cjs/schema/item.schema.js +0 -91
- package/cjs/schema/item_entitlement.schema.js +0 -45
- package/cjs/schema/item_family.schema.js +0 -21
- package/cjs/schema/item_price.schema.js +0 -190
- package/cjs/schema/non_subscription.schema.js +0 -28
- package/cjs/schema/offer_event.schema.js +0 -13
- package/cjs/schema/offer_fulfillment.schema.js +0 -20
- package/cjs/schema/omnichannel_one_time_order.schema.js +0 -26
- package/cjs/schema/omnichannel_subscription.schema.js +0 -89
- package/cjs/schema/omnichannel_subscription_item.schema.js +0 -13
- package/cjs/schema/order.schema.js +0 -273
- package/cjs/schema/payment_intent.schema.js +0 -117
- package/cjs/schema/payment_schedule_scheme.schema.js +0 -20
- package/cjs/schema/payment_source.schema.js +0 -358
- package/cjs/schema/payment_voucher.schema.js +0 -57
- package/cjs/schema/personalized_offer.schema.js +0 -28
- package/cjs/schema/plan.schema.js +0 -225
- package/cjs/schema/portal_session.schema.js +0 -22
- package/cjs/schema/price_variant.schema.js +0 -36
- package/cjs/schema/pricing_page_session.schema.js +0 -135
- package/cjs/schema/promotional_credit.schema.js +0 -78
- package/cjs/schema/purchase.schema.js +0 -272
- package/cjs/schema/quote.schema.js +0 -1557
- package/cjs/schema/ramp.schema.js +0 -209
- package/cjs/schema/recorded_purchase.schema.js +0 -32
- package/cjs/schema/resource_migration.schema.js +0 -14
- package/cjs/schema/site_migration_detail.schema.js +0 -81
- package/cjs/schema/subscription.schema.js +0 -2993
- package/cjs/schema/subscription_entitlement.schema.js +0 -25
- package/cjs/schema/time_machine.schema.js +0 -17
- package/cjs/schema/transaction.schema.js +0 -70
- package/cjs/schema/unbilled_charge.schema.js +0 -113
- package/cjs/schema/usage.schema.js +0 -93
- package/cjs/schema/usage_charge.schema.js +0 -17
- package/cjs/schema/usage_event.schema.js +0 -28
- package/cjs/schema/usage_file.schema.js +0 -13
- package/cjs/schema/usage_summary.schema.js +0 -17
- package/cjs/schema/virtual_bank_account.schema.js +0 -43
- package/cjs/schema/webhook_endpoint.schema.js +0 -504
- package/cjs/validationLoader.js +0 -59
- package/esm/chargebeeZodValidationError.js +0 -14
- package/esm/schema/addon.schema.js +0 -150
- package/esm/schema/address.schema.js +0 -32
- package/esm/schema/alert.schema.js +0 -35
- package/esm/schema/attached_item.schema.js +0 -55
- package/esm/schema/business_entity.schema.js +0 -43
- package/esm/schema/card.schema.js +0 -162
- package/esm/schema/comment.schema.js +0 -66
- package/esm/schema/coupon.schema.js +0 -206
- package/esm/schema/coupon_code.schema.js +0 -11
- package/esm/schema/coupon_set.schema.js +0 -25
- package/esm/schema/credit_note.schema.js +0 -285
- package/esm/schema/currency.schema.js +0 -29
- package/esm/schema/customer.schema.js +0 -983
- package/esm/schema/customer_entitlement.schema.js +0 -11
- package/esm/schema/differential_price.schema.js +0 -65
- package/esm/schema/entitlement.schema.js +0 -24
- package/esm/schema/entitlement_override.schema.js +0 -30
- package/esm/schema/estimate.schema.js +0 -1522
- package/esm/schema/export.schema.js +0 -1542
- package/esm/schema/feature.schema.js +0 -34
- package/esm/schema/gift.schema.js +0 -274
- package/esm/schema/hosted_page.schema.js +0 -1646
- package/esm/schema/in_app_subscription.schema.js +0 -65
- package/esm/schema/index.js +0 -64
- package/esm/schema/invoice.schema.js +0 -1464
- package/esm/schema/item.schema.js +0 -88
- package/esm/schema/item_entitlement.schema.js +0 -42
- package/esm/schema/item_family.schema.js +0 -18
- package/esm/schema/item_price.schema.js +0 -187
- package/esm/schema/non_subscription.schema.js +0 -25
- package/esm/schema/offer_event.schema.js +0 -10
- package/esm/schema/offer_fulfillment.schema.js +0 -17
- package/esm/schema/omnichannel_one_time_order.schema.js +0 -23
- package/esm/schema/omnichannel_subscription.schema.js +0 -86
- package/esm/schema/omnichannel_subscription_item.schema.js +0 -10
- package/esm/schema/order.schema.js +0 -270
- package/esm/schema/payment_intent.schema.js +0 -114
- package/esm/schema/payment_schedule_scheme.schema.js +0 -17
- package/esm/schema/payment_source.schema.js +0 -355
- package/esm/schema/payment_voucher.schema.js +0 -54
- package/esm/schema/personalized_offer.schema.js +0 -25
- package/esm/schema/plan.schema.js +0 -222
- package/esm/schema/portal_session.schema.js +0 -19
- package/esm/schema/price_variant.schema.js +0 -33
- package/esm/schema/pricing_page_session.schema.js +0 -132
- package/esm/schema/promotional_credit.schema.js +0 -75
- package/esm/schema/purchase.schema.js +0 -269
- package/esm/schema/quote.schema.js +0 -1554
- package/esm/schema/ramp.schema.js +0 -206
- package/esm/schema/recorded_purchase.schema.js +0 -29
- package/esm/schema/resource_migration.schema.js +0 -11
- package/esm/schema/site_migration_detail.schema.js +0 -78
- package/esm/schema/subscription.schema.js +0 -2990
- package/esm/schema/subscription_entitlement.schema.js +0 -22
- package/esm/schema/time_machine.schema.js +0 -14
- package/esm/schema/transaction.schema.js +0 -67
- package/esm/schema/unbilled_charge.schema.js +0 -110
- package/esm/schema/usage.schema.js +0 -90
- package/esm/schema/usage_charge.schema.js +0 -14
- package/esm/schema/usage_event.schema.js +0 -25
- package/esm/schema/usage_file.schema.js +0 -10
- package/esm/schema/usage_summary.schema.js +0 -14
- package/esm/schema/virtual_bank_account.schema.js +0 -40
- package/esm/schema/webhook_endpoint.schema.js +0 -501
- package/esm/validationLoader.js +0 -56
- package/types/resources/QuoteEntitlement.d.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,108 @@
|
|
|
1
|
-
### v3.
|
|
1
|
+
### v3.26.0 (2026-06-12)
|
|
2
2
|
* * *
|
|
3
|
+
### New Resources:
|
|
4
|
+
- [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks) has been added.
|
|
5
|
+
- [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances) has been added.
|
|
6
|
+
- [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations) has been added.
|
|
7
|
+
- [`PromotionalGrant`](https://apidocs.chargebee.com/docs/api/promotional_grants) has been added.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### New Attributes:
|
|
11
|
+
- [`notes`](https://apidocs.chargebee.com/docs/api/credit_notes/credit-note-object#notes) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes).
|
|
12
|
+
- [`layout`](https://apidocs.chargebee.com/docs/api/hosted_pages/hosted-page-object#layout) has been added to [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages).
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### New Parameters:
|
|
16
|
+
- [`sort_by`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#sort_by) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions).
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### New Enums:
|
|
20
|
+
- `available`, `exhausted`, `scheduled`, and `in_grace_period` have been added as new values enum `Status`.
|
|
21
|
+
- `subscription_created`, `subscription_changed`, `top_up`, `promotional_grants`, and `rollover` have been added as new values to enum attribute [`grant_source`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#grant_source) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks).
|
|
22
|
+
- `provisioned` and `overdraft` have been added as new values to enum attribute [`account_type`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#account_type) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks).
|
|
23
|
+
- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#unit_type) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks).
|
|
24
|
+
- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/ledger_account_balances/ledger-account-balance-object#unit_type) in [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances).
|
|
25
|
+
- `allocation`, `capture`, `authorize`, `release_authorization`, `capture_authorization`, `expiry`, `void`, `rollover`, and `adjustment` have been added as new values to enum attribute [`type`](https://apidocs.chargebee.com/docs/api/ledger_operations/ledger-operation-object#type) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).
|
|
26
|
+
- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/ledger_operations/ledger-operation-object#unit_type) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).
|
|
27
|
+
- `expires_at`, `created_at`, and `effective_from` have been added as new values to enum query parameter `sort_by.asc` in [`list_grant_blocks`](https://apidocs.chargebee.com/docs/api/grant_blocks/list-grant-blocks) of [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks).
|
|
28
|
+
- `expires_at`, `created_at`, and `effective_from` have been added as new values to enum query parameter `sort_by.desc` in [`list_grant_blocks`](https://apidocs.chargebee.com/docs/api/grant_blocks/list-grant-blocks) of [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks).
|
|
29
|
+
- `allocation`, `release_authorization`, `void`, `capture`, `rollover`, `adjustment`, `expiry`, `authorize`, and `capture_authorization` have been added as new values to enum query parameter `type.is` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).
|
|
30
|
+
- `allocation`, `release_authorization`, `void`, `capture`, `rollover`, `adjustment`, `expiry`, `authorize`, and `capture_authorization` have been added as new values to enum query parameter `type.in` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).
|
|
31
|
+
- `created_at` has been added as a new value to enum query parameter `sort_by.asc` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).
|
|
32
|
+
- `created_at` has been added as a new value to enum query parameter `sort_by.desc` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).
|
|
33
|
+
- `updated_at` and `created_at` have been added as new values to enum query parameter `sort_by.asc` in [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) of [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions).
|
|
34
|
+
- `updated_at` and `created_at` have been added as new values to enum query parameter `sort_by.desc` in [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) of [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions).
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### v3.25.0 (2026-06-08)
|
|
39
|
+
* * *
|
|
40
|
+
### New Attributes:
|
|
41
|
+
- [`purchased_at`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/omnichannel-subscription-object#purchased_at) has been added to [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions).
|
|
42
|
+
- [`updated_at`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/omnichannel-subscription-object#updated_at) has been added to [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions).
|
|
43
|
+
- [`updated_at`](https://apidocs.chargebee.com/docs/api/omnichannel_subscription_items/omnichannel-subscription-item-object#updated_at) has been added to [`OmnichannelSubscriptionItem`](https://apidocs.chargebee.com/docs/api/omnichannel_subscription_items).
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### New Parameters:
|
|
47
|
+
- [`customer_id.in`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#customer_id_in) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions).
|
|
48
|
+
- [`customer_id.not_in`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#customer_id_not_in) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions).
|
|
49
|
+
- [`id`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#id) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions).
|
|
50
|
+
- [`id_at_source`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#id_at_source) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions).
|
|
51
|
+
- [`updated_at`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#updated_at) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions).
|
|
52
|
+
- [`purchased_at`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#purchased_at) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions).
|
|
53
|
+
- [`gift_receiver`](https://apidocs.chargebee.com/docs/api/gifts/update-a-gift#gift_receiver) has been added as request body parameter to [`update_a_gift`](https://apidocs.chargebee.com/docs/api/gifts/update-a-gift) in [`Gift`](https://apidocs.chargebee.com/docs/api/gifts).
|
|
54
|
+
- [`layout`](https://apidocs.chargebee.com/docs/api/hosted_pages/checkout-gift-subscription-for-items#layout) has been added as request body parameter to [`checkout_gift_subscription_for_items`](https://apidocs.chargebee.com/docs/api/hosted_pages/checkout-gift-subscription-for-items) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages).
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### Parameter Updates:
|
|
58
|
+
- [`scheduled_at`](https://apidocs.chargebee.com/docs/api/gifts/update-a-gift#scheduled_at) has been changed from required to optional in [`update_a_gift`](https://apidocs.chargebee.com/docs/api/gifts/update-a-gift) of [`Gift`](https://apidocs.chargebee.com/docs/api/gifts).
|
|
59
|
+
|
|
3
60
|
|
|
4
|
-
###
|
|
5
|
-
-
|
|
6
|
-
-
|
|
61
|
+
### New Events:
|
|
62
|
+
- [`omnichannel_subscription_item_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/omnichannel_subscription_item_updated) has been added.
|
|
63
|
+
- [`omnichannel_subscription_item_recovered`](https://apidocs.chargebee.com/docs/api/events/webhook/omnichannel_subscription_item_recovered) has been added.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Deleted Resources:
|
|
67
|
+
- QuoteEntitlement has been removed.
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Deleted Attributes:
|
|
71
|
+
- `entity_id` has been removed from `QuoteEntitlement`.
|
|
72
|
+
- `entity_type` has been removed from `QuoteEntitlement`.
|
|
73
|
+
- `feature_id` has been removed from `QuoteEntitlement`.
|
|
74
|
+
- `value` has been removed from `QuoteEntitlement`.
|
|
75
|
+
- `is_enabled` has been removed from `QuoteEntitlement`.
|
|
76
|
+
- `start_date` has been removed from `QuoteEntitlement`.
|
|
77
|
+
- `end_date` has been removed from `QuoteEntitlement`.
|
|
78
|
+
- `created_at` has been removed from `QuoteEntitlement`.
|
|
79
|
+
- `modified_at` has been removed from `QuoteEntitlement`.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Deleted Parameters:
|
|
83
|
+
- `exclude` has been removed as query parameter from [`list_invoices`](https://apidocs.chargebee.com/docs/api/invoices/list-invoices) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices).
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### New Enums:
|
|
87
|
+
- `omnichannel_subscription_item_updated` and `omnichannel_subscription_item_recovered` have been added as new values enum `EventType`.
|
|
88
|
+
- `klarna`, `alipay_hk`, `paypay`, `gcash`, and `south_korean_cards` have been added as new values enum `PaymentMethod`.
|
|
89
|
+
- `klarna`, `alipay_hk`, `paypay`, `gcash`, and `south_korean_cards` have been added as new values enum `PaymentMethodType`.
|
|
90
|
+
- `klarna`, `alipay_hk`, `paypay`, `gcash`, and `south_korean_cards` have been added as new values enum `Type`.
|
|
91
|
+
- `klarna`, `alipay_hk`, `paypay`, `gcash`, and `south_korean_cards` 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).
|
|
92
|
+
- `klarna`, `alipay_hk`, `paypay`, `gcash`, and `south_korean_cards` 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).
|
|
93
|
+
- `klarna`, `alipay_hk`, `paypay`, `gcash`, and `south_korean_cards` 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).
|
|
94
|
+
- `klarna`, `alipay_hk`, `paypay`, `gcash`, and `south_korean_cards` 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).
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### v3.24.1 (2026-06-03)
|
|
99
|
+
* * *
|
|
100
|
+
### Bug Fixes:
|
|
101
|
+
- Fixed `Content-Length` header being computed from the JavaScript string length (UTF-16 code units) instead of the UTF-8 byte length. Requests with non-ASCII payloads (e.g. accented characters, CJK, emoji) under-declared `Content-Length` and were rejected by Node's `fetch`/undici (≥ 7.26.0) with `Request body length does not match content-length header`. The header is now computed via `Buffer.byteLength(data, 'utf8')`. Resolves https://github.com/chargebee/chargebee-node/issues/119.
|
|
102
|
+
|
|
103
|
+
### Tests:
|
|
104
|
+
- ASCII form-urlencoded body — `Content-Length` matches the UTF-8 byte length of the serialized body.
|
|
105
|
+
- Multi-byte JSON body — `Content-Length` matches the UTF-8 byte length and is greater than the JS character count, ensuring the regression cannot return.
|
|
7
106
|
|
|
8
107
|
|
|
9
108
|
### v3.24.0 (2026-05-04)
|
package/README.md
CHANGED
|
@@ -124,45 +124,6 @@ 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
|
-
|
|
166
127
|
### Using filters in the List API
|
|
167
128
|
|
|
168
129
|
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,8 +4,6 @@ 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");
|
|
9
7
|
class RequestWrapper {
|
|
10
8
|
constructor(args, apiCall, envArg) {
|
|
11
9
|
this.getRequest = () => {
|
|
@@ -25,17 +23,6 @@ class RequestWrapper {
|
|
|
25
23
|
}
|
|
26
24
|
return idParam;
|
|
27
25
|
}
|
|
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
|
-
}
|
|
39
26
|
static parseRetryAfter(retryAfter) {
|
|
40
27
|
if (!retryAfter)
|
|
41
28
|
return null;
|
|
@@ -55,20 +42,6 @@ class RequestWrapper {
|
|
|
55
42
|
? this.args[1]
|
|
56
43
|
: this.args[0];
|
|
57
44
|
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
|
-
}
|
|
72
45
|
Object.assign(this.httpHeaders, headers);
|
|
73
46
|
if (this.apiCall.httpMethod === 'POST' &&
|
|
74
47
|
!this.httpHeaders['chargebee-idempotency-key'] &&
|
|
@@ -100,7 +73,7 @@ class RequestWrapper {
|
|
|
100
73
|
const requestHeaders = Object.assign({}, this.httpHeaders);
|
|
101
74
|
if (data && data.length) {
|
|
102
75
|
(0, util_js_1.extend)(true, requestHeaders, {
|
|
103
|
-
'Content-Length': data
|
|
76
|
+
'Content-Length': node_buffer_1.Buffer.byteLength(data, 'utf8'),
|
|
104
77
|
});
|
|
105
78
|
}
|
|
106
79
|
const contentType = this.apiCall.isJsonRequest
|
package/cjs/chargebee.cjs.js
CHANGED
|
@@ -4,7 +4,6 @@ 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");
|
|
8
7
|
const httpClient = new FetchClient_js_1.FetchHttpClient();
|
|
9
8
|
const Chargebee = (0, createChargebee_js_1.CreateChargebee)(httpClient);
|
|
10
9
|
module.exports = Chargebee;
|
|
@@ -19,5 +18,3 @@ module.exports.WebhookError = handler_js_1.WebhookError;
|
|
|
19
18
|
module.exports.WebhookAuthenticationError = handler_js_1.WebhookAuthenticationError;
|
|
20
19
|
module.exports.WebhookPayloadValidationError = handler_js_1.WebhookPayloadValidationError;
|
|
21
20
|
module.exports.WebhookPayloadParseError = handler_js_1.WebhookPayloadParseError;
|
|
22
|
-
// Export validation error class
|
|
23
|
-
module.exports.ChargebeeZodValidationError = chargebeeZodValidationError_js_1.ChargebeeZodValidationError;
|
|
@@ -3,7 +3,6 @@ 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");
|
|
7
6
|
const httpClient = new FetchClient_js_1.FetchHttpClient();
|
|
8
7
|
const Chargebee = (0, createChargebee_js_1.CreateChargebee)(httpClient);
|
|
9
8
|
module.exports = Chargebee;
|
|
@@ -20,4 +19,3 @@ Object.defineProperty(exports, "WebhookError", { enumerable: true, get: function
|
|
|
20
19
|
Object.defineProperty(exports, "WebhookAuthenticationError", { enumerable: true, get: function () { return handler_js_2.WebhookAuthenticationError; } });
|
|
21
20
|
Object.defineProperty(exports, "WebhookPayloadValidationError", { enumerable: true, get: function () { return handler_js_2.WebhookPayloadValidationError; } });
|
|
22
21
|
Object.defineProperty(exports, "WebhookPayloadParseError", { enumerable: true, get: function () { return handler_js_2.WebhookPayloadParseError; } });
|
|
23
|
-
module.exports.ChargebeeZodValidationError = chargebeeZodValidationError_js_1.ChargebeeZodValidationError;
|
package/cjs/createChargebee.js
CHANGED
|
@@ -96,11 +96,6 @@ 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
|
-
}
|
|
104
99
|
this[res][apiCall.methodName] = this._createApiFunc(apiCall, this._env);
|
|
105
100
|
}
|
|
106
101
|
}
|
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.26.0',
|
|
15
15
|
port: DEFAULT_PORT,
|
|
16
16
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
17
17
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
|
@@ -3032,7 +3032,6 @@ exports.Endpoints = {
|
|
|
3032
3032
|
quotedDeltaRamp: [],
|
|
3033
3033
|
billingConfiguration: [],
|
|
3034
3034
|
quoteLineGroup: [],
|
|
3035
|
-
quoteEntitlement: [],
|
|
3036
3035
|
cpqQuoteSignature: [],
|
|
3037
3036
|
plan: [
|
|
3038
3037
|
[
|
|
@@ -4696,6 +4695,7 @@ exports.Endpoints = {
|
|
|
4696
4695
|
},
|
|
4697
4696
|
],
|
|
4698
4697
|
],
|
|
4698
|
+
omnichannelSubscriptionItemScheduledChange: [],
|
|
4699
4699
|
omnichannelSubscription: [
|
|
4700
4700
|
[
|
|
4701
4701
|
'retrieve',
|
|
@@ -4828,7 +4828,6 @@ exports.Endpoints = {
|
|
|
4828
4828
|
{},
|
|
4829
4829
|
],
|
|
4830
4830
|
],
|
|
4831
|
-
omnichannelSubscriptionItemScheduledChange: [],
|
|
4832
4831
|
usageFile: [
|
|
4833
4832
|
[
|
|
4834
4833
|
'uploadUrl',
|
|
@@ -4888,7 +4887,7 @@ exports.Endpoints = {
|
|
|
4888
4887
|
null,
|
|
4889
4888
|
true,
|
|
4890
4889
|
'grow',
|
|
4891
|
-
|
|
4890
|
+
false,
|
|
4892
4891
|
{},
|
|
4893
4892
|
{},
|
|
4894
4893
|
],
|
|
@@ -5055,6 +5054,125 @@ exports.Endpoints = {
|
|
|
5055
5054
|
{},
|
|
5056
5055
|
],
|
|
5057
5056
|
],
|
|
5057
|
+
ledgerAccountBalance: [
|
|
5058
|
+
[
|
|
5059
|
+
'listLedgerAccountBalances',
|
|
5060
|
+
'GET',
|
|
5061
|
+
'/ledger_account_balances',
|
|
5062
|
+
null,
|
|
5063
|
+
false,
|
|
5064
|
+
null,
|
|
5065
|
+
false,
|
|
5066
|
+
{},
|
|
5067
|
+
{},
|
|
5068
|
+
],
|
|
5069
|
+
],
|
|
5070
|
+
ledgerOperation: [
|
|
5071
|
+
[
|
|
5072
|
+
'retrieveLedgerOperation',
|
|
5073
|
+
'GET',
|
|
5074
|
+
'/ledger_operations',
|
|
5075
|
+
null,
|
|
5076
|
+
true,
|
|
5077
|
+
null,
|
|
5078
|
+
false,
|
|
5079
|
+
{},
|
|
5080
|
+
{},
|
|
5081
|
+
],
|
|
5082
|
+
[
|
|
5083
|
+
'listLedgerOperations',
|
|
5084
|
+
'GET',
|
|
5085
|
+
'/ledger_operations',
|
|
5086
|
+
null,
|
|
5087
|
+
false,
|
|
5088
|
+
null,
|
|
5089
|
+
false,
|
|
5090
|
+
{},
|
|
5091
|
+
{},
|
|
5092
|
+
],
|
|
5093
|
+
[
|
|
5094
|
+
'capture',
|
|
5095
|
+
'POST',
|
|
5096
|
+
'/ledger_operations',
|
|
5097
|
+
'/capture',
|
|
5098
|
+
false,
|
|
5099
|
+
null,
|
|
5100
|
+
true,
|
|
5101
|
+
{
|
|
5102
|
+
metadata: 0,
|
|
5103
|
+
},
|
|
5104
|
+
{},
|
|
5105
|
+
],
|
|
5106
|
+
[
|
|
5107
|
+
'authorize',
|
|
5108
|
+
'POST',
|
|
5109
|
+
'/ledger_operations',
|
|
5110
|
+
'/authorize',
|
|
5111
|
+
false,
|
|
5112
|
+
null,
|
|
5113
|
+
true,
|
|
5114
|
+
{
|
|
5115
|
+
metadata: 0,
|
|
5116
|
+
},
|
|
5117
|
+
{},
|
|
5118
|
+
],
|
|
5119
|
+
[
|
|
5120
|
+
'captureAuthorization',
|
|
5121
|
+
'POST',
|
|
5122
|
+
'/ledger_operations',
|
|
5123
|
+
'/capture_authorization',
|
|
5124
|
+
false,
|
|
5125
|
+
null,
|
|
5126
|
+
true,
|
|
5127
|
+
{
|
|
5128
|
+
metadata: 0,
|
|
5129
|
+
},
|
|
5130
|
+
{},
|
|
5131
|
+
],
|
|
5132
|
+
[
|
|
5133
|
+
'releaseAuthorization',
|
|
5134
|
+
'POST',
|
|
5135
|
+
'/ledger_operations',
|
|
5136
|
+
'/release_authorization',
|
|
5137
|
+
false,
|
|
5138
|
+
null,
|
|
5139
|
+
true,
|
|
5140
|
+
{
|
|
5141
|
+
metadata: 0,
|
|
5142
|
+
},
|
|
5143
|
+
{},
|
|
5144
|
+
],
|
|
5145
|
+
],
|
|
5146
|
+
grantBlock: [
|
|
5147
|
+
[
|
|
5148
|
+
'listGrantBlocks',
|
|
5149
|
+
'GET',
|
|
5150
|
+
'/grant_blocks',
|
|
5151
|
+
null,
|
|
5152
|
+
false,
|
|
5153
|
+
null,
|
|
5154
|
+
false,
|
|
5155
|
+
{},
|
|
5156
|
+
{},
|
|
5157
|
+
],
|
|
5158
|
+
],
|
|
5159
|
+
promotionalGrant: [
|
|
5160
|
+
[
|
|
5161
|
+
'promotionalGrants',
|
|
5162
|
+
'POST',
|
|
5163
|
+
'/promotional_grants',
|
|
5164
|
+
null,
|
|
5165
|
+
false,
|
|
5166
|
+
null,
|
|
5167
|
+
true,
|
|
5168
|
+
{
|
|
5169
|
+
metadata: 0,
|
|
5170
|
+
},
|
|
5171
|
+
{
|
|
5172
|
+
isIdempotent: true,
|
|
5173
|
+
},
|
|
5174
|
+
],
|
|
5175
|
+
],
|
|
5058
5176
|
impactedCustomer: [],
|
|
5059
5177
|
subscriptionEntitlementsUpdatedDetail: [],
|
|
5060
5178
|
subscriptionEntitlementsCreatedDetail: [],
|
|
@@ -108,12 +108,14 @@ var WebhookEventType;
|
|
|
108
108
|
WebhookEventType["OmnichannelSubscriptionItemPauseScheduled"] = "omnichannel_subscription_item_pause_scheduled";
|
|
109
109
|
WebhookEventType["OmnichannelSubscriptionItemPaused"] = "omnichannel_subscription_item_paused";
|
|
110
110
|
WebhookEventType["OmnichannelSubscriptionItemReactivated"] = "omnichannel_subscription_item_reactivated";
|
|
111
|
+
WebhookEventType["OmnichannelSubscriptionItemRecovered"] = "omnichannel_subscription_item_recovered";
|
|
111
112
|
WebhookEventType["OmnichannelSubscriptionItemRenewed"] = "omnichannel_subscription_item_renewed";
|
|
112
113
|
WebhookEventType["OmnichannelSubscriptionItemResubscribed"] = "omnichannel_subscription_item_resubscribed";
|
|
113
114
|
WebhookEventType["OmnichannelSubscriptionItemResumed"] = "omnichannel_subscription_item_resumed";
|
|
114
115
|
WebhookEventType["OmnichannelSubscriptionItemScheduledCancellationRemoved"] = "omnichannel_subscription_item_scheduled_cancellation_removed";
|
|
115
116
|
WebhookEventType["OmnichannelSubscriptionItemScheduledChangeRemoved"] = "omnichannel_subscription_item_scheduled_change_removed";
|
|
116
117
|
WebhookEventType["OmnichannelSubscriptionItemScheduledDowngradeRemoved"] = "omnichannel_subscription_item_scheduled_downgrade_removed";
|
|
118
|
+
WebhookEventType["OmnichannelSubscriptionItemUpdated"] = "omnichannel_subscription_item_updated";
|
|
117
119
|
WebhookEventType["OmnichannelSubscriptionItemUpgraded"] = "omnichannel_subscription_item_upgraded";
|
|
118
120
|
WebhookEventType["OmnichannelSubscriptionMovedIn"] = "omnichannel_subscription_moved_in";
|
|
119
121
|
WebhookEventType["OmnichannelTransactionCreated"] = "omnichannel_transaction_created";
|
package/esm/RequestWrapper.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { extend, callbackifyPromise, getApiURL, encodeListParams, encodeParams, serialize, getHost, log, generateUUIDv4 as uuidv4, } from './util.js';
|
|
2
2
|
import { handleResponse } from './coreCommon.js';
|
|
3
3
|
import { Buffer } from 'node:buffer';
|
|
4
|
-
import { ChargebeeZodValidationError } from './chargebeeZodValidationError.js';
|
|
5
|
-
import { getSchema } from './validationLoader.js';
|
|
6
4
|
export class RequestWrapper {
|
|
7
5
|
constructor(args, apiCall, envArg) {
|
|
8
6
|
this.getRequest = () => {
|
|
@@ -22,17 +20,6 @@ export class RequestWrapper {
|
|
|
22
20
|
}
|
|
23
21
|
return idParam;
|
|
24
22
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Validate parameters against the action's Zod schema when enableValidation is true.
|
|
27
|
-
* Query params are validated as `params ?? {}`; body params are validated when `params` is non-null.
|
|
28
|
-
* Throws a descriptive error listing every validation violation.
|
|
29
|
-
*/
|
|
30
|
-
static _validateParams(params, schema, actionName) {
|
|
31
|
-
const result = schema.safeParse(params);
|
|
32
|
-
if (!result.success) {
|
|
33
|
-
throw new ChargebeeZodValidationError(actionName, result.error);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
23
|
static parseRetryAfter(retryAfter) {
|
|
37
24
|
if (!retryAfter)
|
|
38
25
|
return null;
|
|
@@ -52,20 +39,6 @@ export class RequestWrapper {
|
|
|
52
39
|
? this.args[1]
|
|
53
40
|
: this.args[0];
|
|
54
41
|
let headers = this.apiCall.hasIdInUrl ? this.args[2] : this.args[1];
|
|
55
|
-
// Lazy-load Zod schema when enableValidation is true
|
|
56
|
-
if (env.enableValidation &&
|
|
57
|
-
this.apiCall.resourceKey &&
|
|
58
|
-
this.apiCall.actionName) {
|
|
59
|
-
const schema = await getSchema(this.apiCall.resourceKey, this.apiCall.actionName);
|
|
60
|
-
if (schema) {
|
|
61
|
-
if (this.apiCall.httpMethod === 'GET') {
|
|
62
|
-
RequestWrapper._validateParams(params !== null && params !== void 0 ? params : {}, schema, this.apiCall.methodName);
|
|
63
|
-
}
|
|
64
|
-
else if (params != null) {
|
|
65
|
-
RequestWrapper._validateParams(params, schema, this.apiCall.methodName);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
42
|
Object.assign(this.httpHeaders, headers);
|
|
70
43
|
if (this.apiCall.httpMethod === 'POST' &&
|
|
71
44
|
!this.httpHeaders['chargebee-idempotency-key'] &&
|
|
@@ -97,7 +70,7 @@ export class RequestWrapper {
|
|
|
97
70
|
const requestHeaders = Object.assign({}, this.httpHeaders);
|
|
98
71
|
if (data && data.length) {
|
|
99
72
|
extend(true, requestHeaders, {
|
|
100
|
-
'Content-Length': data
|
|
73
|
+
'Content-Length': Buffer.byteLength(data, 'utf8'),
|
|
101
74
|
});
|
|
102
75
|
}
|
|
103
76
|
const contentType = this.apiCall.isJsonRequest
|
package/esm/chargebee.esm.js
CHANGED
|
@@ -7,5 +7,3 @@ export default Chargebee;
|
|
|
7
7
|
export { WebhookEventType, WebhookContentType, } from './resources/webhook/handler.js';
|
|
8
8
|
export { basicAuthValidator } from './resources/webhook/auth.js';
|
|
9
9
|
export { WebhookError, WebhookAuthenticationError, WebhookPayloadValidationError, WebhookPayloadParseError, } from './resources/webhook/handler.js';
|
|
10
|
-
// Export validation error class
|
|
11
|
-
export { ChargebeeZodValidationError } from './chargebeeZodValidationError.js';
|
|
@@ -7,4 +7,3 @@ export default Chargebee;
|
|
|
7
7
|
export { WebhookEventType, WebhookContentType, } from './resources/webhook/handler.js';
|
|
8
8
|
export { basicAuthValidator } from './resources/webhook/auth.js';
|
|
9
9
|
export { WebhookError, WebhookAuthenticationError, WebhookPayloadValidationError, WebhookPayloadParseError, } from './resources/webhook/handler.js';
|
|
10
|
-
export { ChargebeeZodValidationError } from './chargebeeZodValidationError.js';
|
package/esm/createChargebee.js
CHANGED
|
@@ -93,11 +93,6 @@ export const CreateChargebee = (httpClient) => {
|
|
|
93
93
|
jsonKeys: metaArr[7],
|
|
94
94
|
options: metaArr[8],
|
|
95
95
|
};
|
|
96
|
-
if (this._env.enableValidation) {
|
|
97
|
-
// Store resource and action for lazy schema loading in RequestWrapper
|
|
98
|
-
apiCall.resourceKey = res;
|
|
99
|
-
apiCall.actionName = metaArr[0];
|
|
100
|
-
}
|
|
101
96
|
this[res][apiCall.methodName] = this._createApiFunc(apiCall, this._env);
|
|
102
97
|
}
|
|
103
98
|
}
|
package/esm/environment.js
CHANGED
|
@@ -8,7 +8,7 @@ export const Environment = {
|
|
|
8
8
|
hostSuffix: '.chargebee.com',
|
|
9
9
|
apiPath: '/api/v2',
|
|
10
10
|
timeout: DEFAULT_TIME_OUT,
|
|
11
|
-
clientVersion: 'v3.
|
|
11
|
+
clientVersion: 'v3.26.0',
|
|
12
12
|
port: DEFAULT_PORT,
|
|
13
13
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
14
14
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|