clarion-shared-types 1.0.133 → 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 +1 -0
- package/dist/cjs/index.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 +1 -0
- package/dist/esm/index.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 +1 -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-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/user/interfaces/guardian.d.ts +2 -0
- package/dist/types/modules/user/interfaces/guardians-response.d.ts +2 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __exportStar(require("./modules/alert-intake/index"), exports);
|
|
|
40
40
|
__exportStar(require("./modules/partner/index"), exports);
|
|
41
41
|
__exportStar(require("./modules/support/index"), exports);
|
|
42
42
|
__exportStar(require("./modules/safety/index"), exports);
|
|
43
|
+
__exportStar(require("./modules/safety-profile/index"), exports);
|
|
43
44
|
__exportStar(require("./modules/billing/index"), exports);
|
|
44
45
|
__exportStar(require("./modules/newsfeed/index"), exports);
|
|
45
46
|
__exportStar(require("./modules/dispatch/index"), exports);
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,uDAAqC;AACrC,iEAA+C;AAC/C,gEAA8C;AAC9C,2DAAyC;AACzC,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,mEAAiD;AACjD,+DAA6C;AAC7C,uDAAqC;AACrC,0DAAwC;AACxC,2DAAyC;AACzC,8DAA4C;AAC5C,iEAA+C;AAC/C,+DAA6C;AAC7C,0DAAwC;AACxC,0DAAwC;AACxC,yDAAuC;AACvC,0DAAwC;AACxC,2DAAyC;AACzC,2DAAyC;AACzC,+DAA6C;AAC7C,4DAA0C;AAC1C,4DAA0C;AAE1C,aAAa;AACb,6EAA2D;AAC3D,yEAAuD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,uDAAqC;AACrC,iEAA+C;AAC/C,gEAA8C;AAC9C,2DAAyC;AACzC,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,mEAAiD;AACjD,+DAA6C;AAC7C,uDAAqC;AACrC,0DAAwC;AACxC,2DAAyC;AACzC,8DAA4C;AAC5C,iEAA+C;AAC/C,+DAA6C;AAC7C,0DAAwC;AACxC,0DAAwC;AACxC,yDAAuC;AACvC,iEAA+C;AAC/C,0DAAwC;AACxC,2DAAyC;AACzC,2DAAyC;AACzC,+DAA6C;AAC7C,4DAA0C;AAC1C,4DAA0C;AAE1C,aAAa;AACb,6EAA2D;AAC3D,yEAAuD"}
|
|
@@ -271,6 +271,13 @@ var PermissionActions;
|
|
|
271
271
|
PermissionActions["USE_FOLLOW_ME"] = "use:follow-me";
|
|
272
272
|
PermissionActions["READ_FOLLOW_ME"] = "read:follow-me";
|
|
273
273
|
PermissionActions["TRACK_FOLLOW_ME"] = "track:follow-me";
|
|
274
|
+
// Module: Safety Profile (clarion-authentication). manage = the person's OWN
|
|
275
|
+
// profile in the app; read = the console sees the reporter's profile on an
|
|
276
|
+
// incident ("only during SOS" categories only while the emergency is active);
|
|
277
|
+
// override = break the glass with a logged reason (Control Centre Admin).
|
|
278
|
+
PermissionActions["MANAGE_SAFETY_PROFILE"] = "manage:safety-profile";
|
|
279
|
+
PermissionActions["READ_SAFETY_PROFILE"] = "read:safety-profile";
|
|
280
|
+
PermissionActions["OVERRIDE_SAFETY_PROFILE"] = "override:safety-profile";
|
|
274
281
|
// Module: Places (clarion-gis) - a user's own saved places.
|
|
275
282
|
PermissionActions["MANAGE_SAVED_PLACE"] = "manage:saved-place";
|
|
276
283
|
// Module: Incident SLA (clarion-incident) - the emergency SLA card, its
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBA6UX;AA7UD,WAA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CAAA;IACvC,8EAAyD,CAAA;IACzD,2EAA2E;IAC3E,oEAA+C,CAAA;IAC/C,iFAAiF;IACjF,4EAA4E;IAC5E,mEAAmE;IACnE,oDAA+B,CAAA;IAC/B,sDAAiC,CAAA;IACjC,wDAAmC,CAAA;IAEnC,6EAA6E;IAC7E,2EAA2E;IAC3E,8EAA8E;IAC9E,0EAA0E;IAC1E,oEAA+C,CAAA;IAC/C,gEAA2C,CAAA;IAC3C,wEAAmD,CAAA;IAEnD,4DAA4D;IAC5D,8DAAyC,CAAA;IAEzC,wEAAwE;IACxE,0DAA0D;IAC1D,4DAAuC,CAAA;IACvC,gEAA2C,CAAA;IAC3C,kEAA6C,CAAA;IAC7C,0EAAqD,CAAA;IACrD,8EAAyD,CAAA;IACzD,gFAA2D,CAAA;IAE3D,6EAA6E;IAC7E,sEAAsE;IACtE,6EAA6E;IAC7E,2EAA2E;IAC3E,+BAA+B;IAC/B,4DAAuC,CAAA;IACvC,sFAAiE,CAAA;IACjE,4EAAuD,CAAA;IACvD,wGAAwG;IACxG,4DAAuC,CAAA;IACvC,wGAAwG;IACxG,gEAA2C,CAAA;AAC/C,CAAC,EA7UW,iBAAiB,iCAAjB,iBAAiB,QA6U5B"}
|
|
@@ -19,6 +19,7 @@ var PermissionsModule;
|
|
|
19
19
|
PermissionsModule["NOTIFICATION"] = "Notification";
|
|
20
20
|
PermissionsModule["ALERT_INTAKE"] = "Alert Intake";
|
|
21
21
|
PermissionsModule["SAFETY"] = "Safety";
|
|
22
|
+
PermissionsModule["SAFETY_PROFILE"] = "Safety Profile";
|
|
22
23
|
PermissionsModule["PLACES"] = "Places";
|
|
23
24
|
PermissionsModule["INCIDENT_SLA"] = "Incident SLA";
|
|
24
25
|
PermissionsModule["RESPONDER"] = "Responder";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions-moudule.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permissions-moudule.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"permissions-moudule.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permissions-moudule.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAqBX;AArBD,WAAY,iBAAiB;IACzB,kDAA6B,CAAA;IAC7B,wCAAmB,CAAA;IACnB,sDAAiC,CAAA;IACjC,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,2CAAsB,CAAA;IACtB,oDAA+B,CAAA;IAC/B,0CAAqB,CAAA;IACrB,sEAAiD,CAAA;IACjD,wCAAmB,CAAA;IACnB,0CAAqB,CAAA;IACrB,wCAAmB,CAAA;IACnB,kDAA6B,CAAA;IAC7B,kDAA6B,CAAA;IAC7B,sCAAiB,CAAA;IACjB,sDAAiC,CAAA;IACjC,sCAAiB,CAAA;IACjB,kDAA6B,CAAA;IAC7B,4CAAuB,CAAA;AAC3B,CAAC,EArBW,iBAAiB,iCAAjB,iBAAiB,QAqB5B"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SAFETY_PROFILE_CATEGORY_LABELS = exports.SAFETY_PROFILE_LIMITS = exports.SAFETY_PROFILE_EXPLANATION = exports.SAFETY_PROFILE_CONSENT_VERSION = exports.SAFETY_PROFILE_AUDIENCE_CATEGORIES = exports.RESPONDER_SAFETY_PROFILE_CATEGORIES = exports.NEVER_SHARED_WITH_GUARDIANS = exports.CONSENT_REQUIRED_SAFETY_PROFILE_CATEGORIES = exports.STORED_SAFETY_PROFILE_CATEGORIES = exports.SAFETY_PROFILE_CATEGORIES = void 0;
|
|
4
|
+
const safety_profile_enums_1 = require("../enums/safety-profile.enums");
|
|
5
|
+
const C = safety_profile_enums_1.SafetyProfileCategory;
|
|
6
|
+
/** Every category, in the order the app and the console list them. */
|
|
7
|
+
exports.SAFETY_PROFILE_CATEGORIES = [
|
|
8
|
+
C.IDENTITY,
|
|
9
|
+
C.MEDICAL,
|
|
10
|
+
C.EMERGENCY_CONTACTS,
|
|
11
|
+
C.RESIDENCE,
|
|
12
|
+
C.WORKPLACE,
|
|
13
|
+
C.FREQUENT_PLACES,
|
|
14
|
+
C.TRAVEL,
|
|
15
|
+
C.VEHICLE,
|
|
16
|
+
C.SAFETY_RISK,
|
|
17
|
+
C.DEVICE,
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* The categories stored in `safety_profile_sections` (encrypted). EMERGENCY_CONTACTS
|
|
21
|
+
* is not one: it is the guardian list, kept where it always was.
|
|
22
|
+
*/
|
|
23
|
+
exports.STORED_SAFETY_PROFILE_CATEGORIES = exports.SAFETY_PROFILE_CATEGORIES.filter((category) => category !== C.EMERGENCY_CONTACTS);
|
|
24
|
+
/**
|
|
25
|
+
* The categories a person must agree to share before anything is stored in them.
|
|
26
|
+
* Each is sensitive personal data under the Kenya Data Protection Act 2019 (health,
|
|
27
|
+
* sex, biometric images, property and family details) or its equivalents in UG/TZ/ZM.
|
|
28
|
+
* DEVICE holds only what the platform already knows plus an IMEI the person typed,
|
|
29
|
+
* so it needs no separate consent.
|
|
30
|
+
*/
|
|
31
|
+
exports.CONSENT_REQUIRED_SAFETY_PROFILE_CATEGORIES = [
|
|
32
|
+
C.IDENTITY,
|
|
33
|
+
C.MEDICAL,
|
|
34
|
+
C.RESIDENCE,
|
|
35
|
+
C.WORKPLACE,
|
|
36
|
+
C.FREQUENT_PLACES,
|
|
37
|
+
C.TRAVEL,
|
|
38
|
+
C.VEHICLE,
|
|
39
|
+
C.SAFETY_RISK,
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Never shown to a guardian, whatever the person chose: the threats they named and
|
|
43
|
+
* their duress phrase must stay hidden from the people closest to them - in a
|
|
44
|
+
* domestic-violence case the threat can BE a guardian. Device details are
|
|
45
|
+
* operational and for the control room only.
|
|
46
|
+
*/
|
|
47
|
+
exports.NEVER_SHARED_WITH_GUARDIANS = [C.SAFETY_RISK, C.DEVICE];
|
|
48
|
+
/**
|
|
49
|
+
* What a responder's compact card may draw on (still subject to the person's
|
|
50
|
+
* settings). The safe word and the device stay with the control room.
|
|
51
|
+
*/
|
|
52
|
+
exports.RESPONDER_SAFETY_PROFILE_CATEGORIES = [
|
|
53
|
+
C.IDENTITY,
|
|
54
|
+
C.MEDICAL,
|
|
55
|
+
C.EMERGENCY_CONTACTS,
|
|
56
|
+
C.RESIDENCE,
|
|
57
|
+
C.WORKPLACE,
|
|
58
|
+
C.VEHICLE,
|
|
59
|
+
C.SAFETY_RISK,
|
|
60
|
+
];
|
|
61
|
+
/** Which categories each audience can ever see. */
|
|
62
|
+
exports.SAFETY_PROFILE_AUDIENCE_CATEGORIES = {
|
|
63
|
+
[safety_profile_enums_1.SafetyProfileAudience.CONTROL_CENTRE]: exports.SAFETY_PROFILE_CATEGORIES,
|
|
64
|
+
[safety_profile_enums_1.SafetyProfileAudience.RESPONDER]: exports.RESPONDER_SAFETY_PROFILE_CATEGORIES,
|
|
65
|
+
[safety_profile_enums_1.SafetyProfileAudience.GUARDIAN]: exports.SAFETY_PROFILE_CATEGORIES.filter((category) => !exports.NEVER_SHARED_WITH_GUARDIANS.includes(category) && category !== C.EMERGENCY_CONTACTS),
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The version of the consent text the app shows. Recorded with every consent, so
|
|
69
|
+
* a later change of wording can ask again. Bump it when the text changes.
|
|
70
|
+
*/
|
|
71
|
+
exports.SAFETY_PROFILE_CONSENT_VERSION = '2026-11-07';
|
|
72
|
+
/** The one-line reason for the whole profile, shown wherever it is collected. */
|
|
73
|
+
exports.SAFETY_PROFILE_EXPLANATION = 'This information helps responders identify and locate you faster.';
|
|
74
|
+
/** Size limits, checked by the DTOs and the services alike. */
|
|
75
|
+
exports.SAFETY_PROFILE_LIMITS = {
|
|
76
|
+
nicknameMin: 2,
|
|
77
|
+
nicknameMax: 30,
|
|
78
|
+
shortText: 80,
|
|
79
|
+
mediumText: 160,
|
|
80
|
+
longText: 1000,
|
|
81
|
+
alternativePhones: 3,
|
|
82
|
+
photos: 4,
|
|
83
|
+
allergies: 20,
|
|
84
|
+
medications: 20,
|
|
85
|
+
frequentPlaces: 10,
|
|
86
|
+
vehicles: 5,
|
|
87
|
+
imeiNumbers: 2,
|
|
88
|
+
safeWordMin: 3,
|
|
89
|
+
safeWordMax: 60,
|
|
90
|
+
heightCm: { min: 30, max: 272 },
|
|
91
|
+
weightKg: { min: 1, max: 500 },
|
|
92
|
+
overrideReasonMin: 10,
|
|
93
|
+
overrideReasonMax: 500,
|
|
94
|
+
devicesPerUser: 10,
|
|
95
|
+
accessLogPageMax: 100,
|
|
96
|
+
};
|
|
97
|
+
/** Every category's display name, for logs and fallbacks (the clients have their own copy). */
|
|
98
|
+
exports.SAFETY_PROFILE_CATEGORY_LABELS = {
|
|
99
|
+
[C.IDENTITY]: 'Core identity',
|
|
100
|
+
[C.MEDICAL]: 'Medical information',
|
|
101
|
+
[C.EMERGENCY_CONTACTS]: 'Emergency contacts & guardians',
|
|
102
|
+
[C.RESIDENCE]: 'Residence & home',
|
|
103
|
+
[C.WORKPLACE]: 'Workplace, school or business',
|
|
104
|
+
[C.FREQUENT_PLACES]: 'Frequently visited places',
|
|
105
|
+
[C.TRAVEL]: 'Travel & temporary location',
|
|
106
|
+
[C.VEHICLE]: 'Vehicle & transport',
|
|
107
|
+
[C.SAFETY_RISK]: 'Safety & risk',
|
|
108
|
+
[C.DEVICE]: 'Digital & device',
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=safety-profile.const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety-profile.const.js","sourceRoot":"","sources":["../../../../../src/modules/safety-profile/constants/safety-profile.const.ts"],"names":[],"mappings":";;;AAAA,wEAA6F;AAG7F,MAAM,CAAC,GAAG,4CAAqB,CAAC;AAEhC,sEAAsE;AACzD,QAAA,yBAAyB,GAAqC;IACvE,CAAC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C,CAAC,OAAO,CAAC,EAAE,qBAAqB;IAClC,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,eAAe;IAChC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,kBAAkB;CACjC,CAAC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SafetyProfileViewFormat = exports.HighRiskOccupation = exports.VehicleType = exports.VehicleOwnership = exports.FrequentPlaceType = exports.WorkSchedule = exports.PregnancyStatus = exports.DisabilityType = exports.ChronicCondition = exports.BloodGroup = exports.SafetyProfilePhotoKind = exports.SafetyProfileGender = exports.SafetyProfileErrorCode = exports.SafetyProfileHiddenReason = exports.SafetyProfileAudience = exports.SafetyProfileCategory = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Safety Profile (clarion-authentication): what an app user tells responders so
|
|
6
|
+
* they can be identified, found and helped faster in an emergency.
|
|
7
|
+
*
|
|
8
|
+
* The profile is split into CATEGORIES. Each stored category carries its own
|
|
9
|
+
* consent, its own "visible only during an active SOS" setting and its own
|
|
10
|
+
* "share with my guardians" setting, so a person can share their home with
|
|
11
|
+
* responders at any time while keeping their medical details for an emergency.
|
|
12
|
+
*/
|
|
13
|
+
var SafetyProfileCategory;
|
|
14
|
+
(function (SafetyProfileCategory) {
|
|
15
|
+
/** Nickname, gender, extra photos, other phone numbers (plus the account's name, photo, birth date, phone, e-mail). */
|
|
16
|
+
SafetyProfileCategory["IDENTITY"] = "IDENTITY";
|
|
17
|
+
SafetyProfileCategory["MEDICAL"] = "MEDICAL";
|
|
18
|
+
/** The guardian list (guardian_relations) - not stored in the profile, summarised from it. */
|
|
19
|
+
SafetyProfileCategory["EMERGENCY_CONTACTS"] = "EMERGENCY_CONTACTS";
|
|
20
|
+
SafetyProfileCategory["RESIDENCE"] = "RESIDENCE";
|
|
21
|
+
SafetyProfileCategory["WORKPLACE"] = "WORKPLACE";
|
|
22
|
+
SafetyProfileCategory["FREQUENT_PLACES"] = "FREQUENT_PLACES";
|
|
23
|
+
SafetyProfileCategory["TRAVEL"] = "TRAVEL";
|
|
24
|
+
SafetyProfileCategory["VEHICLE"] = "VEHICLE";
|
|
25
|
+
SafetyProfileCategory["SAFETY_RISK"] = "SAFETY_RISK";
|
|
26
|
+
/** Devices the app reported, last sign-in / activity, plus what the person typed (IMEI, second SIM). */
|
|
27
|
+
SafetyProfileCategory["DEVICE"] = "DEVICE";
|
|
28
|
+
})(SafetyProfileCategory || (exports.SafetyProfileCategory = SafetyProfileCategory = {}));
|
|
29
|
+
/** Who is looking at somebody else's profile. The owner is never an audience: they always see everything. */
|
|
30
|
+
var SafetyProfileAudience;
|
|
31
|
+
(function (SafetyProfileAudience) {
|
|
32
|
+
/** Control-room staff (read:safety-profile), in the admin console. */
|
|
33
|
+
SafetyProfileAudience["CONTROL_CENTRE"] = "CONTROL_CENTRE";
|
|
34
|
+
/** A responder dispatched to the person's emergency, in the responder app (compact card only). */
|
|
35
|
+
SafetyProfileAudience["RESPONDER"] = "RESPONDER";
|
|
36
|
+
/** One of the person's own guardians (notified on SOS), in the app. */
|
|
37
|
+
SafetyProfileAudience["GUARDIAN"] = "GUARDIAN";
|
|
38
|
+
})(SafetyProfileAudience || (exports.SafetyProfileAudience = SafetyProfileAudience = {}));
|
|
39
|
+
/** Why a category with data in it was not shown to this viewer. */
|
|
40
|
+
var SafetyProfileHiddenReason;
|
|
41
|
+
(function (SafetyProfileHiddenReason) {
|
|
42
|
+
/** The person shares it only during an active emergency, and there is none. */
|
|
43
|
+
SafetyProfileHiddenReason["ONLY_DURING_SOS"] = "ONLY_DURING_SOS";
|
|
44
|
+
/** The person has not shared it with their guardians. */
|
|
45
|
+
SafetyProfileHiddenReason["NOT_SHARED_WITH_GUARDIANS"] = "NOT_SHARED_WITH_GUARDIANS";
|
|
46
|
+
/** Never shown to this kind of viewer (e.g. the safe word to a guardian). */
|
|
47
|
+
SafetyProfileHiddenReason["NOT_FOR_AUDIENCE"] = "NOT_FOR_AUDIENCE";
|
|
48
|
+
})(SafetyProfileHiddenReason || (exports.SafetyProfileHiddenReason = SafetyProfileHiddenReason = {}));
|
|
49
|
+
var SafetyProfileErrorCode;
|
|
50
|
+
(function (SafetyProfileErrorCode) {
|
|
51
|
+
/** A category is written before the person agreed to share it. */
|
|
52
|
+
SafetyProfileErrorCode["CONSENT_REQUIRED"] = "SAFETY_PROFILE_CONSENT_REQUIRED";
|
|
53
|
+
/** Somebody else (another device) saved the category since it was read. */
|
|
54
|
+
SafetyProfileErrorCode["VERSION_CONFLICT"] = "SAFETY_PROFILE_VERSION_CONFLICT";
|
|
55
|
+
/** The section's data does not validate. `details.errors` lists the fields. */
|
|
56
|
+
SafetyProfileErrorCode["INVALID_SECTION"] = "SAFETY_PROFILE_INVALID_SECTION";
|
|
57
|
+
/** The category cannot be written (EMERGENCY_CONTACTS is the guardian list). */
|
|
58
|
+
SafetyProfileErrorCode["CATEGORY_NOT_WRITABLE"] = "SAFETY_PROFILE_CATEGORY_NOT_WRITABLE";
|
|
59
|
+
/** Safety profiles cannot be stored or read right now: the encryption key is not configured. */
|
|
60
|
+
SafetyProfileErrorCode["ENCRYPTION_UNAVAILABLE"] = "SAFETY_PROFILE_ENCRYPTION_UNAVAILABLE";
|
|
61
|
+
/** A photo id that is not one of the person's own uploads. */
|
|
62
|
+
SafetyProfileErrorCode["PHOTO_NOT_YOURS"] = "SAFETY_PROFILE_PHOTO_NOT_YOURS";
|
|
63
|
+
/** A saved place id that is not one of the person's own places. */
|
|
64
|
+
SafetyProfileErrorCode["PLACE_NOT_YOURS"] = "SAFETY_PROFILE_PLACE_NOT_YOURS";
|
|
65
|
+
/** The viewer may not see this person's profile at all. */
|
|
66
|
+
SafetyProfileErrorCode["NOT_AUTHORISED"] = "SAFETY_PROFILE_NOT_AUTHORISED";
|
|
67
|
+
/** A responder asked outside an active dispatch. */
|
|
68
|
+
SafetyProfileErrorCode["EMERGENCY_REQUIRED"] = "SAFETY_PROFILE_EMERGENCY_REQUIRED";
|
|
69
|
+
/** The incident does not belong to the person whose profile was asked for. */
|
|
70
|
+
SafetyProfileErrorCode["INCIDENT_MISMATCH"] = "SAFETY_PROFILE_INCIDENT_MISMATCH";
|
|
71
|
+
/** The caller of the incident is anonymous, or the organization hides them from responders. */
|
|
72
|
+
SafetyProfileErrorCode["CALLER_NOT_SHARED"] = "SAFETY_PROFILE_CALLER_NOT_SHARED";
|
|
73
|
+
/** An emergency override without a usable reason. */
|
|
74
|
+
SafetyProfileErrorCode["OVERRIDE_REASON_REQUIRED"] = "SAFETY_PROFILE_OVERRIDE_REASON_REQUIRED";
|
|
75
|
+
})(SafetyProfileErrorCode || (exports.SafetyProfileErrorCode = SafetyProfileErrorCode = {}));
|
|
76
|
+
var SafetyProfileGender;
|
|
77
|
+
(function (SafetyProfileGender) {
|
|
78
|
+
SafetyProfileGender["FEMALE"] = "FEMALE";
|
|
79
|
+
SafetyProfileGender["MALE"] = "MALE";
|
|
80
|
+
SafetyProfileGender["OTHER"] = "OTHER";
|
|
81
|
+
SafetyProfileGender["PREFER_NOT_TO_SAY"] = "PREFER_NOT_TO_SAY";
|
|
82
|
+
})(SafetyProfileGender || (exports.SafetyProfileGender = SafetyProfileGender = {}));
|
|
83
|
+
/** The extra photos that help somebody be recognised. */
|
|
84
|
+
var SafetyProfilePhotoKind;
|
|
85
|
+
(function (SafetyProfilePhotoKind) {
|
|
86
|
+
SafetyProfilePhotoKind["FRONT"] = "FRONT";
|
|
87
|
+
SafetyProfilePhotoKind["SIDE"] = "SIDE";
|
|
88
|
+
SafetyProfilePhotoKind["FULL_BODY"] = "FULL_BODY";
|
|
89
|
+
/** Optional: how the person looks lately (haircut, beard...). Not counted for completeness. */
|
|
90
|
+
SafetyProfilePhotoKind["RECENT"] = "RECENT";
|
|
91
|
+
})(SafetyProfilePhotoKind || (exports.SafetyProfilePhotoKind = SafetyProfilePhotoKind = {}));
|
|
92
|
+
var BloodGroup;
|
|
93
|
+
(function (BloodGroup) {
|
|
94
|
+
BloodGroup["A_POSITIVE"] = "A_POSITIVE";
|
|
95
|
+
BloodGroup["A_NEGATIVE"] = "A_NEGATIVE";
|
|
96
|
+
BloodGroup["B_POSITIVE"] = "B_POSITIVE";
|
|
97
|
+
BloodGroup["B_NEGATIVE"] = "B_NEGATIVE";
|
|
98
|
+
BloodGroup["AB_POSITIVE"] = "AB_POSITIVE";
|
|
99
|
+
BloodGroup["AB_NEGATIVE"] = "AB_NEGATIVE";
|
|
100
|
+
BloodGroup["O_POSITIVE"] = "O_POSITIVE";
|
|
101
|
+
BloodGroup["O_NEGATIVE"] = "O_NEGATIVE";
|
|
102
|
+
/** Answered: the person does not know theirs. */
|
|
103
|
+
BloodGroup["UNKNOWN"] = "UNKNOWN";
|
|
104
|
+
})(BloodGroup || (exports.BloodGroup = BloodGroup = {}));
|
|
105
|
+
var ChronicCondition;
|
|
106
|
+
(function (ChronicCondition) {
|
|
107
|
+
ChronicCondition["DIABETES"] = "DIABETES";
|
|
108
|
+
ChronicCondition["ASTHMA"] = "ASTHMA";
|
|
109
|
+
ChronicCondition["EPILEPSY"] = "EPILEPSY";
|
|
110
|
+
ChronicCondition["HEART_DISEASE"] = "HEART_DISEASE";
|
|
111
|
+
ChronicCondition["HYPERTENSION"] = "HYPERTENSION";
|
|
112
|
+
ChronicCondition["SICKLE_CELL"] = "SICKLE_CELL";
|
|
113
|
+
ChronicCondition["KIDNEY_DISEASE"] = "KIDNEY_DISEASE";
|
|
114
|
+
ChronicCondition["OTHER"] = "OTHER";
|
|
115
|
+
})(ChronicCondition || (exports.ChronicCondition = ChronicCondition = {}));
|
|
116
|
+
var DisabilityType;
|
|
117
|
+
(function (DisabilityType) {
|
|
118
|
+
DisabilityType["MOBILITY"] = "MOBILITY";
|
|
119
|
+
DisabilityType["HEARING"] = "HEARING";
|
|
120
|
+
DisabilityType["VISION"] = "VISION";
|
|
121
|
+
DisabilityType["COGNITIVE"] = "COGNITIVE";
|
|
122
|
+
DisabilityType["SPEECH"] = "SPEECH";
|
|
123
|
+
DisabilityType["OTHER"] = "OTHER";
|
|
124
|
+
})(DisabilityType || (exports.DisabilityType = DisabilityType = {}));
|
|
125
|
+
var PregnancyStatus;
|
|
126
|
+
(function (PregnancyStatus) {
|
|
127
|
+
PregnancyStatus["NOT_PREGNANT"] = "NOT_PREGNANT";
|
|
128
|
+
PregnancyStatus["PREGNANT"] = "PREGNANT";
|
|
129
|
+
PregnancyStatus["PREFER_NOT_TO_SAY"] = "PREFER_NOT_TO_SAY";
|
|
130
|
+
})(PregnancyStatus || (exports.PregnancyStatus = PregnancyStatus = {}));
|
|
131
|
+
var WorkSchedule;
|
|
132
|
+
(function (WorkSchedule) {
|
|
133
|
+
WorkSchedule["OFFICE_HOURS"] = "OFFICE_HOURS";
|
|
134
|
+
WorkSchedule["NIGHT_SHIFT"] = "NIGHT_SHIFT";
|
|
135
|
+
WorkSchedule["ROTATING_SHIFTS"] = "ROTATING_SHIFTS";
|
|
136
|
+
WorkSchedule["FIELD_WORK"] = "FIELD_WORK";
|
|
137
|
+
WorkSchedule["REMOTE"] = "REMOTE";
|
|
138
|
+
WorkSchedule["OTHER"] = "OTHER";
|
|
139
|
+
})(WorkSchedule || (exports.WorkSchedule = WorkSchedule = {}));
|
|
140
|
+
var FrequentPlaceType;
|
|
141
|
+
(function (FrequentPlaceType) {
|
|
142
|
+
FrequentPlaceType["FAMILY_HOME"] = "FAMILY_HOME";
|
|
143
|
+
FrequentPlaceType["FRIENDS_PLACE"] = "FRIENDS_PLACE";
|
|
144
|
+
FrequentPlaceType["GYM_SPORTS_CLUB"] = "GYM_SPORTS_CLUB";
|
|
145
|
+
FrequentPlaceType["RELIGIOUS_PLACE"] = "RELIGIOUS_PLACE";
|
|
146
|
+
FrequentPlaceType["MEDICAL_FACILITY"] = "MEDICAL_FACILITY";
|
|
147
|
+
FrequentPlaceType["SHOPPING"] = "SHOPPING";
|
|
148
|
+
FrequentPlaceType["ENTERTAINMENT"] = "ENTERTAINMENT";
|
|
149
|
+
FrequentPlaceType["CHILDCARE"] = "CHILDCARE";
|
|
150
|
+
FrequentPlaceType["TRANSPORT_POINT"] = "TRANSPORT_POINT";
|
|
151
|
+
FrequentPlaceType["REGULAR_ROUTE"] = "REGULAR_ROUTE";
|
|
152
|
+
FrequentPlaceType["RURAL_HOME"] = "RURAL_HOME";
|
|
153
|
+
FrequentPlaceType["OTHER"] = "OTHER";
|
|
154
|
+
})(FrequentPlaceType || (exports.FrequentPlaceType = FrequentPlaceType = {}));
|
|
155
|
+
var VehicleOwnership;
|
|
156
|
+
(function (VehicleOwnership) {
|
|
157
|
+
VehicleOwnership["OWN"] = "OWN";
|
|
158
|
+
VehicleOwnership["COMPANY"] = "COMPANY";
|
|
159
|
+
VehicleOwnership["FAMILY"] = "FAMILY";
|
|
160
|
+
VehicleOwnership["OTHER"] = "OTHER";
|
|
161
|
+
})(VehicleOwnership || (exports.VehicleOwnership = VehicleOwnership = {}));
|
|
162
|
+
var VehicleType;
|
|
163
|
+
(function (VehicleType) {
|
|
164
|
+
VehicleType["CAR"] = "CAR";
|
|
165
|
+
VehicleType["MOTORCYCLE"] = "MOTORCYCLE";
|
|
166
|
+
VehicleType["BICYCLE"] = "BICYCLE";
|
|
167
|
+
VehicleType["TRUCK"] = "TRUCK";
|
|
168
|
+
VehicleType["SCOOTER"] = "SCOOTER";
|
|
169
|
+
VehicleType["OTHER"] = "OTHER";
|
|
170
|
+
})(VehicleType || (exports.VehicleType = VehicleType = {}));
|
|
171
|
+
var HighRiskOccupation;
|
|
172
|
+
(function (HighRiskOccupation) {
|
|
173
|
+
HighRiskOccupation["CASH_HANDLING"] = "CASH_HANDLING";
|
|
174
|
+
HighRiskOccupation["NIGHT_WORK"] = "NIGHT_WORK";
|
|
175
|
+
HighRiskOccupation["SECURITY"] = "SECURITY";
|
|
176
|
+
HighRiskOccupation["FIELD_SALES"] = "FIELD_SALES";
|
|
177
|
+
HighRiskOccupation["JOURNALISM"] = "JOURNALISM";
|
|
178
|
+
HighRiskOccupation["HEALTHCARE"] = "HEALTHCARE";
|
|
179
|
+
HighRiskOccupation["TRANSPORT"] = "TRANSPORT";
|
|
180
|
+
HighRiskOccupation["OTHER"] = "OTHER";
|
|
181
|
+
})(HighRiskOccupation || (exports.HighRiskOccupation = HighRiskOccupation = {}));
|
|
182
|
+
/** The detail level of a view: the admin console's full profile, or the responder's one card. */
|
|
183
|
+
var SafetyProfileViewFormat;
|
|
184
|
+
(function (SafetyProfileViewFormat) {
|
|
185
|
+
SafetyProfileViewFormat["FULL"] = "FULL";
|
|
186
|
+
SafetyProfileViewFormat["COMPACT"] = "COMPACT";
|
|
187
|
+
})(SafetyProfileViewFormat || (exports.SafetyProfileViewFormat = SafetyProfileViewFormat = {}));
|
|
188
|
+
//# sourceMappingURL=safety-profile.enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety-profile.enums.js","sourceRoot":"","sources":["../../../../../src/modules/safety-profile/enums/safety-profile.enums.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,IAAY,qBAcX;AAdD,WAAY,qBAAqB;IAC7B,uHAAuH;IACvH,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;IACnB,8FAA8F;IAC9F,kEAAyC,CAAA;IACzC,gDAAuB,CAAA;IACvB,gDAAuB,CAAA;IACvB,4DAAmC,CAAA;IACnC,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;IACnB,oDAA2B,CAAA;IAC3B,wGAAwG;IACxG,0CAAiB,CAAA;AACrB,CAAC,EAdW,qBAAqB,qCAArB,qBAAqB,QAchC;AAED,6GAA6G;AAC7G,IAAY,qBAOX;AAPD,WAAY,qBAAqB;IAC7B,sEAAsE;IACtE,0DAAiC,CAAA;IACjC,kGAAkG;IAClG,gDAAuB,CAAA;IACvB,uEAAuE;IACvE,8CAAqB,CAAA;AACzB,CAAC,EAPW,qBAAqB,qCAArB,qBAAqB,QAOhC;AAED,mEAAmE;AACnE,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AiB,iCAAjB,iBAAiB,QAa5B;AAED,IAAY,gBAKX;AALD,WAAY,gBAAgB;IACxB,+BAAW,CAAA;IACX,uCAAmB,CAAA;IACnB,qCAAiB,CAAA;IACjB,mCAAe,CAAA;AACnB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAED,IAAY,WAOX;AAPD,WAAY,WAAW;IACnB,0BAAW,CAAA;IACX,wCAAyB,CAAA;IACzB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACnB,CAAC,EAPW,WAAW,2BAAX,WAAW,QAOtB;AAED,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC1B,qDAA+B,CAAA;IAC/B,+CAAyB,CAAA;IACzB,2CAAqB,CAAA;IACrB,iDAA2B,CAAA;IAC3B,+CAAyB,CAAA;IACzB,+CAAyB,CAAA;IACzB,6CAAuB,CAAA;IACvB,qCAAe,CAAA;AACnB,CAAC,EATW,kBAAkB,kCAAlB,kBAAkB,QAS7B;AAED,iGAAiG;AACjG,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IAC/B,wCAAa,CAAA;IACb,8CAAmB,CAAA;AACvB,CAAC,EAHW,uBAAuB,uCAAvB,uBAAuB,QAGlC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Enums
|
|
18
|
+
__exportStar(require("./enums/safety-profile.enums"), exports);
|
|
19
|
+
// Constants
|
|
20
|
+
__exportStar(require("./constants/safety-profile.const"), exports);
|
|
21
|
+
// Interfaces
|
|
22
|
+
__exportStar(require("./interfaces/safety-profile-sections"), exports);
|
|
23
|
+
__exportStar(require("./interfaces/safety-profile-views"), exports);
|
|
24
|
+
// Utilities
|
|
25
|
+
__exportStar(require("./utils/safety-profile-visibility.util"), exports);
|
|
26
|
+
__exportStar(require("./utils/safety-profile-display.util"), exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/safety-profile/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,+DAA6C;AAE7C,YAAY;AACZ,mEAAiD;AAEjD,aAAa;AACb,uEAAqD;AACrD,oEAAkD;AAElD,YAAY;AACZ,yEAAuD;AACvD,sEAAoD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety-profile-sections.js","sourceRoot":"","sources":["../../../../../src/modules/safety-profile/interfaces/safety-profile-sections.ts"],"names":[],"mappings":";;AAAA,wEAauC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety-profile-views.js","sourceRoot":"","sources":["../../../../../src/modules/safety-profile/interfaces/safety-profile-views.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SAFETY_PROFILE_HIDDEN_REASON_LABELS = exports.SAFETY_PROFILE_AUDIENCE_LABELS = exports.HIGH_RISK_OCCUPATION_LABELS = exports.VEHICLE_TYPE_LABELS = exports.VEHICLE_OWNERSHIP_LABELS = exports.FREQUENT_PLACE_TYPE_LABELS = exports.WORK_SCHEDULE_LABELS = exports.PREGNANCY_STATUS_LABELS = exports.DISABILITY_TYPE_LABELS = exports.CHRONIC_CONDITION_LABELS = exports.BLOOD_GROUP_LABELS = exports.SAFETY_PROFILE_PHOTO_KIND_LABELS = exports.SAFETY_PROFILE_GENDER_LABELS = void 0;
|
|
4
|
+
exports.safetyProfileLabel = safetyProfileLabel;
|
|
5
|
+
exports.safetyProfileAge = safetyProfileAge;
|
|
6
|
+
const safety_profile_enums_1 = require("../enums/safety-profile.enums");
|
|
7
|
+
/**
|
|
8
|
+
* Human labels for the Safety Profile enums, so every console screen names a
|
|
9
|
+
* value the same way the app does.
|
|
10
|
+
*/
|
|
11
|
+
exports.SAFETY_PROFILE_GENDER_LABELS = {
|
|
12
|
+
[safety_profile_enums_1.SafetyProfileGender.FEMALE]: 'Female',
|
|
13
|
+
[safety_profile_enums_1.SafetyProfileGender.MALE]: 'Male',
|
|
14
|
+
[safety_profile_enums_1.SafetyProfileGender.OTHER]: 'Other',
|
|
15
|
+
[safety_profile_enums_1.SafetyProfileGender.PREFER_NOT_TO_SAY]: 'Prefers not to say',
|
|
16
|
+
};
|
|
17
|
+
exports.SAFETY_PROFILE_PHOTO_KIND_LABELS = {
|
|
18
|
+
[safety_profile_enums_1.SafetyProfilePhotoKind.FRONT]: 'Front',
|
|
19
|
+
[safety_profile_enums_1.SafetyProfilePhotoKind.SIDE]: 'Side',
|
|
20
|
+
[safety_profile_enums_1.SafetyProfilePhotoKind.FULL_BODY]: 'Full body',
|
|
21
|
+
[safety_profile_enums_1.SafetyProfilePhotoKind.RECENT]: 'Recent',
|
|
22
|
+
};
|
|
23
|
+
exports.BLOOD_GROUP_LABELS = {
|
|
24
|
+
[safety_profile_enums_1.BloodGroup.A_POSITIVE]: 'A+',
|
|
25
|
+
[safety_profile_enums_1.BloodGroup.A_NEGATIVE]: 'A−',
|
|
26
|
+
[safety_profile_enums_1.BloodGroup.B_POSITIVE]: 'B+',
|
|
27
|
+
[safety_profile_enums_1.BloodGroup.B_NEGATIVE]: 'B−',
|
|
28
|
+
[safety_profile_enums_1.BloodGroup.AB_POSITIVE]: 'AB+',
|
|
29
|
+
[safety_profile_enums_1.BloodGroup.AB_NEGATIVE]: 'AB−',
|
|
30
|
+
[safety_profile_enums_1.BloodGroup.O_POSITIVE]: 'O+',
|
|
31
|
+
[safety_profile_enums_1.BloodGroup.O_NEGATIVE]: 'O−',
|
|
32
|
+
[safety_profile_enums_1.BloodGroup.UNKNOWN]: 'Unknown',
|
|
33
|
+
};
|
|
34
|
+
exports.CHRONIC_CONDITION_LABELS = {
|
|
35
|
+
[safety_profile_enums_1.ChronicCondition.DIABETES]: 'Diabetes',
|
|
36
|
+
[safety_profile_enums_1.ChronicCondition.ASTHMA]: 'Asthma',
|
|
37
|
+
[safety_profile_enums_1.ChronicCondition.EPILEPSY]: 'Epilepsy',
|
|
38
|
+
[safety_profile_enums_1.ChronicCondition.HEART_DISEASE]: 'Heart disease',
|
|
39
|
+
[safety_profile_enums_1.ChronicCondition.HYPERTENSION]: 'Hypertension',
|
|
40
|
+
[safety_profile_enums_1.ChronicCondition.SICKLE_CELL]: 'Sickle cell',
|
|
41
|
+
[safety_profile_enums_1.ChronicCondition.KIDNEY_DISEASE]: 'Kidney disease',
|
|
42
|
+
[safety_profile_enums_1.ChronicCondition.OTHER]: 'Other',
|
|
43
|
+
};
|
|
44
|
+
exports.DISABILITY_TYPE_LABELS = {
|
|
45
|
+
[safety_profile_enums_1.DisabilityType.MOBILITY]: 'Mobility',
|
|
46
|
+
[safety_profile_enums_1.DisabilityType.HEARING]: 'Hearing',
|
|
47
|
+
[safety_profile_enums_1.DisabilityType.VISION]: 'Vision',
|
|
48
|
+
[safety_profile_enums_1.DisabilityType.COGNITIVE]: 'Cognitive',
|
|
49
|
+
[safety_profile_enums_1.DisabilityType.SPEECH]: 'Speech',
|
|
50
|
+
[safety_profile_enums_1.DisabilityType.OTHER]: 'Other',
|
|
51
|
+
};
|
|
52
|
+
exports.PREGNANCY_STATUS_LABELS = {
|
|
53
|
+
[safety_profile_enums_1.PregnancyStatus.NOT_PREGNANT]: 'Not pregnant',
|
|
54
|
+
[safety_profile_enums_1.PregnancyStatus.PREGNANT]: 'Pregnant',
|
|
55
|
+
[safety_profile_enums_1.PregnancyStatus.PREFER_NOT_TO_SAY]: 'Prefers not to say',
|
|
56
|
+
};
|
|
57
|
+
exports.WORK_SCHEDULE_LABELS = {
|
|
58
|
+
[safety_profile_enums_1.WorkSchedule.OFFICE_HOURS]: 'Office hours',
|
|
59
|
+
[safety_profile_enums_1.WorkSchedule.NIGHT_SHIFT]: 'Night shift',
|
|
60
|
+
[safety_profile_enums_1.WorkSchedule.ROTATING_SHIFTS]: 'Rotating shifts',
|
|
61
|
+
[safety_profile_enums_1.WorkSchedule.FIELD_WORK]: 'Field work',
|
|
62
|
+
[safety_profile_enums_1.WorkSchedule.REMOTE]: 'Remote',
|
|
63
|
+
[safety_profile_enums_1.WorkSchedule.OTHER]: 'Other',
|
|
64
|
+
};
|
|
65
|
+
exports.FREQUENT_PLACE_TYPE_LABELS = {
|
|
66
|
+
[safety_profile_enums_1.FrequentPlaceType.FAMILY_HOME]: 'Family home',
|
|
67
|
+
[safety_profile_enums_1.FrequentPlaceType.FRIENDS_PLACE]: "Friend's place",
|
|
68
|
+
[safety_profile_enums_1.FrequentPlaceType.GYM_SPORTS_CLUB]: 'Gym / sports club',
|
|
69
|
+
[safety_profile_enums_1.FrequentPlaceType.RELIGIOUS_PLACE]: 'Religious place',
|
|
70
|
+
[safety_profile_enums_1.FrequentPlaceType.MEDICAL_FACILITY]: 'Medical facility',
|
|
71
|
+
[safety_profile_enums_1.FrequentPlaceType.SHOPPING]: 'Shopping',
|
|
72
|
+
[safety_profile_enums_1.FrequentPlaceType.ENTERTAINMENT]: 'Entertainment',
|
|
73
|
+
[safety_profile_enums_1.FrequentPlaceType.CHILDCARE]: 'Childcare / school',
|
|
74
|
+
[safety_profile_enums_1.FrequentPlaceType.TRANSPORT_POINT]: 'Transport point',
|
|
75
|
+
[safety_profile_enums_1.FrequentPlaceType.REGULAR_ROUTE]: 'Regular route',
|
|
76
|
+
[safety_profile_enums_1.FrequentPlaceType.RURAL_HOME]: 'Rural home',
|
|
77
|
+
[safety_profile_enums_1.FrequentPlaceType.OTHER]: 'Other',
|
|
78
|
+
};
|
|
79
|
+
exports.VEHICLE_OWNERSHIP_LABELS = {
|
|
80
|
+
[safety_profile_enums_1.VehicleOwnership.OWN]: 'Own',
|
|
81
|
+
[safety_profile_enums_1.VehicleOwnership.COMPANY]: 'Company',
|
|
82
|
+
[safety_profile_enums_1.VehicleOwnership.FAMILY]: 'Family',
|
|
83
|
+
[safety_profile_enums_1.VehicleOwnership.OTHER]: 'Other',
|
|
84
|
+
};
|
|
85
|
+
exports.VEHICLE_TYPE_LABELS = {
|
|
86
|
+
[safety_profile_enums_1.VehicleType.CAR]: 'Car',
|
|
87
|
+
[safety_profile_enums_1.VehicleType.MOTORCYCLE]: 'Motorcycle',
|
|
88
|
+
[safety_profile_enums_1.VehicleType.BICYCLE]: 'Bicycle',
|
|
89
|
+
[safety_profile_enums_1.VehicleType.TRUCK]: 'Truck',
|
|
90
|
+
[safety_profile_enums_1.VehicleType.SCOOTER]: 'Scooter',
|
|
91
|
+
[safety_profile_enums_1.VehicleType.OTHER]: 'Other',
|
|
92
|
+
};
|
|
93
|
+
exports.HIGH_RISK_OCCUPATION_LABELS = {
|
|
94
|
+
[safety_profile_enums_1.HighRiskOccupation.CASH_HANDLING]: 'Cash handling',
|
|
95
|
+
[safety_profile_enums_1.HighRiskOccupation.NIGHT_WORK]: 'Night work',
|
|
96
|
+
[safety_profile_enums_1.HighRiskOccupation.SECURITY]: 'Security',
|
|
97
|
+
[safety_profile_enums_1.HighRiskOccupation.FIELD_SALES]: 'Field sales',
|
|
98
|
+
[safety_profile_enums_1.HighRiskOccupation.JOURNALISM]: 'Journalism',
|
|
99
|
+
[safety_profile_enums_1.HighRiskOccupation.HEALTHCARE]: 'Healthcare',
|
|
100
|
+
[safety_profile_enums_1.HighRiskOccupation.TRANSPORT]: 'Transport',
|
|
101
|
+
[safety_profile_enums_1.HighRiskOccupation.OTHER]: 'Other',
|
|
102
|
+
};
|
|
103
|
+
exports.SAFETY_PROFILE_AUDIENCE_LABELS = {
|
|
104
|
+
[safety_profile_enums_1.SafetyProfileAudience.CONTROL_CENTRE]: 'Control room',
|
|
105
|
+
[safety_profile_enums_1.SafetyProfileAudience.RESPONDER]: 'Responder',
|
|
106
|
+
[safety_profile_enums_1.SafetyProfileAudience.GUARDIAN]: 'Guardian',
|
|
107
|
+
};
|
|
108
|
+
exports.SAFETY_PROFILE_HIDDEN_REASON_LABELS = {
|
|
109
|
+
[safety_profile_enums_1.SafetyProfileHiddenReason.ONLY_DURING_SOS]: 'Shared only during an active SOS',
|
|
110
|
+
[safety_profile_enums_1.SafetyProfileHiddenReason.NOT_SHARED_WITH_GUARDIANS]: 'Not shared with guardians',
|
|
111
|
+
[safety_profile_enums_1.SafetyProfileHiddenReason.NOT_FOR_AUDIENCE]: 'Not shared with this role',
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* The label for a value of any of the maps above, or the raw value when it is
|
|
115
|
+
* unknown (a newer server) - never blank.
|
|
116
|
+
*/
|
|
117
|
+
function safetyProfileLabel(labels, value) {
|
|
118
|
+
var _a;
|
|
119
|
+
if (value === null || value === undefined || value === '')
|
|
120
|
+
return '';
|
|
121
|
+
return (_a = labels[value]) !== null && _a !== void 0 ? _a : String(value).replace(/_/g, ' ').toLowerCase().replace(/^\w/, (c) => c.toUpperCase());
|
|
122
|
+
}
|
|
123
|
+
/** "35 years" from a YYYY-MM-DD date of birth, or null; `today` is injectable for tests. */
|
|
124
|
+
function safetyProfileAge(dateOfBirth, today = new Date()) {
|
|
125
|
+
if (!dateOfBirth)
|
|
126
|
+
return null;
|
|
127
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})/.exec(dateOfBirth);
|
|
128
|
+
if (!match)
|
|
129
|
+
return null;
|
|
130
|
+
const [year, month, day] = [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
131
|
+
let age = today.getUTCFullYear() - year;
|
|
132
|
+
const beforeBirthday = today.getUTCMonth() + 1 < month || (today.getUTCMonth() + 1 === month && today.getUTCDate() < day);
|
|
133
|
+
if (beforeBirthday)
|
|
134
|
+
age -= 1;
|
|
135
|
+
return age >= 0 && age < 150 ? age : null;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=safety-profile-display.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety-profile-display.util.js","sourceRoot":"","sources":["../../../../../src/modules/safety-profile/utils/safety-profile-display.util.ts"],"names":[],"mappings":";;;AA2IA,gDAGC;AAGD,4CASC;AA1JD,wEAcuC;AAEvC;;;GAGG;AACU,QAAA,4BAA4B,GAAkD;IACvF,CAAC,0CAAmB,CAAC,MAAM,CAAC,EAAE,QAAQ;IACtC,CAAC,0CAAmB,CAAC,IAAI,CAAC,EAAE,MAAM;IAClC,CAAC,0CAAmB,CAAC,KAAK,CAAC,EAAE,OAAO;IACpC,CAAC,0CAAmB,CAAC,iBAAiB,CAAC,EAAE,oBAAoB;CAChE,CAAC;AAEW,QAAA,gCAAgC,GAAqD;IAC9F,CAAC,6CAAsB,CAAC,KAAK,CAAC,EAAE,OAAO;IACvC,CAAC,6CAAsB,CAAC,IAAI,CAAC,EAAE,MAAM;IACrC,CAAC,6CAAsB,CAAC,SAAS,CAAC,EAAE,WAAW;IAC/C,CAAC,6CAAsB,CAAC,MAAM,CAAC,EAAE,QAAQ;CAC5C,CAAC;AAEW,QAAA,kBAAkB,GAAyC;IACpE,CAAC,iCAAU,CAAC,UAAU,CAAC,EAAE,IAAI;IAC7B,CAAC,iC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