chargebee
Version:
A library for integrating with Chargebee.
70 lines (69 loc) • 2.18 kB
JavaScript
;
// Generated Zod schemas: Comment
// Actions: create, list
// Do not edit manually – regenerate via sdk-generator
Object.defineProperty(exports, "__esModule", { value: true });
exports.ListCommentBodySchema = exports.CreateCommentBodySchema = void 0;
const zod_1 = require("zod");
//Comment.create
const CreateCommentBodySchema = zod_1.z.looseObject({
entity_type: zod_1.z.enum([
'customer',
'subscription',
'invoice',
'quote',
'credit_note',
'transaction',
'plan',
'addon',
'coupon',
'order',
'business_entity',
'item_family',
'item',
'item_price',
'price_variant',
]),
entity_id: zod_1.z.string().max(100),
notes: zod_1.z.string().max(1000),
added_by: zod_1.z.string().max(100).optional(),
});
exports.CreateCommentBodySchema = CreateCommentBodySchema;
//Comment.list
const ListCommentCreatedAtSchema = zod_1.z.object({
after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
});
const ListCommentSortBySchema = zod_1.z.looseObject({
asc: zod_1.z.enum(['created_at']).optional(),
desc: zod_1.z.enum(['created_at']).optional(),
});
const ListCommentBodySchema = zod_1.z.looseObject({
limit: zod_1.z.number().int().min(1).max(100).optional(),
offset: zod_1.z.string().max(1000).optional(),
entity_type: zod_1.z
.enum([
'customer',
'subscription',
'invoice',
'quote',
'credit_note',
'transaction',
'plan',
'addon',
'coupon',
'order',
'business_entity',
'item_family',
'item',
'item_price',
'price_variant',
])
.optional(),
entity_id: zod_1.z.string().max(100).optional(),
created_at: ListCommentCreatedAtSchema.optional(),
sort_by: ListCommentSortBySchema.optional(),
});
exports.ListCommentBodySchema = ListCommentBodySchema;