mgtypes 1.0.52 → 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.52",
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
@@ -267,7 +268,7 @@ export interface mgColorsConfig {
267
268
  onBackground: string;
268
269
  surface: string;
269
270
  onSurface: string;
270
- surfaceVariant: string;
271
+ surfaceVariant: string; // IconButton and CustomChip unselected bg
271
272
  onSurfaceVariant: string;
272
273
  inverseSurface: string;
273
274
  inverseOnSurface: string;
@@ -483,9 +484,9 @@ export interface mgMapFiltersProfile {
483
484
  export interface mgMapFilter {
484
485
  contentToFilter?: {
485
486
  contentType: 'pin' | 'plan' | 'route'; // 'pin'
486
- contentableCategory: string; // 'food'
487
- contentableType: string; // 'burgers'
487
+ contentableCategory: string | 'all'; // 'food'
488
+ contentableType: string | 'all'; // 'burgers'
488
489
  }[];
489
- contentItemsToFilter?: number[]
490
+ contentItemsToFilter?: number[];
490
491
  icon: string;
491
492
  }
package/types/Content.ts CHANGED
@@ -1,22 +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
7
 
8
- export interface Post {
9
- content: Content;
10
- contentable: Contentable;
11
- user: User;
12
- tags: Tag[];
13
- sharedContentDetails?: SharedContentDetails;
14
- userPlan?: UserPlan;
8
+ export interface mgPost {
9
+ content: mgContent;
10
+ contentable: mgContentable;
11
+ user: mgUser;
12
+ tags: mgTag[];
13
+ sharedContentDetails?: mgSharedContentDetails;
14
+ userPlan?: mgUserPlan;
15
15
  // children?: Post[];
16
16
  // thread?: Thread;
17
- userVote?: Vote;
17
+ userVote?: mgVote;
18
18
  indent?: number;
19
- parent?: Post;
19
+ parent?: mgPost;
20
20
  pages?: {
21
21
  feed:
22
22
  | { main?: number; shared?: number; user?: number; friends?: number }
@@ -30,17 +30,17 @@ export interface Post {
30
30
  /**
31
31
  * indicates who embedded a piece of content: used for ThreadModal
32
32
  * */
33
- export interface Thread {
33
+ export interface mgThread {
34
34
  id: number;
35
35
  parentId: number;
36
36
  childId: number;
37
37
  threaderId: number;
38
38
  createdAt: string;
39
39
  updatedAt: string;
40
- threader: User;
40
+ threader: mgUser;
41
41
  }
42
42
 
43
- export interface Content {
43
+ export interface mgContent {
44
44
  id: number;
45
45
  latitude: number | string; // should be a number but is coming back from db as a string for some reason
46
46
  longitude: number | string; // same as above
@@ -68,7 +68,7 @@ export interface Content {
68
68
  * Covers all different content types
69
69
  * (pin, plan, comment, photo, route) coming in from server
70
70
  * */
71
- export interface Contentable {
71
+ export interface mgContentable {
72
72
  id: number;
73
73
  primaryText: string;
74
74
  secondaryText?: string;
@@ -100,7 +100,7 @@ export interface Contentable {
100
100
  phoneNumber?: string;
101
101
 
102
102
  // Pins
103
- pinHours?: PinHour[];
103
+ pinHours?: mgPinHour[];
104
104
 
105
105
  // Routes
106
106
  routeCategory?: string;
@@ -110,11 +110,11 @@ export interface Contentable {
110
110
  coordinates?: Position[];
111
111
 
112
112
  // Embed
113
- embeddedContent: Post;
113
+ embeddedContent: mgPost;
114
114
  embeddedContentId: number;
115
115
  }
116
116
 
117
- export interface PinHour {
117
+ export interface mgPinHour {
118
118
  id: number;
119
119
  openDateTime: string;
120
120
  closeDateTime: string;
@@ -123,8 +123,8 @@ export interface PinHour {
123
123
  pinId: number;
124
124
  }
125
125
 
126
- export interface SharedContentDetails {
127
- senders: Sender[];
126
+ export interface mgSharedContentDetails {
127
+ senders: mgSender[];
128
128
  }
129
129
 
130
130
  /**
@@ -134,7 +134,7 @@ export interface SharedContentDetails {
134
134
  * has last updated it. TODO:type create events that document
135
135
  * how a friendship has changed over time
136
136
  */
137
- export interface FriendRequest {
137
+ export interface mgFriendRequest {
138
138
  id: number;
139
139
  status:
140
140
  | 'pending'
@@ -147,12 +147,12 @@ export interface FriendRequest {
147
147
  updatedAt: string;
148
148
  requesterId: number;
149
149
  recipientId: number;
150
- requester: User;
151
- recipient: User;
150
+ requester: mgUser;
151
+ recipient: mgUser;
152
152
  lastUpdaterId: number;
153
153
  }
154
154
 
155
- export interface Pin {
155
+ export interface mgPin {
156
156
  id: number | null; // will not have id when creating
157
157
  pinCategory?: string;
158
158
  pinType?: string;
@@ -171,7 +171,7 @@ export interface Pin {
171
171
  link?: string | null;
172
172
  }
173
173
 
174
- export interface Plan {
174
+ export interface mgPlan {
175
175
  id: number | null; // will not have id when creating
176
176
  planCategory: string;
177
177
  planType: string;
@@ -190,14 +190,14 @@ export interface Plan {
190
190
  updatedAt: string;
191
191
  }
192
192
 
193
- export interface Comment {
193
+ export interface mgComment {
194
194
  id: number | null; // will not have id when creating
195
195
  primaryText: string;
196
196
  createdAt: string;
197
197
  updatedAt: string;
198
198
  }
199
199
 
200
- export interface Photo {
200
+ export interface mgPhoto {
201
201
  id: number | null; // will not have id when creating
202
202
  primaryText: string;
203
203
  photoURL?: string;
@@ -205,7 +205,7 @@ export interface Photo {
205
205
  updatedAt: string;
206
206
  }
207
207
 
208
- export interface Route {
208
+ export interface mgRoute {
209
209
  routeCategory: string;
210
210
  primaryText: string;
211
211
  secondaryText: string;
@@ -217,3 +217,23 @@ export interface Route {
217
217
  link: string;
218
218
  phoneNumber: string;
219
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;