chargebee 3.26.0 → 3.28.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 (172) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/README.md +131 -0
  3. package/cjs/RequestWrapper.js +130 -12
  4. package/cjs/chargebee.cjs.js +5 -0
  5. package/cjs/chargebee.cjs.worker.js +2 -0
  6. package/cjs/chargebeeZodValidationError.js +18 -0
  7. package/cjs/createChargebee.js +23 -2
  8. package/cjs/environment.js +1 -1
  9. package/cjs/schema/addon.schema.js +269 -0
  10. package/cjs/schema/address.schema.js +35 -0
  11. package/cjs/schema/alert.schema.js +74 -0
  12. package/cjs/schema/alert_status.schema.js +31 -0
  13. package/cjs/schema/attached_item.schema.js +144 -0
  14. package/cjs/schema/business_entity.schema.js +46 -0
  15. package/cjs/schema/card.schema.js +165 -0
  16. package/cjs/schema/comment.schema.js +69 -0
  17. package/cjs/schema/coupon.schema.js +323 -0
  18. package/cjs/schema/coupon_code.schema.js +49 -0
  19. package/cjs/schema/coupon_set.schema.js +88 -0
  20. package/cjs/schema/credit_note.schema.js +502 -0
  21. package/cjs/schema/currency.schema.js +32 -0
  22. package/cjs/schema/customer.schema.js +1201 -0
  23. package/cjs/schema/customer_entitlement.schema.js +14 -0
  24. package/cjs/schema/differential_price.schema.js +106 -0
  25. package/cjs/schema/entitlement.schema.js +54 -0
  26. package/cjs/schema/entitlement_override.schema.js +35 -0
  27. package/cjs/schema/estimate.schema.js +1535 -0
  28. package/cjs/schema/event.schema.js +1060 -0
  29. package/cjs/schema/export.schema.js +3385 -0
  30. package/cjs/schema/feature.schema.js +78 -0
  31. package/cjs/schema/gift.schema.js +293 -0
  32. package/cjs/schema/grant_block.schema.js +47 -0
  33. package/cjs/schema/hosted_page.schema.js +1777 -0
  34. package/cjs/schema/in_app_subscription.schema.js +68 -0
  35. package/cjs/schema/index.js +88 -0
  36. package/cjs/schema/invoice.schema.js +1685 -0
  37. package/cjs/schema/item.schema.js +195 -0
  38. package/cjs/schema/item_entitlement.schema.js +45 -0
  39. package/cjs/schema/item_family.schema.js +57 -0
  40. package/cjs/schema/item_price.schema.js +335 -0
  41. package/cjs/schema/ledger_account_balance.schema.js +21 -0
  42. package/cjs/schema/ledger_operation.schema.js +104 -0
  43. package/cjs/schema/meter.schema.js +13 -0
  44. package/cjs/schema/metered_feature.schema.js +20 -0
  45. package/cjs/schema/non_subscription.schema.js +28 -0
  46. package/cjs/schema/offer_event.schema.js +13 -0
  47. package/cjs/schema/offer_fulfillment.schema.js +20 -0
  48. package/cjs/schema/omnichannel_one_time_order.schema.js +26 -0
  49. package/cjs/schema/omnichannel_subscription.schema.js +122 -0
  50. package/cjs/schema/omnichannel_subscription_item.schema.js +13 -0
  51. package/cjs/schema/order.schema.js +441 -0
  52. package/cjs/schema/payment_intent.schema.js +127 -0
  53. package/cjs/schema/payment_schedule_scheme.schema.js +20 -0
  54. package/cjs/schema/payment_source.schema.js +630 -0
  55. package/cjs/schema/payment_voucher.schema.js +57 -0
  56. package/cjs/schema/personalized_offer.schema.js +28 -0
  57. package/cjs/schema/plan.schema.js +363 -0
  58. package/cjs/schema/portal_session.schema.js +22 -0
  59. package/cjs/schema/price_variant.schema.js +93 -0
  60. package/cjs/schema/pricing_page_session.schema.js +135 -0
  61. package/cjs/schema/promotional_credit.schema.js +78 -0
  62. package/cjs/schema/promotional_grant.schema.js +17 -0
  63. package/cjs/schema/purchase.schema.js +277 -0
  64. package/cjs/schema/quote.schema.js +1667 -0
  65. package/cjs/schema/ramp.schema.js +245 -0
  66. package/cjs/schema/recorded_purchase.schema.js +32 -0
  67. package/cjs/schema/resource_migration.schema.js +14 -0
  68. package/cjs/schema/site_migration_detail.schema.js +81 -0
  69. package/cjs/schema/subscription.schema.js +3344 -0
  70. package/cjs/schema/subscription_entitlement.schema.js +25 -0
  71. package/cjs/schema/time_machine.schema.js +17 -0
  72. package/cjs/schema/transaction.schema.js +744 -0
  73. package/cjs/schema/unbilled_charge.schema.js +139 -0
  74. package/cjs/schema/usage.schema.js +93 -0
  75. package/cjs/schema/usage_charge.schema.js +17 -0
  76. package/cjs/schema/usage_event.schema.js +28 -0
  77. package/cjs/schema/usage_file.schema.js +13 -0
  78. package/cjs/schema/usage_summary.schema.js +17 -0
  79. package/cjs/schema/virtual_bank_account.schema.js +71 -0
  80. package/cjs/schema/webhook_endpoint.schema.js +508 -0
  81. package/cjs/telemetry/TelemetryAdapter.js +145 -0
  82. package/cjs/telemetry/index.js +28 -0
  83. package/cjs/telemetry/otel.js +66 -0
  84. package/cjs/telemetry/types.js +47 -0
  85. package/cjs/validationLoader.js +59 -0
  86. package/esm/RequestWrapper.js +130 -12
  87. package/esm/chargebee.esm.js +3 -0
  88. package/esm/chargebee.esm.worker.js +1 -0
  89. package/esm/chargebeeZodValidationError.js +14 -0
  90. package/esm/createChargebee.js +23 -2
  91. package/esm/environment.js +1 -1
  92. package/esm/schema/addon.schema.js +266 -0
  93. package/esm/schema/address.schema.js +32 -0
  94. package/esm/schema/alert.schema.js +71 -0
  95. package/esm/schema/alert_status.schema.js +28 -0
  96. package/esm/schema/attached_item.schema.js +141 -0
  97. package/esm/schema/business_entity.schema.js +43 -0
  98. package/esm/schema/card.schema.js +162 -0
  99. package/esm/schema/comment.schema.js +66 -0
  100. package/esm/schema/coupon.schema.js +320 -0
  101. package/esm/schema/coupon_code.schema.js +46 -0
  102. package/esm/schema/coupon_set.schema.js +85 -0
  103. package/esm/schema/credit_note.schema.js +499 -0
  104. package/esm/schema/currency.schema.js +29 -0
  105. package/esm/schema/customer.schema.js +1198 -0
  106. package/esm/schema/customer_entitlement.schema.js +11 -0
  107. package/esm/schema/differential_price.schema.js +103 -0
  108. package/esm/schema/entitlement.schema.js +51 -0
  109. package/esm/schema/entitlement_override.schema.js +32 -0
  110. package/esm/schema/estimate.schema.js +1532 -0
  111. package/esm/schema/event.schema.js +1057 -0
  112. package/esm/schema/export.schema.js +3382 -0
  113. package/esm/schema/feature.schema.js +75 -0
  114. package/esm/schema/gift.schema.js +290 -0
  115. package/esm/schema/grant_block.schema.js +44 -0
  116. package/esm/schema/hosted_page.schema.js +1774 -0
  117. package/esm/schema/in_app_subscription.schema.js +65 -0
  118. package/esm/schema/index.js +72 -0
  119. package/esm/schema/invoice.schema.js +1682 -0
  120. package/esm/schema/item.schema.js +192 -0
  121. package/esm/schema/item_entitlement.schema.js +42 -0
  122. package/esm/schema/item_family.schema.js +54 -0
  123. package/esm/schema/item_price.schema.js +332 -0
  124. package/esm/schema/ledger_account_balance.schema.js +18 -0
  125. package/esm/schema/ledger_operation.schema.js +101 -0
  126. package/esm/schema/meter.schema.js +10 -0
  127. package/esm/schema/metered_feature.schema.js +17 -0
  128. package/esm/schema/non_subscription.schema.js +25 -0
  129. package/esm/schema/offer_event.schema.js +10 -0
  130. package/esm/schema/offer_fulfillment.schema.js +17 -0
  131. package/esm/schema/omnichannel_one_time_order.schema.js +23 -0
  132. package/esm/schema/omnichannel_subscription.schema.js +119 -0
  133. package/esm/schema/omnichannel_subscription_item.schema.js +10 -0
  134. package/esm/schema/order.schema.js +438 -0
  135. package/esm/schema/payment_intent.schema.js +124 -0
  136. package/esm/schema/payment_schedule_scheme.schema.js +17 -0
  137. package/esm/schema/payment_source.schema.js +627 -0
  138. package/esm/schema/payment_voucher.schema.js +54 -0
  139. package/esm/schema/personalized_offer.schema.js +25 -0
  140. package/esm/schema/plan.schema.js +360 -0
  141. package/esm/schema/portal_session.schema.js +19 -0
  142. package/esm/schema/price_variant.schema.js +90 -0
  143. package/esm/schema/pricing_page_session.schema.js +132 -0
  144. package/esm/schema/promotional_credit.schema.js +75 -0
  145. package/esm/schema/promotional_grant.schema.js +14 -0
  146. package/esm/schema/purchase.schema.js +274 -0
  147. package/esm/schema/quote.schema.js +1664 -0
  148. package/esm/schema/ramp.schema.js +242 -0
  149. package/esm/schema/recorded_purchase.schema.js +29 -0
  150. package/esm/schema/resource_migration.schema.js +11 -0
  151. package/esm/schema/site_migration_detail.schema.js +78 -0
  152. package/esm/schema/subscription.schema.js +3341 -0
  153. package/esm/schema/subscription_entitlement.schema.js +22 -0
  154. package/esm/schema/time_machine.schema.js +14 -0
  155. package/esm/schema/transaction.schema.js +741 -0
  156. package/esm/schema/unbilled_charge.schema.js +136 -0
  157. package/esm/schema/usage.schema.js +90 -0
  158. package/esm/schema/usage_charge.schema.js +14 -0
  159. package/esm/schema/usage_event.schema.js +25 -0
  160. package/esm/schema/usage_file.schema.js +10 -0
  161. package/esm/schema/usage_summary.schema.js +14 -0
  162. package/esm/schema/virtual_bank_account.schema.js +68 -0
  163. package/esm/schema/webhook_endpoint.schema.js +505 -0
  164. package/esm/telemetry/TelemetryAdapter.js +132 -0
  165. package/esm/telemetry/index.js +8 -0
  166. package/esm/telemetry/otel.js +62 -0
  167. package/esm/telemetry/types.js +44 -0
  168. package/esm/validationLoader.js +56 -0
  169. package/package.json +43 -24
  170. package/types/core.d.ts +2 -0
  171. package/types/index.d.ts +85 -0
  172. package/types/telemetry/otel.d.ts +22 -0
