1 import { USED_CLIENT_FLAGS } from '../interfaces';
2 import { hasBitBigInt } from './bitset';
33 } = USED_CLIENT_FLAGS;
35 const isAndroidCalendarUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, ANDROID_CALENDAR);
36 const isIOSCalendarUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, IOS_CALENDAR);
38 const isWebDriveUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, WEB_DRIVE);
39 const isAndroidDriveUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, ANDROID_DRIVE);
40 const isIOSDriveUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, IOS_DRIVE);
41 const isDesktopDriveUser = (usedClientFlags: bigint) =>
42 hasBitBigInt(usedClientFlags, WINDOWS_DRIVE) || hasBitBigInt(usedClientFlags, MACOS_DRIVE);
44 const isAndroidMailUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, ANDROID_MAIL);
45 const isIOSMailUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, IOS_MAIL);
47 const isWebPassUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, WEB_PASS);
48 const isAndroidPassUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, ANDROID_PASS);
49 const isIOSPassUser = (usedClientFlags: bigint) => hasBitBigInt(usedClientFlags, IOS_PASS);
50 const isDesktopPassUser = (usedClientFlags: bigint) =>
51 hasBitBigInt(usedClientFlags, WINDOWS_PASS) ||
52 hasBitBigInt(usedClientFlags, LINUX_PASS) ||
53 hasBitBigInt(usedClientFlags, MACOS_PASS);
55 const isWebVPNUser = (usedClientFlags: bigint) =>
56 hasBitBigInt(usedClientFlags, WEB_VPN) ||
57 hasBitBigInt(usedClientFlags, WEB_VPN_SETTINGS) ||
58 hasBitBigInt(usedClientFlags, BROWSER_VPN);
59 const isAndroidVPNUser = (usedClientFlags: bigint) =>
60 hasBitBigInt(usedClientFlags, ANDROID_VPN) || hasBitBigInt(usedClientFlags, ANDROID_TV_VPN);
61 const isIOSVPNUser = (usedClientFlags: bigint) =>
62 hasBitBigInt(usedClientFlags, IOS_VPN) || hasBitBigInt(usedClientFlags, APPLE_TV_VPN);
63 const isDesktopVPNUser = (usedClientFlags: bigint) =>
64 hasBitBigInt(usedClientFlags, WINDOWS_VPN) ||
65 hasBitBigInt(usedClientFlags, LINUX_VPN) ||
66 hasBitBigInt(usedClientFlags, MACOS_VPN);
68 export const isCalendarMobileAppUser = (usedClientFlags: bigint) => {
70 isAndroidCalendarUser(usedClientFlags) || isIOSCalendarUser(usedClientFlags)
74 export const isDesktopInboxUser = (usedClientFlags: bigint) => {
76 hasBitBigInt(usedClientFlags, WINDOWS_INBOX) ||
77 hasBitBigInt(usedClientFlags, LINUX_INBOX) ||
78 hasBitBigInt(usedClientFlags, MACOS_INBOX)
82 export const isDriveUser = (usedClientFlags: bigint) => {
84 isWebDriveUser(usedClientFlags) ||
85 isAndroidDriveUser(usedClientFlags) ||
86 isIOSDriveUser(usedClientFlags) ||
87 isDesktopDriveUser(usedClientFlags)
91 export const isDriveMobileAppUser = (usedClientFlags: bigint) => {
93 isAndroidDriveUser(usedClientFlags) || isIOSDriveUser(usedClientFlags)
97 export const isMailMobileAppUser = (usedClientFlags: bigint) => {
99 isAndroidMailUser(usedClientFlags) || isIOSMailUser(usedClientFlags)
103 export const isPassUser = (usedClientFlags: bigint) => {
105 isWebPassUser(usedClientFlags) ||
106 isAndroidPassUser(usedClientFlags) ||
107 isIOSPassUser(usedClientFlags) ||
108 isDesktopPassUser(usedClientFlags)
112 export const isVPNUser = (usedClientFlags: bigint) => {
114 isWebVPNUser(usedClientFlags) ||
115 isAndroidVPNUser(usedClientFlags) ||
116 isIOSVPNUser(usedClientFlags) ||
117 isDesktopVPNUser(usedClientFlags)