chargebee 3.34.0 → 3.36.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 (198) hide show
  1. package/CHANGELOG.md +237 -0
  2. package/cjs/environment.js +1 -1
  3. package/cjs/resources/api_endpoints.js +230 -2
  4. package/cjs/resources/webhook/eventType.js +25 -1
  5. package/cjs/schema/addon.schema.js +221 -40
  6. package/cjs/schema/alert.schema.js +17 -2
  7. package/cjs/schema/alert_status.schema.js +6 -1
  8. package/cjs/schema/attached_item.schema.js +101 -26
  9. package/cjs/schema/business_entity.schema.js +43 -6
  10. package/cjs/schema/business_rule.schema.js +2 -2
  11. package/cjs/schema/business_ruleset.schema.js +2 -2
  12. package/cjs/schema/collections_payment_promise.schema.js +43 -0
  13. package/cjs/schema/comment.schema.js +17 -4
  14. package/cjs/schema/coupon.schema.js +218 -37
  15. package/cjs/schema/coupon_code.schema.js +36 -6
  16. package/cjs/schema/coupon_set.schema.js +108 -27
  17. package/cjs/schema/credit_note.schema.js +497 -105
  18. package/cjs/schema/credit_unit.schema.js +12 -2
  19. package/cjs/schema/customer.schema.js +212 -62
  20. package/cjs/schema/differential_price.schema.js +100 -12
  21. package/cjs/schema/dispute.schema.js +125 -33
  22. package/cjs/schema/einvoice.schema.js +27 -6
  23. package/cjs/schema/email_log.schema.js +15 -4
  24. package/cjs/schema/entitlement.schema.js +35 -6
  25. package/cjs/schema/entitlement_override.schema.js +17 -1
  26. package/cjs/schema/estimate.schema.js +585 -40
  27. package/cjs/schema/event.schema.js +1334 -585
  28. package/cjs/schema/export.schema.js +4459 -1412
  29. package/cjs/schema/feature.schema.js +73 -11
  30. package/cjs/schema/gateway_request_log.schema.js +309 -0
  31. package/cjs/schema/gateway_webhook_log.schema.js +257 -0
  32. package/cjs/schema/gift.schema.js +51 -5
  33. package/cjs/schema/grant_block.schema.js +45 -12
  34. package/cjs/schema/hosted_page.schema.js +564 -68
  35. package/cjs/schema/index.js +6 -0
  36. package/cjs/schema/invoice.schema.js +843 -123
  37. package/cjs/schema/item.schema.js +151 -28
  38. package/cjs/schema/item_entitlement.schema.js +23 -2
  39. package/cjs/schema/item_family.schema.js +29 -8
  40. package/cjs/schema/item_price.schema.js +263 -48
  41. package/cjs/schema/ledger_account_balance.schema.js +11 -2
  42. package/cjs/schema/ledger_operation.schema.js +44 -17
  43. package/cjs/schema/metered_feature.schema.js +10 -1
  44. package/cjs/schema/omnichannel_one_time_order.schema.js +42 -4
  45. package/cjs/schema/omnichannel_subscription.schema.js +146 -32
  46. package/cjs/schema/order.schema.js +233 -61
  47. package/cjs/schema/organization_detail.schema.js +36 -0
  48. package/cjs/schema/payment_schedule.schema.js +39 -8
  49. package/cjs/schema/payment_schedule_scheme.schema.js +37 -7
  50. package/cjs/schema/payment_source.schema.js +375 -148
  51. package/cjs/schema/payment_voucher.schema.js +33 -5
  52. package/cjs/schema/plan.schema.js +345 -57
  53. package/cjs/schema/price_ramp.schema.js +153 -0
  54. package/cjs/schema/price_variant.schema.js +88 -18
  55. package/cjs/schema/pricing_page_session.schema.js +36 -2
  56. package/cjs/schema/promotional_credit.schema.js +27 -6
  57. package/cjs/schema/purchase.schema.js +210 -12
  58. package/cjs/schema/quote.schema.js +907 -87
  59. package/cjs/schema/quote_entitlement.schema.js +6 -2
  60. package/cjs/schema/ramp.schema.js +242 -24
  61. package/cjs/schema/retry_segment.schema.js +12 -0
  62. package/cjs/schema/site_migration_detail.schema.js +50 -16
  63. package/cjs/schema/subscription.schema.js +1002 -173
  64. package/cjs/schema/subscription_entitlement.schema.js +9 -1
  65. package/cjs/schema/transaction.schema.js +780 -342
  66. package/cjs/schema/unbilled_charge.schema.js +141 -13
  67. package/cjs/schema/usage.schema.js +59 -11
  68. package/cjs/schema/usage_event.schema.js +13 -1
  69. package/cjs/schema/usage_summary.schema.js +1 -0
  70. package/cjs/schema/virtual_bank_account.schema.js +42 -10
  71. package/cjs/schema/webhook_endpoint.schema.js +50 -2
  72. package/esm/environment.js +1 -1
  73. package/esm/resources/api_endpoints.js +230 -2
  74. package/esm/resources/webhook/eventType.js +25 -1
  75. package/esm/schema/addon.schema.js +221 -40
  76. package/esm/schema/alert.schema.js +17 -2
  77. package/esm/schema/alert_status.schema.js +6 -1
  78. package/esm/schema/attached_item.schema.js +101 -26
  79. package/esm/schema/business_entity.schema.js +42 -5
  80. package/esm/schema/business_rule.schema.js +2 -2
  81. package/esm/schema/business_ruleset.schema.js +2 -2
  82. package/esm/schema/collections_payment_promise.schema.js +40 -0
  83. package/esm/schema/comment.schema.js +17 -4
  84. package/esm/schema/coupon.schema.js +218 -37
  85. package/esm/schema/coupon_code.schema.js +36 -6
  86. package/esm/schema/coupon_set.schema.js +108 -27
  87. package/esm/schema/credit_note.schema.js +497 -105
  88. package/esm/schema/credit_unit.schema.js +12 -2
  89. package/esm/schema/customer.schema.js +212 -62
  90. package/esm/schema/differential_price.schema.js +100 -12
  91. package/esm/schema/dispute.schema.js +125 -33
  92. package/esm/schema/einvoice.schema.js +27 -6
  93. package/esm/schema/email_log.schema.js +15 -4
  94. package/esm/schema/entitlement.schema.js +35 -6
  95. package/esm/schema/entitlement_override.schema.js +17 -1
  96. package/esm/schema/estimate.schema.js +585 -40
  97. package/esm/schema/event.schema.js +1334 -585
  98. package/esm/schema/export.schema.js +4459 -1412
  99. package/esm/schema/feature.schema.js +73 -11
  100. package/esm/schema/gateway_request_log.schema.js +306 -0
  101. package/esm/schema/gateway_webhook_log.schema.js +254 -0
  102. package/esm/schema/gift.schema.js +51 -5
  103. package/esm/schema/grant_block.schema.js +45 -12
  104. package/esm/schema/hosted_page.schema.js +564 -68
  105. package/esm/schema/index.js +6 -0
  106. package/esm/schema/invoice.schema.js +842 -122
  107. package/esm/schema/item.schema.js +151 -28
  108. package/esm/schema/item_entitlement.schema.js +23 -2
  109. package/esm/schema/item_family.schema.js +29 -8
  110. package/esm/schema/item_price.schema.js +263 -48
  111. package/esm/schema/ledger_account_balance.schema.js +10 -1
  112. package/esm/schema/ledger_operation.schema.js +44 -17
  113. package/esm/schema/metered_feature.schema.js +10 -1
  114. package/esm/schema/omnichannel_one_time_order.schema.js +42 -4
  115. package/esm/schema/omnichannel_subscription.schema.js +146 -32
  116. package/esm/schema/order.schema.js +233 -61
  117. package/esm/schema/organization_detail.schema.js +33 -0
  118. package/esm/schema/payment_schedule.schema.js +39 -8
  119. package/esm/schema/payment_schedule_scheme.schema.js +37 -7
  120. package/esm/schema/payment_source.schema.js +375 -148
  121. package/esm/schema/payment_voucher.schema.js +33 -5
  122. package/esm/schema/plan.schema.js +345 -57
  123. package/esm/schema/price_ramp.schema.js +150 -0
  124. package/esm/schema/price_variant.schema.js +88 -18
  125. package/esm/schema/pricing_page_session.schema.js +36 -2
  126. package/esm/schema/promotional_credit.schema.js +27 -6
  127. package/esm/schema/purchase.schema.js +210 -12
  128. package/esm/schema/quote.schema.js +907 -87
  129. package/esm/schema/quote_entitlement.schema.js +6 -2
  130. package/esm/schema/ramp.schema.js +242 -24
  131. package/esm/schema/retry_segment.schema.js +9 -0
  132. package/esm/schema/site_migration_detail.schema.js +50 -16
  133. package/esm/schema/subscription.schema.js +1002 -173
  134. package/esm/schema/subscription_entitlement.schema.js +9 -1
  135. package/esm/schema/transaction.schema.js +780 -342
  136. package/esm/schema/unbilled_charge.schema.js +141 -13
  137. package/esm/schema/usage.schema.js +59 -11
  138. package/esm/schema/usage_event.schema.js +13 -1
  139. package/esm/schema/usage_summary.schema.js +1 -0
  140. package/esm/schema/virtual_bank_account.schema.js +42 -10
  141. package/esm/schema/webhook_endpoint.schema.js +50 -2
  142. package/package.json +1 -1
  143. package/types/core.d.ts +63 -74
  144. package/types/index.d.ts +29 -1
  145. package/types/resources/BillingLineItem.d.ts +10 -0
  146. package/types/resources/BillingMetadata.d.ts +9 -0
  147. package/types/resources/BusinessEntity.d.ts +52 -0
  148. package/types/resources/Citation.d.ts +13 -0
  149. package/types/resources/CollectionsDispute.d.ts +24 -0
  150. package/types/resources/CollectionsPaymentPromise.d.ts +93 -0
  151. package/types/resources/CollectionsReminderSequence.d.ts +35 -0
  152. package/types/resources/Comment.d.ts +2 -1
  153. package/types/resources/Content.d.ts +23 -1
  154. package/types/resources/CreditNote.d.ts +1 -0
  155. package/types/resources/CustomData.d.ts +14 -0
  156. package/types/resources/Discount.d.ts +1 -0
  157. package/types/resources/DraftEstimate.d.ts +13 -0
  158. package/types/resources/DraftRequest.d.ts +45 -0
  159. package/types/resources/EmailAttachment.d.ts +16 -0
  160. package/types/resources/EmailConversation.d.ts +18 -0
  161. package/types/resources/EmailLog.d.ts +1 -0
  162. package/types/resources/EmailMessage.d.ts +40 -0
  163. package/types/resources/Estimate.d.ts +3 -0
  164. package/types/resources/Event.d.ts +25 -1
  165. package/types/resources/Execution.d.ts +12 -0
  166. package/types/resources/GatewayPaymentMethodToken.d.ts +2 -2
  167. package/types/resources/GatewayRequestLog.d.ts +82 -0
  168. package/types/resources/GatewayWebhookLog.d.ts +74 -0
  169. package/types/resources/GrantBlock.d.ts +5 -0
  170. package/types/resources/GroupByAttribute.d.ts +15 -0
  171. package/types/resources/GroupByRecommendation.d.ts +10 -0
  172. package/types/resources/HostedPage.d.ts +18 -0
  173. package/types/resources/Invoice.d.ts +19 -0
  174. package/types/resources/ItemPrice.d.ts +1 -0
  175. package/types/resources/LedgerAccountBalance.d.ts +19 -0
  176. package/types/resources/Meter.d.ts +1 -0
  177. package/types/resources/MeteredFeature.d.ts +1 -0
  178. package/types/resources/OmnichannelOneTimeOrder.d.ts +5 -1
  179. package/types/resources/OmnichannelSubscription.d.ts +6 -1
  180. package/types/resources/OmnichannelSubscriptionItem.d.ts +4 -1
  181. package/types/resources/OrganizationDetail.d.ts +84 -0
  182. package/types/resources/PaymentSchedule.d.ts +1 -1
  183. package/types/resources/PaymentScheduleEstimate.d.ts +1 -1
  184. package/types/resources/PaymentSource.d.ts +19 -0
  185. package/types/resources/PreferenceVariant.d.ts +10 -0
  186. package/types/resources/PriceRamp.d.ts +113 -0
  187. package/types/resources/PrivateNote.d.ts +18 -0
  188. package/types/resources/Purchase.d.ts +6 -0
  189. package/types/resources/Ramp.d.ts +6 -0
  190. package/types/resources/RampInterval.d.ts +12 -0
  191. package/types/resources/RecordedPurchase.d.ts +5 -1
  192. package/types/resources/RetrySegment.d.ts +36 -0
  193. package/types/resources/Subscription.d.ts +3 -0
  194. package/types/resources/Transaction.d.ts +4 -0
  195. package/types/resources/Usage.d.ts +7 -0
  196. package/types/resources/UsageSummary.d.ts +2 -0
  197. package/types/resources/WebhookEvent.d.ts +159 -5
  198. package/types/resources/AppliedBusinessRule.d.ts +0 -15
