clarion-shared-types 1.0.132 → 1.0.134
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/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/analytics/analytics-country.js +83 -0
- package/dist/cjs/modules/analytics/analytics-country.js.map +1 -0
- package/dist/cjs/modules/analytics/index.js +18 -0
- package/dist/cjs/modules/analytics/index.js.map +1 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla.dto.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +7 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permissions-moudule.enum.js +1 -0
- package/dist/cjs/modules/permission/enums/permissions-moudule.enum.js.map +1 -1
- package/dist/cjs/modules/safety-profile/constants/safety-profile.const.js +110 -0
- package/dist/cjs/modules/safety-profile/constants/safety-profile.const.js.map +1 -0
- package/dist/cjs/modules/safety-profile/enums/safety-profile.enums.js +188 -0
- package/dist/cjs/modules/safety-profile/enums/safety-profile.enums.js.map +1 -0
- package/dist/cjs/modules/safety-profile/index.js +27 -0
- package/dist/cjs/modules/safety-profile/index.js.map +1 -0
- package/dist/cjs/modules/safety-profile/interfaces/safety-profile-sections.js +4 -0
- package/dist/cjs/modules/safety-profile/interfaces/safety-profile-sections.js.map +1 -0
- package/dist/cjs/modules/safety-profile/interfaces/safety-profile-views.js +3 -0
- package/dist/cjs/modules/safety-profile/interfaces/safety-profile-views.js.map +1 -0
- package/dist/cjs/modules/safety-profile/utils/safety-profile-display.util.js +137 -0
- package/dist/cjs/modules/safety-profile/utils/safety-profile-display.util.js.map +1 -0
- package/dist/cjs/modules/safety-profile/utils/safety-profile-visibility.util.js +43 -0
- package/dist/cjs/modules/safety-profile/utils/safety-profile-visibility.util.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/analytics/analytics-country.js +74 -0
- package/dist/esm/modules/analytics/analytics-country.js.map +1 -0
- package/dist/esm/modules/analytics/index.js +2 -0
- package/dist/esm/modules/analytics/index.js.map +1 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla.dto.js.map +1 -1
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +7 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/permission/enums/permissions-moudule.enum.js +1 -0
- package/dist/esm/modules/permission/enums/permissions-moudule.enum.js.map +1 -1
- package/dist/esm/modules/safety-profile/constants/safety-profile.const.js +107 -0
- package/dist/esm/modules/safety-profile/constants/safety-profile.const.js.map +1 -0
- package/dist/esm/modules/safety-profile/enums/safety-profile.enums.js +185 -0
- package/dist/esm/modules/safety-profile/enums/safety-profile.enums.js.map +1 -0
- package/dist/esm/modules/safety-profile/index.js +11 -0
- package/dist/esm/modules/safety-profile/index.js.map +1 -0
- package/dist/esm/modules/safety-profile/interfaces/safety-profile-sections.js +2 -0
- package/dist/esm/modules/safety-profile/interfaces/safety-profile-sections.js.map +1 -0
- package/dist/esm/modules/safety-profile/interfaces/safety-profile-views.js +2 -0
- package/dist/esm/modules/safety-profile/interfaces/safety-profile-views.js.map +1 -0
- package/dist/esm/modules/safety-profile/utils/safety-profile-display.util.js +132 -0
- package/dist/esm/modules/safety-profile/utils/safety-profile-display.util.js.map +1 -0
- package/dist/esm/modules/safety-profile/utils/safety-profile-visibility.util.js +40 -0
- package/dist/esm/modules/safety-profile/utils/safety-profile-visibility.util.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/modules/alert-intake/interfaces/alert-intake-analytics.d.ts +9 -0
- package/dist/types/modules/analytics/analytics-country.d.ts +61 -0
- package/dist/types/modules/analytics/index.d.ts +1 -0
- package/dist/types/modules/billing/interfaces/billing-analytics.d.ts +41 -1
- package/dist/types/modules/chat/interfaces/chat-analytics.d.ts +5 -0
- package/dist/types/modules/dispatch/interfaces/dispatch-analytics.d.ts +7 -0
- package/dist/types/modules/gis/interfaces/zone-analytics.d.ts +7 -0
- package/dist/types/modules/incident/intefaces/incident-dashboard-analytics.d.ts +9 -0
- package/dist/types/modules/incident-sla/interfaces/incident-sla.dto.d.ts +9 -0
- package/dist/types/modules/newsfeed/interfaces/newsfeed-analytics.d.ts +5 -0
- package/dist/types/modules/notification/interfaces/notification-analytics.d.ts +5 -0
- package/dist/types/modules/organization/interfaces/organization-analytics.d.ts +9 -0
- package/dist/types/modules/partner/interfaces/partner-analytics.d.ts +9 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +3 -0
- package/dist/types/modules/permission/enums/permissions-moudule.enum.d.ts +1 -0
- package/dist/types/modules/safety/interfaces/safety-analytics.d.ts +9 -0
- package/dist/types/modules/safety-profile/constants/safety-profile.const.d.ts +69 -0
- package/dist/types/modules/safety-profile/enums/safety-profile.enums.d.ts +168 -0
- package/dist/types/modules/safety-profile/index.d.ts +6 -0
- package/dist/types/modules/safety-profile/interfaces/safety-profile-sections.d.ts +163 -0
- package/dist/types/modules/safety-profile/interfaces/safety-profile-views.d.ts +249 -0
- package/dist/types/modules/safety-profile/utils/safety-profile-display.util.d.ts +25 -0
- package/dist/types/modules/safety-profile/utils/safety-profile-visibility.util.d.ts +38 -0
- package/dist/types/modules/support/interfaces/support-analytics.d.ts +5 -0
- package/dist/types/modules/tracking/interfaces/tracking-analytics.d.ts +9 -0
- package/dist/types/modules/user/interfaces/account-analytics.d.ts +9 -0
- package/dist/types/modules/user/interfaces/guardian.d.ts +2 -0
- package/dist/types/modules/user/interfaces/guardians-response.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { SavedPlaceView } from '../../gis/interfaces/routing';
|
|
2
|
+
import { GuardianRelationship } from '../../user/enums/guardian-relationship.enum';
|
|
3
|
+
import { SafetyProfileAudience, SafetyProfileCategory, SafetyProfileGender, SafetyProfileHiddenReason, SafetyProfilePhotoKind } from '../enums/safety-profile.enums';
|
|
4
|
+
import { SafetyProfileSectionData, StoredSafetyProfileCategory } from './safety-profile-sections';
|
|
5
|
+
/** A category's sharing choices. */
|
|
6
|
+
export interface SafetyProfileSectionSettings {
|
|
7
|
+
/** When the person agreed to share this category; null = not agreed (nothing stored). */
|
|
8
|
+
consentedAt: string | null;
|
|
9
|
+
/** The consent text version agreed to (SAFETY_PROFILE_CONSENT_VERSION at the time). */
|
|
10
|
+
consentVersion: string | null;
|
|
11
|
+
/** Shown to the control room and responders only during an active emergency. Default on. */
|
|
12
|
+
onlyDuringSos: boolean;
|
|
13
|
+
/** Shown to the person's guardians too (never SAFETY_RISK or DEVICE). Default off. */
|
|
14
|
+
shareWithGuardians: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface SafetyProfileCategoryCompletion {
|
|
17
|
+
category: SafetyProfileCategory;
|
|
18
|
+
filled: number;
|
|
19
|
+
total: number;
|
|
20
|
+
/** 0-100, rounded down; 100 only when everything is filled. */
|
|
21
|
+
percent: number;
|
|
22
|
+
complete: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface SafetyProfileCompletion {
|
|
25
|
+
/** The mean of the categories' percents, rounded down. */
|
|
26
|
+
percent: number;
|
|
27
|
+
completeCategories: number;
|
|
28
|
+
totalCategories: number;
|
|
29
|
+
categories: SafetyProfileCategoryCompletion[];
|
|
30
|
+
}
|
|
31
|
+
/** One category as its owner sees it. */
|
|
32
|
+
export interface SafetyProfileSectionState<T = SafetyProfileSectionData> {
|
|
33
|
+
category: StoredSafetyProfileCategory;
|
|
34
|
+
/** Null when nothing has been saved. */
|
|
35
|
+
data: T | null;
|
|
36
|
+
settings: SafetyProfileSectionSettings;
|
|
37
|
+
/** Optimistic-concurrency version; send it back as expectedVersion. 0 = never saved. */
|
|
38
|
+
version: number;
|
|
39
|
+
updatedAt: string | null;
|
|
40
|
+
}
|
|
41
|
+
/** The account fields the profile shows but does not own (users table). */
|
|
42
|
+
export interface SafetyProfileAccount {
|
|
43
|
+
userId: number;
|
|
44
|
+
name: string;
|
|
45
|
+
avatar: string | null;
|
|
46
|
+
nickname: string | null;
|
|
47
|
+
/** The name the person appears under on the newsfeed (unique; see PublicUserProfile). */
|
|
48
|
+
publicName: string | null;
|
|
49
|
+
/** YYYY-MM-DD. */
|
|
50
|
+
dateOfBirth: string | null;
|
|
51
|
+
phoneNumber: string | null;
|
|
52
|
+
phoneVerified: boolean;
|
|
53
|
+
email: string | null;
|
|
54
|
+
emailVerified: boolean;
|
|
55
|
+
countryCode: string | null;
|
|
56
|
+
lastLoginAt: string | null;
|
|
57
|
+
lastActiveAt: string | null;
|
|
58
|
+
createdAt: string | null;
|
|
59
|
+
}
|
|
60
|
+
/** A device the app reported (PUT /safety-profile/me/devices/current). */
|
|
61
|
+
export interface SafetyProfileDeviceView {
|
|
62
|
+
/** The app installation's own id - distinguishes a person's devices. */
|
|
63
|
+
installationId: string;
|
|
64
|
+
platform: string;
|
|
65
|
+
manufacturer: string | null;
|
|
66
|
+
model: string | null;
|
|
67
|
+
osVersion: string | null;
|
|
68
|
+
appVersion: string | null;
|
|
69
|
+
simCountryIso: string | null;
|
|
70
|
+
simCarrier: string | null;
|
|
71
|
+
firstSeenAt: string;
|
|
72
|
+
lastActiveAt: string;
|
|
73
|
+
}
|
|
74
|
+
/** A contact of the person: a guardian (alerted on SOS) or an emergency contact (not alerted). */
|
|
75
|
+
export interface SafetyProfileContactView {
|
|
76
|
+
id: number;
|
|
77
|
+
name: string;
|
|
78
|
+
phoneNumber: string | null;
|
|
79
|
+
relationship: GuardianRelationship | null;
|
|
80
|
+
isPrimary: boolean;
|
|
81
|
+
notifyOnSos: boolean;
|
|
82
|
+
/** True when the contact is an app account of the same organization. */
|
|
83
|
+
isAppUser: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface SafetyProfileEmergencyContactsSummary {
|
|
86
|
+
guardians: number;
|
|
87
|
+
emergencyContacts: number;
|
|
88
|
+
hasPrimary: boolean;
|
|
89
|
+
}
|
|
90
|
+
/** GET /safety-profile/me - everything, for the owner. */
|
|
91
|
+
export interface MySafetyProfile {
|
|
92
|
+
account: SafetyProfileAccount;
|
|
93
|
+
sections: SafetyProfileSectionState[];
|
|
94
|
+
emergencyContacts: SafetyProfileEmergencyContactsSummary;
|
|
95
|
+
devices: SafetyProfileDeviceView[];
|
|
96
|
+
/** The saved places the sections reference, by id. A missing id = the place was deleted. */
|
|
97
|
+
places: Record<string, SavedPlaceView>;
|
|
98
|
+
completion: SafetyProfileCompletion;
|
|
99
|
+
consentVersion: string;
|
|
100
|
+
explanation: string;
|
|
101
|
+
}
|
|
102
|
+
/** A photo, with a short-lived link the viewer can load. */
|
|
103
|
+
export interface SafetyProfilePhotoView {
|
|
104
|
+
kind: SafetyProfilePhotoKind;
|
|
105
|
+
imageId: number;
|
|
106
|
+
url: string | null;
|
|
107
|
+
thumbnailUrl: string | null;
|
|
108
|
+
takenOn: string | null;
|
|
109
|
+
}
|
|
110
|
+
export interface SafetyProfileHiddenCategory {
|
|
111
|
+
category: SafetyProfileCategory;
|
|
112
|
+
reason: SafetyProfileHiddenReason;
|
|
113
|
+
}
|
|
114
|
+
/** What the emergency context was when the view was built. */
|
|
115
|
+
export interface SafetyProfileEmergencyContext {
|
|
116
|
+
incidentId: number | null;
|
|
117
|
+
dispatchId: number | null;
|
|
118
|
+
active: boolean;
|
|
119
|
+
}
|
|
120
|
+
/** One visible category in a viewer's profile. */
|
|
121
|
+
export interface SafetyProfileVisibleSection<T = SafetyProfileSectionData> {
|
|
122
|
+
category: StoredSafetyProfileCategory;
|
|
123
|
+
data: T;
|
|
124
|
+
updatedAt: string | null;
|
|
125
|
+
}
|
|
126
|
+
/** The subscription standing the control room sees on the device card. */
|
|
127
|
+
export interface SafetyProfileSubscriptionView {
|
|
128
|
+
tier: string;
|
|
129
|
+
canAlertProvider: boolean;
|
|
130
|
+
reason: string | null;
|
|
131
|
+
expiresAt: string | null;
|
|
132
|
+
}
|
|
133
|
+
/** POST /safety-profiles/users/:userId/view (FULL) - another person's profile, filtered for the viewer. */
|
|
134
|
+
export interface SafetyProfileAudienceView {
|
|
135
|
+
audience: SafetyProfileAudience;
|
|
136
|
+
subject: {
|
|
137
|
+
userId: number;
|
|
138
|
+
name: string;
|
|
139
|
+
avatar: string | null;
|
|
140
|
+
nickname: string | null;
|
|
141
|
+
phoneNumber: string | null;
|
|
142
|
+
phoneVerified: boolean;
|
|
143
|
+
email: string | null;
|
|
144
|
+
emailVerified: boolean;
|
|
145
|
+
/** Only when IDENTITY is visible. */
|
|
146
|
+
dateOfBirth: string | null;
|
|
147
|
+
countryCode: string | null;
|
|
148
|
+
};
|
|
149
|
+
emergency: SafetyProfileEmergencyContext;
|
|
150
|
+
/** True when an authorised control-room user overrode "only during SOS" (logged with the reason). */
|
|
151
|
+
override: boolean;
|
|
152
|
+
sections: SafetyProfileVisibleSection[];
|
|
153
|
+
hidden: SafetyProfileHiddenCategory[];
|
|
154
|
+
/** Every contact for the control room; none for a guardian. */
|
|
155
|
+
contacts: SafetyProfileContactView[];
|
|
156
|
+
places: Record<string, SavedPlaceView>;
|
|
157
|
+
photos: SafetyProfilePhotoView[];
|
|
158
|
+
/** The control room only, when DEVICE is visible. */
|
|
159
|
+
device: {
|
|
160
|
+
lastLoginAt: string | null;
|
|
161
|
+
lastActiveAt: string | null;
|
|
162
|
+
devices: SafetyProfileDeviceView[];
|
|
163
|
+
subscription: SafetyProfileSubscriptionView | null;
|
|
164
|
+
} | null;
|
|
165
|
+
completion: SafetyProfileCompletion;
|
|
166
|
+
viewedAt: string;
|
|
167
|
+
}
|
|
168
|
+
export interface SafetyProfileCompactPlace {
|
|
169
|
+
label: string | null;
|
|
170
|
+
address: string | null;
|
|
171
|
+
lat: number | null;
|
|
172
|
+
lng: number | null;
|
|
173
|
+
/** Building, house number and floor, joined - for the responder at the gate. */
|
|
174
|
+
detail: string | null;
|
|
175
|
+
landmarks: string | null;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* POST /safety-profiles/users/:userId/view (COMPACT) - the responder's single card,
|
|
179
|
+
* most useful first. Everything absent is null rather than omitted.
|
|
180
|
+
*/
|
|
181
|
+
export interface SafetyProfileCompactView {
|
|
182
|
+
subjectUserId: number;
|
|
183
|
+
name: string;
|
|
184
|
+
nickname: string | null;
|
|
185
|
+
/** The best photo: the recent / front photo when shared, else the account photo. */
|
|
186
|
+
photoUrl: string | null;
|
|
187
|
+
phoneNumber: string | null;
|
|
188
|
+
phoneVerified: boolean;
|
|
189
|
+
alternativePhones: string[];
|
|
190
|
+
gender: SafetyProfileGender | null;
|
|
191
|
+
age: number | null;
|
|
192
|
+
/** The person asked not to be called in an emergency. Shown first, loudly. */
|
|
193
|
+
silentEmergency: boolean;
|
|
194
|
+
primaryGuardian: {
|
|
195
|
+
name: string;
|
|
196
|
+
phoneNumber: string | null;
|
|
197
|
+
relationship: GuardianRelationship | null;
|
|
198
|
+
} | null;
|
|
199
|
+
home: SafetyProfileCompactPlace | null;
|
|
200
|
+
workplace: (SafetyProfileCompactPlace & {
|
|
201
|
+
employerName: string | null;
|
|
202
|
+
}) | null;
|
|
203
|
+
vehicles: Array<{
|
|
204
|
+
description: string;
|
|
205
|
+
registrationNumber: string | null;
|
|
206
|
+
colour: string | null;
|
|
207
|
+
}>;
|
|
208
|
+
medical: {
|
|
209
|
+
bloodGroup: string | null;
|
|
210
|
+
allergies: string[];
|
|
211
|
+
conditions: string[];
|
|
212
|
+
disabilities: string[];
|
|
213
|
+
pregnant: boolean;
|
|
214
|
+
notes: string | null;
|
|
215
|
+
} | null;
|
|
216
|
+
/** Categories the person keeps from responders, so the card can say so. */
|
|
217
|
+
withheld: SafetyProfileCategory[];
|
|
218
|
+
emergency: SafetyProfileEmergencyContext;
|
|
219
|
+
viewedAt: string;
|
|
220
|
+
}
|
|
221
|
+
/** One line of "who viewed my profile". */
|
|
222
|
+
export interface SafetyProfileAccessLogEntry {
|
|
223
|
+
id: number;
|
|
224
|
+
audience: SafetyProfileAudience;
|
|
225
|
+
viewer: {
|
|
226
|
+
userId: number | null;
|
|
227
|
+
name: string | null;
|
|
228
|
+
/** Role names, for the console; the app shows a plain label. */
|
|
229
|
+
roles: string[];
|
|
230
|
+
organizationId: number | null;
|
|
231
|
+
controlCentreId: number | null;
|
|
232
|
+
};
|
|
233
|
+
incidentId: number | null;
|
|
234
|
+
dispatchId: number | null;
|
|
235
|
+
emergencyActive: boolean;
|
|
236
|
+
override: boolean;
|
|
237
|
+
reason: string | null;
|
|
238
|
+
categories: SafetyProfileCategory[];
|
|
239
|
+
createdAt: string;
|
|
240
|
+
}
|
|
241
|
+
export interface SafetyProfileAccessLogPage {
|
|
242
|
+
data: SafetyProfileAccessLogEntry[];
|
|
243
|
+
meta: {
|
|
244
|
+
total: number;
|
|
245
|
+
page: number;
|
|
246
|
+
limit: number;
|
|
247
|
+
totalPages: number;
|
|
248
|
+
};
|
|
249
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BloodGroup, ChronicCondition, DisabilityType, FrequentPlaceType, HighRiskOccupation, PregnancyStatus, SafetyProfileAudience, SafetyProfileGender, SafetyProfileHiddenReason, SafetyProfilePhotoKind, VehicleOwnership, VehicleType, WorkSchedule } from '../enums/safety-profile.enums';
|
|
2
|
+
/**
|
|
3
|
+
* Human labels for the Safety Profile enums, so every console screen names a
|
|
4
|
+
* value the same way the app does.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SAFETY_PROFILE_GENDER_LABELS: Readonly<Record<SafetyProfileGender, string>>;
|
|
7
|
+
export declare const SAFETY_PROFILE_PHOTO_KIND_LABELS: Readonly<Record<SafetyProfilePhotoKind, string>>;
|
|
8
|
+
export declare const BLOOD_GROUP_LABELS: Readonly<Record<BloodGroup, string>>;
|
|
9
|
+
export declare const CHRONIC_CONDITION_LABELS: Readonly<Record<ChronicCondition, string>>;
|
|
10
|
+
export declare const DISABILITY_TYPE_LABELS: Readonly<Record<DisabilityType, string>>;
|
|
11
|
+
export declare const PREGNANCY_STATUS_LABELS: Readonly<Record<PregnancyStatus, string>>;
|
|
12
|
+
export declare const WORK_SCHEDULE_LABELS: Readonly<Record<WorkSchedule, string>>;
|
|
13
|
+
export declare const FREQUENT_PLACE_TYPE_LABELS: Readonly<Record<FrequentPlaceType, string>>;
|
|
14
|
+
export declare const VEHICLE_OWNERSHIP_LABELS: Readonly<Record<VehicleOwnership, string>>;
|
|
15
|
+
export declare const VEHICLE_TYPE_LABELS: Readonly<Record<VehicleType, string>>;
|
|
16
|
+
export declare const HIGH_RISK_OCCUPATION_LABELS: Readonly<Record<HighRiskOccupation, string>>;
|
|
17
|
+
export declare const SAFETY_PROFILE_AUDIENCE_LABELS: Readonly<Record<SafetyProfileAudience, string>>;
|
|
18
|
+
export declare const SAFETY_PROFILE_HIDDEN_REASON_LABELS: Readonly<Record<SafetyProfileHiddenReason, string>>;
|
|
19
|
+
/**
|
|
20
|
+
* The label for a value of any of the maps above, or the raw value when it is
|
|
21
|
+
* unknown (a newer server) - never blank.
|
|
22
|
+
*/
|
|
23
|
+
export declare function safetyProfileLabel<K extends string>(labels: Readonly<Record<K, string>>, value: K | string | null | undefined): string;
|
|
24
|
+
/** "35 years" from a YYYY-MM-DD date of birth, or null; `today` is injectable for tests. */
|
|
25
|
+
export declare function safetyProfileAge(dateOfBirth: string | null | undefined, today?: Date): number | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SafetyProfileAudience, SafetyProfileCategory, SafetyProfileHiddenReason } from '../enums/safety-profile.enums';
|
|
2
|
+
/**
|
|
3
|
+
* Who sees which category, and when - the whole rule in one function, so the
|
|
4
|
+
* console, the responder card and the guardian view cannot drift apart.
|
|
5
|
+
*
|
|
6
|
+
* - Nothing is shown of a category the person never consented to or never filled.
|
|
7
|
+
* - A responder sees anything only during an ACTIVE dispatch to the person's
|
|
8
|
+
* emergency, and only the categories of their compact card.
|
|
9
|
+
* - The control room sees a category when the person shares it at all times, or
|
|
10
|
+
* during an active emergency of theirs, or under an emergency override
|
|
11
|
+
* (override:safety-profile, with a logged reason).
|
|
12
|
+
* - A guardian sees a category only if the person chose to share it with their
|
|
13
|
+
* guardians, and - when it is "only during SOS" - only during the person's SOS.
|
|
14
|
+
* Never the safe word or threats, never the device; never by override.
|
|
15
|
+
*/
|
|
16
|
+
export interface SafetyProfileVisibilityInput {
|
|
17
|
+
audience: SafetyProfileAudience;
|
|
18
|
+
category: SafetyProfileCategory;
|
|
19
|
+
/** The category's settings; null when it has none (never consented / saved). */
|
|
20
|
+
settings: {
|
|
21
|
+
consented: boolean;
|
|
22
|
+
onlyDuringSos: boolean;
|
|
23
|
+
shareWithGuardians: boolean;
|
|
24
|
+
} | null;
|
|
25
|
+
/** Whether there is anything to show (a stored document, or contacts). */
|
|
26
|
+
hasData: boolean;
|
|
27
|
+
emergencyActive: boolean;
|
|
28
|
+
override: boolean;
|
|
29
|
+
}
|
|
30
|
+
export type SafetyProfileVisibility = {
|
|
31
|
+
visible: true;
|
|
32
|
+
}
|
|
33
|
+
/** `reason` null: nothing to show, so nothing to mention. */
|
|
34
|
+
| {
|
|
35
|
+
visible: false;
|
|
36
|
+
reason: SafetyProfileHiddenReason | null;
|
|
37
|
+
};
|
|
38
|
+
export declare function safetyProfileVisibility(input: SafetyProfileVisibilityInput): SafetyProfileVisibility;
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* whose deadline later moved (waiting on the customer, a reopen) can be breached
|
|
26
26
|
* once and still end up met.
|
|
27
27
|
*/
|
|
28
|
+
import { AnalyticsCountryRow, AnalyticsLocalTimes } from '../../analytics/analytics-country';
|
|
28
29
|
/** How the period is cut into points for the charts. Chosen by the service from the length of the period. */
|
|
29
30
|
export type SupportAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
|
|
30
31
|
export interface SupportAnalyticsRange {
|
|
@@ -379,6 +380,10 @@ export interface SupportAnalytics {
|
|
|
379
380
|
heatmap: SupportAnalyticsHeatCell[];
|
|
380
381
|
/** A Super-Admin looking at every organization only. */
|
|
381
382
|
byOrganization?: SupportAnalyticsOrganizationRow[];
|
|
383
|
+
/** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
|
|
384
|
+
localTimes: AnalyticsLocalTimes;
|
|
385
|
+
/** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
|
|
386
|
+
countryComparison: AnalyticsCountryRow[];
|
|
382
387
|
}
|
|
383
388
|
/** What a dashboard asks: the period, one country - and, for a Super-Admin, whose figures. */
|
|
384
389
|
export interface SupportAnalyticsQuery {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* rollup of the position history, so a year costs no more to read than a day. Counts,
|
|
10
10
|
* rates and durations only - never a position, a route or a device identifier.
|
|
11
11
|
*/
|
|
12
|
+
import { AnalyticsCountryRow, AnalyticsLocalTimes } from '../../analytics/analytics-country';
|
|
12
13
|
/** How the period is cut into points for the charts. Chosen by the service from the length of the period. */
|
|
13
14
|
export type UnitsAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
|
|
14
15
|
export interface UnitsAnalyticsRange {
|
|
@@ -189,6 +190,12 @@ export interface TrackingAnalytics {
|
|
|
189
190
|
rollupThrough: string | null;
|
|
190
191
|
/** History older than this is still being rolled up (the first hours after release); null once complete. */
|
|
191
192
|
backfillingBefore: string | null;
|
|
193
|
+
/** The country the figures are narrowed to (each record's own country); null for every country. */
|
|
194
|
+
countryCode: string | null;
|
|
195
|
+
/** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
|
|
196
|
+
localTimes: AnalyticsLocalTimes;
|
|
197
|
+
/** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
|
|
198
|
+
countryComparison: AnalyticsCountryRow[];
|
|
192
199
|
}
|
|
193
200
|
/** The query both halves answer (UnitsAnalyticsQueryDto in grm-shared-library). All optional. */
|
|
194
201
|
export interface UnitsAnalyticsQuery {
|
|
@@ -202,4 +209,6 @@ export interface UnitsAnalyticsQuery {
|
|
|
202
209
|
organizationId?: number;
|
|
203
210
|
/** One control centre of the organization. */
|
|
204
211
|
controlCentreId?: number;
|
|
212
|
+
/** One country's records only; its days in that country's zone. */
|
|
213
|
+
countryCode?: string;
|
|
205
214
|
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* codes and password changes come from the service's activity log, which begins on
|
|
13
13
|
* `activitySince`: before it, the only trace of a sign-in is each account's LAST one.
|
|
14
14
|
*/
|
|
15
|
+
import { AnalyticsCountryRow, AnalyticsLocalTimes } from '../../analytics/analytics-country';
|
|
15
16
|
/** How the period is cut into points for the charts. Chosen by the service from the length of the period. */
|
|
16
17
|
export type AccountAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
|
|
17
18
|
export interface AccountAnalyticsRange {
|
|
@@ -444,6 +445,12 @@ export interface AccountAnalytics {
|
|
|
444
445
|
signInOptions?: AccountAnalyticsSignInOptions;
|
|
445
446
|
/** A Super-Admin looking at every organization only. */
|
|
446
447
|
byOrganization?: AccountAnalyticsOrganizationRow[];
|
|
448
|
+
/** The country the figures are narrowed to (each record's own country); null for every country. */
|
|
449
|
+
countryCode: string | null;
|
|
450
|
+
/** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
|
|
451
|
+
localTimes: AnalyticsLocalTimes;
|
|
452
|
+
/** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
|
|
453
|
+
countryComparison: AnalyticsCountryRow[];
|
|
447
454
|
}
|
|
448
455
|
/** What a dashboard asks: the period, and - for a Super-Admin - whose figures. */
|
|
449
456
|
export interface AccountAnalyticsQuery {
|
|
@@ -451,4 +458,6 @@ export interface AccountAnalyticsQuery {
|
|
|
451
458
|
to?: string;
|
|
452
459
|
timeZone?: string;
|
|
453
460
|
organizationId?: number;
|
|
461
|
+
/** One country's records only; its days in that country's zone. */
|
|
462
|
+
countryCode?: string;
|
|
454
463
|
}
|
|
@@ -7,4 +7,6 @@ import { GuardianRelation } from "./guardian-relation";
|
|
|
7
7
|
export interface GuardiansResponse {
|
|
8
8
|
externalGuardians: Guardian[];
|
|
9
9
|
systemGuardians: GuardianRelation[];
|
|
10
|
+
/** Contacts the person chose NOT to alert on SOS; the two lists above are guardians only. */
|
|
11
|
+
emergencyContacts?: Guardian[];
|
|
10
12
|
}
|