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.
Files changed (80) hide show
  1. package/dist/cjs/index.js +2 -0
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/modules/analytics/analytics-country.js +83 -0
  4. package/dist/cjs/modules/analytics/analytics-country.js.map +1 -0
  5. package/dist/cjs/modules/analytics/index.js +18 -0
  6. package/dist/cjs/modules/analytics/index.js.map +1 -0
  7. package/dist/cjs/modules/incident-sla/interfaces/incident-sla.dto.js.map +1 -1
  8. package/dist/cjs/modules/permission/enums/permission-actions.enum.js +7 -0
  9. package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
  10. package/dist/cjs/modules/permission/enums/permissions-moudule.enum.js +1 -0
  11. package/dist/cjs/modules/permission/enums/permissions-moudule.enum.js.map +1 -1
  12. package/dist/cjs/modules/safety-profile/constants/safety-profile.const.js +110 -0
  13. package/dist/cjs/modules/safety-profile/constants/safety-profile.const.js.map +1 -0
  14. package/dist/cjs/modules/safety-profile/enums/safety-profile.enums.js +188 -0
  15. package/dist/cjs/modules/safety-profile/enums/safety-profile.enums.js.map +1 -0
  16. package/dist/cjs/modules/safety-profile/index.js +27 -0
  17. package/dist/cjs/modules/safety-profile/index.js.map +1 -0
  18. package/dist/cjs/modules/safety-profile/interfaces/safety-profile-sections.js +4 -0
  19. package/dist/cjs/modules/safety-profile/interfaces/safety-profile-sections.js.map +1 -0
  20. package/dist/cjs/modules/safety-profile/interfaces/safety-profile-views.js +3 -0
  21. package/dist/cjs/modules/safety-profile/interfaces/safety-profile-views.js.map +1 -0
  22. package/dist/cjs/modules/safety-profile/utils/safety-profile-display.util.js +137 -0
  23. package/dist/cjs/modules/safety-profile/utils/safety-profile-display.util.js.map +1 -0
  24. package/dist/cjs/modules/safety-profile/utils/safety-profile-visibility.util.js +43 -0
  25. package/dist/cjs/modules/safety-profile/utils/safety-profile-visibility.util.js.map +1 -0
  26. package/dist/esm/index.js +2 -0
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/modules/analytics/analytics-country.js +74 -0
  29. package/dist/esm/modules/analytics/analytics-country.js.map +1 -0
  30. package/dist/esm/modules/analytics/index.js +2 -0
  31. package/dist/esm/modules/analytics/index.js.map +1 -0
  32. package/dist/esm/modules/incident-sla/interfaces/incident-sla.dto.js.map +1 -1
  33. package/dist/esm/modules/permission/enums/permission-actions.enum.js +7 -0
  34. package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
  35. package/dist/esm/modules/permission/enums/permissions-moudule.enum.js +1 -0
  36. package/dist/esm/modules/permission/enums/permissions-moudule.enum.js.map +1 -1
  37. package/dist/esm/modules/safety-profile/constants/safety-profile.const.js +107 -0
  38. package/dist/esm/modules/safety-profile/constants/safety-profile.const.js.map +1 -0
  39. package/dist/esm/modules/safety-profile/enums/safety-profile.enums.js +185 -0
  40. package/dist/esm/modules/safety-profile/enums/safety-profile.enums.js.map +1 -0
  41. package/dist/esm/modules/safety-profile/index.js +11 -0
  42. package/dist/esm/modules/safety-profile/index.js.map +1 -0
  43. package/dist/esm/modules/safety-profile/interfaces/safety-profile-sections.js +2 -0
  44. package/dist/esm/modules/safety-profile/interfaces/safety-profile-sections.js.map +1 -0
  45. package/dist/esm/modules/safety-profile/interfaces/safety-profile-views.js +2 -0
  46. package/dist/esm/modules/safety-profile/interfaces/safety-profile-views.js.map +1 -0
  47. package/dist/esm/modules/safety-profile/utils/safety-profile-display.util.js +132 -0
  48. package/dist/esm/modules/safety-profile/utils/safety-profile-display.util.js.map +1 -0
  49. package/dist/esm/modules/safety-profile/utils/safety-profile-visibility.util.js +40 -0
  50. package/dist/esm/modules/safety-profile/utils/safety-profile-visibility.util.js.map +1 -0
  51. package/dist/types/index.d.ts +2 -0
  52. package/dist/types/modules/alert-intake/interfaces/alert-intake-analytics.d.ts +9 -0
  53. package/dist/types/modules/analytics/analytics-country.d.ts +61 -0
  54. package/dist/types/modules/analytics/index.d.ts +1 -0
  55. package/dist/types/modules/billing/interfaces/billing-analytics.d.ts +41 -1
  56. package/dist/types/modules/chat/interfaces/chat-analytics.d.ts +5 -0
  57. package/dist/types/modules/dispatch/interfaces/dispatch-analytics.d.ts +7 -0
  58. package/dist/types/modules/gis/interfaces/zone-analytics.d.ts +7 -0
  59. package/dist/types/modules/incident/intefaces/incident-dashboard-analytics.d.ts +9 -0
  60. package/dist/types/modules/incident-sla/interfaces/incident-sla.dto.d.ts +9 -0
  61. package/dist/types/modules/newsfeed/interfaces/newsfeed-analytics.d.ts +5 -0
  62. package/dist/types/modules/notification/interfaces/notification-analytics.d.ts +5 -0
  63. package/dist/types/modules/organization/interfaces/organization-analytics.d.ts +9 -0
  64. package/dist/types/modules/partner/interfaces/partner-analytics.d.ts +9 -0
  65. package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +3 -0
  66. package/dist/types/modules/permission/enums/permissions-moudule.enum.d.ts +1 -0
  67. package/dist/types/modules/safety/interfaces/safety-analytics.d.ts +9 -0
  68. package/dist/types/modules/safety-profile/constants/safety-profile.const.d.ts +69 -0
  69. package/dist/types/modules/safety-profile/enums/safety-profile.enums.d.ts +168 -0
  70. package/dist/types/modules/safety-profile/index.d.ts +6 -0
  71. package/dist/types/modules/safety-profile/interfaces/safety-profile-sections.d.ts +163 -0
  72. package/dist/types/modules/safety-profile/interfaces/safety-profile-views.d.ts +249 -0
  73. package/dist/types/modules/safety-profile/utils/safety-profile-display.util.d.ts +25 -0
  74. package/dist/types/modules/safety-profile/utils/safety-profile-visibility.util.d.ts +38 -0
  75. package/dist/types/modules/support/interfaces/support-analytics.d.ts +5 -0
  76. package/dist/types/modules/tracking/interfaces/tracking-analytics.d.ts +9 -0
  77. package/dist/types/modules/user/interfaces/account-analytics.d.ts +9 -0
  78. package/dist/types/modules/user/interfaces/guardian.d.ts +2 -0
  79. package/dist/types/modules/user/interfaces/guardians-response.d.ts +2 -0
  80. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { UnitsAnalyticsCount, UnitsAnalyticsDuration, UnitsAnalyticsRange, UnitsAnalyticsScope } from '../../tracking/interfaces/tracking-analytics';
