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
@@ -61,27 +61,67 @@ const ListAttachedItemIdSchema = zod_1.z.object({
61
61
  is: zod_1.z.string().min(1).optional(),
62
62
  is_not: zod_1.z.string().min(1).optional(),
63
63
  starts_with: zod_1.z.string().min(1).optional(),
64
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
65
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
64
+ in: zod_1.z
65
+ .union([
66
+ zod_1.z.array(zod_1.z.string().optional()),
67
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
68
+ ])
69
+ .optional(),
70
+ not_in: zod_1.z
71
+ .union([
72
+ zod_1.z.array(zod_1.z.string().optional()),
73
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
74
+ ])
75
+ .optional(),
66
76
  });
67
77
  const ListAttachedItemItemIdSchema = zod_1.z.object({
68
78
  is: zod_1.z.string().min(1).optional(),
69
79
  is_not: zod_1.z.string().min(1).optional(),
70
80
  starts_with: zod_1.z.string().min(1).optional(),
71
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
72
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
81
+ in: zod_1.z
82
+ .union([
83
+ zod_1.z.array(zod_1.z.string().optional()),
84
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
85
+ ])
86
+ .optional(),
87
+ not_in: zod_1.z
88
+ .union([
89
+ zod_1.z.array(zod_1.z.string().optional()),
90
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
91
+ ])
92
+ .optional(),
73
93
  });
74
94
  const ListAttachedItemTypeSchema = zod_1.z.object({
75
95
  is: zod_1.z.enum(['recommended', 'mandatory', 'optional']).optional(),
76
96
  is_not: zod_1.z.enum(['recommended', 'mandatory', 'optional']).optional(),
77
- in: zod_1.z.enum(['recommended', 'mandatory', 'optional']).optional(),
78
- not_in: zod_1.z.enum(['recommended', 'mandatory', 'optional']).optional(),
97
+ in: zod_1.z
98
+ .union([
99
+ zod_1.z.array(zod_1.z.enum(['recommended', 'mandatory', 'optional']).optional()),
100
+ zod_1.z.enum(['recommended', 'mandatory', 'optional']),
101
+ ])
102
+ .optional(),
103
+ not_in: zod_1.z
104
+ .union([
105
+ zod_1.z.array(zod_1.z.enum(['recommended', 'mandatory', 'optional']).optional()),
106
+ zod_1.z.enum(['recommended', 'mandatory', 'optional']),
107
+ ])
108
+ .optional(),
79
109
  });
80
110
  const ListAttachedItemItemTypeSchema = zod_1.z.object({
81
111
  is: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
82
112
  is_not: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
83
- in: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
84
- not_in: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
113
+ in: zod_1.z
114
+ .union([
115
+ zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()),
116
+ zod_1.z.enum(['plan', 'addon', 'charge']),
117
+ ])
118
+ .optional(),
119
+ not_in: zod_1.z
120
+ .union([
121
+ zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()),
122
+ zod_1.z.enum(['plan', 'addon', 'charge']),
123
+ ])
124
+ .optional(),
85
125
  });
