2 import { BASE_SIZE } from '../helpers/size';
4 export const VCARD_KEY_FIELDS = [
8 'x-pm-encrypt-untrusted',
13 export const CLEAR_FIELDS = ['version', 'prodid', 'categories'];
14 export const SIGNED_FIELDS = ['version', 'prodid', 'fn', 'uid', 'email'].concat(VCARD_KEY_FIELDS);
16 export enum CRYPTO_PROCESSING_TYPES {
18 SIGNATURE_NOT_VERIFIED,
24 export enum OVERWRITE {
25 // when UID conflict at contact import
26 THROW_ERROR_IF_CONFLICT = 0,
27 OVERWRITE_CONTACT = 1,
30 export enum CATEGORIES {
35 export const OTHER_INFORMATION_FIELDS = [
49 export enum PGP_SCHEME_TEXT {
50 INLINE = 'PGP/Inline',
54 export enum ADDRESS_COMPONENTS {
64 export const CONTACT_IMG_SIZE = 180;
66 export const API_SAFE_INTERVAL = 100; // API request limit: 100 requests / 10 seconds, so 1 request every 100 ms is safe
67 export const QUERY_EXPORT_MAX_PAGESIZE = 50; // in GET API route /contacts/export
68 // Manual limit on number of imported contacts to be sent to the API, so that the response does not take too long
69 export const ADD_CONTACTS_MAX_SIZE = 10;
71 // FRONT-END RESTRICTIONS
72 export const MAX_SIMULTANEOUS_CONTACTS_ENCRYPT = 5;
74 export const MAX_CONTACTS_PER_USER = 10000;
75 export const MAX_IMPORT_CONTACTS_STRING = MAX_CONTACTS_PER_USER.toLocaleString();
76 export const MAX_IMPORT_FILE_SIZE = 10 * BASE_SIZE ** 2;
77 export const MAX_IMPORT_FILE_SIZE_STRING = '10 MB';
78 export const MAX_CONTACT_ID_CHARS_DISPLAY = 40;
79 export const MAX_FILENAME_CHARS_DISPLAY = 100;
80 export const CONTACT_NAME_MAX_LENGTH = 190;
81 // We remove one to avoid issue with space when computing the full name
82 export const CONTACT_FIRST_LAST_NAME_MAX_LENGTH = CONTACT_NAME_MAX_LENGTH / 2 - 1;
84 export const UID_PREFIX = 'contact-property';