2
+ import { AnalyticsCountryRow, AnalyticsLocalTimes } from '../../analytics/analytics-country';
2
3
  /**
3
4
  * Units & Tracking analytics, the dispatch half: the response units sent to emergencies
4
5
  * and what became of each - computed by clarion-incident, for the same query as
@@ -155,4 +156,10 @@ export interface DispatchAnalytics {
155
156
  unitsTruncated: boolean;
156
157
  /** Platform view only; null otherwise. */
157
158
  byOrganization: DispatchAnalyticsOrganizationRow[] | null;
159
+ /** The country the figures are narrowed to (each record's own country); null for every country. */
160
+ countryCode: string | null;
161
+ /** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
162
+ localTimes: AnalyticsLocalTimes;
163
+ /** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
164
+ countryComparison: AnalyticsCountryRow[];
158
165
  }
@@ -1,4 +1,5 @@
1
1
  import { OrganizationAnalyticsCount, OrganizationAnalyticsRange, OrganizationAnalyticsScope } from '../../organization/interfaces/organization-analytics';
2
+ import { AnalyticsCountryRow, AnalyticsLocalTimes } from '../../analytics/analytics-country';
2
3
  /**
3
4
  * Organization analytics, the zone half: the areas the control centres cover - how
4
5
  * much ground, which counties, where zones overlap - computed by clarion-gis for the
@@ -140,4 +141,10 @@ export interface ZoneAnalytics {
140
141
  /** Platform view only; null otherwise. */
141
142
  byOrganization: ZoneAnalyticsOrganizationRow[] | null;
142
143
  timeline: ZoneAnalyticsTimelinePoint[];
144
+ /** The country the figures are narrowed to (each record's own country); null for every country. */
145
+ countryCode: string | null;
146
+ /** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
147
+ localTimes: AnalyticsLocalTimes;
148
+ /** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
149
+ countryComparison: AnalyticsCountryRow[];
143
150
  }
@@ -12,6 +12,7 @@
12
12
  * is never returned. Counts, rates and durations only - never a reporter, a description
13
13
  * or an address.
14
14
  */
15
+ import { AnalyticsCountryRow, AnalyticsLocalTimes } from '../../analytics/analytics-country';
15
16
  /** How the period is cut into points. Chosen by the service from the length of the period. */
16
17
  export type IncidentAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
