feat: mail composition
Signed-off-by: Sebastian <krupinski01@gmail.com>
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
import type { EntityIdentifier, ServiceIdentifier } from '@MailManager/types/common'
|
||||
|
||||
export interface CompositionSenderInterface {
|
||||
provider: string
|
||||
service: string | number | null
|
||||
address: string
|
||||
name: string | null
|
||||
}
|
||||
|
||||
export interface CompositionMessageInterface {
|
||||
to: string[]
|
||||
cc: string[]
|
||||
bcc: string[]
|
||||
subject: string
|
||||
body: {
|
||||
text: string
|
||||
html: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface CompositionAttachmentInterface {
|
||||
identifier: string
|
||||
composition: string
|
||||
origin: 'source' | 'upload'
|
||||
name: string
|
||||
type: string
|
||||
size: number
|
||||
source: EntityIdentifier | null
|
||||
data?: string
|
||||
}
|
||||
|
||||
export interface CompositionStageRequest {
|
||||
identifier: string
|
||||
action: 'fresh' | 'reply' | 'forward'
|
||||
sender: CompositionSenderInterface
|
||||
source?: EntityIdentifier | null
|
||||
message: CompositionMessageInterface
|
||||
}
|
||||
|
||||
export interface CompositionStageResponse {
|
||||
identifier: string
|
||||
revision: number
|
||||
disposition: 'staged'
|
||||
attachments: Record<string, CompositionAttachmentInterface>
|
||||
}
|
||||
|
||||
export interface CompositionPatchRequest {
|
||||
identifier: string
|
||||
revision: number
|
||||
sender: CompositionSenderInterface
|
||||
message: CompositionMessageInterface
|
||||
}
|
||||
|
||||
export interface CompositionPatchResponse {
|
||||
identifier: string
|
||||
revision: number
|
||||
message: CompositionMessageInterface
|
||||
}
|
||||
|
||||
export interface CompositionDiscardRequest {
|
||||
identifier: string
|
||||
}
|
||||
|
||||
export interface CompositionDiscardResponse {
|
||||
identifier: string
|
||||
disposition: boolean
|
||||
}
|
||||
|
||||
export interface CompositionSendRequest {
|
||||
identifier: string
|
||||
revision: number
|
||||
sender: CompositionSenderInterface
|
||||
message: CompositionMessageInterface
|
||||
attachments: Record<string, CompositionAttachmentInterface>
|
||||
}
|
||||
|
||||
export interface CompositionSendResponse {
|
||||
identifier: string
|
||||
disposition: boolean
|
||||
}
|
||||
|
||||
export interface CompositionAttachmentAddRequest {
|
||||
composition: string
|
||||
attachments: Record<string, CompositionAttachmentInterface>
|
||||
}
|
||||
|
||||
export interface CompositionAttachmentAddResponse {
|
||||
disposition: 'added' | 'error'
|
||||
error?: {
|
||||
type: string
|
||||
message: string
|
||||
}
|
||||
composition: string
|
||||
attachments: Record<string, CompositionAttachmentInterface>
|
||||
}
|
||||
|
||||
export interface CompositionAttachmentRemoveRequest {
|
||||
composition: string
|
||||
identifier: string
|
||||
}
|
||||
|
||||
export interface CompositionAttachmentRemoveResponse {
|
||||
disposition: 'removed' | 'error'
|
||||
error?: {
|
||||
type: string
|
||||
message: string
|
||||
}
|
||||
composition: string
|
||||
identifier: string
|
||||
}
|
||||
Reference in New Issue
Block a user