Merge branch 'INDA-330-pii-update' into 'main'
[ProtonMail-WebClient.git] / packages / sieve / fixtures / folder.ts
blob5a9a289e9e83bc9177fa810632f8948473a1efa5
1 /*
2  * Sieve/Tree test inputs
3  */
4 import type { SimpleObject } from '@proton/components/containers/filters/interfaces';
5 import { ConditionComparator, ConditionType, FilterStatement } from '@proton/components/containers/filters/interfaces';
7 const tree = [
8     {
9         List: ['fileinto', 'imap4flags'],
10         Type: 'Require',
11     },
12     {
13         If: {
14             Tests: [
15                 {
16                     Headers: ['Subject'],
17                     Keys: ['Order'],
18                     Match: {
19                         Type: 'Contains',
20                     },
21                     Format: {
22                         Type: 'UnicodeCaseMap',
23                     },
24                     Type: 'Header',
25                 },
26             ],
27             Type: 'AllOf',
28         },
29         Then: [
30             {
31                 Type: 'FileInto',
32                 Name: 'important',
33             },
34             {
35                 Type: 'FileInto',
36                 Name: 'Folder',
37             },
38             {
39                 Type: 'AddFlag',
40                 Flags: ['\\Seen'],
41             },
42             {
43                 Type: 'Keep',
44             },
45         ],
46         Type: 'If',
47     },
50 const simple: SimpleObject = {
51     Operator: {
52         label: 'All',
53         value: FilterStatement.ALL,
54     },
55     Conditions: [
56         {
57             Values: ['Order'],
58             Type: {
59                 label: 'Subject',
60                 value: ConditionType.SUBJECT,
61             },
62             Comparator: {
63                 label: 'contains',
64                 value: ConditionComparator.CONTAINS,
65             },
66         },
67     ],
68     Actions: {
69         FileInto: ['important', 'Folder'],
70         Mark: {
71             Read: true,
72             Starred: false,
73         },
74     },
77 export default { tree, simple };