17
18
  export interface IncidentAnalyticsRange {
@@ -303,6 +304,12 @@ export interface IncidentDashboardAnalytics {
303
304
  /** Platform view only; null otherwise. */
304
305
  byOrganization: IncidentAnalyticsOrganizationRow[] | null;
305
306
  geography: IncidentAnalyticsGeography;
307
+ /** The country the figures are narrowed to (each record's own country); null for every country. */
308
+ countryCode: string | null;
309
+ /** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
310
+ localTimes: AnalyticsLocalTimes;
311
+ /** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
312
+ countryComparison: AnalyticsCountryRow[];
306
313
  }
307
314
  /** The query the Dashboard's incident analytics answer (IncidentDashboardAnalyticsQueryDto in the services). */
308
315
  export interface IncidentDashboardAnalyticsQuery {
@@ -320,4 +327,6 @@ export interface IncidentDashboardAnalyticsQuery {
320
327
  channel?: string;
321
328
  typeId?: number;
322
329
  categoryId?: number;
330
+ /** One country's records only; its days in that country's zone. */
331
+ countryCode?: string;
323
332
  }
@@ -1,6 +1,7 @@
1
1
  import { IncidentEmergencyType } from '../../incident/enums/incident-emergency-type.enum';
2
2
  import { IncidentPriority } from '../../incident/enums/incident-priority.enum';
3
3
  import { EmergencyIncidentStage, EtaBasis, EtaStatus, IncidentActorType, IncidentArrivalSource, IncidentClosureReason, IncidentSlaEventSource, IncidentSlaEventType, IncidentSlaStage, IncidentSlaStatus, SlaEscalationLevel, SlaEscalationTrigger, SlaExceptionReason, SlaExceptionStatus, SlaOverallState, SlaPauseReason, SlaPauseStatus, SlaPolicyScope, SlaPriorityLevel } from '../enums/incident-sla-enums';
4
+ import { AnalyticsCountryRow, AnalyticsLocalTimes } from '../../analytics/analytics-country';
4
5
  export interface IncidentSlaExceptionDto {
5
6
  status: SlaExceptionStatus;
6
7
  reason: SlaExceptionReason | null;
@@ -517,6 +518,12 @@ export interface IncidentSlaAnalyticsDto {
517
518
  worstIncidents: IncidentSlaWorstIncidentDto[];
518
519
  byOrganization: IncidentSlaOrganizationRowDto[];
519
520
  generatedAt: string;
521
+ /** The country the figures are narrowed to (each record's own country); null for every country. */
522
+ countryCode: string | null;
523
+ /** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
524
+ localTimes: AnalyticsLocalTimes;
525
+ /** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
526
+ countryComparison: AnalyticsCountryRow[];
520
527
  }
521
528
  /** The query of `GET /api/incident-sla/analytics`. */
522
529
  export interface IncidentSlaAnalyticsQuery {
@@ -530,6 +537,8 @@ export interface IncidentSlaAnalyticsQuery {
530
537
  typeId?: number;
531
538
  categoryId?: number;
532
539
  responseUnitId?: number;
540
+ /** One country's records only; its days in that country's zone. */
541
+ countryCode?: string;
533
542
  }
534
543
  /** Policy settings beside the targets. On a stored policy every field is optional (absent = inherit). */
535
544
  export interface IncidentSlaPolicySettingsDto {
@@ -14,6 +14,7 @@
14
14
  * events the service emitted. Comments are every comment written, including any since
15
15
  * hidden by a moderator or removed.
16
16
  */
17
+ import { AnalyticsCountryRow, AnalyticsLocalTimes } from '../../analytics/analytics-country';
17
18
  /** How the period is cut into points for the charts. Chosen by the service from the length of the period. */
18
19
  export type NewsfeedAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
19
20
  export interface NewsfeedAnalyticsRange {
@@ -313,6 +314,10 @@ export interface NewsfeedAnalytics {
313
314
  byCountry: NewsfeedAnalyticsCountryRow[];
314
315
  /** A Super-Admin looking at every organization only. */
315
316
  byOrganization?: NewsfeedAnalyticsOrganizationRow[];
317
+ /** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
318
+ localTimes: AnalyticsLocalTimes;
319
+ /** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
320
+ countryComparison: AnalyticsCountryRow[];
316
321
  }
317
322
  /** What a dashboard asks: the period, one country - and, for a Super-Admin, whose figures. */
318
323
  export interface NewsfeedAnalyticsQuery {
@@ -22,6 +22,7 @@
22
22
  * - A country narrows push, in-app and devices by the recipient's country and SMS by
23
23
  * the number's; email has no country and is never narrowed.
24
24
  */
25
+ import { AnalyticsCountryRow, AnalyticsLocalTimes } from '../../analytics/analytics-country';
25
26
  /** How the period is cut into points for the charts. Chosen by the service from the length of the period. */
26
27
  export type NotificationAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
27
28
  /** The four ways Clarion tells somebody something. */
@@ -262,6 +263,10 @@ export interface NotificationAnalytics {
262
263
  byOrganization?: NotificationAnalyticsOrganizationRow[];
263
264
  /** A Super-Admin looking at every organization only. */
264
265
  unattributed?: NotificationAnalyticsUnattributed;
266
+ /** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
267
+ localTimes: AnalyticsLocalTimes;
268
+ /** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
269
+ countryComparison: AnalyticsCountryRow[];
265
270
  }
266
271
  /** What a dashboard asks: the period, one country - and, for a Super-Admin, whose figures. */
267
272
  export interface NotificationAnalyticsQuery {
@@ -10,6 +10,7 @@
10
10
  * Counts, rates and durations only - never a phone number, an address, a person or a
11
11
  * typed reason.
12
12
  */
13
+ import { AnalyticsCountryRow, AnalyticsLocalTimes } from '../../analytics/analytics-country';
13
14
  /** How the period is cut into points. Chosen by the service from the length of the period. */
14
15
  export type OrganizationAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
15
16
  export interface OrganizationAnalyticsRange {
@@ -186,6 +187,12 @@ export interface OrganizationAnalytics {
186
187
  controlCentreRowsTruncated: boolean;
187
188
  /** The organizations in scope: one row for an organization's own staff. */
188
189
  organizationRows: OrganizationAnalyticsOrganizationRow[];
190
+ /** The country the figures are narrowed to (each record's own country); null for every country. */
191
+ countryCode: string | null;
192
+ /** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
193
+ localTimes: AnalyticsLocalTimes;
194
+ /** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
195
+ countryComparison: AnalyticsCountryRow[];
189
196
  }
190
197
  /** The query both halves of the Organization analytics answer (OrganizationAnalyticsQueryDto in the services). */
191
198
  export interface OrganizationAnalyticsQuery {
@@ -197,4 +204,6 @@ export interface OrganizationAnalyticsQuery {
197
204
  /** Super-Admin only. */
198
205
  organizationId?: number;
199
206
  controlCentreId?: number;
207
+ /** One country's records only; its days in that country's zone. */
208
+ countryCode?: string;
200
209
  }
@@ -12,6 +12,7 @@
12
12
  * as they stand now: a dispatch raised in the period and delivered after it counts as
13
13
  * delivered. Partner calls and memberships are counted by when they happened.
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 PartnerAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
17
18
  export interface PartnerAnalyticsRange {
@@ -367,6 +368,12 @@ export interface PartnerAnalytics {
367
368
  incidentTypes: PartnerAnalyticsIncidentTypeRow[];
368
369
  /** A Super-Admin looking at every organization only. */
369
370
  byOrganization?: PartnerAnalyticsOrganizationRow[];
371
+ /** The country the figures are narrowed to (each record's own country); null for every country. */
372
+ countryCode: string | null;
373
+ /** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
374
+ localTimes: AnalyticsLocalTimes;
375
+ /** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
376
+ countryComparison: AnalyticsCountryRow[];
370
377
  }
371
378
  /** What a dashboard asks: the period, one partnership - and, for a Super-Admin, whose figures. */
372
379
  export interface PartnerAnalyticsQuery {
@@ -375,4 +382,6 @@ export interface PartnerAnalyticsQuery {
375
382
  timeZone?: string;
376
383
  organizationId?: number;
377
384
  integrationId?: number;
385
+ /** One country's records only; its days in that country's zone. */
386
+ countryCode?: string;
378
387
  }
@@ -195,6 +195,9 @@ export declare enum PermissionActions {
195
195
  USE_FOLLOW_ME = "use:follow-me",
196
196
  READ_FOLLOW_ME = "read:follow-me",
197
197
  TRACK_FOLLOW_ME = "track:follow-me",
198
+ MANAGE_SAFETY_PROFILE = "manage:safety-profile",
199
+ READ_SAFETY_PROFILE = "read:safety-profile",
200
+ OVERRIDE_SAFETY_PROFILE = "override:safety-profile",
198
201
  MANAGE_SAVED_PLACE = "manage:saved-place",
199
202
  READ_INCIDENT_SLA = "read:incident-sla",
200
203
  UPDATE_INCIDENT_SLA = "update:incident-sla",
@@ -15,6 +15,7 @@ export declare enum PermissionsModule {
15
15
  NOTIFICATION = "Notification",
16
16
  ALERT_INTAKE = "Alert Intake",
17
17
  SAFETY = "Safety",
18
+ SAFETY_PROFILE = "Safety Profile",
18
19
  PLACES = "Places",
19
20
  INCIDENT_SLA = "Incident SLA",
20
21
  RESPONDER = "Responder"
@@ -7,6 +7,7 @@
7
7
  * Counts only: never a location, a destination, a phone number, a name or a reason a
8
8
  * user typed. A check or journey is counted by when it started, as it stands now.
9
9
  */
10
+ import { AnalyticsCountryRow, AnalyticsLocalTimes } from '../../analytics/analytics-country';
10
11
  /** How the period is cut into points for the charts. Chosen by the service from the length of the period. */
11
12
  export type SafetyAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
12
13
  export interface SafetyAnalyticsRange {
@@ -346,6 +347,12 @@ export interface SafetyAnalytics {
346
347
  followMe: FollowMeAnalytics;
347
348
  /** Super-Admin's view of every organization only. */
348
349
  byOrganization?: SafetyAnalyticsOrganizationRow[];
350
+ /** The country the figures are narrowed to (each record's own country); null for every country. */
351
+ countryCode: string | null;
352
+ /** How the hour-of-week grids read time: in `range.timeZone` ('zone'), or each record in its own country's zone ('record'). */
353
+ localTimes: AnalyticsLocalTimes;
354
+ /** Every country in scope side by side for the period, the country filter left out: largest first, Unknown last. */
355
+ countryComparison: AnalyticsCountryRow[];
349
356
  }
350
357
  /**
351
358
  * The period a safety analytics read covers (query string). Both ends optional: no
@@ -357,4 +364,6 @@ export interface SafetyAnalyticsQuery {
357
364
  to?: string;
358
365
  timeZone?: string;
359
366
  organizationId?: number;
367
+ /** One country's records only; its days in that country's zone. */
368
+ countryCode?: string;
360
369
  }
@@ -0,0 +1,69 @@
1
+ import { SafetyProfileAudience, SafetyProfileCategory } from '../enums/safety-profile.enums';
2
+ import type { StoredSafetyProfileCategory } from '../interfaces/safety-profile-sections';
3
+ /** Every category, in the order the app and the console list them. */
4
+ export declare const SAFETY_PROFILE_CATEGORIES: readonly SafetyProfileCategory[];
5
+ /**
6
+ * The categories stored in `safety_profile_sections` (encrypted). EMERGENCY_CONTACTS
7
+ * is not one: it is the guardian list, kept where it always was.
8
+ */
9
+ export declare const STORED_SAFETY_PROFILE_CATEGORIES: readonly StoredSafetyProfileCategory[];
10
+ /**
11
+ * The categories a person must agree to share before anything is stored in them.
12
+ * Each is sensitive personal data under the Kenya Data Protection Act 2019 (health,
13
+ * sex, biometric images, property and family details) or its equivalents in UG/TZ/ZM.
14
+ * DEVICE holds only what the platform already knows plus an IMEI the person typed,
15
+ * so it needs no separate consent.
16
+ */
17
+ export declare const CONSENT_REQUIRED_SAFETY_PROFILE_CATEGORIES: readonly SafetyProfileCategory[];
18
+ /**
19
+ * Never shown to a guardian, whatever the person chose: the threats they named and
20
+ * their duress phrase must stay hidden from the people closest to them - in a
21
+ * domestic-violence case the threat can BE a guardian. Device details are
22
+ * operational and for the control room only.
23
+ */
24
+ export declare const NEVER_SHARED_WITH_GUARDIANS: readonly SafetyProfileCategory[];
25
+ /**
26
+ * What a responder's compact card may draw on (still subject to the person's
27
+ * settings). The safe word and the device stay with the control room.
28
+ */
29
+ export declare const RESPONDER_SAFETY_PROFILE_CATEGORIES: readonly SafetyProfileCategory[];
30
+ /** Which categories each audience can ever see. */
31
+ export declare const SAFETY_PROFILE_AUDIENCE_CATEGORIES: Readonly<Record<SafetyProfileAudience, readonly SafetyProfileCategory[]>>;
32
+ /**
33
+ * The version of the consent text the app shows. Recorded with every consent, so
34
+ * a later change of wording can ask again. Bump it when the text changes.
35
+ */
36
+ export declare const SAFETY_PROFILE_CONSENT_VERSION = "2026-11-07";
37
+ /** The one-line reason for the whole profile, shown wherever it is collected. */
38
+ export declare const SAFETY_PROFILE_EXPLANATION = "This information helps responders identify and locate you faster.";
39
+ /** Size limits, checked by the DTOs and the services alike. */
40
+ export declare const SAFETY_PROFILE_LIMITS: {
41
+ readonly nicknameMin: 2;
42
+ readonly nicknameMax: 30;
43
+ readonly shortText: 80;
44
+ readonly mediumText: 160;
45
+ readonly longText: 1000;
46
+ readonly alternativePhones: 3;
47
+ readonly photos: 4;
48
+ readonly allergies: 20;
49
+ readonly medications: 20;
50
+ readonly frequentPlaces: 10;
51
+ readonly vehicles: 5;
52
+ readonly imeiNumbers: 2;
53
+ readonly safeWordMin: 3;
54
+ readonly safeWordMax: 60;
55
+ readonly heightCm: {
56
+ readonly min: 30;
57
+ readonly max: 272;
58
+ };
59
+ readonly weightKg: {
60
+ readonly min: 1;
61
+ readonly max: 500;
62
+ };
63
+ readonly overrideReasonMin: 10;
64
+ readonly overrideReasonMax: 500;
65
+ readonly devicesPerUser: 10;
66
+ readonly accessLogPageMax: 100;
67
+ };
68
+ /** Every category's display name, for logs and fallbacks (the clients have their own copy). */
69
+ export declare const SAFETY_PROFILE_CATEGORY_LABELS: Readonly<Record<SafetyProfileCategory, string>>;
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Safety Profile (clarion-authentication): what an app user tells responders so
3
+ * they can be identified, found and helped faster in an emergency.
4
+ *
5
+ * The profile is split into CATEGORIES. Each stored category carries its own
6
+ * consent, its own "visible only during an active SOS" setting and its own
7
+ * "share with my guardians" setting, so a person can share their home with
8
+ * responders at any time while keeping their medical details for an emergency.
9
+ */
10
+ export declare enum SafetyProfileCategory {
11
+ /** Nickname, gender, extra photos, other phone numbers (plus the account's name, photo, birth date, phone, e-mail). */
12
+ IDENTITY = "IDENTITY",
13
+ MEDICAL = "MEDICAL",
14
+ /** The guardian list (guardian_relations) - not stored in the profile, summarised from it. */
15
+ EMERGENCY_CONTACTS = "EMERGENCY_CONTACTS",
16
+ RESIDENCE = "RESIDENCE",
17
+ WORKPLACE = "WORKPLACE",
18
+ FREQUENT_PLACES = "FREQUENT_PLACES",
19
+ TRAVEL = "TRAVEL",
20
+ VEHICLE = "VEHICLE",
21
+ SAFETY_RISK = "SAFETY_RISK",
22
+ /** Devices the app reported, last sign-in / activity, plus what the person typed (IMEI, second SIM). */
23
+ DEVICE = "DEVICE"
24
+ }
25
+ /** Who is looking at somebody else's profile. The owner is never an audience: they always see everything. */
26
+ export declare enum SafetyProfileAudience {
27
+ /** Control-room staff (read:safety-profile), in the admin console. */
28
+ CONTROL_CENTRE = "CONTROL_CENTRE",
29
+ /** A responder dispatched to the person's emergency, in the responder app (compact card only). */
30
+ RESPONDER = "RESPONDER",
31
+ /** One of the person's own guardians (notified on SOS), in the app. */
32
+ GUARDIAN = "GUARDIAN"
33
+ }
34
+ /** Why a category with data in it was not shown to this viewer. */
35
+ export declare enum SafetyProfileHiddenReason {
36
+ /** The person shares it only during an active emergency, and there is none. */
37
+ ONLY_DURING_SOS = "ONLY_DURING_SOS",
38
+ /** The person has not shared it with their guardians. */
39
+ NOT_SHARED_WITH_GUARDIANS = "NOT_SHARED_WITH_GUARDIANS",
40
+ /** Never shown to this kind of viewer (e.g. the safe word to a guardian). */
41
+ NOT_FOR_AUDIENCE = "NOT_FOR_AUDIENCE"
42
+ }
43
+ export declare enum SafetyProfileErrorCode {
44
+ /** A category is written before the person agreed to share it. */
45
+ CONSENT_REQUIRED = "SAFETY_PROFILE_CONSENT_REQUIRED",
46
+ /** Somebody else (another device) saved the category since it was read. */
47
+ VERSION_CONFLICT = "SAFETY_PROFILE_VERSION_CONFLICT",
48
+ /** The section's data does not validate. `details.errors` lists the fields. */
49
+ INVALID_SECTION = "SAFETY_PROFILE_INVALID_SECTION",
50
+ /** The category cannot be written (EMERGENCY_CONTACTS is the guardian list). */
51
+ CATEGORY_NOT_WRITABLE = "SAFETY_PROFILE_CATEGORY_NOT_WRITABLE",
52
+ /** Safety profiles cannot be stored or read right now: the encryption key is not configured. */
53
+ ENCRYPTION_UNAVAILABLE = "SAFETY_PROFILE_ENCRYPTION_UNAVAILABLE",
54
+ /** A photo id that is not one of the person's own uploads. */
55
+ PHOTO_NOT_YOURS = "SAFETY_PROFILE_PHOTO_NOT_YOURS",
56
+ /** A saved place id that is not one of the person's own places. */
57
+ PLACE_NOT_YOURS = "SAFETY_PROFILE_PLACE_NOT_YOURS",
58
+ /** The viewer may not see this person's profile at all. */
59
+ NOT_AUTHORISED = "SAFETY_PROFILE_NOT_AUTHORISED",
60
+ /** A responder asked outside an active dispatch. */
61
+ EMERGENCY_REQUIRED = "SAFETY_PROFILE_EMERGENCY_REQUIRED",
62
+ /** The incident does not belong to the person whose profile was asked for. */
63
+ INCIDENT_MISMATCH = "SAFETY_PROFILE_INCIDENT_MISMATCH",
64
+ /** The caller of the incident is anonymous, or the organization hides them from responders. */
65
+ CALLER_NOT_SHARED = "SAFETY_PROFILE_CALLER_NOT_SHARED",
66
+ /** An emergency override without a usable reason. */
67
+ OVERRIDE_REASON_REQUIRED = "SAFETY_PROFILE_OVERRIDE_REASON_REQUIRED"
68
+ }
69
+ export declare enum SafetyProfileGender {
70
+ FEMALE = "FEMALE",
71
+ MALE = "MALE",
72
+ OTHER = "OTHER",
73
+ PREFER_NOT_TO_SAY = "PREFER_NOT_TO_SAY"
74
+ }
75
+ /** The extra photos that help somebody be recognised. */
76
+ export declare enum SafetyProfilePhotoKind {
77
+ FRONT = "FRONT",
78
+ SIDE = "SIDE",
79
+ FULL_BODY = "FULL_BODY",
80
+ /** Optional: how the person looks lately (haircut, beard...). Not counted for completeness. */
81
+ RECENT = "RECENT"
82
+ }
83
+ export declare enum BloodGroup {
84
+ A_POSITIVE = "A_POSITIVE",
85
+ A_NEGATIVE = "A_NEGATIVE",
86
+ B_POSITIVE = "B_POSITIVE",
87
+ B_NEGATIVE = "B_NEGATIVE",
88
+ AB_POSITIVE = "AB_POSITIVE",
89
+ AB_NEGATIVE = "AB_NEGATIVE",
90
+ O_POSITIVE = "O_POSITIVE",
91
+ O_NEGATIVE = "O_NEGATIVE",
92
+ /** Answered: the person does not know theirs. */
93
+ UNKNOWN = "UNKNOWN"
94
+ }
95
+ export declare enum ChronicCondition {
96
+ DIABETES = "DIABETES",
97
+ ASTHMA = "ASTHMA",
98
+ EPILEPSY = "EPILEPSY",
99
+ HEART_DISEASE = "HEART_DISEASE",
100
+ HYPERTENSION = "HYPERTENSION",
101
+ SICKLE_CELL = "SICKLE_CELL",
102
+ KIDNEY_DISEASE = "KIDNEY_DISEASE",
103
+ OTHER = "OTHER"
104
+ }
105
+ export declare enum DisabilityType {
106
+ MOBILITY = "MOBILITY",
107
+ HEARING = "HEARING",
108
+ VISION = "VISION",
109
+ COGNITIVE = "COGNITIVE",
110
+ SPEECH = "SPEECH",
111
+ OTHER = "OTHER"
112
+ }
113
+ export declare enum PregnancyStatus {
114
+ NOT_PREGNANT = "NOT_PREGNANT",
115
+ PREGNANT = "PREGNANT",
116
+ PREFER_NOT_TO_SAY = "PREFER_NOT_TO_SAY"
117
+ }
118
+ export declare enum WorkSchedule {
119
+ OFFICE_HOURS = "OFFICE_HOURS",
120
+ NIGHT_SHIFT = "NIGHT_SHIFT",
121
+ ROTATING_SHIFTS = "ROTATING_SHIFTS",
122
+ FIELD_WORK = "FIELD_WORK",
123
+ REMOTE = "REMOTE",
124
+ OTHER = "OTHER"
125
+ }
126
+ export declare enum FrequentPlaceType {
127
+ FAMILY_HOME = "FAMILY_HOME",
128
+ FRIENDS_PLACE = "FRIENDS_PLACE",
129
+ GYM_SPORTS_CLUB = "GYM_SPORTS_CLUB",
130
+ RELIGIOUS_PLACE = "RELIGIOUS_PLACE",
131
+ MEDICAL_FACILITY = "MEDICAL_FACILITY",
132
+ SHOPPING = "SHOPPING",
133
+ ENTERTAINMENT = "ENTERTAINMENT",
134
+ CHILDCARE = "CHILDCARE",
135
+ TRANSPORT_POINT = "TRANSPORT_POINT",
136
+ REGULAR_ROUTE = "REGULAR_ROUTE",
137
+ RURAL_HOME = "RURAL_HOME",
138
+ OTHER = "OTHER"
139
+ }
140
+ export declare enum VehicleOwnership {
141
+ OWN = "OWN",
142
+ COMPANY = "COMPANY",
143
+ FAMILY = "FAMILY",
144
+ OTHER = "OTHER"
145
+ }
146
+ export declare enum VehicleType {
147
+ CAR = "CAR",
148
+ MOTORCYCLE = "MOTORCYCLE",
149
+ BICYCLE = "BICYCLE",
150
+ TRUCK = "TRUCK",
151
+ SCOOTER = "SCOOTER",
152
+ OTHER = "OTHER"
153
+ }
154
+ export declare enum HighRiskOccupation {
155
+ CASH_HANDLING = "CASH_HANDLING",
156
+ NIGHT_WORK = "NIGHT_WORK",
157
+ SECURITY = "SECURITY",
158
+ FIELD_SALES = "FIELD_SALES",
159
+ JOURNALISM = "JOURNALISM",
160
+ HEALTHCARE = "HEALTHCARE",
161
+ TRANSPORT = "TRANSPORT",
162
+ OTHER = "OTHER"
163
+ }
164
+ /** The detail level of a view: the admin console's full profile, or the responder's one card. */
165
+ export declare enum SafetyProfileViewFormat {
166
+ FULL = "FULL",
167
+ COMPACT = "COMPACT"
168
+ }
@@ -0,0 +1,6 @@
1
+ export * from './enums/safety-profile.enums';
2
+ export * from './constants/safety-profile.const';
3
+ export * from './interfaces/safety-profile-sections';
4
+ export * from './interfaces/safety-profile-views';
5
+ export * from './utils/safety-profile-visibility.util';
6
+ export * from './utils/safety-profile-display.util';
@@ -0,0 +1,163 @@
1
+ import { BloodGroup, ChronicCondition, DisabilityType, FrequentPlaceType, HighRiskOccupation, PregnancyStatus, SafetyProfileCategory, SafetyProfileGender, SafetyProfilePhotoKind, VehicleOwnership, VehicleType, WorkSchedule } from '../enums/safety-profile.enums';
2
+ export interface SafetyProfilePhoto {
3
+ kind: SafetyProfilePhotoKind;
4
+ /** A DMS image the person uploaded themselves (checked when saved). */
5
+ imageId: number;
6
+ /** YYYY-MM-DD, when the photo was taken, if the person said. */
7
+ takenOn?: string | null;
8
+ }
9
+ export interface SafetyProfileAlternativePhone {
10
+ /** Canonical E.164. */
11
+ phoneNumber: string;
12
+ /** "Work phone", "Second SIM"... */
13
+ label?: string | null;
14
+ }
15
+ export interface IdentitySection {
16
+ /** What friends, guards, neighbours or colleagues call the person. Stored on the account (users.nickname). */
17
+ nickname?: string | null;
18
+ gender?: SafetyProfileGender | null;
19
+ /** The person's own words, when gender is OTHER. */
20
+ genderDescription?: string | null;
21
+ alternativePhones?: SafetyProfileAlternativePhone[];
22
+ /** Answered: there is no other number to try. */
23
+ noAlternativePhone?: boolean;
24
+ photos?: SafetyProfilePhoto[];
25
+ }
26
+ export interface MedicalSection {
27
+ bloodGroup?: BloodGroup | null;
28
+ heightCm?: number | null;
29
+ weightKg?: number | null;
30
+ allergies?: string[];
31
+ noKnownAllergies?: boolean;
32
+ chronicConditions?: ChronicCondition[];
33
+ /** What OTHER is, or detail on any condition. */
34
+ chronicConditionNotes?: string | null;
35
+ noChronicConditions?: boolean;
36
+ medications?: string[];
37
+ noMedications?: boolean;
38
+ disabilities?: DisabilityType[];
39
+ disabilityNotes?: string | null;
40
+ noDisabilities?: boolean;
41
+ pregnancyStatus?: PregnancyStatus | null;
42
+ /** YYYY-MM-DD, when PREGNANT. */
43
+ pregnancyDueDate?: string | null;
44
+ insuranceProvider?: string | null;
45
+ insuranceMemberNumber?: string | null;
46
+ noInsurance?: boolean;
47
+ medicalNotes?: string | null;
48
+ }
49
+ export interface ResidenceSection {
50
+ /** The person's HOME saved place - the GPS pin. */
51
+ savedPlaceId?: string | null;
52
+ /** The address as the person writes it (the saved place's own address is the geocoder's). */
53
+ addressLine?: string | null;
54
+ estateOrBuilding?: string | null;
55
+ houseNumber?: string | null;
56
+ floor?: string | null;
57
+ /** Shops, schools, petrol stations, churches, mosques, roads nearby. */
58
+ landmarks?: string | null;
59
+ }
60
+ export interface WorkplaceSection {
61
+ /** Answered: no regular workplace, school or business. */
62
+ noWorkplace?: boolean;
63
+ employerName?: string | null;
64
+ jobTitle?: string | null;
65
+ /** The person's WORK saved place. */
66
+ savedPlaceId?: string | null;
67
+ addressLine?: string | null;
68
+ floorOrDepartment?: string | null;
69
+ schedule?: WorkSchedule | null;
70
+ scheduleNotes?: string | null;
71
+ }
72
+ export interface FrequentPlace {
73
+ /** Client-made id (UUID) so an entry can be edited in place. */
74
+ id: string;
75
+ name: string;
76
+ type: FrequentPlaceType;
77
+ savedPlaceId?: string | null;
78
+ addressOrLandmark?: string | null;
79
+ /** "Usually parks near Basement B entrance", "Visits on Saturday afternoons". */
80
+ notes?: string | null;
81
+ }
82
+ export interface FrequentPlacesSection {
83
+ places?: FrequentPlace[];
84
+ /** Answered: nothing to add. */
85
+ noneToAdd?: boolean;
86
+ }
87
+ /** A place on a trip: a saved place, a name, or both. */
88
+ export interface TravelLocation {
89
+ savedPlaceId?: string | null;
90
+ name?: string | null;
91
+ }
92
+ export interface TravelCompanion {
93
+ name?: string | null;
94
+ /** Canonical E.164. */
95
+ phoneNumber?: string | null;
96
+ }
97
+ export interface TravelSection {
98
+ /** Answered: not travelling or on a temporary assignment at the moment. */
99
+ notTravelling?: boolean;
100
+ /** A field assignment or temporary work site. */
101
+ temporarySite?: TravelLocation | null;
102
+ accommodation?: TravelLocation | null;
103
+ roomNumber?: string | null;
104
+ companion?: TravelCompanion | null;
105
+ /** A concert, a meeting, a conference. */
106
+ eventLocation?: TravelLocation | null;
107
+ /** YYYY-MM-DD. */
108
+ expectedReturnDate?: string | null;
109
+ }
110
+ export interface Vehicle {
111
+ /** Client-made id (UUID). */
112
+ id: string;
113
+ ownership?: VehicleOwnership | null;
114
+ type?: VehicleType | null;
115
+ make?: string | null;
116
+ model?: string | null;
117
+ colour?: string | null;
118
+ registrationNumber?: string | null;
119
+ }
120
+ export interface VehicleSection {
121
+ vehicles?: Vehicle[];
122
+ /** Answered: does not drive or own a vehicle. */
123
+ noVehicle?: boolean;
124
+ }
125
+ export interface SafetyRiskSection {
126
+ knownThreats?: string | null;
127
+ noKnownThreats?: boolean;
128
+ highRiskOccupations?: HighRiskOccupation[];
129
+ occupationNotes?: string | null;
130
+ noHighRiskOccupation?: boolean;
131
+ /**
132
+ * In an emergency, do NOT call me: contact me silently (text, in-app) first.
133
+ * Critical in a kidnapping, GBV or security incident - a ringing phone can give
134
+ * the person away. Null = not answered.
135
+ */
136
+ silentEmergency?: boolean | null;
137
+ /** A word or phrase that tells the control room the person is under duress. */
138
+ safeWord?: string | null;
139
+ }
140
+ export interface DeviceSection {
141
+ /** 15-digit IMEIs the person typed (dial *#06#). Apps cannot read them. */
142
+ imeiNumbers?: string[];
143
+ /** Answered: the IMEI is not at hand / not to be shared. */
144
+ noImei?: boolean;
145
+ /** Canonical E.164 number of a second SIM. */
146
+ alternateSimNumber?: string | null;
147
+ /** Answered: one SIM only. */
148
+ singleSim?: boolean;
149
+ }
150
+ /** The decrypted document of each stored category. */
151
+ export interface SafetyProfileSectionDataMap {
152
+ [SafetyProfileCategory.IDENTITY]: IdentitySection;
153
+ [SafetyProfileCategory.MEDICAL]: MedicalSection;
154
+ [SafetyProfileCategory.RESIDENCE]: ResidenceSection;
155
+ [SafetyProfileCategory.WORKPLACE]: WorkplaceSection;
156
+ [SafetyProfileCategory.FREQUENT_PLACES]: FrequentPlacesSection;
157
+ [SafetyProfileCategory.TRAVEL]: TravelSection;
158
+ [SafetyProfileCategory.VEHICLE]: VehicleSection;
159
+ [SafetyProfileCategory.SAFETY_RISK]: SafetyRiskSection;
160
+ [SafetyProfileCategory.DEVICE]: DeviceSection;
161
+ }
162
+ export type StoredSafetyProfileCategory = keyof SafetyProfileSectionDataMap;
163
+ export type SafetyProfileSectionData = SafetyProfileSectionDataMap[StoredSafetyProfileCategory];