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
|
@@ -61,27 +61,67 @@ const ListAttachedItemIdSchema = zod_1.z.object({
|
|
|
61
61
|
is: zod_1.z.string().min(1).optional(),
|
|
62
62
|
is_not: zod_1.z.string().min(1).optional(),
|
|
63
63
|
starts_with: zod_1.z.string().min(1).optional(),
|
|
64
|
-
in: zod_1.z
|
|
65
|
-
|
|
64
|
+
in: zod_1.z
|
|
65
|
+
.union([
|
|
66
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
67
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
68
|
+
])
|
|
69
|
+
.optional(),
|
|
70
|
+
not_in: zod_1.z
|
|
71
|
+
.union([
|
|
72
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
73
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
74
|
+
])
|
|
75
|
+
.optional(),
|
|
66
76
|
});
|
|
67
77
|
const ListAttachedItemItemIdSchema = zod_1.z.object({
|
|
68
78
|
is: zod_1.z.string().min(1).optional(),
|
|
69
79
|
is_not: zod_1.z.string().min(1).optional(),
|
|
70
80
|
starts_with: zod_1.z.string().min(1).optional(),
|
|
71
|
-
in: zod_1.z
|
|
72
|
-
|
|
81
|
+
in: zod_1.z
|
|
82
|
+
.union([
|
|
83
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
84
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
85
|
+
])
|
|
86
|
+
.optional(),
|
|
87
|
+
not_in: zod_1.z
|
|
88
|
+
.union([
|
|
89
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
90
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
91
|
+
])
|
|
92
|
+
.optional(),
|
|
73
93
|
});
|
|
74
94
|
const ListAttachedItemTypeSchema = zod_1.z.object({
|
|
75
95
|
is: zod_1.z.enum(['recommended', 'mandatory', 'optional']).optional(),
|
|
76
96
|
is_not: zod_1.z.enum(['recommended', 'mandatory', 'optional']).optional(),
|
|
77
|
-
in: zod_1.z
|
|
78
|
-
|
|
97
|
+
in: zod_1.z
|
|
98
|
+
.union([
|
|
99
|
+
zod_1.z.array(zod_1.z.enum(['recommended', 'mandatory', 'optional']).optional()),
|
|
100
|
+
zod_1.z.enum(['recommended', 'mandatory', 'optional']),
|
|
101
|
+
])
|
|
102
|
+
.optional(),
|
|
103
|
+
not_in: zod_1.z
|
|
104
|
+
.union([
|
|
105
|
+
zod_1.z.array(zod_1.z.enum(['recommended', 'mandatory', 'optional']).optional()),
|
|
106
|
+
zod_1.z.enum(['recommended', 'mandatory', 'optional']),
|
|
107
|
+
])
|
|
108
|
+
.optional(),
|
|
79
109
|
});
|
|
80
110
|
const ListAttachedItemItemTypeSchema = zod_1.z.object({
|
|
81
111
|
is: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
|
|
82
112
|
is_not: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
|
|
83
|
-
in: zod_1.z
|
|
84
|
-
|
|
113
|
+
in: zod_1.z
|
|
114
|
+
.union([
|
|
115
|
+
zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()),
|
|
116
|
+
zod_1.z.enum(['plan', 'addon', 'charge']),
|
|
117
|
+
])
|
|
118
|
+
.optional(),
|
|
119
|
+
not_in: zod_1.z
|
|
120
|
+
.union([
|
|
121
|
+
zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()),
|
|
122
|
+
zod_1.z.enum(['plan', 'addon', 'charge']),
|
|
123
|
+
])
|
|
124
|
+
.optional(),
|
|
85
125
|
});
|
|
86
126
|
const ListAttachedItemChargeOnEventSchema = zod_1.z.object({
|
|
87
127
|
is: zod_1.z
|
|
@@ -105,31 +145,66 @@ const ListAttachedItemChargeOnEventSchema = zod_1.z.object({
|
|
|
105
145
|
])
|
|
106
146
|
.optional(),
|
|
107
147
|
in: zod_1.z
|
|
108
|
-
.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
148
|
+
.union([
|
|
149
|
+
zod_1.z.array(zod_1.z
|
|
150
|
+
.enum([
|
|
151
|
+
'subscription_creation',
|
|
152
|
+
'subscription_trial_start',
|
|
153
|
+
'plan_activation',
|
|
154
|
+
'subscription_activation',
|
|
155
|
+
'contract_termination',
|
|
156
|
+
'on_demand',
|
|
157
|
+
])
|
|
158
|
+
.optional()),
|
|
159
|
+
zod_1.z.enum([
|
|
160
|
+
'subscription_creation',
|
|
161
|
+
'subscription_trial_start',
|
|
162
|
+
'plan_activation',
|
|
163
|
+
'subscription_activation',
|
|
164
|
+
'contract_termination',
|
|
165
|
+
'on_demand',
|
|
166
|
+
]),
|
|
115
167
|
])
|
|
116
168
|
.optional(),
|
|
117
169
|
not_in: zod_1.z
|
|
118
|
-
.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
170
|
+
.union([
|
|
171
|
+
zod_1.z.array(zod_1.z
|
|
172
|
+
.enum([
|
|
173
|
+
'subscription_creation',
|
|
174
|
+
'subscription_trial_start',
|
|
175
|
+
'plan_activation',
|
|
176
|
+
'subscription_activation',
|
|
177
|
+
'contract_termination',
|
|
178
|
+
'on_demand',
|
|
179
|
+
])
|
|
180
|
+
.optional()),
|
|
181
|
+
zod_1.z.enum([
|
|
182
|
+
'subscription_creation',
|
|
183
|
+
'subscription_trial_start',
|
|
184
|
+
'plan_activation',
|
|
185
|
+
'subscription_activation',
|
|
186
|
+
'contract_termination',
|
|
187
|
+
'on_demand',
|
|
188
|
+
]),
|
|
125
189
|
])
|
|
126
190
|
.optional(),
|
|
127
191
|
});
|
|
128
192
|
const ListAttachedItemUpdatedAtSchema = zod_1.z.object({
|
|
129
|
-
after: zod_1.z
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
193
|
+
after: zod_1.z
|
|
194
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
195
|
+
.optional(),
|
|
196
|
+
before: zod_1.z
|
|
197
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
198
|
+
.optional(),
|
|
199
|
+
on: zod_1.z
|
|
200
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
201
|
+
.optional(),
|
|
202
|
+
between: zod_1.z
|
|
203
|
+
.union([
|
|
204
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
205
|
+
zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
206
|
+
])
|
|
207
|
+
.optional(),
|
|
133
208
|
});
|
|
134
209
|
const ListAttachedItemBodySchema = zod_1.z.looseObject({
|
|
135
210
|
limit: zod_1.z.number().int().min(1).max(100).optional(),
|
|
@@ -16,7 +16,7 @@ const ListBusinessEntityNameSchema = zod_1.z.object({
|
|
|
16
16
|
is: zod_1.z.string().min(1).optional(),
|
|
17
17
|
is_not: zod_1.z.string().min(1).optional(),
|
|
18
18
|
starts_with: zod_1.z.string().min(1).optional(),
|
|
19
|
-
is_present: zod_1.z.enum(['true', 'false']).optional(),
|
|
19
|
+
is_present: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
|
|
20
20
|
});
|
|
21
21
|
const ListBusinessEntityBodySchema = zod_1.z.looseObject({
|
|
22
22
|
limit: zod_1.z.number().int().min(1).max(100).optional(),
|
|
@@ -51,10 +51,21 @@ const GetTransfersBusinessEntityActiveResourceIdSchema = zod_1.z.object({
|
|
|
51
51
|
is: zod_1.z.string().min(1).optional(),
|
|
52
52
|
});
|
|
53
53
|
const GetTransfersBusinessEntityCreatedAtSchema = zod_1.z.object({
|
|
54
|
-
after: zod_1.z
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
after: zod_1.z
|
|
55
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
56
|
+
.optional(),
|
|
57
|
+
before: zod_1.z
|
|
58
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
59
|
+
.optional(),
|
|
60
|
+
on: zod_1.z
|
|
61
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
62
|
+
.optional(),
|
|
63
|
+
between: zod_1.z
|
|
64
|
+
.union([
|
|
65
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
66
|
+
zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
67
|
+
])
|
|
68
|
+
.optional(),
|
|
58
69
|
});
|
|
59
70
|
const GetTransfersBusinessEntitySortBySchema = zod_1.z.looseObject({
|
|
60
71
|
asc: zod_1.z.enum(['created_at']).optional(),
|
|
@@ -28,10 +28,10 @@ const UpdateDraftBusinessRuleBodySchema = zod_1.z.looseObject({
|
|
|
28
28
|
exports.UpdateDraftBusinessRuleBodySchema = UpdateDraftBusinessRuleBodySchema;
|
|
29
29
|
//BusinessRule.list
|
|
30
30
|
const ListBusinessRuleDraftSchema = zod_1.z.object({
|
|
31
|
-
is: zod_1.z.enum(['true', 'false']).optional(),
|
|
31
|
+
is: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
|
|
32
32
|
});
|
|
33
33
|
const ListBusinessRuleActiveSchema = zod_1.z.object({
|
|
34
|
-
is: zod_1.z.enum(['true', 'false']).optional(),
|
|
34
|
+
is: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
|
|
35
35
|
});
|
|
36
36
|
const ListBusinessRuleBodySchema = zod_1.z.looseObject({
|
|
37
37
|
limit: zod_1.z.number().int().min(1).max(100).optional(),
|
|
@@ -48,7 +48,7 @@ const RemoveRulesBusinessRulesetBodySchema = zod_1.z.looseObject({
|
|
|
48
48
|
exports.RemoveRulesBusinessRulesetBodySchema = RemoveRulesBusinessRulesetBodySchema;
|
|
49
49
|
//BusinessRuleset.listRules
|
|
50
50
|
const ListRulesBusinessRulesetActiveSchema = zod_1.z.object({
|
|
51
|
-
is: zod_1.z.enum(['true', 'false']).optional(),
|
|
51
|
+
is: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
|
|
52
52
|
});
|
|
53
53
|
const ListRulesBusinessRulesetBodySchema = zod_1.z.looseObject({
|
|
54
54
|
limit: zod_1.z.number().int().min(1).max(100).optional(),
|
|
@@ -58,7 +58,7 @@ const ListRulesBusinessRulesetBodySchema = zod_1.z.looseObject({
|
|
|
58
58
|
exports.ListRulesBusinessRulesetBodySchema = ListRulesBusinessRulesetBodySchema;
|
|
59
59
|
//BusinessRuleset.list
|
|
60
60
|
const ListBusinessRulesetActiveSchema = zod_1.z.object({
|
|
61
|
-
is: zod_1.z.enum(['true', 'false']).optional(),
|
|
61
|
+
is: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
|
|
62
62
|
});
|
|
63
63
|
const ListBusinessRulesetBodySchema = zod_1.z.looseObject({
|
|
64
64
|
limit: zod_1.z.number().int().min(1).max(100).optional(),
|
|
@@ -32,10 +32,21 @@ const CreateCommentBodySchema = zod_1.z.looseObject({
|
|
|
32
32
|
exports.CreateCommentBodySchema = CreateCommentBodySchema;
|
|
33
33
|
//Comment.list
|
|
34
34
|
const ListCommentCreatedAtSchema = zod_1.z.object({
|
|
35
|
-
after: zod_1.z
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
after: zod_1.z
|
|
36
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
37
|
+
.optional(),
|
|
38
|
+
before: zod_1.z
|
|
39
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
40
|
+
.optional(),
|
|
41
|
+
on: zod_1.z
|
|
42
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
43
|
+
.optional(),
|
|
44
|
+
between: zod_1.z
|
|
45
|
+
.union([
|
|
46
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
47
|
+
zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
48
|
+
])
|
|
49
|
+
.optional(),
|
|
39
50
|
});
|
|
40
51
|
const ListCommentSortBySchema = zod_1.z.looseObject({
|
|
41
52
|
asc: zod_1.z.enum(['created_at']).optional(),
|
|
@@ -42,11 +42,22 @@ const CreateCouponBodySchema = zod_1.z.looseObject({
|
|
|
42
42
|
exports.CreateCouponBodySchema = CreateCouponBodySchema;
|
|
43
43
|
//Coupon.createForItems
|
|
44
44
|
const CreateForItemsCouponMetaDataSchema = zod_1.z.looseObject({});
|
|
45
|
+
const CreateForItemsCouponItemConstraintsItemSchema = zod_1.z.object({
|
|
46
|
+
constraint: zod_1.z.enum(['none', 'all', 'specific', 'criteria']),
|
|
47
|
+
item_type: zod_1.z.enum(['plan', 'addon', 'charge']),
|
|
48
|
+
item_price_ids: zod_1.z.array(zod_1.z.string().optional()).optional(),
|
|
49
|
+
});
|
|
45
50
|
const CreateForItemsCouponItemConstraintsSchema = zod_1.z.object({
|
|
46
51
|
constraint: zod_1.z.array(zod_1.z.enum(['none', 'all', 'specific', 'criteria']).optional()),
|
|
47
52
|
item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()),
|
|
48
53
|
item_price_ids: zod_1.z.array(zod_1.z.array(zod_1.z.string().optional()).optional()).optional(),
|
|
49
54
|
});
|
|
55
|
+
const CreateForItemsCouponItemConstraintCriteriaItemSchema = zod_1.z.object({
|
|
56
|
+
item_type: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
|
|
57
|
+
item_family_ids: zod_1.z.array(zod_1.z.string().optional()).optional(),
|
|
58
|
+
currencies: zod_1.z.array(zod_1.z.string().optional()).optional(),
|
|
59
|
+
item_price_periods: zod_1.z.array(zod_1.z.string().optional()).optional(),
|
|
60
|
+
});
|
|
50
61
|
const CreateForItemsCouponItemConstraintCriteriaSchema = zod_1.z.object({
|
|
51
62
|
item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
|
|
52
63
|
item_family_ids: zod_1.z
|
|
@@ -57,6 +68,16 @@ const CreateForItemsCouponItemConstraintCriteriaSchema = zod_1.z.object({
|
|
|
57
68
|
.array(zod_1.z.array(zod_1.z.string().optional()).optional())
|
|
58
69
|
.optional(),
|
|
59
70
|
});
|
|
71
|
+
const CreateForItemsCouponCouponConstraintsItemSchema = zod_1.z.object({
|
|
72
|
+
entity_type: zod_1.z.enum(['customer']),
|
|
73
|
+
type: zod_1.z.enum([
|
|
74
|
+
'max_redemptions',
|
|
75
|
+
'unique_by',
|
|
76
|
+
'existing_customer',
|
|
77
|
+
'new_customer',
|
|
78
|
+
]),
|
|
79
|
+
value: zod_1.z.string().max(65000).optional(),
|
|
80
|
+
});
|
|
60
81
|
const CreateForItemsCouponCouponConstraintsSchema = zod_1.z.object({
|
|
61
82
|
entity_type: zod_1.z.array(zod_1.z.enum(['customer']).optional()),
|
|
62
83
|
type: zod_1.z.array(zod_1.z
|
|
@@ -97,18 +118,44 @@ const CreateForItemsCouponBodySchema = zod_1.z.looseObject({
|
|
|
97
118
|
period: zod_1.z.number().int().min(1).optional(),
|
|
98
119
|
period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
99
120
|
status: zod_1.z.enum(['active', 'archived']).optional(),
|
|
100
|
-
item_constraints:
|
|
101
|
-
|
|
102
|
-
|
|
121
|
+
item_constraints: zod_1.z
|
|
122
|
+
.union([
|
|
123
|
+
zod_1.z.array(CreateForItemsCouponItemConstraintsItemSchema.optional()),
|
|
124
|
+
CreateForItemsCouponItemConstraintsSchema,
|
|
125
|
+
])
|
|
126
|
+
.optional(),
|
|
127
|
+
item_constraint_criteria: zod_1.z
|
|
128
|
+
.union([
|
|
129
|
+
zod_1.z.array(CreateForItemsCouponItemConstraintCriteriaItemSchema.optional()),
|
|
130
|
+
CreateForItemsCouponItemConstraintCriteriaSchema,
|
|
131
|
+
])
|
|
132
|
+
.optional(),
|
|
133
|
+
coupon_constraints: zod_1.z
|
|
134
|
+
.union([
|
|
135
|
+
zod_1.z.array(CreateForItemsCouponCouponConstraintsItemSchema.optional()),
|
|
136
|
+
CreateForItemsCouponCouponConstraintsSchema,
|
|
137
|
+
])
|
|
138
|
+
.optional(),
|
|
103
139
|
});
|
|
104
140
|
exports.CreateForItemsCouponBodySchema = CreateForItemsCouponBodySchema;
|
|
105
141
|
//Coupon.updateForItems
|
|
106
142
|
const UpdateForItemsCouponMetaDataSchema = zod_1.z.looseObject({});
|
|
143
|
+
const UpdateForItemsCouponItemConstraintsItemSchema = zod_1.z.object({
|
|
144
|
+
constraint: zod_1.z.enum(['none', 'all', 'specific', 'criteria']),
|
|
145
|
+
item_type: zod_1.z.enum(['plan', 'addon', 'charge']),
|
|
146
|
+
item_price_ids: zod_1.z.array(zod_1.z.string().optional()).optional(),
|
|
147
|
+
});
|
|
107
148
|
const UpdateForItemsCouponItemConstraintsSchema = zod_1.z.object({
|
|
108
149
|
constraint: zod_1.z.array(zod_1.z.enum(['none', 'all', 'specific', 'criteria']).optional()),
|
|
109
150
|
item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()),
|
|
110
151
|
item_price_ids: zod_1.z.array(zod_1.z.array(zod_1.z.string().optional()).optional()).optional(),
|
|
111
152
|
});
|
|
153
|
+
const UpdateForItemsCouponItemConstraintCriteriaItemSchema = zod_1.z.object({
|
|
154
|
+
item_type: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
|
|
155
|
+
item_family_ids: zod_1.z.array(zod_1.z.string().optional()).optional(),
|
|
156
|
+
currencies: zod_1.z.array(zod_1.z.string().optional()).optional(),
|
|
157
|
+
item_price_periods: zod_1.z.array(zod_1.z.string().optional()).optional(),
|
|
158
|
+
});
|
|
112
159
|
const UpdateForItemsCouponItemConstraintCriteriaSchema = zod_1.z.object({
|
|
113
160
|
item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
|
|
114
161
|
item_family_ids: zod_1.z
|
|
@@ -119,6 +166,16 @@ const UpdateForItemsCouponItemConstraintCriteriaSchema = zod_1.z.object({
|
|
|
119
166
|
.array(zod_1.z.array(zod_1.z.string().optional()).optional())
|
|
120
167
|
.optional(),
|
|
121
168
|
});
|
|
169
|
+
const UpdateForItemsCouponCouponConstraintsItemSchema = zod_1.z.object({
|
|
170
|
+
entity_type: zod_1.z.enum(['customer']),
|
|
171
|
+
type: zod_1.z.enum([
|
|
172
|
+
'max_redemptions',
|
|
173
|
+
'unique_by',
|
|
174
|
+
'existing_customer',
|
|
175
|
+
'new_customer',
|
|
176
|
+
]),
|
|
177
|
+
value: zod_1.z.string().max(65000).optional(),
|
|
178
|
+
});
|
|
122
179
|
const UpdateForItemsCouponCouponConstraintsSchema = zod_1.z.object({
|
|
123
180
|
entity_type: zod_1.z.array(zod_1.z.enum(['customer']).optional()),
|
|
124
181
|
type: zod_1.z.array(zod_1.z
|
|
@@ -159,9 +216,24 @@ const UpdateForItemsCouponBodySchema = zod_1.z.looseObject({
|
|
|
159
216
|
included_in_mrr: zod_1.z.boolean().optional(),
|
|
160
217
|
period: zod_1.z.number().int().min(1).optional(),
|
|
161
218
|
period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
162
|
-
item_constraints:
|
|
163
|
-
|
|
164
|
-
|
|
219
|
+
item_constraints: zod_1.z
|
|
220
|
+
.union([
|
|
221
|
+
zod_1.z.array(UpdateForItemsCouponItemConstraintsItemSchema.optional()),
|
|
222
|
+
UpdateForItemsCouponItemConstraintsSchema,
|
|
223
|
+
])
|
|
224
|
+
.optional(),
|
|
225
|
+
item_constraint_criteria: zod_1.z
|
|
226
|
+
.union([
|
|
227
|
+
zod_1.z.array(UpdateForItemsCouponItemConstraintCriteriaItemSchema.optional()),
|
|
228
|
+
UpdateForItemsCouponItemConstraintCriteriaSchema,
|
|
229
|
+
])
|
|
230
|
+
.optional(),
|
|
231
|
+
coupon_constraints: zod_1.z
|
|
232
|
+
.union([
|
|
233
|
+
zod_1.z.array(UpdateForItemsCouponCouponConstraintsItemSchema.optional()),
|
|
234
|
+
UpdateForItemsCouponCouponConstraintsSchema,
|
|
235
|
+
])
|
|
236
|
+
.optional(),
|
|
165
237
|
});
|
|
166
238
|
exports.UpdateForItemsCouponBodySchema = UpdateForItemsCouponBodySchema;
|
|
167
239
|
//Coupon.list
|
|
@@ -169,36 +241,88 @@ const ListCouponIdSchema = zod_1.z.object({
|
|
|
169
241
|
is: zod_1.z.string().min(1).optional(),
|
|
170
242
|
is_not: zod_1.z.string().min(1).optional(),
|
|
171
243
|
starts_with: zod_1.z.string().min(1).optional(),
|
|
172
|
-
in: zod_1.z
|
|
173
|
-
|
|
244
|
+
in: zod_1.z
|
|
245
|
+
.union([
|
|
246
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
247
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
248
|
+
])
|
|
249
|
+
.optional(),
|
|
250
|
+
not_in: zod_1.z
|
|
251
|
+
.union([
|
|
252
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
253
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
254
|
+
])
|
|
255
|
+
.optional(),
|
|
174
256
|
});
|
|
175
257
|
const ListCouponNameSchema = zod_1.z.object({
|
|
176
258
|
is: zod_1.z.string().min(1).optional(),
|
|
177
259
|
is_not: zod_1.z.string().min(1).optional(),
|
|
178
260
|
starts_with: zod_1.z.string().min(1).optional(),
|
|
179
|
-
in: zod_1.z
|
|
180
|
-
|
|
261
|
+
in: zod_1.z
|
|
262
|
+
.union([
|
|
263
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
264
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
265
|
+
])
|
|
266
|
+
.optional(),
|
|
267
|
+
not_in: zod_1.z
|
|
268
|
+
.union([
|
|
269
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
270
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
271
|
+
])
|
|
272
|
+
.optional(),
|
|
181
273
|
});
|
|
182
274
|
const ListCouponDiscountTypeSchema = zod_1.z.object({
|
|
183
275
|
is: zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional(),
|
|
184
276
|
is_not: zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional(),
|
|
185
|
-
in: zod_1.z
|
|
186
|
-
|
|
277
|
+
in: zod_1.z
|
|
278
|
+
.union([
|
|
279
|
+
zod_1.z.array(zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional()),
|
|
280
|
+
zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']),
|
|
281
|
+
])
|
|
282
|
+
.optional(),
|
|
283
|
+
not_in: zod_1.z
|
|
284
|
+
.union([
|
|
285
|
+
zod_1.z.array(zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']).optional()),
|
|
286
|
+
zod_1.z.enum(['fixed_amount', 'percentage', 'offer_quantity']),
|
|
287
|
+
])
|
|
288
|
+
.optional(),
|
|
187
289
|
});
|
|
188
290
|
const ListCouponDurationTypeSchema = zod_1.z.object({
|
|
189
291
|
is: zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional(),
|
|
190
292
|
is_not: zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional(),
|
|
191
|
-
in: zod_1.z
|
|
192
|
-
|
|
293
|
+
in: zod_1.z
|
|
294
|
+
.union([
|
|
295
|
+
zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
|
|
296
|
+
zod_1.z.enum(['one_time', 'forever', 'limited_period']),
|
|
297
|
+
])
|
|
298
|
+
.optional(),
|
|
299
|
+
not_in: zod_1.z
|
|
300
|
+
.union([
|
|
301
|
+
zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
|
|
302
|
+
zod_1.z.enum(['one_time', 'forever', 'limited_period']),
|
|
303
|
+
])
|
|
304
|
+
.optional(),
|
|
193
305
|
});
|
|
194
306
|
const ListCouponStatusSchema = zod_1.z.object({
|
|
195
307
|
is: zod_1.z.enum(['active', 'expired', 'archived', 'deleted', 'future']).optional(),
|
|
196
308
|
is_not: zod_1.z
|
|
197
309
|
.enum(['active', 'expired', 'archived', 'deleted', 'future'])
|
|
198
310
|
.optional(),
|
|
199
|
-
in: zod_1.z
|
|
311
|
+
in: zod_1.z
|
|
312
|
+
.union([
|
|
313
|
+
zod_1.z.array(zod_1.z
|
|
314
|
+
.enum(['active', 'expired', 'archived', 'deleted', 'future'])
|
|
315
|
+
.optional()),
|
|
316
|
+
zod_1.z.enum(['active', 'expired', 'archived', 'deleted', 'future']),
|
|
317
|
+
])
|
|
318
|
+
.optional(),
|
|
200
319
|
not_in: zod_1.z
|
|
201
|
-
.
|
|
320
|
+
.union([
|
|
321
|
+
zod_1.z.array(zod_1.z
|
|
322
|
+
.enum(['active', 'expired', 'archived', 'deleted', 'future'])
|
|
323
|
+
.optional()),
|
|
324
|
+
zod_1.z.enum(['active', 'expired', 'archived', 'deleted', 'future']),
|
|
325
|
+
])
|
|
202
326
|
.optional(),
|
|
203
327
|
});
|
|
204
328
|
const ListCouponApplyOnSchema = zod_1.z.object({
|
|
@@ -219,33 +343,75 @@ const ListCouponApplyOnSchema = zod_1.z.object({
|
|
|
219
343
|
])
|
|
220
344
|
.optional(),
|
|
221
345
|
in: zod_1.z
|
|
222
|
-
.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
346
|
+
.union([
|
|
347
|
+
zod_1.z.array(zod_1.z
|
|
348
|
+
.enum([
|
|
349
|
+
'invoice_amount',
|
|
350
|
+
'specified_items_total',
|
|
351
|
+
'each_specified_item',
|
|
352
|
+
'each_unit_of_specified_items',
|
|
353
|
+
])
|
|
354
|
+
.optional()),
|
|
355
|
+
zod_1.z.enum([
|
|
356
|
+
'invoice_amount',
|
|
357
|
+
'specified_items_total',
|
|
358
|
+
'each_specified_item',
|
|
359
|
+
'each_unit_of_specified_items',
|
|
360
|
+
]),
|
|
227
361
|
])
|
|
228
362
|
.optional(),
|
|
229
363
|
not_in: zod_1.z
|
|
230
|
-
.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
364
|
+
.union([
|
|
365
|
+
zod_1.z.array(zod_1.z
|
|
366
|
+
.enum([
|
|
367
|
+
'invoice_amount',
|
|
368
|
+
'specified_items_total',
|
|
369
|
+
'each_specified_item',
|
|
370
|
+
'each_unit_of_specified_items',
|
|
371
|
+
])
|
|
372
|
+
.optional()),
|
|
373
|
+
zod_1.z.enum([
|
|
374
|
+
'invoice_amount',
|
|
375
|
+
'specified_items_total',
|
|
376
|
+
'each_specified_item',
|
|
377
|
+
'each_unit_of_specified_items',
|
|
378
|
+
]),
|
|
235
379
|
])
|
|
236
380
|
.optional(),
|
|
237
381
|
});
|
|
238
382
|
const ListCouponCreatedAtSchema = zod_1.z.object({
|
|
239
|
-
after: zod_1.z
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
383
|
+
after: zod_1.z
|
|
384
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
385
|
+
.optional(),
|
|
386
|
+
before: zod_1.z
|
|
387
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
388
|
+
.optional(),
|
|
389
|
+
on: zod_1.z
|
|
390
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
391
|
+
.optional(),
|
|
392
|
+
between: zod_1.z
|
|
393
|
+
.union([
|
|
394
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
395
|
+
zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
396
|
+
])
|
|
397
|
+
.optional(),
|
|
243
398
|
});
|
|
244
399
|
const ListCouponUpdatedAtSchema = zod_1.z.object({
|
|
245
|
-
after: zod_1.z
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
400
|
+
after: zod_1.z
|
|
401
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
402
|
+
.optional(),
|
|
403
|
+
before: zod_1.z
|
|
404
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
405
|
+
.optional(),
|
|
406
|
+
on: zod_1.z
|
|
407
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
408
|
+
.optional(),
|
|
409
|
+
between: zod_1.z
|
|
410
|
+
.union([
|
|
411
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
412
|
+
zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
413
|
+
])
|
|
414
|
+
.optional(),
|
|
249
415
|
});
|
|
250
416
|
const ListCouponSortBySchema = zod_1.z.looseObject({
|
|
251
417
|
asc: zod_1.z.enum(['created_at']).optional(),
|
|
@@ -255,11 +421,26 @@ const ListCouponCurrencyCodeSchema = zod_1.z.object({
|
|
|
255
421
|
is: zod_1.z.string().min(1).optional(),
|
|
256
422
|
is_not: zod_1.z.string().min(1).optional(),
|
|
257
423
|
starts_with: zod_1.z.string().min(1).optional(),
|
|
258
|
-
in: zod_1.z
|
|
259
|
-
|
|
424
|
+
in: zod_1.z
|
|
425
|
+
.union([
|
|
426
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
427
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
428
|
+
])
|
|
429
|
+
.optional(),
|
|
430
|
+
not_in: zod_1.z
|
|
431
|
+
.union([
|
|
432
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
433
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
434
|
+
])
|
|
435
|
+
.optional(),
|
|
260
436
|
});
|
|
261
437
|
const ListCouponApplicableItemPriceIdsSchema = zod_1.z.object({
|
|
262
|
-
in: zod_1.z
|
|
438
|
+
in: zod_1.z
|
|
439
|
+
.union([
|
|
440
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
441
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
442
|
+
])
|
|
443
|
+
.optional(),
|
|
263
444
|
is: zod_1.z.string().min(1).optional(),
|
|
264
445
|
});
|
|
265
446
|
const ListCouponBodySchema = zod_1.z.looseObject({
|