1 import type { AutoResponder as tsAutoResponder } from '../interfaces/AutoResponder';
2 import type { BLOCK_SENDER_CONFIRMATION } from '../mail/constants';
4 AUTO_DELETE_SPAM_AND_TRASH_DAYS,
12 } from '../mail/mailSettings';
14 export const getMailSettings = () => ({
15 url: 'mail/v4/settings',
19 export const updatePageSize = (PageSize: MAIL_PAGE_SIZE) => ({
20 url: 'mail/v4/settings/pagesize',
25 export const updateNextMessageOnMove = (NextMessageOnMove: NEXT_MESSAGE_ON_MOVE) => ({
26 url: 'mail/v4/settings/next-message-on-move',
28 data: { NextMessageOnMove },
31 export const updateShowMoved = (ShowMoved: number) => ({
32 url: 'mail/v4/settings/moved',
37 export const updateHideRemoteImages = (HideRemoteImages: number) => ({
38 url: 'mail/v4/settings/hide-remote-images',
40 data: { HideRemoteImages },
43 export const updateShowAlmostAllMail = (AlmostAllMail: number) => ({
44 url: 'mail/v4/settings/almost-all-mail',
46 data: { AlmostAllMail },
49 export const updateHideEmbeddedImages = (HideEmbeddedImages: number) => ({
50 url: 'mail/v4/settings/hide-embedded-images',
52 data: { HideEmbeddedImages },
55 export const updateAutoSaveContacts = (AutoSaveContacts: number) => ({
56 url: 'mail/v4/settings/autocontacts',
58 data: { AutoSaveContacts },
61 export const updateTheme = (Theme: string | number) => ({
62 url: 'mail/v4/settings/theme',
67 export const updateDisplayName = (DisplayName: string) => ({
68 url: 'mail/v4/settings/display',
70 data: { DisplayName },
73 export const updateSignature = (Signature: string) => ({
74 url: 'mail/v4/settings/signature',
79 export const updatePMSignature = (PMSignature: number) => ({
80 url: 'mail/v4/settings/pmsignature',
82 data: { PMSignature },
85 export const updatePMSignatureReferralLink = (PMSignatureReferralLink: PM_SIGNATURE_REFERRAL) => ({
86 url: 'mail/v4/settings/pmsignature-referral',
88 data: { PMSignatureReferralLink },
91 export const updateComposerMode = (ComposerMode: number) => ({
92 url: 'mail/v4/settings/composermode',
94 data: { ComposerMode },
97 export const updateMessageButtons = (MessageButtons: number) => ({
98 url: 'mail/v4/settings/messagebuttons',
100 data: { MessageButtons },
103 export const updateViewMode = (ViewMode: number) => ({
104 url: 'mail/v4/settings/viewmode',
109 export const updateStickyLabels = (StickyLabels: number) => ({
110 url: 'mail/v4/settings/stickylabels',
112 data: { StickyLabels },
115 export const updateDraftType = (MIMEType: string) => ({
116 url: 'mail/v4/settings/drafttype',
121 export const updateRightToLeft = (RightToLeft: DIRECTION) => ({
122 url: 'mail/v4/settings/righttoleft',
124 data: { RightToLeft },
127 export const updateViewLayout = (ViewLayout: number) => ({
128 url: 'mail/v4/settings/viewlayout',
130 data: { ViewLayout },
133 export const updatePromptPin = (PromptPin: number) => ({
134 url: 'mail/v4/settings/promptpin',
139 export const updateKT = (KT: number) => ({
140 url: 'mail/v4/settings/kt',
145 export const updatePGPScheme = (PGPScheme: number) => ({
146 url: 'mail/v4/settings/pgpscheme',
151 export const updateSign = (Sign: number) => ({
152 url: 'mail/v4/settings/sign',
157 export const updateAttachPublicKey = (AttachPublicKey: number) => ({
158 url: 'mail/v4/settings/attachpublic',
160 data: { AttachPublicKey },
163 export const updateShortcuts = (Shortcuts: number) => ({
164 url: 'mail/v4/settings/shortcuts',
169 export const updateAutoresponder = (AutoResponder: tsAutoResponder) => ({
170 url: 'mail/v4/settings/autoresponder',
172 data: { AutoResponder },
175 export const updateConfirmLink = (ConfirmLink: number) => ({
176 url: 'mail/v4/settings/confirmlink',
178 data: { ConfirmLink },
181 export const updateDelaySend = (DelaySendSeconds: number) => ({
182 url: 'mail/v4/settings/delaysend',
184 data: { DelaySendSeconds },
187 export const updateEnableFolderColor = (EnableFolderColor: number) => ({
188 url: 'mail/v4/settings/enablefoldercolor',
190 data: { EnableFolderColor },
193 export const updateInheritParentFolderColor = (InheritParentFolderColor: number) => ({
194 url: 'mail/v4/settings/inheritparentfoldercolor',
196 data: { InheritParentFolderColor },
199 export const updateFontFace = (FontFace: string) => ({
200 url: 'mail/v4/settings/fontface',
205 export const updateFontSize = (FontSize: number) => ({
206 url: 'mail/v4/settings/fontsize',
211 export const updateImageProxy = (ImageProxy: number, Action: 'add' | 'remove') => ({
212 url: 'mail/v4/settings/imageproxy',
214 data: { ImageProxy, Action: Action === 'add' ? 1 : 0 },
217 export const updateSpamAction = (SpamAction: SPAM_ACTION | null) => ({
218 url: 'mail/v4/settings/spam-action',
220 data: { SpamAction },
223 export const updateBlockSenderConfirmation = (BlockSenderConfirmation: BLOCK_SENDER_CONFIRMATION | null) => ({
224 url: 'mail/v4/settings/block-sender-confirmation',
226 data: { BlockSenderConfirmation },
229 export const updateHideSenderImages = (HideSenderImages: number) => ({
230 url: 'mail/v4/settings/hide-sender-images',
232 data: { HideSenderImages },
235 export const updateDisplayUnreadFavicon = (UnreadFavicon: number) => ({
236 url: 'mail/v4/settings/unread-favicon',
238 data: { UnreadFavicon },
241 export const updateAutoDelete = (AutoDeleteSpamAndTrashDays: AUTO_DELETE_SPAM_AND_TRASH_DAYS) => ({
242 url: 'mail/v4/settings/auto-delete-spam-and-trash-days',
244 data: { Days: AutoDeleteSpamAndTrashDays },
247 export const updateSwipeLeft = (SwipeLeft: SWIPE_ACTION) => ({
248 url: 'mail/v4/settings/swipeleft',
253 export const updateSwipeRight = (SwipeRight: SWIPE_ACTION) => ({
254 url: 'mail/v4/settings/swiperight',
256 data: { SwipeRight },
259 export const updateRemoveImageMetadata = (RemoveImageMetadata: REMOVE_IMAGE_METADATA) => ({
260 url: 'mail/v4/settings/remove-image-metadata',
262 data: { RemoveImageMetadata },