chargebee 3.25.0-beta.1 → 3.26.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 (171) hide show
  1. package/CHANGELOG.md +103 -4
  2. package/README.md +0 -39
  3. package/cjs/RequestWrapper.js +1 -28
  4. package/cjs/chargebee.cjs.js +0 -3
  5. package/cjs/chargebee.cjs.worker.js +0 -2
  6. package/cjs/createChargebee.js +0 -5
  7. package/cjs/environment.js +1 -1
  8. package/cjs/resources/api_endpoints.js +121 -3
  9. package/cjs/resources/webhook/eventType.js +2 -0
  10. package/esm/RequestWrapper.js +1 -28
  11. package/esm/chargebee.esm.js +0 -2
  12. package/esm/chargebee.esm.worker.js +0 -1
  13. package/esm/createChargebee.js +0 -5
  14. package/esm/environment.js +1 -1
  15. package/esm/resources/api_endpoints.js +121 -3
  16. package/esm/resources/webhook/eventType.js +2 -0
  17. package/package.json +1 -4
  18. package/types/core.d.ts +24 -6
  19. package/types/index.d.ts +8 -17
  20. package/types/resources/Content.d.ts +4 -1
  21. package/types/resources/CreditNote.d.ts +1 -0
  22. package/types/resources/Customer.d.ts +14 -4
  23. package/types/resources/Estimate.d.ts +14 -4
  24. package/types/resources/Event.d.ts +2 -0
  25. package/types/resources/Gift.d.ts +23 -6
  26. package/types/resources/GrantBlock.d.ts +59 -0
  27. package/types/resources/HostedPage.d.ts +6 -1
  28. package/types/resources/Invoice.d.ts +14 -5
  29. package/types/resources/LedgerAccountBalance.d.ts +50 -0
  30. package/types/resources/LedgerOperation.d.ts +141 -0
  31. package/types/resources/OmnichannelSubscription.d.ts +8 -0
  32. package/types/resources/OmnichannelSubscriptionItem.d.ts +1 -0
  33. package/types/resources/PaymentIntent.d.ts +35 -10
  34. package/types/resources/PaymentSource.d.ts +7 -2
  35. package/types/resources/PromotionalGrant.d.ts +37 -0
  36. package/types/resources/Purchase.d.ts +7 -2
  37. package/types/resources/Subscription.d.ts +49 -14
  38. package/types/resources/WebhookEvent.d.ts +22 -4
  39. package/cjs/chargebeeZodValidationError.js +0 -18
  40. package/cjs/schema/addon.schema.js +0 -153
  41. package/cjs/schema/address.schema.js +0 -35
  42. package/cjs/schema/alert.schema.js +0 -38
  43. package/cjs/schema/attached_item.schema.js +0 -58
  44. package/cjs/schema/business_entity.schema.js +0 -46
  45. package/cjs/schema/card.schema.js +0 -165
  46. package/cjs/schema/comment.schema.js +0 -69
  47. package/cjs/schema/coupon.schema.js +0 -209
  48. package/cjs/schema/coupon_code.schema.js +0 -14
  49. package/cjs/schema/coupon_set.schema.js +0 -28
  50. package/cjs/schema/credit_note.schema.js +0 -288
  51. package/cjs/schema/currency.schema.js +0 -32
  52. package/cjs/schema/customer.schema.js +0 -986
  53. package/cjs/schema/customer_entitlement.schema.js +0 -14
  54. package/cjs/schema/differential_price.schema.js +0 -68
  55. package/cjs/schema/entitlement.schema.js +0 -27
  56. package/cjs/schema/entitlement_override.schema.js +0 -33
  57. package/cjs/schema/estimate.schema.js +0 -1525
  58. package/cjs/schema/export.schema.js +0 -1545
  59. package/cjs/schema/feature.schema.js +0 -37
  60. package/cjs/schema/gift.schema.js +0 -277
  61. package/cjs/schema/hosted_page.schema.js +0 -1649
  62. package/cjs/schema/in_app_subscription.schema.js +0 -68
  63. package/cjs/schema/index.js +0 -80
  64. package/cjs/schema/invoice.schema.js +0 -1467
  65. package/cjs/schema/item.schema.js +0 -91
  66. package/cjs/schema/item_entitlement.schema.js +0 -45
  67. package/cjs/schema/item_family.schema.js +0 -21
  68. package/cjs/schema/item_price.schema.js +0 -190
  69. package/cjs/schema/non_subscription.schema.js +0 -28
  70. package/cjs/schema/offer_event.schema.js +0 -13
  71. package/cjs/schema/offer_fulfillment.schema.js +0 -20
  72. package/cjs/schema/omnichannel_one_time_order.schema.js +0 -26
  73. package/cjs/schema/omnichannel_subscription.schema.js +0 -89
  74. package/cjs/schema/omnichannel_subscription_item.schema.js +0 -13
  75. package/cjs/schema/order.schema.js +0 -273
  76. package/cjs/schema/payment_intent.schema.js +0 -117
  77. package/cjs/schema/payment_schedule_scheme.schema.js +0 -20
  78. package/cjs/schema/payment_source.schema.js +0 -358
  79. package/cjs/schema/payment_voucher.schema.js +0 -57
  80. package/cjs/schema/personalized_offer.schema.js +0 -28
  81. package/cjs/schema/plan.schema.js +0 -225
  82. package/cjs/schema/portal_session.schema.js +0 -22
  83. package/cjs/schema/price_variant.schema.js +0 -36
  84. package/cjs/schema/pricing_page_session.schema.js +0 -135
  85. package/cjs/schema/promotional_credit.schema.js +0 -78
  86. package/cjs/schema/purchase.schema.js +0 -272
  87. package/cjs/schema/quote.schema.js +0 -1557
  88. package/cjs/schema/ramp.schema.js +0 -209
  89. package/cjs/schema/recorded_purchase.schema.js +0 -32
  90. package/cjs/schema/resource_migration.schema.js +0 -14
  91. package/cjs/schema/site_migration_detail.schema.js +0 -81
  92. package/cjs/schema/subscription.schema.js +0 -2993
  93. package/cjs/schema/subscription_entitlement.schema.js +0 -25
  94. package/cjs/schema/time_machine.schema.js +0 -17
  95. package/cjs/schema/transaction.schema.js +0 -70
  96. package/cjs/schema/unbilled_charge.schema.js +0 -113
  97. package/cjs/schema/usage.schema.js +0 -93
  98. package/cjs/schema/usage_charge.schema.js +0 -17
  99. package/cjs/schema/usage_event.schema.js +0 -28
  100. package/cjs/schema/usage_file.schema.js +0 -13
  101. package/cjs/schema/usage_summary.schema.js +0 -17
  102. package/cjs/schema/virtual_bank_account.schema.js +0 -43
  103. package/cjs/schema/webhook_endpoint.schema.js +0 -504
  104. package/cjs/validationLoader.js +0 -59
  105. package/esm/chargebeeZodValidationError.js +0 -14
  106. package/esm/schema/addon.schema.js +0 -150
  107. package/esm/schema/address.schema.js +0 -32
  108. package/esm/schema/alert.schema.js +0 -35
  109. package/esm/schema/attached_item.schema.js +0 -55
  110. package/esm/schema/business_entity.schema.js +0 -43
  111. package/esm/schema/card.schema.js +0 -162
  112. package/esm/schema/comment.schema.js +0 -66
  113. package/esm/schema/coupon.schema.js +0 -206
  114. package/esm/schema/coupon_code.schema.js +0 -11
  115. package/esm/schema/coupon_set.schema.js +0 -25
  116. package/esm/schema/credit_note.schema.js +0 -285
  117. package/esm/schema/currency.schema.js +0 -29
  118. package/esm/schema/customer.schema.js +0 -983
  119. package/esm/schema/customer_entitlement.schema.js +0 -11
  120. package/esm/schema/differential_price.schema.js +0 -65
  121. package/esm/schema/entitlement.schema.js +0 -24
  122. package/esm/schema/entitlement_override.schema.js +0 -30
  123. package/esm/schema/estimate.schema.js +0 -1522
  124. package/esm/schema/export.schema.js +0 -1542
  125. package/esm/schema/feature.schema.js +0 -34
  126. package/esm/schema/gift.schema.js +0 -274
  127. package/esm/schema/hosted_page.schema.js +0 -1646
  128. package/esm/schema/in_app_subscription.schema.js +0 -65
  129. package/esm/schema/index.js +0 -64
  130. package/esm/schema/invoice.schema.js +0 -1464
  131. package/esm/schema/item.schema.js +0 -88
  132. package/esm/schema/item_entitlement.schema.js +0 -42
  133. package/esm/schema/item_family.schema.js +0 -18
  134. package/esm/schema/item_price.schema.js +0 -187
  135. package/esm/schema/non_subscription.schema.js +0 -25
  136. package/esm/schema/offer_event.schema.js +0 -10
  137. package/esm/schema/offer_fulfillment.schema.js +0 -17
  138. package/esm/schema/omnichannel_one_time_order.schema.js +0 -23
  139. package/esm/schema/omnichannel_subscription.schema.js +0 -86
  140. package/esm/schema/omnichannel_subscription_item.schema.js +0 -10
  141. package/esm/schema/order.schema.js +0 -270
  142. package/esm/schema/payment_intent.schema.js +0 -114
  143. package/esm/schema/payment_schedule_scheme.schema.js +0 -17
  144. package/esm/schema/payment_source.schema.js +0 -355
  145. package/esm/schema/payment_voucher.schema.js +0 -54
  146. package/esm/schema/personalized_offer.schema.js +0 -25
  147. package/esm/schema/plan.schema.js +0 -222
  148. package/esm/schema/portal_session.schema.js +0 -19
  149. package/esm/schema/price_variant.schema.js +0 -33
  150. package/esm/schema/pricing_page_session.schema.js +0 -132
  151. package/esm/schema/promotional_credit.schema.js +0 -75
  152. package/esm/schema/purchase.schema.js +0 -269
  153. package/esm/schema/quote.schema.js +0 -1554
  154. package/esm/schema/ramp.schema.js +0 -206
  155. package/esm/schema/recorded_purchase.schema.js +0 -29
  156. package/esm/schema/resource_migration.schema.js +0 -11
  157. package/esm/schema/site_migration_detail.schema.js +0 -78
  158. package/esm/schema/subscription.schema.js +0 -2990
  159. package/esm/schema/subscription_entitlement.schema.js +0 -22
  160. package/esm/schema/time_machine.schema.js +0 -14
  161. package/esm/schema/transaction.schema.js +0 -67
  162. package/esm/schema/unbilled_charge.schema.js +0 -110
  163. package/esm/schema/usage.schema.js +0 -90
  164. package/esm/schema/usage_charge.schema.js +0 -14
  165. package/esm/schema/usage_event.schema.js +0 -25
  166. package/esm/schema/usage_file.schema.js +0 -10
  167. package/esm/schema/usage_summary.schema.js +0 -14
  168. package/esm/schema/virtual_bank_account.schema.js +0 -40
  169. package/esm/schema/webhook_endpoint.schema.js +0 -501
  170. package/esm/validationLoader.js +0 -56
  171. package/types/resources/QuoteEntitlement.d.ts +0 -16
