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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Generated Zod schemas: CollectionsPaymentPromise
|
|
2
|
+
// Actions: listCollectionsPaymentPromises, createCollectionsPaymentPromise, updateCollectionsPaymentPromise
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//CollectionsPaymentPromise.listCollectionsPaymentPromises
|
|
6
|
+
const ListCollectionsPaymentPromisesCollectionsPaymentPromiseCustomerIdSchema = z.object({
|
|
7
|
+
is: z.string().min(1).optional(),
|
|
8
|
+
});
|
|
9
|
+
const ListCollectionsPaymentPromisesCollectionsPaymentPromiseInvoiceIdSchema = z.object({
|
|
10
|
+
is: z.string().min(1).optional(),
|
|
11
|
+
});
|
|
12
|
+
const ListCollectionsPaymentPromisesCollectionsPaymentPromiseStatusSchema = z.object({
|
|
13
|
+
is: z.enum(['active', 'fulfilled', 'broken', 'cancelled']).optional(),
|
|
14
|
+
});
|
|
15
|
+
const ListCollectionsPaymentPromisesCollectionsPaymentPromiseBodySchema = z.looseObject({
|
|
16
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
17
|
+
offset: z.string().max(1000).optional(),
|
|
18
|
+
customer_id: ListCollectionsPaymentPromisesCollectionsPaymentPromiseCustomerIdSchema.optional(),
|
|
19
|
+
invoice_id: ListCollectionsPaymentPromisesCollectionsPaymentPromiseInvoiceIdSchema.optional(),
|
|
20
|
+
status: ListCollectionsPaymentPromisesCollectionsPaymentPromiseStatusSchema.optional(),
|
|
21
|
+
});
|
|
22
|
+
export { ListCollectionsPaymentPromisesCollectionsPaymentPromiseBodySchema };
|
|
23
|
+
//CollectionsPaymentPromise.createCollectionsPaymentPromise
|
|
24
|
+
const CreateCollectionsPaymentPromiseCollectionsPaymentPromiseBodySchema = z.looseObject({
|
|
25
|
+
customer_id: z.string().max(100),
|
|
26
|
+
invoice_id: z.string().max(100).optional(),
|
|
27
|
+
amount: z.number().int(),
|
|
28
|
+
currency_code: z.string().max(3).optional(),
|
|
29
|
+
promised_on: z.number().int(),
|
|
30
|
+
reason: z.string().max(500).optional(),
|
|
31
|
+
promised_by: z.string().max(254).optional(),
|
|
32
|
+
});
|
|
33
|
+
export { CreateCollectionsPaymentPromiseCollectionsPaymentPromiseBodySchema };
|
|
34
|
+
//CollectionsPaymentPromise.updateCollectionsPaymentPromise
|
|
35
|
+
const UpdateCollectionsPaymentPromiseCollectionsPaymentPromiseBodySchema = z.looseObject({
|
|
36
|
+
promised_on: z.number().int().optional(),
|
|
37
|
+
reason: z.string().max(500).optional(),
|
|
38
|
+
promised_by: z.string().max(254).optional(),
|
|
39
|
+
});
|
|
40
|
+
export { UpdateCollectionsPaymentPromiseCollectionsPaymentPromiseBodySchema };
|
|
@@ -20,6 +20,7 @@ const CreateCommentBodySchema = z.looseObject({
|
|
|
20
20
|
'item',
|
|
21
21
|
'item_price',
|
|
22
22
|
'price_variant',
|
|
23
|
+
'task',
|
|
23
24
|
]),
|
|
24
25
|
entity_id: z.string().max(100),
|
|
25
26
|
notes: z.string().max(1000),
|
|
@@ -28,10 +29,21 @@ const CreateCommentBodySchema = z.looseObject({
|
|
|
28
29
|
export { CreateCommentBodySchema };
|
|
29
30
|
//Comment.list
|
|
30
31
|
const ListCommentCreatedAtSchema = z.object({
|
|
31
|
-
after: z
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
after: z
|
|
33
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
34
|
+
.optional(),
|
|
35
|
+
before: z
|
|
36
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
37
|
+
.optional(),
|
|
38
|
+
on: z
|
|
39
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
40
|
+
.optional(),
|
|
41
|
+
between: z
|
|
42
|
+
.union([
|
|
43
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
44
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
45
|
+
])
|
|
46
|
+
.optional(),
|
|
35
47
|
});
|
|
36
48
|
const ListCommentSortBySchema = z.looseObject({
|
|
37
49
|
asc: z.enum(['created_at']).optional(),
|
|
@@ -57,6 +69,7 @@ const ListCommentBodySchema = z.looseObject({
|
|
|
57
69
|
'item',
|
|
58
70
|
'item_price',
|
|
59
71
|
'price_variant',
|
|
72
|
+
'task',
|
|
60
73
|
])
|
|
61
74
|
.optional(),
|
|
62
75
|
entity_id: z.string().max(100).optional(),
|
|
@@ -39,11 +39,22 @@ const CreateCouponBodySchema = z.looseObject({
|
|
|
39
39
|
export { CreateCouponBodySchema };
|
|
40
40
|
//Coupon.createForItems
|
|
41
41
|
const CreateForItemsCouponMetaDataSchema = z.looseObject({});
|
|
42
|
+
const CreateForItemsCouponItemConstraintsItemSchema = z.object({
|
|
43
|
+
constraint: z.enum(['none', 'all', 'specific', 'criteria']),
|
|
44
|
+
item_type: z.enum(['plan', 'addon', 'charge']),
|
|
45
|
+
item_price_ids: z.array(z.string().optional()).optional(),
|
|
46
|
+
});
|
|
42
47
|
const CreateForItemsCouponItemConstraintsSchema = z.object({
|
|
43
48
|
constraint: z.array(z.enum(['none', 'all', 'specific', 'criteria']).optional()),
|
|
44
49
|
item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()),
|
|
45
50
|
item_price_ids: z.array(z.array(z.string().optional()).optional()).optional(),
|
|
46
51
|
});
|
|
52
|
+
const CreateForItemsCouponItemConstraintCriteriaItemSchema = z.object({
|
|
53
|
+
item_type: z.enum(['plan', 'addon', 'charge']).optional(),
|
|
54
|
+
item_family_ids: z.array(z.string().optional()).optional(),
|
|
55
|
+
currencies: z.array(z.string().optional()).optional(),
|
|
56
|
+
item_price_periods: z.array(z.string().optional()).optional(),
|
|
57
|
+
});
|
|
47
58
|
const CreateForItemsCouponItemConstraintCriteriaSchema = z.object({
|
|
48
59
|
item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(),
|
|
49
60
|
item_family_ids: z
|
|
@@ -54,6 +65,16 @@ const CreateForItemsCouponItemConstraintCriteriaSchema = z.object({
|
|
|
54
65
|
.array(z.array(z.string().optional()).optional())
|
|
55
66
|
.optional(),
|
|
56
67
|
});
|
|
68
|
+
const CreateForItemsCouponCouponConstraintsItemSchema = z.object({
|
|
69
|
+
entity_type: z.enum(['customer']),
|
|
70
|
+
type: z.enum([
|
|
71
|
+
'max_redemptions',
|
|
72
|
+
'unique_by',
|
|
73
|
+
'existing_customer',
|
|
74
|
+
'new_customer',
|
|
75
|
+
]),
|
|
76
|
+
value: z.string().max(65000).optional(),
|
|
77
|
+
});
|
|
57
78
|
const CreateForItemsCouponCouponConstraintsSchema = z.object({
|
|
58
79
|
entity_type: z.array(z.enum(['customer']).optional()),
|
|
59
80
|
type: z.array(z
|
|
@@ -94,18 +115,44 @@ const CreateForItemsCouponBodySchema = z.looseObject({
|
|
|
94
115
|
period: z.number().int().min(1).optional(),
|
|
95
116
|
period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
96
117
|
status: z.enum(['active', 'archived']).optional(),
|
|
97
|
-
item_constraints:
|
|
98
|
-
|
|
99
|
-
|
|
118
|
+
item_constraints: z
|
|
119
|
+
.union([
|
|
120
|
+
z.array(CreateForItemsCouponItemConstraintsItemSchema.optional()),
|
|
121
|
+
CreateForItemsCouponItemConstraintsSchema,
|
|
122
|
+
])
|
|
123
|
+
.optional(),
|
|
124
|
+
item_constraint_criteria: z
|
|
125
|
+
.union([
|
|
126
|
+
z.array(CreateForItemsCouponItemConstraintCriteriaItemSchema.optional()),
|
|
127
|
+
CreateForItemsCouponItemConstraintCriteriaSchema,
|
|
128
|
+
])
|
|
129
|
+
.optional(),
|
|
130
|
+
coupon_constraints: z
|
|
131
|
+
.union([
|
|
132
|
+
z.array(CreateForItemsCouponCouponConstraintsItemSchema.optional()),
|
|
133
|
+
CreateForItemsCouponCouponConstraintsSchema,
|
|
134
|
+
])
|
|
135
|
+
.optional(),
|
|
100
136
|
});
|
|
101
137
|
export { CreateForItemsCouponBodySchema };
|
|
102
138
|
//Coupon.updateForItems
|
|
103
139
|
const UpdateForItemsCouponMetaDataSchema = z.looseObject({});
|
|
140
|
+
const UpdateForItemsCouponItemConstraintsItemSchema = z.object({
|
|
141
|
+
constraint: z.enum(['none', 'all', 'specific', 'criteria']),
|
|
142
|
+
item_type: z.enum(['plan', 'addon', 'charge']),
|
|
143
|
+
item_price_ids: z.array(z.string().optional()).optional(),
|
|
144
|
+
});
|
|
104
145
|
const UpdateForItemsCouponItemConstraintsSchema = z.object({
|
|
105
146
|
constraint: z.array(z.enum(['none', 'all', 'specific', 'criteria']).optional()),
|
|
106
147
|
item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()),
|
|
107
148
|
item_price_ids: z.array(z.array(z.string().optional()).optional()).optional(),
|
|
108
149
|
});
|
|
150
|
+
const UpdateForItemsCouponItemConstraintCriteriaItemSchema = z.object({
|
|
151
|
+
item_type: z.enum(['plan', 'addon', 'charge']).optional(),
|
|
152
|
+
item_family_ids: z.array(z.string().optional()).optional(),
|
|
153
|
+
currencies: z.array(z.string().optional()).optional(),
|
|
154
|
+
item_price_periods: z.array(z.string().optional()).optional(),
|
|
155
|
+
});
|
|
109
156
|
const UpdateForItemsCouponItemConstraintCriteriaSchema = z.object({
|
|
110
157
|
item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(),
|
|
111
158
|
item_family_ids: z
|
|
@@ -116,6 +163,16 @@ const UpdateForItemsCouponItemConstraintCriteriaSchema = z.object({
|
|
|
116
163
|
.array(z.array(z.string().optional()).optional())
|
|
117
164
|
.optional(),
|
|
118
165
|
});
|
|
166
|
+
const UpdateForItemsCouponCouponConstraintsItemSchema = z.object({
|
|
167
|
+
entity_type: z.enum(['customer']),
|
|
168
|
+
type: z.enum([
|
|
169
|
+
'max_redemptions',
|
|
170
|
+
'unique_by',
|
|
171
|
+
'existing_customer',
|
|
172
|
+
'new_customer',
|
|
173
|
+
]),
|
|
174
|
+
value: z.string().max(65000).optional(),
|
|
175
|
+
});
|
|
119
176
|
const UpdateForItemsCouponCouponConstraintsSchema = z.object({
|
|
120
177
|
entity_type: z.array(z.enum(['customer']).optional()),
|
|
121
178
|
type: z.array(z
|
|
@@ -156,9 +213,24 @@ const UpdateForItemsCouponBodySchema = z.looseObject({
|
|
|
156
213
|
included_in_mrr: z.boolean().optional(),
|
|
157
214
|
period: z.number().int().min(1).optional(),
|
|
158
215
|
period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
159
|
-
item_constraints:
|
|
160
|
-
|
|
161
|
-
|
|
216
|
+
item_constraints: z
|
|
217
|
+
.union([
|
|
218
|
+
z.array(UpdateForItemsCouponItemConstraintsItemSchema.optional()),
|
|
219
|
+
UpdateForItemsCouponItemConstraintsSchema,
|
|
220
|
+
])
|
|
221
|
+
.optional(),
|
|
222
|
+
item_constraint_criteria: z
|
|
223
|
+
.union([
|
|
224
|
+
z.array(UpdateForItemsCouponItemConstraintCriteriaItemSchema.optional()),
|
|
225
|
+
UpdateForItemsCouponItemConstraintCriteriaSchema,
|
|
226
|
+
])
|
|
227
|
+
.optional(),
|
|
228
|
+
coupon_constraints: z
|
|
229
|
+
.union([
|
|
230
|
+
z.array(UpdateForItemsCouponCouponConstraintsItemSchema.optional()),
|
|
231
|
+
UpdateForItemsCouponCouponConstraintsSchema,
|
|
232
|
+
])
|
|
233
|
+
.optional(),
|
|
162
234
|
});
|
|
163
235
|
export { UpdateForItemsCouponBodySchema };
|
|
164
236
|
//Coupon.list
|
|
@@ -166,36 +238,88 @@ const ListCouponIdSchema = z.object({
|
|
|
166
238
|
is: z.string().min(1).optional(),
|
|
167
239
|
is_not: z.string().min(1).optional(),
|
|
168
240
|
starts_with: z.string().min(1).optional(),
|
|
169
|
-
in: z
|
|
170
|
-
|
|
241
|
+
in: z
|
|
242
|
+
.union([
|
|
243
|
+
z.array(z.string().optional()),
|
|
244
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
245
|
+
])
|
|
246
|
+
.optional(),
|
|
247
|
+
not_in: z
|
|
248
|
+
.union([
|
|
249
|
+
z.array(z.string().optional()),
|
|
250
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
251
|
+
])
|
|
252
|
+
.optional(),
|
|
171
253
|
});
|
|
172
254
|
const ListCouponNameSchema = z.object({
|
|
173
255
|
is: z.string().min(1).optional(),
|
|
174
256
|
is_not: z.string().min(1).optional(),
|
|
175
257
|
starts_with: z.string().min(1).optional(),
|
|
176
|
-
in: z
|
|
177
|
-
|
|
258
|
+
in: z
|
|
259
|
+
.union([
|
|
260
|
+
z.array(z.string().optional()),
|
|
261
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
262
|
+
])
|
|
263
|
+
.optional(),
|
|
264
|
+
not_in: z
|
|
265
|
+
.union([
|
|
266
|
+
z.array(z.string().optional()),
|
|
267
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
268
|
+
])
|
|
269
|
+
.optional(),
|
|
178
270
|
});
|
|
179
271
|
const ListCouponDiscountTypeSchema = z.object({
|
|
180
272
|
is: z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional(),
|
|
181
273
|
is_not: z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional(),
|
|
182
|
-
in: z
|
|
183
|
-
|
|
274
|
+
in: z
|
|
275
|
+
.union([
|
|
276
|
+
z.array(z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional()),
|
|
277
|
+
z.enum(['fixed_amount', 'percentage', 'offer_quantity']),
|
|
278
|
+
])
|
|
279
|
+
.optional(),
|
|
280
|
+
not_in: z
|
|
281
|
+
.union([
|
|
282
|
+
z.array(z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional()),
|
|
283
|
+
z.enum(['fixed_amount', 'percentage', 'offer_quantity']),
|
|
284
|
+
])
|
|
285
|
+
.optional(),
|
|
184
286
|
});
|
|
185
287
|
const ListCouponDurationTypeSchema = z.object({
|
|
186
288
|
is: z.enum(['one_time', 'forever', 'limited_period']).optional(),
|
|
187
289
|
is_not: z.enum(['one_time', 'forever', 'limited_period']).optional(),
|
|
188
|
-
in: z
|
|
189
|
-
|
|
290
|
+
in: z
|
|
291
|
+
.union([
|
|
292
|
+
z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
|
|
293
|
+
z.enum(['one_time', 'forever', 'limited_period']),
|
|
294
|
+
])
|
|
295
|
+
.optional(),
|
|
296
|
+
not_in: z
|
|
297
|
+
.union([
|
|
298
|
+
z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
|
|
299
|
+
z.enum(['one_time', 'forever', 'limited_period']),
|
|
300
|
+
])
|
|
301
|
+
.optional(),
|
|
190
302
|
});
|
|
191
303
|
const ListCouponStatusSchema = z.object({
|
|
192
304
|
is: z.enum(['active', 'expired', 'archived', 'deleted', 'future']).optional(),
|
|
193
305
|
is_not: z
|
|
194
306
|
.enum(['active', 'expired', 'archived', 'deleted', 'future'])
|
|
195
307
|
.optional(),
|
|
196
|
-
in: z
|
|
308
|
+
in: z
|
|
309
|
+
.union([
|
|
310
|
+
z.array(z
|
|
311
|
+
.enum(['active', 'expired', 'archived', 'deleted', 'future'])
|
|
312
|
+
.optional()),
|
|
313
|
+
z.enum(['active', 'expired', 'archived', 'deleted', 'future']),
|
|
314
|
+
])
|
|
315
|
+
.optional(),
|
|
197
316
|
not_in: z
|
|
198
|
-
.
|
|
317
|
+
.union([
|
|
318
|
+
z.array(z
|
|
319
|
+
.enum(['active', 'expired', 'archived', 'deleted', 'future'])
|
|
320
|
+
.optional()),
|
|
321
|
+
z.enum(['active', 'expired', 'archived', 'deleted', 'future']),
|
|
322
|
+
])
|
|
199
323
|
.optional(),
|
|
200
324
|
});
|
|
201
325
|
const ListCouponApplyOnSchema = z.object({
|
|
@@ -216,33 +340,75 @@ const ListCouponApplyOnSchema = z.object({
|
|
|
216
340
|
])
|
|
217
341
|
.optional(),
|
|
218
342
|
in: z
|
|
219
|
-
.
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
343
|
+
.union([
|
|
344
|
+
z.array(z
|
|
345
|
+
.enum([
|
|
346
|
+
'invoice_amount',
|
|
347
|
+
'specified_items_total',
|
|
348
|
+
'each_specified_item',
|
|
349
|
+
'each_unit_of_specified_items',
|
|
350
|
+
])
|
|
351
|
+
.optional()),
|
|
352
|
+
z.enum([
|
|
353
|
+
'invoice_amount',
|
|
354
|
+
'specified_items_total',
|
|
355
|
+
'each_specified_item',
|
|
356
|
+
'each_unit_of_specified_items',
|
|
357
|
+
]),
|
|
224
358
|
])
|
|
225
359
|
.optional(),
|
|
226
360
|
not_in: z
|
|
227
|
-
.
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
361
|
+
.union([
|
|
362
|
+
z.array(z
|
|
363
|
+
.enum([
|
|
364
|
+
'invoice_amount',
|
|
365
|
+
'specified_items_total',
|
|
366
|
+
'each_specified_item',
|
|
367
|
+
'each_unit_of_specified_items',
|
|
368
|
+
])
|
|
369
|
+
.optional()),
|
|
370
|
+
z.enum([
|
|
371
|
+
'invoice_amount',
|
|
372
|
+
'specified_items_total',
|
|
373
|
+
'each_specified_item',
|
|
374
|
+
'each_unit_of_specified_items',
|
|
375
|
+
]),
|
|
232
376
|
])
|
|
233
377
|
.optional(),
|
|
234
378
|
});
|
|
235
379
|
const ListCouponCreatedAtSchema = z.object({
|
|
236
|
-
after: z
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
380
|
+
after: z
|
|
381
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
382
|
+
.optional(),
|
|
383
|
+
before: z
|
|
384
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
385
|
+
.optional(),
|
|
386
|
+
on: z
|
|
387
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
388
|
+
.optional(),
|
|
389
|
+
between: z
|
|
390
|
+
.union([
|
|
391
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
392
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
393
|
+
])
|
|
394
|
+
.optional(),
|
|
240
395
|
});
|
|
241
396
|
const ListCouponUpdatedAtSchema = z.object({
|
|
242
|
-
after: z
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
397
|
+
after: z
|
|
398
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
399
|
+
.optional(),
|
|
400
|
+
before: z
|
|
401
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
402
|
+
.optional(),
|
|
403
|
+
on: z
|
|
404
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
405
|
+
.optional(),
|
|
406
|
+
between: z
|
|
407
|
+
.union([
|
|
408
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
409
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
410
|
+
])
|
|
411
|
+
.optional(),
|
|
246
412
|
});
|
|
247
413
|
const ListCouponSortBySchema = z.looseObject({
|
|
248
414
|
asc: z.enum(['created_at']).optional(),
|
|
@@ -252,12 +418,27 @@ const ListCouponCurrencyCodeSchema = z.object({
|
|
|
252
418
|
is: z.string().min(1).optional(),
|
|
253
419
|
is_not: z.string().min(1).optional(),
|
|
254
420
|
starts_with: z.string().min(1).optional(),
|
|
255
|
-
in: z
|
|
256
|
-
|
|
421
|
+
in: z
|
|
422
|
+
.union([
|
|
423
|
+
z.array(z.string().optional()),
|
|
424
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
425
|
+
])
|
|
426
|
+
.optional(),
|
|
427
|
+
not_in: z
|
|
428
|
+
.union([
|
|
429
|
+
z.array(z.string().optional()),
|
|
430
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
431
|
+
])
|
|
432
|
+
.optional(),
|
|
257
433
|
});
|
|
258
434
|
const ListCouponApplicableItemPriceIdsSchema = z.object({
|
|
435
|
+
in: z
|
|
436
|
+
.union([
|
|
437
|
+
z.array(z.string().optional()),
|
|
438
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
439
|
+
])
|
|
440
|
+
.optional(),
|
|
259
441
|
is: z.string().min(1).optional(),
|
|
260
|
-
in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
261
442
|
});
|
|
262
443
|
const ListCouponBodySchema = z.looseObject({
|
|
263
444
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -14,15 +14,35 @@ const ListCouponCodeCodeSchema = z.object({
|
|
|
14
14
|
is: z.string().min(1).optional(),
|
|
15
15
|
is_not: z.string().min(1).optional(),
|
|
16
16
|
starts_with: z.string().min(1).optional(),
|
|
17
|
-
in: z
|
|
18
|
-
|
|
17
|
+
in: z
|
|
18
|
+
.union([
|
|
19
|
+
z.array(z.string().optional()),
|
|
20
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
21
|
+
])
|
|
22
|
+
.optional(),
|
|
23
|
+
not_in: z
|
|
24
|
+
.union([
|
|
25
|
+
z.array(z.string().optional()),
|
|
26
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
27
|
+
])
|
|
28
|
+
.optional(),
|
|
19
29
|
});
|
|
20
30
|
const ListCouponCodeCouponIdSchema = z.object({
|
|
21
31
|
is: z.string().min(1).optional(),
|
|
22
32
|
is_not: z.string().min(1).optional(),
|
|
23
33
|
starts_with: z.string().min(1).optional(),
|
|
24
|
-
in: z
|
|
25
|
-
|
|
34
|
+
in: z
|
|
35
|
+
.union([
|
|
36
|
+
z.array(z.string().optional()),
|
|
37
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
38
|
+
])
|
|
39
|
+
.optional(),
|
|
40
|
+
not_in: z
|
|
41
|
+
.union([
|
|
42
|
+
z.array(z.string().optional()),
|
|
43
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
44
|
+
])
|
|
45
|
+
.optional(),
|
|
26
46
|
});
|
|
27
47
|
const ListCouponCodeCouponSetNameSchema = z.object({
|
|
28
48
|
is: z.string().min(1).optional(),
|
|
@@ -32,8 +52,18 @@ const ListCouponCodeCouponSetNameSchema = z.object({
|
|
|
32
52
|
const ListCouponCodeStatusSchema = z.object({
|
|
33
53
|
is: z.enum(['not_redeemed', 'redeemed', 'archived']).optional(),
|
|
34
54
|
is_not: z.enum(['not_redeemed', 'redeemed', 'archived']).optional(),
|
|
35
|
-
in: z
|
|
36
|
-
|
|
55
|
+
in: z
|
|
56
|
+
.union([
|
|
57
|
+
z.array(z.enum(['not_redeemed', 'redeemed', 'archived']).optional()),
|
|
58
|
+
z.enum(['not_redeemed', 'redeemed', 'archived']),
|
|
59
|
+
])
|
|
60
|
+
.optional(),
|
|
61
|
+
not_in: z
|
|
62
|
+
.union([
|
|
63
|
+
z.array(z.enum(['not_redeemed', 'redeemed', 'archived']).optional()),
|
|
64
|
+
z.enum(['not_redeemed', 'redeemed', 'archived']),
|
|
65
|
+
])
|
|
66
|
+
.optional(),
|
|
37
67
|
});
|
|
38
68
|
const ListCouponCodeBodySchema = z.looseObject({
|
|
39
69
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -21,49 +21,130 @@ const ListCouponSetIdSchema = z.object({
|
|
|
21
21
|
is: z.string().min(1).optional(),
|
|
22
22
|
is_not: z.string().min(1).optional(),
|
|
23
23
|
starts_with: z.string().min(1).optional(),
|
|
24
|
-
in: z
|
|
25
|
-
|
|
24
|
+
in: z
|
|
25
|
+
.union([
|
|
26
|
+
z.array(z.string().optional()),
|
|
27
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
28
|
+
])
|
|
29
|
+
.optional(),
|
|
30
|
+
not_in: z
|
|
31
|
+
.union([
|
|
32
|
+
z.array(z.string().optional()),
|
|
33
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
34
|
+
])
|
|
35
|
+
.optional(),
|
|
26
36
|
});
|
|
27
37
|
const ListCouponSetNameSchema = z.object({
|
|
28
38
|
is: z.string().min(1).optional(),
|
|
29
39
|
is_not: z.string().min(1).optional(),
|
|
30
40
|
starts_with: z.string().min(1).optional(),
|
|
31
|
-
in: z
|
|
32
|
-
|
|
41
|
+
in: z
|
|
42
|
+
.union([
|
|
43
|
+
z.array(z.string().optional()),
|
|
44
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
45
|
+
])
|
|
46
|
+
.optional(),
|
|
47
|
+
not_in: z
|
|
48
|
+
.union([
|
|
49
|
+
z.array(z.string().optional()),
|
|
50
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
51
|
+
])
|
|
52
|
+
.optional(),
|
|
33
53
|
});
|
|
34
54
|
const ListCouponSetCouponIdSchema = z.object({
|
|
35
55
|
is: z.string().min(1).optional(),
|
|
36
56
|
is_not: z.string().min(1).optional(),
|
|
37
57
|
starts_with: z.string().min(1).optional(),
|
|
38
|
-
in: z
|
|
39
|
-
|
|
58
|
+
in: z
|
|
59
|
+
.union([
|
|
60
|
+
z.array(z.string().optional()),
|
|
61
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
62
|
+
])
|
|
63
|
+
.optional(),
|
|
64
|
+
not_in: z
|
|
65
|
+
.union([
|
|
66
|
+
z.array(z.string().optional()),
|
|
67
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
68
|
+
])
|
|
69
|
+
.optional(),
|
|
40
70
|
});
|
|
41
71
|
const ListCouponSetTotalCountSchema = z.object({
|
|
42
|
-
is: z
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
72
|
+
is: z
|
|
73
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
74
|
+
.optional(),
|
|
75
|
+
is_not: z
|
|
76
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
77
|
+
.optional(),
|
|
78
|
+
lt: z
|
|
79
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
80
|
+
.optional(),
|
|
81
|
+
lte: z
|
|
82
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
83
|
+
.optional(),
|
|
84
|
+
gt: z
|
|
85
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
86
|
+
.optional(),
|
|
87
|
+
gte: z
|
|
88
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
89
|
+
.optional(),
|
|
90
|
+
between: z
|
|
91
|
+
.union([
|
|
92
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
93
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
94
|
+
])
|
|
95
|
+
.optional(),
|
|
49
96
|
});
|
|
50
97
|
const ListCouponSetRedeemedCountSchema = z.object({
|
|
51
|
-
is: z
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
98
|
+
is: z
|
|
99
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
100
|
+
.optional(),
|
|
101
|
+
is_not: z
|
|
102
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
103
|
+
.optional(),
|
|
104
|
+
lt: z
|
|
105
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
106
|
+
.optional(),
|
|
107
|
+
lte: z
|
|
108
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
109
|
+
.optional(),
|
|
110
|
+
gt: z
|
|
111
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
112
|
+
.optional(),
|
|
113
|
+
gte: z
|
|
114
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
115
|
+
.optional(),
|
|
116
|
+
between: z
|
|
117
|
+
.union([
|
|
118
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
119
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
120
|
+
])
|
|
121
|
+
.optional(),
|
|
58
122
|
});
|
|
59
123
|
const ListCouponSetArchivedCountSchema = z.object({
|
|
60
|
-
is: z
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
124
|
+
is: z
|
|
125
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
126
|
+
.optional(),
|
|
127
|
+
is_not: z
|
|
128
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
129
|
+
.optional(),
|
|
130
|
+
lt: z
|
|
131
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
132
|
+
.optional(),
|
|
133
|
+
lte: z
|
|
134
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
135
|
+
.optional(),
|
|
136
|
+
gt: z
|
|
137
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
138
|
+
.optional(),
|
|
139
|
+
gte: z
|
|
140
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
141
|
+
.optional(),
|
|
142
|
+
between: z
|
|
143
|
+
.union([
|
|
144
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
145
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
146
|
+
])
|
|
147
|
+
.optional(),
|
|
67
148
|
});
|
|
68
149
|
const ListCouponSetBodySchema = z.looseObject({
|
|
69
150
|
limit: z.number().int().min(1).max(100).optional(),
|