chargebee 3.25.0-beta.1 → 3.25.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.
Files changed (166) hide show
  1. package/CHANGELOG.md +66 -4
  2. package/README.md +0 -39
  3. package/cjs/RequestWrapper.js +1 -28
  4. package/cjs/chargebee.cjs.js +0 -3
  5. package/cjs/chargebee.cjs.worker.js +0 -2
  6. package/cjs/createChargebee.js +0 -5
  7. package/cjs/environment.js +1 -1
  8. package/cjs/resources/api_endpoints.js +1 -2
  9. package/cjs/resources/webhook/eventType.js +2 -0
  10. package/esm/RequestWrapper.js +1 -28
  11. package/esm/chargebee.esm.js +0 -2
  12. package/esm/chargebee.esm.worker.js +0 -1
  13. package/esm/createChargebee.js +0 -5
  14. package/esm/environment.js +1 -1
  15. package/esm/resources/api_endpoints.js +1 -2
  16. package/esm/resources/webhook/eventType.js +2 -0
  17. package/package.json +1 -4
  18. package/types/core.d.ts +23 -6
  19. package/types/index.d.ts +0 -17
  20. package/types/resources/Content.d.ts +0 -1
  21. package/types/resources/Customer.d.ts +14 -4
  22. package/types/resources/Estimate.d.ts +14 -4
  23. package/types/resources/Event.d.ts +2 -0
  24. package/types/resources/Gift.d.ts +23 -6
  25. package/types/resources/HostedPage.d.ts +1 -0
  26. package/types/resources/Invoice.d.ts +14 -5
  27. package/types/resources/OmnichannelSubscription.d.ts +6 -0
  28. package/types/resources/OmnichannelSubscriptionItem.d.ts +1 -0
  29. package/types/resources/PaymentIntent.d.ts +35 -10
  30. package/types/resources/PaymentSource.d.ts +7 -2
  31. package/types/resources/Purchase.d.ts +7 -2
  32. package/types/resources/Subscription.d.ts +49 -14
  33. package/types/resources/WebhookEvent.d.ts +22 -4
  34. package/cjs/chargebeeZodValidationError.js +0 -18
  35. package/cjs/schema/addon.schema.js +0 -153
  36. package/cjs/schema/address.schema.js +0 -35
  37. package/cjs/schema/alert.schema.js +0 -38
  38. package/cjs/schema/attached_item.schema.js +0 -58
  39. package/cjs/schema/business_entity.schema.js +0 -46
  40. package/cjs/schema/card.schema.js +0 -165
  41. package/cjs/schema/comment.schema.js +0 -69
  42. package/cjs/schema/coupon.schema.js +0 -209
  43. package/cjs/schema/coupon_code.schema.js +0 -14
  44. package/cjs/schema/coupon_set.schema.js +0 -28
  45. package/cjs/schema/credit_note.schema.js +0 -288
  46. package/cjs/schema/currency.schema.js +0 -32
  47. package/cjs/schema/customer.schema.js +0 -986
  48. package/cjs/schema/customer_entitlement.schema.js +0 -14
  49. package/cjs/schema/differential_price.schema.js +0 -68
  50. package/cjs/schema/entitlement.schema.js +0 -27
  51. package/cjs/schema/entitlement_override.schema.js +0 -33
  52. package/cjs/schema/estimate.schema.js +0 -1525
  53. package/cjs/schema/export.schema.js +0 -1545
  54. package/cjs/schema/feature.schema.js +0 -37
  55. package/cjs/schema/gift.schema.js +0 -277
  56. package/cjs/schema/hosted_page.schema.js +0 -1649
  57. package/cjs/schema/in_app_subscription.schema.js +0 -68
  58. package/cjs/schema/index.js +0 -80
  59. package/cjs/schema/invoice.schema.js +0 -1467
  60. package/cjs/schema/item.schema.js +0 -91
  61. package/cjs/schema/item_entitlement.schema.js +0 -45
  62. package/cjs/schema/item_family.schema.js +0 -21
  63. package/cjs/schema/item_price.schema.js +0 -190
  64. package/cjs/schema/non_subscription.schema.js +0 -28
  65. package/cjs/schema/offer_event.schema.js +0 -13
  66. package/cjs/schema/offer_fulfillment.schema.js +0 -20
  67. package/cjs/schema/omnichannel_one_time_order.schema.js +0 -26
  68. package/cjs/schema/omnichannel_subscription.schema.js +0 -89
  69. package/cjs/schema/omnichannel_subscription_item.schema.js +0 -13
  70. package/cjs/schema/order.schema.js +0 -273
  71. package/cjs/schema/payment_intent.schema.js +0 -117
  72. package/cjs/schema/payment_schedule_scheme.schema.js +0 -20
  73. package/cjs/schema/payment_source.schema.js +0 -358
  74. package/cjs/schema/payment_voucher.schema.js +0 -57
  75. package/cjs/schema/personalized_offer.schema.js +0 -28
  76. package/cjs/schema/plan.schema.js +0 -225
  77. package/cjs/schema/portal_session.schema.js +0 -22
  78. package/cjs/schema/price_variant.schema.js +0 -36
  79. package/cjs/schema/pricing_page_session.schema.js +0 -135
  80. package/cjs/schema/promotional_credit.schema.js +0 -78
  81. package/cjs/schema/purchase.schema.js +0 -272
  82. package/cjs/schema/quote.schema.js +0 -1557
  83. package/cjs/schema/ramp.schema.js +0 -209
  84. package/cjs/schema/recorded_purchase.schema.js +0 -32
  85. package/cjs/schema/resource_migration.schema.js +0 -14
  86. package/cjs/schema/site_migration_detail.schema.js +0 -81
  87. package/cjs/schema/subscription.schema.js +0 -2993
  88. package/cjs/schema/subscription_entitlement.schema.js +0 -25
  89. package/cjs/schema/time_machine.schema.js +0 -17
  90. package/cjs/schema/transaction.schema.js +0 -70
  91. package/cjs/schema/unbilled_charge.schema.js +0 -113
  92. package/cjs/schema/usage.schema.js +0 -93
  93. package/cjs/schema/usage_charge.schema.js +0 -17
  94. package/cjs/schema/usage_event.schema.js +0 -28
  95. package/cjs/schema/usage_file.schema.js +0 -13
  96. package/cjs/schema/usage_summary.schema.js +0 -17
  97. package/cjs/schema/virtual_bank_account.schema.js +0 -43
  98. package/cjs/schema/webhook_endpoint.schema.js +0 -504
  99. package/cjs/validationLoader.js +0 -59
  100. package/esm/chargebeeZodValidationError.js +0 -14
  101. package/esm/schema/addon.schema.js +0 -150
  102. package/esm/schema/address.schema.js +0 -32
  103. package/esm/schema/alert.schema.js +0 -35
  104. package/esm/schema/attached_item.schema.js +0 -55
  105. package/esm/schema/business_entity.schema.js +0 -43
  106. package/esm/schema/card.schema.js +0 -162
  107. package/esm/schema/comment.schema.js +0 -66
  108. package/esm/schema/coupon.schema.js +0 -206
  109. package/esm/schema/coupon_code.schema.js +0 -11
  110. package/esm/schema/coupon_set.schema.js +0 -25
  111. package/esm/schema/credit_note.schema.js +0 -285
  112. package/esm/schema/currency.schema.js +0 -29
  113. package/esm/schema/customer.schema.js +0 -983
  114. package/esm/schema/customer_entitlement.schema.js +0 -11
  115. package/esm/schema/differential_price.schema.js +0 -65
  116. package/esm/schema/entitlement.schema.js +0 -24
  117. package/esm/schema/entitlement_override.schema.js +0 -30
  118. package/esm/schema/estimate.schema.js +0 -1522
  119. package/esm/schema/export.schema.js +0 -1542
  120. package/esm/schema/feature.schema.js +0 -34
  121. package/esm/schema/gift.schema.js +0 -274
  122. package/esm/schema/hosted_page.schema.js +0 -1646
  123. package/esm/schema/in_app_subscription.schema.js +0 -65
  124. package/esm/schema/index.js +0 -64
  125. package/esm/schema/invoice.schema.js +0 -1464
  126. package/esm/schema/item.schema.js +0 -88
  127. package/esm/schema/item_entitlement.schema.js +0 -42
  128. package/esm/schema/item_family.schema.js +0 -18
  129. package/esm/schema/item_price.schema.js +0 -187
  130. package/esm/schema/non_subscription.schema.js +0 -25
  131. package/esm/schema/offer_event.schema.js +0 -10
  132. package/esm/schema/offer_fulfillment.schema.js +0 -17
  133. package/esm/schema/omnichannel_one_time_order.schema.js +0 -23
  134. package/esm/schema/omnichannel_subscription.schema.js +0 -86
  135. package/esm/schema/omnichannel_subscription_item.schema.js +0 -10
  136. package/esm/schema/order.schema.js +0 -270
  137. package/esm/schema/payment_intent.schema.js +0 -114
  138. package/esm/schema/payment_schedule_scheme.schema.js +0 -17
  139. package/esm/schema/payment_source.schema.js +0 -355
  140. package/esm/schema/payment_voucher.schema.js +0 -54
  141. package/esm/schema/personalized_offer.schema.js +0 -25
  142. package/esm/schema/plan.schema.js +0 -222
  143. package/esm/schema/portal_session.schema.js +0 -19
  144. package/esm/schema/price_variant.schema.js +0 -33
  145. package/esm/schema/pricing_page_session.schema.js +0 -132
  146. package/esm/schema/promotional_credit.schema.js +0 -75
  147. package/esm/schema/purchase.schema.js +0 -269
  148. package/esm/schema/quote.schema.js +0 -1554
  149. package/esm/schema/ramp.schema.js +0 -206
  150. package/esm/schema/recorded_purchase.schema.js +0 -29
  151. package/esm/schema/resource_migration.schema.js +0 -11
  152. package/esm/schema/site_migration_detail.schema.js +0 -78
  153. package/esm/schema/subscription.schema.js +0 -2990
  154. package/esm/schema/subscription_entitlement.schema.js +0 -22
  155. package/esm/schema/time_machine.schema.js +0 -14
  156. package/esm/schema/transaction.schema.js +0 -67
  157. package/esm/schema/unbilled_charge.schema.js +0 -110
  158. package/esm/schema/usage.schema.js +0 -90
  159. package/esm/schema/usage_charge.schema.js +0 -14
  160. package/esm/schema/usage_event.schema.js +0 -25
  161. package/esm/schema/usage_file.schema.js +0 -10
  162. package/esm/schema/usage_summary.schema.js +0 -14
  163. package/esm/schema/virtual_bank_account.schema.js +0 -40
  164. package/esm/schema/webhook_endpoint.schema.js +0 -501
  165. package/esm/validationLoader.js +0 -56
  166. package/types/resources/QuoteEntitlement.d.ts +0 -16