@@ -3,6 +3,15 @@
3
3
  // Do not edit manually – regenerate via sdk-generator
4
4
  import { z } from 'zod';
5
5
  //UnbilledCharge.createUnbilledCharge
6
+ const CreateUnbilledChargeUnbilledChargeAddonsItemSchema = z.object({
7
+ id: z.string().max(100).optional(),
8
+ quantity: z.number().int().min(1).optional(),
9
+ unit_price: z.number().int().min(0).optional(),
10
+ quantity_in_decimal: z.string().max(33).optional(),
11
+ unit_price_in_decimal: z.string().max(39).optional(),
12
+ date_from: z.number().int().optional(),
13
+ date_to: z.number().int().optional(),
14
+ });
6
15
  const CreateUnbilledChargeUnbilledChargeAddonsSchema = z.object({
7
16
  id: z.array(z.string().max(100).optional()).optional(),
8
17
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -12,6 +21,23 @@ const CreateUnbilledChargeUnbilledChargeAddonsSchema = z.object({
12
21
  date_from: z.array(z.number().int().optional()).optional(),
13
22
  date_to: z.array(z.number().int().optional()).optional(),
14
23
  });
24
+ const CreateUnbilledChargeUnbilledChargeChargesItemSchema = z.object({
25
+ amount: z.number().int().min(1).optional(),
26
+ amount_in_decimal: z.string().max(39).optional(),
27
+ description: z.string().max(250).optional(),
28
+ taxable: z.boolean().default(true).optional(),
29
+ tax_profile_id: z.string().max(50).optional(),
30
+ avalara_tax_code: z.string().max(50).optional(),
31
+ hsn_code: z.string().max(50).optional(),
32
+ taxjar_product_code: z.string().max(50).optional(),
33
+ avalara_sale_type: z
34
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
35
+ .optional(),
36
+ avalara_transaction_type: z.number().int().optional(),
37
+ avalara_service_type: z.number().int().optional(),
38
+ date_from: z.number().int().optional(),
39
+ date_to: z.number().int().optional(),
40
+ });
15
41
  const CreateUnbilledChargeUnbilledChargeChargesSchema = z.object({
16
42
  amount: z.array(z.number().int().min(1).optional()).optional(),
17
43
  amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
@@ -29,6 +55,11 @@ const CreateUnbilledChargeUnbilledChargeChargesSchema = z.object({
29
55
  date_from: z.array(z.number().int().optional()).optional(),
30
56
  date_to: z.array(z.number().int().optional()).optional(),
31
57
  });
58
+ const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsItemSchema = z.object({
59
+ provider_name: z.string().max(50).optional(),
60
+ field_id: z.string().max(50).optional(),
61
+ field_value: z.string().max(50).optional(),
62
+ });
32
63
  const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema = z.object({
33
64
  provider_name: z.array(z.string().max(50).optional()).optional(),
34
65
  field_id: z.array(z.string().max(50).optional()).optional(),
@@ -37,12 +68,36 @@ const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema = z.object({
37
68
  const CreateUnbilledChargeUnbilledChargeBodySchema = z.looseObject({
38
69
  subscription_id: z.string().max(50),
39
70
  currency_code: z.string().max(3).optional(),
40
- addons: CreateUnbilledChargeUnbilledChargeAddonsSchema.optional(),
41
- charges: CreateUnbilledChargeUnbilledChargeChargesSchema.optional(),
42
- tax_providers_fields: CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema.optional(),
71
+ addons: z
72
+ .union([
73
+ z.array(CreateUnbilledChargeUnbilledChargeAddonsItemSchema.optional()),
74
+ CreateUnbilledChargeUnbilledChargeAddonsSchema,
75
+ ])
76
+ .optional(),
77
+ charges: z
78
+ .union([
79
+ z.array(CreateUnbilledChargeUnbilledChargeChargesItemSchema.optional()),
80
+ CreateUnbilledChargeUnbilledChargeChargesSchema,
81
+ ])
82
+ .optional(),
83
+ tax_providers_fields: z
84
+ .union([
85
+ z.array(CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsItemSchema.optional()),
86
+ CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema,
87
+ ])
88
+ .optional(),
43
89
  });
44
90
  export { CreateUnbilledChargeUnbilledChargeBodySchema };
45
91
  //UnbilledCharge.create
92
+ const CreateUnbilledChargeItemPricesItemSchema = z.object({
93
+ item_price_id: z.string().max(100).optional(),
94
+ quantity: z.number().int().min(1).optional(),
95
+ quantity_in_decimal: z.string().max(33).optional(),
96
+ unit_price: z.number().int().min(0).optional(),
97
+ unit_price_in_decimal: z.string().max(39).optional(),
98
+ date_from: z.number().int().optional(),
99
+ date_to: z.number().int().optional(),
100
+ });
46
101
  const CreateUnbilledChargeItemPricesSchema = z.object({
47
102
  item_price_id: z.array(z.string().max(100).optional()).optional(),
48
103
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -52,6 +107,17 @@ const CreateUnbilledChargeItemPricesSchema = z.object({
52
107
  date_from: z.array(z.number().int().optional()).optional(),
53
108
  date_to: z.array(z.number().int().optional()).optional(),
54
109
  });
110
+ const CreateUnbilledChargeItemTiersItemSchema = z.object({
111
+ item_price_id: z.string().max(100).optional(),
112
+ starting_unit: z.number().int().min(1).optional(),
113
+ ending_unit: z.number().int().optional(),
114
+ price: z.number().int().min(0).optional(),
115
+ starting_unit_in_decimal: z.string().max(33).optional(),
116
+ ending_unit_in_decimal: z.string().max(33).optional(),
117
+ price_in_decimal: z.string().max(39).optional(),
118
+ pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
119
+ package_size: z.number().int().min(1).optional(),
120
+ });
55
121
  const CreateUnbilledChargeItemTiersSchema = z.object({
56
122
  item_price_id: z.array(z.string().max(100).optional()).optional(),
57
123
  starting_unit: z.array(z.number().int().min(1).optional()).optional(),
@@ -65,6 +131,23 @@ const CreateUnbilledChargeItemTiersSchema = z.object({
65
131
  .optional(),
66
132
  package_size: z.array(z.number().int().min(1).optional()).optional(),
67
133
  });
134
+ const CreateUnbilledChargeChargesItemSchema = z.object({
135
+ amount: z.number().int().min(1).optional(),
136
+ amount_in_decimal: z.string().max(39).optional(),
137
+ description: z.string().max(250).optional(),
138
+ taxable: z.boolean().default(true).optional(),
139
+ tax_profile_id: z.string().max(50).optional(),
140
+ avalara_tax_code: z.string().max(50).optional(),
141
+ hsn_code: z.string().max(50).optional(),
142
+ taxjar_product_code: z.string().max(50).optional(),
143
+ avalara_sale_type: z
144
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
145
+ .optional(),
146
+ avalara_transaction_type: z.number().int().optional(),
147
+ avalara_service_type: z.number().int().optional(),
148
+ date_from: z.number().int().optional(),
149
+ date_to: z.number().int().optional(),
150
+ });
68
151
  const CreateUnbilledChargeChargesSchema = z.object({
69
152
  amount: z.array(z.number().int().min(1).optional()).optional(),
70
153
  amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
@@ -82,6 +165,11 @@ const CreateUnbilledChargeChargesSchema = z.object({
82
165
  date_from: z.array(z.number().int().optional()).optional(),
83
166
  date_to: z.array(z.number().int().optional()).optional(),
84
167
  });
168
+ const CreateUnbilledChargeTaxProvidersFieldsItemSchema = z.object({
169
+ provider_name: z.string().max(50).optional(),
170
+ field_id: z.string().max(50).optional(),
171
+ field_value: z.string().max(50).optional(),
172
+ });
85
173
  const CreateUnbilledChargeTaxProvidersFieldsSchema = z.object({
86
174
  provider_name: z.array(z.string().max(50).optional()).optional(),
87
175
  field_id: z.array(z.string().max(50).optional()).optional(),
@@ -90,10 +178,30 @@ const CreateUnbilledChargeTaxProvidersFieldsSchema = z.object({
90
178
  const CreateUnbilledChargeBodySchema = z.looseObject({
91
179
  subscription_id: z.string().max(50),
92
180
  currency_code: z.string().max(3).optional(),
93
- item_prices: CreateUnbilledChargeItemPricesSchema.optional(),
94
- item_tiers: CreateUnbilledChargeItemTiersSchema.optional(),
95
- charges: CreateUnbilledChargeChargesSchema.optional(),
96
- tax_providers_fields: CreateUnbilledChargeTaxProvidersFieldsSchema.optional(),
181
+ item_prices: z
182
+ .union([
183
+ z.array(CreateUnbilledChargeItemPricesItemSchema.optional()),
184
+ CreateUnbilledChargeItemPricesSchema,
185
+ ])
186
+ .optional(),
187
+ item_tiers: z
188
+ .union([
189
+ z.array(CreateUnbilledChargeItemTiersItemSchema.optional()),
190
+ CreateUnbilledChargeItemTiersSchema,
191
+ ])
192
+ .optional(),
193
+ charges: z
194
+ .union([
195
+ z.array(CreateUnbilledChargeChargesItemSchema.optional()),
196
+ CreateUnbilledChargeChargesSchema,
197
+ ])
198
+ .optional(),
199
+ tax_providers_fields: z
200
+ .union([
201
+ z.array(CreateUnbilledChargeTaxProvidersFieldsItemSchema.optional()),
202
+ CreateUnbilledChargeTaxProvidersFieldsSchema,
203
+ ])
204
+ .optional(),
97
205
  });
98
206
  export { CreateUnbilledChargeBodySchema };
99
207
  //UnbilledCharge.invoiceUnbilledCharges
@@ -107,17 +215,37 @@ const ListUnbilledChargeSubscriptionIdSchema = z.object({
107
215
  is: z.string().min(1).optional(),
108
216
  is_not: z.string().min(1).optional(),
109
217
  starts_with: z.string().min(1).optional(),
110
- is_present: z.enum(['true', 'false']).optional(),
111
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
112
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
218
+ is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
219
+ in: z
220
+ .union([
221
+ z.array(z.string().optional()),
222
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
223
+ ])
224
+ .optional(),
225
+ not_in: z
226
+ .union([
227
+ z.array(z.string().optional()),
228
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
229
+ ])
230
+ .optional(),
113
231
  });
114
232
  const ListUnbilledChargeCustomerIdSchema = z.object({
115
233
  is: z.string().min(1).optional(),
116
234
  is_not: z.string().min(1).optional(),
117
235
  starts_with: z.string().min(1).optional(),
118
- is_present: z.enum(['true', 'false']).optional(),
119
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
120
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
236
+ is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
237
+ in: z
238
+ .union([
239
+ z.array(z.string().optional()),
240
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
241
+ ])
242
+ .optional(),
243
+ not_in: z
244
+ .union([
245
+ z.array(z.string().optional()),
246
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
247
+ ])
248
+ .optional(),
121
249
  });
122
250
  const ListUnbilledChargeBodySchema = z.looseObject({
123
251
  limit: z.number().int().min(1).max(100).optional(),
@@ -34,16 +34,38 @@ const ListUsageSubscriptionIdSchema = z.object({
34
34
  starts_with: z.string().min(1).optional(),
35
35
  });
36
36
  const ListUsageUsageDateSchema = z.object({
37
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
38
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
39
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
40
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
37
+ after: z
38
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
39
+ .optional(),
40
+ before: z
41
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
42
+ .optional(),
43
+ on: z
44
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
45
+ .optional(),
46
+ between: z
47
+ .union([
48
+ z.array(z.number().int().optional()).min(2).max(2),
49
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
50
+ ])
51
+ .optional(),
41
52
  });
42
53
  const ListUsageUpdatedAtSchema = z.object({
43
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
44
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
45
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
46
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
54
+ after: z
55
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
56
+ .optional(),
57
+ before: z
58
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
59
+ .optional(),
60
+ on: z
61
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
62
+ .optional(),
63
+ between: z
64
+ .union([
65
+ z.array(z.number().int().optional()).min(2).max(2),
66
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
67
+ ])
68
+ .optional(),
47
69
  });
48
70
  const ListUsageItemPriceIdSchema = z.object({
49
71
  is: z.string().min(1).optional(),
@@ -54,13 +76,23 @@ const ListUsageInvoiceIdSchema = z.object({
54
76
  is: z.string().min(1).optional(),
55
77
  is_not: z.string().min(1).optional(),
56
78
  starts_with: z.string().min(1).optional(),
57
- is_present: z.enum(['true', 'false']).optional(),
79
+ is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
58
80
  });
59
81
  const ListUsageSourceSchema = z.object({
60
82
  is: z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
61
83
  is_not: z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
62
- in: z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
63
- not_in: z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
84
+ in: z
85
+ .union([
86
+ z.array(z.enum(['admin_console', 'api', 'bulk_operation']).optional()),
87
+ z.enum(['admin_console', 'api', 'bulk_operation']),
88
+ ])
89
+ .optional(),
90
+ not_in: z
91
+ .union([
92
+ z.array(z.enum(['admin_console', 'api', 'bulk_operation']).optional()),
93
+ z.enum(['admin_console', 'api', 'bulk_operation']),
94
+ ])
95
+ .optional(),
64
96
  });
65
97
  const ListUsageSortBySchema = z.looseObject({
66
98
  asc: z.enum(['usage_date', 'updated_at']).optional(),
@@ -83,8 +115,24 @@ export { ListUsageBodySchema };
83
115
  const PdfUsageInvoiceSchema = z.object({
84
116
  id: z.string().max(50),
85
117
  });
118
+ const PdfUsageGroupByItemSchema = z.object({
119
+ feature_id: z.string().max(100).optional(),
120
+ attributes: z.array(z.string().optional()).optional(),
121
+ window_size: z.enum(['day', 'none']).optional(),
122
+ });
123
+ const PdfUsageGroupBySchema = z.object({
124
+ feature_id: z.array(z.string().max(100).optional()).optional(),
125
+ attributes: z.array(z.array(z.string().optional()).optional()).optional(),
126
+ window_size: z.array(z.enum(['day', 'none']).optional()).optional(),
127
+ });
86
128
  const PdfUsageBodySchema = z.looseObject({
87
129
  disposition_type: z.enum(['attachment', 'inline']).optional(),
88
130
  invoice: PdfUsageInvoiceSchema.optional(),
131
+ group_by: z
132
+ .union([
133
+ z.array(PdfUsageGroupByItemSchema.optional()),
134
+ PdfUsageGroupBySchema,
135
+ ])
136
+ .optional(),
89
137
  });
90
138
  export { PdfUsageBodySchema };
@@ -12,6 +12,13 @@ const CreateUsageEventBodySchema = z.looseObject({
12
12
  });
13
13
  export { CreateUsageEventBodySchema };
14
14
  //UsageEvent.batchIngest
15
+ const BatchIngestUsageEventPropertiesSchema = z.looseObject({});
16
+ const BatchIngestUsageEventEventsItemSchema = z.object({
17
+ deduplication_id: z.string().max(36),
18
+ subscription_id: z.string().max(50),
19
+ usage_timestamp: z.number().int(),
20
+ properties: BatchIngestUsageEventPropertiesSchema,
21
+ });
15
22
  const BatchIngestUsageEventPropertiesItemSchema = z.looseObject({});
16
23
  const BatchIngestUsageEventEventsSchema = z.object({
17
24
  deduplication_id: z.array(z.string().max(36).optional()),
@@ -20,6 +27,11 @@ const BatchIngestUsageEventEventsSchema = z.object({
20
27
  properties: z.array(BatchIngestUsageEventPropertiesItemSchema.optional()),
21
28
  });
22
29
  const BatchIngestUsageEventBodySchema = z.looseObject({
23
- events: BatchIngestUsageEventEventsSchema.optional(),
30
+ events: z
31
+ .union([
32
+ z.array(BatchIngestUsageEventEventsItemSchema.optional()),
33
+ BatchIngestUsageEventEventsSchema,
34
+ ])
35
+ .optional(),
24
36
  });
25
37
  export { BatchIngestUsageEventBodySchema };
@@ -10,5 +10,6 @@ const RetrieveUsageSummaryForSubscriptionUsageSummaryBodySchema = z.looseObject(
10
10
  window_size: z.enum(['month', 'week', 'day', 'hour', 'minute']).optional(),
11
11
  timeframe_start: z.number().int().optional(),
12
12
  timeframe_end: z.number().int().optional(),
13
+ group_by: z.array(z.string().max(100).optional()).optional(),
13
14
  });
14
15
  export { RetrieveUsageSummaryForSubscriptionUsageSummaryBodySchema };
@@ -43,20 +43,52 @@ const ListVirtualBankAccountCustomerIdSchema = z.object({
43
43
  is: z.string().min(1).optional(),
44
44
  is_not: z.string().min(1).optional(),
45
45
  starts_with: z.string().min(1).optional(),
46
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
47
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
46
+ in: z
47
+ .union([
48
+ z.array(z.string().optional()),
49
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
50
+ ])
51
+ .optional(),
52
+ not_in: z
53
+ .union([
54
+ z.array(z.string().optional()),
55
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
56
+ ])
57
+ .optional(),
48
58
  });
49
59
  const ListVirtualBankAccountUpdatedAtSchema = z.object({
50
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
51
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
52
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
53
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
60
+ after: z
61
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
62
+ .optional(),
63
+ before: z
64
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
65
+ .optional(),
66
+ on: z
67
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
68
+ .optional(),
69
+ between: z
70
+ .union([
71
+ z.array(z.number().int().optional()).min(2).max(2),
72
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
73
+ ])
74
+ .optional(),
54
75
  });
55
76
  const ListVirtualBankAccountCreatedAtSchema = z.object({
56
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
57
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
58
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
59
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
77
+ after: z
78
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
79
+ .optional(),
80
+ before: z
81
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
82
+ .optional(),
83
+ on: z
84
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
85
+ .optional(),
86
+ between: z
87
+ .union([
88
+ z.array(z.number().int().optional()).min(2).max(2),
89
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
90
+ ])
91
+ .optional(),
60
92
  });
61
93
  const ListVirtualBankAccountBodySchema = z.looseObject({
62
94
  limit: z.number().int().min(1).max(100).optional(),
@@ -82,6 +82,7 @@ const CreateWebhookEndpointBodySchema = z.looseObject({
82
82
  'payment_schedules_updated',
83
83
  'payment_schedule_scheme_created',
84
84
  'payment_schedule_scheme_deleted',
85
+ 'payment_schedules_cancelled',
85
86
  'subscription_renewal_reminder',
86
87
  'add_usages_reminder',
87
88
  'payment_due_reminder',
@@ -92,6 +93,7 @@ const CreateWebhookEndpointBodySchema = z.looseObject({
92
93
  'payment_failed',
93
94
  'dunning_updated',
94
95
  'payment_refunded',
96
+ 'refund_failed',
95
97
  'payment_initiated',
96
98
  'refund_initiated',
97
99
  'netd_payment_due_reminder',
@@ -182,6 +184,8 @@ const CreateWebhookEndpointBodySchema = z.looseObject({
182
184
  'customer_business_entity_changed',
183
185
  'subscription_business_entity_changed',
184
186
  'payment_source_business_entity_changed',
187
+ 'organization_details_created',
188
+ 'organization_details_updated',
185
189
  'purchase_created',
186
190
  'voucher_created',
187
191
  'voucher_expired',
@@ -243,6 +247,9 @@ const CreateWebhookEndpointBodySchema = z.looseObject({
243
247
  'alert_status_changed',
244
248
  'omnichannel_subscription_item_updated',
245
249
  'omnichannel_subscription_item_recovered',
250
+ 'price_ramp_created',
251
+ 'price_ramp_updated',
252
+ 'price_ramp_deleted',
246
253
  'omnichannel_subscription_item_mrr_updated',
247
254
  'ledger_account_balance_updated',
248
255
  'grant_blocks_created',
@@ -257,12 +264,29 @@ const CreateWebhookEndpointBodySchema = z.looseObject({
257
264
  'vault_token_created',
258
265
  'vault_token_updated',
259
266
  'vault_token_deleted',
260
- 'business_rules_applied',
267
+ 'chargeback_initiated',
268
+ 'chargeback_won',
269
+ 'chargeback_lost',
261
270
  'business_ruleset_created',
262
271
  'business_ruleset_updated',
263
272
  'business_ruleset_activated',
264
273
  'business_ruleset_deactivated',
265
274
  'business_ruleset_deleted',
275
+ 'collections_reminder_sequence_created',
276
+ 'collections_reminder_sequence_paused',
277
+ 'collections_reminder_sequence_resumed',
278
+ 'collections_reminder_sequence_completed',
279
+ 'collections_payment_promise_created',
280
+ 'collections_payment_promise_updated',
281
+ 'collections_payment_promise_fulfilled',
282
+ 'collections_payment_promise_cancelled',
283
+ 'collections_payment_promise_broken',
284
+ 'collections_dispute_created',
285
+ 'collections_dispute_updated',
286
+ 'collections_dispute_resolved',
287
+ 'collections_dispute_withdrawn',
288
+ 'email_message_received',
289
+ 'private_note_added',
266
290
  'plan_created',
267
291
  'plan_updated',
268
292
  'plan_deleted',
@@ -351,6 +375,7 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({
351
375
  'payment_schedules_updated',
352
376
  'payment_schedule_scheme_created',
353
377
  'payment_schedule_scheme_deleted',
378
+ 'payment_schedules_cancelled',
354
379
  'subscription_renewal_reminder',
355
380
  'add_usages_reminder',
356
381
  'payment_due_reminder',
@@ -361,6 +386,7 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({
361
386
  'payment_failed',
362
387
  'dunning_updated',
363
388
  'payment_refunded',
389
+ 'refund_failed',
364
390
  'payment_initiated',
365
391
  'refund_initiated',
366
392
  'netd_payment_due_reminder',
@@ -451,6 +477,8 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({
451
477
  'customer_business_entity_changed',
452
478
  'subscription_business_entity_changed',
453
479
  'payment_source_business_entity_changed',
480
+ 'organization_details_created',
481
+ 'organization_details_updated',
454
482
  'purchase_created',
455
483
  'voucher_created',
456
484
  'voucher_expired',
@@ -512,6 +540,9 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({
512
540
  'alert_status_changed',
513
541
  'omnichannel_subscription_item_updated',
514
542
  'omnichannel_subscription_item_recovered',
543
+ 'price_ramp_created',
544
+ 'price_ramp_updated',
545
+ 'price_ramp_deleted',
515
546
  'omnichannel_subscription_item_mrr_updated',
516
547
  'ledger_account_balance_updated',
517
548
  'grant_blocks_created',
@@ -526,12 +557,29 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({
526
557
  'vault_token_created',
527
558
  'vault_token_updated',
528
559
  'vault_token_deleted',
529
- 'business_rules_applied',
560
+ 'chargeback_initiated',
561
+ 'chargeback_won',
562
+ 'chargeback_lost',
530
563
  'business_ruleset_created',
531
564
  'business_ruleset_updated',
532
565
  'business_ruleset_activated',
533
566
  'business_ruleset_deactivated',
534
567
  'business_ruleset_deleted',
568
+ 'collections_reminder_sequence_created',
569
+ 'collections_reminder_sequence_paused',
570
+ 'collections_reminder_sequence_resumed',
571
+ 'collections_reminder_sequence_completed',
572
+ 'collections_payment_promise_created',
573
+ 'collections_payment_promise_updated',
574
+ 'collections_payment_promise_fulfilled',
575
+ 'collections_payment_promise_cancelled',
576
+ 'collections_payment_promise_broken',
577
+ 'collections_dispute_created',
578
+ 'collections_dispute_updated',
579
+ 'collections_dispute_resolved',
580
+ 'collections_dispute_withdrawn',
581
+ 'email_message_received',
582
+ 'private_note_added',
535
583
  'plan_created',
536
584
  'plan_updated',
537
585
  'plan_deleted',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chargebee",
3
- "version": "3.34.0",
3
+ "version": "3.36.0",
4
4
  "description": "A library for integrating with Chargebee.",
5
5
  "scripts": {
6
6
  "prepack": "npm ci && npm run build",