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
@@ -0,0 +1,150 @@
1
+ // Generated Zod schemas: PriceRamp
2
+ // Actions: create, update, list
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //PriceRamp.create
6
+ const CreatePriceRampRampIntervalsItemSchema = z.object({
7
+ starting_billing_cycle: z.number().int().min(1),
8
+ ending_billing_cycle: z.number().int().min(1).optional(),
9
+ apply_catalog_price: z.boolean().default(false).optional(),
10
+ price: z.number().int().min(0).optional(),
11
+ price_in_decimal: z.string().max(39).optional(),
12
+ });
13
+ const CreatePriceRampRampIntervalsSchema = z.object({
14
+ starting_billing_cycle: z.array(z.number().int().min(1).optional()),
15
+ ending_billing_cycle: z.array(z.number().int().min(1).optional()).optional(),
16
+ apply_catalog_price: z
17
+ .array(z.boolean().default(false).optional())
18
+ .optional(),
19
+ price: z.array(z.number().int().min(0).optional()).optional(),
20
+ price_in_decimal: z.array(z.string().max(39).optional()).optional(),
21
+ });
22
+ const CreatePriceRampBodySchema = z.looseObject({
23
+ item_price_id: z.string().max(100),
24
+ business_entity_id: z.string().max(50).optional(),
25
+ ramp_intervals: z
26
+ .union([
27
+ z.array(CreatePriceRampRampIntervalsItemSchema.optional()),
28
+ CreatePriceRampRampIntervalsSchema,
29
+ ])
30
+ .optional(),
31
+ });
32
+ export { CreatePriceRampBodySchema };
33
+ //PriceRamp.update
34
+ const UpdatePriceRampRampIntervalsItemSchema = z.object({
35
+ starting_billing_cycle: z.number().int().min(1),
36
+ ending_billing_cycle: z.number().int().min(1).optional(),
37
+ apply_catalog_price: z.boolean().default(false).optional(),
38
+ price: z.number().int().min(0).optional(),
39
+ price_in_decimal: z.string().max(39).optional(),
40
+ });
41
+ const UpdatePriceRampRampIntervalsSchema = z.object({
42
+ starting_billing_cycle: z.array(z.number().int().min(1).optional()),
43
+ ending_billing_cycle: z.array(z.number().int().min(1).optional()).optional(),
44
+ apply_catalog_price: z
45
+ .array(z.boolean().default(false).optional())
46
+ .optional(),
47
+ price: z.array(z.number().int().min(0).optional()).optional(),
48
+ price_in_decimal: z.array(z.string().max(39).optional()).optional(),
49
+ });
50
+ const UpdatePriceRampBodySchema = z.looseObject({
51
+ status: z.enum(['active', 'archived']).optional(),
52
+ ramp_intervals: z
53
+ .union([
54
+ z.array(UpdatePriceRampRampIntervalsItemSchema.optional()),
55
+ UpdatePriceRampRampIntervalsSchema,
56
+ ])
57
+ .optional(),
58
+ });
59
+ export { UpdatePriceRampBodySchema };
60
+ //PriceRamp.list
61
+ const ListPriceRampIdSchema = z.object({
62
+ is: z.string().min(1).optional(),
63
+ is_not: z.string().min(1).optional(),
64
+ starts_with: z.string().min(1).optional(),
65
+ in: z
66
+ .union([
67
+ z.array(z.string().optional()),
68
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
69
+ ])
70
+ .optional(),
71
+ not_in: z
72
+ .union([
73
+ z.array(z.string().optional()),
74
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
75
+ ])
76
+ .optional(),
77
+ });
78
+ const ListPriceRampItemPriceIdSchema = z.object({
79
+ is: z.string().min(1).optional(),
80
+ is_not: z.string().min(1).optional(),
81
+ starts_with: z.string().min(1).optional(),
82
+ in: z
83
+ .union([
84
+ z.array(z.string().optional()),
85
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
86
+ ])
87
+ .optional(),
88
+ not_in: z
89
+ .union([
90
+ z.array(z.string().optional()),
91
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
92
+ ])
93
+ .optional(),
94
+ });
95
+ const ListPriceRampStatusSchema = z.object({
96
+ is: z.enum(['active', 'archived']).optional(),
97
+ is_not: z.enum(['active', 'archived']).optional(),
98
+ in: z
99
+ .union([
100
+ z.array(z.enum(['active', 'archived']).optional()),
101
+ z.enum(['active', 'archived']),
102
+ ])
103
+ .optional(),
104
+ not_in: z
105
+ .union([
106
+ z.array(z.enum(['active', 'archived']).optional()),
107
+ z.enum(['active', 'archived']),
108
+ ])
109
+ .optional(),
110
+ });
111
+ const ListPriceRampUpdatedAtSchema = z.object({
112
+ after: z
113
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
114
+ .optional(),
115
+ before: z
116
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
117
+ .optional(),
118
+ on: z
119
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
120
+ .optional(),
121
+ between: z
122
+ .union([
123
+ z.array(z.number().int().optional()).min(2).max(2),
124
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
125
+ ])
126
+ .optional(),
127
+ });
128
+ const ListPriceRampBusinessEntityIdSchema = z.object({
129
+ is: z.string().min(1).optional(),
130
+ is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
131
+ });
132
+ const ListPriceRampIncludeSiteLevelResourcesSchema = z.object({
133
+ is: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
134
+ });
135
+ const ListPriceRampSortBySchema = z.looseObject({
136
+ asc: z.enum(['id', 'status', 'updated_at']).optional(),
137
+ desc: z.enum(['id', 'status', 'updated_at']).optional(),
138
+ });
139
+ const ListPriceRampBodySchema = z.looseObject({
140
+ limit: z.number().int().min(1).max(100).optional(),
141
+ offset: z.string().max(1000).optional(),
142
+ id: ListPriceRampIdSchema.optional(),
143
+ item_price_id: ListPriceRampItemPriceIdSchema.optional(),
144
+ status: ListPriceRampStatusSchema.optional(),
145
+ updated_at: ListPriceRampUpdatedAtSchema.optional(),
146
+ business_entity_id: ListPriceRampBusinessEntityIdSchema.optional(),
147
+ include_site_level_resources: ListPriceRampIncludeSiteLevelResourcesSchema.optional(),
148
+ sort_by: ListPriceRampSortBySchema.optional(),
149
+ });
150
+ export { ListPriceRampBodySchema };
@@ -3,6 +3,10 @@
3
3
  // Do not edit manually – regenerate via sdk-generator
