Update selected item color in Pass menu
[ProtonMail-WebClient.git] / packages / pass / store / actions / requests.ts
blobcfa2d2f5b1121b049d9caacbd2ad3037bd514f7a
1 import { type EndpointOptions } from './enhancers/endpoint';
3 const withItemKey = (base: string) => (shareId: string, itemId: string) => `${base}::${shareId}::${itemId}`;
4 const withKey = (base: string) => (key: string) => `${base}::${key}`;
6 export const bootRequest = () => 'worker::boot';
7 export const syncRequest = () => 'worker::sync';
8 export const channelRequest = withKey(`worker::channel`);
9 export const wakeupRequest = ({ endpoint, tabId }: EndpointOptions) => `worker::wakeup-${endpoint}-${tabId}`;
10 export const offlineToggleRequest = () => `offline::toggle`;
11 export const offlineResumeRequest = () => `offline::resume`;
13 export const itemPinRequest = withItemKey(`item::pin`);
14 export const itemUnpinRequest = withItemKey(`item::unpin`);
15 export const itemRevisionsRequest = withItemKey(`item::revisions`);
16 export const itemsImportRequest = () => `items::import`;
17 export const itemsBulkMoveRequest = () => `items::bulk::move`;
18 export const itemsBulkTrashRequest = () => `items::bulk::trash`;
19 export const itemsBulkDeleteRequest = () => `items::bulk::delete`;
20 export const itemsBulkRestoreRequest = () => `items::bulk::restore`;
21 export const itemUpdateFlagsRequest = withItemKey(`item::flags::update`);
23 export const secureLinkCreateRequest = withItemKey(`secure-link::create`);
24 export const secureLinkOpenRequest = withKey('secure-link::open');
25 export const secureLinkRemoveRequest = withItemKey('secure-link::remove');
26 export const secureLinksRemoveInactiveRequest = () => 'secure-links::remove::inactive';
27 export const secureLinksGetRequest = () => 'secure-links::get';
29 export const vaultCreateRequest = withKey(`vault::create`);
30 export const vaultEditRequest = withKey(`vault::edit`);
31 export const vaultDeleteRequest = withKey(`vault::delete`);
32 export const vaultMoveAllItemsRequest = withKey(`vault::move::all::items`);
33 export const vaultTransferOwnerRequest = withKey(`vault::transfer:owner`);
34 export const trashEmptyRequest = () => `trash::empty`;
35 export const trashRestoreRequest = () => `trash::restore`;
37 export const unlockRequest = () => `auth::unlock`;
38 export const lockCreateRequest = () => `auth::lock::create`;
39 export const passwordConfirmRequest = () => `auth::password::confirm`;
40 export const extraPasswordToggleRequest = () => `auth::extra-password::toggle`;
42 export const settingsEditRequest = withKey(`settings::edit`);
44 export const aliasOptionsRequest = withKey(`alias::options`);
45 export const aliasDetailsRequest = withKey(`alias::details`);
46 export const aliasSyncEnableRequest = () => `alias::sync::enable`;
47 export const aliasSyncPendingRequest = () => `alias::sync::pending`;
48 export const aliasSyncStatusRequest = () => `alias::sync::status`;
49 export const aliasSyncToggleStatusRequest = withItemKey(`alias::sync::status::toggle`);
51 export const shareRemoveMemberRequest = withKey(`share::members::remove`);
52 export const shareEditMemberRoleRequest = withKey(`share::members::edit-role`);
53 export const shareLeaveRequest = withKey(`share::leave`);
54 export const shareAccessOptionsRequest = withKey(`share::access-options`);
56 export const inviteCreateRequest = withKey(`invite::create`);
57 export const inviteResendRequest = withKey(`invite::resend`);
58 export const inviteAcceptRequest = withKey(`invite::accept`);
59 export const inviteRejectRequest = withKey(`invite::reject`);
60 export const inviteRemoveRequest = withKey(`invite::remove`);
61 export const inviteRecommendationsRequest = withKey(`invite::recommendations`);
62 export const inviteAddressesValidateRequest = withKey(`invite::addresses::validate`);
64 export const newUserInvitePromoteRequest = withKey(`new-user-invite::promote`);
65 export const newUserInviteRemoveRequest = withKey(`new-user-invite::remove`);
67 export const userAccessRequest = withKey(`user::access`);
68 export const userFeaturesRequest = withKey(`user::features`);
69 export const userSettingsRequest = withKey(`user::settings`);
71 export const reportBugRequest = withKey(`report::bug`);
73 export const organizationSettingsRequest = () => `organization::settings::get`;
74 export const sentinelToggleRequest = () => `monitor::sentinel::toggle`;
76 export const breachesRequest = () => `monitor::breaches`;
77 export const protonBreachRequest = withKey(`monitor::breaches::proton`);
78 export const customBreachRequest = withKey(`monitor::breaches::custom`);
79 export const aliasBreachRequest = withItemKey(`monitor::breaches::alias`);
81 export const addCustomAddressRequest = withKey(`monitor::add::custom`);
82 export const verifyCustomAddressRequest = withKey(`monitor::verify::custom`);
83 export const deleteCustomAddressRequest = withKey(`monitor::delete::custom`);
84 export const resendCustomAddressCodeRequest = withKey(`monitor::verify::custom::resend`);
86 export const toggleMonitorRequest = () => `monitor::global::toggle`;
87 export const toggleAddressMonitorRequest = withKey(`monitor::toggle::address`);
88 export const resolveAddressMonitorRequest = withKey(`monitor::resolve::address`);
90 export const websiteRulesRequest = () => `rules::get`;
92 export const getAuthDevicesRequest = () => `auth::sso::auth_devices`;
93 export const confirmPendingAuthDeviceRequest = withKey(`auth::sso::confirm`);
94 export const rejectPendingAuthDeviceRequest = withKey(`auth::sso::reject`);