Skip to content
← Public packages

@kody/mailroom

Offline-first PWA for your Kody mailbox: sent and received threads, copy-prompt for agents, no send.

src/types.ts

51 lines · 1.1 KB · TypeScript
export type MailDirection = 'inbound' | 'outbound'

export type MailSummary = {
	id: string
	direction: MailDirection
	inbox_id: string | null
	thread_id: string | null
	from_address: string | null
	envelope_from: string | null
	to_addresses: Array<string>
	subject: string | null
	message_id_header: string | null
	processing_status: string
	classification: string
	delivery_status: string | null
	received_at: string | null
	sent_at: string | null
	created_at: string
	updated_at: string
}

export type MailAttachment = {
	id: string
	filename: string | null
	content_type: string | null
	size: number | null
}

export type MailMessage = MailSummary & {
	cc_addresses: Array<string>
	bcc_addresses: Array<string>
	reply_to_addresses: Array<string>
	in_reply_to_header: string | null
	references: Array<string>
	text_body: string | null
	html_body: string | null
	attachments: Array<MailAttachment>
}

export type MailThread = {
	id: string
	direction: MailDirection
	subject: string
	snippet: string
	latestAt: string
	messageCount: number
	from_address: string | null
	to_addresses: Array<string>
	participants: Array<string>
	messages: Array<MailSummary>
}