chargebee 3.26.0 → 3.28.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 +14 -1
- package/README.md +131 -0
- package/cjs/RequestWrapper.js +130 -12
- package/cjs/chargebee.cjs.js +5 -0
- package/cjs/chargebee.cjs.worker.js +2 -0
- package/cjs/chargebeeZodValidationError.js +18 -0
- package/cjs/createChargebee.js +23 -2
- package/cjs/environment.js +1 -1
- package/cjs/schema/addon.schema.js +269 -0
- package/cjs/schema/address.schema.js +35 -0
- package/cjs/schema/alert.schema.js +74 -0
- package/cjs/schema/alert_status.schema.js +31 -0
- package/cjs/schema/attached_item.schema.js +144 -0
- package/cjs/schema/business_entity.schema.js +46 -0
- package/cjs/schema/card.schema.js +165 -0
- package/cjs/schema/comment.schema.js +69 -0
- package/cjs/schema/coupon.schema.js +323 -0
- package/cjs/schema/coupon_code.schema.js +49 -0
- package/cjs/schema/coupon_set.schema.js +88 -0
- package/cjs/schema/credit_note.schema.js +502 -0
- package/cjs/schema/currency.schema.js +32 -0
- package/cjs/schema/customer.schema.js +1201 -0
- package/cjs/schema/customer_entitlement.schema.js +14 -0
- package/cjs/schema/differential_price.schema.js +106 -0
- package/cjs/schema/entitlement.schema.js +54 -0
- package/cjs/schema/entitlement_override.schema.js +35 -0
- package/cjs/schema/estimate.schema.js +1535 -0
- package/cjs/schema/event.schema.js +1060 -0
- package/cjs/schema/export.schema.js +3385 -0
- package/cjs/schema/feature.schema.js +78 -0
- package/cjs/schema/gift.schema.js +293 -0
- package/cjs/schema/grant_block.schema.js +47 -0
- package/cjs/schema/hosted_page.schema.js +1777 -0
- package/cjs/schema/in_app_subscription.schema.js +68 -0
- package/cjs/schema/index.js +88 -0
- package/cjs/schema/invoice.schema.js +1685 -0
- package/cjs/schema/item.schema.js +195 -0
- package/cjs/schema/item_entitlement.schema.js +45 -0
- package/cjs/schema/item_family.schema.js +57 -0
- package/cjs/schema/item_price.schema.js +335 -0
- package/cjs/schema/ledger_account_balance.schema.js +21 -0
- package/cjs/schema/ledger_operation.schema.js +104 -0
- package/cjs/schema/meter.schema.js +13 -0
- package/cjs/schema/metered_feature.schema.js +20 -0
- package/cjs/schema/non_subscription.schema.js +28 -0
- package/cjs/schema/offer_event.schema.js +13 -0
- package/cjs/schema/offer_fulfillment.schema.js +20 -0
- package/cjs/schema/omnichannel_one_time_order.schema.js +26 -0
- package/cjs/schema/omnichannel_subscription.schema.js +122 -0
- package/cjs/schema/omnichannel_subscription_item.schema.js +13 -0
- package/cjs/schema/order.schema.js +441 -0
- package/cjs/schema/payment_intent.schema.js +127 -0
- package/cjs/schema/payment_schedule_scheme.schema.js +20 -0
- package/cjs/schema/payment_source.schema.js +630 -0
- package/cjs/schema/payment_voucher.schema.js +57 -0
- package/cjs/schema/personalized_offer.schema.js +28 -0
- package/cjs/schema/plan.schema.js +363 -0
- package/cjs/schema/portal_session.schema.js +22 -0
- package/cjs/schema/price_variant.schema.js +93 -0
- package/cjs/schema/pricing_page_session.schema.js +135 -0
- package/cjs/schema/promotional_credit.schema.js +78 -0
- package/cjs/schema/promotional_grant.schema.js +17 -0
- package/cjs/schema/purchase.schema.js +277 -0
- package/cjs/schema/quote.schema.js +1667 -0
- package/cjs/schema/ramp.schema.js +245 -0
- package/cjs/schema/recorded_purchase.schema.js +32 -0
- package/cjs/schema/resource_migration.schema.js +14 -0
- package/cjs/schema/site_migration_detail.schema.js +81 -0
- package/cjs/schema/subscription.schema.js +3344 -0
- package/cjs/schema/subscription_entitlement.schema.js +25 -0
- package/cjs/schema/time_machine.schema.js +17 -0
- package/cjs/schema/transaction.schema.js +744 -0
- package/cjs/schema/unbilled_charge.schema.js +139 -0
- package/cjs/schema/usage.schema.js +93 -0
- package/cjs/schema/usage_charge.schema.js +17 -0
- package/cjs/schema/usage_event.schema.js +28 -0
- package/cjs/schema/usage_file.schema.js +13 -0
- package/cjs/schema/usage_summary.schema.js +17 -0
- package/cjs/schema/virtual_bank_account.schema.js +71 -0
- package/cjs/schema/webhook_endpoint.schema.js +508 -0
- package/cjs/telemetry/TelemetryAdapter.js +145 -0
- package/cjs/telemetry/index.js +28 -0
- package/cjs/telemetry/otel.js +66 -0
- package/cjs/telemetry/types.js +47 -0
- package/cjs/validationLoader.js +59 -0
- package/esm/RequestWrapper.js +130 -12
- package/esm/chargebee.esm.js +3 -0
- package/esm/chargebee.esm.worker.js +1 -0
- package/esm/chargebeeZodValidationError.js +14 -0
- package/esm/createChargebee.js +23 -2
- package/esm/environment.js +1 -1
- package/esm/schema/addon.schema.js +266 -0
- package/esm/schema/address.schema.js +32 -0
- package/esm/schema/alert.schema.js +71 -0
- package/esm/schema/alert_status.schema.js +28 -0
- package/esm/schema/attached_item.schema.js +141 -0
- package/esm/schema/business_entity.schema.js +43 -0
- package/esm/schema/card.schema.js +162 -0
- package/esm/schema/comment.schema.js +66 -0
- package/esm/schema/coupon.schema.js +320 -0
- package/esm/schema/coupon_code.schema.js +46 -0
- package/esm/schema/coupon_set.schema.js +85 -0
- package/esm/schema/credit_note.schema.js +499 -0
- package/esm/schema/currency.schema.js +29 -0
- package/esm/schema/customer.schema.js +1198 -0
- package/esm/schema/customer_entitlement.schema.js +11 -0
- package/esm/schema/differential_price.schema.js +103 -0
- package/esm/schema/entitlement.schema.js +51 -0
- package/esm/schema/entitlement_override.schema.js +32 -0
- package/esm/schema/estimate.schema.js +1532 -0
- package/esm/schema/event.schema.js +1057 -0
- package/esm/schema/export.schema.js +3382 -0
- package/esm/schema/feature.schema.js +75 -0
- package/esm/schema/gift.schema.js +290 -0
- package/esm/schema/grant_block.schema.js +44 -0
- package/esm/schema/hosted_page.schema.js +1774 -0
- package/esm/schema/in_app_subscription.schema.js +65 -0
- package/esm/schema/index.js +72 -0
- package/esm/schema/invoice.schema.js +1682 -0
- package/esm/schema/item.schema.js +192 -0
- package/esm/schema/item_entitlement.schema.js +42 -0
- package/esm/schema/item_family.schema.js +54 -0
- package/esm/schema/item_price.schema.js +332 -0
- package/esm/schema/ledger_account_balance.schema.js +18 -0
- package/esm/schema/ledger_operation.schema.js +101 -0
- package/esm/schema/meter.schema.js +10 -0
- package/esm/schema/metered_feature.schema.js +17 -0
- package/esm/schema/non_subscription.schema.js +25 -0
- package/esm/schema/offer_event.schema.js +10 -0
- package/esm/schema/offer_fulfillment.schema.js +17 -0
- package/esm/schema/omnichannel_one_time_order.schema.js +23 -0
- package/esm/schema/omnichannel_subscription.schema.js +119 -0
- package/esm/schema/omnichannel_subscription_item.schema.js +10 -0
- package/esm/schema/order.schema.js +438 -0
- package/esm/schema/payment_intent.schema.js +124 -0
- package/esm/schema/payment_schedule_scheme.schema.js +17 -0
- package/esm/schema/payment_source.schema.js +627 -0
- package/esm/schema/payment_voucher.schema.js +54 -0
- package/esm/schema/personalized_offer.schema.js +25 -0
- package/esm/schema/plan.schema.js +360 -0
- package/esm/schema/portal_session.schema.js +19 -0
- package/esm/schema/price_variant.schema.js +90 -0
- package/esm/schema/pricing_page_session.schema.js +132 -0
- package/esm/schema/promotional_credit.schema.js +75 -0
- package/esm/schema/promotional_grant.schema.js +14 -0
- package/esm/schema/purchase.schema.js +274 -0
- package/esm/schema/quote.schema.js +1664 -0
- package/esm/schema/ramp.schema.js +242 -0
- package/esm/schema/recorded_purchase.schema.js +29 -0
- package/esm/schema/resource_migration.schema.js +11 -0
- package/esm/schema/site_migration_detail.schema.js +78 -0
- package/esm/schema/subscription.schema.js +3341 -0
- package/esm/schema/subscription_entitlement.schema.js +22 -0
- package/esm/schema/time_machine.schema.js +14 -0
- package/esm/schema/transaction.schema.js +741 -0
- package/esm/schema/unbilled_charge.schema.js +136 -0
- package/esm/schema/usage.schema.js +90 -0
- package/esm/schema/usage_charge.schema.js +14 -0
- package/esm/schema/usage_event.schema.js +25 -0
- package/esm/schema/usage_file.schema.js +10 -0
- package/esm/schema/usage_summary.schema.js +14 -0
- package/esm/schema/virtual_bank_account.schema.js +68 -0
- package/esm/schema/webhook_endpoint.schema.js +505 -0
- package/esm/telemetry/TelemetryAdapter.js +132 -0
- package/esm/telemetry/index.js +8 -0
- package/esm/telemetry/otel.js +62 -0
- package/esm/telemetry/types.js +44 -0
- package/esm/validationLoader.js +56 -0
- package/package.json +43 -24
- package/types/core.d.ts +2 -0
- package/types/index.d.ts +85 -0
- package/types/telemetry/otel.d.ts +22 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated Zod schemas: PersonalizedOffer
|
|
3
|
+
// Actions: personalizedOffers
|
|
4
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PersonalizedOffersPersonalizedOfferBodySchema = void 0;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
//PersonalizedOffer.personalizedOffers
|
|
9
|
+
const PersonalizedOffersPersonalizedOfferCustomSchema = zod_1.z.looseObject({});
|
|
10
|
+
const PersonalizedOffersPersonalizedOfferRequestContextSchema = zod_1.z.object({
|
|
11
|
+
user_agent: zod_1.z.string().max(255).optional(),
|
|
12
|
+
locale: zod_1.z.string().max(50).optional(),
|
|
13
|
+
timezone: zod_1.z.string().max(64).optional(),
|
|
14
|
+
url: zod_1.z.string().max(250).optional(),
|
|
15
|
+
referrer_url: zod_1.z.string().max(250).optional(),
|
|
16
|
+
});
|
|
17
|
+
const PersonalizedOffersPersonalizedOfferBodySchema = zod_1.z.looseObject({
|
|
18
|
+
first_name: zod_1.z.string().max(150).optional(),
|
|
19
|
+
last_name: zod_1.z.string().max(150).optional(),
|
|
20
|
+
email: zod_1.z.string().email().max(70).optional(),
|
|
21
|
+
roles: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
|
|
22
|
+
external_user_id: zod_1.z.string().max(50).optional(),
|
|
23
|
+
subscription_id: zod_1.z.string().max(50).optional(),
|
|
24
|
+
customer_id: zod_1.z.string().max(50),
|
|
25
|
+
custom: PersonalizedOffersPersonalizedOfferCustomSchema.optional(),
|
|
26
|
+
request_context: PersonalizedOffersPersonalizedOfferRequestContextSchema.optional(),
|
|
27
|
+
});
|
|
28
|
+
exports.PersonalizedOffersPersonalizedOfferBodySchema = PersonalizedOffersPersonalizedOfferBodySchema;
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated Zod schemas: Plan
|
|
3
|
+
// Actions: create, update, list, copy
|
|
4
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CopyPlanBodySchema = exports.ListPlanBodySchema = exports.UpdatePlanBodySchema = exports.CreatePlanBodySchema = void 0;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
//Plan.create
|
|
9
|
+
const CreatePlanMetaDataSchema = zod_1.z.looseObject({});
|
|
10
|
+
const CreatePlanTiersSchema = zod_1.z.object({
|
|
11
|
+
starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
12
|
+
ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
13
|
+
price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
|
|
14
|
+
starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
15
|
+
ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
16
|
+
price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
|
|
17
|
+
});
|
|
18
|
+
const CreatePlanTaxProvidersFieldsSchema = zod_1.z.object({
|
|
19
|
+
provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
20
|
+
field_id: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
21
|
+
field_value: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
22
|
+
});
|
|
23
|
+
const CreatePlanApplicableAddonsSchema = zod_1.z.object({
|
|
24
|
+
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
25
|
+
});
|
|
26
|
+
const CreatePlanEventBasedAddonsSchema = zod_1.z.object({
|
|
27
|
+
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
28
|
+
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
29
|
+
quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
30
|
+
on_event: zod_1.z
|
|
31
|
+
.array(zod_1.z
|
|
32
|
+
.enum([
|
|
33
|
+
'subscription_creation',
|
|
34
|
+
'subscription_trial_start',
|
|
35
|
+
'plan_activation',
|
|
36
|
+
'subscription_activation',
|
|
37
|
+
'contract_termination',
|
|
38
|
+
])
|
|
39
|
+
.optional())
|
|
40
|
+
.optional(),
|
|
41
|
+
charge_once: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
|
|
42
|
+
});
|
|
43
|
+
const CreatePlanAttachedAddonsSchema = zod_1.z.object({
|
|
44
|
+
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
45
|
+
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
46
|
+
quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
47
|
+
billing_cycles: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
48
|
+
type: zod_1.z.array(zod_1.z.enum(['recommended', 'mandatory']).optional()).optional(),
|
|
49
|
+
});
|
|
50
|
+
const CreatePlanBodySchema = zod_1.z.looseObject({
|
|
51
|
+
id: zod_1.z.string().max(100),
|
|
52
|
+
name: zod_1.z.string().max(100),
|
|
53
|
+
invoice_name: zod_1.z.string().max(100).optional(),
|
|
54
|
+
description: zod_1.z.string().max(2000).optional(),
|
|
55
|
+
trial_period: zod_1.z.number().int().min(1).optional(),
|
|
56
|
+
trial_period_unit: zod_1.z.enum(['day', 'month']).optional(),
|
|
57
|
+
trial_end_action: zod_1.z
|
|
58
|
+
.enum(['site_default', 'activate_subscription', 'cancel_subscription'])
|
|
59
|
+
.optional(),
|
|
60
|
+
period: zod_1.z.number().int().min(1).optional(),
|
|
61
|
+
period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
62
|
+
setup_cost: zod_1.z.number().int().min(1).optional(),
|
|
63
|
+
price: zod_1.z.number().int().min(0).optional(),
|
|
64
|
+
price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
65
|
+
currency_code: zod_1.z.string().max(3).optional(),
|
|
66
|
+
billing_cycles: zod_1.z.number().int().min(1).optional(),
|
|
67
|
+
pricing_model: zod_1.z
|
|
68
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
69
|
+
.optional(),
|
|
70
|
+
charge_model: zod_1.z
|
|
71
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
72
|
+
.optional(),
|
|
73
|
+
free_quantity: zod_1.z.number().int().min(0).optional(),
|
|
74
|
+
free_quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
75
|
+
addon_applicability: zod_1.z.enum(['all', 'restricted']).optional(),
|
|
76
|
+
downgrade_penalty: zod_1.z.number().min(0.01).max(100).optional(),
|
|
77
|
+
redirect_url: zod_1.z.string().max(500).optional(),
|
|
78
|
+
enabled_in_hosted_pages: zod_1.z.boolean().default(true).optional(),
|
|
79
|
+
enabled_in_portal: zod_1.z.boolean().default(true).optional(),
|
|
80
|
+
taxable: zod_1.z.boolean().default(true).optional(),
|
|
81
|
+
tax_profile_id: zod_1.z.string().max(50).optional(),
|
|
82
|
+
tax_code: zod_1.z.string().max(50).optional(),
|
|
83
|
+
hsn_code: zod_1.z.string().max(50).optional(),
|
|
84
|
+
taxjar_product_code: zod_1.z.string().max(50).optional(),
|
|
85
|
+
avalara_sale_type: zod_1.z
|
|
86
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
87
|
+
.optional(),
|
|
88
|
+
avalara_transaction_type: zod_1.z.number().int().optional(),
|
|
89
|
+
avalara_service_type: zod_1.z.number().int().optional(),
|
|
90
|
+
sku: zod_1.z.string().max(100).optional(),
|
|
91
|
+
accounting_code: zod_1.z.string().max(100).optional(),
|
|
92
|
+
accounting_category1: zod_1.z.string().max(100).optional(),
|
|
93
|
+
accounting_category2: zod_1.z.string().max(100).optional(),
|
|
94
|
+
accounting_category3: zod_1.z.string().max(100).optional(),
|
|
95
|
+
accounting_category4: zod_1.z.string().max(100).optional(),
|
|
96
|
+
is_shippable: zod_1.z.boolean().default(false).optional(),
|
|
97
|
+
shipping_frequency_period: zod_1.z.number().int().min(1).optional(),
|
|
98
|
+
shipping_frequency_period_unit: zod_1.z
|
|
99
|
+
.enum(['year', 'month', 'week', 'day'])
|
|
100
|
+
.optional(),
|
|
101
|
+
invoice_notes: zod_1.z.string().max(2000).optional(),
|
|
102
|
+
meta_data: CreatePlanMetaDataSchema.optional(),
|
|
103
|
+
show_description_in_invoices: zod_1.z.boolean().default(false).optional(),
|
|
104
|
+
show_description_in_quotes: zod_1.z.boolean().default(false).optional(),
|
|
105
|
+
giftable: zod_1.z.boolean().default(false).optional(),
|
|
106
|
+
status: zod_1.z.enum(['active', 'archived']).optional(),
|
|
107
|
+
claim_url: zod_1.z.string().max(500).optional(),
|
|
108
|
+
tiers: CreatePlanTiersSchema.optional(),
|
|
109
|
+
tax_providers_fields: CreatePlanTaxProvidersFieldsSchema.optional(),
|
|
110
|
+
applicable_addons: CreatePlanApplicableAddonsSchema.optional(),
|
|
111
|
+
event_based_addons: CreatePlanEventBasedAddonsSchema.optional(),
|
|
112
|
+
attached_addons: CreatePlanAttachedAddonsSchema.optional(),
|
|
113
|
+
});
|
|
114
|
+
exports.CreatePlanBodySchema = CreatePlanBodySchema;
|
|
115
|
+
//Plan.update
|
|
116
|
+
const UpdatePlanMetaDataSchema = zod_1.z.looseObject({});
|
|
117
|
+
const UpdatePlanTiersSchema = zod_1.z.object({
|
|
118
|
+
starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
119
|
+
ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
120
|
+
price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
|
|
121
|
+
starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
122
|
+
ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
123
|
+
price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
|
|
124
|
+
});
|
|
125
|
+
const UpdatePlanTaxProvidersFieldsSchema = zod_1.z.object({
|
|
126
|
+
provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
127
|
+
field_id: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
128
|
+
field_value: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
129
|
+
});
|
|
130
|
+
const UpdatePlanApplicableAddonsSchema = zod_1.z.object({
|
|
131
|
+
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
132
|
+
});
|
|
133
|
+
const UpdatePlanEventBasedAddonsSchema = zod_1.z.object({
|
|
134
|
+
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
135
|
+
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
136
|
+
quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
137
|
+
on_event: zod_1.z
|
|
138
|
+
.array(zod_1.z
|
|
139
|
+
.enum([
|
|
140
|
+
'subscription_creation',
|
|
141
|
+
'subscription_trial_start',
|
|
142
|
+
'plan_activation',
|
|
143
|
+
'subscription_activation',
|
|
144
|
+
'contract_termination',
|
|
145
|
+
])
|
|
146
|
+
.optional())
|
|
147
|
+
.optional(),
|
|
148
|
+
charge_once: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
|
|
149
|
+
});
|
|
150
|
+
const UpdatePlanAttachedAddonsSchema = zod_1.z.object({
|
|
151
|
+
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
152
|
+
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
153
|
+
quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
154
|
+
billing_cycles: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
155
|
+
type: zod_1.z.array(zod_1.z.enum(['recommended', 'mandatory']).optional()).optional(),
|
|
156
|
+
});
|
|
157
|
+
const UpdatePlanBodySchema = zod_1.z.looseObject({
|
|
158
|
+
name: zod_1.z.string().max(100).optional(),
|
|
159
|
+
invoice_name: zod_1.z.string().max(100).optional(),
|
|
160
|
+
description: zod_1.z.string().max(2000).optional(),
|
|
161
|
+
trial_period: zod_1.z.number().int().min(0).optional(),
|
|
162
|
+
trial_period_unit: zod_1.z.enum(['day', 'month']).optional(),
|
|
163
|
+
trial_end_action: zod_1.z
|
|
164
|
+
.enum(['site_default', 'activate_subscription', 'cancel_subscription'])
|
|
165
|
+
.optional(),
|
|
166
|
+
period: zod_1.z.number().int().min(1).optional(),
|
|
167
|
+
period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
168
|
+
setup_cost: zod_1.z.number().int().min(1).optional(),
|
|
169
|
+
price: zod_1.z.number().int().min(0).optional(),
|
|
170
|
+
price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
171
|
+
currency_code: zod_1.z.string().max(3).optional(),
|
|
172
|
+
billing_cycles: zod_1.z.number().int().min(1).optional(),
|
|
173
|
+
pricing_model: zod_1.z
|
|
174
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
175
|
+
.optional(),
|
|
176
|
+
charge_model: zod_1.z
|
|
177
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
178
|
+
.optional(),
|
|
179
|
+
free_quantity: zod_1.z.number().int().min(0).optional(),
|
|
180
|
+
free_quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
181
|
+
addon_applicability: zod_1.z.enum(['all', 'restricted']).optional(),
|
|
182
|
+
downgrade_penalty: zod_1.z.number().min(0.01).max(100).optional(),
|
|
183
|
+
redirect_url: zod_1.z.string().max(500).optional(),
|
|
184
|
+
enabled_in_hosted_pages: zod_1.z.boolean().default(true).optional(),
|
|
185
|
+
enabled_in_portal: zod_1.z.boolean().default(true).optional(),
|
|
186
|
+
taxable: zod_1.z.boolean().default(true).optional(),
|
|
187
|
+
tax_profile_id: zod_1.z.string().max(50).optional(),
|
|
188
|
+
tax_code: zod_1.z.string().max(50).optional(),
|
|
189
|
+
hsn_code: zod_1.z.string().max(50).optional(),
|
|
190
|
+
taxjar_product_code: zod_1.z.string().max(50).optional(),
|
|
191
|
+
avalara_sale_type: zod_1.z
|
|
192
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
193
|
+
.optional(),
|
|
194
|
+
avalara_transaction_type: zod_1.z.number().int().optional(),
|
|
195
|
+
avalara_service_type: zod_1.z.number().int().optional(),
|
|
196
|
+
sku: zod_1.z.string().max(100).optional(),
|
|
197
|
+
accounting_code: zod_1.z.string().max(100).optional(),
|
|
198
|
+
accounting_category1: zod_1.z.string().max(100).optional(),
|
|
199
|
+
accounting_category2: zod_1.z.string().max(100).optional(),
|
|
200
|
+
accounting_category3: zod_1.z.string().max(100).optional(),
|
|
201
|
+
accounting_category4: zod_1.z.string().max(100).optional(),
|
|
202
|
+
is_shippable: zod_1.z.boolean().default(false).optional(),
|
|
203
|
+
shipping_frequency_period: zod_1.z.number().int().min(1).optional(),
|
|
204
|
+
shipping_frequency_period_unit: zod_1.z
|
|
205
|
+
.enum(['year', 'month', 'week', 'day'])
|
|
206
|
+
.optional(),
|
|
207
|
+
invoice_notes: zod_1.z.string().max(2000).optional(),
|
|
208
|
+
meta_data: UpdatePlanMetaDataSchema.optional(),
|
|
209
|
+
show_description_in_invoices: zod_1.z.boolean().default(false).optional(),
|
|
210
|
+
show_description_in_quotes: zod_1.z.boolean().default(false).optional(),
|
|
211
|
+
tiers: UpdatePlanTiersSchema.optional(),
|
|
212
|
+
tax_providers_fields: UpdatePlanTaxProvidersFieldsSchema.optional(),
|
|
213
|
+
applicable_addons: UpdatePlanApplicableAddonsSchema.optional(),
|
|
214
|
+
event_based_addons: UpdatePlanEventBasedAddonsSchema.optional(),
|
|
215
|
+
attached_addons: UpdatePlanAttachedAddonsSchema.optional(),
|
|
216
|
+
});
|
|
217
|
+
exports.UpdatePlanBodySchema = UpdatePlanBodySchema;
|
|
218
|
+
//Plan.list
|
|
219
|
+
const ListPlanIdSchema = zod_1.z.object({
|
|
220
|
+
is: zod_1.z.string().min(1).optional(),
|
|
221
|
+
is_not: zod_1.z.string().min(1).optional(),
|
|
222
|
+
starts_with: zod_1.z.string().min(1).optional(),
|
|
223
|
+
in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
224
|
+
not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
225
|
+
});
|
|
226
|
+
const ListPlanNameSchema = zod_1.z.object({
|
|
227
|
+
is: zod_1.z.string().min(1).optional(),
|
|
228
|
+
is_not: zod_1.z.string().min(1).optional(),
|
|
229
|
+
starts_with: zod_1.z.string().min(1).optional(),
|
|
230
|
+
in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
231
|
+
not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
232
|
+
});
|
|
233
|
+
const ListPlanPriceSchema = zod_1.z.object({
|
|
234
|
+
is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
235
|
+
is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
236
|
+
lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
237
|
+
lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
238
|
+
gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
239
|
+
gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
240
|
+
between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
|
|
241
|
+
});
|
|
242
|
+
const ListPlanPeriodSchema = zod_1.z.object({
|
|
243
|
+
is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
244
|
+
is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
245
|
+
lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
246
|
+
lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
247
|
+
gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
248
|
+
gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
249
|
+
between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
|
|
250
|
+
});
|
|
251
|
+
const ListPlanPeriodUnitSchema = zod_1.z.object({
|
|
252
|
+
is: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
253
|
+
is_not: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
254
|
+
in: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
255
|
+
not_in: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
256
|
+
});
|
|
257
|
+
const ListPlanTrialPeriodSchema = zod_1.z.object({
|
|
258
|
+
is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
259
|
+
is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
260
|
+
lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
261
|
+
lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
262
|
+
gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
263
|
+
gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
264
|
+
between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
|
|
265
|
+
is_present: zod_1.z.enum(['true', 'false']).optional(),
|
|
266
|
+
});
|
|
267
|
+
const ListPlanTrialPeriodUnitSchema = zod_1.z.object({
|
|
268
|
+
is: zod_1.z.enum(['day', 'month']).optional(),
|
|
269
|
+
is_not: zod_1.z.enum(['day', 'month']).optional(),
|
|
270
|
+
in: zod_1.z.enum(['day', 'month']).optional(),
|
|
271
|
+
not_in: zod_1.z.enum(['day', 'month']).optional(),
|
|
272
|
+
});
|
|
273
|
+
const ListPlanAddonApplicabilitySchema = zod_1.z.object({
|
|
274
|
+
is: zod_1.z.enum(['all', 'restricted']).optional(),
|
|
275
|
+
is_not: zod_1.z.enum(['all', 'restricted']).optional(),
|
|
276
|
+
in: zod_1.z.enum(['all', 'restricted']).optional(),
|
|
277
|
+
not_in: zod_1.z.enum(['all', 'restricted']).optional(),
|
|
278
|
+
});
|
|
279
|
+
const ListPlanGiftableSchema = zod_1.z.object({
|
|
280
|
+
is: zod_1.z.enum(['true', 'false']).optional(),
|
|
281
|
+
});
|
|
282
|
+
const ListPlanChargeModelSchema = zod_1.z.object({
|
|
283
|
+
is: zod_1.z
|
|
284
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
285
|
+
.optional(),
|
|
286
|
+
is_not: zod_1.z
|
|
287
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
288
|
+
.optional(),
|
|
289
|
+
in: zod_1.z
|
|
290
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
291
|
+
.optional(),
|
|
292
|
+
not_in: zod_1.z
|
|
293
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
294
|
+
.optional(),
|
|
295
|
+
});
|
|
296
|
+
const ListPlanPricingModelSchema = zod_1.z.object({
|
|
297
|
+
is: zod_1.z
|
|
298
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
299
|
+
.optional(),
|
|
300
|
+
is_not: zod_1.z
|
|
301
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
302
|
+
.optional(),
|
|
303
|
+
in: zod_1.z
|
|
304
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
305
|
+
.optional(),
|
|
306
|
+
not_in: zod_1.z
|
|
307
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
308
|
+
.optional(),
|
|
309
|
+
});
|
|
310
|
+
const ListPlanStatusSchema = zod_1.z.object({
|
|
311
|
+
is: zod_1.z.enum(['active', 'archived', 'deleted']).optional(),
|
|
312
|
+
is_not: zod_1.z.enum(['active', 'archived', 'deleted']).optional(),
|
|
313
|
+
in: zod_1.z.enum(['active', 'archived', 'deleted']).optional(),
|
|
314
|
+
not_in: zod_1.z.enum(['active', 'archived', 'deleted']).optional(),
|
|
315
|
+
});
|
|
316
|
+
const ListPlanUpdatedAtSchema = zod_1.z.object({
|
|
317
|
+
after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
318
|
+
before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
319
|
+
on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
320
|
+
between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
|
|
321
|
+
});
|
|
322
|
+
const ListPlanCurrencyCodeSchema = zod_1.z.object({
|
|
323
|
+
is: zod_1.z.string().min(1).optional(),
|
|
324
|
+
is_not: zod_1.z.string().min(1).optional(),
|
|
325
|
+
starts_with: zod_1.z.string().min(1).optional(),
|
|
326
|
+
in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
327
|
+
not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
328
|
+
});
|
|
329
|
+
const ListPlanChannelSchema = zod_1.z.object({
|
|
330
|
+
is: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
331
|
+
is_not: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
332
|
+
in: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
333
|
+
not_in: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
334
|
+
});
|
|
335
|
+
const ListPlanBodySchema = zod_1.z.looseObject({
|
|
336
|
+
limit: zod_1.z.number().int().min(1).max(100).optional(),
|
|
337
|
+
offset: zod_1.z.string().max(1000).optional(),
|
|
338
|
+
id: ListPlanIdSchema.optional(),
|
|
339
|
+
name: ListPlanNameSchema.optional(),
|
|
340
|
+
price: ListPlanPriceSchema.optional(),
|
|
341
|
+
period: ListPlanPeriodSchema.optional(),
|
|
342
|
+
period_unit: ListPlanPeriodUnitSchema.optional(),
|
|
343
|
+
trial_period: ListPlanTrialPeriodSchema.optional(),
|
|
344
|
+
trial_period_unit: ListPlanTrialPeriodUnitSchema.optional(),
|
|
345
|
+
addon_applicability: ListPlanAddonApplicabilitySchema.optional(),
|
|
346
|
+
giftable: ListPlanGiftableSchema.optional(),
|
|
347
|
+
charge_model: ListPlanChargeModelSchema.optional(),
|
|
348
|
+
pricing_model: ListPlanPricingModelSchema.optional(),
|
|
349
|
+
status: ListPlanStatusSchema.optional(),
|
|
350
|
+
updated_at: ListPlanUpdatedAtSchema.optional(),
|
|
351
|
+
currency_code: ListPlanCurrencyCodeSchema.optional(),
|
|
352
|
+
channel: ListPlanChannelSchema.optional(),
|
|
353
|
+
include_deleted: zod_1.z.boolean().default(false).optional(),
|
|
354
|
+
});
|
|
355
|
+
exports.ListPlanBodySchema = ListPlanBodySchema;
|
|
356
|
+
//Plan.copy
|
|
357
|
+
const CopyPlanBodySchema = zod_1.z.looseObject({
|
|
358
|
+
from_site: zod_1.z.string().max(50),
|
|
359
|
+
id_at_from_site: zod_1.z.string().max(100),
|
|
360
|
+
id: zod_1.z.string().max(100).optional(),
|
|
361
|
+
for_site_merging: zod_1.z.boolean().default(false).optional(),
|
|
362
|
+
});
|
|
363
|
+
exports.CopyPlanBodySchema = CopyPlanBodySchema;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated Zod schemas: PortalSession
|
|
3
|
+
// Actions: create, activate
|
|
4
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ActivatePortalSessionBodySchema = exports.CreatePortalSessionBodySchema = void 0;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
//PortalSession.create
|
|
9
|
+
const CreatePortalSessionCustomerSchema = zod_1.z.object({
|
|
10
|
+
id: zod_1.z.string().max(50),
|
|
11
|
+
});
|
|
12
|
+
const CreatePortalSessionBodySchema = zod_1.z.looseObject({
|
|
13
|
+
redirect_url: zod_1.z.string().max(250).optional(),
|
|
14
|
+
forward_url: zod_1.z.string().max(250).optional(),
|
|
15
|
+
customer: CreatePortalSessionCustomerSchema.optional(),
|
|
16
|
+
});
|
|
17
|
+
exports.CreatePortalSessionBodySchema = CreatePortalSessionBodySchema;
|
|
18
|
+
//PortalSession.activate
|
|
19
|
+
const ActivatePortalSessionBodySchema = zod_1.z.looseObject({
|
|
20
|
+
token: zod_1.z.string().max(70),
|
|
21
|
+
});
|
|
22
|
+
exports.ActivatePortalSessionBodySchema = ActivatePortalSessionBodySchema;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated Zod schemas: PriceVariant
|
|
3
|
+
// Actions: create, update, list
|
|
4
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ListPriceVariantBodySchema = exports.UpdatePriceVariantBodySchema = exports.CreatePriceVariantBodySchema = void 0;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
//PriceVariant.create
|
|
9
|
+
const CreatePriceVariantAttributesSchema = zod_1.z.object({
|
|
10
|
+
name: zod_1.z.array(zod_1.z.string().max(100).optional()),
|
|
11
|
+
value: zod_1.z.array(zod_1.z.string().max(100).optional()),
|
|
12
|
+
});
|
|
13
|
+
const CreatePriceVariantBodySchema = zod_1.z.looseObject({
|
|
14
|
+
id: zod_1.z.string().max(100),
|
|
15
|
+
name: zod_1.z.string().max(100),
|
|
16
|
+
external_name: zod_1.z.string().max(100).optional(),
|
|
17
|
+
description: zod_1.z.string().max(500).optional(),
|
|
18
|
+
variant_group: zod_1.z.string().max(100).optional(),
|
|
19
|
+
business_entity_id: zod_1.z.string().max(50).optional(),
|
|
20
|
+
attributes: CreatePriceVariantAttributesSchema.optional(),
|
|
21
|
+
});
|
|
22
|
+
exports.CreatePriceVariantBodySchema = CreatePriceVariantBodySchema;
|
|
23
|
+
//PriceVariant.update
|
|
24
|
+
const UpdatePriceVariantAttributesSchema = zod_1.z.object({
|
|
25
|
+
name: zod_1.z.array(zod_1.z.string().max(100).optional()),
|
|
26
|
+
value: zod_1.z.array(zod_1.z.string().max(100).optional()),
|
|
27
|
+
});
|
|
28
|
+
const UpdatePriceVariantBodySchema = zod_1.z.looseObject({
|
|
29
|
+
name: zod_1.z.string().max(100).optional(),
|
|
30
|
+
external_name: zod_1.z.string().max(100).optional(),
|
|
31
|
+
description: zod_1.z.string().max(500).optional(),
|
|
32
|
+
variant_group: zod_1.z.string().max(100).optional(),
|
|
33
|
+
status: zod_1.z.enum(['active', 'archived']).optional(),
|
|
34
|
+
attributes: UpdatePriceVariantAttributesSchema.optional(),
|
|
35
|
+
});
|
|
36
|
+
exports.UpdatePriceVariantBodySchema = UpdatePriceVariantBodySchema;
|
|
37
|
+
//PriceVariant.list
|
|
38
|
+
const ListPriceVariantIdSchema = zod_1.z.object({
|
|
39
|
+
is: zod_1.z.string().min(1).optional(),
|
|
40
|
+
is_not: zod_1.z.string().min(1).optional(),
|
|
41
|
+
starts_with: zod_1.z.string().min(1).optional(),
|
|
42
|
+
in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
43
|
+
not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
44
|
+
});
|
|
45
|
+
const ListPriceVariantNameSchema = zod_1.z.object({
|
|
46
|
+
is: zod_1.z.string().min(1).optional(),
|
|
47
|
+
is_not: zod_1.z.string().min(1).optional(),
|
|
48
|
+
starts_with: zod_1.z.string().min(1).optional(),
|
|
49
|
+
in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
50
|
+
not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
51
|
+
});
|
|
52
|
+
const ListPriceVariantStatusSchema = zod_1.z.object({
|
|
53
|
+
is: zod_1.z.enum(['active', 'archived']).optional(),
|
|
54
|
+
is_not: zod_1.z.enum(['active', 'archived']).optional(),
|
|
55
|
+
in: zod_1.z.enum(['active', 'archived']).optional(),
|
|
56
|
+
not_in: zod_1.z.enum(['active', 'archived']).optional(),
|
|
57
|
+
});
|
|
58
|
+
const ListPriceVariantUpdatedAtSchema = zod_1.z.object({
|
|
59
|
+
after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
60
|
+
before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
61
|
+
on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
62
|
+
between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
|
|
63
|
+
});
|
|
64
|
+
const ListPriceVariantCreatedAtSchema = zod_1.z.object({
|
|
65
|
+
after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
66
|
+
before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
67
|
+
on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
68
|
+
between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
|
|
69
|
+
});
|
|
70
|
+
const ListPriceVariantBusinessEntityIdSchema = zod_1.z.object({
|
|
71
|
+
is: zod_1.z.string().min(1).optional(),
|
|
72
|
+
is_present: zod_1.z.enum(['true', 'false']).optional(),
|
|
73
|
+
});
|
|
74
|
+
const ListPriceVariantIncludeSiteLevelResourcesSchema = zod_1.z.object({
|
|
75
|
+
is: zod_1.z.enum(['true', 'false']).optional(),
|
|
76
|
+
});
|
|
77
|
+
const ListPriceVariantSortBySchema = zod_1.z.looseObject({
|
|
78
|
+
asc: zod_1.z.enum(['name', 'id', 'status', 'created_at', 'updated_at']).optional(),
|
|
79
|
+
desc: zod_1.z.enum(['name', 'id', 'status', 'created_at', 'updated_at']).optional(),
|
|
80
|
+
});
|
|
81
|
+
const ListPriceVariantBodySchema = zod_1.z.looseObject({
|
|
82
|
+
limit: zod_1.z.number().int().min(1).max(100).optional(),
|
|
83
|
+
offset: zod_1.z.string().max(1000).optional(),
|
|
84
|
+
id: ListPriceVariantIdSchema.optional(),
|
|
85
|
+
name: ListPriceVariantNameSchema.optional(),
|
|
86
|
+
status: ListPriceVariantStatusSchema.optional(),
|
|
87
|
+
updated_at: ListPriceVariantUpdatedAtSchema.optional(),
|
|
88
|
+
created_at: ListPriceVariantCreatedAtSchema.optional(),
|
|
89
|
+
business_entity_id: ListPriceVariantBusinessEntityIdSchema.optional(),
|
|
90
|
+
include_site_level_resources: ListPriceVariantIncludeSiteLevelResourcesSchema.optional(),
|
|
91
|
+
sort_by: ListPriceVariantSortBySchema.optional(),
|
|
92
|
+
});
|
|
93
|
+
exports.ListPriceVariantBodySchema = ListPriceVariantBodySchema;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated Zod schemas: PricingPageSession
|
|
3
|
+
// Actions: createForNewSubscription, createForExistingSubscription
|
|
4
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CreateForExistingSubscriptionPricingPageSessionBodySchema = exports.CreateForNewSubscriptionPricingPageSessionBodySchema = void 0;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
//PricingPageSession.createForNewSubscription
|
|
9
|
+
const CreateForNewSubscriptionPricingPageSessionCustomSchema = zod_1.z.looseObject({});
|
|
10
|
+
const CreateForNewSubscriptionPricingPageSessionPricingPageSchema = zod_1.z.object({
|
|
11
|
+
id: zod_1.z.string().max(50),
|
|
12
|
+
});
|
|
13
|
+
const CreateForNewSubscriptionPricingPageSessionSubscriptionSchema = zod_1.z.looseObject({
|
|
14
|
+
id: zod_1.z.string().max(50).optional(),
|
|
15
|
+
});
|
|
16
|
+
const CreateForNewSubscriptionPricingPageSessionCustomerSchema = zod_1.z.looseObject({
|
|
17
|
+
id: zod_1.z.string().max(50).optional(),
|
|
18
|
+
email: zod_1.z.string().email().max(70).optional(),
|
|
19
|
+
first_name: zod_1.z.string().max(150).optional(),
|
|
20
|
+
last_name: zod_1.z.string().max(150).optional(),
|
|
21
|
+
company: zod_1.z.string().max(250).optional(),
|
|
22
|
+
phone: zod_1.z.string().max(50).optional(),
|
|
23
|
+
locale: zod_1.z.string().max(50).optional(),
|
|
24
|
+
});
|
|
25
|
+
const CreateForNewSubscriptionPricingPageSessionBillingAddressSchema = zod_1.z.object({
|
|
26
|
+
first_name: zod_1.z.string().max(150).optional(),
|
|
27
|
+
last_name: zod_1.z.string().max(150).optional(),
|
|
28
|
+
email: zod_1.z.string().email().max(70).optional(),
|
|
29
|
+
company: zod_1.z.string().max(250).optional(),
|
|
30
|
+
phone: zod_1.z.string().max(50).optional(),
|
|
31
|
+
line1: zod_1.z.string().max(150).optional(),
|
|
32
|
+
line2: zod_1.z.string().max(150).optional(),
|
|
33
|
+
line3: zod_1.z.string().max(150).optional(),
|
|
34
|
+
city: zod_1.z.string().max(50).optional(),
|
|
35
|
+
state_code: zod_1.z.string().max(50).optional(),
|
|
36
|
+
state: zod_1.z.string().max(50).optional(),
|
|
37
|
+
zip: zod_1.z.string().max(20).optional(),
|
|
38
|
+
country: zod_1.z.string().max(50).optional(),
|
|
39
|
+
validation_status: zod_1.z
|
|
40
|
+
.enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
|
|
41
|
+
.optional(),
|
|
42
|
+
});
|
|
43
|
+
const CreateForNewSubscriptionPricingPageSessionShippingAddressSchema = zod_1.z.object({
|
|
44
|
+
first_name: zod_1.z.string().max(150).optional(),
|
|
45
|
+
last_name: zod_1.z.string().max(150).optional(),
|
|
46
|
+
email: zod_1.z.string().email().max(70).optional(),
|
|
47
|
+
company: zod_1.z.string().max(250).optional(),
|
|
48
|
+
phone: zod_1.z.string().max(50).optional(),
|
|
49
|
+
line1: zod_1.z.string().max(150).optional(),
|
|
50
|
+
line2: zod_1.z.string().max(150).optional(),
|
|
51
|
+
line3: zod_1.z.string().max(150).optional(),
|
|
52
|
+
city: zod_1.z.string().max(50).optional(),
|
|
53
|
+
state_code: zod_1.z.string().max(50).optional(),
|
|
54
|
+
state: zod_1.z.string().max(50).optional(),
|
|
55
|
+
zip: zod_1.z.string().max(20).optional(),
|
|
56
|
+
country: zod_1.z.string().max(50).optional(),
|
|
57
|
+
validation_status: zod_1.z
|
|
58
|
+
.enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
|
|
59
|
+
.optional(),
|
|
60
|
+
});
|
|
61
|
+
const CreateForNewSubscriptionPricingPageSessionContractTermSchema = zod_1.z.object({
|
|
62
|
+
action_at_term_end: zod_1.z
|
|
63
|
+
.enum(['renew', 'evergreen', 'cancel', 'renew_once'])
|
|
64
|
+
.optional(),
|
|
65
|
+
cancellation_cutoff_period: zod_1.z.number().int().optional(),
|
|
66
|
+
});
|
|
67
|
+
const CreateForNewSubscriptionPricingPageSessionDiscountsSchema = zod_1.z.object({
|
|
68
|
+
apply_on: zod_1.z
|
|
69
|
+
.array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
|
|
70
|
+
.optional(),
|
|
71
|
+
duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
|
|
72
|
+
percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
|
|
73
|
+
amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
|
|
74
|
+
period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
75
|
+
period_unit: zod_1.z
|
|
76
|
+
.array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
|
|
77
|
+
.optional(),
|
|
78
|
+
included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
|
|
79
|
+
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
80
|
+
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
81
|
+
label: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
82
|
+
});
|
|
83
|
+
const CreateForNewSubscriptionPricingPageSessionBodySchema = zod_1.z.looseObject({
|
|
84
|
+
redirect_url: zod_1.z.string().max(250).optional(),
|
|
85
|
+
business_entity_id: zod_1.z.string().max(50).optional(),
|
|
86
|
+
auto_select_local_currency: zod_1.z.boolean().default(false).optional(),
|
|
87
|
+
custom: CreateForNewSubscriptionPricingPageSessionCustomSchema.optional(),
|
|
88
|
+
pricing_page: CreateForNewSubscriptionPricingPageSessionPricingPageSchema.optional(),
|
|
89
|
+
subscription: CreateForNewSubscriptionPricingPageSessionSubscriptionSchema.optional(),
|
|
90
|
+
customer: CreateForNewSubscriptionPricingPageSessionCustomerSchema.optional(),
|
|
91
|
+
billing_address: CreateForNewSubscriptionPricingPageSessionBillingAddressSchema.optional(),
|
|
92
|
+
shipping_address: CreateForNewSubscriptionPricingPageSessionShippingAddressSchema.optional(),
|
|
93
|
+
contract_term: CreateForNewSubscriptionPricingPageSessionContractTermSchema.optional(),
|
|
94
|
+
discounts: CreateForNewSubscriptionPricingPageSessionDiscountsSchema.optional(),
|
|
95
|
+
});
|
|
96
|
+
exports.CreateForNewSubscriptionPricingPageSessionBodySchema = CreateForNewSubscriptionPricingPageSessionBodySchema;
|
|
97
|
+
//PricingPageSession.createForExistingSubscription
|
|
98
|
+
const CreateForExistingSubscriptionPricingPageSessionCustomSchema = zod_1.z.looseObject({});
|
|
99
|
+
const CreateForExistingSubscriptionPricingPageSessionPricingPageSchema = zod_1.z.object({
|
|
100
|
+
id: zod_1.z.string().max(50).optional(),
|
|
101
|
+
});
|
|
102
|
+
const CreateForExistingSubscriptionPricingPageSessionSubscriptionSchema = zod_1.z.looseObject({
|
|
103
|
+
id: zod_1.z.string().max(50),
|
|
104
|
+
});
|
|
105
|
+
const CreateForExistingSubscriptionPricingPageSessionContractTermSchema = zod_1.z.object({
|
|
106
|
+
action_at_term_end: zod_1.z
|
|
107
|
+
.enum(['renew', 'evergreen', 'cancel', 'renew_once'])
|
|
108
|
+
.optional(),
|
|
109
|
+
cancellation_cutoff_period: zod_1.z.number().int().optional(),
|
|
110
|
+
});
|
|
111
|
+
const CreateForExistingSubscriptionPricingPageSessionDiscountsSchema = zod_1.z.object({
|
|
112
|
+
apply_on: zod_1.z
|
|
113
|
+
.array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
|
|
114
|
+
.optional(),
|
|
115
|
+
duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
|
|
116
|
+
percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
|
|
117
|
+
amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
|
|
118
|
+
period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
119
|
+
period_unit: zod_1.z
|
|
120
|
+
.array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
|
|
121
|
+
.optional(),
|
|
122
|
+
included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
|
|
123
|
+
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
124
|
+
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
125
|
+
label: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
126
|
+
});
|
|
127
|
+
const CreateForExistingSubscriptionPricingPageSessionBodySchema = zod_1.z.looseObject({
|
|
128
|
+
redirect_url: zod_1.z.string().max(250).optional(),
|
|
129
|
+
custom: CreateForExistingSubscriptionPricingPageSessionCustomSchema.optional(),
|
|
130
|
+
pricing_page: CreateForExistingSubscriptionPricingPageSessionPricingPageSchema.optional(),
|
|
131
|
+
subscription: CreateForExistingSubscriptionPricingPageSessionSubscriptionSchema.optional(),
|
|
132
|
+
contract_term: CreateForExistingSubscriptionPricingPageSessionContractTermSchema.optional(),
|
|
133
|
+
discounts: CreateForExistingSubscriptionPricingPageSessionDiscountsSchema.optional(),
|
|
134
|
+
});
|
|
135
|
+
exports.CreateForExistingSubscriptionPricingPageSessionBodySchema = CreateForExistingSubscriptionPricingPageSessionBodySchema;
|