1 export const getOrganization = () => ({
2 url: 'core/v4/organizations',
6 export const getOrganizationIdentity = () => ({
7 url: 'core/v4/organizations/keys/signature',
11 export const getOrganizationKeys = () => ({
12 url: 'core/v4/organizations/keys',
16 export const getOrganizationBackupKeys = () => ({
17 url: 'core/v4/organizations/keys/backup',
21 export const getOrganizationLogo = (id: string) => ({
22 url: `core/v4/organizations/logo/${id}`,
26 export const updateOrganizationName = (Name: string) => ({
27 url: 'core/v4/organizations/name',
32 export const updateOrganizationLogo = (Image: string) => ({
33 url: 'core/v4/organizations/settings/logo',
38 export const deleteOrganizationLogo = () => ({
39 url: 'core/v4/organizations/settings/logo',
43 export const updateOrganizationSettings = ({
45 ShowScribeWritingAssistant,
46 VideoConferencingEnabled,
49 ShowScribeWritingAssistant?: boolean;
50 VideoConferencingEnabled?: boolean;
52 url: 'core/v4/organizations/settings',
54 data: { ShowName, ShowScribeWritingAssistant, VideoConferencingEnabled },
57 export const getOrganizationSettings = () => ({
58 url: 'core/v4/organizations/settings',
62 export const updateOrganizationEmail = (Email: string) => ({
63 url: 'core/v4/organizations/email',
68 export const updateOrganizationTheme = (Theme: string) => ({
69 url: 'core/v4/organizations/theme',
74 export const updateTwoFactor = (GracePeriod: number) => ({
75 url: 'core/v4/organizations/2fa',
77 data: { GracePeriod },
80 export interface UpdateOrganizationKeysPayloadLegacy {
82 BackupPrivateKey: string;
83 BackupKeySalt: string;
84 Tokens: { ID: string; Token: string }[];
87 export const updateOrganizationKeysLegacy = ({
92 }: UpdateOrganizationKeysPayloadLegacy) => ({
93 url: 'core/v4/organizations/keys',
95 data: { PrivateKey, BackupPrivateKey, BackupKeySalt, Tokens },
108 OrgSignature: string;
112 export interface UpdatePasswordlessOrganizationKeysPayload {
119 TokenKeyPacket: string;
121 SignatureAddressID: string;
122 EncryptionAddressID: string;
126 TokenKeyPacket: string;
131 export const createPasswordlessOrganizationKeys = (data: UpdatePasswordlessOrganizationKeysPayload) => ({
132 url: 'core/v4/organizations/keys',
137 export const updatePasswordlessOrganizationKeys = (data: UpdatePasswordlessOrganizationKeysPayload) => ({
138 ...createPasswordlessOrganizationKeys(data),
142 interface MigratePasswordlessOrganizationKeysPayload
143 extends Omit<UpdatePasswordlessOrganizationKeysPayload, 'Members' | 'AdminInvitations'> {
146 TokenKeyPacket: string;
151 export const migratePasswordlessOrganizationKey = (data: MigratePasswordlessOrganizationKeysPayload) => ({
152 url: 'core/v4/organizations/keys/migrate',
157 export interface UpdateOrganizationKeysPayloadV2 {
159 BackupPrivateKey: string;
160 BackupKeySalt: string;
164 export const updateOrganizationKeysV2 = ({
169 }: UpdateOrganizationKeysPayloadV2) => ({
170 url: 'core/v4/organizations/keys',
172 data: { PrivateKey, BackupPrivateKey, BackupKeySalt, Members },
175 export const updateBackupKey = ({ PrivateKey, KeySalt }: { PrivateKey: string; KeySalt: string }) => ({
176 url: 'core/v4/organizations/keys/backup',
178 data: { PrivateKey, KeySalt },
181 export const activateOrganizationKey = (PrivateKey: string) => ({
182 url: 'core/v4/organizations/keys/activate',
184 data: { PrivateKey },
187 export const uploadOrganizationKeySignature = (data: { AddressID: string; Signature: string }) => ({
188 url: 'core/v4/organizations/keys/signature',
193 export const leaveOrganisation = () => ({
194 url: 'core/v4/organizations/membership',
198 export const queryEnforceTwoFA = (Require: number) => ({
199 url: `core/v4/organizations/require2fa`,
204 export const queryRemoveTwoFA = () => ({
205 url: `core/v4/organizations/require2fa`,
209 export const sendEmailReminderTwoFA = () => ({
210 url: 'core/v4/organizations/2fa/remind',