Use same lock values as mobile clients
[ProtonMail-WebClient.git] / packages / shared / lib / calendar / apiModels.ts
blobd716dae9adb4d77520837e7b5877da317e6cb49c
1 import type { RequireSome } from '../interfaces';
2 import type { CalendarCreateOrUpdateEventBlobData, CalendarEvent } from '../interfaces/calendar';
4 export const getHasSharedEventContent = (
5     data: CalendarCreateOrUpdateEventBlobData
6 ): data is RequireSome<CalendarCreateOrUpdateEventBlobData, 'SharedEventContent'> => !!data.SharedEventContent;
8 export const getHasSharedKeyPacket = (
9     data: CalendarCreateOrUpdateEventBlobData
10 ): data is RequireSome<CalendarCreateOrUpdateEventBlobData, 'SharedKeyPacket'> => !!data.SharedKeyPacket;
12 export const getHasDefaultNotifications = ({ Notifications }: CalendarEvent) => {
13     return !Notifications;
16 export const getIsAutoAddedInvite = (
17     event: CalendarEvent
18 ): event is CalendarEvent & { AddressKeyPacket: string; AddressID: string } =>
19     !!event.AddressKeyPacket && !!event.AddressID;
21 export const getIsPersonalSingleEdit = ({ IsPersonalSingleEdit }: CalendarEvent) => IsPersonalSingleEdit;