chargebee 3.25.0 → 3.27.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 (173) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +39 -0
  3. package/cjs/RequestWrapper.js +27 -0
  4. package/cjs/chargebee.cjs.js +3 -0
  5. package/cjs/chargebee.cjs.worker.js +2 -0
  6. package/cjs/chargebeeZodValidationError.js +18 -0
  7. package/cjs/createChargebee.js +5 -0
  8. package/cjs/environment.js +1 -1
  9. package/cjs/resources/api_endpoints.js +120 -1
  10. package/cjs/schema/addon.schema.js +269 -0
  11. package/cjs/schema/address.schema.js +35 -0
  12. package/cjs/schema/alert.schema.js +74 -0
  13. package/cjs/schema/alert_status.schema.js +31 -0
  14. package/cjs/schema/attached_item.schema.js +144 -0
  15. package/cjs/schema/business_entity.schema.js +46 -0
  16. package/cjs/schema/card.schema.js +165 -0
  17. package/cjs/schema/comment.schema.js +69 -0
  18. package/cjs/schema/coupon.schema.js +323 -0
  19. package/cjs/schema/coupon_code.schema.js +49 -0
  20. package/cjs/schema/coupon_set.schema.js +88 -0
  21. package/cjs/schema/credit_note.schema.js +502 -0
  22. package/cjs/schema/currency.schema.js +32 -0
  23. package/cjs/schema/customer.schema.js +1201 -0
  24. package/cjs/schema/customer_entitlement.schema.js +14 -0
  25. package/cjs/schema/differential_price.schema.js +106 -0
  26. package/cjs/schema/entitlement.schema.js +54 -0
  27. package/cjs/schema/entitlement_override.schema.js +35 -0
  28. package/cjs/schema/estimate.schema.js +1535 -0
  29. package/cjs/schema/event.schema.js +1060 -0
  30. package/cjs/schema/export.schema.js +3385 -0
  31. package/cjs/schema/feature.schema.js +78 -0
  32. package/cjs/schema/gift.schema.js +293 -0
  33. package/cjs/schema/grant_block.schema.js +47 -0
  34. package/cjs/schema/hosted_page.schema.js +1777 -0
  35. package/cjs/schema/in_app_subscription.schema.js +68 -0
  36. package/cjs/schema/index.js +88 -0
  37. package/cjs/schema/invoice.schema.js +1685 -0
  38. package/cjs/schema/item.schema.js +195 -0
  39. package/cjs/schema/item_entitlement.schema.js +45 -0
  40. package/cjs/schema/item_family.schema.js +57 -0
  41. package/cjs/schema/item_price.schema.js +335 -0
  42. package/cjs/schema/ledger_account_balance.schema.js +21 -0
  43. package/cjs/schema/ledger_operation.schema.js +104 -0
  44. package/cjs/schema/meter.schema.js +13 -0
  45. package/cjs/schema/metered_feature.schema.js +20 -0
  46. package/cjs/schema/non_subscription.schema.js +28 -0
  47. package/cjs/schema/offer_event.schema.js +13 -0
  48. package/cjs/schema/offer_fulfillment.schema.js +20 -0
  49. package/cjs/schema/omnichannel_one_time_order.schema.js +26 -0
  50. package/cjs/schema/omnichannel_subscription.schema.js +122 -0
  51. package/cjs/schema/omnichannel_subscription_item.schema.js +13 -0
  52. package/cjs/schema/order.schema.js +441 -0
  53. package/cjs/schema/payment_intent.schema.js +127 -0
  54. package/cjs/schema/payment_schedule_scheme.schema.js +20 -0
  55. package/cjs/schema/payment_source.schema.js +630 -0
  56. package/cjs/schema/payment_voucher.schema.js +57 -0
  57. package/cjs/schema/personalized_offer.schema.js +28 -0
  58. package/cjs/schema/plan.schema.js +363 -0
  59. package/cjs/schema/portal_session.schema.js +22 -0
  60. package/cjs/schema/price_variant.schema.js +93 -0
  61. package/cjs/schema/pricing_page_session.schema.js +135 -0
  62. package/cjs/schema/promotional_credit.schema.js +78 -0
  63. package/cjs/schema/promotional_grant.schema.js +17 -0
  64. package/cjs/schema/purchase.schema.js +277 -0
  65. package/cjs/schema/quote.schema.js +1667 -0
  66. package/cjs/schema/ramp.schema.js +245 -0
  67. package/cjs/schema/recorded_purchase.schema.js +32 -0
  68. package/cjs/schema/resource_migration.schema.js +14 -0
  69. package/cjs/schema/site_migration_detail.schema.js +81 -0
  70. package/cjs/schema/subscription.schema.js +3344 -0
  71. package/cjs/schema/subscription_entitlement.schema.js +25 -0
  72. package/cjs/schema/time_machine.schema.js +17 -0
  73. package/cjs/schema/transaction.schema.js +744 -0
  74. package/cjs/schema/unbilled_charge.schema.js +139 -0
  75. package/cjs/schema/usage.schema.js +93 -0
  76. package/cjs/schema/usage_charge.schema.js +17 -0
  77. package/cjs/schema/usage_event.schema.js +28 -0
  78. package/cjs/schema/usage_file.schema.js +13 -0
  79. package/cjs/schema/usage_summary.schema.js +17 -0
  80. package/cjs/schema/virtual_bank_account.schema.js +71 -0
  81. package/cjs/schema/webhook_endpoint.schema.js +508 -0
  82. package/cjs/validationLoader.js +59 -0
  83. package/esm/RequestWrapper.js +27 -0
  84. package/esm/chargebee.esm.js +2 -0
  85. package/esm/chargebee.esm.worker.js +1 -0
  86. package/esm/chargebeeZodValidationError.js +14 -0
  87. package/esm/createChargebee.js +5 -0
  88. package/esm/environment.js +1 -1
  89. package/esm/resources/api_endpoints.js +120 -1
  90. package/esm/schema/addon.schema.js +266 -0
  91. package/esm/schema/address.schema.js +32 -0
  92. package/esm/schema/alert.schema.js +71 -0
  93. package/esm/schema/alert_status.schema.js +28 -0
  94. package/esm/schema/attached_item.schema.js +141 -0
  95. package/esm/schema/business_entity.schema.js +43 -0
  96. package/esm/schema/card.schema.js +162 -0
  97. package/esm/schema/comment.schema.js +66 -0
  98. package/esm/schema/coupon.schema.js +320 -0
  99. package/esm/schema/coupon_code.schema.js +46 -0
  100. package/esm/schema/coupon_set.schema.js +85 -0
  101. package/esm/schema/credit_note.schema.js +499 -0
  102. package/esm/schema/currency.schema.js +29 -0
  103. package/esm/schema/customer.schema.js +1198 -0
  104. package/esm/schema/customer_entitlement.schema.js +11 -0
  105. package/esm/schema/differential_price.schema.js +103 -0
  106. package/esm/schema/entitlement.schema.js +51 -0
  107. package/esm/schema/entitlement_override.schema.js +32 -0
  108. package/esm/schema/estimate.schema.js +1532 -0
  109. package/esm/schema/event.schema.js +1057 -0
  110. package/esm/schema/export.schema.js +3382 -0
  111. package/esm/schema/feature.schema.js +75 -0
  112. package/esm/schema/gift.schema.js +290 -0
  113. package/esm/schema/grant_block.schema.js +44 -0
  114. package/esm/schema/hosted_page.schema.js +1774 -0
  115. package/esm/schema/in_app_subscription.schema.js +65 -0
  116. package/esm/schema/index.js +72 -0
  117. package/esm/schema/invoice.schema.js +1682 -0
  118. package/esm/schema/item.schema.js +192 -0
  119. package/esm/schema/item_entitlement.schema.js +42 -0
  120. package/esm/schema/item_family.schema.js +54 -0
  121. package/esm/schema/item_price.schema.js +332 -0
  122. package/esm/schema/ledger_account_balance.schema.js +18 -0
  123. package/esm/schema/ledger_operation.schema.js +101 -0
  124. package/esm/schema/meter.schema.js +10 -0
  125. package/esm/schema/metered_feature.schema.js +17 -0
  126. package/esm/schema/non_subscription.schema.js +25 -0
  127. package/esm/schema/offer_event.schema.js +10 -0
  128. package/esm/schema/offer_fulfillment.schema.js +17 -0
  129. package/esm/schema/omnichannel_one_time_order.schema.js +23 -0
  130. package/esm/schema/omnichannel_subscription.schema.js +119 -0
  131. package/esm/schema/omnichannel_subscription_item.schema.js +10 -0
  132. package/esm/schema/order.schema.js +438 -0
  133. package/esm/schema/payment_intent.schema.js +124 -0
  134. package/esm/schema/payment_schedule_scheme.schema.js +17 -0
  135. package/esm/schema/payment_source.schema.js +627 -0
  136. package/esm/schema/payment_voucher.schema.js +54 -0
  137. package/esm/schema/personalized_offer.schema.js +25 -0
  138. package/esm/schema/plan.schema.js +360 -0
  139. package/esm/schema/portal_session.schema.js +19 -0
  140. package/esm/schema/price_variant.schema.js +90 -0
  141. package/esm/schema/pricing_page_session.schema.js +132 -0
  142. package/esm/schema/promotional_credit.schema.js +75 -0
  143. package/esm/schema/promotional_grant.schema.js +14 -0
  144. package/esm/schema/purchase.schema.js +274 -0
  145. package/esm/schema/quote.schema.js +1664 -0
  146. package/esm/schema/ramp.schema.js +242 -0
  147. package/esm/schema/recorded_purchase.schema.js +29 -0
  148. package/esm/schema/resource_migration.schema.js +11 -0
  149. package/esm/schema/site_migration_detail.schema.js +78 -0
  150. package/esm/schema/subscription.schema.js +3341 -0
  151. package/esm/schema/subscription_entitlement.schema.js +22 -0
  152. package/esm/schema/time_machine.schema.js +14 -0
  153. package/esm/schema/transaction.schema.js +741 -0
  154. package/esm/schema/unbilled_charge.schema.js +136 -0
  155. package/esm/schema/usage.schema.js +90 -0
  156. package/esm/schema/usage_charge.schema.js +14 -0
  157. package/esm/schema/usage_event.schema.js +25 -0
  158. package/esm/schema/usage_file.schema.js +10 -0
  159. package/esm/schema/usage_summary.schema.js +14 -0
  160. package/esm/schema/virtual_bank_account.schema.js +68 -0
  161. package/esm/schema/webhook_endpoint.schema.js +505 -0
  162. package/esm/validationLoader.js +56 -0
  163. package/package.json +4 -1
  164. package/types/core.d.ts +3 -0
  165. package/types/index.d.ts +24 -0
  166. package/types/resources/Content.d.ts +4 -0
  167. package/types/resources/CreditNote.d.ts +1 -0
  168. package/types/resources/GrantBlock.d.ts +59 -0
  169. package/types/resources/HostedPage.d.ts +5 -1
  170. package/types/resources/LedgerAccountBalance.d.ts +50 -0
  171. package/types/resources/LedgerOperation.d.ts +141 -0
  172. package/types/resources/OmnichannelSubscription.d.ts +2 -0
  173. package/types/resources/PromotionalGrant.d.ts +37 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,47 @@
