grm-shared-library 1.1.222 → 1.1.224
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/kafka/topics.js +7 -0
- package/dist/cjs/kafka/topics.js.map +1 -1
- package/dist/cjs/modules/gis/dtos/private-trip.dto.js +34 -0
- package/dist/cjs/modules/gis/dtos/private-trip.dto.js.map +1 -1
- package/dist/cjs/modules/gis/dtos/routing.dto.js +251 -0
- package/dist/cjs/modules/gis/dtos/routing.dto.js.map +1 -0
- package/dist/cjs/modules/gis/dtos/trip-points.dto.js +35 -0
- package/dist/cjs/modules/gis/dtos/trip-points.dto.js.map +1 -0
- package/dist/cjs/modules/gis/enums/routing.enum.js +29 -0
- package/dist/cjs/modules/gis/enums/routing.enum.js.map +1 -0
- package/dist/cjs/modules/gis/enums/trip-privacy.enum.js +6 -0
- package/dist/cjs/modules/gis/enums/trip-privacy.enum.js.map +1 -1
- package/dist/cjs/modules/gis/index.js +5 -0
- package/dist/cjs/modules/gis/index.js.map +1 -1
- package/dist/cjs/modules/gis/interfaces/routing.js +3 -0
- package/dist/cjs/modules/gis/interfaces/routing.js.map +1 -0
- package/dist/cjs/modules/gis/interfaces/trip-point.js +3 -0
- package/dist/cjs/modules/gis/interfaces/trip-point.js.map +1 -0
- package/dist/cjs/modules/incident/dtos/incident/incident.dto.js +9 -1
- package/dist/cjs/modules/incident/dtos/incident/incident.dto.js.map +1 -1
- package/dist/cjs/modules/incident/enums/incident-origin-type.enum.js +2 -0
- package/dist/cjs/modules/incident/enums/incident-origin-type.enum.js.map +1 -1
- package/dist/cjs/modules/permission/data/permissions.data.js +10 -1
- package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +12 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permissions-module.enum.js +1 -0
- package/dist/cjs/modules/permission/enums/permissions-module.enum.js.map +1 -1
- package/dist/cjs/modules/role/constants/safety-roles.js +22 -1
- package/dist/cjs/modules/role/constants/safety-roles.js.map +1 -1
- package/dist/cjs/modules/role/data/roles.data.js +24 -7
- package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
- package/dist/cjs/modules/safety/constants/follow-me.const.js +137 -0
- package/dist/cjs/modules/safety/constants/follow-me.const.js.map +1 -0
- package/dist/cjs/modules/safety/constants/safety-integration.const.js +88 -1
- package/dist/cjs/modules/safety/constants/safety-integration.const.js.map +1 -1
- package/dist/cjs/modules/safety/dtos/follow-me.dto.js +501 -0
- package/dist/cjs/modules/safety/dtos/follow-me.dto.js.map +1 -0
- package/dist/cjs/modules/safety/dtos/safety-admin.dto.js +13 -0
- package/dist/cjs/modules/safety/dtos/safety-admin.dto.js.map +1 -1
- package/dist/cjs/modules/safety/dtos/safety-alert-context.dto.js +60 -0
- package/dist/cjs/modules/safety/dtos/safety-alert-context.dto.js.map +1 -0
- package/dist/cjs/modules/safety/dtos/safety-internal.dto.js +17 -0
- package/dist/cjs/modules/safety/dtos/safety-internal.dto.js.map +1 -1
- package/dist/cjs/modules/safety/enums/follow-me.enums.js +237 -0
- package/dist/cjs/modules/safety/enums/follow-me.enums.js.map +1 -0
- package/dist/cjs/modules/safety/enums/safety-enums.js +8 -3
- package/dist/cjs/modules/safety/enums/safety-enums.js.map +1 -1
- package/dist/cjs/modules/safety/index.js +7 -0
- package/dist/cjs/modules/safety/index.js.map +1 -1
- package/dist/cjs/modules/safety/interfaces/follow-me.js +3 -0
- package/dist/cjs/modules/safety/interfaces/follow-me.js.map +1 -0
- package/dist/cjs/modules/safety/interfaces/safety-alert-context.js +3 -0
- package/dist/cjs/modules/safety/interfaces/safety-alert-context.js.map +1 -0
- package/dist/cjs/modules/safety/utils/follow-me-state-machine.js +131 -0
- package/dist/cjs/modules/safety/utils/follow-me-state-machine.js.map +1 -0
- package/dist/cjs/modules/sms/constants/sms-templates.config.js +12 -0
- package/dist/cjs/modules/sms/constants/sms-templates.config.js.map +1 -1
- package/dist/cjs/modules/sms/enums/sms-template.enum.js +2 -0
- package/dist/cjs/modules/sms/enums/sms-template.enum.js.map +1 -1
- package/dist/esm/kafka/topics.js +7 -0
- package/dist/esm/kafka/topics.js.map +1 -1
- package/dist/esm/modules/gis/dtos/private-trip.dto.js +34 -0
- package/dist/esm/modules/gis/dtos/private-trip.dto.js.map +1 -1
- package/dist/esm/modules/gis/dtos/routing.dto.js +241 -0
- package/dist/esm/modules/gis/dtos/routing.dto.js.map +1 -0
- package/dist/esm/modules/gis/dtos/trip-points.dto.js +31 -0
- package/dist/esm/modules/gis/dtos/trip-points.dto.js.map +1 -0
- package/dist/esm/modules/gis/enums/routing.enum.js +26 -0
- package/dist/esm/modules/gis/enums/routing.enum.js.map +1 -0
- package/dist/esm/modules/gis/enums/trip-privacy.enum.js +6 -0
- package/dist/esm/modules/gis/enums/trip-privacy.enum.js.map +1 -1
- package/dist/esm/modules/gis/index.js +5 -0
- package/dist/esm/modules/gis/index.js.map +1 -1
- package/dist/esm/modules/gis/interfaces/routing.js +2 -0
- package/dist/esm/modules/gis/interfaces/routing.js.map +1 -0
- package/dist/esm/modules/gis/interfaces/trip-point.js +2 -0
- package/dist/esm/modules/gis/interfaces/trip-point.js.map +1 -0
- package/dist/esm/modules/incident/dtos/incident/incident.dto.js +9 -1
- package/dist/esm/modules/incident/dtos/incident/incident.dto.js.map +1 -1
- package/dist/esm/modules/incident/enums/incident-origin-type.enum.js +2 -0
- package/dist/esm/modules/incident/enums/incident-origin-type.enum.js.map +1 -1
- package/dist/esm/modules/permission/data/permissions.data.js +10 -1
- package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +12 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/permission/enums/permissions-module.enum.js +1 -0
- package/dist/esm/modules/permission/enums/permissions-module.enum.js.map +1 -1
- package/dist/esm/modules/role/constants/safety-roles.js +21 -0
- package/dist/esm/modules/role/constants/safety-roles.js.map +1 -1
- package/dist/esm/modules/role/data/roles.data.js +24 -7
- package/dist/esm/modules/role/data/roles.data.js.map +1 -1
- package/dist/esm/modules/safety/constants/follow-me.const.js +134 -0
- package/dist/esm/modules/safety/constants/follow-me.const.js.map +1 -0
- package/dist/esm/modules/safety/constants/safety-integration.const.js +86 -0
- package/dist/esm/modules/safety/constants/safety-integration.const.js.map +1 -1
- package/dist/esm/modules/safety/dtos/follow-me.dto.js +488 -0
- package/dist/esm/modules/safety/dtos/follow-me.dto.js.map +1 -0
- package/dist/esm/modules/safety/dtos/safety-admin.dto.js +13 -0
- package/dist/esm/modules/safety/dtos/safety-admin.dto.js.map +1 -1
- package/dist/esm/modules/safety/dtos/safety-alert-context.dto.js +55 -0
- package/dist/esm/modules/safety/dtos/safety-alert-context.dto.js.map +1 -0
- package/dist/esm/modules/safety/dtos/safety-internal.dto.js +17 -0
- package/dist/esm/modules/safety/dtos/safety-internal.dto.js.map +1 -1
- package/dist/esm/modules/safety/enums/follow-me.enums.js +234 -0
- package/dist/esm/modules/safety/enums/follow-me.enums.js.map +1 -0
- package/dist/esm/modules/safety/enums/safety-enums.js +8 -3
- package/dist/esm/modules/safety/enums/safety-enums.js.map +1 -1
- package/dist/esm/modules/safety/index.js +7 -0
- package/dist/esm/modules/safety/index.js.map +1 -1
- package/dist/esm/modules/safety/interfaces/follow-me.js +2 -0
- package/dist/esm/modules/safety/interfaces/follow-me.js.map +1 -0
- package/dist/esm/modules/safety/interfaces/safety-alert-context.js +2 -0
- package/dist/esm/modules/safety/interfaces/safety-alert-context.js.map +1 -0
- package/dist/esm/modules/safety/utils/follow-me-state-machine.js +116 -0
- package/dist/esm/modules/safety/utils/follow-me-state-machine.js.map +1 -0
- package/dist/esm/modules/sms/constants/sms-templates.config.js +12 -0
- package/dist/esm/modules/sms/constants/sms-templates.config.js.map +1 -1
- package/dist/esm/modules/sms/enums/sms-template.enum.js +2 -0
- package/dist/esm/modules/sms/enums/sms-template.enum.js.map +1 -1
- package/dist/types/kafka/topics.d.ts +5 -0
- package/dist/types/modules/gis/dtos/private-trip.dto.d.ts +4 -0
- package/dist/types/modules/gis/dtos/routing.dto.d.ts +48 -0
- package/dist/types/modules/gis/dtos/trip-points.dto.d.ts +5 -0
- package/dist/types/modules/gis/enums/routing.enum.d.ts +22 -0
- package/dist/types/modules/gis/enums/trip-privacy.enum.d.ts +7 -1
- package/dist/types/modules/gis/index.d.ts +5 -0
- package/dist/types/modules/gis/interfaces/routing.d.ts +43 -0
- package/dist/types/modules/gis/interfaces/trip-point.d.ts +16 -0
- package/dist/types/modules/gis/interfaces/trip-summary.d.ts +2 -6
- package/dist/types/modules/incident/dtos/incident/incident.dto.d.ts +2 -0
- package/dist/types/modules/incident/enums/incident-origin-type.enum.d.ts +3 -1
- package/dist/types/modules/incident/intefaces/incident.d.ts +3 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +4 -0
- package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +2 -1
- package/dist/types/modules/role/constants/safety-roles.d.ts +10 -0
- package/dist/types/modules/safety/constants/follow-me.const.d.ts +120 -0
- package/dist/types/modules/safety/constants/safety-integration.const.d.ts +79 -0
- package/dist/types/modules/safety/dtos/follow-me.dto.d.ts +106 -0
- package/dist/types/modules/safety/dtos/safety-admin.dto.d.ts +3 -0
- package/dist/types/modules/safety/dtos/safety-alert-context.dto.d.ts +14 -0
- package/dist/types/modules/safety/dtos/safety-internal.dto.d.ts +3 -0
- package/dist/types/modules/safety/enums/follow-me.enums.d.ts +218 -0
- package/dist/types/modules/safety/enums/safety-enums.d.ts +9 -4
- package/dist/types/modules/safety/index.d.ts +7 -0
- package/dist/types/modules/safety/interfaces/follow-me.d.ts +377 -0
- package/dist/types/modules/safety/interfaces/safety-alert-context.d.ts +8 -0
- package/dist/types/modules/safety/interfaces/safety-check.d.ts +3 -1
- package/dist/types/modules/safety/utils/follow-me-state-machine.d.ts +51 -0
- package/dist/types/modules/sms/enums/sms-template.enum.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lifecycle of one Follow Me session. clarion-safety is the only writer; every
|
|
3
|
+
* transition is validated against FOLLOW_ME_TRANSITIONS and applied as a
|
|
4
|
+
* conditional update, exactly as a Safety Check is.
|
|
5
|
+
*
|
|
6
|
+
* CREATED accepted and persisted; the trip, the timer and the guardian
|
|
7
|
+
* requests are being set up. Already counts as live.
|
|
8
|
+
* ACTIVE the journey is being shared and monitored.
|
|
9
|
+
* PROMPTING a safety prompt is open (see FollowMePromptStatus); an SOS is
|
|
10
|
+
* raised if it is not answered.
|
|
11
|
+
* ARRIVED the destination was reached. Terminal, successful.
|
|
12
|
+
* SOS_TRIGGERED an SOS was raised - a prompt went unanswered or the user
|
|
13
|
+
* asked for one. Follow Me is over; the recorded trip goes on as
|
|
14
|
+
* the incident's trip and followers move to the SOS view.
|
|
15
|
+
* STOPPED the user ended it. Terminal.
|
|
16
|
+
* EXPIRED the chosen duration ran out before arrival. Terminal; never
|
|
17
|
+
* raises an SOS by itself. Deferred while a prompt is open.
|
|
18
|
+
* CANCELLED ended by the platform rather than the user (e.g. sign-out).
|
|
19
|
+
* FAILED the SOS could not be raised because clarion-incident refused
|
|
20
|
+
* it outright. Terminal; the user and guardians are told to act.
|
|
21
|
+
*
|
|
22
|
+
* Deliberately NOT a status: whether live sharing is healthy. That is
|
|
23
|
+
* FollowMeTrackingHealth, derived from when the last location arrived - a
|
|
24
|
+
* session with a flat battery is still a session.
|
|
25
|
+
*/
|
|
26
|
+
export declare enum FollowMeStatus {
|
|
27
|
+
CREATED = "CREATED",
|
|
28
|
+
ACTIVE = "ACTIVE",
|
|
29
|
+
PROMPTING = "PROMPTING",
|
|
30
|
+
ARRIVED = "ARRIVED",
|
|
31
|
+
SOS_TRIGGERED = "SOS_TRIGGERED",
|
|
32
|
+
STOPPED = "STOPPED",
|
|
33
|
+
EXPIRED = "EXPIRED",
|
|
34
|
+
CANCELLED = "CANCELLED",
|
|
35
|
+
FAILED = "FAILED"
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* One guardian's relationship to a session - separate from the session's own
|
|
39
|
+
* state. A guardian stopping following never ends the session.
|
|
40
|
+
*
|
|
41
|
+
* PENDING asked, not yet answered.
|
|
42
|
+
* ACCEPTED following (whether they are looking right now is
|
|
43
|
+
* presence, not state).
|
|
44
|
+
* DECLINED said no. May still accept while the session is live.
|
|
45
|
+
* STOPPED_FOLLOWING followed, then stopped. May follow again while live.
|
|
46
|
+
* EXPIRED the session ended; every open participation ends with it.
|
|
47
|
+
*/
|
|
48
|
+
export declare enum FollowMeParticipantStatus {
|
|
49
|
+
PENDING = "PENDING",
|
|
50
|
+
ACCEPTED = "ACCEPTED",
|
|
51
|
+
DECLINED = "DECLINED",
|
|
52
|
+
STOPPED_FOLLOWING = "STOPPED_FOLLOWING",
|
|
53
|
+
EXPIRED = "EXPIRED"
|
|
54
|
+
}
|
|
55
|
+
/** Who a participant is. App guardians sign in; external guardians hold a link. */
|
|
56
|
+
export declare enum FollowMeParticipantKind {
|
|
57
|
+
SYSTEM_GUARDIAN = "SYSTEM_GUARDIAN",
|
|
58
|
+
EXTERNAL_GUARDIAN = "EXTERNAL_GUARDIAN"
|
|
59
|
+
}
|
|
60
|
+
export declare enum FollowMeTransportMode {
|
|
61
|
+
WALK = "WALK",
|
|
62
|
+
DRIVE = "DRIVE",
|
|
63
|
+
TWO_WHEELER = "TWO_WHEELER",
|
|
64
|
+
PUBLIC_TRANSPORT = "PUBLIC_TRANSPORT",
|
|
65
|
+
/** A taxi or ride-hail: routed as driving, monitored as a vehicle. */
|
|
66
|
+
RIDE_SERVICE = "RIDE_SERVICE"
|
|
67
|
+
}
|
|
68
|
+
export declare enum FollowMeWaypointKind {
|
|
69
|
+
START = "START",
|
|
70
|
+
STOP = "STOP",
|
|
71
|
+
DESTINATION = "DESTINATION"
|
|
72
|
+
}
|
|
73
|
+
/** A route is never replaced silently: the plan and every recalculation are kept. */
|
|
74
|
+
export declare enum FollowMeRouteKind {
|
|
75
|
+
ORIGINAL = "ORIGINAL",
|
|
76
|
+
RECALCULATED = "RECALCULATED"
|
|
77
|
+
}
|
|
78
|
+
/** What made Follow Me ask the user whether they are safe. */
|
|
79
|
+
export declare enum FollowMeSafetyTrigger {
|
|
80
|
+
CRASH_SUSPECTED = "CRASH_SUSPECTED",
|
|
81
|
+
ROUTE_DEVIATION = "ROUTE_DEVIATION",
|
|
82
|
+
PROLONGED_STOP = "PROLONGED_STOP",
|
|
83
|
+
ETA_OVERDUE = "ETA_OVERDUE"
|
|
84
|
+
}
|
|
85
|
+
export declare enum FollowMePromptStatus {
|
|
86
|
+
ACTIVE = "ACTIVE",
|
|
87
|
+
CONFIRMED_OK = "CONFIRMED_OK",
|
|
88
|
+
/** Unanswered - the SOS followed. */
|
|
89
|
+
EXPIRED = "EXPIRED",
|
|
90
|
+
/** Closed without an answer for another reason: the session ended, or the user pressed SOS. */
|
|
91
|
+
CANCELLED = "CANCELLED"
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* What the monitors observed (follow_me_safety_events). Evidence, not decisions:
|
|
95
|
+
* most of these never become a prompt.
|
|
96
|
+
*/
|
|
97
|
+
export declare enum FollowMeSafetyEventType {
|
|
98
|
+
OFF_ROUTE_SUSPECTED = "OFF_ROUTE_SUSPECTED",
|
|
99
|
+
BACK_ON_ROUTE = "BACK_ON_ROUTE",
|
|
100
|
+
ROUTE_RECALCULATED = "ROUTE_RECALCULATED",
|
|
101
|
+
DEVIATION_CONFIRMED = "DEVIATION_CONFIRMED",
|
|
102
|
+
PROLONGED_STOP_DETECTED = "PROLONGED_STOP_DETECTED",
|
|
103
|
+
STOP_DEFERRED_FOR_TRAFFIC = "STOP_DEFERRED_FOR_TRAFFIC",
|
|
104
|
+
ETA_RECALCULATED = "ETA_RECALCULATED",
|
|
105
|
+
ETA_OVERDUE_DETECTED = "ETA_OVERDUE_DETECTED",
|
|
106
|
+
CRASH_REPORTED = "CRASH_REPORTED",
|
|
107
|
+
CRASH_REJECTED = "CRASH_REJECTED",
|
|
108
|
+
ARRIVAL_DETECTED = "ARRIVAL_DETECTED",
|
|
109
|
+
TRACKING_STALE = "TRACKING_STALE",
|
|
110
|
+
TRACKING_RESTORED = "TRACKING_RESTORED"
|
|
111
|
+
}
|
|
112
|
+
/** Is the session's live location actually live? Derived from lastLocationAt. */
|
|
113
|
+
export declare enum FollowMeTrackingHealth {
|
|
114
|
+
LIVE = "LIVE",
|
|
115
|
+
/** Nothing for a while - show "last seen N min ago", never "live". */
|
|
116
|
+
STALE = "STALE",
|
|
117
|
+
/** No location has arrived yet. */
|
|
118
|
+
NO_SIGNAL = "NO_SIGNAL"
|
|
119
|
+
}
|
|
120
|
+
/** Audit trail (follow_me_audit_events). Never carries a location or a token. */
|
|
121
|
+
export declare enum FollowMeAuditEventType {
|
|
122
|
+
CREATED = "CREATED",
|
|
123
|
+
ACTIVATED = "ACTIVATED",
|
|
124
|
+
TRACKING_STARTED = "TRACKING_STARTED",
|
|
125
|
+
TRACKING_UNAVAILABLE = "TRACKING_UNAVAILABLE",
|
|
126
|
+
WORKFLOW_STARTED = "WORKFLOW_STARTED",
|
|
127
|
+
WORKFLOW_START_FAILED = "WORKFLOW_START_FAILED",
|
|
128
|
+
CHAT_CREATED = "CHAT_CREATED",
|
|
129
|
+
GUARDIAN_INVITED = "GUARDIAN_INVITED",
|
|
130
|
+
GUARDIAN_ACCEPTED = "GUARDIAN_ACCEPTED",
|
|
131
|
+
GUARDIAN_DECLINED = "GUARDIAN_DECLINED",
|
|
132
|
+
GUARDIAN_STOPPED_FOLLOWING = "GUARDIAN_STOPPED_FOLLOWING",
|
|
133
|
+
EXTERNAL_LINK_ISSUED = "EXTERNAL_LINK_ISSUED",
|
|
134
|
+
EXTERNAL_LINK_USED = "EXTERNAL_LINK_USED",
|
|
135
|
+
ROUTE_RECALCULATED = "ROUTE_RECALCULATED",
|
|
136
|
+
PROMPT_STARTED = "PROMPT_STARTED",
|
|
137
|
+
PROMPT_CONFIRMED = "PROMPT_CONFIRMED",
|
|
138
|
+
PROMPT_EXPIRED = "PROMPT_EXPIRED",
|
|
139
|
+
PROMPT_CANCELLED = "PROMPT_CANCELLED",
|
|
140
|
+
SOS_TRIGGERED = "SOS_TRIGGERED",
|
|
141
|
+
SOS_INCIDENT_CREATED = "SOS_INCIDENT_CREATED",
|
|
142
|
+
SOS_INCIDENT_RETRY = "SOS_INCIDENT_RETRY",
|
|
143
|
+
SOS_FAILED = "SOS_FAILED",
|
|
144
|
+
ARRIVED = "ARRIVED",
|
|
145
|
+
STOPPED = "STOPPED",
|
|
146
|
+
EXPIRED = "EXPIRED",
|
|
147
|
+
CANCELLED = "CANCELLED"
|
|
148
|
+
}
|
|
149
|
+
/** Kafka event types (the `eventType` of FollowMeEvent), one topic each. */
|
|
150
|
+
export declare enum FollowMeEventType {
|
|
151
|
+
STARTED = "FOLLOW_ME_STARTED",
|
|
152
|
+
GUARDIAN_RESPONDED = "FOLLOW_ME_GUARDIAN_RESPONDED",
|
|
153
|
+
PROMPTING = "FOLLOW_ME_PROMPTING",
|
|
154
|
+
SOS_TRIGGERED = "FOLLOW_ME_SOS_TRIGGERED",
|
|
155
|
+
ENDED = "FOLLOW_ME_ENDED"
|
|
156
|
+
}
|
|
157
|
+
/** Socket.IO `safety.event` types for Follow Me (FollowMeRealtimeEnvelope.type). */
|
|
158
|
+
export declare enum FollowMeRealtimeEventType {
|
|
159
|
+
STARTED = "FOLLOW_ME_STARTED",
|
|
160
|
+
REQUEST = "FOLLOW_ME_REQUEST",
|
|
161
|
+
GUARDIAN_ACCEPTED = "FOLLOW_ME_GUARDIAN_ACCEPTED",
|
|
162
|
+
GUARDIAN_DECLINED = "FOLLOW_ME_GUARDIAN_DECLINED",
|
|
163
|
+
GUARDIAN_STOPPED_FOLLOWING = "FOLLOW_ME_GUARDIAN_STOPPED_FOLLOWING",
|
|
164
|
+
LOCATION_UPDATED = "FOLLOW_ME_LOCATION_UPDATED",
|
|
165
|
+
ROUTE_UPDATED = "FOLLOW_ME_ROUTE_UPDATED",
|
|
166
|
+
ETA_UPDATED = "FOLLOW_ME_ETA_UPDATED",
|
|
167
|
+
SAFETY_EVENT = "FOLLOW_ME_SAFETY_EVENT",
|
|
168
|
+
PROMPT_STARTED = "FOLLOW_ME_PROMPT_STARTED",
|
|
169
|
+
PROMPT_CONFIRMED = "FOLLOW_ME_PROMPT_CONFIRMED",
|
|
170
|
+
SOS_TRIGGERED = "FOLLOW_ME_SOS_TRIGGERED",
|
|
171
|
+
ARRIVED = "FOLLOW_ME_ARRIVED",
|
|
172
|
+
STOPPED = "FOLLOW_ME_STOPPED",
|
|
173
|
+
EXPIRED = "FOLLOW_ME_EXPIRED",
|
|
174
|
+
ENDED = "FOLLOW_ME_ENDED",
|
|
175
|
+
PROVIDER_UPDATED = "FOLLOW_ME_PROVIDER_UPDATED"
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Push `data.action` / `data.type` values for Follow Me (allow-listed by the
|
|
179
|
+
* app's notification_deep_link_coordinator.dart - changing one breaks installed
|
|
180
|
+
* apps).
|
|
181
|
+
*/
|
|
182
|
+
export declare enum FollowMePushAction {
|
|
183
|
+
/** To a guardian: somebody asked you to follow their journey. */
|
|
184
|
+
FOLLOW_ME_REQUEST = "FOLLOW_ME_REQUEST",
|
|
185
|
+
/** To the user: a guardian accepted or declined. */
|
|
186
|
+
FOLLOW_ME_GUARDIAN_RESPONDED = "FOLLOW_ME_GUARDIAN_RESPONDED",
|
|
187
|
+
/** To the user: confirm you are safe. */
|
|
188
|
+
FOLLOW_ME_PROMPT = "FOLLOW_ME_PROMPT",
|
|
189
|
+
/** To the user and followers: an SOS was raised from Follow Me. */
|
|
190
|
+
FOLLOW_ME_SOS_TRIGGERED = "FOLLOW_ME_SOS_TRIGGERED",
|
|
191
|
+
/** To followers (and the user when it ended without them): Follow Me ended. */
|
|
192
|
+
FOLLOW_ME_ENDED = "FOLLOW_ME_ENDED"
|
|
193
|
+
}
|
|
194
|
+
/** Machine-readable `code` on every Follow Me error. */
|
|
195
|
+
export declare enum FollowMeErrorCode {
|
|
196
|
+
NOT_FOUND = "FOLLOW_ME_NOT_FOUND",
|
|
197
|
+
ALREADY_ACTIVE = "FOLLOW_ME_ALREADY_ACTIVE",
|
|
198
|
+
ALREADY_ENDED = "FOLLOW_ME_ENDED",
|
|
199
|
+
SOS_ALREADY_TRIGGERED = "FOLLOW_ME_SOS_ALREADY_TRIGGERED",
|
|
200
|
+
INVALID_TRANSITION = "FOLLOW_ME_INVALID_TRANSITION",
|
|
201
|
+
INVALID_DURATION = "FOLLOW_ME_INVALID_DURATION",
|
|
202
|
+
ROUTE_EXCEEDS_MAX_DURATION = "FOLLOW_ME_ROUTE_EXCEEDS_MAX_DURATION",
|
|
203
|
+
ROUTE_INVALID = "FOLLOW_ME_ROUTE_INVALID",
|
|
204
|
+
ROUTE_EXPIRED = "FOLLOW_ME_ROUTE_EXPIRED",
|
|
205
|
+
ROUTING_UNAVAILABLE = "FOLLOW_ME_ROUTING_UNAVAILABLE",
|
|
206
|
+
INVALID_REASON = "FOLLOW_ME_INVALID_REASON",
|
|
207
|
+
CUSTOM_REASON_REQUIRED = "FOLLOW_ME_CUSTOM_REASON_REQUIRED",
|
|
208
|
+
GUARDIAN_NOT_FOUND = "FOLLOW_ME_GUARDIAN_NOT_FOUND",
|
|
209
|
+
GUARDIANS_UNAVAILABLE = "FOLLOW_ME_GUARDIANS_UNAVAILABLE",
|
|
210
|
+
NO_RECIPIENTS = "FOLLOW_ME_NO_RECIPIENTS",
|
|
211
|
+
SERVICE_PROVIDER_NOT_ENTITLED = "FOLLOW_ME_SERVICE_PROVIDER_NOT_ENTITLED",
|
|
212
|
+
PROMPT_NOT_ACTIVE = "FOLLOW_ME_PROMPT_NOT_ACTIVE",
|
|
213
|
+
TRACKING_CLOSED = "FOLLOW_ME_TRACKING_CLOSED",
|
|
214
|
+
NOT_A_PARTICIPANT = "FOLLOW_ME_NOT_A_PARTICIPANT",
|
|
215
|
+
ACCESS_EXPIRED = "FOLLOW_ME_ACCESS_EXPIRED",
|
|
216
|
+
LOCATION_NOT_SHARED = "FOLLOW_ME_LOCATION_NOT_SHARED",
|
|
217
|
+
RATE_LIMITED = "FOLLOW_ME_RATE_LIMITED"
|
|
218
|
+
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Why a safety feature raised an SOS. Shared by every safety feature (the name
|
|
3
|
+
* predates Follow Me).
|
|
4
|
+
*/
|
|
2
5
|
export declare enum SafetyCheckSosTrigger {
|
|
3
|
-
/**
|
|
6
|
+
/** Safety Check: the prompt countdown ran out without the user confirming they were safe. */
|
|
4
7
|
MISSED_CHECK_IN = "MISSED_CHECK_IN",
|
|
5
|
-
/** The user pressed SOS from
|
|
6
|
-
USER_REQUESTED = "USER_REQUESTED"
|
|
8
|
+
/** The user pressed SOS from a safety feature's screen. */
|
|
9
|
+
USER_REQUESTED = "USER_REQUESTED",
|
|
10
|
+
/** Follow Me: a safety prompt (crash, deviation, stop, overdue) went unanswered. */
|
|
11
|
+
MISSED_SAFETY_PROMPT = "MISSED_SAFETY_PROMPT"
|
|
7
12
|
}
|
|
8
13
|
/** Who caused a Safety Check transition - recorded on every audit entry. */
|
|
9
14
|
export declare enum SafetyCheckActorType {
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
export * from './enums/safety-check-status.enum';
|
|
2
2
|
export * from './enums/safety-enums';
|
|
3
3
|
export * from './enums/safety-error-code.enum';
|
|
4
|
+
export * from './enums/follow-me.enums';
|
|
4
5
|
export * from './constants/safety-check-limits.const';
|
|
5
6
|
export * from './constants/safety-taxonomy.const';
|
|
6
7
|
export * from './constants/safety-integration.const';
|
|
8
|
+
export * from './constants/follow-me.const';
|
|
7
9
|
export * from './interfaces/safety-check';
|
|
8
10
|
export * from './interfaces/safety-check-event';
|
|
11
|
+
export * from './interfaces/safety-alert-context';
|
|
12
|
+
export * from './interfaces/follow-me';
|
|
9
13
|
export * from './dtos/safety-check.dto';
|
|
10
14
|
export * from './dtos/safety-admin.dto';
|
|
11
15
|
export * from './dtos/safety-internal.dto';
|
|
16
|
+
export * from './dtos/safety-alert-context.dto';
|
|
17
|
+
export * from './dtos/follow-me.dto';
|
|
12
18
|
export * from './utils/safety-check-state-machine';
|
|
13
19
|
export * from './utils/safety-check-timing.util';
|
|
20
|
+
export * from './utils/follow-me-state-machine';
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import { GuardianAudience } from '../../alert-dispatch/interfaces/guardian-audience';
|
|
2
|
+
import { GisRoutingProvider } from '../../gis/enums/routing.enum';
|
|
3
|
+
import { TripPoint } from '../../gis/interfaces/trip-point';
|
|
4
|
+
import { FollowMeAuditEventType, FollowMeEventType, FollowMeParticipantKind, FollowMeParticipantStatus, FollowMePromptStatus, FollowMeRealtimeEventType, FollowMeRouteKind, FollowMeSafetyEventType, FollowMeSafetyTrigger, FollowMeStatus, FollowMeTrackingHealth, FollowMeTransportMode, FollowMeWaypointKind } from '../enums/follow-me.enums';
|
|
5
|
+
import { SafetyCheckSosTrigger } from '../enums/safety-enums';
|
|
6
|
+
import { SafetyCheckActorType } from '../enums/safety-enums';
|
|
7
|
+
import { SafetyCheckTripSummary } from './safety-check';
|
|
8
|
+
/**
|
|
9
|
+
* Coordinates and address are null wherever the viewer may not see location (the
|
|
10
|
+
* admin detail without track access) - the label alone says "Home" or "Work".
|
|
11
|
+
*/
|
|
12
|
+
export interface FollowMeWaypointView {
|
|
13
|
+
sequence: number;
|
|
14
|
+
kind: FollowMeWaypointKind;
|
|
15
|
+
label: string;
|
|
16
|
+
address: string | null;
|
|
17
|
+
lat: number | null;
|
|
18
|
+
lng: number | null;
|
|
19
|
+
savedPlaceId: string | null;
|
|
20
|
+
}
|
|
21
|
+
/** A computed route as the session stores it. */
|
|
22
|
+
export interface FollowMeRouteView {
|
|
23
|
+
id: string;
|
|
24
|
+
kind: FollowMeRouteKind;
|
|
25
|
+
provider: GisRoutingProvider;
|
|
26
|
+
transportMode: FollowMeTransportMode;
|
|
27
|
+
/** Null wherever the viewer may not see location. */
|
|
28
|
+
polyline: string | null;
|
|
29
|
+
distanceMeters: number;
|
|
30
|
+
durationSeconds: number;
|
|
31
|
+
staticDurationSeconds: number;
|
|
32
|
+
computedAt: string;
|
|
33
|
+
/** Why it was recalculated (deviation, ETA check...). Null for the original plan. */
|
|
34
|
+
reason: string | null;
|
|
35
|
+
warnings: string[];
|
|
36
|
+
}
|
|
37
|
+
/** The answer to a route preview; start references it by `routeToken`. */
|
|
38
|
+
export interface FollowMeRoutePreview {
|
|
39
|
+
routeToken: string;
|
|
40
|
+
expiresAt: string;
|
|
41
|
+
transportMode: FollowMeTransportMode;
|
|
42
|
+
waypoints: FollowMeWaypointView[];
|
|
43
|
+
provider: GisRoutingProvider;
|
|
44
|
+
polyline: string;
|
|
45
|
+
distanceMeters: number;
|
|
46
|
+
durationSeconds: number;
|
|
47
|
+
staticDurationSeconds: number;
|
|
48
|
+
etaAt: string;
|
|
49
|
+
/** The journey would outlast Follow Me's 24 h maximum. */
|
|
50
|
+
exceedsMaxDuration: boolean;
|
|
51
|
+
/** What the setup screen should pre-select (travel time plus a buffer, capped at 24 h). */
|
|
52
|
+
suggestedDurationMinutes: number;
|
|
53
|
+
warnings: string[];
|
|
54
|
+
}
|
|
55
|
+
export interface FollowMePromptView {
|
|
56
|
+
id: string;
|
|
57
|
+
trigger: FollowMeSafetyTrigger;
|
|
58
|
+
status: FollowMePromptStatus;
|
|
59
|
+
startedAt: string;
|
|
60
|
+
/** When the visible countdown ends. */
|
|
61
|
+
deadlineAt: string;
|
|
62
|
+
countdownSeconds: number;
|
|
63
|
+
respondedAt: string | null;
|
|
64
|
+
/** What the prompt screen says caused it, in plain words. */
|
|
65
|
+
message: string;
|
|
66
|
+
}
|
|
67
|
+
/** A participant as the SESSION OWNER sees them. */
|
|
68
|
+
export interface FollowMeParticipantView {
|
|
69
|
+
id: string;
|
|
70
|
+
kind: FollowMeParticipantKind;
|
|
71
|
+
status: FollowMeParticipantStatus;
|
|
72
|
+
guardianUserId: number | null;
|
|
73
|
+
displayName: string;
|
|
74
|
+
/** External guardians only, masked (+2547******78). */
|
|
75
|
+
maskedPhoneNumber: string | null;
|
|
76
|
+
invitedAt: string;
|
|
77
|
+
respondedAt: string | null;
|
|
78
|
+
/** Looked at the journey in the last minute. */
|
|
79
|
+
watchingNow: boolean;
|
|
80
|
+
}
|
|
81
|
+
/** The session as its OWNER sees it. Timestamps are server time; use serverTime for skew. */
|
|
82
|
+
export interface FollowMeSessionView {
|
|
83
|
+
id: string;
|
|
84
|
+
status: FollowMeStatus;
|
|
85
|
+
reasonId: string | null;
|
|
86
|
+
reasonCode: string | null;
|
|
87
|
+
reasonLabel: string;
|
|
88
|
+
customReason: string | null;
|
|
89
|
+
durationMinutes: number;
|
|
90
|
+
startedAt: string;
|
|
91
|
+
plannedEndAt: string;
|
|
92
|
+
endedAt: string | null;
|
|
93
|
+
arrivedAt: string | null;
|
|
94
|
+
promptCountdownSeconds: number;
|
|
95
|
+
notifyGuardiansOnStartEnd: boolean;
|
|
96
|
+
notifyServiceProviderRequested: boolean;
|
|
97
|
+
notifyServiceProviderAllowed: boolean;
|
|
98
|
+
transportMode: FollowMeTransportMode | null;
|
|
99
|
+
waypoints: FollowMeWaypointView[];
|
|
100
|
+
/** The route being monitored (the latest recalculation, else the plan). */
|
|
101
|
+
currentRoute: FollowMeRouteView | null;
|
|
102
|
+
/** Live estimate; null without a destination. */
|
|
103
|
+
etaAt: string | null;
|
|
104
|
+
distanceRemainingMeters: number | null;
|
|
105
|
+
trackingHealth: FollowMeTrackingHealth;
|
|
106
|
+
lastLocationAt: string | null;
|
|
107
|
+
crashDetectionEnabled: boolean;
|
|
108
|
+
activePrompt: FollowMePromptView | null;
|
|
109
|
+
participants: FollowMeParticipantView[];
|
|
110
|
+
sosTrigger: SafetyCheckSosTrigger | null;
|
|
111
|
+
sosCause: FollowMeSafetyTrigger | null;
|
|
112
|
+
sosTriggeredAt: string | null;
|
|
113
|
+
incidentId: number | null;
|
|
114
|
+
tripId: string | null;
|
|
115
|
+
conversationId: string | null;
|
|
116
|
+
serverTime: string;
|
|
117
|
+
}
|
|
118
|
+
export interface FollowMeCurrentResponse {
|
|
119
|
+
session: FollowMeSessionView | null;
|
|
120
|
+
serverTime: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The journey as a FOLLOWER sees it - an app guardian, an external guardian on the
|
|
124
|
+
* web page, or provider staff. Never includes guardians' contact details.
|
|
125
|
+
*/
|
|
126
|
+
export interface FollowMeFollowerView {
|
|
127
|
+
sessionId: string;
|
|
128
|
+
status: FollowMeStatus;
|
|
129
|
+
owner: {
|
|
130
|
+
firstName: string;
|
|
131
|
+
userId: number | null;
|
|
132
|
+
};
|
|
133
|
+
reasonLabel: string;
|
|
134
|
+
startedAt: string;
|
|
135
|
+
plannedEndAt: string;
|
|
136
|
+
endedAt: string | null;
|
|
137
|
+
arrivedAt: string | null;
|
|
138
|
+
transportMode: FollowMeTransportMode | null;
|
|
139
|
+
waypoints: FollowMeWaypointView[];
|
|
140
|
+
currentRoute: Pick<FollowMeRouteView, 'polyline' | 'distanceMeters' | 'durationSeconds' | 'provider'> | null;
|
|
141
|
+
etaAt: string | null;
|
|
142
|
+
distanceRemainingMeters: number | null;
|
|
143
|
+
trackingHealth: FollowMeTrackingHealth;
|
|
144
|
+
/** Null once live access has ended, and for a caller who has not accepted. */
|
|
145
|
+
latestLocation: TripPoint | null;
|
|
146
|
+
/** Recent path (oldest first) since the `since` the caller sent; empty without live access. */
|
|
147
|
+
path: TripPoint[];
|
|
148
|
+
/** Pass as `since` next time. */
|
|
149
|
+
pathCursor: string | null;
|
|
150
|
+
/** Other followers: names and states for app guardians, a count on the web page. */
|
|
151
|
+
otherFollowers: {
|
|
152
|
+
displayName: string;
|
|
153
|
+
status: FollowMeParticipantStatus;
|
|
154
|
+
}[] | {
|
|
155
|
+
count: number;
|
|
156
|
+
};
|
|
157
|
+
providerParticipating: boolean;
|
|
158
|
+
activePromptTrigger: FollowMeSafetyTrigger | null;
|
|
159
|
+
incidentId: number | null;
|
|
160
|
+
myParticipation: {
|
|
161
|
+
participantId: string;
|
|
162
|
+
status: FollowMeParticipantStatus;
|
|
163
|
+
} | null;
|
|
164
|
+
/** App guardians who accepted: the session chat. */
|
|
165
|
+
conversationId: string | null;
|
|
166
|
+
serverTime: string;
|
|
167
|
+
}
|
|
168
|
+
/** Pending requests for an app guardian (checked after sign-in, not only on a push). */
|
|
169
|
+
export interface FollowMeRequestSummary {
|
|
170
|
+
sessionId: string;
|
|
171
|
+
participantId: string;
|
|
172
|
+
ownerFirstName: string;
|
|
173
|
+
reasonLabel: string;
|
|
174
|
+
status: FollowMeParticipantStatus;
|
|
175
|
+
invitedAt: string;
|
|
176
|
+
plannedEndAt: string;
|
|
177
|
+
}
|
|
178
|
+
/** What the setup screens need, so client and server agree. */
|
|
179
|
+
export interface FollowMeStartOptions {
|
|
180
|
+
limits: {
|
|
181
|
+
minDurationMinutes: number;
|
|
182
|
+
maxDurationMinutes: number;
|
|
183
|
+
minPromptCountdownSeconds: number;
|
|
184
|
+
maxPromptCountdownSeconds: number;
|
|
185
|
+
maxIntermediateStops: number;
|
|
186
|
+
customReasonMaxLength: number;
|
|
187
|
+
};
|
|
188
|
+
defaults: {
|
|
189
|
+
durationMinutes: number;
|
|
190
|
+
promptCountdownSeconds: number;
|
|
191
|
+
notifyServiceProvider: boolean;
|
|
192
|
+
notifyGuardiansOnStartEnd: boolean;
|
|
193
|
+
transportMode: FollowMeTransportMode;
|
|
194
|
+
};
|
|
195
|
+
tracking: {
|
|
196
|
+
locationIntervalSeconds: number;
|
|
197
|
+
distanceFilterMeters: number;
|
|
198
|
+
uploadIntervalSeconds: number;
|
|
199
|
+
};
|
|
200
|
+
crashDetection: Record<string, number | string | boolean> & {
|
|
201
|
+
enabledTransportModes: FollowMeTransportMode[];
|
|
202
|
+
};
|
|
203
|
+
serviceProvider: {
|
|
204
|
+
available: boolean;
|
|
205
|
+
tier: string | null;
|
|
206
|
+
degraded: boolean;
|
|
207
|
+
};
|
|
208
|
+
serverTime: string;
|
|
209
|
+
}
|
|
210
|
+
export interface FollowMeSafetyEventView {
|
|
211
|
+
id: string;
|
|
212
|
+
type: FollowMeSafetyEventType;
|
|
213
|
+
occurredAt: string;
|
|
214
|
+
promptId: string | null;
|
|
215
|
+
/** Metrics (distances, durations, confidence). Coordinates only for viewers allowed location. */
|
|
216
|
+
evidence: Record<string, unknown> | null;
|
|
217
|
+
}
|
|
218
|
+
export interface FollowMeAuditEntry {
|
|
219
|
+
id: string;
|
|
220
|
+
eventType: FollowMeAuditEventType;
|
|
221
|
+
fromStatus: FollowMeStatus | null;
|
|
222
|
+
toStatus: FollowMeStatus | null;
|
|
223
|
+
actorType: SafetyCheckActorType;
|
|
224
|
+
actorUserId: number | null;
|
|
225
|
+
metadata: Record<string, unknown> | null;
|
|
226
|
+
createdAt: string;
|
|
227
|
+
}
|
|
228
|
+
export interface FollowMeAdminListItem {
|
|
229
|
+
id: string;
|
|
230
|
+
status: FollowMeStatus;
|
|
231
|
+
userId: number;
|
|
232
|
+
userName: string | null;
|
|
233
|
+
organizationId: number;
|
|
234
|
+
controlCentreId: number | null;
|
|
235
|
+
reasonLabel: string;
|
|
236
|
+
durationMinutes: number;
|
|
237
|
+
startedAt: string;
|
|
238
|
+
plannedEndAt: string;
|
|
239
|
+
endedAt: string | null;
|
|
240
|
+
destinationLabel: string | null;
|
|
241
|
+
transportMode: FollowMeTransportMode | null;
|
|
242
|
+
providerParticipation: boolean;
|
|
243
|
+
sosTriggeredAt: string | null;
|
|
244
|
+
incidentId: number | null;
|
|
245
|
+
createdAt: string;
|
|
246
|
+
}
|
|
247
|
+
export interface FollowMeAdminDetail {
|
|
248
|
+
session: FollowMeSessionView & {
|
|
249
|
+
userId: number;
|
|
250
|
+
userName: string | null;
|
|
251
|
+
userPhoneNumber: string | null;
|
|
252
|
+
organizationId: number;
|
|
253
|
+
controlCentreId: number | null;
|
|
254
|
+
appId: string | null;
|
|
255
|
+
countryCode: string | null;
|
|
256
|
+
entitlementTierAtStart: string | null;
|
|
257
|
+
workflowId: string | null;
|
|
258
|
+
workflowStartedAt: string | null;
|
|
259
|
+
trackPointCount: number;
|
|
260
|
+
sosAttempts: number;
|
|
261
|
+
sosFailureReason: string | null;
|
|
262
|
+
createdAt: string;
|
|
263
|
+
updatedAt: string;
|
|
264
|
+
};
|
|
265
|
+
routes: FollowMeRouteView[];
|
|
266
|
+
prompts: FollowMePromptView[];
|
|
267
|
+
safetyEvents: FollowMeSafetyEventView[];
|
|
268
|
+
audit: FollowMeAuditEntry[];
|
|
269
|
+
trip: SafetyCheckTripSummary | null;
|
|
270
|
+
/**
|
|
271
|
+
* Whether this viewer may see where the user was: the session was shared with
|
|
272
|
+
* the provider or became an SOS, AND the gateway vouched for track:follow-me
|
|
273
|
+
* (SAFETY_LOCATION_ACCESS_HEADER). When false every coordinate, address and
|
|
274
|
+
* polyline in this response is null and GET .../tracking answers 403.
|
|
275
|
+
*/
|
|
276
|
+
locationAccess: boolean;
|
|
277
|
+
}
|
|
278
|
+
/** GET /safety/admin/follow-me/:id/tracking - track:follow-me, provider-shared or SOS sessions only. */
|
|
279
|
+
export interface FollowMeAdminTracking {
|
|
280
|
+
sessionId: string;
|
|
281
|
+
status: FollowMeStatus;
|
|
282
|
+
waypoints: FollowMeWaypointView[];
|
|
283
|
+
routes: FollowMeRouteView[];
|
|
284
|
+
latestLocation: TripPoint | null;
|
|
285
|
+
/** Oldest first, after `since`; page with pathCursor. */
|
|
286
|
+
path: TripPoint[];
|
|
287
|
+
pathCursor: string | null;
|
|
288
|
+
/** Safety events with the coordinates they were observed at. */
|
|
289
|
+
safetyEvents: FollowMeSafetyEventView[];
|
|
290
|
+
trackingHealth: FollowMeTrackingHealth;
|
|
291
|
+
serverTime: string;
|
|
292
|
+
}
|
|
293
|
+
/** One active session on the staff live map (provider-shared, in the viewer's scope). */
|
|
294
|
+
export interface FollowMeLiveSession {
|
|
295
|
+
sessionId: string;
|
|
296
|
+
status: FollowMeStatus;
|
|
297
|
+
userId: number;
|
|
298
|
+
userName: string | null;
|
|
299
|
+
organizationId: number;
|
|
300
|
+
controlCentreId: number | null;
|
|
301
|
+
reasonLabel: string;
|
|
302
|
+
transportMode: FollowMeTransportMode | null;
|
|
303
|
+
destinationLabel: string | null;
|
|
304
|
+
etaAt: string | null;
|
|
305
|
+
trackingHealth: FollowMeTrackingHealth;
|
|
306
|
+
latestLocation: TripPoint | null;
|
|
307
|
+
activePromptTrigger: FollowMeSafetyTrigger | null;
|
|
308
|
+
startedAt: string;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Kafka payload of every KAFKA_TOPICS.FOLLOW_ME_* topic (outbox, at-least-once,
|
|
312
|
+
* keyed by session id). NO location and NO access token - an external guardian's
|
|
313
|
+
* link is minted by clarion-notification at send time through the internal
|
|
314
|
+
* access-link route.
|
|
315
|
+
*/
|
|
316
|
+
export interface FollowMeEvent {
|
|
317
|
+
eventId: string;
|
|
318
|
+
eventType: FollowMeEventType;
|
|
319
|
+
version: 1;
|
|
320
|
+
occurredAt: string;
|
|
321
|
+
correlationId: string | null;
|
|
322
|
+
sessionId: string;
|
|
323
|
+
userId: number;
|
|
324
|
+
organizationId: number;
|
|
325
|
+
controlCentreId: number | null;
|
|
326
|
+
appId: string | null;
|
|
327
|
+
countryCode: string | null;
|
|
328
|
+
status: FollowMeStatus;
|
|
329
|
+
reasonLabel: string;
|
|
330
|
+
startedAt: string;
|
|
331
|
+
plannedEndAt: string;
|
|
332
|
+
endedAt: string | null;
|
|
333
|
+
destinationLabel: string | null;
|
|
334
|
+
etaAt: string | null;
|
|
335
|
+
notifyGuardiansOnStartEnd: boolean;
|
|
336
|
+
providerParticipation: boolean;
|
|
337
|
+
guardianAudience: GuardianAudience;
|
|
338
|
+
/** Everyone asked to follow, for invitations and endings. */
|
|
339
|
+
participants: {
|
|
340
|
+
participantId: string;
|
|
341
|
+
kind: FollowMeParticipantKind;
|
|
342
|
+
status: FollowMeParticipantStatus;
|
|
343
|
+
guardianUserId: number | null;
|
|
344
|
+
/** External guardians only (E.164), for the SMS. */
|
|
345
|
+
phoneNumber: string | null;
|
|
346
|
+
displayName: string;
|
|
347
|
+
}[];
|
|
348
|
+
/** GUARDIAN_RESPONDED: who answered, and how. */
|
|
349
|
+
respondingParticipantId: string | null;
|
|
350
|
+
promptId: string | null;
|
|
351
|
+
promptTrigger: FollowMeSafetyTrigger | null;
|
|
352
|
+
promptDeadlineAt: string | null;
|
|
353
|
+
sosTrigger: SafetyCheckSosTrigger | null;
|
|
354
|
+
sosCause: FollowMeSafetyTrigger | null;
|
|
355
|
+
incidentId: number | null;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* What clarion-safety publishes on SAFETY_REALTIME_CHANNEL. `rooms` is decided by
|
|
359
|
+
* clarion-safety from the session's CURRENT audience each time, so a guardian who
|
|
360
|
+
* stops following or a session that ends stops receiving at once. clarion-socket
|
|
361
|
+
* validates the rooms and emits SAFETY_SOCKET_EVENT with the envelope minus rooms.
|
|
362
|
+
*/
|
|
363
|
+
export interface FollowMeRealtimeEnvelope {
|
|
364
|
+
eventId: string;
|
|
365
|
+
feature: 'FOLLOW_ME';
|
|
366
|
+
type: FollowMeRealtimeEventType;
|
|
367
|
+
sessionId: string;
|
|
368
|
+
organizationId: number;
|
|
369
|
+
occurredAt: string;
|
|
370
|
+
rooms: string[];
|
|
371
|
+
payload: Record<string, unknown>;
|
|
372
|
+
}
|
|
373
|
+
/** The internal access-link answer (clarion-safety -> clarion-notification only). */
|
|
374
|
+
export interface FollowMeExternalLink {
|
|
375
|
+
url: string;
|
|
376
|
+
expiresAt: string;
|
|
377
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GuardianAudience } from '../../alert-dispatch/interfaces/guardian-audience';
|
|
2
2
|
import { SafetyCheckStatus } from '../enums/safety-check-status.enum';
|
|
3
|
-
import { SafetyCheckActorType, SafetyCheckAuditEventType, SafetyCheckSosTrigger } from '../enums/safety-enums';
|
|
3
|
+
import { SafetyCheckActorType, SafetyCheckAuditEventType, SafetyCheckSosTrigger, SafetyFeature } from '../enums/safety-enums';
|
|
4
4
|
/** A reason as the app's dropdown shows it. */
|
|
5
5
|
export interface SafetyCheckReasonView {
|
|
6
6
|
id: string;
|
|
@@ -10,6 +10,8 @@ export interface SafetyCheckReasonView {
|
|
|
10
10
|
/** The "Write my own" entry: the user types the reason. */
|
|
11
11
|
isCustom: boolean;
|
|
12
12
|
displayOrder: number;
|
|
13
|
+
/** Which feature offers it (absent from services older than Follow Me = SAFETY_CHECK). */
|
|
14
|
+
feature?: SafetyFeature;
|
|
13
15
|
}
|
|
14
16
|
/** A reason as the admin manages it. */
|
|
15
17
|
export interface SafetyCheckReasonAdminView extends SafetyCheckReasonView {
|