index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/createSecureSessionStorage.ts | import { load, save } from '../helpers/secureSessionStorage';
import createStore from '../helpers/store';
const createSecureSessionStorage = () => {
const store = createStore(load());
if ('onpagehide' in window) {
const handlePageShow = () => {
// This does not need to do anything. The mai... | 8,300 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/cryptoHelper.ts | import mergeUint8Arrays from '@proton/utils/mergeUint8Arrays';
const IV_LENGTH = 16;
export const ENCRYPTION_ALGORITHM = 'AES-GCM';
export const getKey = (key: Uint8Array, keyUsage: KeyUsage[] = ['decrypt', 'encrypt']) => {
return crypto.subtle.importKey('raw', key.buffer, ENCRYPTION_ALGORITHM, false, keyUsage);
... | 8,301 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/error.ts | // eslint-disable-next-line max-classes-per-file
export class InvalidPersistentSessionError extends Error {
constructor(message?: string) {
super(['Invalid persistent session', message].filter(Boolean).join(':'));
Object.setPrototypeOf(this, InvalidPersistentSessionError.prototype);
}
}
export ... | 8,302 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/interface.ts | import { AuthenticationCredentialsPayload, AuthenticationOptions, RegisteredKey } from '../webauthn/interface';
export interface Fido2Response {
AuthenticationOptions: AuthenticationOptions;
RegisteredKeys: RegisteredKey[];
}
export type Fido2Data = AuthenticationCredentialsPayload;
export interface TwoFaRes... | 8,303 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/loginWithFallback.ts | import { getAuthVersionWithFallback } from '@proton/srp';
import { PASSWORD_WRONG_ERROR, auth, getInfo } from '../api/auth';
import { Api } from '../interfaces';
import { srpAuth } from '../srp';
import { AuthResponse, AuthVersion, ChallengePayload, InfoResponse } from './interface';
/**
* Provides authentication wi... | 8,304 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/logout.ts | import { getAppHref } from '@proton/shared/lib/apps/helper';
import { PersistedSession } from '@proton/shared/lib/authentication/SessionInterface';
import { APPS } from '@proton/shared/lib/constants';
import { decodeBase64URL, encodeBase64URL } from '@proton/shared/lib/helpers/encoding';
interface PassedSession {
... | 8,305 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/memberLogin.js | /**
* Opens a window to login to a non-private member.
* @param {String} UID
* @param {String} mailboxPassword - The admin mailbox password
* @param {String} url - Absolute URL path
* @param {Number} [timeout]
* @return {Promise}
*/
export default ({ UID, mailboxPassword, url: urlString, timeout = 20000 }) => {
... | 8,306 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/mutate.ts | import type { AuthenticationStore } from '@proton/shared/lib/authentication/createAuthenticationStore';
import { persistSessionWithPassword } from '@proton/shared/lib/authentication/persistedSessionHelper';
import { isSSOMode } from '@proton/shared/lib/constants';
import { PASSWORD_CHANGE_MESSAGE_TYPE, sendMessageToTab... | 8,307 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/pathnameHelper.ts | import { PUBLIC_PATH } from '../constants';
import { stripLeadingAndTrailingSlash } from '../helpers/string';
import { getValidatedLocalID } from './sessionForkValidation';
export const getLocalIDPath = (u?: number) => (u === undefined ? undefined : `u/${u}`);
export const getLocalIDFromPathname = (pathname: string) ... | 8,308 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/persistedSessionHelper.ts | import { updateVersionCookie, versionCookieAtLoad } from '@proton/components/hooks/useEarlyAccess';
import { PersistedSessionWithLocalID } from '@proton/shared/lib/authentication/SessionInterface';
import { getIsIframe } from '@proton/shared/lib/helpers/browser';
import { captureMessage } from '@proton/shared/lib/helpe... | 8,309 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/persistedSessionStorage.ts | import isTruthy from '@proton/utils/isTruthy';
import { removeLastRefreshDate } from '../api/helpers/refreshStorage';
import { getItem, removeItem, setItem } from '../helpers/storage';
import { PersistedSession, PersistedSessionBlob, PersistedSessionWithLocalID } from './SessionInterface';
import { InvalidPersistentSe... | 8,310 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/sessionBlobCryptoHelper.ts | import {
base64StringToUint8Array,
stringToUint8Array,
uint8ArrayToBase64String,
uint8ArrayToString,
} from '../helpers/encoding';
import { decryptData, encryptData } from './cryptoHelper';
export const getEncryptedBlob = async (key: CryptoKey, data: string) => {
const result = await encryptData(ke... | 8,311 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/sessionForkBlob.ts | import { getDecryptedBlob, getEncryptedBlob } from './sessionBlobCryptoHelper';
interface ForkEncryptedBlob {
keyPassword: string;
}
export const getForkEncryptedBlob = async (key: CryptoKey, data: ForkEncryptedBlob) => {
return getEncryptedBlob(key, JSON.stringify(data));
};
export const getForkDecryptedBlob... | 8,312 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/sessionForkValidation.ts | import { APP_NAMES, FORKABLE_APPS } from '../constants';
import { decodeBase64URL, stringToUint8Array } from '../helpers/encoding';
import { FORK_TYPE } from './ForkInterface';
export const getValidatedApp = (app = ''): APP_NAMES | undefined => {
if (FORKABLE_APPS.has(app as any)) {
return app as APP_NAMES... | 8,313 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authentication/sessionForking.ts | import { getPathFromLocation } from '@proton/shared/lib/helpers/url';
import getRandomString from '@proton/utils/getRandomString';
import noop from '@proton/utils/noop';
import { pullForkSession, pushForkSession, revoke, setCookies } from '../api/auth';
import { OAuthForkResponse, postOAuthFork } from '../api/oauth';
... | 8,314 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authlog/AuthLog.ts | export enum AUTH_LOG_EVENTS {
LOGIN_FAILURE_PASSWORD = 0,
LOGIN_SUCCESS,
LOGOUT,
LOGIN_FAILURE_2FA,
LOGIN_SUCCESS_AWAIT_2FA,
LOGIN_SUCCESS_FORBIDDEN,
LOGIN_SUCCESS_MNEMONIC,
LOGIN_FAILURE_MNEMONIC,
LOGIN_SUCCESS_ADMIN,
LOGIN_BLOCKED,
LOGIN_SUCCESS_AWAIT_VERIFY = 80,
LOGIN... | 8,315 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/authlog/index.ts | export * from './AuthLog';
| 8,316 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/broadcast/broadcast.ts | const getClient = () => {
const {
navigator: { standalone, userAgent },
} = window as any;
const lowercaseUserAgent = userAgent.toLowerCase();
const safari = /safari/.test(lowercaseUserAgent);
const ios = /iphone|ipod|ipad/.test(lowercaseUserAgent);
if (ios) {
if (!standalone &&... | 8,317 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/broadcast/helper.ts | import { getApiError, getApiErrorMessage } from '../api/helpers/apiErrorHelper';
import { GenericErrorPayload } from './interface';
export const getGenericErrorPayload = (e: any): GenericErrorPayload => {
const apiError = getApiError(e);
return {
message: getApiErrorMessage(e) || e.message || 'Unknown ... | 8,318 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/broadcast/index.ts | import broadcast from './broadcast';
export * from './interface';
export * from './helper';
export default broadcast;
| 8,319 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/broadcast/interface.ts | export interface GenericErrorPayload {
status?: number;
message: string;
code?: number;
details?: any;
}
| 8,320 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/browser/credentials.ts | export async function storeCredentials(id: string, password: string) {
if (!navigator.credentials) {
return; // Feature not available
}
try {
// @ts-ignore
const cred = new window.PasswordCredential({
id,
password,
});
await navigator.credenti... | 8,321 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/browser/extension.ts | import getRandomString from '@proton/utils/getRandomString';
export type ExtensionMessage<T = {}> = { type: string } & T;
/* extension communicating with account should
* conform to this message response type */
export type ExtensionMessageResponse<P extends {}> =
| { type: 'success'; payload: P }
| { type: ... | 8,322 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/busy/busy.ts | import noop from '@proton/utils/noop';
import { traceError } from '../helpers/sentry';
import { ProtonConfig } from '../interfaces';
let uid = 0;
let busies = [] as number[];
const unregister = (id: number) => {
busies = busies.filter((busy) => busy !== id);
};
const register = () => {
const id = uid++;
... | 8,323 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/busy/index.ts | export { default } from './busy';
export * from './busy';
| 8,324 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/alarms.ts | import truncate from '@proton/utils/truncate';
import uniqueBy from '@proton/utils/uniqueBy';
import { MINUTE } from '../constants';
import { convertUTCDateTimeToZone, fromUTCDate, getTimezoneOffset, toUTCDate } from '../date/timezone';
import { omit } from '../helpers/object';
import {
NotificationModel,
Vcal... | 8,325 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/api.ts | import { getEventByUID } from '../api/calendars';
import { Api } from '../interfaces';
import { CalendarEvent, GetEventByUIDArguments } from '../interfaces/calendar';
import { CALENDAR_TYPE } from './constants';
const MAX_ITERATIONS = 100;
export const getPaginatedEventsByUID = async ({
api,
uid,
recurren... | 8,326 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/apiModels.ts | import { RequireSome } from '../interfaces';
import { CalendarCreateOrUpdateEventBlobData, CalendarEvent } from '../interfaces/calendar';
export const getHasSharedEventContent = (
data: CalendarCreateOrUpdateEventBlobData
): data is RequireSome<CalendarCreateOrUpdateEventBlobData, 'SharedEventContent'> => !!data.S... | 8,327 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/attendees.ts | import { CryptoProxy } from '@proton/crypto';
import { arrayToHexString, binaryStringToArray } from '@proton/crypto/lib/utils';
import groupWith from '@proton/utils/groupWith';
import isTruthy from '@proton/utils/isTruthy';
import unary from '@proton/utils/unary';
import { CONTACT_NAME_MAX_LENGTH } from '../contacts/c... | 8,328 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/author.ts | import { PublicKeyReference } from '@proton/crypto';
import { captureMessage } from '@proton/shared/lib/helpers/sentry';
import { ContactEmail } from '@proton/shared/lib/interfaces/contacts';
import { GetVerificationPreferences } from '@proton/shared/lib/interfaces/hooks/GetVerificationPreferences';
import isTruthy fro... | 8,329 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/badges.ts | import { c } from 'ttag';
import { BadgeType } from '@proton/components/components/badge/Badge';
import { SubscribedCalendar, VisualCalendar } from '../interfaces/calendar';
import { getIsCalendarDisabled, getIsCalendarProbablyActive, getIsSubscribedCalendar } from './calendar';
import { getCalendarHasSubscriptionPar... | 8,330 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/calendar.ts | import isTruthy from '@proton/utils/isTruthy';
import unary from '@proton/utils/unary';
import { updateCalendarSettings, updateMember } from '../api/calendars';
import { hasBit, toggleBit } from '../helpers/bitset';
import { Address, Api } from '../interfaces';
import {
Calendar,
CalendarCreateData,
Calend... | 8,331 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/calendarLimits.ts | import { c } from 'ttag';
import { BRAND_NAME, MAIL_SHORT_APP_NAME } from '../constants';
import { VisualCalendar } from '../interfaces/calendar';
import { getOwnedPersonalCalendars } from './calendar';
import { MAX_CALENDARS_FREE, MAX_CALENDARS_PAID } from './constants';
export const getHasUserReachedCalendarsLimit ... | 8,332 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/constants.ts | import { ACCENT_COLORS } from '../colors';
import { BASE_SIZE } from '../constants';
export const MAX_CALENDARS_FREE = 3;
export const MAX_CALENDARS_PAID = 25; // Only paid mail
export const MAX_CALENDARS_FAMILY = 150;
export const MAX_DEFAULT_NOTIFICATIONS = 5;
export const MAX_NOTIFICATIONS = 10;
export const MAX_A... | 8,333 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/deserialize.ts | import { PrivateKeyReference, PublicKeyReference, SessionKey } from '@proton/crypto';
import { getIsAddressActive, getIsAddressExternal } from '../helpers/address';
import { canonicalizeInternalEmail } from '../helpers/email';
import { base64StringToUint8Array } from '../helpers/encoding';
import { Address, Nullable }... | 8,334 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/exdate.ts | import { toUTCDate } from '../date/timezone';
import { DateTimeValue } from '../interfaces/calendar';
import { VcalDateOrDateTimeProperty, VcalDateProperty, VcalDateTimeProperty } from '../interfaces/calendar/VcalModel';
import { getDateProperty, getDateTimeProperty } from './vcalConverter';
export const createExdateM... | 8,335 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/formatData.ts | import { CalendarNotificationSettings, CreateOrUpdateCalendarEventData } from '@proton/shared/lib/interfaces/calendar';
import isTruthy from '@proton/utils/isTruthy';
import { uint8ArrayToBase64String } from '../helpers/encoding';
import { SimpleMap } from '../interfaces';
import { AttendeeClearPartResult } from '../i... | 8,336 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/getComponentFromCalendarEvent.ts | import { CalendarEvent, SharedVcalVeventComponent } from '../interfaces/calendar';
import { CALENDAR_CARD_TYPE } from './constants';
import { unwrap } from './helper';
import { parse } from './vcal';
const { CLEAR_TEXT, SIGNED } = CALENDAR_CARD_TYPE;
const getComponentFromCalendarEvent = (eventData: CalendarEvent): S... | 8,337 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/getMemberWithAdmin.ts | import { hasBit } from '../helpers/bitset';
import { Address as AddressInterface } from '../interfaces';
import { CalendarMember as MemberInterface } from '../interfaces/calendar';
import { CALENDAR_PERMISSIONS } from './constants';
export const getMemberAddressWithAdminPermissions = (Members: MemberInterface[], Addre... | 8,338 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/getSettings.ts | import { CalendarUserSettings } from '../interfaces/calendar';
import { SETTINGS_VIEW, VIEWS } from './constants';
export const getAutoDetectPrimaryTimezone = (calendarUserSettings: CalendarUserSettings) => {
return !!calendarUserSettings.AutoDetectPrimaryTimezone;
};
export const getDisplaySecondaryTimezone = (c... | 8,339 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/helper.ts | import { c } from 'ttag';
import { CryptoProxy } from '@proton/crypto';
import { arrayToHexString, binaryStringToArray } from '@proton/crypto/lib/utils';
import { API_CODES } from '../constants';
import { encodeBase64URL, uint8ArrayToString } from '../helpers/encoding';
import {
SyncMultipleApiResponses,
Sync... | 8,340 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/members.ts | import { Address as AddressInterface } from '../interfaces';
import { CalendarMember as MemberInterface } from '../interfaces/calendar';
export const getMemberAndAddress = (
Addresses: AddressInterface[] = [],
Members: MemberInterface[] = [],
Author = ''
): [MemberInterface, AddressInterface] => {
if (... | 8,341 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/permissions.ts | import { CALENDAR_PERMISSIONS } from '@proton/shared/lib/calendar/constants';
import { hasBit } from '@proton/shared/lib/helpers/bitset';
const { SUPER_OWNER, OWNER, ADMIN, READ_MEMBER_LIST, WRITE, READ, AVAILABILITY } = CALENDAR_PERMISSIONS;
export const MEMBER_PERMISSIONS = {
OWNS: SUPER_OWNER + OWNER + ADMIN +... | 8,342 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/plans.ts | import { PLAN_SERVICES, PLAN_TYPES } from '../constants';
import { hasBit } from '../helpers/bitset';
import { Api, Plan, PlanIDs } from '../interfaces';
import { CalendarWithOwnMembers } from '../interfaces/calendar';
import { MAX_CALENDARS_FREE } from './constants';
import getHasSharedCalendars from './sharing/getHas... | 8,343 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/sanitize.ts | import DOMPurify from 'dompurify';
DOMPurify.addHook('afterSanitizeAttributes', (node) => {
if (node.tagName === 'A') {
node.setAttribute('rel', 'noopener noreferrer');
node.setAttribute('target', '_blank');
}
});
export const restrictedCalendarSanitize = (source: string) => {
return DOMPu... | 8,344 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/serialize.ts | import { PrivateKeyReference, PublicKeyReference, SessionKey } from '@proton/crypto';
import { VcalVeventComponent } from '../interfaces/calendar';
import { SimpleMap } from '../interfaces/utils';
import { CALENDAR_CARD_TYPE } from './constants';
import {
createSessionKey,
encryptPart,
getEncryptedSessionK... | 8,345 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/settingsRoutes.ts | import { getSlugFromApp } from '@proton/shared/lib/apps/slugHelper';
import { CALENDAR_SETTINGS_ROUTE } from '@proton/shared/lib/calendar/constants';
import { APPS } from '@proton/shared/lib/constants';
import { validateBase64string } from '@proton/shared/lib/helpers/encoding';
interface GetPathOptions {
fullPath?... | 8,346 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/urlify.ts | // eslint-disable-next-line no-useless-escape
const URL_REGEX = /(\b(?:https|ftps|file|mailto|tel|sms):(?:(?!["<>\^`{|}])\S)+)/gi;
const A_TAG_REGEX = /(<a[^>]+>.+?<\/a>)/gi;
const urlify = (string: string) =>
string
.split(A_TAG_REGEX)
.map((piece) => {
if (piece.match(A_TAG_REGEX)) {
... | 8,347 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/valarmHelper.ts | import { buildMailTo } from '../helpers/email';
import { VcalValarmComponent } from '../interfaces/calendar';
import { ICAL_ALARM_ACTION } from './constants';
import { getSupportedAlarmAction } from './icsSurgery/valarm';
/**
* Helper that takes a vAlarm as it's persisted in our database and returns one that is RFC-c... | 8,348 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/vcal.ts | /**
* This file needs to be improved in terms of typing. They were rushed due to time constraints.
*/
import ICAL from 'ical.js';
import { parseWithRecovery } from '@proton/shared/lib/calendar/icsSurgery/ics';
import { DAY, HOUR, MINUTE, SECOND, WEEK } from '../constants';
import {
VcalCalendarComponent,
Vc... | 8,349 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/vcalConfig.ts | import { getClientID } from '../apps/helper';
import { ProtonConfig } from '../interfaces';
/**
* Given an app config the prodId is fixed, so it's convenient to have
* it as a mutable export, then set it when the app is loaded
*/
export let prodId = '';
export const setVcalProdId = (value: string) => {
prodId ... | 8,350 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/vcalConverter.ts | import mod from '@proton/utils/mod';
import { addDays, isNextDay } from '../date-fns-utc';
import {
convertUTCDateTimeToZone,
convertZonedDateTimeToUTC,
fromUTCDate,
toLocalDate,
toUTCDate,
} from '../date/timezone';
import { buildMailTo, canonicalizeEmail, getEmailTo } from '../helpers/email';
imp... | 8,351 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/vcalDefinition.ts | export const PROPERTIES = new Set([
'version',
'prodid',
'calscale',
'method',
'name',
'refresh-interval',
'source',
'color',
'image',
'conference',
'attach',
'categories',
'class',
'comment',
'description',
'geo',
'location',
'percent-complete',
... | 8,352 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/vcalHelper.ts | import { normalize } from '../helpers/string';
import {
VcalAttendeeProperty,
VcalAttendeePropertyWithCn,
VcalAttendeePropertyWithPartstat,
VcalAttendeePropertyWithRole,
VcalAttendeePropertyWithToken,
VcalCalendarComponent,
VcalCalendarComponentWithMaybeErrors,
VcalDateOrDateTimeProperty... | 8,353 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/veventHelper.ts | import { serverTime } from '@proton/crypto';
import { absoluteToRelativeTrigger, getIsAbsoluteTrigger } from '@proton/shared/lib/calendar/alarms/trigger';
import { DAY } from '../constants';
import { fromUTCDate, toUTCDate } from '../date/timezone';
import { omit, pick } from '../helpers/object';
import {
Attendee... | 8,354 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/vtimezoneHelper.ts | import isTruthy from '@proton/utils/isTruthy';
import { SimpleMap } from '../interfaces';
import { VcalVeventComponent } from '../interfaces/calendar';
import { GetVTimezonesMap } from '../interfaces/hooks/GetVTimezonesMap';
import { getPropertyTzid } from './vcalHelper';
interface Params {
vevents?: VcalVeventCo... | 8,355 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/alarms/getAlarmMessageText.ts | import { c } from 'ttag';
import { MINUTE } from '../../constants';
import { format as formatUTC, isNextDay, isSameDay, isSameMonth, isSameYear } from '../../date-fns-utc';
interface Arguments {
isAllDay: boolean;
title: string;
startFakeUTCDate: Date;
nowFakeUTCDate: Date;
formatOptions: any;
}
c... | 8,356 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/alarms/getNotificationString.ts | import { c, msgid } from 'ttag';
import { fromLocalDate, toUTCDate } from '../../date/timezone';
import { NotificationModel } from '../../interfaces/calendar';
import { NOTIFICATION_UNITS, NOTIFICATION_WHEN } from '../constants';
const getNotificationString = (notification: NotificationModel, formatTime: (date: Date)... | 8,357 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/alarms/getValarmTrigger.ts | import { NotificationModel } from '../../interfaces/calendar/Notification';
import { NOTIFICATION_UNITS, NOTIFICATION_WHEN } from '../constants';
import { transformBeforeAt } from './trigger';
const getValarmTriggerUnit = (unit: NOTIFICATION_UNITS) => {
return (
{
[NOTIFICATION_UNITS.WEEK]: 'we... | 8,358 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/alarms/modelToNotifications.ts | import { NotificationModel } from '../../interfaces/calendar';
import { getValarmTrigger } from '../alarms/getValarmTrigger';
import { toTriggerString } from '../vcal';
export const modelToNotifications = (notifications: NotificationModel[] = []) => {
return notifications.map((notificationModel) => ({
Type... | 8,359 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/alarms/modelToValarm.ts | import { NotificationModel } from '../../interfaces/calendar';
import { VcalValarmComponent } from '../../interfaces/calendar/VcalModel';
import { ICAL_ALARM_ACTION, NOTIFICATION_TYPE_API } from '../constants';
import { getValarmTrigger } from './getValarmTrigger';
export const modelToValarmComponent = (notificationMo... | 8,360 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/alarms/notificationDefaults.ts | import { NOTIFICATION_TYPE_API } from '../constants';
import { fromTriggerString } from '../vcal';
import { triggerToModel } from './notificationModel';
export const DEFAULT_PART_DAY_NOTIFICATIONS = [
{
Type: NOTIFICATION_TYPE_API.DEVICE,
Trigger: '-PT15M',
},
{
Type: NOTIFICATION_T... | 8,361 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/alarms/notificationModel.ts | import { NotificationModel, VcalDurationValue } from '../../interfaces/calendar';
import { normalizeRelativeTrigger, transformBeforeAt } from '../alarms/trigger';
import { NOTIFICATION_TYPE_API, NOTIFICATION_UNITS, NOTIFICATION_WHEN } from '../constants';
const getInt = (value: any) => parseInt(value, 10) || 0;
inter... | 8,362 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/alarms/notificationsToModel.ts | import generateUID from '../../helpers/generateUID';
import { Nullable } from '../../interfaces';
import { CalendarNotificationSettings, CalendarSettings } from '../../interfaces/calendar';
import { filterFutureNotifications } from '../alarms';
import { fromTriggerString } from '../vcal';
import { triggerToModel } from... | 8,363 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/alarms/trigger.ts | import { differenceInMinutes } from 'date-fns';
import isTruthy from '@proton/utils/isTruthy';
import {
VcalDateOrDateTimeProperty,
VcalDateTimeProperty,
VcalDurationValue,
VcalTriggerProperty,
} from '../../interfaces/calendar';
import { propertyToUTCDate } from '../vcalConverter';
import { getIsProp... | 8,364 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto/constants.ts | export const SIGNATURE_CONTEXT = {
SHARE_CALENDAR_INVITE: 'calendar.sharing.invite'
};
| 8,365 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto/decrypt.ts | import { CryptoProxy, PrivateKeyReference, PublicKeyReference, SessionKey, VERIFICATION_STATUS } from '@proton/crypto';
import { stringToUtf8Array, utf8ArrayToString } from '@proton/crypto/lib/utils';
import { captureMessage } from '@proton/shared/lib/helpers/sentry';
import { base64StringToUint8Array } from '../../he... | 8,366 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto/encrypt.ts | import { CryptoProxy, PrivateKeyReference, PublicKeyReference, SessionKey } from '@proton/crypto';
import { stringToUtf8Array } from '@proton/crypto/lib/utils';
import { SimpleMap } from '../../interfaces';
import { EncryptPartResult, SignPartResult } from '../../interfaces/calendar';
export function signPart(dataToS... | 8,367 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto/keys/calendarKeys.ts | import { c } from 'ttag';
import {
CryptoProxy,
PrivateKeyReference,
PublicKeyReference,
SessionKey,
VERIFICATION_STATUS,
toPublicKeyReference,
} from '@proton/crypto';
import { SIGNATURE_CONTEXT } from '@proton/shared/lib/calendar/crypto/constants';
import isTruthy from '@proton/utils/isTruthy... | 8,368 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto/keys/helpers.ts | import { c } from 'ttag';
import isTruthy from '@proton/utils/isTruthy';
import noop from '@proton/utils/noop';
import { hasBit } from '../../../helpers/bitset';
import { uint8ArrayToBase64String } from '../../../helpers/encoding';
import { Address, DecryptedKey } from '../../../interfaces';
import {
CalendarEven... | 8,369 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto/keys/reactivateCalendarKeys.ts | import { useGetAddressKeys } from '@proton/components';
import { CryptoProxy } from '@proton/crypto';
import { getAllCalendarKeys, getPassphrases, queryMembers, reactivateCalendarKey } from '../../../api/calendars';
import { Address, Api } from '../../../interfaces';
import { Calendar, CalendarKey, CalendarMember, Pas... | 8,370 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto/keys/resetCalendarKeys.ts | import { useGetAddressKeys } from '@proton/components';
import { resetCalendars } from '../../../api/calendars';
import { Api } from '../../../interfaces';
import { VisualCalendar } from '../../../interfaces/calendar';
import { getPrimaryKey } from '../../../keys';
import { generateCalendarKeyPayload } from './calenda... | 8,371 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto/keys/resetHelper.ts | import { c } from 'ttag';
import { useGetAddressKeys, useGetAddresses } from '@proton/components';
import { getSilentApi } from '../../../api/helpers/customConfig';
import getHasSharedCalendars from '../../../calendar/sharing/getHasSharedCalendars';
import { Api } from '../../../interfaces';
import { VisualCalendar }... | 8,372 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto/keys/setupCalendarHelper.ts | import { c } from 'ttag';
import { useGetAddressKeys } from '@proton/components';
import { createCalendar, updateCalendarUserSettings } from '../../../api/calendars';
import { getRandomAccentColor } from '../../../colors';
import { getTimezone } from '../../../date/timezone';
import { getActiveAddresses } from '../..... | 8,373 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto/keys/setupCalendarKeys.ts | import { c } from 'ttag';
import { useGetAddressKeys } from '@proton/components/hooks';
import { setupCalendar } from '../../../api/calendars';
import { Api } from '../../../interfaces';
import { CalendarSetupResponse, CalendarWithOwnMembers } from '../../../interfaces/calendar';
import { getPrimaryKey } from '../../... | 8,374 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/crypto/keys/setupHolidaysCalendarHelper.ts | import {joinHolidaysCalendar} from '../../../api/calendars';
import {Address, Api} from '../../../interfaces';
import {CalendarNotificationSettings, HolidaysDirectoryCalendar} from '../../../interfaces/calendar';
import {GetAddressKeys} from '../../../interfaces/hooks/GetAddressKeys';
import {getJoinHolidaysCalendarDat... | 8,375 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/export/createExportIcs.ts | import { RequireSome } from '../../interfaces';
import { VcalVcalendar, VcalVeventComponent, VcalVtimezoneComponent, VisualCalendar } from '../../interfaces/calendar';
import { ICAL_METHOD } from '../constants';
import { serialize } from '../vcal';
interface CreateExportIcsParams {
prodId: string;
eventsWithSu... | 8,376 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/export/export.ts | import { fromUnixTime } from 'date-fns';
import { c } from 'ttag';
import { CryptoProxy } from '@proton/crypto';
import { withSupportedSequence } from '@proton/shared/lib/calendar/icsSurgery/vevent';
import isTruthy from '@proton/utils/isTruthy';
import partition from '@proton/utils/partition';
import unique from '@pr... | 8,377 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/holidaysCalendar/holidaysCalendar.ts | import { SessionKey } from '@proton/crypto';
import { encryptPassphraseSessionKey, signPassphrase } from '@proton/shared/lib/calendar/crypto/keys/calendarKeys';
import { Address } from '@proton/shared/lib/interfaces';
import { CalendarNotificationSettings, HolidaysDirectoryCalendar } from '@proton/shared/lib/interfaces... | 8,378 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/icsSurgery/EventInvitationError.ts | import { c } from 'ttag';
import { ICAL_ATTENDEE_STATUS, ICAL_METHOD, ICAL_METHODS_ATTENDEE } from '../constants';
export enum EVENT_INVITATION_ERROR_TYPE {
INVITATION_INVALID,
INVITATION_UNSUPPORTED,
INVALID_METHOD,
NO_COMPONENT,
NO_VEVENT,
PARSING_ERROR,
DECRYPTION_ERROR,
FETCHING_ER... | 8,379 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/icsSurgery/ImportEventError.ts | import { c } from 'ttag';
export enum IMPORT_EVENT_ERROR_TYPE {
WRONG_FORMAT,
NON_GREGORIAN,
TODO_FORMAT,
JOURNAL_FORMAT,
FREEBUSY_FORMAT,
TIMEZONE_FORMAT,
TIMEZONE_IGNORE,
VEVENT_INVALID,
VEVENT_UNSUPPORTED,
UNEXPECTED_FLOATING_TIME,
ALLDAY_INCONSISTENCY,
DTSTART_MISSIN... | 8,380 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/icsSurgery/ics.ts | import { parse } from '@proton/shared/lib/calendar/vcal';
import { PROPERTIES } from '@proton/shared/lib/calendar/vcalDefinition';
import { VcalCalendarComponent } from '@proton/shared/lib/interfaces/calendar';
import { captureMessage } from '../../helpers/sentry';
/**
* If a vcalendar ics does not have the proper e... | 8,381 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/icsSurgery/valarm.ts | import { DAY_IN_SECONDS } from '@proton/shared/lib/constants';
import isTruthy from '@proton/utils/isTruthy';
import { normalize } from '../../helpers/string';
import {
DateTimeValue,
VcalDateOrDateTimeProperty,
VcalStringProperty,
VcalValarmComponent,
VcalValarmRelativeComponent,
} from '../../int... | 8,382 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/icsSurgery/vcal.ts | import { normalize } from '../../helpers/string';
import { VcalStringProperty } from '../../interfaces/calendar';
import { ICAL_CALSCALE } from '../constants';
export const getSupportedStringValue = (property?: VcalStringProperty) => {
const trimmedValue = property?.value?.trim();
if (!trimmedValue) {
... | 8,383 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/icsSurgery/vevent.ts | import { addDays, fromUnixTime } from 'date-fns';
import truncate from '@proton/utils/truncate';
import unique from '@proton/utils/unique';
import { RequireOnly } from '../../../lib/interfaces';
import { DAY } from '../../constants';
import { convertUTCDateTimeToZone, fromUTCDate, getSupportedTimezone } from '../../d... | 8,384 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/import/ImportFatalError.ts | import { c } from 'ttag';
export class ImportFatalError extends Error {
error: Error;
constructor(error: Error) {
super(c('Error importing calendar').t`An unexpected error occurred. Import must be restarted.`);
this.error = error;
Object.setPrototypeOf(this, ImportFatalError.prototype)... | 8,385 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/import/ImportFileError.ts | import { c, msgid } from 'ttag';
import truncate from '@proton/utils/truncate';
import {
IMPORT_ERROR_TYPE,
MAX_FILENAME_CHARS_DISPLAY,
MAX_IMPORT_EVENTS_STRING,
MAX_IMPORT_FILE_SIZE_STRING,
} from '../constants';
const getErrorMessage = (errorType: IMPORT_ERROR_TYPE, filename = '') => {
const fo... | 8,386 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/import/encryptAndSubmit.ts | import { getHasSharedEventContent, getHasSharedKeyPacket } from '@proton/shared/lib/calendar/apiModels';
import chunk from '@proton/utils/chunk';
import { syncMultipleEvents } from '../../api/calendars';
import { HOUR, SECOND } from '../../constants';
import { HTTP_ERROR_CODES } from '../../errors';
import { wait } fr... | 8,387 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/import/import.ts | import { c } from 'ttag';
import { serverTime } from '@proton/crypto';
import isTruthy from '@proton/utils/isTruthy';
import truncate from '@proton/utils/truncate';
import unique from '@proton/utils/unique';
import { getEventByUID } from '../../api/calendars';
import formatUTC, { Options as FormatOptions } from '../.... | 8,388 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/mailIntegration/AddAttendeeError.ts | import { c, msgid } from 'ttag';
import { MAX_ATTENDEES } from '@proton/shared/lib/calendar/constants';
export enum ADD_EVENT_ERROR_TYPE {
TOO_MANY_PARTICIPANTS,
}
const getErrorMessage = (errorType: ADD_EVENT_ERROR_TYPE, maxAttendees = MAX_ATTENDEES) => {
if (errorType === ADD_EVENT_ERROR_TYPE.TOO_MANY_PART... | 8,389 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/mailIntegration/invite.ts | import { c } from 'ttag';
import { getIsAddressExternal } from '@proton/shared/lib/helpers/address';
import isTruthy from '@proton/utils/isTruthy';
import unary from '@proton/utils/unary';
import { MIME_TYPES } from '../../constants';
import { addDays, format as formatUTC } from '../../date-fns-utc';
import { Options... | 8,390 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/recurrence/getFrequencyString.ts | import { c, msgid } from 'ttag';
import mod from '@proton/utils/mod';
import unique from '@proton/utils/unique';
import { format } from '../../date-fns-utc';
import { WeekStartsOn } from '../../date-fns-utc/interface';
import { toUTCDate } from '../../date/timezone';
import {
VcalDateOrDateTimeProperty,
VcalR... | 8,391 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/recurrence/getRecurrenceIdValueFromTimestamp.ts | import { convertTimestampToTimezone } from '../../date/timezone';
import { toExdate } from '../exdate';
const getRecurrenceIdValueFromTimestamp = (unixTimestamp: number, isAllDay: boolean, startTimezone: string) => {
const localStartDateTime = convertTimestampToTimezone(unixTimestamp, startTimezone);
return to... | 8,392 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/recurrence/recurring.ts | /* eslint-disable no-param-reassign */
import { addDays, addMilliseconds, differenceInCalendarDays, max } from '../../date-fns-utc';
import { convertUTCDateTimeToZone, convertZonedDateTimeToUTC, fromUTCDate, toUTCDate } from '../../date/timezone';
import {
VcalDateOrDateTimeProperty,
VcalDateOrDateTimeValue,
... | 8,393 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/recurrence/rrule.ts | import { getDaysInMonth } from '../../date-fns-utc';
import {
convertUTCDateTimeToZone,
convertZonedDateTimeToUTC,
fromUTCDate,
toLocalDate,
toUTCDate,
} from '../../date/timezone';
import { omit, pick } from '../../helpers/object';
import { RequireSome } from '../../interfaces';
import {
VcalDa... | 8,394 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/recurrence/rruleEqual.ts | import shallowEqual from '@proton/utils/shallowEqual';
import { isSameDay } from '../../date-fns-utc';
import { toUTCDate } from '../../date/timezone';
import isDeepEqual from '../../helpers/isDeepEqual';
import { omit } from '../../helpers/object';
import {
VcalDateOrDateTimeValue,
VcalDays,
VcalDaysKeys,... | 8,395 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/recurrence/rruleProperties.ts | import unique from '@proton/utils/unique';
import { convertUTCDateTimeToZone, fromUTCDate } from '../../date/timezone';
import { VcalDateOrDateTimeValue, VcalDateTimeValue, VcalDays } from '../../interfaces/calendar/VcalModel';
import { END_TYPE, MONTHLY_TYPE } from '../constants';
import { dayToNumericDay, propertyTo... | 8,396 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/recurrence/rruleSubset.ts | import { convertZonedDateTimeToUTC, fromUTCDate, toUTCDate } from '../../date/timezone';
import { VcalVeventComponent } from '../../interfaces/calendar';
import { propertyToUTCDate } from '../vcalConverter';
import { getPropertyTzid } from '../vcalHelper';
import {getIsAllDay} from '../veventHelper';
import { Recurring... | 8,397 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/recurrence/rruleUntil.ts | import { VcalDateOrDateTimeProperty, VcalRruleProperty } from '../../interfaces/calendar/VcalModel';
import { getUntilProperty } from '../vcalConverter';
import { getIsPropertyAllDay, getPropertyTzid } from '../vcalHelper';
export const withRruleUntil = (rrule: VcalRruleProperty, dtstart: VcalDateOrDateTimeProperty): ... | 8,398 |
0 | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar | petrpan-code/ProtonMail/WebClients/packages/shared/lib/calendar/recurrence/rruleWkst.ts | import { omit } from '../../helpers/object';
import { VcalDays, VcalRrulePropertyValue, VcalVeventComponent } from '../../interfaces/calendar/VcalModel';
import { FREQUENCY } from '../constants';
import { numericDayToDay } from '../vcalConverter';
/**
* WKST is significant when a WEEKLY "RRULE" has an interval greate... | 8,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.