package/CHANGELOG.md CHANGED
@@ -1,9 +1,71 @@
1
- ### v3.25.0-beta.1 (2026-05-14)
1
+ ### v3.25.0 (2026-06-08)
2
2
  * * *
3
+ ### New Attributes:
4
+ - [`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).
5
+ - [`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).
6
+ - [`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).
7
+
8
+
9
+ ### New Parameters:
10
+ - [`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).
11
+ - [`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).
12
+ - [`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).
13
+ - [`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).
14
+ - [`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).
15
+ - [`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).
16
+ - [`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).
17
+ - [`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).
18
+
19
+
20
+ ### Parameter Updates:
21
+ - [`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).
22
+
23
+
24
+ ### New Events:
25
+ - [`omnichannel_subscription_item_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/omnichannel_subscription_item_updated) has been added.
26
+ - [`omnichannel_subscription_item_recovered`](https://apidocs.chargebee.com/docs/api/events/webhook/omnichannel_subscription_item_recovered) has been added.
27
+
28
+
29
+ ### Deleted Resources:
30
+ - QuoteEntitlement has been removed.
31
+
3
32
 
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.
33
+ ### Deleted Attributes:
34
+ - `entity_id` has been removed from `QuoteEntitlement`.
35
+ - `entity_type` has been removed from `QuoteEntitlement`.
36
+ - `feature_id` has been removed from `QuoteEntitlement`.
37
+ - `value` has been removed from `QuoteEntitlement`.
38
+ - `is_enabled` has been removed from `QuoteEntitlement`.
39
+ - `start_date` has been removed from `QuoteEntitlement`.
40
+ - `end_date` has been removed from `QuoteEntitlement`.
41
+ - `created_at` has been removed from `QuoteEntitlement`.
42
+ - `modified_at` has been removed from `QuoteEntitlement`.
43
+
44
+
45
+ ### Deleted Parameters:
46
+ - `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).
47
+
48
+
49
+ ### New Enums:
50
+ - `omnichannel_subscription_item_updated` and `omnichannel_subscription_item_recovered` have been added as new values enum `EventType`.
51
+ - `klarna`, `alipay_hk`, `paypay`, `gcash`, and `south_korean_cards` have been added as new values enum `PaymentMethod`.
52
+ - `klarna`, `alipay_hk`, `paypay`, `gcash`, and `south_korean_cards` have been added as new values enum `PaymentMethodType`.
53
+ - `klarna`, `alipay_hk`, `paypay`, `gcash`, and `south_korean_cards` have been added as new values enum `Type`.
54
+ - `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).
55
+ - `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).
56
+ - `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).
57
+ - `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).
58
+
59
+
60
+
61
+ ### v3.24.1 (2026-06-03)
62
+ * * *
63
+ ### Bug Fixes:
64
+ - 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.
65
+
66
+ ### Tests:
67
+ - ASCII form-urlencoded body — `Content-Length` matches the UTF-8 byte length of the serialized body.
68
+ - 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
69
 
