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
@@ -7,10 +7,14 @@ const ListQuoteEntitlementsQuoteEntitlementEntityIdSchema = z.object({
7
7
  is: z.string().min(1).optional(),
8
8
  });
9
9
  const ListQuoteEntitlementsQuoteEntitlementStartDateSchema = z.object({
10
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
10
+ on: z
11
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
12
+ .optional(),
11
13
  });
12
14
  const ListQuoteEntitlementsQuoteEntitlementEndDateSchema = z.object({
13
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
15
+ on: z
16
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
17
+ .optional(),
14
18
  });
15
19
  const ListQuoteEntitlementsQuoteEntitlementBodySchema = z.looseObject({
16
20
  limit: z.number().int().min(1).max(100).optional(),
@@ -13,6 +13,26 @@ const CreateForSubscriptionRampContractTermSchema = z.object({
13
13
  cancellation_cutoff_period: z.number().int().optional(),
14
14
  renewal_billing_cycles: z.number().int().optional(),
15
15
  });
16
+ const CreateForSubscriptionRampItemsToAddItemSchema = z.object({
17
+ item_price_id: z.string().max(100),
18
+ quantity: z.number().int().min(1).optional(),
19
+ quantity_in_decimal: z.string().max(33).optional(),
20
+ unit_price: z.number().int().min(0).optional(),
21
+ unit_price_in_decimal: z.string().max(39).optional(),
22
+ billing_cycles: z.number().int().min(0).optional(),
23
+ service_period_days: z.number().int().min(1).max(4000).optional(),
24
+ charge_on_event: z
25
+ .enum([
26
+ 'subscription_trial_start',
27
+ 'plan_activation',
28
+ 'subscription_activation',
29
+ 'contract_termination',
30
+ ])
31
+ .optional(),
32
+ charge_once: z.boolean().optional(),
33
+ charge_on_option: z.enum(['immediately', 'on_event']).optional(),
34
+ description: z.string().max(2000).optional(),
35
+ });
16
36
  const CreateForSubscriptionRampItemsToAddSchema = z.object({
17
37
  item_price_id: z.array(z.string().max(100).optional()),
18
38
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -37,7 +57,27 @@ const CreateForSubscriptionRampItemsToAddSchema = z.object({
37
57
  charge_on_option: z
38
58
  .array(z.enum(['immediately', 'on_event']).optional())
39
59
  .optional(),
40
- description: z.array(z.string().max(500).optional()).optional(),
60
+ description: z.array(z.string().max(2000).optional()).optional(),
61
+ });
62
+ const CreateForSubscriptionRampItemsToUpdateItemSchema = z.object({
63
+ item_price_id: z.string().max(100),
64
+ quantity: z.number().int().min(1).optional(),
65
+ quantity_in_decimal: z.string().max(33).optional(),
66
+ unit_price: z.number().int().min(0).optional(),
67
+ unit_price_in_decimal: z.string().max(39).optional(),
68
+ billing_cycles: z.number().int().min(0).optional(),
69
+ service_period_days: z.number().int().min(1).max(4000).optional(),
70
+ charge_on_event: z
71
+ .enum([
72
+ 'subscription_trial_start',
73
+ 'plan_activation',
74
+ 'subscription_activation',
75
+ 'contract_termination',
76
+ ])
77
+ .optional(),
78
+ charge_once: z.boolean().optional(),
79
+ charge_on_option: z.enum(['immediately', 'on_event']).optional(),
80
+ description: z.string().max(2000).optional(),
41
81
  });
42
82
  const CreateForSubscriptionRampItemsToUpdateSchema = z.object({
43
83
  item_price_id: z.array(z.string().max(100).optional()),
@@ -63,7 +103,18 @@ const CreateForSubscriptionRampItemsToUpdateSchema = z.object({
63
103
  charge_on_option: z
64
104
  .array(z.enum(['immediately', 'on_event']).optional())
65
105
  .optional(),
66
- description: z.array(z.string().max(500).optional()).optional(),
106
+ description: z.array(z.string().max(2000).optional()).optional(),
107
+ });
108
+ const CreateForSubscriptionRampItemTiersItemSchema = z.object({
109
+ item_price_id: z.string().max(100).optional(),
110
+ starting_unit: z.number().int().min(1).optional(),
111
+ ending_unit: z.number().int().optional(),
112
+ price: z.number().int().min(0).optional(),
113
+ starting_unit_in_decimal: z.string().max(33).optional(),
114
+ ending_unit_in_decimal: z.string().max(33).optional(),
115
+ price_in_decimal: z.string().max(39).optional(),
116
+ pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
117
+ package_size: z.number().int().min(1).optional(),
67
118
  });
68
119
  const CreateForSubscriptionRampItemTiersSchema = z.object({
69
120
  item_price_id: z.array(z.string().max(100).optional()).optional(),
@@ -78,10 +129,25 @@ const CreateForSubscriptionRampItemTiersSchema = z.object({
78
129
  .optional(),
79
130
  package_size: z.array(z.number().int().min(1).optional()).optional(),
80
131
  });
132
+ const CreateForSubscriptionRampCouponsToAddItemSchema = z.object({
133
+ coupon_id: z.string().max(100).optional(),
134
+ apply_till: z.number().int().optional(),
135
+ });
81
136
  const CreateForSubscriptionRampCouponsToAddSchema = z.object({
82
137
  coupon_id: z.array(z.string().max(100).optional()).optional(),
83
138
  apply_till: z.array(z.number().int().optional()).optional(),
84
139
  });
140
+ const CreateForSubscriptionRampDiscountsToAddItemSchema = z.object({
141
+ apply_on: z.enum(['invoice_amount', 'specific_item_price']),
142
+ duration_type: z.enum(['one_time', 'forever', 'limited_period']),
143
+ percentage: z.number().min(0.01).max(100).optional(),
144
+ amount: z.number().int().min(0).optional(),
145
+ quantity: z.number().int().min(1).optional(),
146
+ period: z.number().int().min(1).optional(),
147
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
148
+ included_in_mrr: z.boolean().optional(),
149
+ item_price_id: z.string().max(100).optional(),
150
+ });
85
151
  const CreateForSubscriptionRampDiscountsToAddSchema = z.object({
86
152
  apply_on: z.array(z.enum(['invoice_amount', 'specific_item_price']).optional()),
87
153
  duration_type: z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
@@ -103,11 +169,36 @@ const CreateForSubscriptionRampBodySchema = z.looseObject({
103
169
  items_to_remove: z.array(z.string().max(100).optional()).optional(),
104
170
  billing_configuration: CreateForSubscriptionRampBillingConfigurationSchema.optional(),
105
171
  contract_term: CreateForSubscriptionRampContractTermSchema.optional(),
106
- items_to_add: CreateForSubscriptionRampItemsToAddSchema.optional(),
107
- items_to_update: CreateForSubscriptionRampItemsToUpdateSchema.optional(),
108
- item_tiers: CreateForSubscriptionRampItemTiersSchema.optional(),
109
- coupons_to_add: CreateForSubscriptionRampCouponsToAddSchema.optional(),
110
- discounts_to_add: CreateForSubscriptionRampDiscountsToAddSchema.optional(),
172
+ items_to_add: z
173
+ .union([
174
+ z.array(CreateForSubscriptionRampItemsToAddItemSchema.optional()),
175
+ CreateForSubscriptionRampItemsToAddSchema,
176
+ ])
177
+ .optional(),
178
+ items_to_update: z
179
+ .union([
180
+ z.array(CreateForSubscriptionRampItemsToUpdateItemSchema.optional()),
181
+ CreateForSubscriptionRampItemsToUpdateSchema,
182
+ ])
183
+ .optional(),
184
+ item_tiers: z
185
+ .union([
186
+ z.array(CreateForSubscriptionRampItemTiersItemSchema.optional()),
187
+ CreateForSubscriptionRampItemTiersSchema,
188
+ ])
189
+ .optional(),
190
+ coupons_to_add: z
191
+ .union([
192
+ z.array(CreateForSubscriptionRampCouponsToAddItemSchema.optional()),
193
+ CreateForSubscriptionRampCouponsToAddSchema,
194
+ ])
195
+ .optional(),
196
+ discounts_to_add: z
197
+ .union([
198
+ z.array(CreateForSubscriptionRampDiscountsToAddItemSchema.optional()),
199
+ CreateForSubscriptionRampDiscountsToAddSchema,
200
+ ])
201
+ .optional(),
111
202
  });
112
203
  export { CreateForSubscriptionRampBodySchema };
113
204
  //Ramp.update
@@ -121,6 +212,26 @@ const UpdateRampContractTermSchema = z.object({
121
212
  cancellation_cutoff_period: z.number().int().optional(),
122
213
  renewal_billing_cycles: z.number().int().optional(),
123
214
  });
215
+ const UpdateRampItemsToAddItemSchema = z.object({
216
+ item_price_id: z.string().max(100),
217
+ quantity: z.number().int().min(1).optional(),
218
+ quantity_in_decimal: z.string().max(33).optional(),
219
+ unit_price: z.number().int().min(0).optional(),
220
+ unit_price_in_decimal: z.string().max(39).optional(),
221
+ billing_cycles: z.number().int().min(0).optional(),
222
+ service_period_days: z.number().int().min(1).max(4000).optional(),
223
+ charge_on_event: z
224
+ .enum([
225
+ 'subscription_trial_start',
226
+ 'plan_activation',
227
+ 'subscription_activation',
228
+ 'contract_termination',
229
+ ])
230
+ .optional(),
231
+ charge_once: z.boolean().optional(),
232
+ charge_on_option: z.enum(['immediately', 'on_event']).optional(),
233
+ description: z.string().max(2000).optional(),
234
+ });
124
235
  const UpdateRampItemsToAddSchema = z.object({
125
236
  item_price_id: z.array(z.string().max(100).optional()),
126
237
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -145,7 +256,27 @@ const UpdateRampItemsToAddSchema = z.object({
145
256
  charge_on_option: z
146
257
  .array(z.enum(['immediately', 'on_event']).optional())
147
258
  .optional(),
148
- description: z.array(z.string().max(500).optional()).optional(),
259
+ description: z.array(z.string().max(2000).optional()).optional(),
260
+ });
261
+ const UpdateRampItemsToUpdateItemSchema = z.object({
262
+ item_price_id: z.string().max(100),
263
+ quantity: z.number().int().min(1).optional(),
264
+ quantity_in_decimal: z.string().max(33).optional(),
265
+ unit_price: z.number().int().min(0).optional(),
266
+ unit_price_in_decimal: z.string().max(39).optional(),
267
+ billing_cycles: z.number().int().min(0).optional(),
268
+ service_period_days: z.number().int().min(1).max(4000).optional(),
269
+ charge_on_event: z
270
+ .enum([
271
+ 'subscription_trial_start',
272
+ 'plan_activation',
273
+ 'subscription_activation',
274
+ 'contract_termination',
275
+ ])
276
+ .optional(),
277
+ charge_once: z.boolean().optional(),
278
+ charge_on_option: z.enum(['immediately', 'on_event']).optional(),
279
+ description: z.string().max(2000).optional(),
149
280
  });
150
281
  const UpdateRampItemsToUpdateSchema = z.object({
151
282
  item_price_id: z.array(z.string().max(100).optional()),
@@ -171,7 +302,18 @@ const UpdateRampItemsToUpdateSchema = z.object({
171
302
  charge_on_option: z
172
303
  .array(z.enum(['immediately', 'on_event']).optional())
173
304
  .optional(),
174
- description: z.array(z.string().max(500).optional()).optional(),
305
+ description: z.array(z.string().max(2000).optional()).optional(),
306
+ });
307
+ const UpdateRampItemTiersItemSchema = z.object({
308
+ item_price_id: z.string().max(100).optional(),
309
+ starting_unit: z.number().int().min(1).optional(),
310
+ ending_unit: z.number().int().optional(),
311
+ price: z.number().int().min(0).optional(),
312
+ starting_unit_in_decimal: z.string().max(33).optional(),
313
+ ending_unit_in_decimal: z.string().max(33).optional(),
314
+ price_in_decimal: z.string().max(39).optional(),
315
+ pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
316
+ package_size: z.number().int().min(1).optional(),
175
317
  });
176
318
  const UpdateRampItemTiersSchema = z.object({
177
319
  item_price_id: z.array(z.string().max(100).optional()).optional(),
@@ -186,10 +328,25 @@ const UpdateRampItemTiersSchema = z.object({
186
328
  .optional(),
187
329
  package_size: z.array(z.number().int().min(1).optional()).optional(),
188
330
  });
331
+ const UpdateRampCouponsToAddItemSchema = z.object({
332
+ coupon_id: z.string().max(100).optional(),
333
+ apply_till: z.number().int().optional(),
334
+ });
189
335
  const UpdateRampCouponsToAddSchema = z.object({
190
336
  coupon_id: z.array(z.string().max(100).optional()).optional(),
191
337
  apply_till: z.array(z.number().int().optional()).optional(),
192
338
  });
339
+ const UpdateRampDiscountsToAddItemSchema = z.object({
340
+ apply_on: z.enum(['invoice_amount', 'specific_item_price']),
341
+ duration_type: z.enum(['one_time', 'forever', 'limited_period']),
342
+ percentage: z.number().min(0.01).max(100).optional(),
343
+ amount: z.number().int().min(0).optional(),
344
+ quantity: z.number().int().min(1).optional(),
345
+ period: z.number().int().min(1).optional(),
346
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
347
+ included_in_mrr: z.boolean().optional(),
348
+ item_price_id: z.string().max(100).optional(),
349
+ });
193
350
  const UpdateRampDiscountsToAddSchema = z.object({
194
351
  apply_on: z.array(z.enum(['invoice_amount', 'specific_item_price']).optional()),
195
352
  duration_type: z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
@@ -211,33 +368,90 @@ const UpdateRampBodySchema = z.looseObject({
211
368
  items_to_remove: z.array(z.string().max(100).optional()).optional(),
212
369
  billing_configuration: UpdateRampBillingConfigurationSchema.optional(),
213
370
  contract_term: UpdateRampContractTermSchema.optional(),
214
- items_to_add: UpdateRampItemsToAddSchema.optional(),
215
- items_to_update: UpdateRampItemsToUpdateSchema.optional(),
216
- item_tiers: UpdateRampItemTiersSchema.optional(),
217
- coupons_to_add: UpdateRampCouponsToAddSchema.optional(),
218
- discounts_to_add: UpdateRampDiscountsToAddSchema.optional(),
371
+ items_to_add: z
372
+ .union([
373
+ z.array(UpdateRampItemsToAddItemSchema.optional()),
374
+ UpdateRampItemsToAddSchema,
375
+ ])
376
+ .optional(),
377
+ items_to_update: z
378
+ .union([
379
+ z.array(UpdateRampItemsToUpdateItemSchema.optional()),
380
+ UpdateRampItemsToUpdateSchema,
381
+ ])
382
+ .optional(),
383
+ item_tiers: z
384
+ .union([
385
+ z.array(UpdateRampItemTiersItemSchema.optional()),
386
+ UpdateRampItemTiersSchema,
387
+ ])
388
+ .optional(),
389
+ coupons_to_add: z
390
+ .union([
391
+ z.array(UpdateRampCouponsToAddItemSchema.optional()),
392
+ UpdateRampCouponsToAddSchema,
393
+ ])
394
+ .optional(),
395
+ discounts_to_add: z
396
+ .union([
397
+ z.array(UpdateRampDiscountsToAddItemSchema.optional()),
398
+ UpdateRampDiscountsToAddSchema,
399
+ ])
400
+ .optional(),
219
401
  });
220
402
  export { UpdateRampBodySchema };
221
403
  //Ramp.list
222
404
  const ListRampStatusSchema = z.object({
223
- in: z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(),
405
+ in: z
406
+ .union([
407
+ z.array(z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional()),
408
+ z.enum(['scheduled', 'succeeded', 'failed', 'draft']),
409
+ ])
410
+ .optional(),
224
411
  is: z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(),
225
412
  });
226
413
  const ListRampSubscriptionIdSchema = z.object({
227
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
414
+ in: z
415
+ .union([
416
+ z.array(z.string().optional()),
417
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
418
+ ])
419
+ .optional(),
228
420
  is: z.string().min(1).optional(),
229
421
  });
230
422
  const ListRampEffectiveFromSchema = z.object({
231
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
232
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
233
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
234
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
423
+ after: z
424
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
425
+ .optional(),
426
+ before: z
427
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
428
+ .optional(),
429
+ on: z
430
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
431
+ .optional(),
432
+ between: z
433
+ .union([
434
+ z.array(z.number().int().optional()).min(2).max(2),
435
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
436
+ ])
437
+ .optional(),
235
438
  });
236
439
  const ListRampUpdatedAtSchema = z.object({
237
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
238
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
239
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
240
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
440
+ after: z
441
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
442
+ .optional(),
443
+ before: z
444
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
445
+ .optional(),
446
+ on: z
447
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
448
+ .optional(),
449
+ between: z
450
+ .union([
451
+ z.array(z.number().int().optional()).min(2).max(2),
452
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
453
+ ])
454
+ .optional(),
241
455
  });
242
456
  const ListRampSortBySchema = z.looseObject({
243
457
  asc: z.enum(['effective_from', 'updated_at']).optional(),
@@ -40,31 +40,65 @@ const ListSiteMigrationDetailEntityTypeSchema = z.object({
40
40
  ])
41
41
  .optional(),
42
42
  in: z
43
- .enum([
44
- 'customer',
45
- 'subscription',
46
- 'invoice',
47
- 'credit_note',
48
- 'transaction',
49
- 'order',
43
+ .union([
44
+ z.array(z
45
+ .enum([
46
+ 'customer',
47
+ 'subscription',
48
+ 'invoice',
49
+ 'credit_note',
50
+ 'transaction',
51
+ 'order',
52
+ ])
53
+ .optional()),
54
+ z.enum([
55
+ 'customer',
56
+ 'subscription',
57
+ 'invoice',
58
+ 'credit_note',
59
+ 'transaction',
60
+ 'order',
61
+ ]),
50
62
  ])
51
63
  .optional(),
52
64
  not_in: z
53
- .enum([
54
- 'customer',
55
- 'subscription',
56
- 'invoice',
57
- 'credit_note',
58
- 'transaction',
59
- 'order',
65
+ .union([
66
+ z.array(z
67
+ .enum([
68
+ 'customer',
69
+ 'subscription',
70
+ 'invoice',
71
+ 'credit_note',
72
+ 'transaction',
73
+ 'order',
74
+ ])
75
+ .optional()),
76
+ z.enum([
77
+ 'customer',
78
+ 'subscription',
79
+ 'invoice',
80
+ 'credit_note',
81
+ 'transaction',
82
+ 'order',
83
+ ]),
60
84
  ])
61
85
  .optional(),
62
86
  });
63
87
  const ListSiteMigrationDetailStatusSchema = z.object({
64
88
  is: z.enum(['moved_in', 'moved_out', 'moving_out']).optional(),
65
89
  is_not: z.enum(['moved_in', 'moved_out', 'moving_out']).optional(),
66
- in: z.enum(['moved_in', 'moved_out', 'moving_out']).optional(),
67
- not_in: z.enum(['moved_in', 'moved_out', 'moving_out']).optional(),
90
+ in: z
91
+ .union([
92
+ z.array(z.enum(['moved_in', 'moved_out', 'moving_out']).optional()),
93
+ z.enum(['moved_in', 'moved_out', 'moving_out']),
94
+ ])
95
+ .optional(),
96
+ not_in: z
97
+ .union([
98
+ z.array(z.enum(['moved_in', 'moved_out', 'moving_out']).optional()),
99
+ z.enum(['moved_in', 'moved_out', 'moving_out']),
100
+ ])
101
+ .optional(),
68
102
  });
69
103
  const ListSiteMigrationDetailBodySchema = z.looseObject({
70
104
  limit: z.number().int().min(1).max(100).optional(),