chargebee 3.35.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 +65 -0
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +56 -0
- package/cjs/resources/webhook/eventType.js +2 -0
- 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 +16 -5
- package/cjs/schema/business_rule.schema.js +2 -2
- package/cjs/schema/business_ruleset.schema.js +2 -2
- package/cjs/schema/comment.schema.js +15 -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 +496 -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 +33 -4
- package/cjs/schema/entitlement_override.schema.js +17 -1
- package/cjs/schema/estimate.schema.js +581 -36
- package/cjs/schema/event.schema.js +1282 -633
- 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 +562 -66
- package/cjs/schema/index.js +3 -0
- package/cjs/schema/invoice.schema.js +821 -121
- 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_operation.schema.js +42 -15
- package/cjs/schema/metered_feature.schema.js +10 -1
- package/cjs/schema/omnichannel_one_time_order.schema.js +32 -2
- package/cjs/schema/omnichannel_subscription.schema.js +136 -30
- 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 +360 -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 +79 -14
- 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 +204 -12
- package/cjs/schema/quote.schema.js +901 -81
- package/cjs/schema/quote_entitlement.schema.js +6 -2
- package/cjs/schema/ramp.schema.js +238 -24
- package/cjs/schema/site_migration_detail.schema.js +50 -16
- package/cjs/schema/subscription.schema.js +998 -169
- 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 +55 -12
- package/cjs/schema/usage_event.schema.js +13 -1
- package/cjs/schema/virtual_bank_account.schema.js +42 -10
- package/cjs/schema/webhook_endpoint.schema.js +4 -0
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +56 -0
- package/esm/resources/webhook/eventType.js +2 -0
- 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 +16 -5
- package/esm/schema/business_rule.schema.js +2 -2
- package/esm/schema/business_ruleset.schema.js +2 -2
- package/esm/schema/comment.schema.js +15 -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 +496 -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 +33 -4
- package/esm/schema/entitlement_override.schema.js +17 -1
- package/esm/schema/estimate.schema.js +581 -36
- package/esm/schema/event.schema.js +1282 -633
- 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 +562 -66
- package/esm/schema/index.js +3 -0
- package/esm/schema/invoice.schema.js +821 -121
- 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_operation.schema.js +42 -15
- package/esm/schema/metered_feature.schema.js +10 -1
- package/esm/schema/omnichannel_one_time_order.schema.js +32 -2
- package/esm/schema/omnichannel_subscription.schema.js +136 -30
- 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 +360 -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 +79 -14
- 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 +204 -12
- package/esm/schema/quote.schema.js +901 -81
- package/esm/schema/quote_entitlement.schema.js +6 -2
- package/esm/schema/ramp.schema.js +238 -24
- package/esm/schema/site_migration_detail.schema.js +50 -16
- package/esm/schema/subscription.schema.js +998 -169
- 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 +55 -12
- package/esm/schema/usage_event.schema.js +13 -1
- package/esm/schema/virtual_bank_account.schema.js +42 -10
- package/esm/schema/webhook_endpoint.schema.js +4 -0
- package/package.json +1 -1
- package/types/core.d.ts +10 -6
- package/types/index.d.ts +8 -1
- package/types/resources/BillingLineItem.d.ts +10 -0
- package/types/resources/BillingMetadata.d.ts +9 -0
- package/types/resources/Content.d.ts +5 -0
- package/types/resources/Discount.d.ts +1 -0
- package/types/resources/DraftRequest.d.ts +1 -1
- package/types/resources/Estimate.d.ts +3 -0
- package/types/resources/Event.d.ts +2 -0
- 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/HostedPage.d.ts +18 -0
- package/types/resources/Invoice.d.ts +4 -0
- package/types/resources/OrganizationDetail.d.ts +84 -0
- package/types/resources/Subscription.d.ts +3 -0
- package/types/resources/Usage.d.ts +1 -0
- package/types/resources/WebhookEvent.d.ts +10 -0
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
//Plan.create
|
|
6
6
|
const CreatePlanMetaDataSchema = z.looseObject({});
|
|
7
|
+
const CreatePlanTiersItemSchema = 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 CreatePlanTiersSchema = 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,14 +20,37 @@ const CreatePlanTiersSchema = 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 CreatePlanTaxProvidersFieldsItemSchema = 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 CreatePlanTaxProvidersFieldsSchema = z.object({
|
|
16
29
|
provider_name: z.array(z.string().max(50).optional()),
|
|
17
30
|
field_id: z.array(z.string().max(50).optional()),
|
|
18
31
|
field_value: z.array(z.string().max(50).optional()),
|
|
19
32
|
});
|
|
33
|
+
const CreatePlanApplicableAddonsItemSchema = z.object({
|
|
34
|
+
id: z.string().max(100).optional(),
|
|
35
|
+
});
|
|
20
36
|
const CreatePlanApplicableAddonsSchema = z.object({
|
|
21
37
|
id: z.array(z.string().max(100).optional()).optional(),
|
|
22
38
|
});
|
|
39
|
+
const CreatePlanEventBasedAddonsItemSchema = z.object({
|
|
40
|
+
id: z.string().max(100).optional(),
|
|
41
|
+
quantity: z.number().int().min(1).optional(),
|
|
42
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
43
|
+
on_event: z
|
|
44
|
+
.enum([
|
|
45
|
+
'subscription_creation',
|
|
46
|
+
'subscription_trial_start',
|
|
47
|
+
'plan_activation',
|
|
48
|
+
'subscription_activation',
|
|
49
|
+
'contract_termination',
|
|
50
|
+
])
|
|
51
|
+
.optional(),
|
|
52
|
+
charge_once: z.boolean().default(true).optional(),
|
|
53
|
+
});
|
|
23
54
|
const CreatePlanEventBasedAddonsSchema = z.object({
|
|
24
55
|
id: z.array(z.string().max(100).optional()).optional(),
|
|
25
56
|
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -37,6 +68,13 @@ const CreatePlanEventBasedAddonsSchema = z.object({
|
|
|
37
68
|
.optional(),
|
|
38
69
|
charge_once: z.array(z.boolean().default(true).optional()).optional(),
|
|
39
70
|
});
|
|
71
|
+
const CreatePlanAttachedAddonsItemSchema = z.object({
|
|
72
|
+
id: z.string().max(100).optional(),
|
|
73
|
+
quantity: z.number().int().min(1).optional(),
|
|
74
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
75
|
+
billing_cycles: z.number().int().min(1).optional(),
|
|
76
|
+
type: z.enum(['recommended', 'mandatory']).optional(),
|
|
77
|
+
});
|
|
40
78
|
const CreatePlanAttachedAddonsSchema = z.object({
|
|
41
79
|
id: z.array(z.string().max(100).optional()).optional(),
|
|
42
80
|
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -102,15 +140,48 @@ const CreatePlanBodySchema = z.looseObject({
|
|
|
102
140
|
giftable: z.boolean().default(false).optional(),
|
|
103
141
|
status: z.enum(['active', 'archived']).optional(),
|
|
104
142
|
claim_url: z.string().max(500).optional(),
|
|
105
|
-
tiers:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
143
|
+
tiers: z
|
|
144
|
+
.union([
|
|
145
|
+
z.array(CreatePlanTiersItemSchema.optional()),
|
|
146
|
+
CreatePlanTiersSchema,
|
|
147
|
+
])
|
|
148
|
+
.optional(),
|
|
149
|
+
tax_providers_fields: z
|
|
150
|
+
.union([
|
|
151
|
+
z.array(CreatePlanTaxProvidersFieldsItemSchema.optional()),
|
|
152
|
+
CreatePlanTaxProvidersFieldsSchema,
|
|
153
|
+
])
|
|
154
|
+
.optional(),
|
|
155
|
+
applicable_addons: z
|
|
156
|
+
.union([
|
|
157
|
+
z.array(CreatePlanApplicableAddonsItemSchema.optional()),
|
|
158
|
+
CreatePlanApplicableAddonsSchema,
|
|
159
|
+
])
|
|
160
|
+
.optional(),
|
|
161
|
+
event_based_addons: z
|
|
162
|
+
.union([
|
|
163
|
+
z.array(CreatePlanEventBasedAddonsItemSchema.optional()),
|
|
164
|
+
CreatePlanEventBasedAddonsSchema,
|
|
165
|
+
])
|
|
166
|
+
.optional(),
|
|
167
|
+
attached_addons: z
|
|
168
|
+
.union([
|
|
169
|
+
z.array(CreatePlanAttachedAddonsItemSchema.optional()),
|
|
170
|
+
CreatePlanAttachedAddonsSchema,
|
|
171
|
+
])
|
|
172
|
+
.optional(),
|
|
110
173
|
});
|
|
111
174
|
export { CreatePlanBodySchema };
|
|
112
175
|
//Plan.update
|
|
113
176
|
const UpdatePlanMetaDataSchema = z.looseObject({});
|
|
177
|
+
const UpdatePlanTiersItemSchema = z.object({
|
|
178
|
+
starting_unit: z.number().int().min(1).optional(),
|
|
179
|
+
ending_unit: z.number().int().optional(),
|
|
180
|
+
price: z.number().int().min(0).optional(),
|
|
181
|
+
starting_unit_in_decimal: z.string().max(33).optional(),
|
|
182
|
+
ending_unit_in_decimal: z.string().max(33).optional(),
|
|
183
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
184
|
+
});
|
|
114
185
|
const UpdatePlanTiersSchema = z.object({
|
|
115
186
|
starting_unit: z.array(z.number().int().min(1).optional()).optional(),
|
|
116
187
|
ending_unit: z.array(z.number().int().optional()).optional(),
|
|
@@ -119,14 +190,37 @@ const UpdatePlanTiersSchema = z.object({
|
|
|
119
190
|
ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
120
191
|
price_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
121
192
|
});
|
|
193
|
+
const UpdatePlanTaxProvidersFieldsItemSchema = z.object({
|
|
194
|
+
provider_name: z.string().max(50),
|
|
195
|
+
field_id: z.string().max(50),
|
|
196
|
+
field_value: z.string().max(50),
|
|
197
|
+
});
|
|
122
198
|
const UpdatePlanTaxProvidersFieldsSchema = z.object({
|
|
123
199
|
provider_name: z.array(z.string().max(50).optional()),
|
|
124
200
|
field_id: z.array(z.string().max(50).optional()),
|
|
125
201
|
field_value: z.array(z.string().max(50).optional()),
|
|
126
202
|
});
|
|
203
|
+
const UpdatePlanApplicableAddonsItemSchema = z.object({
|
|
204
|
+
id: z.string().max(100).optional(),
|
|
205
|
+
});
|
|
127
206
|
const UpdatePlanApplicableAddonsSchema = z.object({
|
|
128
207
|
id: z.array(z.string().max(100).optional()).optional(),
|
|
129
208
|
});
|
|
209
|
+
const UpdatePlanEventBasedAddonsItemSchema = z.object({
|
|
210
|
+
id: z.string().max(100).optional(),
|
|
211
|
+
quantity: z.number().int().min(1).optional(),
|
|
212
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
213
|
+
on_event: z
|
|
214
|
+
.enum([
|
|
215
|
+
'subscription_creation',
|
|
216
|
+
'subscription_trial_start',
|
|
217
|
+
'plan_activation',
|
|
218
|
+
'subscription_activation',
|
|
219
|
+
'contract_termination',
|
|
220
|
+
])
|
|
221
|
+
.optional(),
|
|
222
|
+
charge_once: z.boolean().default(true).optional(),
|
|
223
|
+
});
|
|
130
224
|
const UpdatePlanEventBasedAddonsSchema = z.object({
|
|
131
225
|
id: z.array(z.string().max(100).optional()).optional(),
|
|
132
226
|
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -144,6 +238,13 @@ const UpdatePlanEventBasedAddonsSchema = z.object({
|
|
|
144
238
|
.optional(),
|
|
145
239
|
charge_once: z.array(z.boolean().default(true).optional()).optional(),
|
|
146
240
|
});
|
|
241
|
+
const UpdatePlanAttachedAddonsItemSchema = z.object({
|
|
242
|
+
id: z.string().max(100).optional(),
|
|
243
|
+
quantity: z.number().int().min(1).optional(),
|
|
244
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
245
|
+
billing_cycles: z.number().int().min(1).optional(),
|
|
246
|
+
type: z.enum(['recommended', 'mandatory']).optional(),
|
|
247
|
+
});
|
|
147
248
|
const UpdatePlanAttachedAddonsSchema = z.object({
|
|
148
249
|
id: z.array(z.string().max(100).optional()).optional(),
|
|
149
250
|
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -205,11 +306,36 @@ const UpdatePlanBodySchema = z.looseObject({
|
|
|
205
306
|
meta_data: UpdatePlanMetaDataSchema.optional(),
|
|
206
307
|
show_description_in_invoices: z.boolean().default(false).optional(),
|
|
207
308
|
show_description_in_quotes: z.boolean().default(false).optional(),
|
|
208
|
-
tiers:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
309
|
+
tiers: z
|
|
310
|
+
.union([
|
|
311
|
+
z.array(UpdatePlanTiersItemSchema.optional()),
|
|
312
|
+
UpdatePlanTiersSchema,
|
|
313
|
+
])
|
|
314
|
+
.optional(),
|
|
315
|
+
tax_providers_fields: z
|
|
316
|
+
.union([
|
|
317
|
+
z.array(UpdatePlanTaxProvidersFieldsItemSchema.optional()),
|
|
318
|
+
UpdatePlanTaxProvidersFieldsSchema,
|
|
319
|
+
])
|
|
320
|
+
.optional(),
|
|
321
|
+
applicable_addons: z
|
|
322
|
+
.union([
|
|
323
|
+
z.array(UpdatePlanApplicableAddonsItemSchema.optional()),
|
|
324
|
+
UpdatePlanApplicableAddonsSchema,
|
|
325
|
+
])
|
|
326
|
+
.optional(),
|
|
327
|
+
event_based_addons: z
|
|
328
|
+
.union([
|
|
329
|
+
z.array(UpdatePlanEventBasedAddonsItemSchema.optional()),
|
|
330
|
+
UpdatePlanEventBasedAddonsSchema,
|
|
331
|
+
])
|
|
332
|
+
.optional(),
|
|
333
|
+
attached_addons: z
|
|
334
|
+
.union([
|
|
335
|
+
z.array(UpdatePlanAttachedAddonsItemSchema.optional()),
|
|
336
|
+
UpdatePlanAttachedAddonsSchema,
|
|
337
|
+
])
|
|
338
|
+
.optional(),
|
|
213
339
|
});
|
|
214
340
|
export { UpdatePlanBodySchema };
|
|
215
341
|
//Plan.list
|
|
@@ -217,64 +343,165 @@ const ListPlanIdSchema = z.object({
|
|
|
217
343
|
is: z.string().min(1).optional(),
|
|
218
344
|
is_not: z.string().min(1).optional(),
|
|
219
345
|
starts_with: z.string().min(1).optional(),
|
|
220
|
-
in: z
|
|
221
|
-
|
|
346
|
+
in: z
|
|
347
|
+
.union([
|
|
348
|
+
z.array(z.string().optional()),
|
|
349
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
350
|
+
])
|
|
351
|
+
.optional(),
|
|
352
|
+
not_in: z
|
|
353
|
+
.union([
|
|
354
|
+
z.array(z.string().optional()),
|
|
355
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
356
|
+
])
|
|
357
|
+
.optional(),
|
|
222
358
|
});
|
|
223
359
|
const ListPlanNameSchema = z.object({
|
|
224
360
|
is: z.string().min(1).optional(),
|
|
225
361
|
is_not: z.string().min(1).optional(),
|
|
226
362
|
starts_with: z.string().min(1).optional(),
|
|
227
|
-
in: z
|
|
228
|
-
|
|
363
|
+
in: z
|
|
364
|
+
.union([
|
|
365
|
+
z.array(z.string().optional()),
|
|
366
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
367
|
+
])
|
|
368
|
+
.optional(),
|
|
369
|
+
not_in: z
|
|
370
|
+
.union([
|
|
371
|
+
z.array(z.string().optional()),
|
|
372
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
373
|
+
])
|
|
374
|
+
.optional(),
|
|
229
375
|
});
|
|
230
376
|
const ListPlanPriceSchema = z.object({
|
|
231
|
-
is: z
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
377
|
+
is: z
|
|
378
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
379
|
+
.optional(),
|
|
380
|
+
is_not: z
|
|
381
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
382
|
+
.optional(),
|
|
383
|
+
lt: z
|
|
384
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
385
|
+
.optional(),
|
|
386
|
+
lte: z
|
|
387
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
388
|
+
.optional(),
|
|
389
|
+
gt: z
|
|
390
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
391
|
+
.optional(),
|
|
392
|
+
gte: z
|
|
393
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
394
|
+
.optional(),
|
|
395
|
+
between: z
|
|
396
|
+
.union([
|
|
397
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
398
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
399
|
+
])
|
|
400
|
+
.optional(),
|
|
238
401
|
});
|
|
239
402
|
const ListPlanPeriodSchema = z.object({
|
|
240
|
-
is: z
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
403
|
+
is: z
|
|
404
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
405
|
+
.optional(),
|
|
406
|
+
is_not: z
|
|
407
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
408
|
+
.optional(),
|
|
409
|
+
lt: z
|
|
410
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
411
|
+
.optional(),
|
|
412
|
+
lte: z
|
|
413
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
414
|
+
.optional(),
|
|
415
|
+
gt: z
|
|
416
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
417
|
+
.optional(),
|
|
418
|
+
gte: z
|
|
419
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
420
|
+
.optional(),
|
|
421
|
+
between: z
|
|
422
|
+
.union([
|
|
423
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
424
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
425
|
+
])
|
|
426
|
+
.optional(),
|
|
247
427
|
});
|
|
248
428
|
const ListPlanPeriodUnitSchema = z.object({
|
|
249
429
|
is: z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
250
430
|
is_not: z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
251
|
-
in: z
|
|
252
|
-
|
|
431
|
+
in: z
|
|
432
|
+
.union([
|
|
433
|
+
z.array(z.enum(['day', 'week', 'month', 'year']).optional()),
|
|
434
|
+
z.enum(['day', 'week', 'month', 'year']),
|
|
435
|
+
])
|
|
436
|
+
.optional(),
|
|
437
|
+
not_in: z
|
|
438
|
+
.union([
|
|
439
|
+
z.array(z.enum(['day', 'week', 'month', 'year']).optional()),
|
|
440
|
+
z.enum(['day', 'week', 'month', 'year']),
|
|
441
|
+
])
|
|
442
|
+
.optional(),
|
|
253
443
|
});
|
|
254
444
|
const ListPlanTrialPeriodSchema = z.object({
|
|
255
|
-
is: z
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
445
|
+
is: z
|
|
446
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
447
|
+
.optional(),
|
|
448
|
+
is_not: z
|
|
449
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
450
|
+
.optional(),
|
|
451
|
+
lt: z
|
|
452
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
453
|
+
.optional(),
|
|
454
|
+
lte: z
|
|
455
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
456
|
+
.optional(),
|
|
457
|
+
gt: z
|
|
458
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
459
|
+
.optional(),
|
|
460
|
+
gte: z
|
|
461
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
462
|
+
.optional(),
|
|
463
|
+
between: z
|
|
464
|
+
.union([
|
|
465
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
466
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
467
|
+
])
|
|
468
|
+
.optional(),
|
|
469
|
+
is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
263
470
|
});
|
|
264
471
|
const ListPlanTrialPeriodUnitSchema = z.object({
|
|
265
472
|
is: z.enum(['day', 'month']).optional(),
|
|
266
473
|
is_not: z.enum(['day', 'month']).optional(),
|
|
267
|
-
in: z
|
|
268
|
-
|
|
474
|
+
in: z
|
|
475
|
+
.union([
|
|
476
|
+
z.array(z.enum(['day', 'month']).optional()),
|
|
477
|
+
z.enum(['day', 'month']),
|
|
478
|
+
])
|
|
479
|
+
.optional(),
|
|
480
|
+
not_in: z
|
|
481
|
+
.union([
|
|
482
|
+
z.array(z.enum(['day', 'month']).optional()),
|
|
483
|
+
z.enum(['day', 'month']),
|
|
484
|
+
])
|
|
485
|
+
.optional(),
|
|
269
486
|
});
|
|
270
487
|
const ListPlanAddonApplicabilitySchema = z.object({
|
|
271
488
|
is: z.enum(['all', 'restricted']).optional(),
|
|
272
489
|
is_not: z.enum(['all', 'restricted']).optional(),
|
|
273
|
-
in: z
|
|
274
|
-
|
|
490
|
+
in: z
|
|
491
|
+
.union([
|
|
492
|
+
z.array(z.enum(['all', 'restricted']).optional()),
|
|
493
|
+
z.enum(['all', 'restricted']),
|
|
494
|
+
])
|
|
495
|
+
.optional(),
|
|
496
|
+
not_in: z
|
|
497
|
+
.union([
|
|
498
|
+
z.array(z.enum(['all', 'restricted']).optional()),
|
|
499
|
+
z.enum(['all', 'restricted']),
|
|
500
|
+
])
|
|
501
|
+
.optional(),
|
|
275
502
|
});
|
|
276
503
|
const ListPlanGiftableSchema = z.object({
|
|
277
|
-
is: z.enum(['true', 'false']).optional(),
|
|
504
|
+
is: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
278
505
|
});
|
|
279
506
|
const ListPlanChargeModelSchema = z.object({
|
|
280
507
|
is: z
|
|
@@ -284,10 +511,20 @@ const ListPlanChargeModelSchema = z.object({
|
|
|
284
511
|
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
285
512
|
.optional(),
|
|
286
513
|
in: z
|
|
287
|
-
.
|
|
514
|
+
.union([
|
|
515
|
+
z.array(z
|
|
516
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
517
|
+
.optional()),
|
|
518
|
+
z.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep']),
|
|
519
|
+
])
|
|
288
520
|
.optional(),
|
|
289
521
|
not_in: z
|
|
290
|
-
.
|
|
522
|
+
.union([
|
|
523
|
+
z.array(z
|
|
524
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
525
|
+
.optional()),
|
|
526
|
+
z.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep']),
|
|
527
|
+
])
|
|
291
528
|
.optional(),
|
|
292
529
|
});
|
|
293
530
|
const ListPlanPricingModelSchema = z.object({
|
|
@@ -298,36 +535,87 @@ const ListPlanPricingModelSchema = z.object({
|
|
|
298
535
|
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
299
536
|
.optional(),
|
|
300
537
|
in: z
|
|
301
|
-
.
|
|
538
|
+
.union([
|
|
539
|
+
z.array(z
|
|
540
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
541
|
+
.optional()),
|
|
542
|
+
z.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep']),
|
|
543
|
+
])
|
|
302
544
|
.optional(),
|
|
303
545
|
not_in: z
|
|
304
|
-
.
|
|
546
|
+
.union([
|
|
547
|
+
z.array(z
|
|
548
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
549
|
+
.optional()),
|
|
550
|
+
z.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep']),
|
|
551
|
+
])
|
|
305
552
|
.optional(),
|
|
306
553
|
});
|
|
307
554
|
const ListPlanStatusSchema = z.object({
|
|
308
555
|
is: z.enum(['active', 'archived', 'deleted']).optional(),
|
|
309
556
|
is_not: z.enum(['active', 'archived', 'deleted']).optional(),
|
|
310
|
-
in: z
|
|
311
|
-
|
|
557
|
+
in: z
|
|
558
|
+
.union([
|
|
559
|
+
z.array(z.enum(['active', 'archived', 'deleted']).optional()),
|
|
560
|
+
z.enum(['active', 'archived', 'deleted']),
|
|
561
|
+
])
|
|
562
|
+
.optional(),
|
|
563
|
+
not_in: z
|
|
564
|
+
.union([
|
|
565
|
+
z.array(z.enum(['active', 'archived', 'deleted']).optional()),
|
|
566
|
+
z.enum(['active', 'archived', 'deleted']),
|
|
567
|
+
])
|
|
568
|
+
.optional(),
|
|
312
569
|
});
|
|
313
570
|
const ListPlanUpdatedAtSchema = z.object({
|
|
314
|
-
after: z
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
571
|
+
after: z
|
|
572
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
573
|
+
.optional(),
|
|
574
|
+
before: z
|
|
575
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
576
|
+
.optional(),
|
|
577
|
+
on: z
|
|
578
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
579
|
+
.optional(),
|
|
580
|
+
between: z
|
|
581
|
+
.union([
|
|
582
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
583
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
584
|
+
])
|
|
585
|
+
.optional(),
|
|
318
586
|
});
|
|
319
587
|
const ListPlanCurrencyCodeSchema = z.object({
|
|
320
588
|
is: z.string().min(1).optional(),
|
|
321
589
|
is_not: z.string().min(1).optional(),
|
|
322
590
|
starts_with: z.string().min(1).optional(),
|
|
323
|
-
in: z
|
|
324
|
-
|
|
591
|
+
in: z
|
|
592
|
+
.union([
|
|
593
|
+
z.array(z.string().optional()),
|
|
594
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
595
|
+
])
|
|
596
|
+
.optional(),
|
|
597
|
+
not_in: z
|
|
598
|
+
.union([
|
|
599
|
+
z.array(z.string().optional()),
|
|
600
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
601
|
+
])
|
|
602
|
+
.optional(),
|
|
325
603
|
});
|
|
326
604
|
const ListPlanChannelSchema = z.object({
|
|
327
605
|
is: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
328
606
|
is_not: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
329
|
-
in: z
|
|
330
|
-
|
|
607
|
+
in: z
|
|
608
|
+
.union([
|
|
609
|
+
z.array(z.enum(['web', 'app_store', 'play_store']).optional()),
|
|
610
|
+
z.enum(['web', 'app_store', 'play_store']),
|
|
611
|
+
])
|
|
612
|
+
.optional(),
|
|
613
|
+
not_in: z
|
|
614
|
+
.union([
|
|
615
|
+
z.array(z.enum(['web', 'app_store', 'play_store']).optional()),
|
|
616
|
+
z.enum(['web', 'app_store', 'play_store']),
|
|
617
|
+
])
|
|
618
|
+
.optional(),
|
|
331
619
|
});
|
|
332
620
|
const ListPlanBodySchema = z.looseObject({
|
|
333
621
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
// Do not edit manually – regenerate via sdk-generator
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
//PriceRamp.create
|
|
6
|
+
const CreatePriceRampRampIntervalsItemSchema = z.object({
|
|
7
|
+
starting_billing_cycle: z.number().int().min(1),
|
|
8
|
+
ending_billing_cycle: z.number().int().min(1).optional(),
|
|
9
|
+
apply_catalog_price: z.boolean().default(false).optional(),
|
|
10
|
+
price: z.number().int().min(0).optional(),
|
|
11
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
12
|
+
});
|
|
6
13
|
const CreatePriceRampRampIntervalsSchema = z.object({
|
|
7
14
|
starting_billing_cycle: z.array(z.number().int().min(1).optional()),
|
|
8
15
|
ending_billing_cycle: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -15,10 +22,22 @@ const CreatePriceRampRampIntervalsSchema = z.object({
|
|
|
15
22
|
const CreatePriceRampBodySchema = z.looseObject({
|
|
16
23
|
item_price_id: z.string().max(100),
|
|
17
24
|
business_entity_id: z.string().max(50).optional(),
|
|
18
|
-
ramp_intervals:
|
|
25
|
+
ramp_intervals: z
|
|
26
|
+
.union([
|
|
27
|
+
z.array(CreatePriceRampRampIntervalsItemSchema.optional()),
|
|
28
|
+
CreatePriceRampRampIntervalsSchema,
|
|
29
|
+
])
|
|
30
|
+
.optional(),
|
|
19
31
|
});
|
|
20
32
|
export { CreatePriceRampBodySchema };
|
|
21
33
|
//PriceRamp.update
|
|
34
|
+
const UpdatePriceRampRampIntervalsItemSchema = z.object({
|
|
35
|
+
starting_billing_cycle: z.number().int().min(1),
|
|
36
|
+
ending_billing_cycle: z.number().int().min(1).optional(),
|
|
37
|
+
apply_catalog_price: z.boolean().default(false).optional(),
|
|
38
|
+
price: z.number().int().min(0).optional(),
|
|
39
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
40
|
+
});
|
|
22
41
|
const UpdatePriceRampRampIntervalsSchema = z.object({
|
|
23
42
|
starting_billing_cycle: z.array(z.number().int().min(1).optional()),
|
|
24
43
|
ending_billing_cycle: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -30,7 +49,12 @@ const UpdatePriceRampRampIntervalsSchema = z.object({
|
|
|
30
49
|
});
|
|
31
50
|
const UpdatePriceRampBodySchema = z.looseObject({
|
|
32
51
|
status: z.enum(['active', 'archived']).optional(),
|
|
33
|
-
ramp_intervals:
|
|
52
|
+
ramp_intervals: z
|
|
53
|
+
.union([
|
|
54
|
+
z.array(UpdatePriceRampRampIntervalsItemSchema.optional()),
|
|
55
|
+
UpdatePriceRampRampIntervalsSchema,
|
|
56
|
+
])
|
|
57
|
+
.optional(),
|
|
34
58
|
});
|
|
35
59
|
export { UpdatePriceRampBodySchema };
|
|
36
60
|
//PriceRamp.list
|
|
@@ -38,34 +62,75 @@ const ListPriceRampIdSchema = z.object({
|
|
|
38
62
|
is: z.string().min(1).optional(),
|
|
39
63
|
is_not: z.string().min(1).optional(),
|
|
40
64
|
starts_with: z.string().min(1).optional(),
|
|
41
|
-
in: z
|
|
42
|
-
|
|
65
|
+
in: z
|
|
66
|
+
.union([
|
|
67
|
+
z.array(z.string().optional()),
|
|
68
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
69
|
+
])
|
|
70
|
+
.optional(),
|
|
71
|
+
not_in: z
|
|
72
|
+
.union([
|
|
73
|
+
z.array(z.string().optional()),
|
|
74
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
75
|
+
])
|
|
76
|
+
.optional(),
|
|
43
77
|
});
|
|
44
78
|
const ListPriceRampItemPriceIdSchema = z.object({
|
|
45
79
|
is: z.string().min(1).optional(),
|
|
46
80
|
is_not: z.string().min(1).optional(),
|
|
47
81
|
starts_with: z.string().min(1).optional(),
|
|
48
|
-
in: z
|
|
49
|
-
|
|
82
|
+
in: z
|
|
83
|
+
.union([
|
|
84
|
+
z.array(z.string().optional()),
|
|
85
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
86
|
+
])
|
|
87
|
+
.optional(),
|
|
88
|
+
not_in: z
|
|
89
|
+
.union([
|
|
90
|
+
z.array(z.string().optional()),
|
|
91
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
92
|
+
])
|
|
93
|
+
.optional(),
|
|
50
94
|
});
|
|
51
95
|
const ListPriceRampStatusSchema = z.object({
|
|
52
96
|
is: z.enum(['active', 'archived']).optional(),
|
|
53
97
|
is_not: z.enum(['active', 'archived']).optional(),
|
|
54
|
-
in: z
|
|
55
|
-
|
|
98
|
+
in: z
|
|
99
|
+
.union([
|
|
100
|
+
z.array(z.enum(['active', 'archived']).optional()),
|
|
101
|
+
z.enum(['active', 'archived']),
|
|
102
|
+
])
|
|
103
|
+
.optional(),
|
|
104
|
+
not_in: z
|
|
105
|
+
.union([
|
|
106
|
+
z.array(z.enum(['active', 'archived']).optional()),
|
|
107
|
+
z.enum(['active', 'archived']),
|
|
108
|
+
])
|
|
109
|
+
.optional(),
|
|
56
110
|
});
|
|
57
111
|
const ListPriceRampUpdatedAtSchema = z.object({
|
|
58
|
-
after: z
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
112
|
+
after: z
|
|
113
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
114
|
+
.optional(),
|
|
115
|
+
before: z
|
|
116
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
117
|
+
.optional(),
|
|
118
|
+
on: z
|
|
119
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
120
|
+
.optional(),
|
|
121
|
+
between: z
|
|
122
|
+
.union([
|
|
123
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
124
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
125
|
+
])
|
|
126
|
+
.optional(),
|
|
62
127
|
});
|
|
63
128
|
const ListPriceRampBusinessEntityIdSchema = z.object({
|
|
64
|
-
is_present: z.enum(['true', 'false']).optional(),
|
|
65
129
|
is: z.string().min(1).optional(),
|
|
130
|
+
is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
66
131
|
});
|
|
67
132
|
const ListPriceRampIncludeSiteLevelResourcesSchema = z.object({
|
|
68
|
-
is: z.enum(['true', 'false']).optional(),
|
|
133
|
+
is: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
69
134
|
});
|
|
70
135
|
const ListPriceRampSortBySchema = z.looseObject({
|
|
71
136
|
asc: z.enum(['id', 'status', 'updated_at']).optional(),
|