mgtypes 1.0.55 → 1.0.57
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/Authentication.ts +0 -0
- package/types/Configuration.ts +41 -40
- package/types/Content.ts +3 -1
- package/types/Permissions.ts +35 -3
- package/types/User.ts +4 -3
package/package.json
CHANGED
|
File without changes
|
package/types/Configuration.ts
CHANGED
|
@@ -354,6 +354,7 @@ export interface mgProfilesConfig {
|
|
|
354
354
|
GUEST: mgProfileConfig;
|
|
355
355
|
MEMBER: mgProfileConfig;
|
|
356
356
|
ADMIN: mgProfileConfig;
|
|
357
|
+
DEFAULT: mgProfileConfig;
|
|
357
358
|
}
|
|
358
359
|
|
|
359
360
|
interface mgProfileConfig {
|
|
@@ -392,14 +393,15 @@ export interface mgPermissionsProfile {
|
|
|
392
393
|
// VERSION OF THE APP? IF SO, THEY APPEAR IN SETTINGS
|
|
393
394
|
NATIVE_PERMISSIONS: {
|
|
394
395
|
LOCATION_FOREGROUND: { isRequired: boolean; requestOnInit: boolean };
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
396
|
+
// TODO:permissionsConfig
|
|
397
|
+
// LOCATION_BACKGROUND: { isRequired: boolean; requestOnInit: boolean };
|
|
398
|
+
// MEDIA_LIBRARY: { isRequired: boolean; requestOnInit: boolean };
|
|
399
|
+
// REMINDERS: { isRequired: boolean; requestOnInit: boolean };
|
|
400
|
+
// NOTIFICATIONS: { isRequired: boolean; requestOnInit: boolean };
|
|
401
|
+
// CAMERA: { isRequired: boolean; requestOnInit: boolean };
|
|
402
|
+
// MICROPHONE: { isRequired: boolean; requestOnInit: boolean };
|
|
403
|
+
// CONTACTS: { isRequired: boolean; requestOnInit: boolean };
|
|
404
|
+
// CALENDAR: { isRequired: boolean; requestOnInit: boolean };
|
|
403
405
|
};
|
|
404
406
|
FEATURES: {
|
|
405
407
|
CAN_HAVE_FRIENDS: boolean;
|
|
@@ -432,35 +434,37 @@ export interface mgPermissionsProfile {
|
|
|
432
434
|
SHARE_LOCATIONS_FOR_EMERGENCIES: { canToggle: boolean; default: boolean };
|
|
433
435
|
};
|
|
434
436
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
437
|
+
// TODO:permissionsConfig
|
|
438
|
+
// CALENDAR: {
|
|
439
|
+
// ENABLE_CREATE_EVENTS: {
|
|
440
|
+
// canToggle: boolean;
|
|
441
|
+
// default: boolean;
|
|
442
|
+
// };
|
|
443
|
+
// ENABLE_CREATE_REMINDERS: {
|
|
444
|
+
// canToggle: boolean;
|
|
445
|
+
// default: boolean;
|
|
446
|
+
// };
|
|
447
|
+
// ENABLE_ADD_ATTENDEES: {
|
|
448
|
+
// canToggle: boolean;
|
|
449
|
+
// default: boolean;
|
|
450
|
+
// };
|
|
451
|
+
// };
|
|
452
|
+
|
|
453
|
+
// TODO:permissionsConfig
|
|
454
|
+
// NOTIFICATIONS: {
|
|
455
|
+
// RECEIVE_RSVP_NOTIFICATIONS: {
|
|
456
|
+
// canToggle: boolean;
|
|
457
|
+
// default: boolean;
|
|
458
|
+
// };
|
|
459
|
+
// RECEIVE_EVENT_NEWS_NOTIFICATIONS: {
|
|
460
|
+
// canToggle: boolean;
|
|
461
|
+
// default: boolean;
|
|
462
|
+
// };
|
|
463
|
+
// RECEIVE_MARKETING_NOTIFICATIONS: {
|
|
464
|
+
// canToggle: boolean;
|
|
465
|
+
// default: boolean;
|
|
466
|
+
// };
|
|
467
|
+
// };
|
|
464
468
|
}
|
|
465
469
|
|
|
466
470
|
/**
|
|
@@ -471,9 +475,6 @@ export interface mgPermissionsProfile {
|
|
|
471
475
|
* @param pins one of this property's internal properties can be 'all', which will filter all pins
|
|
472
476
|
* @param plans same as above
|
|
473
477
|
*/
|
|
474
|
-
|
|
475
|
-
// TODO: create a data structure that encapsulates
|
|
476
|
-
// how filters might effectively work
|
|
477
478
|
export interface mgMapFiltersProfile {
|
|
478
479
|
[filterName: string]: mgMapFilter;
|
|
479
480
|
}
|
package/types/Content.ts
CHANGED
|
@@ -133,8 +133,10 @@ export interface mgSharedContentDetails {
|
|
|
133
133
|
* Documents when the request was originally made and who
|
|
134
134
|
* has last updated it. TODO:type create events that document
|
|
135
135
|
* how a friendship has changed over time
|
|
136
|
+
*
|
|
137
|
+
* based on the User_friend model
|
|
136
138
|
*/
|
|
137
|
-
export interface
|
|
139
|
+
export interface mgFriendship {
|
|
138
140
|
id: number;
|
|
139
141
|
status:
|
|
140
142
|
| 'pending'
|
package/types/Permissions.ts
CHANGED
|
@@ -10,6 +10,11 @@ export enum mgNativePermissionTitle {
|
|
|
10
10
|
NOTIFICATIONS = 'NOTIFICATIONS',
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
// TODO:permissionsConfig add other permission titles
|
|
14
|
+
export enum mgNonNativePermissionTitle {
|
|
15
|
+
mgLocationPermissionTitle,
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
export enum mgLocationPermissionTitle {
|
|
14
19
|
SHOW_LOCATION = 'SHOW_LOCATION',
|
|
15
20
|
SHOW_DISTANCE_TO_PINS = 'SHOW_DISTANCE_TO_PINS',
|
|
@@ -19,21 +24,48 @@ export enum mgLocationPermissionTitle {
|
|
|
19
24
|
SHARE_LOCATION_FOR_EMERGENCIES = 'SHARE_LOCATION_FOR_EMERGENCIES',
|
|
20
25
|
}
|
|
21
26
|
|
|
22
|
-
//
|
|
23
|
-
// educate users; they can all be default
|
|
24
|
-
// and disabled true
|
|
27
|
+
// TODO:permissionsConfig -- Not being used at the moment
|
|
25
28
|
export enum mgCalendarPermissionTitle {
|
|
26
29
|
ENABLE_CREATE_EVENTS = 'ENABLE_CREATE_EVENTS',
|
|
27
30
|
ENABLE_CREATE_REMINDERS = 'ENABLE_CREATE_REMINDERS',
|
|
28
31
|
ENABLE_ADD_ATTENDEES = 'ENABLE_ADD_ATTENDEES',
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
// TODO:permissionsConfig -- Not being used at the moment
|
|
31
35
|
export enum mgNotificationsPermissionTitle {
|
|
32
36
|
RECEIVE_RSVP_NOTIFICATIONS = 'RECEIVE_RSVP_NOTIFICATIONS',
|
|
33
37
|
RECEIVE_EVENT_NEWS_NOTIFICATIONS = 'RECEIVE_EVENT_NEWS_NOTIFICATIONS',
|
|
34
38
|
RECEIVE_MARKETING_NOTIFICATIONS = 'RECEIVE_MARKETING_NOTIFICATIONS',
|
|
35
39
|
}
|
|
36
40
|
|
|
41
|
+
export interface mgPermissionsState {
|
|
42
|
+
NATIVE: {
|
|
43
|
+
[permission: string]: {
|
|
44
|
+
status: 'granted' | 'undetermined' | 'denied';
|
|
45
|
+
canAskAgain: boolean;
|
|
46
|
+
// will display in info modal: these are non-native, non-toggleable, and true
|
|
47
|
+
defaultTruePermissions: mgLocationPermissionTitle[]; // TODO:permissionsConfig
|
|
48
|
+
toggleablePermissions: mgLocationPermissionTitle[]; // TODO:permissionsConfig
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
LOCATION: {
|
|
52
|
+
[permission: string]: mgNonNativePermission;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface mgNonNativePermission {
|
|
57
|
+
isGranted: boolean;
|
|
58
|
+
disabled: boolean;
|
|
59
|
+
ungrantedNativePermissions: mgNativePermissionTitle[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface mgSecureStorePermission {
|
|
63
|
+
disabled: boolean;
|
|
64
|
+
isGranted: boolean;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ORDERS OF PERMISSIONS
|
|
68
|
+
|
|
37
69
|
export const nativePermissionsOrder: mgNativePermissionTitle[] = [
|
|
38
70
|
mgNativePermissionTitle.LOCATION_FOREGROUND,
|
|
39
71
|
mgNativePermissionTitle.LOCATION_BACKGROUND,
|
package/types/User.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mgFriendship } from "./Content";
|
|
2
2
|
|
|
3
3
|
export interface mgUser {
|
|
4
4
|
id: number | null;
|
|
5
|
+
deviceId: string| null; // this will be abstracted away to a join table
|
|
5
6
|
givenName: string | null;
|
|
6
7
|
familyName: string | null;
|
|
7
8
|
longName: string | null;
|
|
@@ -13,8 +14,8 @@ export interface mgUser {
|
|
|
13
14
|
createdAt: string | null;
|
|
14
15
|
updatedAt: string | null;
|
|
15
16
|
imageURL: string | null;
|
|
16
|
-
|
|
17
|
-
activeRole?:string; // indicates whether user is a friend ('user') or responder ('medical', 'security', etc.)
|
|
17
|
+
// friendship?: mgFriendship; // a user's friends have a record of the friendship attached
|
|
18
|
+
// activeRole?:string; // indicates whether user is a friend ('user') or responder ('medical', 'security', etc.)
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export interface mgUserRole {
|