* Initial implementation of consumption templates * Frontend implementation of consumption templates Testing * Support consumption template source * order templates, automatically add permissions * Support title assignment in consumption templates * Refactoring, filters to and, show sources on list Show sources on template list, update some translation strings Make filters and minor testing * Update strings * Only update django-multiselectfield * Basic docs, document some methods * Improve testing coverage, template multi-assignment merges
74 lines
1.2 KiB
TypeScript
74 lines
1.2 KiB
TypeScript
import { ObjectWithPermissions } from './object-with-permissions'
|
|
|
|
export enum MailFilterAttachmentType {
|
|
Attachments = 1,
|
|
Everything = 2,
|
|
}
|
|
|
|
export enum MailRuleConsumptionScope {
|
|
Attachments = 1,
|
|
Email_Only = 2,
|
|
Everything = 3,
|
|
}
|
|
|
|
export enum MailAction {
|
|
Delete = 1,
|
|
Move = 2,
|
|
MarkRead = 3,
|
|
Flag = 4,
|
|
Tag = 5,
|
|
}
|
|
|
|
export enum MailMetadataTitleOption {
|
|
FromSubject = 1,
|
|
FromFilename = 2,
|
|
None = 3,
|
|
}
|
|
|
|
export enum MailMetadataCorrespondentOption {
|
|
FromNothing = 1,
|
|
FromEmail = 2,
|
|
FromName = 3,
|
|
FromCustom = 4,
|
|
}
|
|
|
|
export interface PaperlessMailRule extends ObjectWithPermissions {
|
|
name: string
|
|
|
|
account: number // PaperlessMailAccount.id
|
|
|
|
order: number
|
|
|
|
folder: string
|
|
|
|
filter_from: string
|
|
|
|
filter_to: string
|
|
|
|
filter_subject: string
|
|
|
|
filter_body: string
|
|
|
|
filter_attachment_filename: string
|
|
|
|
maximum_age: number
|
|
|
|
attachment_type: MailFilterAttachmentType
|
|
|
|
action: MailAction
|
|
|
|
action_parameter?: string
|
|
|
|
assign_title_from: MailMetadataTitleOption
|
|
|
|
assign_tags?: number[] // PaperlessTag.id
|
|
|
|
assign_document_type?: number // PaperlessDocumentType.id
|
|
|
|
assign_correspondent_from?: MailMetadataCorrespondentOption
|
|
|
|
assign_correspondent?: number // PaperlessCorrespondent.id
|
|
|
|
assign_owner_from_rule: boolean
|
|
}
|