chargebee 3.35.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 (152) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/cjs/environment.js +1 -1
  3. package/cjs/resources/api_endpoints.js +56 -0
  4. package/cjs/resources/webhook/eventType.js +2 -0
  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 +16 -5
  10. package/cjs/schema/business_rule.schema.js +2 -2
  11. package/cjs/schema/business_ruleset.schema.js +2 -2
  12. package/cjs/schema/comment.schema.js +15 -4
  13. package/cjs/schema/coupon.schema.js +218 -37
  14. package/cjs/schema/coupon_code.schema.js +36 -6
  15. package/cjs/schema/coupon_set.schema.js +108 -27
  16. package/cjs/schema/credit_note.schema.js +496 -105
  17. package/cjs/schema/credit_unit.schema.js +12 -2
  18. package/cjs/schema/customer.schema.js +212 -62
  19. package/cjs/schema/differential_price.schema.js +100 -12
  20. package/cjs/schema/dispute.schema.js +125 -33
  21. package/cjs/schema/einvoice.schema.js +27 -6
  22. package/cjs/schema/email_log.schema.js +15 -4
  23. package/cjs/schema/entitlement.schema.js +33 -4
  24. package/cjs/schema/entitlement_override.schema.js +17 -1
  25. package/cjs/schema/estimate.schema.js +581 -36
  26. package/cjs/schema/event.schema.js +1282 -633
  27. package/cjs/schema/export.schema.js +4459 -1412
  28. package/cjs/schema/feature.schema.js +73 -11
  29. package/cjs/schema/gateway_request_log.schema.js +309 -0
  30. package/cjs/schema/gateway_webhook_log.schema.js +257 -0
  31. package/cjs/schema/gift.schema.js +51 -5
  32. package/cjs/schema/grant_block.schema.js +45 -12
  33. package/cjs/schema/hosted_page.schema.js +562 -66
  34. package/cjs/schema/index.js +3 -0
  35. package/cjs/schema/invoice.schema.js +821 -121
  36. package/cjs/schema/item.schema.js +151 -28
  37. package/cjs/schema/item_entitlement.schema.js +23 -2
  38. package/cjs/schema/item_family.schema.js +29 -8
  39. package/cjs/schema/item_price.schema.js +263 -48
  40. package/cjs/schema/ledger_operation.schema.js +42 -15
  41. package/cjs/schema/metered_feature.schema.js +10 -1
  42. package/cjs/schema/omnichannel_one_time_order.schema.js +32 -2
  43. package/cjs/schema/omnichannel_subscription.schema.js +136 -30
  44. package/cjs/schema/order.schema.js +233 -61
  45. package/cjs/schema/organization_detail.schema.js +36 -0
  46. package/cjs/schema/payment_schedule.schema.js +39 -8
  47. package/cjs/schema/payment_schedule_scheme.schema.js +37 -7
  48. package/cjs/schema/payment_source.schema.js +360 -148
  49. package/cjs/schema/payment_voucher.schema.js +33 -5
  50. package/cjs/schema/plan.schema.js +345 -57
  51. package/cjs/schema/price_ramp.schema.js +79 -14
  52. package/cjs/schema/price_variant.schema.js +88 -18
  53. package/cjs/schema/pricing_page_session.schema.js +36 -2
  54. package/cjs/schema/promotional_credit.schema.js +27 -6
  55. package/cjs/schema/purchase.schema.js +204 -12
  56. package/cjs/schema/quote.schema.js +901 -81
  57. package/cjs/schema/quote_entitlement.schema.js +6 -2
  58. package/cjs/schema/ramp.schema.js +238 -24
  59. package/cjs/schema/site_migration_detail.schema.js +50 -16
  60. package/cjs/schema/subscription.schema.js +998 -169
  61. package/cjs/schema/subscription_entitlement.schema.js +9 -1
  62. package/cjs/schema/transaction.schema.js +780 -342
  63. package/cjs/schema/unbilled_charge.schema.js +141 -13
  64. package/cjs/schema/usage.schema.js +55 -12
  65. package/cjs/schema/usage_event.schema.js +13 -1
  66. package/cjs/schema/virtual_bank_account.schema.js +42 -10
  67. package/cjs/schema/webhook_endpoint.schema.js +4 -0
  68. package/esm/environment.js +1 -1
  69. package/esm/resources/api_endpoints.js +56 -0
  70. package/esm/resources/webhook/eventType.js +2 -0
  71. package/esm/schema/addon.schema.js +221 -40
  72. package/esm/schema/alert.schema.js +17 -2
  73. package/esm/schema/alert_status.schema.js +6 -1
  74. package/esm/schema/attached_item.schema.js +101 -26
  75. package/esm/schema/business_entity.schema.js +16 -5
  76. package/esm/schema/business_rule.schema.js +2 -2
  77. package/esm/schema/business_ruleset.schema.js +2 -2
  78. package/esm/schema/comment.schema.js +15 -4
  79. package/esm/schema/coupon.schema.js +218 -37
  80. package/esm/schema/coupon_code.schema.js +36 -6
  81. package/esm/schema/coupon_set.schema.js +108 -27
  82. package/esm/schema/credit_note.schema.js +496 -105
  83. package/esm/schema/credit_unit.schema.js +12 -2
  84. package/esm/schema/customer.schema.js +212 -62
  85. package/esm/schema/differential_price.schema.js +100 -12
  86. package/esm/schema/dispute.schema.js +125 -33
  87. package/esm/schema/einvoice.schema.js +27 -6
  88. package/esm/schema/email_log.schema.js +15 -4
  89. package/esm/schema/entitlement.schema.js +33 -4
  90. package/esm/schema/entitlement_override.schema.js +17 -1
  91. package/esm/schema/estimate.schema.js +581 -36
  92. package/esm/schema/event.schema.js +1282 -633
  93. package/esm/schema/export.schema.js +4459 -1412
  94. package/esm/schema/feature.schema.js +73 -11
  95. package/esm/schema/gateway_request_log.schema.js +306 -0
  96. package/esm/schema/gateway_webhook_log.schema.js +254 -0
  97. package/esm/schema/gift.schema.js +51 -5
  98. package/esm/schema/grant_block.schema.js +45 -12
  99. package/esm/schema/hosted_page.schema.js +562 -66
  100. package/esm/schema/index.js +3 -0
  101. package/esm/schema/invoice.schema.js +821 -121
  102. package/esm/schema/item.schema.js +151 -28
  103. package/esm/schema/item_entitlement.schema.js +23 -2
  104. package/esm/schema/item_family.schema.js +29 -8
  105. package/esm/schema/item_price.schema.js +263 -48
  106. package/esm/schema/ledger_operation.schema.js +42 -15
  107. package/esm/schema/metered_feature.schema.js +10 -1
  108. package/esm/schema/omnichannel_one_time_order.schema.js +32 -2
  109. package/esm/schema/omnichannel_subscription.schema.js +136 -30
  110. package/esm/schema/order.schema.js +233 -61
  111. package/esm/schema/organization_detail.schema.js +33 -0
  112. package/esm/schema/payment_schedule.schema.js +39 -8
  113. package/esm/schema/payment_schedule_scheme.schema.js +37 -7
  114. package/esm/schema/payment_source.schema.js +360 -148
  115. package/esm/schema/payment_voucher.schema.js +33 -5
  116. package/esm/schema/plan.schema.js +345 -57
  117. package/esm/schema/price_ramp.schema.js +79 -14
  118. package/esm/schema/price_variant.schema.js +88 -18
  119. package/esm/schema/pricing_page_session.schema.js +36 -2
  120. package/esm/schema/promotional_credit.schema.js +27 -6
  121. package/esm/schema/purchase.schema.js +204 -12
  122. package/esm/schema/quote.schema.js +901 -81
  123. package/esm/schema/quote_entitlement.schema.js +6 -2
  124. package/esm/schema/ramp.schema.js +238 -24
  125. package/esm/schema/site_migration_detail.schema.js +50 -16
  126. package/esm/schema/subscription.schema.js +998 -169
  127. package/esm/schema/subscription_entitlement.schema.js +9 -1
  128. package/esm/schema/transaction.schema.js +780 -342
  129. package/esm/schema/unbilled_charge.schema.js +141 -13
  130. package/esm/schema/usage.schema.js +55 -12
  131. package/esm/schema/usage_event.schema.js +13 -1
  132. package/esm/schema/virtual_bank_account.schema.js +42 -10
  133. package/esm/schema/webhook_endpoint.schema.js +4 -0
  134. package/package.json +1 -1
  135. package/types/core.d.ts +10 -6
  136. package/types/index.d.ts +8 -1
  137. package/types/resources/BillingLineItem.d.ts +10 -0
  138. package/types/resources/BillingMetadata.d.ts +9 -0
  139. package/types/resources/Content.d.ts +5 -0
  140. package/types/resources/Discount.d.ts +1 -0
  141. package/types/resources/DraftRequest.d.ts +1 -1
  142. package/types/resources/Estimate.d.ts +3 -0
  143. package/types/resources/Event.d.ts +2 -0
  144. package/types/resources/GatewayRequestLog.d.ts +82 -0
  145. package/types/resources/GatewayWebhookLog.d.ts +74 -0
  146. package/types/resources/GrantBlock.d.ts +5 -0
  147. package/types/resources/HostedPage.d.ts +18 -0
  148. package/types/resources/Invoice.d.ts +4 -0
  149. package/types/resources/OrganizationDetail.d.ts +84 -0
  150. package/types/resources/Subscription.d.ts +3 -0
  151. package/types/resources/Usage.d.ts +1 -0
  152. package/types/resources/WebhookEvent.d.ts +10 -0
