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
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
//Addon.create
|
|
6
6
|
const CreateAddonMetaDataSchema = z.looseObject({});
|
|
7
|
+
const CreateAddonTiersItemSchema = z.object({
|
|
8
|
+
starting_unit: z.number().int().min(1).optional(),
|
|
9
|
+
ending_unit: z.number().int().optional(),
|
|
10
|
+
price: z.number().int().min(0).optional(),
|
|
11
|
+
starting_unit_in_decimal: z.string().max(33).optional(),
|
|
12
|
+
ending_unit_in_decimal: z.string().max(33).optional(),
|
|
13
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
14
|
+
});
|
|
7
15
|
const CreateAddonTiersSchema = z.object({
|
|
8
16
|
starting_unit: z.array(z.number().int().min(1).optional()).optional(),
|
|
9
17
|
ending_unit: z.array(z.number().int().optional()).optional(),
|
|
@@ -12,6 +20,11 @@ const CreateAddonTiersSchema = z.object({
|
|
|
12
20
|
ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
13
21
|
price_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
14
22
|
});
|
|
23
|
+
const CreateAddonTaxProvidersFieldsItemSchema = z.object({
|
|
24
|
+
provider_name: z.string().max(50),
|
|
25
|
+
field_id: z.string().max(50),
|
|
26
|
+
field_value: z.string().max(50),
|
|
27
|
+
});
|
|
15
28
|
const CreateAddonTaxProvidersFieldsSchema = z.object({
|
|
16
29
|
provider_name: z.array(z.string().max(50).optional()),
|
|
17
30
|
field_id: z.array(z.string().max(50).optional()),
|
|
@@ -68,12 +81,30 @@ const CreateAddonBodySchema = z.looseObject({
|
|
|
68
81
|
.enum(['site_default', 'partial_term', 'full_term'])
|
|
69
82
|
.optional(),
|
|
70
83
|
status: z.enum(['active', 'archived']).optional(),
|
|
71
|
-
tiers:
|
|
72
|
-
|
|
84
|
+
tiers: z
|
|
85
|
+
.union([
|
|
86
|
+
z.array(CreateAddonTiersItemSchema.optional()),
|
|
87
|
+
CreateAddonTiersSchema,
|
|
88
|
+
])
|
|
89
|
+
.optional(),
|
|
90
|
+
tax_providers_fields: z
|
|
91
|
+
.union([
|
|
92
|
+
z.array(CreateAddonTaxProvidersFieldsItemSchema.optional()),
|
|
93
|
+
CreateAddonTaxProvidersFieldsSchema,
|
|
94
|
+
])
|
|
95
|
+
.optional(),
|
|
73
96
|
});
|
|
74
97
|
export { CreateAddonBodySchema };
|
|
75
98
|
//Addon.update
|
|
76
99
|
const UpdateAddonMetaDataSchema = z.looseObject({});
|
|
100
|
+
const UpdateAddonTiersItemSchema = z.object({
|
|
101
|
+
starting_unit: z.number().int().min(1).optional(),
|
|
102
|
+
ending_unit: z.number().int().optional(),
|
|
103
|
+
price: z.number().int().min(0).optional(),
|
|
104
|
+
starting_unit_in_decimal: z.string().max(33).optional(),
|
|
105
|
+
ending_unit_in_decimal: z.string().max(33).optional(),
|
|
106
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
107
|
+
});
|
|
77
108
|
const UpdateAddonTiersSchema = z.object({
|
|
78
109
|
starting_unit: z.array(z.number().int().min(1).optional()).optional(),
|
|
79
110
|
ending_unit: z.array(z.number().int().optional()).optional(),
|
|
@@ -82,6 +113,11 @@ const UpdateAddonTiersSchema = z.object({
|
|
|
82
113
|
ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
83
114
|
price_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
84
115
|
});
|
|
116
|
+
const UpdateAddonTaxProvidersFieldsItemSchema = z.object({
|
|
117
|
+
provider_name: z.string().max(50),
|
|
118
|
+
field_id: z.string().max(50),
|
|
119
|
+
field_value: z.string().max(50),
|
|
120
|
+
});
|
|
85
121
|
const UpdateAddonTaxProvidersFieldsSchema = z.object({
|
|
86
122
|
provider_name: z.array(z.string().max(50).optional()),
|
|
87
123
|
field_id: z.array(z.string().max(50).optional()),
|
|
@@ -136,8 +172,18 @@ const UpdateAddonBodySchema = z.looseObject({
|
|
|
136
172
|
proration_type: z
|
|
137
173
|
.enum(['site_default', 'partial_term', 'full_term'])
|
|
138
174
|
.optional(),
|
|
139
|
-
tiers:
|
|
140
|
-
|
|
175
|
+
tiers: z
|
|
176
|
+
.union([
|
|
177
|
+
z.array(UpdateAddonTiersItemSchema.optional()),
|
|
178
|
+
UpdateAddonTiersSchema,
|
|
179
|
+
])
|
|
180
|
+
.optional(),
|
|
181
|
+
tax_providers_fields: z
|
|
182
|
+
.union([
|
|
183
|
+
z.array(UpdateAddonTaxProvidersFieldsItemSchema.optional()),
|
|
184
|
+
UpdateAddonTaxProvidersFieldsSchema,
|
|
185
|
+
])
|
|
186
|
+
.optional(),
|
|
141
187
|
});
|
|
142
188
|
export { UpdateAddonBodySchema };
|
|
143
189
|
//Addon.list
|
|
@@ -145,15 +191,35 @@ const ListAddonIdSchema = z.object({
|
|
|
145
191
|
is: z.string().min(1).optional(),
|
|
146
192
|
is_not: z.string().min(1).optional(),
|
|
147
193
|
starts_with: z.string().min(1).optional(),
|
|
148
|
-
in: z
|
|
149
|
-
|
|
194
|
+
in: z
|
|
195
|
+
.union([
|
|
196
|
+
z.array(z.string().optional()),
|
|
197
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
198
|
+
])
|
|
199
|
+
.optional(),
|
|
200
|
+
not_in: z
|
|
201
|
+
.union([
|
|
202
|
+
z.array(z.string().optional()),
|
|
203
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
204
|
+
])
|
|
205
|
+
.optional(),
|
|
150
206
|
});
|
|
151
207
|
const ListAddonNameSchema = z.object({
|
|
152
208
|
is: z.string().min(1).optional(),
|
|
153
209
|
is_not: z.string().min(1).optional(),
|
|
154
210
|
starts_with: z.string().min(1).optional(),
|
|
155
|
-
in: z
|
|
156
|
-
|
|
211
|
+
in: z
|
|
212
|
+
.union([
|
|
213
|
+
z.array(z.string().optional()),
|
|
214
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
215
|
+
])
|
|
216
|
+
.optional(),
|
|
217
|
+
not_in: z
|
|
218
|
+
.union([
|
|
219
|
+
z.array(z.string().optional()),
|
|
220
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
221
|
+
])
|
|
222
|
+
.optional(),
|
|
157
223
|
});
|
|
158
224
|
const ListAddonPricingModelSchema = z.object({
|
|
159
225
|
is: z
|
|
@@ -163,10 +229,20 @@ const ListAddonPricingModelSchema = z.object({
|
|
|
163
229
|
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
164
230
|
.optional(),
|
|
165
231
|
in: z
|
|
166
|
-
.
|
|
232
|
+
.union([
|
|
233
|
+
z.array(z
|
|
234
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
235
|
+
.optional()),
|
|
236
|
+
z.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep']),
|
|
237
|
+
])
|
|
167
238
|
.optional(),
|
|
168
239
|
not_in: z
|
|
169
|
-
.
|
|
240
|
+
.union([
|
|
241
|
+
z.array(z
|
|
242
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
243
|
+
.optional()),
|
|
244
|
+
z.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep']),
|
|
245
|
+
])
|
|
170
246
|
.optional(),
|
|
171
247
|
});
|
|
172
248
|
const ListAddonTypeSchema = z.object({
|
|
@@ -177,66 +253,171 @@ const ListAddonTypeSchema = z.object({
|
|
|
177
253
|
.enum(['on_off', 'quantity', 'tiered', 'volume', 'stairstep'])
|
|
178
254
|
.optional(),
|
|
179
255
|
in: z
|
|
180
|
-
.
|
|
256
|
+
.union([
|
|
257
|
+
z.array(z
|
|
258
|
+
.enum(['on_off', 'quantity', 'tiered', 'volume', 'stairstep'])
|
|
259
|
+
.optional()),
|
|
260
|
+
z.enum(['on_off', 'quantity', 'tiered', 'volume', 'stairstep']),
|
|
261
|
+
])
|
|
181
262
|
.optional(),
|
|
182
263
|
not_in: z
|
|
183
|
-
.
|
|
264
|
+
.union([
|
|
265
|
+
z.array(z
|
|
266
|
+
.enum(['on_off', 'quantity', 'tiered', 'volume', 'stairstep'])
|
|
267
|
+
.optional()),
|
|
268
|
+
z.enum(['on_off', 'quantity', 'tiered', 'volume', 'stairstep']),
|
|
269
|
+
])
|
|
184
270
|
.optional(),
|
|
185
271
|
});
|
|
186
272
|
const ListAddonChargeTypeSchema = z.object({
|
|
187
273
|
is: z.enum(['recurring', 'non_recurring']).optional(),
|
|
188
274
|
is_not: z.enum(['recurring', 'non_recurring']).optional(),
|
|
189
|
-
in: z
|
|
190
|
-
|
|
275
|
+
in: z
|
|
276
|
+
.union([
|
|
277
|
+
z.array(z.enum(['recurring', 'non_recurring']).optional()),
|
|
278
|
+
z.enum(['recurring', 'non_recurring']),
|
|
279
|
+
])
|
|
280
|
+
.optional(),
|
|
281
|
+
not_in: z
|
|
282
|
+
.union([
|
|
283
|
+
z.array(z.enum(['recurring', 'non_recurring']).optional()),
|
|
284
|
+
z.enum(['recurring', 'non_recurring']),
|
|
285
|
+
])
|
|
286
|
+
.optional(),
|
|
191
287
|
});
|
|
192
288
|
const ListAddonPriceSchema = z.object({
|
|
193
|
-
is: z
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
289
|
+
is: z
|
|
290
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
291
|
+
.optional(),
|
|
292
|
+
is_not: z
|
|
293
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
294
|
+
.optional(),
|
|
295
|
+
lt: z
|
|
296
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
297
|
+
.optional(),
|
|
298
|
+
lte: z
|
|
299
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
300
|
+
.optional(),
|
|
301
|
+
gt: z
|
|
302
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
303
|
+
.optional(),
|
|
304
|
+
gte: z
|
|
305
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
306
|
+
.optional(),
|
|
307
|
+
between: z
|
|
308
|
+
.union([
|
|
309
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
310
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
311
|
+
])
|
|
312
|
+
.optional(),
|
|
200
313
|
});
|
|
201
314
|
const ListAddonPeriodSchema = z.object({
|
|
202
|
-
is: z
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
315
|
+
is: z
|
|
316
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
317
|
+
.optional(),
|
|
318
|
+
is_not: z
|
|
319
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
320
|
+
.optional(),
|
|
321
|
+
lt: z
|
|
322
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
323
|
+
.optional(),
|
|
324
|
+
lte: z
|
|
325
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
326
|
+
.optional(),
|
|
327
|
+
gt: z
|
|
328
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
329
|
+
.optional(),
|
|
330
|
+
gte: z
|
|
331
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
332
|
+
.optional(),
|
|
333
|
+
between: z
|
|
334
|
+
.union([
|
|
335
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
336
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
337
|
+
])
|
|
338
|
+
.optional(),
|
|
209
339
|
});
|
|
210
340
|
const ListAddonPeriodUnitSchema = z.object({
|
|
211
341
|
is: z.enum(['day', 'week', 'month', 'year', 'not_applicable']).optional(),
|
|
212
342
|
is_not: z.enum(['day', 'week', 'month', 'year', 'not_applicable']).optional(),
|
|
213
|
-
in: z
|
|
214
|
-
|
|
343
|
+
in: z
|
|
344
|
+
.union([
|
|
345
|
+
z.array(z.enum(['day', 'week', 'month', 'year', 'not_applicable']).optional()),
|
|
346
|
+
z.enum(['day', 'week', 'month', 'year', 'not_applicable']),
|
|
347
|
+
])
|
|
348
|
+
.optional(),
|
|
349
|
+
not_in: z
|
|
350
|
+
.union([
|
|
351
|
+
z.array(z.enum(['day', 'week', 'month', 'year', 'not_applicable']).optional()),
|
|
352
|
+
z.enum(['day', 'week', 'month', 'year', 'not_applicable']),
|
|
353
|
+
])
|
|
354
|
+
.optional(),
|
|
215
355
|
});
|
|
216
356
|
const ListAddonStatusSchema = z.object({
|
|
217
357
|
is: z.enum(['active', 'archived', 'deleted']).optional(),
|
|
218
358
|
is_not: z.enum(['active', 'archived', 'deleted']).optional(),
|
|
219
|
-
in: z
|
|
220
|
-
|
|
359
|
+
in: z
|
|
360
|
+
.union([
|
|
361
|
+
z.array(z.enum(['active', 'archived', 'deleted']).optional()),
|
|
362
|
+
z.enum(['active', 'archived', 'deleted']),
|
|
363
|
+
])
|
|
364
|
+
.optional(),
|
|
365
|
+
not_in: z
|
|
366
|
+
.union([
|
|
367
|
+
z.array(z.enum(['active', 'archived', 'deleted']).optional()),
|
|
368
|
+
z.enum(['active', 'archived', 'deleted']),
|
|
369
|
+
])
|
|
370
|
+
.optional(),
|
|
221
371
|
});
|
|
222
372
|
const ListAddonUpdatedAtSchema = z.object({
|
|
223
|
-
after: z
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
373
|
+
after: z
|
|
374
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
375
|
+
.optional(),
|
|
376
|
+
before: z
|
|
377
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
378
|
+
.optional(),
|
|
379
|
+
on: z
|
|
380
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
381
|
+
.optional(),
|
|
382
|
+
between: z
|
|
383
|
+
.union([
|
|
384
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
385
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
386
|
+
])
|
|
387
|
+
.optional(),
|
|
227
388
|
});
|
|
228
389
|
const ListAddonCurrencyCodeSchema = z.object({
|
|
229
390
|
is: z.string().min(1).optional(),
|
|
230
391
|
is_not: z.string().min(1).optional(),
|
|
231
392
|
starts_with: z.string().min(1).optional(),
|
|
232
|
-
in: z
|
|
233
|
-
|
|
393
|
+
in: z
|
|
394
|
+
.union([
|
|
395
|
+
z.array(z.string().optional()),
|
|
396
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
397
|
+
])
|
|
398
|
+
.optional(),
|
|
399
|
+
not_in: z
|
|
400
|
+
.union([
|
|
401
|
+
z.array(z.string().optional()),
|
|
402
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
403
|
+
])
|
|
404
|
+
.optional(),
|
|
234
405
|
});
|
|
235
406
|
const ListAddonChannelSchema = z.object({
|
|
236
407
|
is: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
237
408
|
is_not: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
238
|
-
in: z
|
|
239
|
-
|
|
409
|
+
in: z
|
|
410
|
+
.union([
|
|
411
|
+
z.array(z.enum(['web', 'app_store', 'play_store']).optional()),
|
|
412
|
+
z.enum(['web', 'app_store', 'play_store']),
|
|
413
|
+
])
|
|
414
|
+
.optional(),
|
|
415
|
+
not_in: z
|
|
416
|
+
.union([
|
|
417
|
+
z.array(z.enum(['web', 'app_store', 'play_store']).optional()),
|
|
418
|
+
z.enum(['web', 'app_store', 'play_store']),
|
|
419
|
+
])
|
|
420
|
+
.optional(),
|
|
240
421
|
});
|
|
241
422
|
const ListAddonBodySchema = z.looseObject({
|
|
242
423
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -7,6 +7,11 @@ const CreateAlertThresholdSchema = z.object({
|
|
|
7
7
|
mode: z.enum(['absolute', 'percentage']).optional(),
|
|
8
8
|
value: z.number(),
|
|
9
9
|
});
|
|
10
|
+
const CreateAlertFilterConditionsItemSchema = z.object({
|
|
11
|
+
field: z.enum(['plan_price_id']).optional(),
|
|
12
|
+
operator: z.enum(['equals', 'not_equals']).optional(),
|
|
13
|
+
value: z.string().max(50).optional(),
|
|
14
|
+
});
|
|
10
15
|
const CreateAlertFilterConditionsSchema = z.object({
|
|
11
16
|
field: z.array(z.enum(['plan_price_id']).optional()).optional(),
|
|
12
17
|
operator: z.array(z.enum(['equals', 'not_equals']).optional()).optional(),
|
|
@@ -22,12 +27,22 @@ const CreateAlertBodySchema = z.looseObject({
|
|
|
22
27
|
subscription_id: z.string().max(50).optional(),
|
|
23
28
|
meta: z.string().max(65000).optional(),
|
|
24
29
|
threshold: CreateAlertThresholdSchema.optional(),
|
|
25
|
-
filter_conditions:
|
|
30
|
+
filter_conditions: z
|
|
31
|
+
.union([
|
|
32
|
+
z.array(CreateAlertFilterConditionsItemSchema.optional()),
|
|
33
|
+
CreateAlertFilterConditionsSchema,
|
|
34
|
+
])
|
|
35
|
+
.optional(),
|
|
26
36
|
});
|
|
27
37
|
export { CreateAlertBodySchema };
|
|
28
38
|
//Alert.list
|
|
29
39
|
const ListAlertIdSchema = z.object({
|
|
30
|
-
in: z
|
|
40
|
+
in: z
|
|
41
|
+
.union([
|
|
42
|
+
z.array(z.string().optional()),
|
|
43
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
44
|
+
])
|
|
45
|
+
.optional(),
|
|
31
46
|
});
|
|
32
47
|
const ListAlertTypeSchema = z.object({
|
|
33
48
|
is: z
|
|
@@ -7,7 +7,12 @@ const AlertStatusesforsubscriptionAlertStatusAlarmStatusSchema = z.object({
|
|
|
7
7
|
is: z.enum(['within_limit', 'in_alarm']).optional(),
|
|
8
8
|
});
|
|
9
9
|
const AlertStatusesforsubscriptionAlertStatusAlertIdSchema = z.object({
|
|
10
|
-
in: z
|
|
10
|
+
in: z
|
|
11
|
+
.union([
|
|
12
|
+
z.array(z.string().optional()),
|
|
13
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
14
|
+
])
|
|
15
|
+
.optional(),
|
|
11
16
|
});
|
|
12
17
|
const AlertStatusesforsubscriptionAlertStatusBodySchema = z.looseObject({
|
|
13
18
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -58,27 +58,67 @@ const ListAttachedItemIdSchema = z.object({
|
|
|
58
58
|
is: z.string().min(1).optional(),
|
|
59
59
|
is_not: z.string().min(1).optional(),
|
|
60
60
|
starts_with: z.string().min(1).optional(),
|
|
61
|
-
in: z
|
|
62
|
-
|
|
61
|
+
in: z
|
|
62
|
+
.union([
|
|
63
|
+
z.array(z.string().optional()),
|
|
64
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
65
|
+
])
|
|
66
|
+
.optional(),
|
|
67
|
+
not_in: z
|
|
68
|
+
.union([
|
|
69
|
+
z.array(z.string().optional()),
|
|
70
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
71
|
+
])
|
|
72
|
+
.optional(),
|
|
63
73
|
});
|
|
64
74
|
const ListAttachedItemItemIdSchema = z.object({
|
|
65
75
|
is: z.string().min(1).optional(),
|
|
66
76
|
is_not: z.string().min(1).optional(),
|
|
67
77
|
starts_with: z.string().min(1).optional(),
|
|
68
|
-
in: z
|
|
69
|
-
|
|
78
|
+
in: z
|
|
79
|
+
.union([
|
|
80
|
+
z.array(z.string().optional()),
|
|
81
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
82
|
+
])
|
|
83
|
+
.optional(),
|
|
84
|
+
not_in: z
|
|
85
|
+
.union([
|
|
86
|
+
z.array(z.string().optional()),
|
|
87
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
88
|
+
])
|
|
89
|
+
.optional(),
|
|
70
90
|
});
|
|
71
91
|
const ListAttachedItemTypeSchema = z.object({
|
|
72
92
|
is: z.enum(['recommended', 'mandatory', 'optional']).optional(),
|
|
73
93
|
is_not: z.enum(['recommended', 'mandatory', 'optional']).optional(),
|
|
74
|
-
in: z
|
|
75
|
-
|
|
94
|
+
in: z
|
|
95
|
+
.union([
|
|
96
|
+
z.array(z.enum(['recommended', 'mandatory', 'optional']).optional()),
|
|
97
|
+
z.enum(['recommended', 'mandatory', 'optional']),
|
|
98
|
+
])
|
|
99
|
+
.optional(),
|
|
100
|
+
not_in: z
|
|
101
|
+
.union([
|
|
102
|
+
z.array(z.enum(['recommended', 'mandatory', 'optional']).optional()),
|
|
103
|
+
z.enum(['recommended', 'mandatory', 'optional']),
|
|
104
|
+
])
|
|
105
|
+
.optional(),
|
|
76
106
|
});
|
|
77
107
|
const ListAttachedItemItemTypeSchema = z.object({
|
|
78
108
|
is: z.enum(['plan', 'addon', 'charge']).optional(),
|
|
79
109
|
is_not: z.enum(['plan', 'addon', 'charge']).optional(),
|
|
80
|
-
in: z
|
|
81
|
-
|
|
110
|
+
in: z
|
|
111
|
+
.union([
|
|
112
|
+
z.array(z.enum(['plan', 'addon', 'charge']).optional()),
|
|
113
|
+
z.enum(['plan', 'addon', 'charge']),
|
|
114
|
+
])
|
|
115
|
+
.optional(),
|
|
116
|
+
not_in: z
|
|
117
|
+
.union([
|
|
118
|
+
z.array(z.enum(['plan', 'addon', 'charge']).optional()),
|
|
119
|
+
z.enum(['plan', 'addon', 'charge']),
|
|
120
|
+
])
|
|
121
|
+
.optional(),
|
|
82
122
|
});
|
|
83
123
|
const ListAttachedItemChargeOnEventSchema = z.object({
|
|
84
124
|
is: z
|
|
@@ -102,31 +142,66 @@ const ListAttachedItemChargeOnEventSchema = z.object({
|
|
|
102
142
|
])
|
|
103
143
|
.optional(),
|
|
104
144
|
in: z
|
|
105
|
-
.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
145
|
+
.union([
|
|
146
|
+
z.array(z
|
|
147
|
+
.enum([
|
|
148
|
+
'subscription_creation',
|
|
149
|
+
'subscription_trial_start',
|
|
150
|
+
'plan_activation',
|
|
151
|
+
'subscription_activation',
|
|
152
|
+
'contract_termination',
|
|
153
|
+
'on_demand',
|
|
154
|
+
])
|
|
155
|
+
.optional()),
|
|
156
|
+
z.enum([
|
|
157
|
+
'subscription_creation',
|
|
158
|
+
'subscription_trial_start',
|
|
159
|
+
'plan_activation',
|
|
160
|
+
'subscription_activation',
|
|
161
|
+
'contract_termination',
|
|
162
|
+
'on_demand',
|
|
163
|
+
]),
|
|
112
164
|
])
|
|
113
165
|
.optional(),
|
|
114
166
|
not_in: z
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
167
|
+
.union([
|
|
168
|
+
z.array(z
|
|
169
|
+
.enum([
|
|
170
|
+
'subscription_creation',
|
|
171
|
+
'subscription_trial_start',
|
|
172
|
+
'plan_activation',
|
|
173
|
+
'subscription_activation',
|
|
174
|
+
'contract_termination',
|
|
175
|
+
'on_demand',
|
|
176
|
+
])
|
|
177
|
+
.optional()),
|
|
178
|
+
z.enum([
|
|
179
|
+
'subscription_creation',
|
|
180
|
+
'subscription_trial_start',
|
|
181
|
+
'plan_activation',
|
|
182
|
+
'subscription_activation',
|
|
183
|
+
'contract_termination',
|
|
184
|
+
'on_demand',
|
|
185
|
+
]),
|
|
122
186
|
])
|
|
123
187
|
.optional(),
|
|
124
188
|
});
|
|
125
189
|
const ListAttachedItemUpdatedAtSchema = z.object({
|
|
126
|
-
after: z
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
190
|
+
after: z
|
|
191
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
192
|
+
.optional(),
|
|
193
|
+
before: z
|
|
194
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
195
|
+
.optional(),
|
|
196
|
+
on: z
|
|
197
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
198
|
+
.optional(),
|
|
199
|
+
between: z
|
|
200
|
+
.union([
|
|
201
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
202
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
203
|
+
])
|
|
204
|
+
.optional(),
|
|
130
205
|
});
|
|
131
206
|
const ListAttachedItemBodySchema = z.looseObject({
|
|
132
207
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
// Generated Zod schemas: BusinessEntity
|
|
2
|
-
// Actions: createTransfers, getTransfers
|
|
2
|
+
// Actions: create, list, update, createTransfers, getTransfers
|
|
3
3
|
// Do not edit manually – regenerate via sdk-generator
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
+
//BusinessEntity.create
|
|
6
|
+
const CreateBusinessEntityBodySchema = z.looseObject({
|
|
7
|
+
name: z.string().max(100),
|
|
8
|
+
status: z.enum(['active', 'inactive']),
|
|
9
|
+
});
|
|
10
|
+
export { CreateBusinessEntityBodySchema };
|
|
11
|
+
//BusinessEntity.list
|
|
12
|
+
const ListBusinessEntityNameSchema = z.object({
|
|
13
|
+
is: z.string().min(1).optional(),
|
|
14
|
+
is_not: z.string().min(1).optional(),
|
|
15
|
+
starts_with: z.string().min(1).optional(),
|
|
16
|
+
is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
17
|
+
});
|
|
18
|
+
const ListBusinessEntityBodySchema = z.looseObject({
|
|
19
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
20
|
+
offset: z.string().max(1000).optional(),
|
|
21
|
+
include_deleted: z.boolean().default(false).optional(),
|
|
22
|
+
name: ListBusinessEntityNameSchema.optional(),
|
|
23
|
+
});
|
|
24
|
+
export { ListBusinessEntityBodySchema };
|
|
25
|
+
//BusinessEntity.update
|
|
26
|
+
const UpdateBusinessEntityBodySchema = z.looseObject({
|
|
27
|
+
name: z.string().max(100).optional(),
|
|
28
|
+
status: z.enum(['active', 'inactive']).optional(),
|
|
29
|
+
});
|
|
30
|
+
export { UpdateBusinessEntityBodySchema };
|
|
5
31
|
//BusinessEntity.createTransfers
|
|
6
32
|
const CreateTransfersBusinessEntityBodySchema = z.looseObject({
|
|
7
33
|
active_resource_ids: z.array(z.string().max(50).optional()),
|
|
@@ -22,10 +48,21 @@ const GetTransfersBusinessEntityActiveResourceIdSchema = z.object({
|
|
|
22
48
|
is: z.string().min(1).optional(),
|
|
23
49
|
});
|
|
24
50
|
const GetTransfersBusinessEntityCreatedAtSchema = z.object({
|
|
25
|
-
after: z
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
51
|
+
after: z
|
|
52
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
53
|
+
.optional(),
|
|
54
|
+
before: z
|
|
55
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
56
|
+
.optional(),
|
|
57
|
+
on: z
|
|
58
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
59
|
+
.optional(),
|
|
60
|
+
between: z
|
|
61
|
+
.union([
|
|
62
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
63
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
64
|
+
])
|
|
65
|
+
.optional(),
|
|
29
66
|
});
|
|
30
67
|
const GetTransfersBusinessEntitySortBySchema = z.looseObject({
|
|
31
68
|
asc: z.enum(['created_at']).optional(),
|
|
@@ -25,10 +25,10 @@ const UpdateDraftBusinessRuleBodySchema = z.looseObject({
|
|
|
25
25
|
export { UpdateDraftBusinessRuleBodySchema };
|
|
26
26
|
//BusinessRule.list
|
|
27
27
|
const ListBusinessRuleDraftSchema = z.object({
|
|
28
|
-
is: z.enum(['true', 'false']).optional(),
|
|
28
|
+
is: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
29
29
|
});
|
|
30
30
|
const ListBusinessRuleActiveSchema = z.object({
|
|
31
|
-
is: z.enum(['true', 'false']).optional(),
|
|
31
|
+
is: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
32
32
|
});
|
|
33
33
|
const ListBusinessRuleBodySchema = z.looseObject({
|
|
34
34
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -45,7 +45,7 @@ const RemoveRulesBusinessRulesetBodySchema = z.looseObject({
|
|
|
45
45
|
export { RemoveRulesBusinessRulesetBodySchema };
|
|
46
46
|
//BusinessRuleset.listRules
|
|
47
47
|
const ListRulesBusinessRulesetActiveSchema = z.object({
|
|
48
|
-
is: z.enum(['true', 'false']).optional(),
|
|
48
|
+
is: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
49
49
|
});
|
|
50
50
|
const ListRulesBusinessRulesetBodySchema = z.looseObject({
|
|
51
51
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -55,7 +55,7 @@ const ListRulesBusinessRulesetBodySchema = z.looseObject({
|
|
|
55
55
|
export { ListRulesBusinessRulesetBodySchema };
|
|
56
56
|
//BusinessRuleset.list
|
|
57
57
|
const ListBusinessRulesetActiveSchema = z.object({
|
|
58
|
-
is: z.enum(['true', 'false']).optional(),
|
|
58
|
+
is: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
59
59
|
});
|
|
60
60
|
const ListBusinessRulesetBodySchema = z.looseObject({
|
|
61
61
|
limit: z.number().int().min(1).max(100).optional(),
|