import { z } from 'zod'
const InboxIdSchema = z.string().describe('ID of inbox')
const ThreadIdSchema = z.string().describe('ID of thread')
const MessageIdSchema = z.string().describe('ID of message')
const AttachmentIdSchema = z.string().describe('ID of attachment')
export const ListItemsParams = z.object({
limit: z.number().optional().default(10).describe('Max number of items to return'),
pageToken: z.string().optional().describe('Page token for pagination'),
})
export const GetInboxParams = z.object({
inboxId: InboxIdSchema,
})
export const CreateInboxParams = z.object({
username: z.string().optional().describe('Username'),
domain: z.string().optional().describe('Domain'),
displayName: z.string().optional().describe('Display name'),
})
export const ListInboxItemsParams = ListItemsParams.extend({
inboxId: InboxIdSchema,
labels: z.array(z.string()).optional().describe('Labels to filter items by'),
before: z.string().pipe(z.coerce.date()).optional().describe('Filter items before datetime'),
after: z.string().pipe(z.coerce.date()).optional().describe('Filter items after datetime'),
})
export const GetThreadParams = z.object({
inboxId: InboxIdSchema,
threadId: ThreadIdSchema,
})
export const GetAttachmentParams = z.object({
inboxId: InboxIdSchema,
threadId: ThreadIdSchema,
attachmentId: AttachmentIdSchema,
})
const BaseMessageParams = z.object({
inboxId: InboxIdSchema,
text: z.string().optional().describe('Plain text body'),
html: z.string().optional().describe('HTML body'),
labels: z.array(z.string()).optional().describe('Labels'),
})
export const SendMessageParams = BaseMessageParams.extend({
to: z.array(z.string()).describe('Recipients'),
cc: z.array(z.string()).optional().describe('CC recipients'),
bcc: z.array(z.string()).optional().describe('BCC recipients'),
subject: z.string().optional().describe('Subject'),
})
export const ReplyToMessageParams = BaseMessageParams.extend({
messageId: MessageIdSchema,
replyAll: z.boolean().optional().describe('Reply to all recipients'),
})
export const UpdateMessageParams = z.object({
inboxId: InboxIdSchema,
messageId: MessageIdSchema,
addLabels: z.array(z.string()).optional().describe('Labels to add'),
removeLabels: z.array(z.string()).optional().describe('Labels to remove'),
})