1
+ ### v3.27.0 (2026-06-30)
2
+ * * *
3
+ ### Enhancements:
4
+ - **Zod-backed request validation** — Set `enableValidation: true` in the client configuration to validate outgoing request parameters against each endpoint's generated Zod schema before the API call is sent. Invalid payloads raise `ChargebeeZodValidationError`, which carries the offending `actionName` and the original `ZodError` (including `issues` and `flatten()`) for inspection.
5
+ - **Runtime dependency** — Added [`zod`](https://www.npmjs.com/package/zod) (v4) as a runtime dependency to support request validation.
6
+
7
+
8
+ ### v3.26.0 (2026-06-12)
9
+ * * *
10
+ ### New Resources:
11
+ - [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks) has been added.
12
+ - [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances) has been added.
13
+ - [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations) has been added.
14
+ - [`PromotionalGrant`](https://apidocs.chargebee.com/docs/api/promotional_grants) has been added.
15
+
16
+
17
+ ### New Attributes:
18
+ - [`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).
19
+ - [`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).
20
+
21
+
22
+ ### New Parameters:
23
+ - [`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).
24
+
25
+
26
+ ### New Enums:
27
+ - `available`, `exhausted`, `scheduled`, and `in_grace_period` have been added as new values enum `Status`.
28
+ - `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).
29
+ - `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).
30
+ - `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).
31
+ - `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).
32
+ - `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).
33
+ - `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).
34
+ - `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).
35
+ - `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).
36
+ - `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).
37
+ - `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).
38
+ - `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).
39
+ - `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).
40
+ - `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).
41
+ - `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).
42
+
43
+
44
+
1
45
  ### v3.25.0 (2026-06-08)
2
46
  * * *
3
47
  ### New Attributes:
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.
@@ -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'] &&
@@ -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;
@@ -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
  }
@@ -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',
14
+ clientVersion: 'v3.27.0',
15
15
  port: DEFAULT_PORT,
16
16
  timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
17
17
  exportWaitInMillis: DEFAULT_EXPORT_WAIT,
@@ -4887,7 +4887,7 @@ exports.Endpoints = {
4887
4887
  null,
4888
4888
  true,
4889
4889
  'grow',
4890
- true,
4890
+ false,
4891
4891
  {},
4892
4892
  {},
4893
4893
  ],
@@ -5054,6 +5054,125 @@ exports.Endpoints = {
5054
5054
  {},
5055
5055
  ],
5056
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
+ ],
5057
5176
  impactedCustomer: [],
5058
5177
  subscriptionEntitlementsUpdatedDetail: [],
5059
5178
  subscriptionEntitlementsCreatedDetail: [],
@@ -0,0 +1,269 @@
1
+ "use strict";
2
+ // Generated Zod schemas: Addon
3
+ // Actions: create, update, list, copy
4
+ // Do not edit manually – regenerate via sdk-generator
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CopyAddonBodySchema = exports.ListAddonBodySchema = 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.list
147
+ const ListAddonIdSchema = zod_1.z.object({
148
+ is: zod_1.z.string().min(1).optional(),
149
+ is_not: zod_1.z.string().min(1).optional(),
150
+ starts_with: zod_1.z.string().min(1).optional(),
151
+ in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
152
+ not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
153
+ });
154
+ const ListAddonNameSchema = zod_1.z.object({
155
+ is: zod_1.z.string().min(1).optional(),
156
+ is_not: zod_1.z.string().min(1).optional(),
157
+ starts_with: zod_1.z.string().min(1).optional(),
158
+ in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
159
+ not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
160
+ });
161
+ const ListAddonPricingModelSchema = zod_1.z.object({
162
+ is: zod_1.z
163
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
164
+ .optional(),
165
+ is_not: zod_1.z
166
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
167
+ .optional(),
168
+ in: zod_1.z
169
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
170
+ .optional(),
171
+ not_in: zod_1.z
172
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
173
+ .optional(),
174
+ });
175
+ const ListAddonTypeSchema = zod_1.z.object({
176
+ is: zod_1.z
177
+ .enum(['on_off', 'quantity', 'tiered', 'volume', 'stairstep'])
178
+ .optional(),
179
+ is_not: zod_1.z
180
+ .enum(['on_off', 'quantity', 'tiered', 'volume', 'stairstep'])
181
+ .optional(),
182
+ in: zod_1.z
183
+ .enum(['on_off', 'quantity', 'tiered', 'volume', 'stairstep'])
184
+ .optional(),
185
+ not_in: zod_1.z
186
+ .enum(['on_off', 'quantity', 'tiered', 'volume', 'stairstep'])
187
+ .optional(),
188
+ });
189
+ const ListAddonChargeTypeSchema = zod_1.z.object({
190
+ is: zod_1.z.enum(['recurring', 'non_recurring']).optional(),
191
+ is_not: zod_1.z.enum(['recurring', 'non_recurring']).optional(),
192
+ in: zod_1.z.enum(['recurring', 'non_recurring']).optional(),
193
+ not_in: zod_1.z.enum(['recurring', 'non_recurring']).optional(),
194
+ });
195
+ const ListAddonPriceSchema = zod_1.z.object({
196
+ is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
197
+ is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
198
+ lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
199
+ lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
200
+ gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
201
+ gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
202
+ between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
203
+ });
204
+ const ListAddonPeriodSchema = zod_1.z.object({
205
+ is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
206
+ is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
207
+ lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
208
+ lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
209
+ gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
210
+ gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
211
+ between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
212
+ });
213
+ const ListAddonPeriodUnitSchema = zod_1.z.object({
214
+ is: zod_1.z.enum(['day', 'week', 'month', 'year', 'not_applicable']).optional(),
215
+ is_not: zod_1.z.enum(['day', 'week', 'month', 'year', 'not_applicable']).optional(),
216
+ in: zod_1.z.enum(['day', 'week', 'month', 'year', 'not_applicable']).optional(),
217
+ not_in: zod_1.z.enum(['day', 'week', 'month', 'year', 'not_applicable']).optional(),
218
+ });
219
+ const ListAddonStatusSchema = zod_1.z.object({
220
+ is: zod_1.z.enum(['active', 'archived', 'deleted']).optional(),
221
+ is_not: zod_1.z.enum(['active', 'archived', 'deleted']).optional(),
222
+ in: zod_1.z.enum(['active', 'archived', 'deleted']).optional(),
223
+ not_in: zod_1.z.enum(['active', 'archived', 'deleted']).optional(),
224
+ });
225
+ const ListAddonUpdatedAtSchema = zod_1.z.object({
226
+ after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
227
+ before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
228
+ on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
229
+ between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
230
+ });
231
+ const ListAddonCurrencyCodeSchema = zod_1.z.object({
232
+ is: zod_1.z.string().min(1).optional(),
233
+ is_not: zod_1.z.string().min(1).optional(),
234
+ starts_with: zod_1.z.string().min(1).optional(),
235
+ in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
236
+ not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
237
+ });
238
+ const ListAddonChannelSchema = zod_1.z.object({
239
+ is: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
240
+ is_not: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
241
+ in: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
242
+ not_in: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
243
+ });
244
+ const ListAddonBodySchema = zod_1.z.looseObject({
245
+ limit: zod_1.z.number().int().min(1).max(100).optional(),
246
+ offset: zod_1.z.string().max(1000).optional(),
247
+ id: ListAddonIdSchema.optional(),
248
+ name: ListAddonNameSchema.optional(),
249
+ pricing_model: ListAddonPricingModelSchema.optional(),
250
+ type: ListAddonTypeSchema.optional(),
251
+ charge_type: ListAddonChargeTypeSchema.optional(),
252
+ price: ListAddonPriceSchema.optional(),
253
+ period: ListAddonPeriodSchema.optional(),
254
+ period_unit: ListAddonPeriodUnitSchema.optional(),
255
+ status: ListAddonStatusSchema.optional(),
256
+ updated_at: ListAddonUpdatedAtSchema.optional(),
257
+ currency_code: ListAddonCurrencyCodeSchema.optional(),
258
+ channel: ListAddonChannelSchema.optional(),
259
+ include_deleted: zod_1.z.boolean().default(false).optional(),
260
+ });
261
+ exports.ListAddonBodySchema = ListAddonBodySchema;
262
+ //Addon.copy
263
+ const CopyAddonBodySchema = zod_1.z.looseObject({
264
+ from_site: zod_1.z.string().max(50),
265
+ id_at_from_site: zod_1.z.string().max(100),
266
+ id: zod_1.z.string().max(100).optional(),
267
+ for_site_merging: zod_1.z.boolean().default(false).optional(),
268
+ });
269
+ 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;