@@ -0,0 +1,25 @@
1
+ // Generated Zod schemas: PersonalizedOffer
2
+ // Actions: personalizedOffers
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //PersonalizedOffer.personalizedOffers
6
+ const PersonalizedOffersPersonalizedOfferCustomSchema = z.looseObject({});
7
+ const PersonalizedOffersPersonalizedOfferRequestContextSchema = z.object({
8
+ user_agent: z.string().max(255).optional(),
9
+ locale: z.string().max(50).optional(),
10
+ timezone: z.string().max(64).optional(),
11
+ url: z.string().max(250).optional(),
12
+ referrer_url: z.string().max(250).optional(),
13
+ });
14
+ const PersonalizedOffersPersonalizedOfferBodySchema = z.looseObject({
15
+ first_name: z.string().max(150).optional(),
16
+ last_name: z.string().max(150).optional(),
17
+ email: z.string().email().max(70).optional(),
18
+ roles: z.array(z.string().max(50).optional()).optional(),
19
+ external_user_id: z.string().max(50).optional(),
20
+ subscription_id: z.string().max(50).optional(),
21
+ customer_id: z.string().max(50),
22
+ custom: PersonalizedOffersPersonalizedOfferCustomSchema.optional(),
23
+ request_context: PersonalizedOffersPersonalizedOfferRequestContextSchema.optional(),
24
+ });
25
+ export { PersonalizedOffersPersonalizedOfferBodySchema };
@@ -0,0 +1,360 @@
1
+ // Generated Zod schemas: Plan
2
+ // Actions: create, update, list, copy
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //Plan.create
6
+ const CreatePlanMetaDataSchema = z.looseObject({});
7
+ const CreatePlanTiersSchema = z.object({
8
+ starting_unit: z.array(z.number().int().min(1).optional()).optional(),
9
+ ending_unit: z.array(z.number().int().optional()).optional(),
10
+ price: z.array(z.number().int().min(0).optional()).optional(),
11
+ starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
12
+ ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
13
+ price_in_decimal: z.array(z.string().max(39).optional()).optional(),
14
+ });
15
+ const CreatePlanTaxProvidersFieldsSchema = z.object({
16
+ provider_name: z.array(z.string().max(50).optional()),
17
+ field_id: z.array(z.string().max(50).optional()),
18
+ field_value: z.array(z.string().max(50).optional()),
19
+ });
20
+ const CreatePlanApplicableAddonsSchema = z.object({
21
+ id: z.array(z.string().max(100).optional()).optional(),
22
+ });
23
+ const CreatePlanEventBasedAddonsSchema = z.object({
24
+ id: z.array(z.string().max(100).optional()).optional(),
25
+ quantity: z.array(z.number().int().min(1).optional()).optional(),
26
+ quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
27
+ on_event: z
28
+ .array(z
29
+ .enum([
30
+ 'subscription_creation',
31
+ 'subscription_trial_start',
32
+ 'plan_activation',
33
+ 'subscription_activation',
34
+ 'contract_termination',
35
+ ])
36
+ .optional())
37
+ .optional(),
38
+ charge_once: z.array(z.boolean().default(true).optional()).optional(),
39
+ });
40
+ const CreatePlanAttachedAddonsSchema = z.object({
41
+ id: z.array(z.string().max(100).optional()).optional(),
42
+ quantity: z.array(z.number().int().min(1).optional()).optional(),
43
+ quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
44
+ billing_cycles: z.array(z.number().int().min(1).optional()).optional(),
45
+ type: z.array(z.enum(['recommended', 'mandatory']).optional()).optional(),
46
+ });
47
+ const CreatePlanBodySchema = z.looseObject({
48
+ id: z.string().max(100),
49
+ name: z.string().max(100),
50
+ invoice_name: z.string().max(100).optional(),
51
+ description: z.string().max(2000).optional(),
52
+ trial_period: z.number().int().min(1).optional(),
53
+ trial_period_unit: z.enum(['day', 'month']).optional(),
54
+ trial_end_action: z
55
+ .enum(['site_default', 'activate_subscription', 'cancel_subscription'])
56
+ .optional(),
57
+ period: z.number().int().min(1).optional(),
58
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
59
+ setup_cost: z.number().int().min(1).optional(),
60
+ price: z.number().int().min(0).optional(),
61
+ price_in_decimal: z.string().max(39).optional(),
62
+ currency_code: z.string().max(3).optional(),
63
+ billing_cycles: z.number().int().min(1).optional(),
64
+ pricing_model: z
65
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
66
+ .optional(),
67
+ charge_model: z
68
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
69
+ .optional(),
70
+ free_quantity: z.number().int().min(0).optional(),
71
+ free_quantity_in_decimal: z.string().max(33).optional(),
72
+ addon_applicability: z.enum(['all', 'restricted']).optional(),
73
+ downgrade_penalty: z.number().min(0.01).max(100).optional(),
74
+ redirect_url: z.string().max(500).optional(),
75
+ enabled_in_hosted_pages: z.boolean().default(true).optional(),
76
+ enabled_in_portal: z.boolean().default(true).optional(),
77
+ taxable: z.boolean().default(true).optional(),
78
+ tax_profile_id: z.string().max(50).optional(),
79
+ tax_code: z.string().max(50).optional(),
80
+ hsn_code: z.string().max(50).optional(),
81
+ taxjar_product_code: z.string().max(50).optional(),
82
+ avalara_sale_type: z
83
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
84
+ .optional(),
85
+ avalara_transaction_type: z.number().int().optional(),
86
+ avalara_service_type: z.number().int().optional(),
87
+ sku: z.string().max(100).optional(),
88
+ accounting_code: z.string().max(100).optional(),
89
+ accounting_category1: z.string().max(100).optional(),
90
+ accounting_category2: z.string().max(100).optional(),
91
+ accounting_category3: z.string().max(100).optional(),
92
+ accounting_category4: z.string().max(100).optional(),
93
+ is_shippable: z.boolean().default(false).optional(),
94
+ shipping_frequency_period: z.number().int().min(1).optional(),
95
+ shipping_frequency_period_unit: z
96
+ .enum(['year', 'month', 'week', 'day'])
97
+ .optional(),
98
+ invoice_notes: z.string().max(2000).optional(),
99
+ meta_data: CreatePlanMetaDataSchema.optional(),
100
+ show_description_in_invoices: z.boolean().default(false).optional(),
101
+ show_description_in_quotes: z.boolean().default(false).optional(),
102
+ giftable: z.boolean().default(false).optional(),
103
+ status: z.enum(['active', 'archived']).optional(),
104
+ claim_url: z.string().max(500).optional(),
105
+ tiers: CreatePlanTiersSchema.optional(),
106
+ tax_providers_fields: CreatePlanTaxProvidersFieldsSchema.optional(),
107
+ applicable_addons: CreatePlanApplicableAddonsSchema.optional(),
108
+ event_based_addons: CreatePlanEventBasedAddonsSchema.optional(),
109
+ attached_addons: CreatePlanAttachedAddonsSchema.optional(),
110
+ });
111
+ export { CreatePlanBodySchema };
112
+ //Plan.update
113
+ const UpdatePlanMetaDataSchema = z.looseObject({});
114
+ const UpdatePlanTiersSchema = z.object({
115
+ starting_unit: z.array(z.number().int().min(1).optional()).optional(),
116
+ ending_unit: z.array(z.number().int().optional()).optional(),
117
+ price: z.array(z.number().int().min(0).optional()).optional(),
118
+ starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
119
+ ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
120
+ price_in_decimal: z.array(z.string().max(39).optional()).optional(),
121
+ });
122
+ const UpdatePlanTaxProvidersFieldsSchema = z.object({
123
+ provider_name: z.array(z.string().max(50).optional()),
124
+ field_id: z.array(z.string().max(50).optional()),
125
+ field_value: z.array(z.string().max(50).optional()),
126
+ });
127
+ const UpdatePlanApplicableAddonsSchema = z.object({
128
+ id: z.array(z.string().max(100).optional()).optional(),
129
+ });
130
+ const UpdatePlanEventBasedAddonsSchema = z.object({
131
+ id: z.array(z.string().max(100).optional()).optional(),
132
+ quantity: z.array(z.number().int().min(1).optional()).optional(),
133
+ quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
134
+ on_event: z
135
+ .array(z
136
+ .enum([
137
+ 'subscription_creation',
138
+ 'subscription_trial_start',
139
+ 'plan_activation',
140
+ 'subscription_activation',
141
+ 'contract_termination',
142
+ ])
143
+ .optional())
144
+ .optional(),
145
+ charge_once: z.array(z.boolean().default(true).optional()).optional(),
146
+ });
147
+ const UpdatePlanAttachedAddonsSchema = z.object({
148
+ id: z.array(z.string().max(100).optional()).optional(),
149
+ quantity: z.array(z.number().int().min(1).optional()).optional(),
150
+ quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
151
+ billing_cycles: z.array(z.number().int().min(1).optional()).optional(),
152
+ type: z.array(z.enum(['recommended', 'mandatory']).optional()).optional(),
153
+ });
154
+ const UpdatePlanBodySchema = z.looseObject({
155
+ name: z.string().max(100).optional(),
156
+ invoice_name: z.string().max(100).optional(),
157
+ description: z.string().max(2000).optional(),
158
+ trial_period: z.number().int().min(0).optional(),
159
+ trial_period_unit: z.enum(['day', 'month']).optional(),
160
+ trial_end_action: z
161
+ .enum(['site_default', 'activate_subscription', 'cancel_subscription'])
162
+ .optional(),
163
+ period: z.number().int().min(1).optional(),
164
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
165
+ setup_cost: z.number().int().min(1).optional(),
166
+ price: z.number().int().min(0).optional(),
167
+ price_in_decimal: z.string().max(39).optional(),
168
+ currency_code: z.string().max(3).optional(),
169
+ billing_cycles: z.number().int().min(1).optional(),
170
+ pricing_model: z
171
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
172
+ .optional(),
173
+ charge_model: z
174
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
175
+ .optional(),
176
+ free_quantity: z.number().int().min(0).optional(),
177
+ free_quantity_in_decimal: z.string().max(33).optional(),
178
+ addon_applicability: z.enum(['all', 'restricted']).optional(),
179
+ downgrade_penalty: z.number().min(0.01).max(100).optional(),
180
+ redirect_url: z.string().max(500).optional(),
181
+ enabled_in_hosted_pages: z.boolean().default(true).optional(),
182
+ enabled_in_portal: z.boolean().default(true).optional(),
183
+ taxable: z.boolean().default(true).optional(),
184
+ tax_profile_id: z.string().max(50).optional(),
185
+ tax_code: z.string().max(50).optional(),
186
+ hsn_code: z.string().max(50).optional(),
187
+ taxjar_product_code: z.string().max(50).optional(),
188
+ avalara_sale_type: z
189
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
190
+ .optional(),
191
+ avalara_transaction_type: z.number().int().optional(),
192
+ avalara_service_type: z.number().int().optional(),
193
+ sku: z.string().max(100).optional(),
194
+ accounting_code: z.string().max(100).optional(),
195
+ accounting_category1: z.string().max(100).optional(),
196
+ accounting_category2: z.string().max(100).optional(),
197
+ accounting_category3: z.string().max(100).optional(),
198
+ accounting_category4: z.string().max(100).optional(),
199
+ is_shippable: z.boolean().default(false).optional(),
200
+ shipping_frequency_period: z.number().int().min(1).optional(),
201
+ shipping_frequency_period_unit: z
202
+ .enum(['year', 'month', 'week', 'day'])
203
+ .optional(),
204
+ invoice_notes: z.string().max(2000).optional(),
205
+ meta_data: UpdatePlanMetaDataSchema.optional(),
206
+ show_description_in_invoices: z.boolean().default(false).optional(),
207
+ show_description_in_quotes: z.boolean().default(false).optional(),
208
+ tiers: UpdatePlanTiersSchema.optional(),
209
+ tax_providers_fields: UpdatePlanTaxProvidersFieldsSchema.optional(),
210
+ applicable_addons: UpdatePlanApplicableAddonsSchema.optional(),
211
+ event_based_addons: UpdatePlanEventBasedAddonsSchema.optional(),
212
+ attached_addons: UpdatePlanAttachedAddonsSchema.optional(),
213
+ });
214
+ export { UpdatePlanBodySchema };
215
+ //Plan.list
216
+ const ListPlanIdSchema = z.object({
217
+ is: z.string().min(1).optional(),
218
+ is_not: z.string().min(1).optional(),
219
+ starts_with: z.string().min(1).optional(),
220
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
221
+ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
222
+ });
223
+ const ListPlanNameSchema = z.object({
224
+ is: z.string().min(1).optional(),
225
+ is_not: z.string().min(1).optional(),
226
+ starts_with: z.string().min(1).optional(),
227
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
228
+ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
229
+ });
230
+ const ListPlanPriceSchema = z.object({
231
+ is: z.string().regex(RegExp('^-?\\d+$')).optional(),
232
+ is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
233
+ lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
234
+ lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
235
+ gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
236
+ gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
237
+ between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
238
+ });
239
+ const ListPlanPeriodSchema = z.object({
240
+ is: z.string().regex(RegExp('^-?\\d+$')).optional(),
241
+ is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
242
+ lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
243
+ lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
244
+ gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
245
+ gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
246
+ between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
247
+ });
248
+ const ListPlanPeriodUnitSchema = z.object({
249
+ is: z.enum(['day', 'week', 'month', 'year']).optional(),
250
+ is_not: z.enum(['day', 'week', 'month', 'year']).optional(),
251
+ in: z.enum(['day', 'week', 'month', 'year']).optional(),
252
+ not_in: z.enum(['day', 'week', 'month', 'year']).optional(),
253
+ });
254
+ const ListPlanTrialPeriodSchema = z.object({
255
+ is: z.string().regex(RegExp('^-?\\d+$')).optional(),
256
+ is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
257
+ lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
258
+ lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
259
+ gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
260
+ gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
261
+ between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
262
+ is_present: z.enum(['true', 'false']).optional(),
263
+ });
264
+ const ListPlanTrialPeriodUnitSchema = z.object({
265
+ is: z.enum(['day', 'month']).optional(),
266
+ is_not: z.enum(['day', 'month']).optional(),
267
+ in: z.enum(['day', 'month']).optional(),
268
+ not_in: z.enum(['day', 'month']).optional(),
269
+ });
270
+ const ListPlanAddonApplicabilitySchema = z.object({
271
+ is: z.enum(['all', 'restricted']).optional(),
272
+ is_not: z.enum(['all', 'restricted']).optional(),
273
+ in: z.enum(['all', 'restricted']).optional(),
274
+ not_in: z.enum(['all', 'restricted']).optional(),
275
+ });
276
+ const ListPlanGiftableSchema = z.object({
277
+ is: z.enum(['true', 'false']).optional(),
278
+ });
279
+ const ListPlanChargeModelSchema = z.object({
280
+ is: z
281
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
282
+ .optional(),
283
+ is_not: z
284
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
285
+ .optional(),
286
+ in: z
287
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
288
+ .optional(),
289
+ not_in: z
290
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
291
+ .optional(),
292
+ });
293
+ const ListPlanPricingModelSchema = z.object({
294
+ is: z
295
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
296
+ .optional(),
297
+ is_not: z
298
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
299
+ .optional(),
300
+ in: z
301
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
302
+ .optional(),
303
+ not_in: z
304
+ .enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
305
+ .optional(),
306
+ });
307
+ const ListPlanStatusSchema = z.object({
308
+ is: z.enum(['active', 'archived', 'deleted']).optional(),
309
+ is_not: z.enum(['active', 'archived', 'deleted']).optional(),
310
+ in: z.enum(['active', 'archived', 'deleted']).optional(),
311
+ not_in: z.enum(['active', 'archived', 'deleted']).optional(),
312
+ });
313
+ const ListPlanUpdatedAtSchema = z.object({
314
+ after: z.string().regex(RegExp('^\\d{10}$')).optional(),
315
+ before: z.string().regex(RegExp('^\\d{10}$')).optional(),
316
+ on: z.string().regex(RegExp('^\\d{10}$')).optional(),
317
+ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
318
+ });
319
+ const ListPlanCurrencyCodeSchema = z.object({
320
+ is: z.string().min(1).optional(),
321
+ is_not: z.string().min(1).optional(),
322
+ starts_with: z.string().min(1).optional(),
323
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
324
+ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
325
+ });
326
+ const ListPlanChannelSchema = z.object({
327
+ is: z.enum(['web', 'app_store', 'play_store']).optional(),
328
+ is_not: z.enum(['web', 'app_store', 'play_store']).optional(),
329
+ in: z.enum(['web', 'app_store', 'play_store']).optional(),
330
+ not_in: z.enum(['web', 'app_store', 'play_store']).optional(),
331
+ });
332
+ const ListPlanBodySchema = z.looseObject({
333
+ limit: z.number().int().min(1).max(100).optional(),
334
+ offset: z.string().max(1000).optional(),
335
+ id: ListPlanIdSchema.optional(),
336
+ name: ListPlanNameSchema.optional(),
337
+ price: ListPlanPriceSchema.optional(),
338
+ period: ListPlanPeriodSchema.optional(),
339
+ period_unit: ListPlanPeriodUnitSchema.optional(),
340
+ trial_period: ListPlanTrialPeriodSchema.optional(),
341
+ trial_period_unit: ListPlanTrialPeriodUnitSchema.optional(),
342
+ addon_applicability: ListPlanAddonApplicabilitySchema.optional(),
343
+ giftable: ListPlanGiftableSchema.optional(),
344
+ charge_model: ListPlanChargeModelSchema.optional(),
345
+ pricing_model: ListPlanPricingModelSchema.optional(),
346
+ status: ListPlanStatusSchema.optional(),
347
+ updated_at: ListPlanUpdatedAtSchema.optional(),
348
+ currency_code: ListPlanCurrencyCodeSchema.optional(),
349
+ channel: ListPlanChannelSchema.optional(),
350
+ include_deleted: z.boolean().default(false).optional(),
351
+ });
352
+ export { ListPlanBodySchema };
353
+ //Plan.copy
354
+ const CopyPlanBodySchema = z.looseObject({
355
+ from_site: z.string().max(50),
356
+ id_at_from_site: z.string().max(100),
357
+ id: z.string().max(100).optional(),
358
+ for_site_merging: z.boolean().default(false).optional(),
359
+ });
360
+ export { CopyPlanBodySchema };
@@ -0,0 +1,19 @@
1
+ // Generated Zod schemas: PortalSession
2
+ // Actions: create, activate
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //PortalSession.create
6
+ const CreatePortalSessionCustomerSchema = z.object({
7
+ id: z.string().max(50),
8
+ });
9
+ const CreatePortalSessionBodySchema = z.looseObject({
10
+ redirect_url: z.string().max(250).optional(),
11
+ forward_url: z.string().max(250).optional(),
12
+ customer: CreatePortalSessionCustomerSchema.optional(),
13
+ });
14
+ export { CreatePortalSessionBodySchema };
15
+ //PortalSession.activate
16
+ const ActivatePortalSessionBodySchema = z.looseObject({
17
+ token: z.string().max(70),
18
+ });
19
+ export { ActivatePortalSessionBodySchema };
@@ -0,0 +1,90 @@
1
+ // Generated Zod schemas: PriceVariant
2
+ // Actions: create, update, list
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //PriceVariant.create
6
+ const CreatePriceVariantAttributesSchema = z.object({
7
+ name: z.array(z.string().max(100).optional()),
8
+ value: z.array(z.string().max(100).optional()),
9
+ });
10
+ const CreatePriceVariantBodySchema = z.looseObject({
11
+ id: z.string().max(100),
12
+ name: z.string().max(100),
13
+ external_name: z.string().max(100).optional(),
14
+ description: z.string().max(500).optional(),
15
+ variant_group: z.string().max(100).optional(),
16
+ business_entity_id: z.string().max(50).optional(),
17
+ attributes: CreatePriceVariantAttributesSchema.optional(),
18
+ });
19
+ export { CreatePriceVariantBodySchema };
20
+ //PriceVariant.update
21
+ const UpdatePriceVariantAttributesSchema = z.object({
22
+ name: z.array(z.string().max(100).optional()),
23
+ value: z.array(z.string().max(100).optional()),
24
+ });
25
+ const UpdatePriceVariantBodySchema = z.looseObject({
26
+ name: z.string().max(100).optional(),
27
+ external_name: z.string().max(100).optional(),
28
+ description: z.string().max(500).optional(),
29
+ variant_group: z.string().max(100).optional(),
30
+ status: z.enum(['active', 'archived']).optional(),
31
+ attributes: UpdatePriceVariantAttributesSchema.optional(),
32
+ });
33
+ export { UpdatePriceVariantBodySchema };
34
+ //PriceVariant.list
35
+ const ListPriceVariantIdSchema = z.object({
36
+ is: z.string().min(1).optional(),
37
+ is_not: z.string().min(1).optional(),
38
+ starts_with: z.string().min(1).optional(),
39
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
40
+ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
41
+ });
42
+ const ListPriceVariantNameSchema = z.object({
43
+ is: z.string().min(1).optional(),
44
+ is_not: z.string().min(1).optional(),
45
+ starts_with: z.string().min(1).optional(),
46
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
47
+ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
48
+ });
49
+ const ListPriceVariantStatusSchema = z.object({
50
+ is: z.enum(['active', 'archived']).optional(),
51
+ is_not: z.enum(['active', 'archived']).optional(),
52
+ in: z.enum(['active', 'archived']).optional(),
53
+ not_in: z.enum(['active', 'archived']).optional(),
54
+ });
55
+ 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(),
60
+ });
61
+ 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(),
66
+ });
67
+ const ListPriceVariantBusinessEntityIdSchema = z.object({
68
+ is: z.string().min(1).optional(),
69
+ is_present: z.enum(['true', 'false']).optional(),
70
+ });
71
+ const ListPriceVariantIncludeSiteLevelResourcesSchema = z.object({
72
+ is: z.enum(['true', 'false']).optional(),
73
+ });
74
+ const ListPriceVariantSortBySchema = z.looseObject({
75
+ asc: z.enum(['name', 'id', 'status', 'created_at', 'updated_at']).optional(),
76
+ desc: z.enum(['name', 'id', 'status', 'created_at', 'updated_at']).optional(),
77
+ });
78
+ const ListPriceVariantBodySchema = z.looseObject({
79
+ limit: z.number().int().min(1).max(100).optional(),
80
+ offset: z.string().max(1000).optional(),
81
+ id: ListPriceVariantIdSchema.optional(),
82
+ name: ListPriceVariantNameSchema.optional(),
83
+ status: ListPriceVariantStatusSchema.optional(),
84
+ updated_at: ListPriceVariantUpdatedAtSchema.optional(),
85
+ created_at: ListPriceVariantCreatedAtSchema.optional(),
86
+ business_entity_id: ListPriceVariantBusinessEntityIdSchema.optional(),
87
+ include_site_level_resources: ListPriceVariantIncludeSiteLevelResourcesSchema.optional(),
88
+ sort_by: ListPriceVariantSortBySchema.optional(),
89
+ });
90
+ export { ListPriceVariantBodySchema };
@@ -0,0 +1,132 @@
1
+ // Generated Zod schemas: PricingPageSession
2
+ // Actions: createForNewSubscription, createForExistingSubscription
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //PricingPageSession.createForNewSubscription
6
+ const CreateForNewSubscriptionPricingPageSessionCustomSchema = z.looseObject({});
7
+ const CreateForNewSubscriptionPricingPageSessionPricingPageSchema = z.object({
8
+ id: z.string().max(50),
9
+ });
10
+ const CreateForNewSubscriptionPricingPageSessionSubscriptionSchema = z.looseObject({
11
+ id: z.string().max(50).optional(),
12
+ });
13
+ const CreateForNewSubscriptionPricingPageSessionCustomerSchema = z.looseObject({
14
+ id: z.string().max(50).optional(),
15
+ email: z.string().email().max(70).optional(),
16
+ first_name: z.string().max(150).optional(),
17
+ last_name: z.string().max(150).optional(),
18
+ company: z.string().max(250).optional(),
19
+ phone: z.string().max(50).optional(),
20
+ locale: z.string().max(50).optional(),
21
+ });
22
+ const CreateForNewSubscriptionPricingPageSessionBillingAddressSchema = z.object({
23
+ first_name: z.string().max(150).optional(),
24
+ last_name: z.string().max(150).optional(),
25
+ email: z.string().email().max(70).optional(),
26
+ company: z.string().max(250).optional(),
27
+ phone: z.string().max(50).optional(),
28
+ line1: z.string().max(150).optional(),
29
+ line2: z.string().max(150).optional(),
30
+ line3: z.string().max(150).optional(),
31
+ city: z.string().max(50).optional(),
32
+ state_code: z.string().max(50).optional(),
33
+ state: z.string().max(50).optional(),
34
+ zip: z.string().max(20).optional(),
35
+ country: z.string().max(50).optional(),
36
+ validation_status: z
37
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
38
+ .optional(),
39
+ });
40
+ const CreateForNewSubscriptionPricingPageSessionShippingAddressSchema = z.object({
41
+ first_name: z.string().max(150).optional(),
42
+ last_name: z.string().max(150).optional(),
43
+ email: z.string().email().max(70).optional(),
44
+ company: z.string().max(250).optional(),
45
+ phone: z.string().max(50).optional(),
46
+ line1: z.string().max(150).optional(),
47
+ line2: z.string().max(150).optional(),
48
+ line3: z.string().max(150).optional(),
49
+ city: z.string().max(50).optional(),
50
+ state_code: z.string().max(50).optional(),
51
+ state: z.string().max(50).optional(),
52
+ zip: z.string().max(20).optional(),
53
+ country: z.string().max(50).optional(),
54
+ validation_status: z
55
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
56
+ .optional(),
57
+ });
58
+ const CreateForNewSubscriptionPricingPageSessionContractTermSchema = z.object({
59
+ action_at_term_end: z
60
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
61
+ .optional(),
62
+ cancellation_cutoff_period: z.number().int().optional(),
63
+ });
64
+ const CreateForNewSubscriptionPricingPageSessionDiscountsSchema = z.object({
65
+ apply_on: z
66
+ .array(z.enum(['invoice_amount', 'specific_item_price']).optional())
67
+ .optional(),
68
+ duration_type: z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
69
+ percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
70
+ amount: z.array(z.number().int().min(0).optional()).optional(),
71
+ period: z.array(z.number().int().min(1).optional()).optional(),
72
+ period_unit: z
73
+ .array(z.enum(['day', 'week', 'month', 'year']).optional())
74
+ .optional(),
75
+ included_in_mrr: z.array(z.boolean().optional()).optional(),
76
+ item_price_id: z.array(z.string().max(100).optional()).optional(),
77
+ quantity: z.array(z.number().int().min(1).optional()).optional(),
78
+ label: z.array(z.string().max(100).optional()).optional(),
79
+ });
80
+ const CreateForNewSubscriptionPricingPageSessionBodySchema = z.looseObject({
81
+ redirect_url: z.string().max(250).optional(),
82
+ business_entity_id: z.string().max(50).optional(),
83
+ auto_select_local_currency: z.boolean().default(false).optional(),
84
+ custom: CreateForNewSubscriptionPricingPageSessionCustomSchema.optional(),
85
+ pricing_page: CreateForNewSubscriptionPricingPageSessionPricingPageSchema.optional(),
86
+ subscription: CreateForNewSubscriptionPricingPageSessionSubscriptionSchema.optional(),
87
+ customer: CreateForNewSubscriptionPricingPageSessionCustomerSchema.optional(),
88
+ billing_address: CreateForNewSubscriptionPricingPageSessionBillingAddressSchema.optional(),
89
+ shipping_address: CreateForNewSubscriptionPricingPageSessionShippingAddressSchema.optional(),
90
+ contract_term: CreateForNewSubscriptionPricingPageSessionContractTermSchema.optional(),
91
+ discounts: CreateForNewSubscriptionPricingPageSessionDiscountsSchema.optional(),
92
+ });
93
+ export { CreateForNewSubscriptionPricingPageSessionBodySchema };
94
+ //PricingPageSession.createForExistingSubscription
95
+ const CreateForExistingSubscriptionPricingPageSessionCustomSchema = z.looseObject({});
96
+ const CreateForExistingSubscriptionPricingPageSessionPricingPageSchema = z.object({
97
+ id: z.string().max(50).optional(),
98
+ });
99
+ const CreateForExistingSubscriptionPricingPageSessionSubscriptionSchema = z.looseObject({
100
+ id: z.string().max(50),
101
+ });
102
+ const CreateForExistingSubscriptionPricingPageSessionContractTermSchema = z.object({
103
+ action_at_term_end: z
104
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
105
+ .optional(),
106
+ cancellation_cutoff_period: z.number().int().optional(),
107
+ });
108
+ const CreateForExistingSubscriptionPricingPageSessionDiscountsSchema = z.object({
109
+ apply_on: z
110
+ .array(z.enum(['invoice_amount', 'specific_item_price']).optional())
111
+ .optional(),
112
+ duration_type: z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
113
+ percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
114
+ amount: z.array(z.number().int().min(0).optional()).optional(),
115
+ period: z.array(z.number().int().min(1).optional()).optional(),
116
+ period_unit: z
117
+ .array(z.enum(['day', 'week', 'month', 'year']).optional())
118
+ .optional(),
119
+ included_in_mrr: z.array(z.boolean().optional()).optional(),
120
+ item_price_id: z.array(z.string().max(100).optional()).optional(),
121
+ quantity: z.array(z.number().int().min(1).optional()).optional(),
122
+ label: z.array(z.string().max(100).optional()).optional(),
123
+ });
124
+ const CreateForExistingSubscriptionPricingPageSessionBodySchema = z.looseObject({
125
+ redirect_url: z.string().max(250).optional(),
126
+ custom: CreateForExistingSubscriptionPricingPageSessionCustomSchema.optional(),
127
+ pricing_page: CreateForExistingSubscriptionPricingPageSessionPricingPageSchema.optional(),
128
+ subscription: CreateForExistingSubscriptionPricingPageSessionSubscriptionSchema.optional(),
129
+ contract_term: CreateForExistingSubscriptionPricingPageSessionContractTermSchema.optional(),
130
+ discounts: CreateForExistingSubscriptionPricingPageSessionDiscountsSchema.optional(),
131
+ });
132
+ export { CreateForExistingSubscriptionPricingPageSessionBodySchema };