This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 387
/
groups.ts
127 lines (107 loc) · 2.65 KB
/
groups.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {UserProfile} from './users';
import {Dictionary, RelationOneToOne} from './utilities';
export type SyncableType = 'team' | 'channel';
export type SyncablePatch = {
scheme_admin: boolean;
auto_add: boolean;
};
export type GroupPatch = {
allow_reference: boolean;
name: string;
};
export type Group = {
id: string;
name: string;
display_name: string;
description: string;
type: string;
remote_id: string;
create_at: number;
update_at: number;
delete_at: number;
has_syncables: boolean;
member_count: number;
scheme_admin: boolean;
allow_reference: boolean;
};
export type GroupTeam = {
team_id: string;
team_display_name: string;
team_type: string;
group_id: string;
auto_add: boolean;
scheme_admin: boolean;
create_at: number;
delete_at: number;
update_at: number;
};
export type GroupChannel = {
channel_id: string;
channel_display_name: string;
channel_type: string;
team_id: string;
team_display_name: string;
team_type: string;
group_id: string;
auto_add: boolean;
scheme_admin: boolean;
create_at: number;
delete_at: number;
update_at: number;
};
export type GroupSyncable = {
group_id: string;
auto_add: boolean;
scheme_admin: boolean;
create_at: number;
delete_at: number;
update_at: number;
type: 'Team' | 'Channel';
};
export type GroupSyncablesState = {
teams: GroupTeam[];
channels: GroupChannel[];
};
export type GroupsState = {
syncables: Dictionary<GroupSyncablesState>;
stats: RelationOneToOne<Group, GroupStats>;
groups: Dictionary<Group>;
myGroups: Dictionary<Group>;
};
export type GroupStats = {
group_id: string;
total_member_count: number;
};
export type GroupSearchOpts = {
q: string;
is_linked?: boolean;
is_configured?: boolean;
};
export type MixedUnlinkedGroup = {
mattermost_group_id?: string;
name: string;
primary_key: string;
has_syncables?: boolean;
};
export type MixedUnlinkedGroupRedux = MixedUnlinkedGroup & {
failed?: boolean;
};
export type UserWithGroup = UserProfile & {
groups: Group[];
scheme_guest: boolean;
scheme_user: boolean;
scheme_admin: boolean;
};
export type GroupsWithCount = {
groups: Group[];
total_group_count: number;
// These fields are added by the client after the groups are returned by the server
channelID?: string;
teamID?: string;
}
export type UsersWithGroupsAndCount = {
users: UserWithGroup[];
total_count: number;
};