UNPKG

chargebee

Version:

A library for integrating with Chargebee.

140 lines (139 loc) 8.88 kB
"use strict"; // Generated Zod schemas: UnbilledCharge // Actions: createUnbilledCharge, create, invoiceUnbilledCharges, list, invoiceNowEstimate // Do not edit manually – regenerate via sdk-generator Object.defineProperty(exports, "__esModule", { value: true }); exports.InvoiceNowEstimateUnbilledChargeBodySchema = exports.ListUnbilledChargeBodySchema = exports.InvoiceUnbilledChargesUnbilledChargeBodySchema = exports.CreateUnbilledChargeBodySchema = exports.CreateUnbilledChargeUnbilledChargeBodySchema = void 0; const zod_1 = require("zod"); //UnbilledCharge.createUnbilledCharge const CreateUnbilledChargeUnbilledChargeAddonsSchema = zod_1.z.object({ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(), quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(), unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(), unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(), date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(), date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(), }); const CreateUnbilledChargeUnbilledChargeChargesSchema = zod_1.z.object({ amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(), amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(), description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(), taxable: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(), tax_profile_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), avalara_tax_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), hsn_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), taxjar_product_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), avalara_sale_type: zod_1.z .array(zod_1.z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional()) .optional(), avalara_transaction_type: zod_1.z.array(zod_1.z.number().int().optional()).optional(), avalara_service_type: zod_1.z.array(zod_1.z.number().int().optional()).optional(), date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(), date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(), }); const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema = zod_1.z.object({ provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), }); const CreateUnbilledChargeUnbilledChargeBodySchema = zod_1.z.looseObject({ subscription_id: zod_1.z.string().max(50), currency_code: zod_1.z.string().max(3).optional(), addons: CreateUnbilledChargeUnbilledChargeAddonsSchema.optional(), charges: CreateUnbilledChargeUnbilledChargeChargesSchema.optional(), tax_providers_fields: CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema.optional(), }); exports.CreateUnbilledChargeUnbilledChargeBodySchema = CreateUnbilledChargeUnbilledChargeBodySchema; //UnbilledCharge.create const CreateUnbilledChargeItemPricesSchema = zod_1.z.object({ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(), quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(), quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(), unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(), date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(), date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(), }); const CreateUnbilledChargeItemTiersSchema = zod_1.z.object({ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(), starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(), ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(), price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(), starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(), ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(), price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(), pricing_type: zod_1.z .array(zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional()) .optional(), package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(), }); const CreateUnbilledChargeChargesSchema = zod_1.z.object({ amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(), amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(), description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(), taxable: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(), tax_profile_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), avalara_tax_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), hsn_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), taxjar_product_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), avalara_sale_type: zod_1.z .array(zod_1.z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional()) .optional(), avalara_transaction_type: zod_1.z.array(zod_1.z.number().int().optional()).optional(), avalara_service_type: zod_1.z.array(zod_1.z.number().int().optional()).optional(), date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(), date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(), }); const CreateUnbilledChargeTaxProvidersFieldsSchema = zod_1.z.object({ provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(), }); const CreateUnbilledChargeBodySchema = zod_1.z.looseObject({ subscription_id: zod_1.z.string().max(50), currency_code: zod_1.z.string().max(3).optional(), item_prices: CreateUnbilledChargeItemPricesSchema.optional(), item_tiers: CreateUnbilledChargeItemTiersSchema.optional(), charges: CreateUnbilledChargeChargesSchema.optional(), tax_providers_fields: CreateUnbilledChargeTaxProvidersFieldsSchema.optional(), }); exports.CreateUnbilledChargeBodySchema = CreateUnbilledChargeBodySchema; //UnbilledCharge.invoiceUnbilledCharges const InvoiceUnbilledChargesUnbilledChargeBodySchema = zod_1.z.looseObject({ subscription_id: zod_1.z.string().max(50).optional(), customer_id: zod_1.z.string().max(50).optional(), }); exports.InvoiceUnbilledChargesUnbilledChargeBodySchema = InvoiceUnbilledChargesUnbilledChargeBodySchema; //UnbilledCharge.list const ListUnbilledChargeSubscriptionIdSchema = zod_1.z.object({ is: zod_1.z.string().min(1).optional(), is_not: zod_1.z.string().min(1).optional(), starts_with: zod_1.z.string().min(1).optional(), is_present: zod_1.z.enum(['true', 'false']).optional(), in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListUnbilledChargeCustomerIdSchema = zod_1.z.object({ is: zod_1.z.string().min(1).optional(), is_not: zod_1.z.string().min(1).optional(), starts_with: zod_1.z.string().min(1).optional(), is_present: zod_1.z.enum(['true', 'false']).optional(), in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListUnbilledChargeBodySchema = zod_1.z.looseObject({ limit: zod_1.z.number().int().min(1).max(100).optional(), offset: zod_1.z.string().max(1000).optional(), include_deleted: zod_1.z.boolean().default(false).optional(), is_voided: zod_1.z.boolean().default(false).optional(), subscription_id: ListUnbilledChargeSubscriptionIdSchema.optional(), customer_id: ListUnbilledChargeCustomerIdSchema.optional(), }); exports.ListUnbilledChargeBodySchema = ListUnbilledChargeBodySchema; //UnbilledCharge.invoiceNowEstimate const InvoiceNowEstimateUnbilledChargeBodySchema = zod_1.z.looseObject({ subscription_id: zod_1.z.string().max(50).optional(), customer_id: zod_1.z.string().max(50).optional(), }); exports.InvoiceNowEstimateUnbilledChargeBodySchema = InvoiceNowEstimateUnbilledChargeBodySchema;