3 GROUP_MEMBER_PERMISSIONS,
8 } from '../interfaces';
10 interface GroupParameters {
19 export const createGroup = (groupParams: GroupParameters) => ({
21 url: 'core/v4/groups',
27 export const editGroup = (groupID: string, groupParams: Partial<GroupParameters>) => ({
29 url: `core/v4/groups/${groupID}`,
35 export const deleteGroup = (groupID: string) => ({
37 url: `core/v4/groups/${groupID}`,
40 export interface GroupResult {
46 Permissions: GroupPermissions;
50 export const getGroups = () => ({
52 url: 'core/v4/groups',
55 export const getGroupMembers = (groupID: string) => ({
57 url: `core/v4/groups/${groupID}/members`,
60 export interface GroupMemberParameters {
61 Type: GroupMemberType;
62 GroupID: string; // encrypted
64 AddressSignaturePacket: string;
65 GroupMemberAddressPrivateKey?: string; // Only for internal E2EE member
66 ActivationToken?: string; // Only for internal E2EE member
67 ProxyInstances?: ProxyInstances[]; // Only for E2EE member
70 Permissions?: GROUP_MEMBER_PERMISSIONS;
73 export const addGroupMember = (addMemberParams: GroupMemberParameters) => ({
75 url: 'core/v4/groups/members',
81 export const updateGroupMember = (groupMemberID: string, groupMemberParams: Partial<GroupMemberParameters>) => ({
83 url: `core/v4/groups/members/${groupMemberID}`,
89 export const deleteGroupMember = (groupMemberID: string) => ({
91 url: `core/v4/groups/members/${groupMemberID}`,
94 export const deleteAllGroupMembers = (groupID: string) => ({
96 url: `core/v4/groups/members/${groupID}`,
99 export const resendGroupInvitation = (groupMemberID: string) => ({
101 url: `core/v4/groups/members/${groupMemberID}/reinvite`,
104 export const getGroupMembership = () => ({
106 url: `core/v4/groups/members/internal`,
109 export const getExternalGroupMembership = (jwt: string) => ({
111 url: `core/v4/groups/members/external/${jwt}`,
114 export const acceptExternalGroupMembership = (jwt: string) => ({
116 url: `core/v4/groups/external/${jwt}`,
119 export const declineExternalGroupMembership = (jwt: string) => ({
121 url: `core/v4/groups/external/${jwt}`,