@@ -10,10 +10,14 @@ const ListQuoteEntitlementsQuoteEntitlementEntityIdSchema = zod_1.z.object({
10
10
  is: zod_1.z.string().min(1).optional(),
11
11
  });
12
12
  const ListQuoteEntitlementsQuoteEntitlementStartDateSchema = zod_1.z.object({
13
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
13
+ on: zod_1.z
14
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
15
+ .optional(),
14
16
  });
15
17
  const ListQuoteEntitlementsQuoteEntitlementEndDateSchema = zod_1.z.object({
16
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
18
+ on: zod_1.z
19
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
20
+ .optional(),
17
21
  });
18
22
  const ListQuoteEntitlementsQuoteEntitlementBodySchema = zod_1.z.looseObject({
19
23
  limit: zod_1.z.number().int().min(1).max(100).optional(),
@@ -16,6 +16,26 @@ const CreateForSubscriptionRampContractTermSchema = zod_1.z.object({
16
16
  cancellation_cutoff_period: zod_1.z.number().int().optional(),
17
17
  renewal_billing_cycles: zod_1.z.number().int().optional(),
18
18
  });
19
+ const CreateForSubscriptionRampItemsToAddItemSchema = zod_1.z.object({
20
+ item_price_id: zod_1.z.string().max(100),
21
+ quantity: zod_1.z.number().int().min(1).optional(),
22
+ quantity_in_decimal: zod_1.z.string().max(33).optional(),
23
+ unit_price: zod_1.z.number().int().min(0).optional(),
24
+ unit_price_in_decimal: zod_1.z.string().max(39).optional(),
25
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
26
+ service_period_days: zod_1.z.number().int().min(1).max(4000).optional(),
27
+ charge_on_event: zod_1.z
28
+ .enum([
29
+ 'subscription_trial_start',
30
+ 'plan_activation',
31
+ 'subscription_activation',
32
+ 'contract_termination',
33
+ ])
34
+ .optional(),
35
+ charge_once: zod_1.z.boolean().optional(),
36
+ charge_on_option: zod_1.z.enum(['immediately', 'on_event']).optional(),
37
+ description: zod_1.z.string().max(2000).optional(),
38
+ });
19
39
  const CreateForSubscriptionRampItemsToAddSchema = zod_1.z.object({
20
40
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
21
41
  quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
@@ -40,7 +60,27 @@ const CreateForSubscriptionRampItemsToAddSchema = zod_1.z.object({
40
60
  charge_on_option: zod_1.z
41
61
  .array(zod_1.z.enum(['immediately', 'on_event']).optional())
42
62
  .optional(),
43
- description: zod_1.z.array(zod_1.z.string().max(500).optional()).optional(),
63
+ description: zod_1.z.array(zod_1.z.string().max(2000).optional()).optional(),
64
+ });
65
+ const CreateForSubscriptionRampItemsToUpdateItemSchema = zod_1.z.object({
66
+ item_price_id: zod_1.z.string().max(100),
67
+ quantity: zod_1.z.number().int().min(1).optional(),
68
+ quantity_in_decimal: zod_1.z.string().max(33).optional(),
69
+ unit_price: zod_1.z.number().int().min(0).optional(),
70
+ unit_price_in_decimal: zod_1.z.string().max(39).optional(),
71
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
72
+ service_period_days: zod_1.z.number().int().min(1).max(4000).optional(),
73
+ charge_on_event: zod_1.z
74
+ .enum([
75
+ 'subscription_trial_start',
76
+ 'plan_activation',
77
+ 'subscription_activation',
78
+ 'contract_termination',
79
+ ])
80
+ .optional(),
81
+ charge_once: zod_1.z.boolean().optional(),
82
+ charge_on_option: zod_1.z.enum(['immediately', 'on_event']).optional(),
83
+ description: zod_1.z.string().max(2000).optional(),
44
84
  });
45
85
  const CreateForSubscriptionRampItemsToUpdateSchema = zod_1.z.object({
46
86
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
@@ -66,7 +106,18 @@ const CreateForSubscriptionRampItemsToUpdateSchema = zod_1.z.object({
66
106
  charge_on_option: zod_1.z
67
107
  .array(zod_1.z.enum(['immediately', 'on_event']).optional())
68
108
  .optional(),
69
- description: zod_1.z.array(zod_1.z.string().max(500).optional()).optional(),
109
+ description: zod_1.z.array(zod_1.z.string().max(2000).optional()).optional(),
110
+ });
111
+ const CreateForSubscriptionRampItemTiersItemSchema = zod_1.z.object({
112
+ item_price_id: zod_1.z.string().max(100).optional(),
113
+ starting_unit: zod_1.z.number().int().min(1).optional(),
114
+ ending_unit: zod_1.z.number().int().optional(),
115
+ price: zod_1.z.number().int().min(0).optional(),
116
+ starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
117
+ ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
118
+ price_in_decimal: zod_1.z.string().max(39).optional(),
119
+ pricing_type: zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional(),
120
+ package_size: zod_1.z.number().int().min(1).optional(),
70
121
  });
71
122
  const CreateForSubscriptionRampItemTiersSchema = zod_1.z.object({
72
123
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
@@ -81,10 +132,25 @@ const CreateForSubscriptionRampItemTiersSchema = zod_1.z.object({
81
132
  .optional(),
82
133
  package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
83
134
  });
135
+ const CreateForSubscriptionRampCouponsToAddItemSchema = zod_1.z.object({
136
+ coupon_id: zod_1.z.string().max(100).optional(),
137
+ apply_till: zod_1.z.number().int().optional(),
138
+ });
84
139
  const CreateForSubscriptionRampCouponsToAddSchema = zod_1.z.object({
85
140
  coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
86
141
  apply_till: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
87
142
  });
143
+ const CreateForSubscriptionRampDiscountsToAddItemSchema = zod_1.z.object({
144
+ apply_on: zod_1.z.enum(['invoice_amount', 'specific_item_price']),
145
+ duration_type: zod_1.z.enum(['one_time', 'forever', 'limited_period']),
146
+ percentage: zod_1.z.number().min(0.01).max(100).optional(),
147
+ amount: zod_1.z.number().int().min(0).optional(),
148
+ quantity: zod_1.z.number().int().min(1).optional(),
149
+ period: zod_1.z.number().int().min(1).optional(),
150
+ period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
151
+ included_in_mrr: zod_1.z.boolean().optional(),
152
+ item_price_id: zod_1.z.string().max(100).optional(),
153
+ });
88
154
  const CreateForSubscriptionRampDiscountsToAddSchema = zod_1.z.object({
89
155
  apply_on: zod_1.z.array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional()),
90
156
  duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
@@ -106,11 +172,36 @@ const CreateForSubscriptionRampBodySchema = zod_1.z.looseObject({
106
172
  items_to_remove: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
107
173
  billing_configuration: CreateForSubscriptionRampBillingConfigurationSchema.optional(),
108
174
  contract_term: CreateForSubscriptionRampContractTermSchema.optional(),
109
- items_to_add: CreateForSubscriptionRampItemsToAddSchema.optional(),
110
- items_to_update: CreateForSubscriptionRampItemsToUpdateSchema.optional(),
111
- item_tiers: CreateForSubscriptionRampItemTiersSchema.optional(),
112
- coupons_to_add: CreateForSubscriptionRampCouponsToAddSchema.optional(),
113
- discounts_to_add: CreateForSubscriptionRampDiscountsToAddSchema.optional(),
175
+ items_to_add: zod_1.z
176
+ .union([
177
+ zod_1.z.array(CreateForSubscriptionRampItemsToAddItemSchema.optional()),
178
+ CreateForSubscriptionRampItemsToAddSchema,
179
+ ])
180
+ .optional(),
181
+ items_to_update: zod_1.z
182
+ .union([
183
+ zod_1.z.array(CreateForSubscriptionRampItemsToUpdateItemSchema.optional()),
184
+ CreateForSubscriptionRampItemsToUpdateSchema,
185
+ ])
186
+ .optional(),
187
+ item_tiers: zod_1.z
188
+ .union([
189
+ zod_1.z.array(CreateForSubscriptionRampItemTiersItemSchema.optional()),
190
+ CreateForSubscriptionRampItemTiersSchema,
191
+ ])
192
+ .optional(),
193
+ coupons_to_add: zod_1.z
194
+ .union([
195
+ zod_1.z.array(CreateForSubscriptionRampCouponsToAddItemSchema.optional()),
196
+ CreateForSubscriptionRampCouponsToAddSchema,
197
+ ])
198
+ .optional(),
199
+ discounts_to_add: zod_1.z
200
+ .union([
201
+ zod_1.z.array(CreateForSubscriptionRampDiscountsToAddItemSchema.optional()),
202
+ CreateForSubscriptionRampDiscountsToAddSchema,
203
+ ])
204
+ .optional(),
114
205
  });
115
206
  exports.CreateForSubscriptionRampBodySchema = CreateForSubscriptionRampBodySchema;
116
207
  //Ramp.update
@@ -124,6 +215,26 @@ const UpdateRampContractTermSchema = zod_1.z.object({
124
215
  cancellation_cutoff_period: zod_1.z.number().int().optional(),
125
216
  renewal_billing_cycles: zod_1.z.number().int().optional(),
126
217
  });
218
+ const UpdateRampItemsToAddItemSchema = zod_1.z.object({
219
+ item_price_id: zod_1.z.string().max(100),
220
+ quantity: zod_1.z.number().int().min(1).optional(),
221
+ quantity_in_decimal: zod_1.z.string().max(33).optional(),
222
+ unit_price: zod_1.z.number().int().min(0).optional(),
223
+ unit_price_in_decimal: zod_1.z.string().max(39).optional(),
224
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
225
+ service_period_days: zod_1.z.number().int().min(1).max(4000).optional(),
226
+ charge_on_event: zod_1.z
227
+ .enum([
228
+ 'subscription_trial_start',
229
+ 'plan_activation',
230
+ 'subscription_activation',
231
+ 'contract_termination',
232
+ ])
233
+ .optional(),
234
+ charge_once: zod_1.z.boolean().optional(),
235
+ charge_on_option: zod_1.z.enum(['immediately', 'on_event']).optional(),
236
+ description: zod_1.z.string().max(2000).optional(),
237
+ });
127
238
  const UpdateRampItemsToAddSchema = zod_1.z.object({
128
239
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
129
240
  quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
@@ -148,7 +259,27 @@ const UpdateRampItemsToAddSchema = zod_1.z.object({
148
259
  charge_on_option: zod_1.z
149
260
  .array(zod_1.z.enum(['immediately', 'on_event']).optional())
150
261
  .optional(),
151
- description: zod_1.z.array(zod_1.z.string().max(500).optional()).optional(),
262
+ description: zod_1.z.array(zod_1.z.string().max(2000).optional()).optional(),
263
+ });
264
+ const UpdateRampItemsToUpdateItemSchema = zod_1.z.object({
265
+ item_price_id: zod_1.z.string().max(100),
266
+ quantity: zod_1.z.number().int().min(1).optional(),
267
+ quantity_in_decimal: zod_1.z.string().max(33).optional(),
268
+ unit_price: zod_1.z.number().int().min(0).optional(),
269
+ unit_price_in_decimal: zod_1.z.string().max(39).optional(),
270
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
271
+ service_period_days: zod_1.z.number().int().min(1).max(4000).optional(),
272
+ charge_on_event: zod_1.z
273
+ .enum([
274
+ 'subscription_trial_start',
275
+ 'plan_activation',
276
+ 'subscription_activation',
277
+ 'contract_termination',
278
+ ])
279
+ .optional(),
280
+ charge_once: zod_1.z.boolean().optional(),
281
+ charge_on_option: zod_1.z.enum(['immediately', 'on_event']).optional(),
282
+ description: zod_1.z.string().max(2000).optional(),
152
283
  });
153
284
  const UpdateRampItemsToUpdateSchema = zod_1.z.object({
154
285
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
@@ -174,7 +305,18 @@ const UpdateRampItemsToUpdateSchema = zod_1.z.object({
174
305
  charge_on_option: zod_1.z
175
306
  .array(zod_1.z.enum(['immediately', 'on_event']).optional())
176
307
  .optional(),
177
- description: zod_1.z.array(zod_1.z.string().max(500).optional()).optional(),
308
+ description: zod_1.z.array(zod_1.z.string().max(2000).optional()).optional(),
309
+ });
310
+ const UpdateRampItemTiersItemSchema = zod_1.z.object({
311
+ item_price_id: zod_1.z.string().max(100).optional(),
312
+ starting_unit: zod_1.z.number().int().min(1).optional(),
313
+ ending_unit: zod_1.z.number().int().optional(),
314
+ price: zod_1.z.number().int().min(0).optional(),
315
+ starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
316
+ ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
317
+ price_in_decimal: zod_1.z.string().max(39).optional(),
318
+ pricing_type: zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional(),
319
+ package_size: zod_1.z.number().int().min(1).optional(),
178
320
  });
179
321
  const UpdateRampItemTiersSchema = zod_1.z.object({
180
322
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
@@ -189,10 +331,25 @@ const UpdateRampItemTiersSchema = zod_1.z.object({
189
331
  .optional(),
190
332
  package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
191
333
  });
334
+ const UpdateRampCouponsToAddItemSchema = zod_1.z.object({
335
+ coupon_id: zod_1.z.string().max(100).optional(),
336
+ apply_till: zod_1.z.number().int().optional(),
337
+ });
192
338
  const UpdateRampCouponsToAddSchema = zod_1.z.object({
193
339
  coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
194
340
  apply_till: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
195
341
  });
342
+ const UpdateRampDiscountsToAddItemSchema = zod_1.z.object({
343
+ apply_on: zod_1.z.enum(['invoice_amount', 'specific_item_price']),
344
+ duration_type: zod_1.z.enum(['one_time', 'forever', 'limited_period']),
345
+ percentage: zod_1.z.number().min(0.01).max(100).optional(),
346
+ amount: zod_1.z.number().int().min(0).optional(),
347
+ quantity: zod_1.z.number().int().min(1).optional(),
348
+ period: zod_1.z.number().int().min(1).optional(),
349
+ period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
350
+ included_in_mrr: zod_1.z.boolean().optional(),
351
+ item_price_id: zod_1.z.string().max(100).optional(),
352
+ });
196
353
  const UpdateRampDiscountsToAddSchema = zod_1.z.object({
197
354
  apply_on: zod_1.z.array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional()),
198
355
  duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
@@ -214,33 +371,90 @@ const UpdateRampBodySchema = zod_1.z.looseObject({
214
371
  items_to_remove: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
215
372
  billing_configuration: UpdateRampBillingConfigurationSchema.optional(),
216
373
  contract_term: UpdateRampContractTermSchema.optional(),
217
- items_to_add: UpdateRampItemsToAddSchema.optional(),
218
- items_to_update: UpdateRampItemsToUpdateSchema.optional(),
219
- item_tiers: UpdateRampItemTiersSchema.optional(),
220
- coupons_to_add: UpdateRampCouponsToAddSchema.optional(),
221
- discounts_to_add: UpdateRampDiscountsToAddSchema.optional(),
374
+ items_to_add: zod_1.z
375
+ .union([
376
+ zod_1.z.array(UpdateRampItemsToAddItemSchema.optional()),
377
+ UpdateRampItemsToAddSchema,
378
+ ])
379
+ .optional(),
380
+ items_to_update: zod_1.z
381
+ .union([
382
+ zod_1.z.array(UpdateRampItemsToUpdateItemSchema.optional()),
383
+ UpdateRampItemsToUpdateSchema,
384
+ ])
385
+ .optional(),
386
+ item_tiers: zod_1.z
387
+ .union([
388
+ zod_1.z.array(UpdateRampItemTiersItemSchema.optional()),
389
+ UpdateRampItemTiersSchema,
390
+ ])
391
+ .optional(),
392
+ coupons_to_add: zod_1.z
393
+ .union([
394
+ zod_1.z.array(UpdateRampCouponsToAddItemSchema.optional()),
395
+ UpdateRampCouponsToAddSchema,
396
+ ])
397
+ .optional(),
398
+ discounts_to_add: zod_1.z
399
+ .union([
400
+ zod_1.z.array(UpdateRampDiscountsToAddItemSchema.optional()),
401
+ UpdateRampDiscountsToAddSchema,
402
+ ])
403
+ .optional(),
222
404
  });
223
405
  exports.UpdateRampBodySchema = UpdateRampBodySchema;
224
406
  //Ramp.list
225
407
  const ListRampStatusSchema = zod_1.z.object({
226
- in: zod_1.z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(),
408
+ in: zod_1.z
409
+ .union([
410
+ zod_1.z.array(zod_1.z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional()),
411
+ zod_1.z.enum(['scheduled', 'succeeded', 'failed', 'draft']),
412
+ ])
413
+ .optional(),
227
414
  is: zod_1.z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(),
228
415
  });
229
416
  const ListRampSubscriptionIdSchema = zod_1.z.object({
230
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
417
+ in: zod_1.z
418
+ .union([
419
+ zod_1.z.array(zod_1.z.string().optional()),
420
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
421
+ ])
422
+ .optional(),
231
423
  is: zod_1.z.string().min(1).optional(),
232
424
  });
233
425
  const ListRampEffectiveFromSchema = zod_1.z.object({
234
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
235
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
236
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
237
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
426
+ after: zod_1.z
427
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
428
+ .optional(),
429
+ before: zod_1.z
430
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
431
+ .optional(),
432
+ on: zod_1.z
433
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
434
+ .optional(),
435
+ between: zod_1.z
436
+ .union([
437
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
438
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
439
+ ])
440
+ .optional(),
238
441
  });
239
442
  const ListRampUpdatedAtSchema = zod_1.z.object({
240
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
241
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
242
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
243
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
443
+ after: zod_1.z
444
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
445
+ .optional(),
446
+ before: zod_1.z
447
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
448
+ .optional(),
449
+ on: zod_1.z
450
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
451
+ .optional(),
452
+ between: zod_1.z
453
+ .union([
454
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
455
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
456
+ ])
457
+ .optional(),
244
458
  });
245
459
  const ListRampSortBySchema = zod_1.z.looseObject({
246
460
  asc: zod_1.z.enum(['effective_from', 'updated_at']).optional(),
@@ -43,31 +43,65 @@ const ListSiteMigrationDetailEntityTypeSchema = zod_1.z.object({
43
43
  ])
44
44
  .optional(),
45
45
  in: zod_1.z
46
- .enum([
47
- 'customer',
48
- 'subscription',
49
- 'invoice',
50
- 'credit_note',
51
- 'transaction',
52
- 'order',
46
+ .union([
47
+ zod_1.z.array(zod_1.z
48
+ .enum([
49
+ 'customer',
50
+ 'subscription',
51
+ 'invoice',
52
+ 'credit_note',
53
+ 'transaction',
54
+ 'order',
55
+ ])
56
+ .optional()),
57
+ zod_1.z.enum([
58
+ 'customer',
59
+ 'subscription',
60
+ 'invoice',
61
+ 'credit_note',
62
+ 'transaction',
63
+ 'order',
64
+ ]),
53
65
  ])
54
66
  .optional(),
55
67
  not_in: zod_1.z
56
- .enum([
57
- 'customer',
58
- 'subscription',
59
- 'invoice',
60
- 'credit_note',
61
- 'transaction',
62
- 'order',
68
+ .union([
69
+ zod_1.z.array(zod_1.z
70
+ .enum([
71
+ 'customer',
72
+ 'subscription',
73
+ 'invoice',
74
+ 'credit_note',
75
+ 'transaction',
76
+ 'order',
77
+ ])
78
+ .optional()),
79
+ zod_1.z.enum([
80
+ 'customer',
81
+ 'subscription',
82
+ 'invoice',
83
+ 'credit_note',
84
+ 'transaction',
85
+ 'order',
86
+ ]),
63
87
  ])
64
88
  .optional(),
65
89
  });
66
90
  const ListSiteMigrationDetailStatusSchema = zod_1.z.object({
67
91
  is: zod_1.z.enum(['moved_in', 'moved_out', 'moving_out']).optional(),
68
92
  is_not: zod_1.z.enum(['moved_in', 'moved_out', 'moving_out']).optional(),
69
- in: zod_1.z.enum(['moved_in', 'moved_out', 'moving_out']).optional(),
70
- not_in: zod_1.z.enum(['moved_in', 'moved_out', 'moving_out']).optional(),
93
+ in: zod_1.z
94
+ .union([
95
+ zod_1.z.array(zod_1.z.enum(['moved_in', 'moved_out', 'moving_out']).optional()),
96
+ zod_1.z.enum(['moved_in', 'moved_out', 'moving_out']),
97
+ ])
98
+ .optional(),
99
+ not_in: zod_1.z
100
+ .union([
101
+ zod_1.z.array(zod_1.z.enum(['moved_in', 'moved_out', 'moving_out']).optional()),
102
+ zod_1.z.enum(['moved_in', 'moved_out', 'moving_out']),
103
+ ])
104
+ .optional(),
71
105
  });
72
106
  const ListSiteMigrationDetailBodySchema = zod_1.z.looseObject({
73
107
  limit: zod_1.z.number().int().min(1).max(100).optional(),