mgtypes 1.0.75 → 1.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/types/Admin.ts +166 -0
- package/types/Content.ts +4 -0
- package/types/Permissions.ts +8 -8
- package/types/User.ts +4 -0
- package/types/configs/ClientConfig.ts +2 -1
package/package.json
CHANGED
package/types/Admin.ts
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
//
|
|
2
|
+
|
|
3
|
+
interface mgAdminOrganization {}
|
|
4
|
+
|
|
5
|
+
interface mgAdminUser {}
|
|
6
|
+
interface mgAdminUserRole {}
|
|
7
|
+
|
|
8
|
+
export enum mgAdminRoleTitle {
|
|
9
|
+
ADMINISTRATOR = 'ADMINISTRATOR', // FULL
|
|
10
|
+
EDITOR = 'EDITOR', // USERS, CONTENT
|
|
11
|
+
CONTRIBUTOR = 'CONTRIBUTOR', // CONTENT
|
|
12
|
+
DESIGNER = 'DESIGNER', // STYLES, THEME, MAP
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface mgAdminRoleProfile {
|
|
16
|
+
CONTENT: {
|
|
17
|
+
CAN_CREATE_CONTENT: boolean;
|
|
18
|
+
CAN_UPDATE_CONTENT: boolean;
|
|
19
|
+
CAN_DELETE_CONTENT: boolean;
|
|
20
|
+
};
|
|
21
|
+
USERS: {
|
|
22
|
+
CAN_CREATE_USERS: boolean;
|
|
23
|
+
CAN_UPDATE_USERS: boolean;
|
|
24
|
+
CAN_DELETE_USERS: boolean;
|
|
25
|
+
};
|
|
26
|
+
TEAM: {
|
|
27
|
+
// CAN INVITE SOMEONE INTO TEAM
|
|
28
|
+
CAN_ADD_MEMBERS: boolean;
|
|
29
|
+
|
|
30
|
+
// YOU CAN REMOVE THESE
|
|
31
|
+
// FROM YOUR TEAM, RESTRICTING
|
|
32
|
+
// ACCESS
|
|
33
|
+
CAN_REMOVE_MEMBERS: {
|
|
34
|
+
ADMINISTRATOR: boolean;
|
|
35
|
+
EDITOR: boolean;
|
|
36
|
+
CONTRIBUTOR: boolean;
|
|
37
|
+
DESIGNER: boolean;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
CAN_ASSIGN_ROLE: {
|
|
41
|
+
ADMINISTRATOR: boolean;
|
|
42
|
+
EDITOR: boolean;
|
|
43
|
+
CONTRIBUTOR: boolean;
|
|
44
|
+
DESIGNER: boolean;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// THIS IS A CONSTANT, COULD BE CONFIGGLED SOMEHOW?
|
|
51
|
+
// DO WE NEED TO CONFIGGLE IT?
|
|
52
|
+
export const mgAdminRoleProfiles: {
|
|
53
|
+
ADMINISTRATOR: mgAdminRoleProfile;
|
|
54
|
+
EDITOR: mgAdminRoleProfile;
|
|
55
|
+
CONTRIBUTOR: mgAdminRoleProfile;
|
|
56
|
+
DESIGNER: mgAdminRoleProfile;
|
|
57
|
+
} = {
|
|
58
|
+
ADMINISTRATOR: {
|
|
59
|
+
CONTENT: {
|
|
60
|
+
CAN_CREATE_CONTENT: true,
|
|
61
|
+
CAN_DELETE_CONTENT: true,
|
|
62
|
+
CAN_UPDATE_CONTENT: true,
|
|
63
|
+
},
|
|
64
|
+
USERS: {
|
|
65
|
+
CAN_CREATE_USERS: true,
|
|
66
|
+
CAN_DELETE_USERS: true,
|
|
67
|
+
CAN_UPDATE_USERS: true,
|
|
68
|
+
},
|
|
69
|
+
TEAM: {
|
|
70
|
+
CAN_ADD_MEMBERS: true,
|
|
71
|
+
CAN_ASSIGN_ROLE: {
|
|
72
|
+
ADMINISTRATOR: true,
|
|
73
|
+
EDITOR: true,
|
|
74
|
+
CONTRIBUTOR: true,
|
|
75
|
+
DESIGNER: true,
|
|
76
|
+
},
|
|
77
|
+
CAN_REMOVE_MEMBERS: {
|
|
78
|
+
ADMINISTRATOR: true,
|
|
79
|
+
EDITOR: true,
|
|
80
|
+
CONTRIBUTOR: true,
|
|
81
|
+
DESIGNER: true,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
EDITOR: {
|
|
86
|
+
CONTENT: {
|
|
87
|
+
CAN_CREATE_CONTENT: true,
|
|
88
|
+
CAN_DELETE_CONTENT: true,
|
|
89
|
+
CAN_UPDATE_CONTENT: true,
|
|
90
|
+
},
|
|
91
|
+
USERS: {
|
|
92
|
+
CAN_CREATE_USERS: true,
|
|
93
|
+
CAN_DELETE_USERS: true,
|
|
94
|
+
CAN_UPDATE_USERS: true,
|
|
95
|
+
},
|
|
96
|
+
TEAM: {
|
|
97
|
+
CAN_ADD_MEMBERS: true,
|
|
98
|
+
CAN_ASSIGN_ROLE: {
|
|
99
|
+
ADMINISTRATOR: false,
|
|
100
|
+
EDITOR: true,
|
|
101
|
+
CONTRIBUTOR: true,
|
|
102
|
+
DESIGNER: true,
|
|
103
|
+
},
|
|
104
|
+
CAN_REMOVE_MEMBERS: {
|
|
105
|
+
ADMINISTRATOR: false,
|
|
106
|
+
EDITOR: false,
|
|
107
|
+
CONTRIBUTOR: true,
|
|
108
|
+
DESIGNER: true,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
CONTRIBUTOR: {
|
|
113
|
+
CONTENT: {
|
|
114
|
+
CAN_CREATE_CONTENT: true,
|
|
115
|
+
CAN_DELETE_CONTENT: true,
|
|
116
|
+
CAN_UPDATE_CONTENT: true,
|
|
117
|
+
},
|
|
118
|
+
USERS: {
|
|
119
|
+
CAN_CREATE_USERS: false,
|
|
120
|
+
CAN_DELETE_USERS: false,
|
|
121
|
+
CAN_UPDATE_USERS: false,
|
|
122
|
+
},
|
|
123
|
+
TEAM: {
|
|
124
|
+
CAN_ADD_MEMBERS: false,
|
|
125
|
+
CAN_ASSIGN_ROLE: {
|
|
126
|
+
ADMINISTRATOR: false,
|
|
127
|
+
EDITOR: false,
|
|
128
|
+
CONTRIBUTOR: false,
|
|
129
|
+
DESIGNER: false,
|
|
130
|
+
},
|
|
131
|
+
CAN_REMOVE_MEMBERS: {
|
|
132
|
+
ADMINISTRATOR: false,
|
|
133
|
+
EDITOR: false,
|
|
134
|
+
CONTRIBUTOR: false,
|
|
135
|
+
DESIGNER: false,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
DESIGNER: {
|
|
140
|
+
CONTENT: {
|
|
141
|
+
CAN_CREATE_CONTENT: false,
|
|
142
|
+
CAN_DELETE_CONTENT: false,
|
|
143
|
+
CAN_UPDATE_CONTENT: false,
|
|
144
|
+
},
|
|
145
|
+
USERS: {
|
|
146
|
+
CAN_CREATE_USERS: false,
|
|
147
|
+
CAN_DELETE_USERS: false,
|
|
148
|
+
CAN_UPDATE_USERS: false,
|
|
149
|
+
},
|
|
150
|
+
TEAM: {
|
|
151
|
+
CAN_ADD_MEMBERS: false,
|
|
152
|
+
CAN_ASSIGN_ROLE: {
|
|
153
|
+
ADMINISTRATOR: false,
|
|
154
|
+
EDITOR: false,
|
|
155
|
+
CONTRIBUTOR: false,
|
|
156
|
+
DESIGNER: false,
|
|
157
|
+
},
|
|
158
|
+
CAN_REMOVE_MEMBERS: {
|
|
159
|
+
ADMINISTRATOR: false,
|
|
160
|
+
EDITOR: false,
|
|
161
|
+
CONTRIBUTOR: false,
|
|
162
|
+
DESIGNER: false,
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
};
|
package/types/Content.ts
CHANGED
package/types/Permissions.ts
CHANGED
|
@@ -20,7 +20,7 @@ export enum mgNonNativePermissionTitle {
|
|
|
20
20
|
export enum mgLocationPermissionTitle {
|
|
21
21
|
SHOW_LOCATION = 'SHOW_LOCATION',
|
|
22
22
|
SHOW_DISTANCE_TO_PINS = 'SHOW_DISTANCE_TO_PINS',
|
|
23
|
-
|
|
23
|
+
RECEIVE_GEOTARGETED_CONTENT = 'RECEIVE_GEOTARGETED_CONTENT',
|
|
24
24
|
SHARE_BACKGROUND_LOCATION_WITH_FRIENDS = 'SHARE_BACKGROUND_LOCATION_WITH_FRIENDS',
|
|
25
25
|
SHARE_FOREGROUND_LOCATION_WITH_FRIENDS = 'SHARE_FOREGROUND_LOCATION_WITH_FRIENDS',
|
|
26
26
|
SHARE_LOCATION_FOR_EMERGENCIES = 'SHARE_LOCATION_FOR_EMERGENCIES',
|
|
@@ -28,9 +28,9 @@ export enum mgLocationPermissionTitle {
|
|
|
28
28
|
|
|
29
29
|
// TODO:permissionsConfig -- Not being used at the moment
|
|
30
30
|
export enum mgCalendarPermissionTitle {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
CAN_CREATE_EVENTS = 'CAN_CREATE_EVENTS',
|
|
32
|
+
CAN_CREATE_REMINDERS = 'CAN_CREATE_REMINDERS',
|
|
33
|
+
CAN_ADD_ATTENDEES = 'CAN_ADD_ATTENDEES',
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// TODO:permissionsConfig -- Not being used at the moment
|
|
@@ -98,16 +98,16 @@ export const nativePermissionsOrder: mgNativePermissionTitle[] = [
|
|
|
98
98
|
export const locationPermissionsOrder: mgLocationPermissionTitle[] = [
|
|
99
99
|
mgLocationPermissionTitle.SHOW_LOCATION,
|
|
100
100
|
mgLocationPermissionTitle.SHOW_DISTANCE_TO_PINS,
|
|
101
|
-
mgLocationPermissionTitle.
|
|
101
|
+
mgLocationPermissionTitle.RECEIVE_GEOTARGETED_CONTENT,
|
|
102
102
|
mgLocationPermissionTitle.SHARE_BACKGROUND_LOCATION_WITH_FRIENDS,
|
|
103
103
|
mgLocationPermissionTitle.SHARE_FOREGROUND_LOCATION_WITH_FRIENDS,
|
|
104
104
|
mgLocationPermissionTitle.SHARE_LOCATION_FOR_EMERGENCIES,
|
|
105
105
|
];
|
|
106
106
|
|
|
107
107
|
export const calendarPermissionsOrder: mgCalendarPermissionTitle[] = [
|
|
108
|
-
mgCalendarPermissionTitle.
|
|
109
|
-
mgCalendarPermissionTitle.
|
|
110
|
-
mgCalendarPermissionTitle.
|
|
108
|
+
mgCalendarPermissionTitle.CAN_CREATE_EVENTS,
|
|
109
|
+
mgCalendarPermissionTitle.CAN_CREATE_REMINDERS,
|
|
110
|
+
mgCalendarPermissionTitle.CAN_ADD_ATTENDEES,
|
|
111
111
|
];
|
|
112
112
|
|
|
113
113
|
export const notificationsPermissionsOrder: mgNotificationsPermissionTitle[] = [
|
package/types/User.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { mgFriendship } from "./Content";
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
|
|
3
5
|
export interface mgUser {
|
|
4
6
|
id: number | null;
|
|
5
7
|
deviceId: string| null; // this will be abstracted away to a join table
|
|
@@ -14,6 +16,7 @@ export interface mgUser {
|
|
|
14
16
|
createdAt: string | null;
|
|
15
17
|
updatedAt: string | null;
|
|
16
18
|
imageURL: string | null;
|
|
19
|
+
createdBy: 'admin' | 'user'
|
|
17
20
|
// friendship?: mgFriendship; // a user's friends have a record of the friendship attached
|
|
18
21
|
// activeRole?:string; // indicates whether user is a friend ('user') or responder ('medical', 'security', etc.)
|
|
19
22
|
}
|
|
@@ -49,3 +52,4 @@ export interface mgShareTimeStamp {
|
|
|
49
52
|
updatedAt: string;
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
|
|
@@ -187,6 +187,7 @@ export interface mgColorsConfig {
|
|
|
187
187
|
lightNeutral: string;
|
|
188
188
|
darkNeutral: string;
|
|
189
189
|
dark: string;
|
|
190
|
+
sunkSurface:string;
|
|
190
191
|
success: string;
|
|
191
192
|
warning: string;
|
|
192
193
|
locationPuck: string;
|
|
@@ -255,7 +256,7 @@ interface mgFontTextStyle {
|
|
|
255
256
|
*
|
|
256
257
|
* @property labelSmall: bottom navigation buttons, map label marker ("ZOOM IN"), other small-font instructions/labels
|
|
257
258
|
* @property labelMedium: map filter container switch, map label marker (title), RSVP time info and check text, Custom Chip
|
|
258
|
-
* @property labelLarge: standard & segmented button texts, loading modal, accordion titles,
|
|
259
|
+
* @property labelLarge: standard & segmented button texts, loading modal, accordion titles, help modal, confirm action snackbar title
|
|
259
260
|
* @property bodySmall: smallest normal text. Still needs to be legible.
|
|
260
261
|
* @property bodyMedium: avatar and modal text, card primary text,
|
|
261
262
|
* @property bodyLarge: TextInput, some accessory text (on splash)
|