86
126
  const ListAttachedItemChargeOnEventSchema = zod_1.z.object({
87
127
  is: zod_1.z
@@ -105,31 +145,66 @@ const ListAttachedItemChargeOnEventSchema = zod_1.z.object({
105
145
  ])
106
146
  .optional(),
107
147
  in: zod_1.z
108
- .enum([
109
- 'subscription_creation',
110
- 'subscription_trial_start',
111
- 'plan_activation',
112
- 'subscription_activation',
113
- 'contract_termination',
114
- 'on_demand',
148
+ .union([
149
+ zod_1.z.array(zod_1.z
150
+ .enum([
151
+ 'subscription_creation',
152
+ 'subscription_trial_start',
153
+ 'plan_activation',
154
+ 'subscription_activation',
155
+ 'contract_termination',
156
+ 'on_demand',
157
+ ])
158
+ .optional()),
159
+ zod_1.z.enum([
160
+ 'subscription_creation',
161
+ 'subscription_trial_start',
162
+ 'plan_activation',
163
+ 'subscription_activation',
164
+ 'contract_termination',
165
+ 'on_demand',
166
+ ]),
115
167
  ])
116
168
  .optional(),
117
169
  not_in: zod_1.z
118
- .enum([
119
- 'subscription_creation',
120
- 'subscription_trial_start',
121
- 'plan_activation',
122
- 'subscription_activation',
123
- 'contract_termination',
124
- 'on_demand',
170
+ .union([
171
+ zod_1.z.array(zod_1.z
172
+ .enum([
173
+ 'subscription_creation',
174
+ 'subscription_trial_start',
175
+ 'plan_activation',
176
+ 'subscription_activation',
177
+ 'contract_termination',
178
+ 'on_demand',
179
+ ])
180
+ .optional()),
181
+ zod_1.z.enum([
182
+ 'subscription_creation',
183
+ 'subscription_trial_start',
184
+ 'plan_activation',
185
+ 'subscription_activation',
186
+ 'contract_termination',
187
+ 'on_demand',
188
+ ]),
125
189
  ])
126
190
  .optional(),
127
191
  });
128
192
  const ListAttachedItemUpdatedAtSchema = zod_1.z.object({
129
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
130
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
131
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
132
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
193
+ after: zod_1.z
194
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
195
+ .optional(),
196
+ before: zod_1.z
197
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
198
+ .optional(),
199
+ on: zod_1.z
200
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
201
+ .optional(),
202
+ between: zod_1.z
203
+ .union([
204
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
205
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
206
+ ])
207
+ .optional(),
133
208
  });
134
209
  const ListAttachedItemBodySchema = zod_1.z.looseObject({
135
210
  limit: zod_1.z.number().int().min(1).max(100).optional(),
@@ -16,7 +16,7 @@ const ListBusinessEntityNameSchema = zod_1.z.object({
16
16
  is: zod_1.z.string().min(1).optional(),
17
17
  is_not: zod_1.z.string().min(1).optional(),
18
18
  starts_with: zod_1.z.string().min(1).optional(),
19
- is_present: zod_1.z.enum(['true', 'false']).optional(),
19
+ is_present: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
20
20
  });
21
21
  const ListBusinessEntityBodySchema = zod_1.z.looseObject({
22
22
  limit: zod_1.z.number().int().min(1).max(100).optional(),
@@ -51,10 +51,21 @@ const GetTransfersBusinessEntityActiveResourceIdSchema = zod_1.z.object({
51
51
  is: zod_1.z.string().min(1).optional(),
52
52
  });
53
53
  const GetTransfersBusinessEntityCreatedAtSchema = zod_1.z.object({
54
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
55
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
56
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
57
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
54
+ after: zod_1.z
55
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
56
+ .optional(),
57
+ before: zod_1.z
58
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
59
+ .optional(),
60
+ on: zod_1.z
61
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
62
+ .optional(),
63
+ between: zod_1.z
64
+ .union([
65
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
66
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
67
+ ])
68
+ .optional(),
58
69
  });
59
70
  const GetTransfersBusinessEntitySortBySchema = zod_1.z.looseObject({
60
71
  asc: zod_1.z.enum(['created_at']).optional(),
@@ -28,10 +28,10 @@ const UpdateDraftBusinessRuleBodySchema = zod_1.z.looseObject({
28
28
  exports.UpdateDraftBusinessRuleBodySchema = UpdateDraftBusinessRuleBodySchema;
29
29
  //BusinessRule.list
30
30
  const ListBusinessRuleDraftSchema = zod_1.z.object({
31
- is: zod_1.z.enum(['true', 'false']).optional(),
31
+ is: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
32
32
  });
33
33
  const ListBusinessRuleActiveSchema = zod_1.z.object({
34
- is: zod_1.z.enum(['true', 'false']).optional(),
34
+ is: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
35
35
  });
36
36
  const ListBusinessRuleBodySchema = zod_1.z.looseObject({
37
37
  limit: zod_1.z.number().int().min(1).max(100).optional(),
@@ -48,7 +48,7 @@ const RemoveRulesBusinessRulesetBodySchema = zod_1.z.looseObject({
48
48
  exports.RemoveRulesBusinessRulesetBodySchema = RemoveRulesBusinessRulesetBodySchema;
49
49
  //BusinessRuleset.listRules
50
50
  const ListRulesBusinessRulesetActiveSchema = zod_1.z.object({
51
- is: zod_1.z.enum(['true', 'false']).optional(),
51
+ is: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
52
52
  });
53
53
  const ListRulesBusinessRulesetBodySchema = zod_1.z.looseObject({
54
54
  limit: zod_1.z.number().int().min(1).max(100).optional(),
@@ -58,7 +58,7 @@ const ListRulesBusinessRulesetBodySchema = zod_1.z.looseObject({
58
58
  exports.ListRulesBusinessRulesetBodySchema = ListRulesBusinessRulesetBodySchema;
59
59
  //BusinessRuleset.list
60
60
  const ListBusinessRulesetActiveSchema = zod_1.z.object({
61
- is: zod_1.z.enum(['true', 'false']).optional(),
61
+ is: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
62
62
  });
63
63
  const ListBusinessRulesetBodySchema = zod_1.z.looseObject({
64
64
  limit: zod_1.z.number().int().min(1).max(100).optional(),
@@ -32,10 +32,21 @@ const CreateCommentBodySchema = zod_1.z.looseObject({
32
32
  exports.CreateCommentBodySchema = CreateCommentBodySchema;
33
33
  //Comment.list
34
34
  const ListCommentCreatedAtSchema = zod_1.z.object({
35
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
36
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
37
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
38
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
35
+ after: zod_1.z
36
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
37
+ .optional(),
38
+ before: zod_1.z
39
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
40
+ .optional(),
41
+ on: zod_1.z
42
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
43
+ .optional(),
44
+ between: zod_1.z
45
+ .union([
46
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
47
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
48
+ ])
49
+ .optional(),
39
50
  });
40
51
  const ListCommentSortBySchema = zod_1.z.looseObject({
41
52
  asc: zod_1.z.enum(['created_at']).optional(),
@@ -42,11 +42,22 @@ const CreateCouponBodySchema = zod_1.z.looseObject({
42
42
  exports.CreateCouponBodySchema = CreateCouponBodySchema;
43
43
  //Coupon.createForItems
44
44
  const CreateForItemsCouponMetaDataSchema = zod_1.z.looseObject({});
45
+ const CreateForItemsCouponItemConstraintsItemSchema = zod_1.z.object({
46
+ constraint: zod_1.z.enum(['none', 'all', 'specific', 'criteria']),
47
+ item_type: zod_1.z.enum(['plan', 'addon', 'charge']),
48
+ item_price_ids: zod_1.z.array(zod_1.z.string().optional()).optional(),
49
+ });
45
50
  const CreateForItemsCouponItemConstraintsSchema = zod_1.z.object({
46
51
  constraint: zod_1.z.array(zod_1.z.enum(['none', 'all', 'specific', 'criteria']).optional()),
47
52
  item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()),
48
53
  item_price_ids: zod_1.z.array(zod_1.z.array(zod_1.z.string().optional()).optional()).optional(),
49
54
  });
55
+ const CreateForItemsCouponItemConstraintCriteriaItemSchema = zod_1.z.object({
56
+ item_type: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
57
+ item_family_ids: zod_1.z.array(zod_1.z.string().optional()).optional(),
58
+ currencies: zod_1.z.array(zod_1.z.string().optional()).optional(),
59
+ item_price_periods: zod_1.z.array(zod_1.z.string().optional()).optional(),
60
+ });
50
61
  const CreateForItemsCouponItemConstraintCriteriaSchema = zod_1.z.object({
51
62
  item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
52
63
  item_family_ids: zod_1.z
@@ -57,6 +68,16 @@ const CreateForItemsCouponItemConstraintCriteriaSchema = zod_1.z.object({
57
68
  .array(zod_1.z.array(zod_1.z.string().optional()).optional())
58
69
  .optional(),
59
70
  });
71
+ const CreateForItemsCouponCouponConstraintsItemSchema = zod_1.z.object({
72
+ entity_type: zod_1.z.enum(['customer']),
73
+ type: zod_1.z.enum([
74
+ 'max_redemptions',
75
+ 'unique_by',
76
+ 'existing_customer',
77
+ 'new_customer',
78
+ ]),
79
+ value: zod_1.z.string().max(65000).optional(),
80
+ });
60
81
  const CreateForItemsCouponCouponConstraintsSchema = zod_1.z.object({
61
82
  entity_type: zod_1.z.array(zod_1.z.enum(['customer']).optional()),
62
83
  type: zod_1.z.array(zod_1.z
@@ -97,18 +118,44 @@ const CreateForItemsCouponBodySchema = zod_1.z.looseObject({
97
118
  period: zod_1.z.number().int().min(1).optional(),
98
119
  period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
99
120
  status: zod_1.z.enum(['active', 'archived']).optional(),
100
- item_constraints: CreateForItemsCouponItemConstraintsSchema.optional(),
101
- item_constraint_criteria: CreateForItemsCouponItemConstraintCriteriaSchema.optional(),
102
- coupon_constraints: CreateForItemsCouponCouponConstraintsSchema.optional(),
121
+ item_constraints: zod_1.z
122
+ .union([
123
+ zod_1.z.array(CreateForItemsCouponItemConstraintsItemSchema.optional()),
124
+ CreateForItemsCouponItemConstraintsSchema,
125
+ ])
126
+ .optional(),
127
+ item_constraint_criteria: zod_1.z
128
+ .union([
129
+ zod_1.z.array(CreateForItemsCouponItemConstraintCriteriaItemSchema.optional()),
130
+ CreateForItemsCouponItemConstraintCriteriaSchema,
131
+ ])
132
+ .optional(),
133
+ coupon_constraints: zod_1.z
134
+ .union([
135
+ zod_1.z.array(CreateForItemsCouponCouponConstraintsItemSchema.optional()),
136
+ CreateForItemsCouponCouponConstraintsSchema,
137
+ ])
138
+ .optional(),
103
139
  });
104
140
  exports.CreateForItemsCouponBodySchema = CreateForItemsCouponBodySchema;
105
141
  //Coupon.updateForItems
106
142
  const UpdateForItemsCouponMetaDataSchema = zod_1.z.looseObject({});
143
+ const UpdateForItemsCouponItemConstraintsItemSchema = zod_1.z.object({
144
+ constraint: zod_1.z.enum(['none', 'all', 'specific', 'criteria']),
145
+ item_type: zod_1.z.enum(['plan', 'addon', 'charge']),
146
+ item_price_ids: zod_1.z.array(zod_1.z.string().optional()).optional(),
147
+ });
107
148
  const UpdateForItemsCouponItemConstraintsSchema = zod_1.z.object({
108
149
  constraint: zod_1.z.array(zod_1.z.enum(['none', 'all', 'specific', 'criteria']).optional()),
109
150
  item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()),
110
151
  item_price_ids: zod_1.z.array(zod_1.z.array(zod_1.z.string().optional()).optional()).optional(),
111
152
  });
153
+ const UpdateForItemsCouponItemConstraintCriteriaItemSchema = zod_1.z.object({
154
+ item_type: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
155
+ item_family_ids: zod_1.z.array(zod_1.z.string().optional()).optional(),
156
+ currencies: zod_1.z.array(zod_1.z.string().optional()).optional(),
157
+ item_price_periods: zod_1.z.array(zod_1.z.string().optional()).optional(),
158
+ });
112
159
  const UpdateForItemsCouponItemConstraintCriteriaSchema = zod_1.z.object({
113
160
  item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
114
161
  item_family_ids: zod_1.z
@@ -119,6 +166,16 @@ const UpdateForItemsCouponItemConstraintCriteriaSchema = zod_1.z.object({
119
166
  .array(zod_1.z.array(zod_1.z.string().optional()).optional())
120
167
  .optional(),
121
168
  });
169
+ const UpdateForItemsCouponCouponConstraintsItemSchema = zod_1.z.object({
170
+ entity_type: zod_1.z.enum(['customer']),
171
+ type: zod_1.z.enum([
172
+ 'max_redemptions',
173
+ 'unique_by',
174
+ 'existing_customer',
175
+ 'new_customer',
176
+ ]),
177
+ value: zod_1.z.string().max(65000).optional(),
178
+ });
122
179
  const UpdateForItemsCouponCouponConstraintsSchema = zod_1.z.object({
123
180
  entity_type: zod_1.z.array(zod_1.z.enum(['customer']).optional()),
124
181
  type: zod_1.z.array(zod_1.z
@@ -159,9 +216,24 @@ const UpdateForItemsCouponBodySchema = zod_1.z.looseObject({
159
216
  included_in_mrr: zod_1.z.boolean().optional(),
160
217
  period: zod_1.z.number().int().min(1).optional(),
161
218
  period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
162
- item_constraints: UpdateForItemsCouponItemConstraintsSchema.optional(),
163
- item_constraint_criteria: UpdateForItemsCouponItemConstraintCriteriaSchema.optional(),
164
- coupon_constraints: UpdateForItemsCouponCouponConstraintsSchema.optional(),
219
+ item_constraints: zod_1.z
220
+ .union([
221
+ zod_1.z.array(UpdateForItemsCouponItemConstraintsItemSchema.optional()),
222
+ UpdateForItemsCouponItemConstraintsSchema,
223
+ ])
224
+ .optional(),
225
+ item_constraint_criteria: zod_1.z
226
+ .union([
227
+ zod_1.z.array(UpdateForItemsCouponItemConstraintCriteriaItemSchema.optional()),
228
+ UpdateForItemsCouponItemConstraintCriteriaSchema,
229
+ ])
230
+ .optional(),
231
+ coupon_constraints: zod_1.z
232
+ .union([
233
+ zod_1.z.array(UpdateForItemsCouponCouponConstraintsItemSchema.optional()),
234
+ UpdateForItemsCouponCouponConstraintsSchema,
235
+ ])
236
+ .optional(),
165
237
  });
166
238
  exports.UpdateForItemsCouponBodySchema = UpdateForItemsCouponBodySchema;
167
239
  //Coupon.list
@@ -169,36 +241,88 @@ const ListCouponIdSchema = zod_1.z.object({
169
241
  is: zod_1.z.string().min(1).optional(),
170
242
  is_not: zod_1.z.string().min(1).optional(),
171
243
  starts_with: zod_1.z.string().min(1).optional(),
172
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
173
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
244
+ in: zod_1.z
245
+ .union([
246
+ zod_1.z.array(zod_1.z.string().optional()),
247
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
248
+ ])
249
+ .optional(),
250
+ not_in: zod_1.z
251
+ .union([
252
+ zod_1.z.array(zod_1.z.string().optional()),
253
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
254
+ ])
255
+ .optional(),
174
256
  });
175
257
  const ListCouponNameSchema = zod_1.z.object({
176
258
  is: zod_1.z.string().min(1).optional(),
177
259
  is_not: zod_1.z.string().min(1).optional(),
178
260
  starts_with: zod_1.z.string().min(1).optional(),
179
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
180
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
261
+ in: zod_1.z
262
+ .union([
263
+ zod_1.z.array(zod_1.z.string().optional()),
264
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
265
+ ])
266
+ .optional(),
267
+ not_in: zod_1.z
268
+ .union([
269
+ zod_1.z.array(zod_1.z.string().optional()),
270
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
271
+ ])
272
+ .optional(),
181
273
  });
182
274
  const ListCouponDiscountTypeSchema = zod_1.z.object({
183
275
  is: zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional(),
184
276
  is_not: zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional(),
185
- in: zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional(),
186
- not_in: zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional(),
277
+ in: zod_1.z
278
+ .union([
279
+ zod_1.z.array(zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional()),
280
+ zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']),
281
+ ])
282
+ .optional(),
283
+ not_in: zod_1.z
284
+ .union([
285
+ zod_1.z.array(zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional()),
286
+ zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']),
287
+ ])
288
+ .optional(),
187
289
  });
188
290
  const ListCouponDurationTypeSchema = zod_1.z.object({
189
291
  is: zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional(),
190
292
  is_not: zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional(),
191
- in: zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional(),
192
- not_in: zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional(),
293
+ in: zod_1.z
294
+ .union([
295
+ zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
296
+ zod_1.z.enum(['one_time', 'forever', 'limited_period']),
297
+ ])
298
+ .optional(),
299
+ not_in: zod_1.z
300
+ .union([
301
+ zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
302
+ zod_1.z.enum(['one_time', 'forever', 'limited_period']),
303
+ ])
304
+ .optional(),
193
305
  });
194
306
  const ListCouponStatusSchema = zod_1.z.object({
195
307
  is: zod_1.z.enum(['active', 'expired', 'archived', 'deleted', 'future']).optional(),
196
308
  is_not: zod_1.z
197
309
  .enum(['active', 'expired', 'archived', 'deleted', 'future'])
198
310
  .optional(),
199
- in: zod_1.z.enum(['active', 'expired', 'archived', 'deleted', 'future']).optional(),
311
+ in: zod_1.z
312
+ .union([
313
+ zod_1.z.array(zod_1.z
314
+ .enum(['active', 'expired', 'archived', 'deleted', 'future'])
315
+ .optional()),
316
+ zod_1.z.enum(['active', 'expired', 'archived', 'deleted', 'future']),
317
+ ])
318
+ .optional(),
200
319
  not_in: zod_1.z
201
- .enum(['active', 'expired', 'archived', 'deleted', 'future'])
320
+ .union([
321
+ zod_1.z.array(zod_1.z
322
+ .enum(['active', 'expired', 'archived', 'deleted', 'future'])
323
+ .optional()),
324
+ zod_1.z.enum(['active', 'expired', 'archived', 'deleted', 'future']),
325
+ ])
202
326
  .optional(),
203
327
  });
204
328
  const ListCouponApplyOnSchema = zod_1.z.object({
@@ -219,33 +343,75 @@ const ListCouponApplyOnSchema = zod_1.z.object({
219
343
  ])
220
344
  .optional(),
221
345
  in: zod_1.z
222
- .enum([
223
- 'invoice_amount',
224
- 'specified_items_total',
225
- 'each_specified_item',
226
- 'each_unit_of_specified_items',
346
+ .union([
347
+ zod_1.z.array(zod_1.z
348
+ .enum([
349
+ 'invoice_amount',
350
+ 'specified_items_total',
351
+ 'each_specified_item',
352
+ 'each_unit_of_specified_items',
353
+ ])
354
+ .optional()),
355
+ zod_1.z.enum([
356
+ 'invoice_amount',
357
+ 'specified_items_total',
358
+ 'each_specified_item',
359
+ 'each_unit_of_specified_items',
360
+ ]),
227
361
  ])
228
362
  .optional(),
229
363
  not_in: zod_1.z
230
- .enum([
231
- 'invoice_amount',
232
- 'specified_items_total',
233
- 'each_specified_item',
234
- 'each_unit_of_specified_items',
364
+ .union([
365
+ zod_1.z.array(zod_1.z
366
+ .enum([
367
+ 'invoice_amount',
368
+ 'specified_items_total',
369
+ 'each_specified_item',
370
+ 'each_unit_of_specified_items',
371
+ ])
372
+ .optional()),
373
+ zod_1.z.enum([
374
+ 'invoice_amount',
375
+ 'specified_items_total',
376
+ 'each_specified_item',
377
+ 'each_unit_of_specified_items',
378
+ ]),
235
379
  ])
236
380
  .optional(),
237
381
  });
238
382
  const ListCouponCreatedAtSchema = zod_1.z.object({
239
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
240
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
241
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
242
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
383
+ after: zod_1.z
384
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
385
+ .optional(),
386
+ before: zod_1.z
387
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
388
+ .optional(),
389
+ on: zod_1.z
390
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
391
+ .optional(),
392
+ between: zod_1.z
393
+ .union([
394
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
395
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
396
+ ])
397
+ .optional(),
243
398
  });
244
399
  const ListCouponUpdatedAtSchema = zod_1.z.object({
245
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
246
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
247
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
248
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
400
+ after: zod_1.z
401
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
402
+ .optional(),
403
+ before: zod_1.z
404
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
405
+ .optional(),
406
+ on: zod_1.z
407
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
408
+ .optional(),
409
+ between: zod_1.z
410
+ .union([
411
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
412
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
413
+ ])
414
+ .optional(),
249
415
  });
250
416
  const ListCouponSortBySchema = zod_1.z.looseObject({
251
417
  asc: zod_1.z.enum(['created_at']).optional(),
@@ -255,11 +421,26 @@ const ListCouponCurrencyCodeSchema = zod_1.z.object({
255
421
  is: zod_1.z.string().min(1).optional(),
256
422
  is_not: zod_1.z.string().min(1).optional(),
257
423
  starts_with: zod_1.z.string().min(1).optional(),
258
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
259
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
424
+ in: zod_1.z
425
+ .union([
426
+ zod_1.z.array(zod_1.z.string().optional()),
427
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
428
+ ])
429
+ .optional(),
430
+ not_in: zod_1.z
431
+ .union([
432
+ zod_1.z.array(zod_1.z.string().optional()),
433
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
434
+ ])
435
+ .optional(),
260
436
  });
261
437
  const ListCouponApplicableItemPriceIdsSchema = zod_1.z.object({
262
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
438
+ in: zod_1.z
439
+ .union([
440
+ zod_1.z.array(zod_1.z.string().optional()),
441
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
442
+ ])
443
+ .optional(),
263
444
  is: zod_1.z.string().min(1).optional(),
264
445
  });
265
446
  const ListCouponBodySchema = zod_1.z.looseObject({