1 export const getOrganization = () => ({
2 url: 'core/v4/organizations',
6 export const getOrganizationKeys = () => ({
7 url: 'core/v4/organizations/keys',
11 export const getOrganizationBackupKeys = () => ({
12 url: 'core/v4/organizations/keys/backup',
16 export const getOrganizationLogo = (id: string) => ({
17 url: `core/v4/organizations/logo/${id}`,
21 export const updateOrganizationName = (Name: string) => ({
22 url: 'core/v4/organizations/name',
27 export const updateOrganizationLogo = (Image: string) => ({
28 url: 'core/v4/organizations/settings/logo',
33 export const deleteOrganizationLogo = () => ({
34 url: 'core/v4/organizations/settings/logo',
38 export const updateOrganizationSettings = ({ ShowName }: { ShowName: boolean }) => ({
39 url: 'core/v4/organizations/settings',
44 export const getOrganizationSettings = () => ({
45 url: 'core/v4/organizations/settings',
49 export const updateOrganizationEmail = (Email: string) => ({
50 url: 'core/v4/organizations/email',
55 export const updateOrganizationTheme = (Theme: string) => ({
56 url: 'core/v4/organizations/theme',
61 export const updateTwoFactor = (GracePeriod: number) => ({
62 url: 'core/v4/organizations/2fa',
64 data: { GracePeriod },
67 export interface UpdateOrganizationKeysPayloadLegacy {
69 BackupPrivateKey: string;
70 BackupKeySalt: string;
71 Tokens: { ID: string; Token: string }[];
74 export const updateOrganizationKeysLegacy = ({
79 }: UpdateOrganizationKeysPayloadLegacy) => ({
80 url: 'core/v4/organizations/keys',
82 data: { PrivateKey, BackupPrivateKey, BackupKeySalt, Tokens },
99 export interface UpdatePasswordlessOrganizationKeysPayload {
106 TokenKeyPacket: string;
108 SignatureAddressID: string;
109 EncryptionAddressID: string;
113 TokenKeyPacket: string;
118 export const createPasswordlessOrganizationKeys = (data: UpdatePasswordlessOrganizationKeysPayload) => ({
119 url: 'core/v4/organizations/keys',
124 export const updatePasswordlessOrganizationKeys = (data: UpdatePasswordlessOrganizationKeysPayload) => ({
125 ...createPasswordlessOrganizationKeys(data),
129 interface MigratePasswordlessOrganizationKeysPayload
130 extends Omit<UpdatePasswordlessOrganizationKeysPayload, 'Members' | 'AdminInvitations'> {
133 TokenKeyPacket: string;
138 export const migratePasswordlessOrganizationKey = (data: MigratePasswordlessOrganizationKeysPayload) => ({
139 url: 'core/v4/organizations/keys/migrate',
144 export interface UpdateOrganizationKeysPayloadV2 {
146 BackupPrivateKey: string;
147 BackupKeySalt: string;
151 export const updateOrganizationKeysV2 = ({
156 }: UpdateOrganizationKeysPayloadV2) => ({
157 url: 'core/v4/organizations/keys',
159 data: { PrivateKey, BackupPrivateKey, BackupKeySalt, Members },
162 export const updateBackupKey = ({ PrivateKey, KeySalt }: { PrivateKey: string; KeySalt: string }) => ({
163 url: 'core/v4/organizations/keys/backup',
165 data: { PrivateKey, KeySalt },
168 export const activateOrganizationKey = (PrivateKey: string) => ({
169 url: 'core/v4/organizations/keys/activate',
171 data: { PrivateKey },
174 export const uploadOrganizationKeySignature = (data: { AddressID: string; Signature: string }) => ({
175 url: 'core/v4/organizations/keys/signature',
180 export const leaveOrganisation = () => ({
181 url: 'core/v4/organizations/membership',
185 export const queryEnforceTwoFA = (Require: number) => ({
186 url: `core/v4/organizations/require2fa`,
191 export const queryRemoveTwoFA = () => ({
192 url: `core/v4/organizations/require2fa`,
196 export const sendEmailReminderTwoFA = () => ({
197 url: 'core/v4/organizations/2fa/remind',