chargebee 3.34.0 → 3.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +237 -0
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +230 -2
- package/cjs/resources/webhook/eventType.js +25 -1
- package/cjs/schema/addon.schema.js +221 -40
- package/cjs/schema/alert.schema.js +17 -2
- package/cjs/schema/alert_status.schema.js +6 -1
- package/cjs/schema/attached_item.schema.js +101 -26
- package/cjs/schema/business_entity.schema.js +43 -6
- package/cjs/schema/business_rule.schema.js +2 -2
- package/cjs/schema/business_ruleset.schema.js +2 -2
- package/cjs/schema/collections_payment_promise.schema.js +43 -0
- package/cjs/schema/comment.schema.js +17 -4
- package/cjs/schema/coupon.schema.js +218 -37
- package/cjs/schema/coupon_code.schema.js +36 -6
- package/cjs/schema/coupon_set.schema.js +108 -27
- package/cjs/schema/credit_note.schema.js +497 -105
- package/cjs/schema/credit_unit.schema.js +12 -2
- package/cjs/schema/customer.schema.js +212 -62
- package/cjs/schema/differential_price.schema.js +100 -12
- package/cjs/schema/dispute.schema.js +125 -33
- package/cjs/schema/einvoice.schema.js +27 -6
- package/cjs/schema/email_log.schema.js +15 -4
- package/cjs/schema/entitlement.schema.js +35 -6
- package/cjs/schema/entitlement_override.schema.js +17 -1
- package/cjs/schema/estimate.schema.js +585 -40
- package/cjs/schema/event.schema.js +1334 -585
- package/cjs/schema/export.schema.js +4459 -1412
- package/cjs/schema/feature.schema.js +73 -11
- package/cjs/schema/gateway_request_log.schema.js +309 -0
- package/cjs/schema/gateway_webhook_log.schema.js +257 -0
- package/cjs/schema/gift.schema.js +51 -5
- package/cjs/schema/grant_block.schema.js +45 -12
- package/cjs/schema/hosted_page.schema.js +564 -68
- package/cjs/schema/index.js +6 -0
- package/cjs/schema/invoice.schema.js +843 -123
- package/cjs/schema/item.schema.js +151 -28
- package/cjs/schema/item_entitlement.schema.js +23 -2
- package/cjs/schema/item_family.schema.js +29 -8
- package/cjs/schema/item_price.schema.js +263 -48
- package/cjs/schema/ledger_account_balance.schema.js +11 -2
- package/cjs/schema/ledger_operation.schema.js +44 -17
- package/cjs/schema/metered_feature.schema.js +10 -1
- package/cjs/schema/omnichannel_one_time_order.schema.js +42 -4
- package/cjs/schema/omnichannel_subscription.schema.js +146 -32
- package/cjs/schema/order.schema.js +233 -61
- package/cjs/schema/organization_detail.schema.js +36 -0
- package/cjs/schema/payment_schedule.schema.js +39 -8
- package/cjs/schema/payment_schedule_scheme.schema.js +37 -7
- package/cjs/schema/payment_source.schema.js +375 -148
- package/cjs/schema/payment_voucher.schema.js +33 -5
- package/cjs/schema/plan.schema.js +345 -57
- package/cjs/schema/price_ramp.schema.js +153 -0
- package/cjs/schema/price_variant.schema.js +88 -18
- package/cjs/schema/pricing_page_session.schema.js +36 -2
- package/cjs/schema/promotional_credit.schema.js +27 -6
- package/cjs/schema/purchase.schema.js +210 -12
- package/cjs/schema/quote.schema.js +907 -87
- package/cjs/schema/quote_entitlement.schema.js +6 -2
- package/cjs/schema/ramp.schema.js +242 -24
- package/cjs/schema/retry_segment.schema.js +12 -0
- package/cjs/schema/site_migration_detail.schema.js +50 -16
- package/cjs/schema/subscription.schema.js +1002 -173
- package/cjs/schema/subscription_entitlement.schema.js +9 -1
- package/cjs/schema/transaction.schema.js +780 -342
- package/cjs/schema/unbilled_charge.schema.js +141 -13
- package/cjs/schema/usage.schema.js +59 -11
- package/cjs/schema/usage_event.schema.js +13 -1
- package/cjs/schema/usage_summary.schema.js +1 -0
- package/cjs/schema/virtual_bank_account.schema.js +42 -10
- package/cjs/schema/webhook_endpoint.schema.js +50 -2
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +230 -2
- package/esm/resources/webhook/eventType.js +25 -1
- package/esm/schema/addon.schema.js +221 -40
- package/esm/schema/alert.schema.js +17 -2
- package/esm/schema/alert_status.schema.js +6 -1
- package/esm/schema/attached_item.schema.js +101 -26
- package/esm/schema/business_entity.schema.js +42 -5
- package/esm/schema/business_rule.schema.js +2 -2
- package/esm/schema/business_ruleset.schema.js +2 -2
- package/esm/schema/collections_payment_promise.schema.js +40 -0
- package/esm/schema/comment.schema.js +17 -4
- package/esm/schema/coupon.schema.js +218 -37
- package/esm/schema/coupon_code.schema.js +36 -6
- package/esm/schema/coupon_set.schema.js +108 -27
- package/esm/schema/credit_note.schema.js +497 -105
- package/esm/schema/credit_unit.schema.js +12 -2
- package/esm/schema/customer.schema.js +212 -62
- package/esm/schema/differential_price.schema.js +100 -12
- package/esm/schema/dispute.schema.js +125 -33
- package/esm/schema/einvoice.schema.js +27 -6
- package/esm/schema/email_log.schema.js +15 -4
- package/esm/schema/entitlement.schema.js +35 -6
- package/esm/schema/entitlement_override.schema.js +17 -1
- package/esm/schema/estimate.schema.js +585 -40
- package/esm/schema/event.schema.js +1334 -585
- package/esm/schema/export.schema.js +4459 -1412
- package/esm/schema/feature.schema.js +73 -11
- package/esm/schema/gateway_request_log.schema.js +306 -0
- package/esm/schema/gateway_webhook_log.schema.js +254 -0
- package/esm/schema/gift.schema.js +51 -5
- package/esm/schema/grant_block.schema.js +45 -12
- package/esm/schema/hosted_page.schema.js +564 -68
- package/esm/schema/index.js +6 -0
- package/esm/schema/invoice.schema.js +842 -122
- package/esm/schema/item.schema.js +151 -28
- package/esm/schema/item_entitlement.schema.js +23 -2
- package/esm/schema/item_family.schema.js +29 -8
- package/esm/schema/item_price.schema.js +263 -48
- package/esm/schema/ledger_account_balance.schema.js +10 -1
- package/esm/schema/ledger_operation.schema.js +44 -17
- package/esm/schema/metered_feature.schema.js +10 -1
- package/esm/schema/omnichannel_one_time_order.schema.js +42 -4
- package/esm/schema/omnichannel_subscription.schema.js +146 -32
- package/esm/schema/order.schema.js +233 -61
- package/esm/schema/organization_detail.schema.js +33 -0
- package/esm/schema/payment_schedule.schema.js +39 -8
- package/esm/schema/payment_schedule_scheme.schema.js +37 -7
- package/esm/schema/payment_source.schema.js +375 -148
- package/esm/schema/payment_voucher.schema.js +33 -5
- package/esm/schema/plan.schema.js +345 -57
- package/esm/schema/price_ramp.schema.js +150 -0
- package/esm/schema/price_variant.schema.js +88 -18
- package/esm/schema/pricing_page_session.schema.js +36 -2
- package/esm/schema/promotional_credit.schema.js +27 -6
- package/esm/schema/purchase.schema.js +210 -12
- package/esm/schema/quote.schema.js +907 -87
- package/esm/schema/quote_entitlement.schema.js +6 -2
- package/esm/schema/ramp.schema.js +242 -24
- package/esm/schema/retry_segment.schema.js +9 -0
- package/esm/schema/site_migration_detail.schema.js +50 -16
- package/esm/schema/subscription.schema.js +1002 -173
- package/esm/schema/subscription_entitlement.schema.js +9 -1
- package/esm/schema/transaction.schema.js +780 -342
- package/esm/schema/unbilled_charge.schema.js +141 -13
- package/esm/schema/usage.schema.js +59 -11
- package/esm/schema/usage_event.schema.js +13 -1
- package/esm/schema/usage_summary.schema.js +1 -0
- package/esm/schema/virtual_bank_account.schema.js +42 -10
- package/esm/schema/webhook_endpoint.schema.js +50 -2
- package/package.json +1 -1
- package/types/core.d.ts +63 -74
- package/types/index.d.ts +29 -1
- package/types/resources/BillingLineItem.d.ts +10 -0
- package/types/resources/BillingMetadata.d.ts +9 -0
- package/types/resources/BusinessEntity.d.ts +52 -0
- package/types/resources/Citation.d.ts +13 -0
- package/types/resources/CollectionsDispute.d.ts +24 -0
- package/types/resources/CollectionsPaymentPromise.d.ts +93 -0
- package/types/resources/CollectionsReminderSequence.d.ts +35 -0
- package/types/resources/Comment.d.ts +2 -1
- package/types/resources/Content.d.ts +23 -1
- package/types/resources/CreditNote.d.ts +1 -0
- package/types/resources/CustomData.d.ts +14 -0
- package/types/resources/Discount.d.ts +1 -0
- package/types/resources/DraftEstimate.d.ts +13 -0
- package/types/resources/DraftRequest.d.ts +45 -0
- package/types/resources/EmailAttachment.d.ts +16 -0
- package/types/resources/EmailConversation.d.ts +18 -0
- package/types/resources/EmailLog.d.ts +1 -0
- package/types/resources/EmailMessage.d.ts +40 -0
- package/types/resources/Estimate.d.ts +3 -0
- package/types/resources/Event.d.ts +25 -1
- package/types/resources/Execution.d.ts +12 -0
- package/types/resources/GatewayPaymentMethodToken.d.ts +2 -2
- package/types/resources/GatewayRequestLog.d.ts +82 -0
- package/types/resources/GatewayWebhookLog.d.ts +74 -0
- package/types/resources/GrantBlock.d.ts +5 -0
- package/types/resources/GroupByAttribute.d.ts +15 -0
- package/types/resources/GroupByRecommendation.d.ts +10 -0
- package/types/resources/HostedPage.d.ts +18 -0
- package/types/resources/Invoice.d.ts +19 -0
- package/types/resources/ItemPrice.d.ts +1 -0
- package/types/resources/LedgerAccountBalance.d.ts +19 -0
- package/types/resources/Meter.d.ts +1 -0
- package/types/resources/MeteredFeature.d.ts +1 -0
- package/types/resources/OmnichannelOneTimeOrder.d.ts +5 -1
- package/types/resources/OmnichannelSubscription.d.ts +6 -1
- package/types/resources/OmnichannelSubscriptionItem.d.ts +4 -1
- package/types/resources/OrganizationDetail.d.ts +84 -0
- package/types/resources/PaymentSchedule.d.ts +1 -1
- package/types/resources/PaymentScheduleEstimate.d.ts +1 -1
- package/types/resources/PaymentSource.d.ts +19 -0
- package/types/resources/PreferenceVariant.d.ts +10 -0
- package/types/resources/PriceRamp.d.ts +113 -0
- package/types/resources/PrivateNote.d.ts +18 -0
- package/types/resources/Purchase.d.ts +6 -0
- package/types/resources/Ramp.d.ts +6 -0
- package/types/resources/RampInterval.d.ts +12 -0
- package/types/resources/RecordedPurchase.d.ts +5 -1
- package/types/resources/RetrySegment.d.ts +36 -0
- package/types/resources/Subscription.d.ts +3 -0
- package/types/resources/Transaction.d.ts +4 -0
- package/types/resources/Usage.d.ts +7 -0
- package/types/resources/UsageSummary.d.ts +2 -0
- package/types/resources/WebhookEvent.d.ts +159 -5
- package/types/resources/AppliedBusinessRule.d.ts +0 -15
|
@@ -7,10 +7,14 @@ const ListQuoteEntitlementsQuoteEntitlementEntityIdSchema = z.object({
|
|
|
7
7
|
is: z.string().min(1).optional(),
|
|
8
8
|
});
|
|
9
9
|
const ListQuoteEntitlementsQuoteEntitlementStartDateSchema = z.object({
|
|
10
|
-
on: z
|
|
10
|
+
on: z
|
|
11
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
12
|
+
.optional(),
|
|
11
13
|
});
|
|
12
14
|
const ListQuoteEntitlementsQuoteEntitlementEndDateSchema = z.object({
|
|
13
|
-
on: z
|
|
15
|
+
on: z
|
|
16
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
17
|
+
.optional(),
|
|
14
18
|
});
|
|
15
19
|
const ListQuoteEntitlementsQuoteEntitlementBodySchema = z.looseObject({
|
|
16
20
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -13,6 +13,26 @@ const CreateForSubscriptionRampContractTermSchema = z.object({
|
|
|
13
13
|
cancellation_cutoff_period: z.number().int().optional(),
|
|
14
14
|
renewal_billing_cycles: z.number().int().optional(),
|
|
15
15
|
});
|
|
16
|
+
const CreateForSubscriptionRampItemsToAddItemSchema = z.object({
|
|
17
|
+
item_price_id: z.string().max(100),
|
|
18
|
+
quantity: z.number().int().min(1).optional(),
|
|
19
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
20
|
+
unit_price: z.number().int().min(0).optional(),
|
|
21
|
+
unit_price_in_decimal: z.string().max(39).optional(),
|
|
22
|
+
billing_cycles: z.number().int().min(0).optional(),
|
|
23
|
+
service_period_days: z.number().int().min(1).max(4000).optional(),
|
|
24
|
+
charge_on_event: z
|
|
25
|
+
.enum([
|
|
26
|
+
'subscription_trial_start',
|
|
27
|
+
'plan_activation',
|
|
28
|
+
'subscription_activation',
|
|
29
|
+
'contract_termination',
|
|
30
|
+
])
|
|
31
|
+
.optional(),
|
|
32
|
+
charge_once: z.boolean().optional(),
|
|
33
|
+
charge_on_option: z.enum(['immediately', 'on_event']).optional(),
|
|
34
|
+
description: z.string().max(2000).optional(),
|
|
35
|
+
});
|
|
16
36
|
const CreateForSubscriptionRampItemsToAddSchema = z.object({
|
|
17
37
|
item_price_id: z.array(z.string().max(100).optional()),
|
|
18
38
|
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -21,7 +41,7 @@ const CreateForSubscriptionRampItemsToAddSchema = z.object({
|
|
|
21
41
|
unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
22
42
|
billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
|
|
23
43
|
service_period_days: z
|
|
24
|
-
.array(z.number().int().min(1).max(
|
|
44
|
+
.array(z.number().int().min(1).max(4000).optional())
|
|
25
45
|
.optional(),
|
|
26
46
|
charge_on_event: z
|
|
27
47
|
.array(z
|
|
@@ -37,6 +57,27 @@ const CreateForSubscriptionRampItemsToAddSchema = z.object({
|
|
|
37
57
|
charge_on_option: z
|
|
38
58
|
.array(z.enum(['immediately', 'on_event']).optional())
|
|
39
59
|
.optional(),
|
|
60
|
+
description: z.array(z.string().max(2000).optional()).optional(),
|
|
61
|
+
});
|
|
62
|
+
const CreateForSubscriptionRampItemsToUpdateItemSchema = z.object({
|
|
63
|
+
item_price_id: z.string().max(100),
|
|
64
|
+
quantity: z.number().int().min(1).optional(),
|
|
65
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
66
|
+
unit_price: z.number().int().min(0).optional(),
|
|
67
|
+
unit_price_in_decimal: z.string().max(39).optional(),
|
|
68
|
+
billing_cycles: z.number().int().min(0).optional(),
|
|
69
|
+
service_period_days: z.number().int().min(1).max(4000).optional(),
|
|
70
|
+
charge_on_event: z
|
|
71
|
+
.enum([
|
|
72
|
+
'subscription_trial_start',
|
|
73
|
+
'plan_activation',
|
|
74
|
+
'subscription_activation',
|
|
75
|
+
'contract_termination',
|
|
76
|
+
])
|
|
77
|
+
.optional(),
|
|
78
|
+
charge_once: z.boolean().optional(),
|
|
79
|
+
charge_on_option: z.enum(['immediately', 'on_event']).optional(),
|
|
80
|
+
description: z.string().max(2000).optional(),
|
|
40
81
|
});
|
|
41
82
|
const CreateForSubscriptionRampItemsToUpdateSchema = z.object({
|
|
42
83
|
item_price_id: z.array(z.string().max(100).optional()),
|
|
@@ -46,7 +87,7 @@ const CreateForSubscriptionRampItemsToUpdateSchema = z.object({
|
|
|
46
87
|
unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
47
88
|
billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
|
|
48
89
|
service_period_days: z
|
|
49
|
-
.array(z.number().int().min(1).max(
|
|
90
|
+
.array(z.number().int().min(1).max(4000).optional())
|
|
50
91
|
.optional(),
|
|
51
92
|
charge_on_event: z
|
|
52
93
|
.array(z
|
|
@@ -62,6 +103,18 @@ const CreateForSubscriptionRampItemsToUpdateSchema = z.object({
|
|
|
62
103
|
charge_on_option: z
|
|
63
104
|
.array(z.enum(['immediately', 'on_event']).optional())
|
|
64
105
|
.optional(),
|
|
106
|
+
description: z.array(z.string().max(2000).optional()).optional(),
|
|
107
|
+
});
|
|
108
|
+
const CreateForSubscriptionRampItemTiersItemSchema = z.object({
|
|
109
|
+
item_price_id: z.string().max(100).optional(),
|
|
110
|
+
starting_unit: z.number().int().min(1).optional(),
|
|
111
|
+
ending_unit: z.number().int().optional(),
|
|
112
|
+
price: z.number().int().min(0).optional(),
|
|
113
|
+
starting_unit_in_decimal: z.string().max(33).optional(),
|
|
114
|
+
ending_unit_in_decimal: z.string().max(33).optional(),
|
|
115
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
116
|
+
pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
|
|
117
|
+
package_size: z.number().int().min(1).optional(),
|
|
65
118
|
});
|
|
66
119
|
const CreateForSubscriptionRampItemTiersSchema = z.object({
|
|
67
120
|
item_price_id: z.array(z.string().max(100).optional()).optional(),
|
|
@@ -76,10 +129,25 @@ const CreateForSubscriptionRampItemTiersSchema = z.object({
|
|
|
76
129
|
.optional(),
|
|
77
130
|
package_size: z.array(z.number().int().min(1).optional()).optional(),
|
|
78
131
|
});
|
|
132
|
+
const CreateForSubscriptionRampCouponsToAddItemSchema = z.object({
|
|
133
|
+
coupon_id: z.string().max(100).optional(),
|
|
134
|
+
apply_till: z.number().int().optional(),
|
|
135
|
+
});
|
|
79
136
|
const CreateForSubscriptionRampCouponsToAddSchema = z.object({
|
|
80
137
|
coupon_id: z.array(z.string().max(100).optional()).optional(),
|
|
81
138
|
apply_till: z.array(z.number().int().optional()).optional(),
|
|
82
139
|
});
|
|
140
|
+
const CreateForSubscriptionRampDiscountsToAddItemSchema = z.object({
|
|
141
|
+
apply_on: z.enum(['invoice_amount', 'specific_item_price']),
|
|
142
|
+
duration_type: z.enum(['one_time', 'forever', 'limited_period']),
|
|
143
|
+
percentage: z.number().min(0.01).max(100).optional(),
|
|
144
|
+
amount: z.number().int().min(0).optional(),
|
|
145
|
+
quantity: z.number().int().min(1).optional(),
|
|
146
|
+
period: z.number().int().min(1).optional(),
|
|
147
|
+
period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
148
|
+
included_in_mrr: z.boolean().optional(),
|
|
149
|
+
item_price_id: z.string().max(100).optional(),
|
|
150
|
+
});
|
|
83
151
|
const CreateForSubscriptionRampDiscountsToAddSchema = z.object({
|
|
84
152
|
apply_on: z.array(z.enum(['invoice_amount', 'specific_item_price']).optional()),
|
|
85
153
|
duration_type: z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
|
|
@@ -101,11 +169,36 @@ const CreateForSubscriptionRampBodySchema = z.looseObject({
|
|
|
101
169
|
items_to_remove: z.array(z.string().max(100).optional()).optional(),
|
|
102
170
|
billing_configuration: CreateForSubscriptionRampBillingConfigurationSchema.optional(),
|
|
103
171
|
contract_term: CreateForSubscriptionRampContractTermSchema.optional(),
|
|
104
|
-
items_to_add:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
172
|
+
items_to_add: z
|
|
173
|
+
.union([
|
|
174
|
+
z.array(CreateForSubscriptionRampItemsToAddItemSchema.optional()),
|
|
175
|
+
CreateForSubscriptionRampItemsToAddSchema,
|
|
176
|
+
])
|
|
177
|
+
.optional(),
|
|
178
|
+
items_to_update: z
|
|
179
|
+
.union([
|
|
180
|
+
z.array(CreateForSubscriptionRampItemsToUpdateItemSchema.optional()),
|
|
181
|
+
CreateForSubscriptionRampItemsToUpdateSchema,
|
|
182
|
+
])
|
|
183
|
+
.optional(),
|
|
184
|
+
item_tiers: z
|
|
185
|
+
.union([
|
|
186
|
+
z.array(CreateForSubscriptionRampItemTiersItemSchema.optional()),
|
|
187
|
+
CreateForSubscriptionRampItemTiersSchema,
|
|
188
|
+
])
|
|
189
|
+
.optional(),
|
|
190
|
+
coupons_to_add: z
|
|
191
|
+
.union([
|
|
192
|
+
z.array(CreateForSubscriptionRampCouponsToAddItemSchema.optional()),
|
|
193
|
+
CreateForSubscriptionRampCouponsToAddSchema,
|
|
194
|
+
])
|
|
195
|
+
.optional(),
|
|
196
|
+
discounts_to_add: z
|
|
197
|
+
.union([
|
|
198
|
+
z.array(CreateForSubscriptionRampDiscountsToAddItemSchema.optional()),
|
|
199
|
+
CreateForSubscriptionRampDiscountsToAddSchema,
|
|
200
|
+
])
|
|
201
|
+
.optional(),
|
|
109
202
|
});
|
|
110
203
|
export { CreateForSubscriptionRampBodySchema };
|
|
111
204
|
//Ramp.update
|
|
@@ -119,6 +212,26 @@ const UpdateRampContractTermSchema = z.object({
|
|
|
119
212
|
cancellation_cutoff_period: z.number().int().optional(),
|
|
120
213
|
renewal_billing_cycles: z.number().int().optional(),
|
|
121
214
|
});
|
|
215
|
+
const UpdateRampItemsToAddItemSchema = z.object({
|
|
216
|
+
item_price_id: z.string().max(100),
|
|
217
|
+
quantity: z.number().int().min(1).optional(),
|
|
218
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
219
|
+
unit_price: z.number().int().min(0).optional(),
|
|
220
|
+
unit_price_in_decimal: z.string().max(39).optional(),
|
|
221
|
+
billing_cycles: z.number().int().min(0).optional(),
|
|
222
|
+
service_period_days: z.number().int().min(1).max(4000).optional(),
|
|
223
|
+
charge_on_event: z
|
|
224
|
+
.enum([
|
|
225
|
+
'subscription_trial_start',
|
|
226
|
+
'plan_activation',
|
|
227
|
+
'subscription_activation',
|
|
228
|
+
'contract_termination',
|
|
229
|
+
])
|
|
230
|
+
.optional(),
|
|
231
|
+
charge_once: z.boolean().optional(),
|
|
232
|
+
charge_on_option: z.enum(['immediately', 'on_event']).optional(),
|
|
233
|
+
description: z.string().max(2000).optional(),
|
|
234
|
+
});
|
|
122
235
|
const UpdateRampItemsToAddSchema = z.object({
|
|
123
236
|
item_price_id: z.array(z.string().max(100).optional()),
|
|
124
237
|
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -127,7 +240,7 @@ const UpdateRampItemsToAddSchema = z.object({
|
|
|
127
240
|
unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
128
241
|
billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
|
|
129
242
|
service_period_days: z
|
|
130
|
-
.array(z.number().int().min(1).max(
|
|
243
|
+
.array(z.number().int().min(1).max(4000).optional())
|
|
131
244
|
.optional(),
|
|
132
245
|
charge_on_event: z
|
|
133
246
|
.array(z
|
|
@@ -143,6 +256,27 @@ const UpdateRampItemsToAddSchema = z.object({
|
|
|
143
256
|
charge_on_option: z
|
|
144
257
|
.array(z.enum(['immediately', 'on_event']).optional())
|
|
145
258
|
.optional(),
|
|
259
|
+
description: z.array(z.string().max(2000).optional()).optional(),
|
|
260
|
+
});
|
|
261
|
+
const UpdateRampItemsToUpdateItemSchema = z.object({
|
|
262
|
+
item_price_id: z.string().max(100),
|
|
263
|
+
quantity: z.number().int().min(1).optional(),
|
|
264
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
265
|
+
unit_price: z.number().int().min(0).optional(),
|
|
266
|
+
unit_price_in_decimal: z.string().max(39).optional(),
|
|
267
|
+
billing_cycles: z.number().int().min(0).optional(),
|
|
268
|
+
service_period_days: z.number().int().min(1).max(4000).optional(),
|
|
269
|
+
charge_on_event: z
|
|
270
|
+
.enum([
|
|
271
|
+
'subscription_trial_start',
|
|
272
|
+
'plan_activation',
|
|
273
|
+
'subscription_activation',
|
|
274
|
+
'contract_termination',
|
|
275
|
+
])
|
|
276
|
+
.optional(),
|
|
277
|
+
charge_once: z.boolean().optional(),
|
|
278
|
+
charge_on_option: z.enum(['immediately', 'on_event']).optional(),
|
|
279
|
+
description: z.string().max(2000).optional(),
|
|
146
280
|
});
|
|
147
281
|
const UpdateRampItemsToUpdateSchema = z.object({
|
|
148
282
|
item_price_id: z.array(z.string().max(100).optional()),
|
|
@@ -152,7 +286,7 @@ const UpdateRampItemsToUpdateSchema = z.object({
|
|
|
152
286
|
unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
153
287
|
billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
|
|
154
288
|
service_period_days: z
|
|
155
|
-
.array(z.number().int().min(1).max(
|
|
289
|
+
.array(z.number().int().min(1).max(4000).optional())
|
|
156
290
|
.optional(),
|
|
157
291
|
charge_on_event: z
|
|
158
292
|
.array(z
|
|
@@ -168,6 +302,18 @@ const UpdateRampItemsToUpdateSchema = z.object({
|
|
|
168
302
|
charge_on_option: z
|
|
169
303
|
.array(z.enum(['immediately', 'on_event']).optional())
|
|
170
304
|
.optional(),
|
|
305
|
+
description: z.array(z.string().max(2000).optional()).optional(),
|
|
306
|
+
});
|
|
307
|
+
const UpdateRampItemTiersItemSchema = z.object({
|
|
308
|
+
item_price_id: z.string().max(100).optional(),
|
|
309
|
+
starting_unit: z.number().int().min(1).optional(),
|
|
310
|
+
ending_unit: z.number().int().optional(),
|
|
311
|
+
price: z.number().int().min(0).optional(),
|
|
312
|
+
starting_unit_in_decimal: z.string().max(33).optional(),
|
|
313
|
+
ending_unit_in_decimal: z.string().max(33).optional(),
|
|
314
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
315
|
+
pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
|
|
316
|
+
package_size: z.number().int().min(1).optional(),
|
|
171
317
|
});
|
|
172
318
|
const UpdateRampItemTiersSchema = z.object({
|
|
173
319
|
item_price_id: z.array(z.string().max(100).optional()).optional(),
|
|
@@ -182,10 +328,25 @@ const UpdateRampItemTiersSchema = z.object({
|
|
|
182
328
|
.optional(),
|
|
183
329
|
package_size: z.array(z.number().int().min(1).optional()).optional(),
|
|
184
330
|
});
|
|
331
|
+
const UpdateRampCouponsToAddItemSchema = z.object({
|
|
332
|
+
coupon_id: z.string().max(100).optional(),
|
|
333
|
+
apply_till: z.number().int().optional(),
|
|
334
|
+
});
|
|
185
335
|
const UpdateRampCouponsToAddSchema = z.object({
|
|
186
336
|
coupon_id: z.array(z.string().max(100).optional()).optional(),
|
|
187
337
|
apply_till: z.array(z.number().int().optional()).optional(),
|
|
188
338
|
});
|
|
339
|
+
const UpdateRampDiscountsToAddItemSchema = z.object({
|
|
340
|
+
apply_on: z.enum(['invoice_amount', 'specific_item_price']),
|
|
341
|
+
duration_type: z.enum(['one_time', 'forever', 'limited_period']),
|
|
342
|
+
percentage: z.number().min(0.01).max(100).optional(),
|
|
343
|
+
amount: z.number().int().min(0).optional(),
|
|
344
|
+
quantity: z.number().int().min(1).optional(),
|
|
345
|
+
period: z.number().int().min(1).optional(),
|
|
346
|
+
period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
347
|
+
included_in_mrr: z.boolean().optional(),
|
|
348
|
+
item_price_id: z.string().max(100).optional(),
|
|
349
|
+
});
|
|
189
350
|
const UpdateRampDiscountsToAddSchema = z.object({
|
|
190
351
|
apply_on: z.array(z.enum(['invoice_amount', 'specific_item_price']).optional()),
|
|
191
352
|
duration_type: z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
|
|
@@ -207,33 +368,90 @@ const UpdateRampBodySchema = z.looseObject({
|
|
|
207
368
|
items_to_remove: z.array(z.string().max(100).optional()).optional(),
|
|
208
369
|
billing_configuration: UpdateRampBillingConfigurationSchema.optional(),
|
|
209
370
|
contract_term: UpdateRampContractTermSchema.optional(),
|
|
210
|
-
items_to_add:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
371
|
+
items_to_add: z
|
|
372
|
+
.union([
|
|
373
|
+
z.array(UpdateRampItemsToAddItemSchema.optional()),
|
|
374
|
+
UpdateRampItemsToAddSchema,
|
|
375
|
+
])
|
|
376
|
+
.optional(),
|
|
377
|
+
items_to_update: z
|
|
378
|
+
.union([
|
|
379
|
+
z.array(UpdateRampItemsToUpdateItemSchema.optional()),
|
|
380
|
+
UpdateRampItemsToUpdateSchema,
|
|
381
|
+
])
|
|
382
|
+
.optional(),
|
|
383
|
+
item_tiers: z
|
|
384
|
+
.union([
|
|
385
|
+
z.array(UpdateRampItemTiersItemSchema.optional()),
|
|
386
|
+
UpdateRampItemTiersSchema,
|
|
387
|
+
])
|
|
388
|
+
.optional(),
|
|
389
|
+
coupons_to_add: z
|
|
390
|
+
.union([
|
|
391
|
+
z.array(UpdateRampCouponsToAddItemSchema.optional()),
|
|
392
|
+
UpdateRampCouponsToAddSchema,
|
|
393
|
+
])
|
|
394
|
+
.optional(),
|
|
395
|
+
discounts_to_add: z
|
|
396
|
+
.union([
|
|
397
|
+
z.array(UpdateRampDiscountsToAddItemSchema.optional()),
|
|
398
|
+
UpdateRampDiscountsToAddSchema,
|
|
399
|
+
])
|
|
400
|
+
.optional(),
|
|
215
401
|
});
|
|
216
402
|
export { UpdateRampBodySchema };
|
|
217
403
|
//Ramp.list
|
|
218
404
|
const ListRampStatusSchema = z.object({
|
|
405
|
+
in: z
|
|
406
|
+
.union([
|
|
407
|
+
z.array(z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional()),
|
|
408
|
+
z.enum(['scheduled', 'succeeded', 'failed', 'draft']),
|
|
409
|
+
])
|
|
410
|
+
.optional(),
|
|
219
411
|
is: z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(),
|
|
220
|
-
in: z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(),
|
|
221
412
|
});
|
|
222
413
|
const ListRampSubscriptionIdSchema = z.object({
|
|
414
|
+
in: z
|
|
415
|
+
.union([
|
|
416
|
+
z.array(z.string().optional()),
|
|
417
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
418
|
+
])
|
|
419
|
+
.optional(),
|
|
223
420
|
is: z.string().min(1).optional(),
|
|
224
|
-
in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
225
421
|
});
|
|
226
422
|
const ListRampEffectiveFromSchema = z.object({
|
|
227
|
-
after: z
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
423
|
+
after: z
|
|
424
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
425
|
+
.optional(),
|
|
426
|
+
before: z
|
|
427
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
428
|
+
.optional(),
|
|
429
|
+
on: z
|
|
430
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
431
|
+
.optional(),
|
|
432
|
+
between: z
|
|
433
|
+
.union([
|
|
434
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
435
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
436
|
+
])
|
|
437
|
+
.optional(),
|
|
231
438
|
});
|
|
232
439
|
const ListRampUpdatedAtSchema = z.object({
|
|
233
|
-
after: z
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
440
|
+
after: z
|
|
441
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
442
|
+
.optional(),
|
|
443
|
+
before: z
|
|
444
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
445
|
+
.optional(),
|
|
446
|
+
on: z
|
|
447
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
448
|
+
.optional(),
|
|
449
|
+
between: z
|
|
450
|
+
.union([
|
|
451
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
452
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
453
|
+
])
|
|
454
|
+
.optional(),
|
|
237
455
|
});
|
|
238
456
|
const ListRampSortBySchema = z.looseObject({
|
|
239
457
|
asc: z.enum(['effective_from', 'updated_at']).optional(),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Generated Zod schemas: RetrySegment
|
|
2
|
+
// Actions: retrieve
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//RetrySegment.retrieve
|
|
6
|
+
const RetrieveRetrySegmentBodySchema = z.looseObject({
|
|
7
|
+
invoice_id: z.string().max(50).optional(),
|
|
8
|
+
});
|
|
9
|
+
export { RetrieveRetrySegmentBodySchema };
|
|
@@ -40,31 +40,65 @@ const ListSiteMigrationDetailEntityTypeSchema = z.object({
|
|
|
40
40
|
])
|
|
41
41
|
.optional(),
|
|
42
42
|
in: z
|
|
43
|
-
.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
.union([
|
|
44
|
+
z.array(z
|
|
45
|
+
.enum([
|
|
46
|
+
'customer',
|
|
47
|
+
'subscription',
|
|
48
|
+
'invoice',
|
|
49
|
+
'credit_note',
|
|
50
|
+
'transaction',
|
|
51
|
+
'order',
|
|
52
|
+
])
|
|
53
|
+
.optional()),
|
|
54
|
+
z.enum([
|
|
55
|
+
'customer',
|
|
56
|
+
'subscription',
|
|
57
|
+
'invoice',
|
|
58
|
+
'credit_note',
|
|
59
|
+
'transaction',
|
|
60
|
+
'order',
|
|
61
|
+
]),
|
|
50
62
|
])
|
|
51
63
|
.optional(),
|
|
52
64
|
not_in: z
|
|
53
|
-
.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
65
|
+
.union([
|
|
66
|
+
z.array(z
|
|
67
|
+
.enum([
|
|
68
|
+
'customer',
|
|
69
|
+
'subscription',
|
|
70
|
+
'invoice',
|
|
71
|
+
'credit_note',
|
|
72
|
+
'transaction',
|
|
73
|
+
'order',
|
|
74
|
+
])
|
|
75
|
+
.optional()),
|
|
76
|
+
z.enum([
|
|
77
|
+
'customer',
|
|
78
|
+
'subscription',
|
|
79
|
+
'invoice',
|
|
80
|
+
'credit_note',
|
|
81
|
+
'transaction',
|
|
82
|
+
'order',
|
|
83
|
+
]),
|
|
60
84
|
])
|
|
61
85
|
.optional(),
|
|
62
86
|
});
|
|
63
87
|
const ListSiteMigrationDetailStatusSchema = z.object({
|
|
64
88
|
is: z.enum(['moved_in', 'moved_out', 'moving_out']).optional(),
|
|
65
89
|
is_not: z.enum(['moved_in', 'moved_out', 'moving_out']).optional(),
|
|
66
|
-
in: z
|
|
67
|
-
|
|
90
|
+
in: z
|
|
91
|
+
.union([
|
|
92
|
+
z.array(z.enum(['moved_in', 'moved_out', 'moving_out']).optional()),
|
|
93
|
+
z.enum(['moved_in', 'moved_out', 'moving_out']),
|
|
94
|
+
])
|
|
95
|
+
.optional(),
|
|
96
|
+
not_in: z
|
|
97
|
+
.union([
|
|
98
|
+
z.array(z.enum(['moved_in', 'moved_out', 'moving_out']).optional()),
|
|
99
|
+
z.enum(['moved_in', 'moved_out', 'moving_out']),
|
|
100
|
+
])
|
|
101
|
+
.optional(),
|
|
68
102
|
});
|
|
69
103
|
const ListSiteMigrationDetailBodySchema = z.looseObject({
|
|
70
104
|
limit: z.number().int().min(1).max(100).optional(),
|