8
70
 
9
71
  ### 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.
@@ -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.length,
76
+ 'Content-Length': node_buffer_1.Buffer.byteLength(data, 'utf8'),
104
77
  });
105
78
  }
106
79
  const contentType = this.apiCall.isJsonRequest
@@ -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;
@@ -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
  }
@@ -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.25.0-beta.1',
14
+ clientVersion: 'v3.25.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',
@@ -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";
@@ -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.length,
73
+ 'Content-Length': Buffer.byteLength(data, 'utf8'),
101
74
  });
102
75
  }
103
76
  const contentType = this.apiCall.isJsonRequest
@@ -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';
@@ -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
  }
@@ -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.25.0-beta.1',
11
+ clientVersion: 'v3.25.0',
12
12
  port: DEFAULT_PORT,
13
13
  timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
14
14
  exportWaitInMillis: DEFAULT_EXPORT_WAIT,
@@ -3029,7 +3029,6 @@ export const Endpoints = {
3029
3029
  quotedDeltaRamp: [],
3030
3030
  billingConfiguration: [],
3031
3031
  quoteLineGroup: [],
3032
- quoteEntitlement: [],
3033
3032
  cpqQuoteSignature: [],
3034
3033
  plan: [
3035
3034
  [
@@ -4693,6 +4692,7 @@ export const Endpoints = {
4693
4692
  },
4694
4693
  ],
4695
4694
  ],
4695
+ omnichannelSubscriptionItemScheduledChange: [],
4696
4696
  omnichannelSubscription: [
4697
4697
  [
4698
4698
  'retrieve',
@@ -4825,7 +4825,6 @@ export const Endpoints = {
4825
4825
  {},
4826
4826
  ],
4827
4827
  ],
4828
- omnichannelSubscriptionItemScheduledChange: [],
4829
4828
  usageFile: [
4830
4829
  [
4831
4830
  'uploadUrl',
@@ -105,12 +105,14 @@ export var WebhookEventType;
105
105
  WebhookEventType["OmnichannelSubscriptionItemPauseScheduled"] = "omnichannel_subscription_item_pause_scheduled";
106
106
  WebhookEventType["OmnichannelSubscriptionItemPaused"] = "omnichannel_subscription_item_paused";
107
107
  WebhookEventType["OmnichannelSubscriptionItemReactivated"] = "omnichannel_subscription_item_reactivated";
108
+ WebhookEventType["OmnichannelSubscriptionItemRecovered"] = "omnichannel_subscription_item_recovered";
108
109
  WebhookEventType["OmnichannelSubscriptionItemRenewed"] = "omnichannel_subscription_item_renewed";
109
110
  WebhookEventType["OmnichannelSubscriptionItemResubscribed"] = "omnichannel_subscription_item_resubscribed";
110
111
  WebhookEventType["OmnichannelSubscriptionItemResumed"] = "omnichannel_subscription_item_resumed";
111
112
  WebhookEventType["OmnichannelSubscriptionItemScheduledCancellationRemoved"] = "omnichannel_subscription_item_scheduled_cancellation_removed";
112
113
  WebhookEventType["OmnichannelSubscriptionItemScheduledChangeRemoved"] = "omnichannel_subscription_item_scheduled_change_removed";
113
114
  WebhookEventType["OmnichannelSubscriptionItemScheduledDowngradeRemoved"] = "omnichannel_subscription_item_scheduled_downgrade_removed";
115
+ WebhookEventType["OmnichannelSubscriptionItemUpdated"] = "omnichannel_subscription_item_updated";
114
116
  WebhookEventType["OmnichannelSubscriptionItemUpgraded"] = "omnichannel_subscription_item_upgraded";
115
117
  WebhookEventType["OmnichannelSubscriptionMovedIn"] = "omnichannel_subscription_moved_in";
116
118
  WebhookEventType["OmnichannelTransactionCreated"] = "omnichannel_transaction_created";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chargebee",
3
- "version": "3.25.0-beta.1",
3
+ "version": "3.25.0",
4
4
  "description": "A library for integrating with Chargebee.",
5
5
  "scripts": {
6
6
  "prepack": "npm install && npm run build",
@@ -75,8 +75,5 @@
75
75
  "semi": true,
76
76
  "singleQuote": true,
77
77
  "parser": "typescript"
78
- },
79
- "dependencies": {
80
- "zod": "^4.3.6"
81
78
  }
82
79
  }
package/types/core.d.ts CHANGED
@@ -5,8 +5,6 @@ declare module 'chargebee' {
5
5
  timeout?: number;
6
6
  timemachineWaitInMillis?: number;
7
7
  exportWaitInMillis?: number;
8
- /** When true, request parameters are validated against Zod schemas before each HTTP call (where a schema exists). */
9
- enableValidation?: boolean;
10
8
  }
11
9
  export type ChargebeeResponse<T> = T & {
12
10
  headers: { [key: string]: string };
@@ -370,6 +368,8 @@ declare module 'chargebee' {
370
368
  | 'omnichannel_subscription_moved_in'
371
369
  | 'omnichannel_transaction_created'
372
370
  | 'alert_status_changed'
371
+ | 'omnichannel_subscription_item_updated'
372
+ | 'omnichannel_subscription_item_recovered'
373
373
  | 'plan_created'
374
374
  | 'plan_updated'
375
375
  | 'plan_deleted'
@@ -532,7 +532,12 @@ declare module 'chargebee' {
532
532
  | 'pay_co'
533
533
  | 'after_pay'
534
534
  | 'swish'
535
- | 'payme';
535
+ | 'payme'
536
+ | 'klarna'
537
+ | 'alipay_hk'
538
+ | 'paypay'
539
+ | 'gcash'
540
+ | 'south_korean_cards';
536
541
  type PaymentMethodSavePolicyEnum = 'always' | 'ask' | 'never';
537
542
  type PaymentMethodTypeEnum =
538
543
  | 'card'
@@ -569,14 +574,19 @@ declare module 'chargebee' {
569
574
  | 'naver_pay'
570
575
  | 'revolut_pay'
571
576
  | 'cash_app_pay'
572
- | 'pix'
573
577
  | 'twint'
574
578
  | 'go_pay'
575
579
  | 'grab_pay'
576
580
  | 'pay_co'
577
581
  | 'after_pay'
578
582
  | 'swish'
579
- | 'payme';
583
+ | 'payme'
584
+ | 'pix'
585
+ | 'klarna'
586
+ | 'alipay_hk'
587
+ | 'paypay'
588
+ | 'gcash'
589
+ | 'south_korean_cards';
580
590
  type PaymentVoucherTypeEnum = 'boleto';
581
591
  type PeriodUnitEnum = 'day' | 'week' | 'month' | 'year';
582
592
  type PriceTypeEnum = 'tax_exclusive' | 'tax_inclusive';
@@ -679,7 +689,6 @@ declare module 'chargebee' {
679
689
  | 'naver_pay'
680
690
  | 'revolut_pay'
681
691
  | 'cash_app_pay'
682
- | 'pix'
683
692
  | 'twint'
684
693
  | 'go_pay'
685
694
  | 'grab_pay'
@@ -687,6 +696,12 @@ declare module 'chargebee' {
687
696
  | 'after_pay'
688
697
  | 'swish'
689
698
  | 'payme'
699
+ | 'pix'
700
+ | 'klarna'
701
+ | 'alipay_hk'
702
+ | 'paypay'
703
+ | 'gcash'
704
+ | 'south_korean_cards'
690
705
  | 'free_trial'
691
706
  | 'pay_up_front'
692
707
  | 'pay_as_you_go'
@@ -917,6 +932,8 @@ declare module 'chargebee' {
917
932
  | 'omnichannel_subscription_moved_in'
918
933
  | 'omnichannel_transaction_created'
919
934
  | 'alert_status_changed'
935
+ | 'omnichannel_subscription_item_updated'
936
+ | 'omnichannel_subscription_item_recovered'
920
937
  | 'plan_created'
921
938
  | 'plan_updated'
922
939
  | 'plan_deleted'
package/types/index.d.ts CHANGED
@@ -76,7 +76,6 @@
76
76
  ///<reference path='./resources/PromotionalCredit.d.ts' />
77
77
  ///<reference path='./resources/Purchase.d.ts' />
78
78
  ///<reference path='./resources/Quote.d.ts' />
79
- ///<reference path='./resources/QuoteEntitlement.d.ts' />
80
79
  ///<reference path='./resources/QuoteLineGroup.d.ts' />
81
80
  ///<reference path='./resources/QuotedCharge.d.ts' />
82
81
  ///<reference path='./resources/QuotedDeltaRamp.d.ts' />
@@ -165,11 +164,6 @@ declare module 'chargebee' {
165
164
  * @httpClient optional http client implementation, default http client will be used if not provided
166
165
  */
167
166
  httpClient?: HttpClientInterface;
168
-
169
- /**
170
- * @enableValidation When true, every request's parameters are validated against each endpoint's generated Zod schema before the HTTP request is sent. Violations throw `ChargebeeZodValidationError` with structured Zod issues. Calls with no params argument are validated as `{}`. Required resource ids in the URL path are still checked separately.
171
- */
172
- enableValidation?: boolean;
173
167
  };
174
168
 
175
169
  export interface HttpClientInterface {
@@ -449,15 +443,4 @@ declare module 'chargebee' {
449
443
  name: string;
450
444
  readonly rawBody?: string;
451
445
  }
452
-
453
- /**
454
- * Thrown when `enableValidation` is on and request parameters fail the action's Zod schema.
455
- * Carries `actionName` and the original `ZodError` (issues, `flatten()`, etc.) for programmatic handling.
456
- */
457
- export class ChargebeeZodValidationError extends Error {
458
- constructor(actionName: string, zodError: import('zod').ZodError);
459
- name: string;
460
- readonly actionName: string;
461
- readonly zodError: import('zod').ZodError;
462
- }
463
446
  }
@@ -81,7 +81,6 @@ declare module 'chargebee' {
81
81
  promotional_credit: PromotionalCredit;
82
82
  purchase: Purchase;
83
83
  quote: Quote;
84
- quote_entitlement: QuoteEntitlement;
85
84
  quote_line_group: QuoteLineGroup;
86
85
  quoted_charge: QuotedCharge;
87
86
  quoted_delta_ramp: QuotedDeltaRamp;
@@ -762,14 +762,19 @@ declare module 'chargebee' {
762
762
  | 'cash_app_pay'
763
763
  | 'wechat_pay'
764
764
  | 'alipay'
765
- | 'pix'
766
765
  | 'twint'
767
766
  | 'go_pay'
768
767
  | 'grab_pay'
769
768
  | 'pay_co'
770
769
  | 'after_pay'
771
770
  | 'swish'
772
- | 'payme';
771
+ | 'payme'
772
+ | 'pix'
773
+ | 'klarna'
774
+ | 'alipay_hk'
775
+ | 'paypay'
776
+ | 'gcash'
777
+ | 'south_korean_cards';
773
778
  reference_id?: string;
774
779
  /**
775
780
  * @deprecated Please refer API docs to use other attributes
@@ -954,14 +959,19 @@ declare module 'chargebee' {
954
959
  | 'cash_app_pay'
955
960
  | 'wechat_pay'
956
961
  | 'alipay'
957
- | 'pix'
958
962
  | 'twint'
959
963
  | 'go_pay'
960
964
  | 'grab_pay'
961
965
  | 'pay_co'
962
966
  | 'after_pay'
963
967
  | 'swish'
964
- | 'payme';
968
+ | 'payme'
969
+ | 'pix'
970
+ | 'klarna'
971
+ | 'alipay_hk'
972
+ | 'paypay'
973
+ | 'gcash'
974
+ | 'south_korean_cards';
965
975
  /**
966
976
  * @deprecated Please refer API docs to use other attributes
967
977
  */
@@ -1058,14 +1058,19 @@ declare module 'chargebee' {
1058
1058
  | 'cash_app_pay'
1059
1059
  | 'wechat_pay'
1060
1060
  | 'alipay'
1061
- | 'pix'
1062
1061
  | 'twint'
1063
1062
  | 'go_pay'
1064
1063
  | 'grab_pay'
1065
1064
  | 'pay_co'
1066
1065
  | 'after_pay'
1067
1066
  | 'swish'
1068
- | 'payme';
1067
+ | 'payme'
1068
+ | 'pix'
1069
+ | 'klarna'
1070
+ | 'alipay_hk'
1071
+ | 'paypay'
1072
+ | 'gcash'
1073
+ | 'south_korean_cards';
1069
1074
  reference_id?: string;
1070
1075
  /**
1071
1076
  * @deprecated Please refer API docs to use other attributes
@@ -1155,14 +1160,19 @@ declare module 'chargebee' {
1155
1160
  | 'cash_app_pay'
1156
1161
  | 'wechat_pay'
1157
1162
  | 'alipay'
1158
- | 'pix'
1159
1163
  | 'twint'
1160
1164
  | 'go_pay'
1161
1165
  | 'grab_pay'
1162
1166
  | 'pay_co'
1163
1167
  | 'after_pay'
1164
1168
  | 'swish'
1165
- | 'payme';
1169
+ | 'payme'
1170
+ | 'pix'
1171
+ | 'klarna'
1172
+ | 'alipay_hk'
1173
+ | 'paypay'
1174
+ | 'gcash'
1175
+ | 'south_korean_cards';
1166
1176
  reference_id?: string;
1167
1177
  /**
1168
1178
  * @deprecated Please refer API docs to use other attributes