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,22 +0,0 @@
1
- "use strict";
2
- // Generated Zod schemas: PortalSession
3
- // Actions: create, activate
4
- // Do not edit manually – regenerate via sdk-generator
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ActivatePortalSessionBodySchema = exports.CreatePortalSessionBodySchema = void 0;
7
- const zod_1 = require("zod");
8
- //PortalSession.create
9
- const CreatePortalSessionCustomerSchema = zod_1.z.object({
10
- id: zod_1.z.string().max(50),
11
- });
12
- const CreatePortalSessionBodySchema = zod_1.z.looseObject({
13
- redirect_url: zod_1.z.string().max(250).optional(),
14
- forward_url: zod_1.z.string().max(250).optional(),
15
- customer: CreatePortalSessionCustomerSchema.optional(),
16
- });
17
- exports.CreatePortalSessionBodySchema = CreatePortalSessionBodySchema;
18
- //PortalSession.activate
19
- const ActivatePortalSessionBodySchema = zod_1.z.looseObject({
20
- token: zod_1.z.string().max(70),
21
- });
22
- exports.ActivatePortalSessionBodySchema = ActivatePortalSessionBodySchema;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- // Generated Zod schemas: PriceVariant
3
- // Actions: create, update
4
- // Do not edit manually – regenerate via sdk-generator
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UpdatePriceVariantBodySchema = exports.CreatePriceVariantBodySchema = void 0;
7
- const zod_1 = require("zod");
8
- //PriceVariant.create
9
- const CreatePriceVariantAttributesSchema = zod_1.z.object({
10
- name: zod_1.z.array(zod_1.z.string().max(100).optional()),
11
- value: zod_1.z.array(zod_1.z.string().max(100).optional()),
12
- });
13
- const CreatePriceVariantBodySchema = zod_1.z.looseObject({
14
- id: zod_1.z.string().max(100),
15
- name: zod_1.z.string().max(100),
16
- external_name: zod_1.z.string().max(100).optional(),
17
- description: zod_1.z.string().max(500).optional(),
18
- variant_group: zod_1.z.string().max(100).optional(),
19
- business_entity_id: zod_1.z.string().max(50).optional(),
20
- attributes: CreatePriceVariantAttributesSchema.optional(),
21
- });
22
- exports.CreatePriceVariantBodySchema = CreatePriceVariantBodySchema;
23
- //PriceVariant.update
24
- const UpdatePriceVariantAttributesSchema = zod_1.z.object({
25
- name: zod_1.z.array(zod_1.z.string().max(100).optional()),
26
- value: zod_1.z.array(zod_1.z.string().max(100).optional()),
27
- });
28
- const UpdatePriceVariantBodySchema = zod_1.z.looseObject({
29
- name: zod_1.z.string().max(100).optional(),
30
- external_name: zod_1.z.string().max(100).optional(),
31
- description: zod_1.z.string().max(500).optional(),
32
- variant_group: zod_1.z.string().max(100).optional(),
33
- status: zod_1.z.enum(['active', 'archived']).optional(),
34
- attributes: UpdatePriceVariantAttributesSchema.optional(),
35
- });
36
- exports.UpdatePriceVariantBodySchema = UpdatePriceVariantBodySchema;
@@ -1,135 +0,0 @@
1
- "use strict";
2
- // Generated Zod schemas: PricingPageSession
3
- // Actions: createForNewSubscription, createForExistingSubscription
4
- // Do not edit manually – regenerate via sdk-generator
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CreateForExistingSubscriptionPricingPageSessionBodySchema = exports.CreateForNewSubscriptionPricingPageSessionBodySchema = void 0;
7
- const zod_1 = require("zod");
8
- //PricingPageSession.createForNewSubscription
9
- const CreateForNewSubscriptionPricingPageSessionCustomSchema = zod_1.z.looseObject({});
10
- const CreateForNewSubscriptionPricingPageSessionPricingPageSchema = zod_1.z.object({
11
- id: zod_1.z.string().max(50),
12
- });
13
- const CreateForNewSubscriptionPricingPageSessionSubscriptionSchema = zod_1.z.looseObject({
14
- id: zod_1.z.string().max(50).optional(),
15
- });
16
- const CreateForNewSubscriptionPricingPageSessionCustomerSchema = zod_1.z.looseObject({
17
- id: zod_1.z.string().max(50).optional(),
18
- email: zod_1.z.string().email().max(70).optional(),
19
- first_name: zod_1.z.string().max(150).optional(),
20
- last_name: zod_1.z.string().max(150).optional(),
21
- company: zod_1.z.string().max(250).optional(),
22
- phone: zod_1.z.string().max(50).optional(),
23
- locale: zod_1.z.string().max(50).optional(),
24
- });
25
- const CreateForNewSubscriptionPricingPageSessionBillingAddressSchema = zod_1.z.object({
26
- first_name: zod_1.z.string().max(150).optional(),
27
- last_name: zod_1.z.string().max(150).optional(),
28
- email: zod_1.z.string().email().max(70).optional(),
29
- company: zod_1.z.string().max(250).optional(),
30
- phone: zod_1.z.string().max(50).optional(),
31
- line1: zod_1.z.string().max(150).optional(),
32
- line2: zod_1.z.string().max(150).optional(),
33
- line3: zod_1.z.string().max(150).optional(),
34
- city: zod_1.z.string().max(50).optional(),
35
- state_code: zod_1.z.string().max(50).optional(),
36
- state: zod_1.z.string().max(50).optional(),
37
- zip: zod_1.z.string().max(20).optional(),
38
- country: zod_1.z.string().max(50).optional(),
39
- validation_status: zod_1.z
40
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
41
- .optional(),
42
- });
43
- const CreateForNewSubscriptionPricingPageSessionShippingAddressSchema = zod_1.z.object({
44
- first_name: zod_1.z.string().max(150).optional(),
45
- last_name: zod_1.z.string().max(150).optional(),
46
- email: zod_1.z.string().email().max(70).optional(),
47
- company: zod_1.z.string().max(250).optional(),
48
- phone: zod_1.z.string().max(50).optional(),
49
- line1: zod_1.z.string().max(150).optional(),
50
- line2: zod_1.z.string().max(150).optional(),
51
- line3: zod_1.z.string().max(150).optional(),
52
- city: zod_1.z.string().max(50).optional(),
53
- state_code: zod_1.z.string().max(50).optional(),
54
- state: zod_1.z.string().max(50).optional(),
55
- zip: zod_1.z.string().max(20).optional(),
56
- country: zod_1.z.string().max(50).optional(),
57
- validation_status: zod_1.z
58
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
59
- .optional(),
60
- });
61
- const CreateForNewSubscriptionPricingPageSessionContractTermSchema = zod_1.z.object({
62
- action_at_term_end: zod_1.z
63
- .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
64
- .optional(),
65
- cancellation_cutoff_period: zod_1.z.number().int().optional(),
66
- });
67
- const CreateForNewSubscriptionPricingPageSessionDiscountsSchema = zod_1.z.object({
68
- apply_on: zod_1.z
69
- .array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
70
- .optional(),
71
- duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
72
- percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
73
- amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
74
- period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
75
- period_unit: zod_1.z
76
- .array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
77
- .optional(),
78
- included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
79
- item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
80
- quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
81
- label: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
82
- });
83
- const CreateForNewSubscriptionPricingPageSessionBodySchema = zod_1.z.looseObject({
84
- redirect_url: zod_1.z.string().max(250).optional(),
85
- business_entity_id: zod_1.z.string().max(50).optional(),
86
- auto_select_local_currency: zod_1.z.boolean().default(false).optional(),
87
- custom: CreateForNewSubscriptionPricingPageSessionCustomSchema.optional(),
88
- pricing_page: CreateForNewSubscriptionPricingPageSessionPricingPageSchema.optional(),
89
- subscription: CreateForNewSubscriptionPricingPageSessionSubscriptionSchema.optional(),
90
- customer: CreateForNewSubscriptionPricingPageSessionCustomerSchema.optional(),
91
- billing_address: CreateForNewSubscriptionPricingPageSessionBillingAddressSchema.optional(),
92
- shipping_address: CreateForNewSubscriptionPricingPageSessionShippingAddressSchema.optional(),
93
- contract_term: CreateForNewSubscriptionPricingPageSessionContractTermSchema.optional(),
94
- discounts: CreateForNewSubscriptionPricingPageSessionDiscountsSchema.optional(),
95
- });
96
- exports.CreateForNewSubscriptionPricingPageSessionBodySchema = CreateForNewSubscriptionPricingPageSessionBodySchema;
97
- //PricingPageSession.createForExistingSubscription
98
- const CreateForExistingSubscriptionPricingPageSessionCustomSchema = zod_1.z.looseObject({});
99
- const CreateForExistingSubscriptionPricingPageSessionPricingPageSchema = zod_1.z.object({
100
- id: zod_1.z.string().max(50).optional(),
101
- });
102
- const CreateForExistingSubscriptionPricingPageSessionSubscriptionSchema = zod_1.z.looseObject({
103
- id: zod_1.z.string().max(50),
104
- });
105
- const CreateForExistingSubscriptionPricingPageSessionContractTermSchema = zod_1.z.object({
106
- action_at_term_end: zod_1.z
107
- .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
108
- .optional(),
109
- cancellation_cutoff_period: zod_1.z.number().int().optional(),
110
- });
111
- const CreateForExistingSubscriptionPricingPageSessionDiscountsSchema = zod_1.z.object({
112
- apply_on: zod_1.z
113
- .array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
114
- .optional(),
115
- duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
116
- percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
117
- amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
118
- period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
119
- period_unit: zod_1.z
120
- .array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
121
- .optional(),
122
- included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
123
- item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
124
- quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
125
- label: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
126
- });
127
- const CreateForExistingSubscriptionPricingPageSessionBodySchema = zod_1.z.looseObject({
128
- redirect_url: zod_1.z.string().max(250).optional(),
129
- custom: CreateForExistingSubscriptionPricingPageSessionCustomSchema.optional(),
130
- pricing_page: CreateForExistingSubscriptionPricingPageSessionPricingPageSchema.optional(),
131
- subscription: CreateForExistingSubscriptionPricingPageSessionSubscriptionSchema.optional(),
132
- contract_term: CreateForExistingSubscriptionPricingPageSessionContractTermSchema.optional(),
133
- discounts: CreateForExistingSubscriptionPricingPageSessionDiscountsSchema.optional(),
134
- });
135
- exports.CreateForExistingSubscriptionPricingPageSessionBodySchema = CreateForExistingSubscriptionPricingPageSessionBodySchema;
@@ -1,78 +0,0 @@
1
- "use strict";
2
- // Generated Zod schemas: PromotionalCredit
3
- // Actions: add, deduct, set, list
4
- // Do not edit manually – regenerate via sdk-generator
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ListPromotionalCreditBodySchema = exports.SetPromotionalCreditBodySchema = exports.DeductPromotionalCreditBodySchema = exports.AddPromotionalCreditBodySchema = void 0;
7
- const zod_1 = require("zod");
8
- //PromotionalCredit.add
9
- const AddPromotionalCreditBodySchema = zod_1.z.looseObject({
10
- customer_id: zod_1.z.string().max(50),
11
- amount: zod_1.z.number().int().min(0).optional(),
12
- amount_in_decimal: zod_1.z.string().max(33).optional(),
13
- currency_code: zod_1.z.string().max(3).optional(),
14
- description: zod_1.z.string().max(250),
15
- credit_type: zod_1.z
16
- .enum(['loyalty_credits', 'referral_rewards', 'general'])
17
- .optional(),
18
- reference: zod_1.z.string().max(500).optional(),
19
- });
20
- exports.AddPromotionalCreditBodySchema = AddPromotionalCreditBodySchema;
21
- //PromotionalCredit.deduct
22
- const DeductPromotionalCreditBodySchema = zod_1.z.looseObject({
23
- customer_id: zod_1.z.string().max(50),
24
- amount: zod_1.z.number().int().min(0).optional(),
25
- amount_in_decimal: zod_1.z.string().max(33).optional(),
26
- currency_code: zod_1.z.string().max(3).optional(),
27
- description: zod_1.z.string().max(250),
28
- credit_type: zod_1.z
29
- .enum(['loyalty_credits', 'referral_rewards', 'general'])
30
- .optional(),
31
- reference: zod_1.z.string().max(500).optional(),
32
- });
33
- exports.DeductPromotionalCreditBodySchema = DeductPromotionalCreditBodySchema;
34
- //PromotionalCredit.set
35
- const SetPromotionalCreditBodySchema = zod_1.z.looseObject({
36
- customer_id: zod_1.z.string().max(50),
37
- amount: zod_1.z.number().int().min(0).optional(),
38
- amount_in_decimal: zod_1.z.string().max(33).optional(),
39
- currency_code: zod_1.z.string().max(3).optional(),
40
- description: zod_1.z.string().max(250),
41
- credit_type: zod_1.z
42
- .enum(['loyalty_credits', 'referral_rewards', 'general'])
43
- .optional(),
44
- reference: zod_1.z.string().max(500).optional(),
45
- });
46
- exports.SetPromotionalCreditBodySchema = SetPromotionalCreditBodySchema;
47
- //PromotionalCredit.list
48
- const ListPromotionalCreditIdSchema = zod_1.z.object({
49
- is: zod_1.z.string().min(1).optional(),
50
- is_not: zod_1.z.string().min(1).optional(),
51
- starts_with: zod_1.z.string().min(1).optional(),
52
- });
53
- const ListPromotionalCreditCreatedAtSchema = zod_1.z.object({
54
- after: zod_1.z.string().regex(RegExp('^d{10}$')).optional(),
55
- before: zod_1.z.string().regex(RegExp('^d{10}$')).optional(),
56
- on: zod_1.z.string().regex(RegExp('^d{10}$')).optional(),
57
- between: zod_1.z.string().regex(RegExp('^[d{10},d{10}]$')).optional(),
58
- });
59
- const ListPromotionalCreditTypeSchema = zod_1.z.object({
60
- is: zod_1.z.enum(['increment', 'decrement']).optional(),
61
- is_not: zod_1.z.enum(['increment', 'decrement']).optional(),
62
- in: zod_1.z.enum(['increment', 'decrement']).optional(),
63
- not_in: zod_1.z.enum(['increment', 'decrement']).optional(),
64
- });
65
- const ListPromotionalCreditCustomerIdSchema = zod_1.z.object({
66
- is: zod_1.z.string().min(1).optional(),
67
- is_not: zod_1.z.string().min(1).optional(),
68
- starts_with: zod_1.z.string().min(1).optional(),
69
- });
70
- const ListPromotionalCreditBodySchema = zod_1.z.looseObject({
71
- limit: zod_1.z.number().int().min(1).max(100).optional(),
72
- offset: zod_1.z.string().max(1000).optional(),
73
- id: ListPromotionalCreditIdSchema.optional(),
74
- created_at: ListPromotionalCreditCreatedAtSchema.optional(),
75
- type: ListPromotionalCreditTypeSchema.optional(),
76
- customer_id: ListPromotionalCreditCustomerIdSchema.optional(),
77
- });
78
- exports.ListPromotionalCreditBodySchema = ListPromotionalCreditBodySchema;
@@ -1,272 +0,0 @@
1
- "use strict";
2
- // Generated Zod schemas: Purchase
3
- // Actions: create, estimate
4
- // Do not edit manually – regenerate via sdk-generator
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EstimatePurchaseBodySchema = exports.CreatePurchaseBodySchema = void 0;
7
- const zod_1 = require("zod");
8
- //Purchase.create
9
- const CreatePurchaseInvoiceInfoSchema = zod_1.z.object({
10
- po_number: zod_1.z.string().max(100).optional(),
11
- notes: zod_1.z.string().max(2000).optional(),
12
- });
13
- const CreatePurchasePaymentScheduleSchema = zod_1.z.object({
14
- scheme_id: zod_1.z.string().max(40).optional(),
15
- amount: zod_1.z.number().int().min(0).optional(),
16
- });
17
- const CreatePurchaseStatementDescriptorSchema = zod_1.z.object({
18
- descriptor: zod_1.z.string().max(65000).optional(),
19
- });
20
- const CreatePurchaseAdditionalInformationSchema = zod_1.z.looseObject({});
21
- const CreatePurchasePaymentIntentSchema = zod_1.z.object({
22
- id: zod_1.z.string().max(150).optional(),
23
- gateway_account_id: zod_1.z.string().max(50).optional(),
24
- gw_token: zod_1.z.string().max(65000).optional(),
25
- payment_method_type: zod_1.z
26
- .enum([
27
- 'card',
28
- 'ideal',
29
- 'sofort',
30
- 'bancontact',
31
- 'google_pay',
32
- 'dotpay',
33
- 'giropay',
34
- 'apple_pay',
35
- 'upi',
36
- 'netbanking_emandates',
37
- 'paypal_express_checkout',
38
- 'direct_debit',
39
- 'boleto',
40
- 'venmo',
41
- 'amazon_payments',
42
- 'pay_to',
43
- 'faster_payments',
44
- 'sepa_instant_transfer',
45
- 'klarna_pay_now',
46
- 'online_banking_poland',
47
- 'payconiq_by_bancontact',
48
- 'electronic_payment_standard',
49
- 'kbc_payment_button',
50
- 'pay_by_bank',
51
- 'trustly',
52
- 'stablecoin',
53
- 'kakao_pay',
54
- 'naver_pay',
55
- 'revolut_pay',
56
- 'cash_app_pay',
57
- 'wechat_pay',
58
- 'alipay',
59
- 'pix',
60
- 'twint',
61
- 'go_pay',
62
- 'grab_pay',
63
- 'pay_co',
64
- 'after_pay',
65
- 'swish',
66
- 'payme',
67
- ])
68
- .optional(),
69
- reference_id: zod_1.z.string().max(65000).optional(),
70
- gw_payment_method_id: zod_1.z.string().max(65000).optional(),
71
- additional_information: CreatePurchaseAdditionalInformationSchema.optional(),
72
- });
73
- const CreatePurchasePurchaseItemsSchema = zod_1.z.object({
74
- index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
75
- item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
76
- quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
77
- unit_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
78
- unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
79
- quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
80
- });
81
- const CreatePurchaseItemTiersSchema = zod_1.z.object({
82
- index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
83
- item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
84
- starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
85
- ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
86
- price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
87
- starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
88
- ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
89
- price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
90
- });
91
- const CreatePurchaseShippingAddressesSchema = zod_1.z.object({
92
- first_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
93
- last_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
94
- email: zod_1.z.array(zod_1.z.string().email().max(70).optional()).optional(),
95
- company: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
96
- phone: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
97
- line1: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
98
- line2: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
99
- line3: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
100
- city: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
101
- state: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
102
- state_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
103
- country: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
104
- zip: zod_1.z.array(zod_1.z.string().max(20).optional()).optional(),
105
- validation_status: zod_1.z
106
- .array(zod_1.z
107
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
108
- .optional())
109
- .optional(),
110
- });
111
- const CreatePurchaseDiscountsSchema = zod_1.z.object({
112
- index: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
113
- coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
114
- percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
115
- quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
116
- amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
117
- included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
118
- });
119
- const CreatePurchaseMetaDataItemSchema = zod_1.z.looseObject({});
120
- const CreatePurchaseSubscriptionInfoSchema = zod_1.z.object({
121
- index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
122
- subscription_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
123
- billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
124
- contract_term_billing_cycle_on_renewal: zod_1.z
125
- .array(zod_1.z.number().int().min(1).max(100).optional())
126
- .optional(),
127
- meta_data: zod_1.z.array(CreatePurchaseMetaDataItemSchema.optional()).optional(),
128
- });
129
- const CreatePurchaseContractTermsSchema = zod_1.z.object({
130
- index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
131
- action_at_term_end: zod_1.z
132
- .array(zod_1.z.enum(['renew', 'evergreen', 'cancel', 'renew_once']).optional())
133
- .optional(),
134
- cancellation_cutoff_period: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
135
- });
136
- const CreatePurchaseBodySchema = zod_1.z.looseObject({
137
- customer_id: zod_1.z.string().max(50),
138
- payment_source_id: zod_1.z.string().max(40).optional(),
139
- replace_primary_payment_source: zod_1.z.boolean().default(true).optional(),
140
- invoice_info: CreatePurchaseInvoiceInfoSchema.optional(),
141
- payment_schedule: CreatePurchasePaymentScheduleSchema.optional(),
142
- statement_descriptor: CreatePurchaseStatementDescriptorSchema.optional(),
143
- payment_intent: CreatePurchasePaymentIntentSchema.optional(),
144
- purchase_items: CreatePurchasePurchaseItemsSchema.optional(),
145
- item_tiers: CreatePurchaseItemTiersSchema.optional(),
146
- shipping_addresses: CreatePurchaseShippingAddressesSchema.optional(),
147
- discounts: CreatePurchaseDiscountsSchema.optional(),
148
- subscription_info: CreatePurchaseSubscriptionInfoSchema.optional(),
149
- contract_terms: CreatePurchaseContractTermsSchema.optional(),
150
- });
151
- exports.CreatePurchaseBodySchema = CreatePurchaseBodySchema;
152
- //Purchase.estimate
153
- const EstimatePurchaseCustomerSchema = zod_1.z.object({
154
- vat_number: zod_1.z.string().max(20).optional(),
155
- vat_number_prefix: zod_1.z.string().max(10).optional(),
156
- registered_for_gst: zod_1.z.boolean().optional(),
157
- taxability: zod_1.z.enum(['taxable', 'exempt']).optional(),
158
- entity_code: zod_1.z
159
- .enum([
160
- 'a',
161
- 'b',
162
- 'c',
163
- 'd',
164
- 'e',
165
- 'f',
166
- 'g',
167
- 'h',
168
- 'i',
169
- 'j',
170
- 'k',
171
- 'l',
172
- 'm',
173
- 'n',
174
- 'p',
175
- 'q',
176
- 'r',
177
- 'med1',
178
- 'med2',
179
- ])
180
- .optional(),
181
- exempt_number: zod_1.z.string().max(100).optional(),
182
- exemption_details: zod_1.z.array(zod_1.z.string().optional()).optional(),
183
- customer_type: zod_1.z
184
- .enum(['residential', 'business', 'senior_citizen', 'industrial'])
185
- .optional(),
186
- });
187
- const EstimatePurchaseBillingAddressSchema = zod_1.z.object({
188
- line1: zod_1.z.string().max(150).optional(),
189
- line2: zod_1.z.string().max(150).optional(),
190
- line3: zod_1.z.string().max(150).optional(),
191
- city: zod_1.z.string().max(50).optional(),
192
- state_code: zod_1.z.string().max(50).optional(),
193
- zip: zod_1.z.string().max(20).optional(),
194
- country: zod_1.z.string().max(50).optional(),
195
- validation_status: zod_1.z
196
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
197
- .optional(),
198
- });
199
- const EstimatePurchasePurchaseItemsSchema = zod_1.z.object({
200
- index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
201
- item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
202
- quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
203
- unit_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
204
- unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
205
- quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
206
- });
207
- const EstimatePurchaseItemTiersSchema = zod_1.z.object({
208
- index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
209
- item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
210
- starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
211
- ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
212
- price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
213
- starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
214
- ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
215
- price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
216
- });
217
- const EstimatePurchaseShippingAddressesSchema = zod_1.z.object({
218
- first_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
219
- last_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
220
- email: zod_1.z.array(zod_1.z.string().email().max(70).optional()).optional(),
221
- company: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
222
- phone: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
223
- line1: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
224
- line2: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
225
- line3: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
226
- city: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
227
- state: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
228
- state_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
229
- country: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
230
- zip: zod_1.z.array(zod_1.z.string().max(20).optional()).optional(),
231
- validation_status: zod_1.z
232
- .array(zod_1.z
233
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
234
- .optional())
235
- .optional(),
236
- });
237
- const EstimatePurchaseDiscountsSchema = zod_1.z.object({
238
- index: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
239
- coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
240
- percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
241
- quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
242
- amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
243
- included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
244
- });
245
- const EstimatePurchaseSubscriptionInfoSchema = zod_1.z.object({
246
- index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
247
- subscription_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
248
- billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
249
- contract_term_billing_cycle_on_renewal: zod_1.z
250
- .array(zod_1.z.number().int().min(1).max(100).optional())
251
- .optional(),
252
- });
253
- const EstimatePurchaseContractTermsSchema = zod_1.z.object({
254
- index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
255
- action_at_term_end: zod_1.z
256
- .array(zod_1.z.enum(['renew', 'evergreen', 'cancel', 'renew_once']).optional())
257
- .optional(),
258
- cancellation_cutoff_period: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
259
- });
260
- const EstimatePurchaseBodySchema = zod_1.z.looseObject({
261
- client_profile_id: zod_1.z.string().max(50).optional(),
262
- customer_id: zod_1.z.string().max(50).optional(),
263
- customer: EstimatePurchaseCustomerSchema.optional(),
264
- billing_address: EstimatePurchaseBillingAddressSchema.optional(),
265
- purchase_items: EstimatePurchasePurchaseItemsSchema.optional(),
266
- item_tiers: EstimatePurchaseItemTiersSchema.optional(),
267
- shipping_addresses: EstimatePurchaseShippingAddressesSchema.optional(),
268
- discounts: EstimatePurchaseDiscountsSchema.optional(),
269
- subscription_info: EstimatePurchaseSubscriptionInfoSchema.optional(),
270
- contract_terms: EstimatePurchaseContractTermsSchema.optional(),
271
- });
272
- exports.EstimatePurchaseBodySchema = EstimatePurchaseBodySchema;