4
4
  import { z } from 'zod';
5
5
  //PriceVariant.create
6
+ const CreatePriceVariantAttributesItemSchema = z.object({
7
+ name: z.string().max(100),
8
+ value: z.string().max(100),
9
+ });
6
10
  const CreatePriceVariantAttributesSchema = z.object({
7
11
  name: z.array(z.string().max(100).optional()),
8
12
  value: z.array(z.string().max(100).optional()),
@@ -14,10 +18,19 @@ const CreatePriceVariantBodySchema = z.looseObject({
14
18
  description: z.string().max(500).optional(),
15
19
  variant_group: z.string().max(100).optional(),
16
20
  business_entity_id: z.string().max(50).optional(),
17
- attributes: CreatePriceVariantAttributesSchema.optional(),
21
+ attributes: z
22
+ .union([
23
+ z.array(CreatePriceVariantAttributesItemSchema.optional()),
24
+ CreatePriceVariantAttributesSchema,
25
+ ])
26
+ .optional(),
18
27
  });
19
28
  export { CreatePriceVariantBodySchema };
20
29
  //PriceVariant.update
30
+ const UpdatePriceVariantAttributesItemSchema = z.object({
31
+ name: z.string().max(100),
32
+ value: z.string().max(100),
33
+ });
21
34
  const UpdatePriceVariantAttributesSchema = z.object({
22
35
  name: z.array(z.string().max(100).optional()),
23
36
  value: z.array(z.string().max(100).optional()),
@@ -28,7 +41,12 @@ const UpdatePriceVariantBodySchema = z.looseObject({
28
41
  description: z.string().max(500).optional(),
29
42
  variant_group: z.string().max(100).optional(),
30
43
  status: z.enum(['active', 'archived']).optional(),
31
- attributes: UpdatePriceVariantAttributesSchema.optional(),
44
+ attributes: z
45
+ .union([
46
+ z.array(UpdatePriceVariantAttributesItemSchema.optional()),
47
+ UpdatePriceVariantAttributesSchema,
48
+ ])
49
+ .optional(),
32
50
  });
33
51
  export { UpdatePriceVariantBodySchema };
34
52
  //PriceVariant.list
@@ -36,40 +54,92 @@ const ListPriceVariantIdSchema = z.object({
36
54
  is: z.string().min(1).optional(),
37
55
  is_not: z.string().min(1).optional(),
38
56
  starts_with: z.string().min(1).optional(),
39
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
40
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
57
+ in: z
58
+ .union([
59
+ z.array(z.string().optional()),
60
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
61
+ ])
62
+ .optional(),
63
+ not_in: z
64
+ .union([
65
+ z.array(z.string().optional()),
66
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
67
+ ])
68
+ .optional(),
41
69
  });
42
70
  const ListPriceVariantNameSchema = z.object({
43
71
  is: z.string().min(1).optional(),
44
72
  is_not: z.string().min(1).optional(),
45
73
  starts_with: z.string().min(1).optional(),
46
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
47
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
74
+ in: z
75
+ .union([
76
+ z.array(z.string().optional()),
77
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
78
+ ])
79
+ .optional(),
80
+ not_in: z
81
+ .union([
82
+ z.array(z.string().optional()),
83
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
84
+ ])
85
+ .optional(),
48
86
  });
49
87
  const ListPriceVariantStatusSchema = z.object({
50
88
  is: z.enum(['active', 'archived']).optional(),
51
89
  is_not: z.enum(['active', 'archived']).optional(),
52
- in: z.enum(['active', 'archived']).optional(),
53
- not_in: z.enum(['active', 'archived']).optional(),
90
+ in: z
91
+ .union([
92
+ z.array(z.enum(['active', 'archived']).optional()),
93
+ z.enum(['active', 'archived']),
94
+ ])
95
+ .optional(),
96
+ not_in: z
97
+ .union([
98
+ z.array(z.enum(['active', 'archived']).optional()),
99
+ z.enum(['active', 'archived']),
100
+ ])
101
+ .optional(),
54
102
  });
55
103
  const ListPriceVariantUpdatedAtSchema = z.object({
56
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
57
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
58
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
59
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
104
+ after: z
105
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
106
+ .optional(),
107
+ before: z
108
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
109
+ .optional(),
110
+ on: z
111
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
112
+ .optional(),
113
+ between: z
114
+ .union([
115
+ z.array(z.number().int().optional()).min(2).max(2),
116
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
117
+ ])
118
+ .optional(),
60
119
  });
61
120
  const ListPriceVariantCreatedAtSchema = z.object({
62
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
63
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
64
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
65
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
121
+ after: z
122
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
123
+ .optional(),
124
+ before: z
125
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
126
+ .optional(),
127
+ on: z
128
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
129
+ .optional(),
130
+ between: z
131
+ .union([
132
+ z.array(z.number().int().optional()).min(2).max(2),
133
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
134
+ ])
135
+ .optional(),
66
136
  });
67
137
  const ListPriceVariantBusinessEntityIdSchema = z.object({
68
138
  is: z.string().min(1).optional(),
69
- is_present: z.enum(['true', 'false']).optional(),
139
+ is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
70
140
  });
71
141
  const ListPriceVariantIncludeSiteLevelResourcesSchema = z.object({
72
- is: z.enum(['true', 'false']).optional(),
142
+ is: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
73
143
  });
74
144
  const ListPriceVariantSortBySchema = z.looseObject({
75
145
  asc: z.enum(['name', 'id', 'status', 'created_at', 'updated_at']).optional(),
@@ -61,6 +61,18 @@ const CreateForNewSubscriptionPricingPageSessionContractTermSchema = z.object({
61
61
  .optional(),
62
62
  cancellation_cutoff_period: z.number().int().optional(),
63
63
  });
64
+ const CreateForNewSubscriptionPricingPageSessionDiscountsItemSchema = z.object({
65
+ apply_on: z.enum(['invoice_amount', 'specific_item_price']).optional(),
66
+ duration_type: z.enum(['one_time', 'forever', 'limited_period']),
67
+ percentage: z.number().min(0.01).max(100).optional(),
68
+ amount: z.number().int().min(0).optional(),
69
+ period: z.number().int().min(1).optional(),
70
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
71
+ included_in_mrr: z.boolean().optional(),
72
+ item_price_id: z.string().max(100).optional(),
73
+ quantity: z.number().int().min(1).optional(),
74
+ label: z.string().max(100).optional(),
75
+ });
64
76
  const CreateForNewSubscriptionPricingPageSessionDiscountsSchema = z.object({
65
77
  apply_on: z
66
78
  .array(z.enum(['invoice_amount', 'specific_item_price']).optional())
@@ -89,7 +101,12 @@ const CreateForNewSubscriptionPricingPageSessionBodySchema = z.looseObject({
89
101
  billing_address: CreateForNewSubscriptionPricingPageSessionBillingAddressSchema.optional(),
90
102
  shipping_address: CreateForNewSubscriptionPricingPageSessionShippingAddressSchema.optional(),
91
103
  contract_term: CreateForNewSubscriptionPricingPageSessionContractTermSchema.optional(),
92
- discounts: CreateForNewSubscriptionPricingPageSessionDiscountsSchema.optional(),
104
+ discounts: z
105
+ .union([
106
+ z.array(CreateForNewSubscriptionPricingPageSessionDiscountsItemSchema.optional()),
107
+ CreateForNewSubscriptionPricingPageSessionDiscountsSchema,
108
+ ])
109
+ .optional(),
93
110
  });
94
111
  export { CreateForNewSubscriptionPricingPageSessionBodySchema };
95
112
  //PricingPageSession.createForExistingSubscription
@@ -106,6 +123,18 @@ const CreateForExistingSubscriptionPricingPageSessionContractTermSchema = z.obje
106
123
  .optional(),
107
124
  cancellation_cutoff_period: z.number().int().optional(),
108
125
  });
126
+ const CreateForExistingSubscriptionPricingPageSessionDiscountsItemSchema = z.object({
127
+ apply_on: z.enum(['invoice_amount', 'specific_item_price']).optional(),
128
+ duration_type: z.enum(['one_time', 'forever', 'limited_period']),
129
+ percentage: z.number().min(0.01).max(100).optional(),
130
+ amount: z.number().int().min(0).optional(),
131
+ period: z.number().int().min(1).optional(),
132
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
133
+ included_in_mrr: z.boolean().optional(),
134
+ item_price_id: z.string().max(100).optional(),
135
+ quantity: z.number().int().min(1).optional(),
136
+ label: z.string().max(100).optional(),
137
+ });
109
138
  const CreateForExistingSubscriptionPricingPageSessionDiscountsSchema = z.object({
110
139
  apply_on: z
111
140
  .array(z.enum(['invoice_amount', 'specific_item_price']).optional())
@@ -128,6 +157,11 @@ const CreateForExistingSubscriptionPricingPageSessionBodySchema = z.looseObject(
128
157
  pricing_page: CreateForExistingSubscriptionPricingPageSessionPricingPageSchema.optional(),
129
158
  subscription: CreateForExistingSubscriptionPricingPageSessionSubscriptionSchema.optional(),
130
159
  contract_term: CreateForExistingSubscriptionPricingPageSessionContractTermSchema.optional(),
131
- discounts: CreateForExistingSubscriptionPricingPageSessionDiscountsSchema.optional(),
160
+ discounts: z
161
+ .union([
162
+ z.array(CreateForExistingSubscriptionPricingPageSessionDiscountsItemSchema.optional()),
163
+ CreateForExistingSubscriptionPricingPageSessionDiscountsSchema,
164
+ ])
165
+ .optional(),
132
166
  });
133
167
  export { CreateForExistingSubscriptionPricingPageSessionBodySchema };
@@ -48,16 +48,37 @@ const ListPromotionalCreditIdSchema = z.object({
48
48
  starts_with: z.string().min(1).optional(),
49
49
  });
50
50
  const ListPromotionalCreditCreatedAtSchema = z.object({
51
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
52
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
53
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
54
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
51
+ after: z
52
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
53
+ .optional(),
54
+ before: z
55
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
56
+ .optional(),
57
+ on: z
58
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
59
+ .optional(),
60
+ between: z
61
+ .union([
62
+ z.array(z.number().int().optional()).min(2).max(2),
63
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
64
+ ])
65
+ .optional(),
55
66
  });
56
67
  const ListPromotionalCreditTypeSchema = z.object({
57
68
  is: z.enum(['increment', 'decrement']).optional(),
58
69
  is_not: z.enum(['increment', 'decrement']).optional(),
59
- in: z.enum(['increment', 'decrement']).optional(),
60
- not_in: z.enum(['increment', 'decrement']).optional(),
70
+ in: z
71
+ .union([
72
+ z.array(z.enum(['increment', 'decrement']).optional()),
73
+ z.enum(['increment', 'decrement']),
74
+ ])
75
+ .optional(),
76
+ not_in: z
77
+ .union([
78
+ z.array(z.enum(['increment', 'decrement']).optional()),
79
+ z.enum(['increment', 'decrement']),
80
+ ])
81
+ .optional(),
61
82
  });
62
83
  const ListPromotionalCreditCustomerIdSchema = z.object({
63
84
  is: z.string().min(1).optional(),