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
@@ -7,8 +7,18 @@ const ListDisputeIdSchema = z.object({
7
7
  is: z.string().min(1).optional(),
8
8
  is_not: z.string().min(1).optional(),
9
9
  starts_with: z.string().min(1).optional(),
10
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
11
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
10
+ in: z
11
+ .union([
12
+ z.array(z.string().optional()),
13
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
14
+ ])
15
+ .optional(),
16
+ not_in: z
17
+ .union([
18
+ z.array(z.string().optional()),
19
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
20
+ ])
21
+ .optional(),
12
22
  });
13
23
  const ListDisputeStatusSchema = z.object({
14
24
  is: z
@@ -32,60 +42,142 @@ const ListDisputeStatusSchema = z.object({
32
42
  ])
33
43
  .optional(),
34
44
  in: z
35
- .enum([
36
- 'initiated',
37
- 'funds_withdrawn',
38
- 'in_review',
39
- 'cancelled',
40
- 'lost',
41
- 'won',
45
+ .union([
46
+ z.array(z
47
+ .enum([
48
+ 'initiated',
49
+ 'funds_withdrawn',
50
+ 'in_review',
51
+ 'cancelled',
52
+ 'lost',
53
+ 'won',
54
+ ])
55
+ .optional()),
56
+ z.enum([
57
+ 'initiated',
58
+ 'funds_withdrawn',
59
+ 'in_review',
60
+ 'cancelled',
61
+ 'lost',
62
+ 'won',
63
+ ]),
42
64
  ])
43
65
  .optional(),
44
66
  not_in: z
45
- .enum([
46
- 'initiated',
47
- 'funds_withdrawn',
48
- 'in_review',
49
- 'cancelled',
50
- 'lost',
51
- 'won',
67
+ .union([
68
+ z.array(z
69
+ .enum([
70
+ 'initiated',
71
+ 'funds_withdrawn',
72
+ 'in_review',
73
+ 'cancelled',
74
+ 'lost',
75
+ 'won',
76
+ ])
77
+ .optional()),
78
+ z.enum([
79
+ 'initiated',
80
+ 'funds_withdrawn',
81
+ 'in_review',
82
+ 'cancelled',
83
+ 'lost',
84
+ 'won',
85
+ ]),
52
86
  ])
53
87
  .optional(),
54
88
  });
55
89
  const ListDisputeTypeSchema = z.object({
56
90
  is: z.enum(['chargeback', 'inquiry']).optional(),
57
91
  is_not: z.enum(['chargeback', 'inquiry']).optional(),
58
- in: z.enum(['chargeback', 'inquiry']).optional(),
59
- not_in: z.enum(['chargeback', 'inquiry']).optional(),
92
+ in: z
93
+ .union([
94
+ z.array(z.enum(['chargeback', 'inquiry']).optional()),
95
+ z.enum(['chargeback', 'inquiry']),
96
+ ])
97
+ .optional(),
98
+ not_in: z
99
+ .union([
100
+ z.array(z.enum(['chargeback', 'inquiry']).optional()),
101
+ z.enum(['chargeback', 'inquiry']),
102
+ ])
103
+ .optional(),
60
104
  });
61
105
  const ListDisputeCustomerIdSchema = z.object({
62
106
  is: z.string().min(1).optional(),
63
107
  is_not: z.string().min(1).optional(),
64
108
  starts_with: z.string().min(1).optional(),
65
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
66
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
109
+ in: z
110
+ .union([
111
+ z.array(z.string().optional()),
112
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
113
+ ])
114
+ .optional(),
115
+ not_in: z
116
+ .union([
117
+ z.array(z.string().optional()),
118
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
119
+ ])
120
+ .optional(),
67
121
  });
68
122
  const ListDisputeTransactionIdSchema = z.object({
69
123
  is: z.string().min(1).optional(),
70
124
  is_not: z.string().min(1).optional(),
71
125
  starts_with: z.string().min(1).optional(),
72
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
73
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
126
+ in: z
127
+ .union([
128
+ z.array(z.string().optional()),
129
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
130
+ ])
131
+ .optional(),
132
+ not_in: z
133
+ .union([
134
+ z.array(z.string().optional()),
135
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
136
+ ])
137
+ .optional(),
74
138
  });
75
139
  const ListDisputeAmountSchema = z.object({
76
- is: z.string().regex(RegExp('^-?\\d+$')).optional(),
77
- is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
78
- lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
79
- lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
80
- gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
81
- gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
82
- between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
140
+ is: z
141
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
142
+ .optional(),
143
+ is_not: z
144
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
145
+ .optional(),
146
+ lt: z
147
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
148
+ .optional(),
149
+ lte: z
150
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
151
+ .optional(),
152
+ gt: z
153
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
154
+ .optional(),
155
+ gte: z
156
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
157
+ .optional(),
158
+ between: z
159
+ .union([
160
+ z.array(z.number().int().optional()).min(2).max(2),
161
+ z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
162
+ ])
163
+ .optional(),
83
164
  });
84
165
  const ListDisputeCreatedAtSchema = z.object({
85
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
86
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
87
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
88
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
166
+ after: z
167
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
168
+ .optional(),
169
+ before: z
170
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
171
+ .optional(),
172
+ on: z
173
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
174
+ .optional(),
175
+ between: z
176
+ .union([
177
+ z.array(z.number().int().optional()).min(2).max(2),
178
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
179
+ ])
180
+ .optional(),
89
181
  });
90
182
  const ListDisputeBodySchema = z.looseObject({
91
183
  limit: z.number().int().min(1).max(100).optional(),
@@ -4,18 +4,39 @@
4
4
  import { z } from 'zod';
5
5
  //Einvoice.listEinvoices
6
6
  const ListEinvoicesEinvoiceIdSchema = z.object({
7
+ in: z
8
+ .union([
9
+ z.array(z.string().optional()),
10
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
11
+ ])
12
+ .optional(),
7
13
  is: z.string().min(1).optional(),
8
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
9
14
  });
10
15
  const ListEinvoicesEinvoiceReferenceIdSchema = z.object({
16
+ in: z
17
+ .union([
18
+ z.array(z.string().optional()),
19
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
20
+ ])
21
+ .optional(),
11
22
  is: z.string().min(1).optional(),
12
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
13
23
  });
14
24
  const ListEinvoicesEinvoiceUpdatedAtSchema = z.object({
15
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
16
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
17
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
18
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
25
+ after: z
26
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
27
+ .optional(),
28
+ before: z
29
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
30
+ .optional(),
31
+ on: z
32
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
33
+ .optional(),
34
+ between: z
35
+ .union([
36
+ z.array(z.number().int().optional()).min(2).max(2),
37
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
38
+ ])
39
+ .optional(),
19
40
  });
20
41
  const ListEinvoicesEinvoiceSortBySchema = z.looseObject({
21
42
  asc: z.enum(['updated_at']).optional(),
@@ -4,10 +4,21 @@
4
4
  import { z } from 'zod';
5
5
  //EmailLog.emailLogsForCustomer
6
6
  const EmailLogsForCustomerEmailLogSentOnSchema = z.object({
7
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
8
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
9
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
10
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
7
+ after: z
8
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
9
+ .optional(),
10
+ before: z
11
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
12
+ .optional(),
13
+ on: z
14
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
15
+ .optional(),
16
+ between: z
17
+ .union([
18
+ z.array(z.number().int().optional()).min(2).max(2),
19
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
20
+ ])
21
+ .optional(),
11
22
  });
12
23
  const EmailLogsForCustomerEmailLogBusinessEntityIdSchema = z.object({
13
24
  is: z.string().min(1).optional(),
@@ -4,20 +4,35 @@
4
4
  import { z } from 'zod';
5
5
  //Entitlement.list
6
6
  const ListEntitlementFeatureIdSchema = z.object({
7
+ in: z
8
+ .union([
9
+ z.array(z.string().optional()),
10
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
11
+ ])
12
+ .optional(),
7
13
  is: z.string().min(1).optional(),
8
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
9
14
  });
10
15
  const ListEntitlementEntityTypeSchema = z.object({
11
- is: z
12
- .enum(['plan', 'addon', 'charge', 'plan_price', 'addon_price'])
13
- .optional(),
14
16
  in: z
17
+ .union([
18
+ z.array(z
19
+ .enum(['plan', 'addon', 'charge', 'plan_price', 'addon_price'])
20
+ .optional()),
21
+ z.enum(['plan', 'addon', 'charge', 'plan_price', 'addon_price']),
22
+ ])
23
+ .optional(),
24
+ is: z
15
25
  .enum(['plan', 'addon', 'charge', 'plan_price', 'addon_price'])
16
26
  .optional(),
17
27
  });
18
28
  const ListEntitlementEntityIdSchema = z.object({
29
+ in: z
30
+ .union([
31
+ z.array(z.string().optional()),
32
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
33
+ ])
34
+ .optional(),
19
35
  is: z.string().min(1).optional(),
20
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
21
36
  });
22
37
  const ListEntitlementBodySchema = z.looseObject({
23
38
  limit: z.number().int().min(1).max(100).optional(),
@@ -30,6 +45,15 @@ const ListEntitlementBodySchema = z.looseObject({
30
45
  });
31
46
  export { ListEntitlementBodySchema };
32
47
  //Entitlement.create
48
+ const CreateEntitlementEntitlementsItemSchema = z.object({
49
+ entity_id: z.string().max(100),
50
+ feature_id: z.string().max(50),
51
+ entity_type: z
52
+ .enum(['plan', 'addon', 'charge', 'plan_price', 'addon_price'])
53
+ .optional(),
54
+ value: z.string().max(50).optional(),
55
+ apply_grandfathering: z.boolean().default(false).optional(),
56
+ });
33
57
  const CreateEntitlementEntitlementsSchema = z.object({
34
58
  entity_id: z.array(z.string().max(100).optional()),
35
59
  feature_id: z.array(z.string().max(50).optional()),
@@ -46,6 +70,11 @@ const CreateEntitlementEntitlementsSchema = z.object({
46
70
  const CreateEntitlementBodySchema = z.looseObject({
47
71
  action: z.enum(['upsert', 'remove']),
48
72
  change_reason: z.string().max(100).optional(),
49
- entitlements: CreateEntitlementEntitlementsSchema.optional(),
73
+ entitlements: z
74
+ .union([
75
+ z.array(CreateEntitlementEntitlementsItemSchema.optional()),
76
+ CreateEntitlementEntitlementsSchema,
77
+ ])
78
+ .optional(),
50
79
  });
51
80
  export { CreateEntitlementBodySchema };
@@ -3,6 +3,17 @@
3
3
  // Do not edit manually – regenerate via sdk-generator
4
4
  import { z } from 'zod';
5
5
  //EntitlementOverride.addEntitlementOverrideForSubscription
6
+ const AddEntitlementOverrideForSubscriptionEntitlementOverrideEntitlementOverridesItemSchema = z.object({
7
+ feature_id: z.string().max(50),
8
+ entity_id: z.string().max(100).optional(),
9
+ entity_type: z
10
+ .enum(['plan_price', 'addon_price', 'charge', 'charge_price'])
11
+ .optional(),
12
+ value: z.string().max(50).optional(),
13
+ expires_at: z.number().int().optional(),
14
+ effective_from: z.number().int().optional(),
15
+ is_enabled: z.boolean().optional(),
16
+ });
6
17
  const AddEntitlementOverrideForSubscriptionEntitlementOverrideEntitlementOverridesSchema = z.object({
7
18
  feature_id: z.array(z.string().max(50).optional()),
8
19
  entity_id: z.array(z.string().max(100).optional()).optional(),
@@ -18,7 +29,12 @@ const AddEntitlementOverrideForSubscriptionEntitlementOverrideEntitlementOverrid
18
29
  });
19
30
  const AddEntitlementOverrideForSubscriptionEntitlementOverrideBodySchema = z.looseObject({
20
31
  action: z.enum(['upsert', 'remove']).optional(),
21
- entitlement_overrides: AddEntitlementOverrideForSubscriptionEntitlementOverrideEntitlementOverridesSchema.optional(),
32
+ entitlement_overrides: z
33
+ .union([
34
+ z.array(AddEntitlementOverrideForSubscriptionEntitlementOverrideEntitlementOverridesItemSchema.optional()),
35
+ AddEntitlementOverrideForSubscriptionEntitlementOverrideEntitlementOverridesSchema,
36
+ ])
37
+ .optional(),
22
38
  });
23
39
  export { AddEntitlementOverrideForSubscriptionEntitlementOverrideBodySchema };
24
40
  //EntitlementOverride.listEntitlementOverrideForSubscription