mgtypes 1.0.51 → 1.0.53

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mgtypes",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "types for mg development",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/types/App.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Position } from 'geojson';
1
+ import { mgMapBillboards } from './Content';
2
2
 
3
3
  // App coming from admin database
4
4
  export interface App {
@@ -14,7 +14,7 @@ export interface App {
14
14
  eventZip: string;
15
15
  mapTheme: 'light' | 'dark' | 'streets' | 'outdoors';
16
16
  mapStyleUrl: string;
17
- mapSigns: MapSigns;
17
+ mapBillboards: mgMapBillboards;
18
18
  pins: any[];
19
19
  plans: any[];
20
20
  photos: any[];
@@ -25,20 +25,7 @@ export interface App {
25
25
  appColors: AppColors;
26
26
  }
27
27
 
28
- /**
29
- * @param icon use a hyphen to connect substrings, as in 'ferris-wheel'. This is Expo-friendly.
30
- * @param iconColor use hex, as in '#e5e5e5'
31
- * @param image not configured, would be used to display image on label
32
- */
33
- export interface MapSign {
34
- title: string;
35
- icon: string | null;
36
- latitude: number;
37
- longitude: number;
38
- iconColor: string | null;
39
- image: string | null;
40
- boundingBox: Position[];
41
- }
28
+
42
29
 
43
30
  export interface AppColors {
44
31
  primary: string;
@@ -50,8 +37,3 @@ export interface AppColors {
50
37
  outline: string;
51
38
  surfaceVariant: string;
52
39
  }
53
-
54
- export interface MapSigns {
55
- zoomThresholds: number[];
56
- signs: MapSign[][];
57
- }
@@ -1,5 +1,4 @@
1
- import { Position } from 'geojson';
2
- import { MapSign } from './App';
1
+ import { mgMapBillboards } from './Content';
3
2
 
4
3
  /**
5
4
  * Mother Config object
@@ -23,7 +22,7 @@ export interface mgConfiguration {
23
22
  * Configs for map
24
23
  */
25
24
  export interface mgMapConfig {
26
- MAP_LABELS: { zoomThresholds: number[]; labels: MapSign[][] };
25
+ MAP_BILLBOARDS: mgMapBillboards;
27
26
  MAP_STYLE_URL: string;
28
27
  DEFAULT_MAP_BOUNDARIES: { latitude: number; longitude: number }[];
29
28
  }
@@ -215,6 +214,8 @@ export interface mgAuthenticationConfig {
215
214
 
216
215
  /**
217
216
  * Configs based on React Native Paper color assignments w/ some extras
217
+ * @property surfaceVariant: seems to be the color of the icon button, but
218
+ * setting another component's background to it does not match the icon button
218
219
  */
219
220
  export interface mgColorsConfig {
220
221
  // NEW ONES
@@ -228,7 +229,6 @@ export interface mgColorsConfig {
228
229
  darkNeutral: string;
229
230
  dark: string;
230
231
 
231
-
232
232
  success: string;
233
233
  warning: string;
234
234
 
@@ -241,7 +241,6 @@ export interface mgColorsConfig {
241
241
  secondaryContainerGradient: string;
242
242
  tertiaryContainerGradient: string;
243
243
 
244
-
245
244
  // ORIGINALS
246
245
 
247
246
  primary: string;
@@ -269,7 +268,7 @@ export interface mgColorsConfig {
269
268
  onBackground: string;
270
269
  surface: string;
271
270
  onSurface: string;
272
- surfaceVariant: string;
271
+ surfaceVariant: string; // IconButton and CustomChip unselected bg
273
272
  onSurfaceVariant: string;
274
273
  inverseSurface: string;
275
274
  inverseOnSurface: string;
@@ -472,39 +471,22 @@ export interface mgPermissionsProfile {
472
471
  * @param pins one of this property's internal properties can be 'all', which will filter all pins
473
472
  * @param plans same as above
474
473
  */
474
+
475
+ // TODO: create a data structure that encapsulates
476
+ // how filters might effectively work
475
477
  export interface mgMapFiltersProfile {
476
- pins?: { [key: string]: mgMapFilter };
477
- plans?: { [key: string]: mgMapFilter };
478
- people?: {
479
- friends?: mgMapFilter;
480
- fire?: mgMapFilter;
481
- security?: mgMapFilter;
482
- medical?: mgMapFilter;
483
- 'mental health'?: mgMapFilter;
484
- allResponders?: mgMapFilter;
485
- all?: mgMapFilter;
486
- };
487
- emergencies?: {
488
- fire?: mgMapFilter;
489
- security?: mgMapFilter;
490
- medical?: mgMapFilter;
491
- 'mental health'?: mgMapFilter;
492
- all?: mgMapFilter;
493
- };
494
- routes?: {
495
- runs?: mgMapFilter;
496
- parades?: mgMapFilter;
497
- all?: mgMapFilter;
498
- };
478
+ [filterName: string]: mgMapFilter;
499
479
  }
500
480
 
501
481
  /**
502
482
  * Configs to display a map filter
503
483
  */
504
484
  export interface mgMapFilter {
505
- category: 'route' | 'pin' | 'person' | 'plan' | 'emergency';
506
- value: string;
507
- labelText: string;
485
+ contentToFilter?: {
486
+ contentType: 'pin' | 'plan' | 'route'; // 'pin'
487
+ contentableCategory: string | 'all'; // 'food'
488
+ contentableType: string | 'all'; // 'burgers'
489
+ }[];
490
+ contentItemsToFilter?: number[];
508
491
  icon: string;
509
- color: string;
510
492
  }
package/types/Content.ts CHANGED
@@ -1,70 +1,22 @@
1
- import { Tag } from './Tag';
2
- import { User, UserPlan, Sender, UserRole } from './User';
3
- import { Vote } from './Vote';
4
- import { Emergency } from './Emergency';
1
+ import { mgTag } from './Tag';
2
+ import { mgUser, mgUserPlan, mgSender, mgUserRole } from './User';
3
+ import { mgVote } from './Vote';
4
+ import { mgEmergency } from './Emergency';
5
5
  import { Position } from 'geojson';
6
6
 
7
- /**
8
- * shared posts will have sharedContentDetails, normal
9
- * posts won't have sCD. Posts with threads attached have
10
- * children; thread tracks who added and where a threaded
11
- * post goes. A plan may have UserPlan details that indicate
12
- * if user is attending the plan
13
- * */
14
- export interface AppContent {
15
- feedData: {
16
- mainContent: { order: number[]; content: { [contentId: string]: Post } };
17
- sharedContent: { order: number[]; content: { [contentId: string]: Post } };
18
- friendsContent: { order: number[]; content: { [contentId: string]: Post } };
19
- userContent: { order: number[]; content: { [contentId: string]: Post } };
20
- };
21
- mapData: {
22
- pins: { [contentId: string]: Post };
23
- publicPlans: { [contentId: string]: Post };
24
- userPlans: { [contentId: string]: Post };
25
- pinAds: { [contentId: string]: Post };
26
- planAds: { [contentId: string]: Post };
27
- routes: { [contentId: string]: Post };
28
- };
29
- userData: {
30
- user: User;
31
- votes: Vote[];
32
- friends: { [userId: string]: User };
33
- plans: UserPlan[];
34
- friendRequests: { [friendRequestId: string]: FriendRequest };
35
- roles: UserRole[];
36
- activeRole: string;
37
- emergencies: Emergency[];
38
- };
39
- listsData: {
40
- [listId: string]: {
41
- content: { [contentId: string]: Post };
42
- order: number[];
43
- title: string;
44
- description: string;
45
- icon: string;
46
- };
47
- };
48
- calendarData: {
49
- publicPlans: { [contentId: string]: Post };
50
- };
51
- }
52
- export interface PostWithIndex {
53
- [contentId: string]: Post;
54
- }
55
7
 
56
- export interface Post {
57
- content: Content;
58
- contentable: Contentable;
59
- user: User;
60
- tags: Tag[];
61
- sharedContentDetails?: SharedContentDetails;
62
- userPlan?: UserPlan;
8
+ export interface mgPost {
9
+ content: mgContent;
10
+ contentable: mgContentable;
11
+ user: mgUser;
12
+ tags: mgTag[];
13
+ sharedContentDetails?: mgSharedContentDetails;
14
+ userPlan?: mgUserPlan;
63
15
  // children?: Post[];
64
16
  // thread?: Thread;
65
- userVote?: Vote;
17
+ userVote?: mgVote;
66
18
  indent?: number;
67
- parent?: Post;
19
+ parent?: mgPost;
68
20
  pages?: {
69
21
  feed:
70
22
  | { main?: number; shared?: number; user?: number; friends?: number }
@@ -78,17 +30,17 @@ export interface Post {
78
30
  /**
79
31
  * indicates who embedded a piece of content: used for ThreadModal
80
32
  * */
81
- export interface Thread {
33
+ export interface mgThread {
82
34
  id: number;
83
35
  parentId: number;
84
36
  childId: number;
85
37
  threaderId: number;
86
38
  createdAt: string;
87
39
  updatedAt: string;
88
- threader: User;
40
+ threader: mgUser;
89
41
  }
90
42
 
91
- export interface Content {
43
+ export interface mgContent {
92
44
  id: number;
93
45
  latitude: number | string; // should be a number but is coming back from db as a string for some reason
94
46
  longitude: number | string; // same as above
@@ -116,7 +68,7 @@ export interface Content {
116
68
  * Covers all different content types
117
69
  * (pin, plan, comment, photo, route) coming in from server
118
70
  * */
119
- export interface Contentable {
71
+ export interface mgContentable {
120
72
  id: number;
121
73
  primaryText: string;
122
74
  secondaryText?: string;
@@ -148,20 +100,21 @@ export interface Contentable {
148
100
  phoneNumber?: string;
149
101
 
150
102
  // Pins
151
- pinHours?: PinHour[];
103
+ pinHours?: mgPinHour[];
152
104
 
153
105
  // Routes
154
106
  routeCategory?: string;
107
+ routeType?:string;
155
108
  distance?: string;
156
109
  color?: string;
157
110
  coordinates?: Position[];
158
111
 
159
112
  // Embed
160
- embeddedContent: Post;
113
+ embeddedContent: mgPost;
161
114
  embeddedContentId: number;
162
115
  }
163
116
 
164
- export interface PinHour {
117
+ export interface mgPinHour {
165
118
  id: number;
166
119
  openDateTime: string;
167
120
  closeDateTime: string;
@@ -170,16 +123,8 @@ export interface PinHour {
170
123
  pinId: number;
171
124
  }
172
125
 
173
- export interface SharedContentDetails {
174
- senders: Sender[];
175
- sharedContentStatus: {
176
- id: number;
177
- isArchived: boolean;
178
- createdAt: string;
179
- updatedAt: string;
180
- contentId: number;
181
- userId: number;
182
- };
126
+ export interface mgSharedContentDetails {
127
+ senders: mgSender[];
183
128
  }
184
129
 
185
130
  /**
@@ -189,7 +134,7 @@ export interface SharedContentDetails {
189
134
  * has last updated it. TODO:type create events that document
190
135
  * how a friendship has changed over time
191
136
  */
192
- export interface FriendRequest {
137
+ export interface mgFriendRequest {
193
138
  id: number;
194
139
  status:
195
140
  | 'pending'
@@ -202,12 +147,12 @@ export interface FriendRequest {
202
147
  updatedAt: string;
203
148
  requesterId: number;
204
149
  recipientId: number;
205
- requester: User;
206
- recipient: User;
150
+ requester: mgUser;
151
+ recipient: mgUser;
207
152
  lastUpdaterId: number;
208
153
  }
209
154
 
210
- export interface Pin {
155
+ export interface mgPin {
211
156
  id: number | null; // will not have id when creating
212
157
  pinCategory?: string;
213
158
  pinType?: string;
@@ -226,7 +171,7 @@ export interface Pin {
226
171
  link?: string | null;
227
172
  }
228
173
 
229
- export interface Plan {
174
+ export interface mgPlan {
230
175
  id: number | null; // will not have id when creating
231
176
  planCategory: string;
232
177
  planType: string;
@@ -245,14 +190,14 @@ export interface Plan {
245
190
  updatedAt: string;
246
191
  }
247
192
 
248
- export interface Comment {
193
+ export interface mgComment {
249
194
  id: number | null; // will not have id when creating
250
195
  primaryText: string;
251
196
  createdAt: string;
252
197
  updatedAt: string;
253
198
  }
254
199
 
255
- export interface Photo {
200
+ export interface mgPhoto {
256
201
  id: number | null; // will not have id when creating
257
202
  primaryText: string;
258
203
  photoURL?: string;
@@ -260,7 +205,7 @@ export interface Photo {
260
205
  updatedAt: string;
261
206
  }
262
207
 
263
- export interface Route {
208
+ export interface mgRoute {
264
209
  routeCategory: string;
265
210
  primaryText: string;
266
211
  secondaryText: string;
@@ -272,3 +217,23 @@ export interface Route {
272
217
  link: string;
273
218
  phoneNumber: string;
274
219
  }
220
+
221
+ /**
222
+ * @param icon use a hyphen to connect substrings, as in 'ferris-wheel'. This is Expo-friendly.
223
+ * @param iconColor use hex, as in '#e5e5e5'
224
+ * @param image not configured, would be used to display image on label
225
+ */
226
+ export interface mgMapBillboard {
227
+ title: string;
228
+ icon: string | null;
229
+ latitude: number;
230
+ longitude: number;
231
+ iconColor: string | null;
232
+ image: string | null;
233
+ boundingBox: Position[];
234
+ }
235
+ export interface mgMapBillboards {
236
+ zoomThresholds: number[];
237
+ billboards: mgMapBillboard[][];
238
+ }
239
+
@@ -1,6 +1,6 @@
1
- import { User } from "./User";
1
+ import {mgUser } from "./User";
2
2
 
3
- export interface Emergency {
3
+ export interface mgEmergency {
4
4
  id?: number;
5
5
  createdAt?: string;
6
6
  updatedAt?: string;
@@ -11,6 +11,6 @@ export interface Emergency {
11
11
  emergencyType: 'medical' | 'security' | 'fire' | 'mental health' | null;
12
12
  primaryText: string;
13
13
  address: string | null;
14
- reporter?: User;
14
+ reporter?: mgUser;
15
15
  }
16
16
 
@@ -12,26 +12,26 @@ export enum mgNativePermissionTitle {
12
12
 
13
13
  export enum mgLocationPermissionTitle {
14
14
  SHOW_LOCATION = 'SHOW_LOCATION',
15
- SHOW_DISTANCE_FROM_PINS = 'SHOW_DISTANCE_FROM_PINS',
16
- LOCATION_TARGETED_CONTENT = 'LOCATION_TARGETED_CONTENT',
17
- FRIENDS_LOCATION_SHARING_BACKGROUND = 'FRIENDS_LOCATION_SHARING_BACKGROUND',
18
- FRIENDS_LOCATION_SHARING_FOREGROUND = 'FRIENDS_LOCATION_SHARING_FOREGROUND',
19
- EMERGENCY_LOCATION_SHARING = 'EMERGENCY_LOCATION_SHARING',
15
+ SHOW_DISTANCE_TO_PINS = 'SHOW_DISTANCE_TO_PINS',
16
+ ENABLE_GEOTARGETED_CONTENT = 'ENABLE_GEOTARGETED_CONTENT',
17
+ SHARE_BACKGROUND_LOCATION_WITH_FRIENDS = 'SHARE_BACKGROUND_LOCATION_WITH_FRIENDS',
18
+ SHARE_FOREGROUND_LOCATION_WITH_FRIENDS = 'SHARE_FOREGROUND_LOCATION_WITH_FRIENDS',
19
+ SHARE_LOCATION_FOR_EMERGENCIES = 'SHARE_LOCATION_FOR_EMERGENCIES',
20
20
  }
21
21
 
22
22
  // adding all of them distinctly to
23
23
  // educate users; they can all be default
24
24
  // and disabled true
25
25
  export enum mgCalendarPermissionTitle {
26
- CREATE_EVENTS = 'CREATE_EVENTS',
27
- CREATE_REMINDERS = 'CREATE_REMINDERS',
28
- ADD_ATTENDEES = 'ADD_ATTENDEES',
26
+ ENABLE_CREATE_EVENTS = 'ENABLE_CREATE_EVENTS',
27
+ ENABLE_CREATE_REMINDERS = 'ENABLE_CREATE_REMINDERS',
28
+ ENABLE_CREATE_ATTENDEES = 'ENABLE_CREATE_ATTENDEES',
29
29
  }
30
30
 
31
31
  export enum mgNotificationsPermissionTitle {
32
- ALLOW_FOR_RSVPS = 'ALLOW_FOR_RSVPS',
33
- ALLOW_FOR_UPDATES = 'ALLOW_FOR_UPDATES',
34
- ALLOW_FOR_MARKETING = 'ALLOW_FOR_MARKETING',
32
+ RECEIVE_RSVP_NOTIFICATIONS = 'RECEIVE_RSVP_NOTIFICATIONS',
33
+ RECEIVE_EVENT_NEWS_NOTIFICATIONS = 'RECEIVE_EVENT_NEWS_NOTIFICATIONS',
34
+ RECEIVE_MARKETING_NOTIFICATIONS = 'RECEIVE_MARKETING_NOTIFICATIONS',
35
35
  }
36
36
 
37
37
  export const nativePermissionsOrder: mgNativePermissionTitle[] = [
@@ -47,21 +47,21 @@ export const nativePermissionsOrder: mgNativePermissionTitle[] = [
47
47
 
48
48
  export const locationPermissionsOrder: mgLocationPermissionTitle[] = [
49
49
  mgLocationPermissionTitle.SHOW_LOCATION,
50
- mgLocationPermissionTitle.SHOW_DISTANCE_FROM_PINS,
51
- mgLocationPermissionTitle.LOCATION_TARGETED_CONTENT,
52
- mgLocationPermissionTitle.FRIENDS_LOCATION_SHARING_FOREGROUND,
53
- mgLocationPermissionTitle.FRIENDS_LOCATION_SHARING_BACKGROUND,
54
- mgLocationPermissionTitle.EMERGENCY_LOCATION_SHARING,
50
+ mgLocationPermissionTitle.SHOW_DISTANCE_TO_PINS,
51
+ mgLocationPermissionTitle.ENABLE_GEOTARGETED_CONTENT,
52
+ mgLocationPermissionTitle.SHARE_BACKGROUND_LOCATION_WITH_FRIENDS,
53
+ mgLocationPermissionTitle.SHARE_FOREGROUND_LOCATION_WITH_FRIENDS,
54
+ mgLocationPermissionTitle.SHARE_LOCATION_FOR_EMERGENCIES,
55
55
  ];
56
56
 
57
57
  export const calendarPermissionsOrder: mgCalendarPermissionTitle[] = [
58
- mgCalendarPermissionTitle.CREATE_EVENTS,
59
- mgCalendarPermissionTitle.CREATE_REMINDERS,
60
- mgCalendarPermissionTitle.ADD_ATTENDEES,
58
+ mgCalendarPermissionTitle.ENABLE_CREATE_EVENTS,
59
+ mgCalendarPermissionTitle.ENABLE_CREATE_REMINDERS,
60
+ mgCalendarPermissionTitle.ENABLE_CREATE_ATTENDEES,
61
61
  ];
62
62
 
63
63
  export const notificationsPermissionsOrder: mgNotificationsPermissionTitle[] = [
64
- mgNotificationsPermissionTitle.ALLOW_FOR_RSVPS,
65
- mgNotificationsPermissionTitle.ALLOW_FOR_UPDATES,
66
- mgNotificationsPermissionTitle.ALLOW_FOR_MARKETING,
64
+ mgNotificationsPermissionTitle.RECEIVE_RSVP_NOTIFICATIONS,
65
+ mgNotificationsPermissionTitle.RECEIVE_EVENT_NEWS_NOTIFICATIONS,
66
+ mgNotificationsPermissionTitle.RECEIVE_MARKETING_NOTIFICATIONS,
67
67
  ];
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { mgNativePermissionTitle } from './Permissions';
4
4
 
5
- export enum SecureStoreKey {
5
+ export enum mgSecureStoreKey {
6
6
  LOGIN_PERMISSION_MODAL= 'LOGIN_PERMISSION_MODAL',
7
7
  PERMISSIONS = 'PERMISSIONS',
8
8
 
package/types/Tag.ts CHANGED
@@ -1,12 +1,12 @@
1
- export interface Tag {
1
+ export interface mgTag {
2
2
  id: number;
3
3
  tag: string;
4
4
  createdAt: string;
5
5
  updatedAt: string;
6
- content_tag: ContentTag;
6
+ content_tag: mgContentTag;
7
7
  }
8
8
 
9
- export interface ContentTag {
9
+ export interface mgContentTag {
10
10
  id: number;
11
11
  createdAt: string;
12
12
  updatedAt: string;
package/types/User.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { FriendRequest } from "./Content";
1
+ import { mgFriendRequest } from "./Content";
2
2
 
3
- export interface User {
3
+ export interface mgUser {
4
4
  id: number | null;
5
5
  givenName: string | null;
6
6
  familyName: string | null;
@@ -14,11 +14,11 @@ export interface User {
14
14
  createdAt: string | null;
15
15
  updatedAt: string | null;
16
16
  imageURL: string | null;
17
- friendRequest?: FriendRequest; // a user's friends have a record of the friendship attached
17
+ friendRequest?: mgFriendRequest; // a user's friends have a record of the friendship attached
18
18
  activeRole?:string; // indicates whether user is a friend ('user') or responder ('medical', 'security', etc.)
19
19
  }
20
20
 
21
- export interface UserRole {
21
+ export interface mgUserRole {
22
22
  id: number | null;
23
23
  createdAt: string | null;
24
24
  updatedAt: string | null;
@@ -27,7 +27,7 @@ export interface UserRole {
27
27
  isActiveRole: boolean;
28
28
  }
29
29
 
30
- export interface UserPlan {
30
+ export interface mgUserPlan {
31
31
  status: 'accepted' | 'denied' | 'pending';
32
32
  userId: number;
33
33
  contentId: number;
@@ -36,11 +36,11 @@ export interface UserPlan {
36
36
  id: number;
37
37
  }
38
38
 
39
- export interface Sender extends User {
40
- shareTimeStamp: ShareTimeStamp;
39
+ export interface mgSender extends mgUser {
40
+ shareTimeStamp: mgShareTimeStamp;
41
41
  }
42
42
 
43
- export interface ShareTimeStamp {
43
+ export interface mgShareTimeStamp {
44
44
  id: number | null;
45
45
  contentId: number;
46
46
  senderId: number;
package/types/Vote.ts CHANGED
@@ -1,4 +1,4 @@
1
- export interface Vote {
1
+ export interface mgVote {
2
2
  userId: number;
3
3
  contentId: number;
4
4
  vote: 'up'|'down'|null;