@@ -1,209 +0,0 @@
1
- "use strict";
2
- // Generated Zod schemas: Coupon
3
- // Actions: create, createForItems, updateForItems, update, copy
4
- // Do not edit manually – regenerate via sdk-generator
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CopyCouponBodySchema = exports.UpdateCouponBodySchema = exports.UpdateForItemsCouponBodySchema = exports.CreateForItemsCouponBodySchema = exports.CreateCouponBodySchema = void 0;
7
- const zod_1 = require("zod");
8
- //Coupon.create
9
- const CreateCouponMetaDataSchema = zod_1.z.looseObject({});
10
- const CreateCouponBodySchema = zod_1.z.looseObject({
11
- id: zod_1.z.string().max(100),
12
- name: zod_1.z.string().max(50),
13
- invoice_name: zod_1.z.string().max(100).optional(),
14
- discount_type: zod_1.z
15
- .enum(['fixed_amount', 'percentage', 'offer_quantity'])
16
- .optional(),
17
- discount_amount: zod_1.z.number().int().min(0).optional(),
18
- currency_code: zod_1.z.string().max(3).optional(),
19
- discount_percentage: zod_1.z.number().min(0.01).max(100).optional(),
20
- discount_quantity: zod_1.z.number().int().min(1).optional(),
21
- apply_on: zod_1.z.enum([
22
- 'invoice_amount',
23
- 'specified_items_total',
24
- 'each_specified_item',
25
- 'each_unit_of_specified_items',
26
- ]),
27
- duration_type: zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional(),
28
- duration_month: zod_1.z.number().int().min(1).max(240).optional(),
29
- valid_till: zod_1.z.number().int().optional(),
30
- max_redemptions: zod_1.z.number().int().min(1).optional(),
31
- invoice_notes: zod_1.z.string().max(2000).optional(),
32
- meta_data: CreateCouponMetaDataSchema.optional(),
33
- included_in_mrr: zod_1.z.boolean().optional(),
34
- period: zod_1.z.number().int().min(1).optional(),
35
- period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
36
- plan_constraint: zod_1.z.enum(['none', 'all', 'specific']).optional(),
37
- addon_constraint: zod_1.z.enum(['none', 'all', 'specific']).optional(),
38
- plan_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
39
- addon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
40
- status: zod_1.z.enum(['active', 'archived']).optional(),
41
- });
42
- exports.CreateCouponBodySchema = CreateCouponBodySchema;
43
- //Coupon.createForItems
44
- const CreateForItemsCouponMetaDataSchema = zod_1.z.looseObject({});
45
- const CreateForItemsCouponItemConstraintsSchema = zod_1.z.object({
46
- constraint: zod_1.z.array(zod_1.z.enum(['none', 'all', 'specific', 'criteria']).optional()),
47
- item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()),
48
- item_price_ids: zod_1.z.array(zod_1.z.array(zod_1.z.string().optional()).optional()).optional(),
49
- });
50
- const CreateForItemsCouponItemConstraintCriteriaSchema = zod_1.z.object({
51
- item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
52
- item_family_ids: zod_1.z
53
- .array(zod_1.z.array(zod_1.z.string().optional()).optional())
54
- .optional(),
55
- currencies: zod_1.z.array(zod_1.z.array(zod_1.z.string().optional()).optional()).optional(),
56
- item_price_periods: zod_1.z
57
- .array(zod_1.z.array(zod_1.z.string().optional()).optional())
58
- .optional(),
59
- });
60
- const CreateForItemsCouponCouponConstraintsSchema = zod_1.z.object({
61
- entity_type: zod_1.z.array(zod_1.z.enum(['customer']).optional()),
62
- type: zod_1.z.array(zod_1.z
63
- .enum([
64
- 'max_redemptions',
65
- 'unique_by',
66
- 'existing_customer',
67
- 'new_customer',
68
- ])
69
- .optional()),
70
- value: zod_1.z.array(zod_1.z.string().max(65000).optional()).optional(),
71
- });
72
- const CreateForItemsCouponBodySchema = zod_1.z.looseObject({
73
- id: zod_1.z.string().max(100),
74
- name: zod_1.z.string().max(50),
75
- invoice_name: zod_1.z.string().max(100).optional(),
76
- discount_type: zod_1.z
77
- .enum(['fixed_amount', 'percentage', 'offer_quantity'])
78
- .optional(),
79
- discount_amount: zod_1.z.number().int().min(0).optional(),
80
- currency_code: zod_1.z.string().max(3).optional(),
81
- discount_percentage: zod_1.z.number().min(0.01).max(100).optional(),
82
- discount_quantity: zod_1.z.number().int().min(1).optional(),
83
- apply_on: zod_1.z.enum([
84
- 'invoice_amount',
85
- 'specified_items_total',
86
- 'each_specified_item',
87
- 'each_unit_of_specified_items',
88
- ]),
89
- duration_type: zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional(),
90
- duration_month: zod_1.z.number().int().min(1).max(240).optional(),
91
- valid_from: zod_1.z.number().int().optional(),
92
- valid_till: zod_1.z.number().int().optional(),
93
- max_redemptions: zod_1.z.number().int().min(1).optional(),
94
- invoice_notes: zod_1.z.string().max(2000).optional(),
95
- meta_data: CreateForItemsCouponMetaDataSchema.optional(),
96
- included_in_mrr: zod_1.z.boolean().optional(),
97
- period: zod_1.z.number().int().min(1).optional(),
98
- period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
99
- status: zod_1.z.enum(['active', 'archived']).optional(),
100
- item_constraints: CreateForItemsCouponItemConstraintsSchema.optional(),
101
- item_constraint_criteria: CreateForItemsCouponItemConstraintCriteriaSchema.optional(),
102
- coupon_constraints: CreateForItemsCouponCouponConstraintsSchema.optional(),
103
- });
104
- exports.CreateForItemsCouponBodySchema = CreateForItemsCouponBodySchema;
105
- //Coupon.updateForItems
106
- const UpdateForItemsCouponMetaDataSchema = zod_1.z.looseObject({});
107
- const UpdateForItemsCouponItemConstraintsSchema = zod_1.z.object({
108
- constraint: zod_1.z.array(zod_1.z.enum(['none', 'all', 'specific', 'criteria']).optional()),
109
- item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()),
110
- item_price_ids: zod_1.z.array(zod_1.z.array(zod_1.z.string().optional()).optional()).optional(),
111
- });
112
- const UpdateForItemsCouponItemConstraintCriteriaSchema = zod_1.z.object({
113
- item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
114
- item_family_ids: zod_1.z
115
- .array(zod_1.z.array(zod_1.z.string().optional()).optional())
116
- .optional(),
117
- currencies: zod_1.z.array(zod_1.z.array(zod_1.z.string().optional()).optional()).optional(),
118
- item_price_periods: zod_1.z
119
- .array(zod_1.z.array(zod_1.z.string().optional()).optional())
120
- .optional(),
121
- });
122
- const UpdateForItemsCouponCouponConstraintsSchema = zod_1.z.object({
123
- entity_type: zod_1.z.array(zod_1.z.enum(['customer']).optional()),
124
- type: zod_1.z.array(zod_1.z
125
- .enum([
126
- 'max_redemptions',
127
- 'unique_by',
128
- 'existing_customer',
129
- 'new_customer',
130
- ])
131
- .optional()),
132
- value: zod_1.z.array(zod_1.z.string().max(65000).optional()).optional(),
133
- });
134
- const UpdateForItemsCouponBodySchema = zod_1.z.looseObject({
135
- name: zod_1.z.string().max(50).optional(),
136
- invoice_name: zod_1.z.string().max(100).optional(),
137
- discount_type: zod_1.z
138
- .enum(['fixed_amount', 'percentage', 'offer_quantity'])
139
- .optional(),
140
- discount_amount: zod_1.z.number().int().min(0).optional(),
141
- currency_code: zod_1.z.string().max(3).optional(),
142
- discount_percentage: zod_1.z.number().min(0.01).max(100).optional(),
143
- discount_quantity: zod_1.z.number().int().min(1).optional(),
144
- apply_on: zod_1.z
145
- .enum([
146
- 'invoice_amount',
147
- 'specified_items_total',
148
- 'each_specified_item',
149
- 'each_unit_of_specified_items',
150
- ])
151
- .optional(),
152
- duration_type: zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional(),
153
- duration_month: zod_1.z.number().int().min(1).max(240).optional(),
154
- valid_from: zod_1.z.number().int().optional(),
155
- valid_till: zod_1.z.number().int().optional(),
156
- max_redemptions: zod_1.z.number().int().min(1).optional(),
157
- invoice_notes: zod_1.z.string().max(2000).optional(),
158
- meta_data: UpdateForItemsCouponMetaDataSchema.optional(),
159
- included_in_mrr: zod_1.z.boolean().optional(),
160
- period: zod_1.z.number().int().min(1).optional(),
161
- period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
162
- item_constraints: UpdateForItemsCouponItemConstraintsSchema.optional(),
163
- item_constraint_criteria: UpdateForItemsCouponItemConstraintCriteriaSchema.optional(),
164
- coupon_constraints: UpdateForItemsCouponCouponConstraintsSchema.optional(),
165
- });
166
- exports.UpdateForItemsCouponBodySchema = UpdateForItemsCouponBodySchema;
167
- //Coupon.update
168
- const UpdateCouponMetaDataSchema = zod_1.z.looseObject({});
169
- const UpdateCouponBodySchema = zod_1.z.looseObject({
170
- name: zod_1.z.string().max(50).optional(),
171
- invoice_name: zod_1.z.string().max(100).optional(),
172
- discount_type: zod_1.z
173
- .enum(['fixed_amount', 'percentage', 'offer_quantity'])
174
- .optional(),
175
- discount_amount: zod_1.z.number().int().min(0).optional(),
176
- currency_code: zod_1.z.string().max(3).optional(),
177
- discount_percentage: zod_1.z.number().min(0.01).max(100).optional(),
178
- discount_quantity: zod_1.z.number().int().min(1).optional(),
179
- apply_on: zod_1.z
180
- .enum([
181
- 'invoice_amount',
182
- 'specified_items_total',
183
- 'each_specified_item',
184
- 'each_unit_of_specified_items',
185
- ])
186
- .optional(),
187
- duration_type: zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional(),
188
- duration_month: zod_1.z.number().int().min(1).max(240).optional(),
189
- valid_till: zod_1.z.number().int().optional(),
190
- max_redemptions: zod_1.z.number().int().min(1).optional(),
191
- invoice_notes: zod_1.z.string().max(2000).optional(),
192
- meta_data: UpdateCouponMetaDataSchema.optional(),
193
- included_in_mrr: zod_1.z.boolean().optional(),
194
- period: zod_1.z.number().int().min(1).optional(),
195
- period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
196
- plan_constraint: zod_1.z.enum(['none', 'all', 'specific']).optional(),
197
- addon_constraint: zod_1.z.enum(['none', 'all', 'specific']).optional(),
198
- plan_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
199
- addon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
200
- });
201
- exports.UpdateCouponBodySchema = UpdateCouponBodySchema;
202
- //Coupon.copy
203
- const CopyCouponBodySchema = zod_1.z.looseObject({
204
- from_site: zod_1.z.string().max(50),
205
- id_at_from_site: zod_1.z.string().max(100),
206
- id: zod_1.z.string().max(100).optional(),
207
- for_site_merging: zod_1.z.boolean().default(false).optional(),
208
- });
209
- exports.CopyCouponBodySchema = CopyCouponBodySchema;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- // Generated Zod schemas: CouponCode
3
- // Actions: create
4
- // Do not edit manually – regenerate via sdk-generator
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CreateCouponCodeBodySchema = void 0;
7
- const zod_1 = require("zod");
8
- //CouponCode.create
9
- const CreateCouponCodeBodySchema = zod_1.z.looseObject({
10
- coupon_id: zod_1.z.string().max(100),
11
- coupon_set_name: zod_1.z.string().max(50),
12
- code: zod_1.z.string().max(50),
13
- });
14
- exports.CreateCouponCodeBodySchema = CreateCouponCodeBodySchema;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- // Generated Zod schemas: CouponSet
3
- // Actions: create, addCouponCodes, update
4
- // Do not edit manually – regenerate via sdk-generator
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UpdateCouponSetBodySchema = exports.AddCouponCodesCouponSetBodySchema = exports.CreateCouponSetBodySchema = void 0;
7
- const zod_1 = require("zod");
8
- //CouponSet.create
9
- const CreateCouponSetMetaDataSchema = zod_1.z.looseObject({});
10
- const CreateCouponSetBodySchema = zod_1.z.looseObject({
11
- coupon_id: zod_1.z.string().max(100),
12
- name: zod_1.z.string().max(50),
13
- id: zod_1.z.string().max(50),
14
- meta_data: CreateCouponSetMetaDataSchema.optional(),
15
- });
16
- exports.CreateCouponSetBodySchema = CreateCouponSetBodySchema;
17
- //CouponSet.addCouponCodes
18
- const AddCouponCodesCouponSetBodySchema = zod_1.z.looseObject({
19
- code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
20
- });
21
- exports.AddCouponCodesCouponSetBodySchema = AddCouponCodesCouponSetBodySchema;
22
- //CouponSet.update
23
- const UpdateCouponSetMetaDataSchema = zod_1.z.looseObject({});
24
- const UpdateCouponSetBodySchema = zod_1.z.looseObject({
25
- name: zod_1.z.string().max(50).optional(),
26
- meta_data: UpdateCouponSetMetaDataSchema.optional(),
27
- });
28
- exports.UpdateCouponSetBodySchema = UpdateCouponSetBodySchema;
@@ -1,288 +0,0 @@
1
- "use strict";
2
- // Generated Zod schemas: CreditNote
3
- // Actions: create, retrieve, pdf, refund, recordRefund, voidCreditNote, creditNotesForCustomer, delete, removeTaxWithheldRefund, importCreditNote
4
- // Do not edit manually – regenerate via sdk-generator
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ImportCreditNoteCreditNoteBodySchema = exports.RemoveTaxWithheldRefundCreditNoteBodySchema = exports.DeleteCreditNoteBodySchema = exports.CreditNotesForCustomerCreditNoteBodySchema = exports.VoidCreditNoteCreditNoteBodySchema = exports.RecordRefundCreditNoteBodySchema = exports.RefundCreditNoteBodySchema = exports.PdfCreditNoteBodySchema = exports.RetrieveCreditNoteBodySchema = exports.CreateCreditNoteBodySchema = void 0;
7
- const zod_1 = require("zod");
8
- //CreditNote.create
9
- const CreateCreditNoteLineItemsSchema = zod_1.z.object({
10
- reference_line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
11
- unit_amount: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
12
- unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
13
- quantity: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
14
- quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
15
- amount: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
16
- date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
17
- date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
18
- description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
19
- entity_type: zod_1.z
20
- .array(zod_1.z
21
- .enum([
22
- 'adhoc',
23
- 'plan_item_price',
24
- 'addon_item_price',
25
- 'charge_item_price',
26
- 'plan',
27
- 'addon',
28
- ])
29
- .optional())
30
- .optional(),
31
- entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
32
- });
33
- const CreateCreditNoteBodySchema = zod_1.z.looseObject({
34
- reference_invoice_id: zod_1.z.string().max(50).optional(),
35
- customer_id: zod_1.z.string().max(50).optional(),
36
- total: zod_1.z.number().int().min(0).optional(),
37
- type: zod_1.z.enum(['adjustment', 'refundable', 'store']),
38
- reason_code: zod_1.z
39
- .enum([
40
- 'product_unsatisfactory',
41
- 'service_unsatisfactory',
42
- 'order_change',
43
- 'order_cancellation',
44
- 'waiver',
45
- 'other',
46
- ])
47
- .optional(),
48
- create_reason_code: zod_1.z.string().max(100).optional(),
49
- date: zod_1.z.number().int().optional(),
50
- customer_notes: zod_1.z.string().max(2000).optional(),
51
- currency_code: zod_1.z.string().max(3).optional(),
52
- comment: zod_1.z.string().max(300).optional(),
53
- line_items: CreateCreditNoteLineItemsSchema.optional(),
54
- });
55
- exports.CreateCreditNoteBodySchema = CreateCreditNoteBodySchema;
56
- //CreditNote.retrieve
57
- const RetrieveCreditNoteSubscriptionIdSchema = zod_1.z.object({
58
- is: zod_1.z.string().min(1).optional(),
59
- });
60
- const RetrieveCreditNoteCustomerIdSchema = zod_1.z.object({
61
- is: zod_1.z.string().min(1).optional(),
62
- });
63
- const RetrieveCreditNoteLineItemSchema = zod_1.z.object({
64
- subscription_id: RetrieveCreditNoteSubscriptionIdSchema.optional(),
65
- customer_id: RetrieveCreditNoteCustomerIdSchema.optional(),
66
- });
67
- const RetrieveCreditNoteBodySchema = zod_1.z.looseObject({
68
- line_items_limit: zod_1.z.number().int().min(1).max(300).optional(),
69
- line_items_offset: zod_1.z.string().max(1000).optional(),
70
- line_item: RetrieveCreditNoteLineItemSchema.optional(),
71
- });
72
- exports.RetrieveCreditNoteBodySchema = RetrieveCreditNoteBodySchema;
73
- //CreditNote.pdf
74
- const PdfCreditNoteBodySchema = zod_1.z.looseObject({
75
- disposition_type: zod_1.z.enum(['attachment', 'inline']).optional(),
76
- });
77
- exports.PdfCreditNoteBodySchema = PdfCreditNoteBodySchema;
78
- //CreditNote.refund
79
- const RefundCreditNoteBodySchema = zod_1.z.looseObject({
80
- refund_amount: zod_1.z.number().int().min(1).optional(),
81
- customer_notes: zod_1.z.string().max(2000).optional(),
82
- refund_reason_code: zod_1.z.string().max(100).optional(),
83
- });
84
- exports.RefundCreditNoteBodySchema = RefundCreditNoteBodySchema;
85
- //CreditNote.recordRefund
86
- const RecordRefundCreditNoteTransactionSchema = zod_1.z.object({
87
- id: zod_1.z.string().max(40).optional(),
88
- amount: zod_1.z.number().int().min(0).optional(),
89
- payment_method: zod_1.z.enum([
90
- 'cash',
91
- 'check',
92
- 'chargeback',
93
- 'bank_transfer',
94
- 'other',
95
- 'app_store',
96
- 'play_store',
97
- 'custom',
98
- ]),
99
- reference_number: zod_1.z.string().max(100).optional(),
100
- custom_payment_method_id: zod_1.z.string().max(50).optional(),
101
- date: zod_1.z.number().int(),
102
- });
103
- const RecordRefundCreditNoteBodySchema = zod_1.z.looseObject({
104
- refund_reason_code: zod_1.z.string().max(100).optional(),
105
- comment: zod_1.z.string().max(300).optional(),
106
- transaction: RecordRefundCreditNoteTransactionSchema.optional(),
107
- });
108
- exports.RecordRefundCreditNoteBodySchema = RecordRefundCreditNoteBodySchema;
109
- //CreditNote.voidCreditNote
110
- const VoidCreditNoteCreditNoteBodySchema = zod_1.z.looseObject({
111
- comment: zod_1.z.string().max(300).optional(),
112
- });
113
- exports.VoidCreditNoteCreditNoteBodySchema = VoidCreditNoteCreditNoteBodySchema;
114
- //CreditNote.creditNotesForCustomer
115
- const CreditNotesForCustomerCreditNoteBodySchema = zod_1.z.looseObject({
116
- limit: zod_1.z.number().int().min(1).max(100).optional(),
117
- offset: zod_1.z.string().max(1000).optional(),
118
- });
119
- exports.CreditNotesForCustomerCreditNoteBodySchema = CreditNotesForCustomerCreditNoteBodySchema;
120
- //CreditNote.delete
121
- const DeleteCreditNoteBodySchema = zod_1.z.looseObject({
122
- comment: zod_1.z.string().max(300).optional(),
123
- });
124
- exports.DeleteCreditNoteBodySchema = DeleteCreditNoteBodySchema;
125
- //CreditNote.removeTaxWithheldRefund
126
- const RemoveTaxWithheldRefundCreditNoteTaxWithheldSchema = zod_1.z.object({
127
- id: zod_1.z.string().max(40),
128
- });
129
- const RemoveTaxWithheldRefundCreditNoteBodySchema = zod_1.z.looseObject({
130
- tax_withheld: RemoveTaxWithheldRefundCreditNoteTaxWithheldSchema.optional(),
131
- });
132
- exports.RemoveTaxWithheldRefundCreditNoteBodySchema = RemoveTaxWithheldRefundCreditNoteBodySchema;
133
- //CreditNote.importCreditNote
134
- const ImportCreditNoteCreditNoteLineItemsSchema = zod_1.z.object({
135
- reference_line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
136
- id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
137
- date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
138
- date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
139
- subscription_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
140
- description: zod_1.z.array(zod_1.z.string().max(250).optional()),
141
- unit_amount: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
142
- quantity: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
143
- amount: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
144
- unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
145
- quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
146
- amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
147
- entity_type: zod_1.z
148
- .array(zod_1.z
149
- .enum([
150
- 'adhoc',
151
- 'plan_item_price',
152
- 'addon_item_price',
153
- 'charge_item_price',
154
- 'plan_setup',
155
- 'plan',
156
- 'addon',
157
- ])
158
- .optional())
159
- .optional(),
160
- entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
161
- item_level_discount1_entity_id: zod_1.z
162
- .array(zod_1.z.string().max(100).optional())
163
- .optional(),
164
- item_level_discount1_amount: zod_1.z
165
- .array(zod_1.z.number().int().min(0).optional())
166
- .optional(),
167
- item_level_discount2_entity_id: zod_1.z
168
- .array(zod_1.z.string().max(100).optional())
169
- .optional(),
170
- item_level_discount2_amount: zod_1.z
171
- .array(zod_1.z.number().int().min(0).optional())
172
- .optional(),
173
- tax1_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
174
- tax1_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
175
- tax2_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
176
- tax2_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
177
- tax3_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
178
- tax3_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
179
- tax4_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
180
- tax4_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
181
- tax5_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
182
- tax5_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
183
- tax6_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
184
- tax6_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
185
- tax7_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
186
- tax7_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
187
- tax8_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
188
- tax8_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
189
- tax9_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
190
- tax9_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
191
- tax10_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
192
- tax10_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
193
- });
194
- const ImportCreditNoteCreditNoteLineItemTiersSchema = zod_1.z.object({
195
- line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()),
196
- starting_unit: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
197
- ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
198
- quantity_used: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
199
- unit_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
200
- starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
201
- ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
202
- quantity_used_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
203
- unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
204
- });
205
- const ImportCreditNoteCreditNoteDiscountsSchema = zod_1.z.object({
206
- line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
207
- entity_type: zod_1.z.array(zod_1.z
208
- .enum([
209
- 'item_level_coupon',
210
- 'document_level_coupon',
211
- 'promotional_credits',
212
- 'item_level_discount',
213
- 'document_level_discount',
214
- ])
215
- .optional()),
216
- entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
217
- description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
218
- amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
219
- });
220
- const ImportCreditNoteCreditNoteTaxesSchema = zod_1.z.object({
221
- name: zod_1.z.array(zod_1.z.string().max(100).optional()),
222
- rate: zod_1.z.array(zod_1.z.number().min(0).max(100).optional()),
223
- amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
224
- description: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
225
- juris_type: zod_1.z
226
- .array(zod_1.z
227
- .enum([
228
- 'country',
229
- 'federal',
230
- 'state',
231
- 'county',
232
- 'city',
233
- 'special',
234
- 'unincorporated',
235
- 'other',
236
- ])
237
- .optional())
238
- .optional(),
239
- juris_name: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
240
- juris_code: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
241
- });
242
- const ImportCreditNoteCreditNoteAllocationsSchema = zod_1.z.object({
243
- invoice_id: zod_1.z.array(zod_1.z.string().max(50).optional()),
244
- allocated_amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()),
245
- allocated_at: zod_1.z.array(zod_1.z.number().int().optional()),
246
- });
247
- const ImportCreditNoteCreditNoteLinkedRefundsSchema = zod_1.z.object({
248
- id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
249
- amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()),
250
- payment_method: zod_1.z.array(zod_1.z
251
- .enum([
252
- 'cash',
253
- 'check',
254
- 'bank_transfer',
255
- 'other',
256
- 'app_store',
257
- 'play_store',
258
- 'custom',
259
- ])
260
- .optional()),
261
- date: zod_1.z.array(zod_1.z.number().int().optional()),
262
- reference_number: zod_1.z.array(zod_1.z.string().max(100).min(1).optional()).optional(),
263
- });
264
- const ImportCreditNoteCreditNoteBodySchema = zod_1.z.looseObject({
265
- id: zod_1.z.string().max(50),
266
- customer_id: zod_1.z.string().max(50).optional(),
267
- subscription_id: zod_1.z.string().max(50).optional(),
268
- reference_invoice_id: zod_1.z.string().max(50),
269
- type: zod_1.z.enum(['adjustment', 'refundable', 'store']),
270
- currency_code: zod_1.z.string().max(3).optional(),
271
- create_reason_code: zod_1.z.string().max(100),
272
- date: zod_1.z.number().int(),
273
- status: zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(),
274
- total: zod_1.z.number().int().min(0).optional(),
275
- refunded_at: zod_1.z.number().int().optional(),
276
- voided_at: zod_1.z.number().int().optional(),
277
- sub_total: zod_1.z.number().int().min(0).optional(),
278
- round_off_amount: zod_1.z.number().int().min(-99).max(99).optional(),
279
- fractional_correction: zod_1.z.number().int().min(-50000).max(50000).optional(),
280
- vat_number_prefix: zod_1.z.string().max(10).optional(),
281
- line_items: ImportCreditNoteCreditNoteLineItemsSchema.optional(),
282
- line_item_tiers: ImportCreditNoteCreditNoteLineItemTiersSchema.optional(),
283
- discounts: ImportCreditNoteCreditNoteDiscountsSchema.optional(),
284
- taxes: ImportCreditNoteCreditNoteTaxesSchema.optional(),
285
- allocations: ImportCreditNoteCreditNoteAllocationsSchema.optional(),
286
- linked_refunds: ImportCreditNoteCreditNoteLinkedRefundsSchema.optional(),
287
- });
288
- exports.ImportCreditNoteCreditNoteBodySchema = ImportCreditNoteCreditNoteBodySchema;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- // Generated Zod schemas: Currency
3
- // Actions: list, create, update, addSchedule
4
- // Do not edit manually – regenerate via sdk-generator
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AddScheduleCurrencyBodySchema = exports.UpdateCurrencyBodySchema = exports.CreateCurrencyBodySchema = exports.ListCurrencyBodySchema = void 0;
7
- const zod_1 = require("zod");
8
- //Currency.list
9
- const ListCurrencyBodySchema = zod_1.z.looseObject({
10
- limit: zod_1.z.number().int().min(1).max(100).optional(),
11
- offset: zod_1.z.string().max(1000).optional(),
12
- });
13
- exports.ListCurrencyBodySchema = ListCurrencyBodySchema;
14
- //Currency.create
15
- const CreateCurrencyBodySchema = zod_1.z.looseObject({
16
- currency_code: zod_1.z.string().max(3),
17
- forex_type: zod_1.z.enum(['manual', 'auto']),
18
- manual_exchange_rate: zod_1.z.string().max(20).optional(),
19
- });
20
- exports.CreateCurrencyBodySchema = CreateCurrencyBodySchema;
21
- //Currency.update
22
- const UpdateCurrencyBodySchema = zod_1.z.looseObject({
23
- forex_type: zod_1.z.enum(['manual', 'auto']),
24
- manual_exchange_rate: zod_1.z.string().max(20).optional(),
25
- });
26
- exports.UpdateCurrencyBodySchema = UpdateCurrencyBodySchema;
27
- //Currency.addSchedule
28
- const AddScheduleCurrencyBodySchema = zod_1.z.looseObject({
29
- manual_exchange_rate: zod_1.z.string().max(20),
30
- schedule_at: zod_1.z.number().int(),
31
- });
32
- exports.AddScheduleCurrencyBodySchema = AddScheduleCurrencyBodySchema;