clarion-shared-types 1.0.107 → 1.0.108
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/modules/permission/enums/permission-actions.enum.js +2 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/safety/index.js +1 -0
- package/dist/cjs/modules/safety/index.js.map +1 -1
- package/dist/cjs/modules/safety/interfaces/safety-analytics.js +12 -0
- package/dist/cjs/modules/safety/interfaces/safety-analytics.js.map +1 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +2 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/safety/index.js +1 -0
- package/dist/esm/modules/safety/index.js.map +1 -1
- package/dist/esm/modules/safety/interfaces/safety-analytics.js +11 -0
- package/dist/esm/modules/safety/interfaces/safety-analytics.js.map +1 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +1 -0
- package/dist/types/modules/safety/index.d.ts +1 -0
- package/dist/types/modules/safety/interfaces/safety-analytics.d.ts +360 -0
- package/package.json +45 -45
|
@@ -229,6 +229,8 @@ var PermissionActions;
|
|
|
229
229
|
PermissionActions["USE_SAFETY_CHECK"] = "use:safety-check";
|
|
230
230
|
PermissionActions["READ_SAFETY_CHECK"] = "read:safety-check";
|
|
231
231
|
PermissionActions["MANAGE_SAFETY_CHECK_REASON"] = "manage:safety-check-reason";
|
|
232
|
+
// Safety Analytics: how Safety Check and Follow Me are used - counts only.
|
|
233
|
+
PermissionActions["READ_SAFETY_ANALYTICS"] = "read:safety-analytics";
|
|
232
234
|
// Follow Me: use = run and follow journeys in the app; read = staff see sessions
|
|
233
235
|
// (no location); track = staff see WHERE, only for sessions shared with the
|
|
234
236
|
// provider or turned SOS (clarion-safety enforces that condition).
|
|
@@ -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,iBAgRX;AAhRD,WAAY,iBAAiB;IACzB,uBAAuB;IACvB,gEAA2C,CAAA;IAC3C,4DAAuC,CAAA;IACvC,gEAA2C,CAAA;IAC3C,gEAA2C,CAAA;IAE3C,kBAAkB;IAClB,sDAAiC,CAAA;IACjC,kDAA6B,CAAA;IAC7B,sDAAiC,CAAA;IACjC,sDAAiC,CAAA;IACjC,wEAAwE;IACxE,mEAAmE;IACnE,oEAA+C,CAAA;IAC/C,0EAAqD,CAAA;IACrD,wEAAmD,CAAA;IACnD,wEAAmD,CAAA;IACnD,wEAAmD,CAAA;IACnD,2EAA2E;IAC3E,4EAA4E;IAC5E,qEAAqE;IACrE,uDAAuD;IACvD,wEAAmD,CAAA;IACnD,4EAAuD,CAAA;IAEvD,wBAAwB;IACxB,oEAA+C,CAAA;IAC/C,gEAA2C,CAAA;IAC3C,oEAA+C,CAAA;IAC/C,oEAA+C,CAAA;IAE/C,eAAe;IACf,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAE3B,eAAe;IACf,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAE3B,mBAAmB;IACnB,wDAAmC,CAAA;IACnC,oDAA+B,CAAA;IAC/B,wDAAmC,CAAA;IACnC,wDAAmC,CAAA;IACnC,oFAA+D,CAAA;IAC/D,gFAA2D,CAAA;IAC3D,oFAA+D,CAAA;IAC/D,oFAA+D,CAAA;IAE/D,uBAAuB;IACvB,kEAA6C,CAAA;IAC7C,8DAAyC,CAAA;IACzC,kEAA6C,CAAA;IAC7C,kEAA6C,CAAA;IAE7C,4EAA4E;IAC5E,wEAAwE;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portStar(require("./interfaces/safety-check.dto"), exports);
|
|
26
26
|
__exportStar(require("./interfaces/safety-alert-context"), exports);
|
|
27
27
|
__exportStar(require("./interfaces/follow-me.dto"), exports);
|
|
28
|
+
__exportStar(require("./interfaces/safety-analytics"), exports);
|
|
28
29
|
// Utilities
|
|
29
30
|
__exportStar(require("./utils/safety-display.util"), exports);
|
|
30
31
|
__exportStar(require("./utils/follow-me-display.util"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/safety/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,uDAAqC;AACrC,0DAAwC;AAExC,YAAY;AACZ,wEAAsD;AACtD,oEAAkD;AAClD,8DAA4C;AAE5C,oBAAoB;AACpB,gEAA8C;AAC9C,oEAAkD;AAClD,6DAA2C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/safety/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,uDAAqC;AACrC,0DAAwC;AAExC,YAAY;AACZ,wEAAsD;AACtD,oEAAkD;AAClD,8DAA4C;AAE5C,oBAAoB;AACpB,gEAA8C;AAC9C,oEAAkD;AAClD,6DAA2C;AAC3C,gEAA8C;AAE9C,YAAY;AACZ,8DAA4C;AAC5C,iEAA+C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Safety analytics: how Safety Check and Follow Me were used over a period, by whom
|
|
4
|
+
* and how often, how they ended, what the monitoring caught and how the guardians
|
|
5
|
+
* followed. One read, computed by clarion-safety from one consistent snapshot, so
|
|
6
|
+
* every number on a dashboard agrees with every other.
|
|
7
|
+
*
|
|
8
|
+
* Counts only: never a location, a destination, a phone number, a name or a reason a
|
|
9
|
+
* user typed. A check or journey is counted by when it started, as it stands now.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
//# sourceMappingURL=safety-analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety-analytics.js","sourceRoot":"","sources":["../../../../../src/modules/safety/interfaces/safety-analytics.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG"}
|
|
@@ -226,6 +226,8 @@ export var PermissionActions;
|
|
|
226
226
|
PermissionActions["USE_SAFETY_CHECK"] = "use:safety-check";
|
|
227
227
|
PermissionActions["READ_SAFETY_CHECK"] = "read:safety-check";
|
|
228
228
|
PermissionActions["MANAGE_SAFETY_CHECK_REASON"] = "manage:safety-check-reason";
|
|
229
|
+
// Safety Analytics: how Safety Check and Follow Me are used - counts only.
|
|
230
|
+
PermissionActions["READ_SAFETY_ANALYTICS"] = "read:safety-analytics";
|
|
229
231
|
// Follow Me: use = run and follow journeys in the app; read = staff see sessions
|
|
230
232
|
// (no location); track = staff see WHERE, only for sessions shared with the
|
|
231
233
|
// provider or turned SOS (clarion-safety enforces that condition).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAgRX;AAhRD,WAAY,iBAAiB;IACzB,uBAAuB;IACvB,gEAA2C,CAAA;IAC3C,4DAAuC,CAAA;IACvC,gEAA2C,CAAA;IAC3C,gEAA2C,CAAA;IAE3C,kBAAkB;IAClB,sDAAiC,CAAA;IACjC,kDAA6B,CAAA;IAC7B,sDAAiC,CAAA;IACjC,sDAAiC,CAAA;IACjC,wEAAwE;IACxE,mEAAmE;IACnE,oEAA+C,CAAA;IAC/C,0EAAqD,CAAA;IACrD,wEAAmD,CAAA;IACnD,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IAC5D,sFAAiE,CAAA;IACjE,kFAA6D,CAAA;IAC7D,sFAAiE,CAAA;IACjE,sFAAiE,CAAA;IACjE,kFAA6D,CAAA;IAC7D,4EAAuD,CAAA;IACvD,8EAAyD,CAAA;IACzD,8FAAyE,CAAA;IACzE,kGAA6E,CAAA;IAC7E,gFAA2D,CAAA;IAC3D,gFAAgF;IAChF,sFAAsF;IACtF,kFAA6D,CAAA;IAE7D,gFAAgF;IAChF,0EAA0E;IAC1E,gDAAgD;IAChD,0DAAqC,CAAA;IACrC,4DAAuC,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,4DAA4D;IAC5D,8DAAyC,CAAA;IACzC,wGAAwG;IACxG,4DAAuC,CAAA;IACvC,wGAAwG;IACxG,gEAA2C,CAAA;AAC/C,CAAC,EAhRW,iBAAiB,KAAjB,iBAAiB,QAgR5B"}
|
|
@@ -9,6 +9,7 @@ export * from './constants/follow-me.const';
|
|
|
9
9
|
export * from './interfaces/safety-check.dto';
|
|
10
10
|
export * from './interfaces/safety-alert-context';
|
|
11
11
|
export * from './interfaces/follow-me.dto';
|
|
12
|
+
export * from './interfaces/safety-analytics';
|
|
12
13
|
// Utilities
|
|
13
14
|
export * from './utils/safety-display.util';
|
|
14
15
|
export * from './utils/follow-me-display.util';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/safety/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AAExC,YAAY;AACZ,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAE5C,oBAAoB;AACpB,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/safety/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AAExC,YAAY;AACZ,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAE5C,oBAAoB;AACpB,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAE9C,YAAY;AACZ,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safety analytics: how Safety Check and Follow Me were used over a period, by whom
|
|
3
|
+
* and how often, how they ended, what the monitoring caught and how the guardians
|
|
4
|
+
* followed. One read, computed by clarion-safety from one consistent snapshot, so
|
|
5
|
+
* every number on a dashboard agrees with every other.
|
|
6
|
+
*
|
|
7
|
+
* Counts only: never a location, a destination, a phone number, a name or a reason a
|
|
8
|
+
* user typed. A check or journey is counted by when it started, as it stands now.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=safety-analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety-analytics.js","sourceRoot":"","sources":["../../../../../src/modules/safety/interfaces/safety-analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -178,6 +178,7 @@ export declare enum PermissionActions {
|
|
|
178
178
|
USE_SAFETY_CHECK = "use:safety-check",
|
|
179
179
|
READ_SAFETY_CHECK = "read:safety-check",
|
|
180
180
|
MANAGE_SAFETY_CHECK_REASON = "manage:safety-check-reason",
|
|
181
|
+
READ_SAFETY_ANALYTICS = "read:safety-analytics",
|
|
181
182
|
USE_FOLLOW_ME = "use:follow-me",
|
|
182
183
|
READ_FOLLOW_ME = "read:follow-me",
|
|
183
184
|
TRACK_FOLLOW_ME = "track:follow-me",
|
|
@@ -6,5 +6,6 @@ export * from './constants/follow-me.const';
|
|
|
6
6
|
export * from './interfaces/safety-check.dto';
|
|
7
7
|
export * from './interfaces/safety-alert-context';
|
|
8
8
|
export * from './interfaces/follow-me.dto';
|
|
9
|
+
export * from './interfaces/safety-analytics';
|
|
9
10
|
export * from './utils/safety-display.util';
|
|
10
11
|
export * from './utils/follow-me-display.util';
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safety analytics: how Safety Check and Follow Me were used over a period, by whom
|
|
3
|
+
* and how often, how they ended, what the monitoring caught and how the guardians
|
|
4
|
+
* followed. One read, computed by clarion-safety from one consistent snapshot, so
|
|
5
|
+
* every number on a dashboard agrees with every other.
|
|
6
|
+
*
|
|
7
|
+
* Counts only: never a location, a destination, a phone number, a name or a reason a
|
|
8
|
+
* user typed. A check or journey is counted by when it started, as it stands now.
|
|
9
|
+
*/
|
|
10
|
+
/** How the period is cut into points for the charts. Chosen by the service from the length of the period. */
|
|
11
|
+
export type SafetyAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
|
|
12
|
+
export interface SafetyAnalyticsRange {
|
|
13
|
+
/** Inclusive, ISO 8601. The first check or journey when the period asked for was "forever". */
|
|
14
|
+
from: string;
|
|
15
|
+
/** Exclusive, ISO 8601. */
|
|
16
|
+
to: string;
|
|
17
|
+
bucket: SafetyAnalyticsBucket;
|
|
18
|
+
/** IANA time zone the buckets, the days and the hour-of-week grid are cut in. */
|
|
19
|
+
timeZone: string;
|
|
20
|
+
}
|
|
21
|
+
/** A count by a key (a status, a trigger, a band), largest first unless the section says otherwise. */
|
|
22
|
+
export interface SafetyAnalyticsCount<K extends string = string> {
|
|
23
|
+
key: K;
|
|
24
|
+
count: number;
|
|
25
|
+
}
|
|
26
|
+
/** How many sessions a user started in the period, banded. */
|
|
27
|
+
export type SafetyAnalyticsFrequencyBand = '1' | '2-3' | '4-9' | '10+';
|
|
28
|
+
export interface SafetyAnalyticsFrequencyRow {
|
|
29
|
+
band: SafetyAnalyticsFrequencyBand;
|
|
30
|
+
/** Users who started that many Safety Checks. */
|
|
31
|
+
safetyCheck: number;
|
|
32
|
+
/** Users who started that many Follow Me journeys. */
|
|
33
|
+
followMe: number;
|
|
34
|
+
/** Users who started that many of either, together. */
|
|
35
|
+
any: number;
|
|
36
|
+
}
|
|
37
|
+
export interface SafetyAnalyticsUsagePoint {
|
|
38
|
+
/** The bucket's start, local to the range's time zone, without an offset ("2026-09-21T14:00:00"). */
|
|
39
|
+
bucket: string;
|
|
40
|
+
/** Distinct users who started either feature in the bucket. */
|
|
41
|
+
activeUsers: number;
|
|
42
|
+
safetyCheckUsers: number;
|
|
43
|
+
followMeUsers: number;
|
|
44
|
+
/** Users whose very first check or journey started in the bucket. */
|
|
45
|
+
newUsers: number;
|
|
46
|
+
safetyChecks: number;
|
|
47
|
+
followMeJourneys: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Who uses the safety features, and how often. A user is "active" in a period when
|
|
51
|
+
* they started a Safety Check or a Follow Me journey in it.
|
|
52
|
+
*/
|
|
53
|
+
export interface SafetyAnalyticsUsage {
|
|
54
|
+
activeUsers: number;
|
|
55
|
+
safetyCheckUsers: number;
|
|
56
|
+
followMeUsers: number;
|
|
57
|
+
/** Used both features in the period. */
|
|
58
|
+
bothFeatures: number;
|
|
59
|
+
/** Active users whose first-ever check or journey (in this scope) started in the period. */
|
|
60
|
+
newUsers: number;
|
|
61
|
+
/** Active users who had used a safety feature before the period. */
|
|
62
|
+
returningUsers: number;
|
|
63
|
+
/** Active in the previous period of the same length AND in this one; null for "forever". */
|
|
64
|
+
retainedUsers: number | null;
|
|
65
|
+
/** Safety Checks + Follow Me journeys started. */
|
|
66
|
+
sessions: number;
|
|
67
|
+
/** Sessions per active user; null with no active user. */
|
|
68
|
+
sessionsPerUser: number | null;
|
|
69
|
+
/** Active users who started two or more sessions. */
|
|
70
|
+
repeatUsers: number;
|
|
71
|
+
/** Average number of distinct local days an active user used a feature on. */
|
|
72
|
+
averageActiveDays: number | null;
|
|
73
|
+
/** Distinct users per local day, averaged over every day of the period. */
|
|
74
|
+
averageDailyActiveUsers: number;
|
|
75
|
+
peakDailyActiveUsers: number;
|
|
76
|
+
/** The local day (YYYY-MM-DD) of the peak; null when nobody was active. */
|
|
77
|
+
peakDay: string | null;
|
|
78
|
+
frequency: SafetyAnalyticsFrequencyRow[];
|
|
79
|
+
timeline: SafetyAnalyticsUsagePoint[];
|
|
80
|
+
}
|
|
81
|
+
/** The headline figures of the previous period of the same length, for the change on each. */
|
|
82
|
+
export interface SafetyAnalyticsPrevious {
|
|
83
|
+
from: string;
|
|
84
|
+
to: string;
|
|
85
|
+
activeUsers: number;
|
|
86
|
+
safetyCheckUsers: number;
|
|
87
|
+
followMeUsers: number;
|
|
88
|
+
safetyChecks: number;
|
|
89
|
+
followMeJourneys: number;
|
|
90
|
+
safetyCheckSos: number;
|
|
91
|
+
followMeSos: number;
|
|
92
|
+
checkedIn: number;
|
|
93
|
+
arrived: number;
|
|
94
|
+
prompts: number;
|
|
95
|
+
promptsConfirmedOk: number;
|
|
96
|
+
}
|
|
97
|
+
/** When sessions start, by ISO weekday (1 = Monday) and local hour. All 168 cells are present. */
|
|
98
|
+
export interface SafetyAnalyticsHeatCell {
|
|
99
|
+
weekday: number;
|
|
100
|
+
hour: number;
|
|
101
|
+
safetyChecks: number;
|
|
102
|
+
followMe: number;
|
|
103
|
+
}
|
|
104
|
+
/** A reason the user chose, by its code (or its label for a reason with none); the user's own words are only counted. */
|
|
105
|
+
export interface SafetyAnalyticsReasonRow {
|
|
106
|
+
code: string | null;
|
|
107
|
+
/** The label most recently used for it. "Own reason" for a reason the user typed. */
|
|
108
|
+
label: string;
|
|
109
|
+
count: number;
|
|
110
|
+
/** Ended well: checked in (Safety Check) or arrived (Follow Me). */
|
|
111
|
+
completed: number;
|
|
112
|
+
sos: number;
|
|
113
|
+
}
|
|
114
|
+
export interface SafetyCheckAnalyticsTotals {
|
|
115
|
+
started: number;
|
|
116
|
+
/** Distinct users who started one. */
|
|
117
|
+
users: number;
|
|
118
|
+
checkedIn: number;
|
|
119
|
+
sosTriggered: number;
|
|
120
|
+
stopped: number;
|
|
121
|
+
expired: number;
|
|
122
|
+
cancelled: number;
|
|
123
|
+
failed: number;
|
|
124
|
+
/** Still running: created, active or prompting. */
|
|
125
|
+
open: number;
|
|
126
|
+
/** Checked in only after the check-in prompt appeared. */
|
|
127
|
+
checkedInAfterPrompt: number;
|
|
128
|
+
/** Checks extended at least once, and how many extensions in all. */
|
|
129
|
+
extended: number;
|
|
130
|
+
extensions: number;
|
|
131
|
+
/** Recorded at least one location point. */
|
|
132
|
+
withLocation: number;
|
|
133
|
+
trackPoints: number;
|
|
134
|
+
/** Asked for the service provider to be alerted, and whether their plan allowed it. */
|
|
135
|
+
providerRequested: number;
|
|
136
|
+
providerAllowed: number;
|
|
137
|
+
notifyGuardiansOnStartEnd: number;
|
|
138
|
+
/** Chose at least one guardian who does not use the app (reached by SMS). */
|
|
139
|
+
withExternalGuardians: number;
|
|
140
|
+
averageGuardians: number | null;
|
|
141
|
+
/** Typed their own reason instead of choosing one. */
|
|
142
|
+
customReasons: number;
|
|
143
|
+
/** An SOS that became an incident, one that has not (yet), and one it took more than one attempt to raise. */
|
|
144
|
+
sosIncidents: number;
|
|
145
|
+
sosUndelivered: number;
|
|
146
|
+
sosRetried: number;
|
|
147
|
+
/** Planned length, start to check-in time (extensions included). */
|
|
148
|
+
medianPlannedMinutes: number | null;
|
|
149
|
+
/** Start to the end, for the checks that ended. */
|
|
150
|
+
medianActualMinutes: number | null;
|
|
151
|
+
/** Prompt to check-in, for checks confirmed at the prompt. */
|
|
152
|
+
medianPromptResponseSeconds: number | null;
|
|
153
|
+
/** How long before the check-in time a user confirmed they were safe, for those who did before being prompted. */
|
|
154
|
+
medianMinutesToSpare: number | null;
|
|
155
|
+
}
|
|
156
|
+
export interface SafetyCheckAnalyticsPoint {
|
|
157
|
+
bucket: string;
|
|
158
|
+
started: number;
|
|
159
|
+
checkedIn: number;
|
|
160
|
+
sos: number;
|
|
161
|
+
stopped: number;
|
|
162
|
+
/** Expired, cancelled or failed. */
|
|
163
|
+
other: number;
|
|
164
|
+
open: number;
|
|
165
|
+
}
|
|
166
|
+
export interface SafetyCheckAnalytics {
|
|
167
|
+
totals: SafetyCheckAnalyticsTotals;
|
|
168
|
+
/** Every status a check can end in (or be in), zeros included. */
|
|
169
|
+
byStatus: SafetyAnalyticsCount[];
|
|
170
|
+
timeline: SafetyCheckAnalyticsPoint[];
|
|
171
|
+
/** What raised the SOS: a missed check-in, or the user asking for help. */
|
|
172
|
+
sosByTrigger: SafetyAnalyticsCount[];
|
|
173
|
+
reasons: SafetyAnalyticsReasonRow[];
|
|
174
|
+
/** Planned length, banded ('<=15m', '15-30m', '30-60m', '1-2h', '2-4h', '4-8h', '8-24h'), in that order. */
|
|
175
|
+
plannedDuration: SafetyAnalyticsCount[];
|
|
176
|
+
/** Extensions per check: '0', '1', '2', '3+'. */
|
|
177
|
+
extensions: SafetyAnalyticsCount[];
|
|
178
|
+
/** Guardians chosen per check: '1', '2', '3', '4+' (and '0' if a check had none). */
|
|
179
|
+
guardians: SafetyAnalyticsCount[];
|
|
180
|
+
/** The user's plan when the check started (FREE, TRIAL, PREMIUM; UNKNOWN when billing could not say). */
|
|
181
|
+
tiers: SafetyAnalyticsCount[];
|
|
182
|
+
countries: SafetyAnalyticsCount[];
|
|
183
|
+
}
|
|
184
|
+
export interface FollowMeAnalyticsTotals {
|
|
185
|
+
started: number;
|
|
186
|
+
users: number;
|
|
187
|
+
arrived: number;
|
|
188
|
+
sosTriggered: number;
|
|
189
|
+
stopped: number;
|
|
190
|
+
expired: number;
|
|
191
|
+
cancelled: number;
|
|
192
|
+
failed: number;
|
|
193
|
+
/** Still under way: created, active or prompting. */
|
|
194
|
+
active: number;
|
|
195
|
+
/** Started with a planned route, and how many of those were re-planned along the way. */
|
|
196
|
+
withRoute: number;
|
|
197
|
+
rerouted: number;
|
|
198
|
+
recalculations: number;
|
|
199
|
+
/** Journeys with stops on the way, and how many stops in all. */
|
|
200
|
+
withStops: number;
|
|
201
|
+
stops: number;
|
|
202
|
+
crashDetection: number;
|
|
203
|
+
/** Started without "allow all the time" location: sharing may stop when the app is closed. */
|
|
204
|
+
backgroundLocationDenied: number;
|
|
205
|
+
providerRequested: number;
|
|
206
|
+
providerAllowed: number;
|
|
207
|
+
notifyGuardiansOnStartEnd: number;
|
|
208
|
+
trackPoints: number;
|
|
209
|
+
medianPlannedMinutes: number | null;
|
|
210
|
+
/** Start to end, for journeys that ended. */
|
|
211
|
+
medianActualMinutes: number | null;
|
|
212
|
+
/** The planned route's length, for journeys with one. */
|
|
213
|
+
medianPlannedDistanceMeters: number | null;
|
|
214
|
+
/** The planned distance of every journey that arrived. */
|
|
215
|
+
arrivedDistanceMeters: number;
|
|
216
|
+
/** Arrived no later than the arrival the plan promised, or after it - of the journeys that had one. */
|
|
217
|
+
arrivedOnTime: number;
|
|
218
|
+
arrivedLate: number;
|
|
219
|
+
/** Arrival against the promised arrival (negative = early), median. */
|
|
220
|
+
medianArrivalDelaySeconds: number | null;
|
|
221
|
+
sosIncidents: number;
|
|
222
|
+
sosUndelivered: number;
|
|
223
|
+
}
|
|
224
|
+
export interface FollowMeAnalyticsPoint {
|
|
225
|
+
bucket: string;
|
|
226
|
+
started: number;
|
|
227
|
+
arrived: number;
|
|
228
|
+
sos: number;
|
|
229
|
+
stopped: number;
|
|
230
|
+
other: number;
|
|
231
|
+
active: number;
|
|
232
|
+
}
|
|
233
|
+
export interface FollowMeTransportRow {
|
|
234
|
+
/** A FollowMeTransportMode, or null for a journey without one. */
|
|
235
|
+
mode: string | null;
|
|
236
|
+
journeys: number;
|
|
237
|
+
arrived: number;
|
|
238
|
+
sos: number;
|
|
239
|
+
prompts: number;
|
|
240
|
+
}
|
|
241
|
+
export interface FollowMePromptTriggerRow {
|
|
242
|
+
/** A FollowMeSafetyTrigger. */
|
|
243
|
+
trigger: string;
|
|
244
|
+
prompts: number;
|
|
245
|
+
confirmedOk: number;
|
|
246
|
+
expired: number;
|
|
247
|
+
cancelled: number;
|
|
248
|
+
active: number;
|
|
249
|
+
medianResponseSeconds: number | null;
|
|
250
|
+
}
|
|
251
|
+
/** "Are you OK?" prompts the monitoring raised on the period's journeys. */
|
|
252
|
+
export interface FollowMePromptAnalytics {
|
|
253
|
+
total: number;
|
|
254
|
+
confirmedOk: number;
|
|
255
|
+
/** Not answered in time: each raised an SOS. */
|
|
256
|
+
expired: number;
|
|
257
|
+
/** Withdrawn because the journey ended or an SOS was raised first. */
|
|
258
|
+
cancelled: number;
|
|
259
|
+
active: number;
|
|
260
|
+
journeysPrompted: number;
|
|
261
|
+
medianResponseSeconds: number | null;
|
|
262
|
+
byTrigger: FollowMePromptTriggerRow[];
|
|
263
|
+
}
|
|
264
|
+
export interface FollowMeFollowerKindRow {
|
|
265
|
+
/** A FollowMeParticipantKind. */
|
|
266
|
+
kind: string;
|
|
267
|
+
invited: number;
|
|
268
|
+
accepted: number;
|
|
269
|
+
declined: number;
|
|
270
|
+
pending: number;
|
|
271
|
+
unanswered: number;
|
|
272
|
+
stoppedFollowing: number;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* The guardians asked to follow the period's journeys. Counts only - never who.
|
|
276
|
+
*
|
|
277
|
+
* Each guardian is in exactly one of accepted, declined, pending and unanswered, so
|
|
278
|
+
* those add up to `invited`. A guardian's answer is read from the audit trail: when a
|
|
279
|
+
* journey ends every participation is closed, whatever the answer was.
|
|
280
|
+
*/
|
|
281
|
+
export interface FollowMeFollowerAnalytics {
|
|
282
|
+
invited: number;
|
|
283
|
+
/** Followed the journey at some point. */
|
|
284
|
+
accepted: number;
|
|
285
|
+
/** Answered no, and never followed. */
|
|
286
|
+
declined: number;
|
|
287
|
+
/** Not answered yet, on a journey still under way. */
|
|
288
|
+
pending: number;
|
|
289
|
+
/** Never answered before the journey ended. */
|
|
290
|
+
unanswered: number;
|
|
291
|
+
/** Followed, then stopped following before the end - a part of `accepted`. */
|
|
292
|
+
stoppedFollowing: number;
|
|
293
|
+
/** Journeys at least one guardian followed. */
|
|
294
|
+
journeysFollowed: number;
|
|
295
|
+
averageInvited: number | null;
|
|
296
|
+
/** From the request to the guardian first accepting it. */
|
|
297
|
+
medianSecondsToAccept: number | null;
|
|
298
|
+
byKind: FollowMeFollowerKindRow[];
|
|
299
|
+
/** External guardians who opened their web link at least once. */
|
|
300
|
+
externalLinksOpened: number;
|
|
301
|
+
/** Visits to those links, counted at most once every 10 minutes per guardian. */
|
|
302
|
+
externalVisits: number;
|
|
303
|
+
}
|
|
304
|
+
export interface FollowMeAnalytics {
|
|
305
|
+
totals: FollowMeAnalyticsTotals;
|
|
306
|
+
byStatus: SafetyAnalyticsCount[];
|
|
307
|
+
timeline: FollowMeAnalyticsPoint[];
|
|
308
|
+
transportModes: FollowMeTransportRow[];
|
|
309
|
+
/** Where the planned route came from: GOOGLE, ESTIMATE, or NONE (no route). */
|
|
310
|
+
routeProviders: SafetyAnalyticsCount[];
|
|
311
|
+
/** Planned distance, banded ('<2km', '2-5km', '5-10km', '10-25km', '25-50km', '50km+', 'none'), in that order. */
|
|
312
|
+
distance: SafetyAnalyticsCount[];
|
|
313
|
+
plannedDuration: SafetyAnalyticsCount[];
|
|
314
|
+
prompts: FollowMePromptAnalytics;
|
|
315
|
+
/** What the SOS was about (a FollowMeSafetyTrigger), or MANUAL when the user raised it. */
|
|
316
|
+
sosByCause: SafetyAnalyticsCount[];
|
|
317
|
+
sosByTrigger: SafetyAnalyticsCount[];
|
|
318
|
+
followers: FollowMeFollowerAnalytics;
|
|
319
|
+
/** What the monitoring noticed (FollowMeSafetyEventType), whether or not it prompted. */
|
|
320
|
+
safetyEvents: SafetyAnalyticsCount[];
|
|
321
|
+
reasons: SafetyAnalyticsReasonRow[];
|
|
322
|
+
tiers: SafetyAnalyticsCount[];
|
|
323
|
+
countries: SafetyAnalyticsCount[];
|
|
324
|
+
}
|
|
325
|
+
/** Platform view across organizations only. The organization is named by the caller. */
|
|
326
|
+
export interface SafetyAnalyticsOrganizationRow {
|
|
327
|
+
organizationId: number;
|
|
328
|
+
activeUsers: number;
|
|
329
|
+
safetyChecks: number;
|
|
330
|
+
followMeJourneys: number;
|
|
331
|
+
safetyCheckSos: number;
|
|
332
|
+
followMeSos: number;
|
|
333
|
+
}
|
|
334
|
+
export interface SafetyAnalytics {
|
|
335
|
+
/** Null for every organization (a Super-Admin's platform view). */
|
|
336
|
+
organizationId: number | null;
|
|
337
|
+
/** Set when the figures are one control centre's (a control-centre admin's). */
|
|
338
|
+
controlCentreId: number | null;
|
|
339
|
+
range: SafetyAnalyticsRange;
|
|
340
|
+
generatedAt: string;
|
|
341
|
+
usage: SafetyAnalyticsUsage;
|
|
342
|
+
/** Null for "forever": there is nothing before it to compare with. */
|
|
343
|
+
previous: SafetyAnalyticsPrevious | null;
|
|
344
|
+
heatmap: SafetyAnalyticsHeatCell[];
|
|
345
|
+
safetyCheck: SafetyCheckAnalytics;
|
|
346
|
+
followMe: FollowMeAnalytics;
|
|
347
|
+
/** Super-Admin's view of every organization only. */
|
|
348
|
+
byOrganization?: SafetyAnalyticsOrganizationRow[];
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* The period a safety analytics read covers (query string). Both ends optional: no
|
|
352
|
+
* `from` is "forever", no `to` is now. ISO 8601 instants; `timeZone` is an IANA name.
|
|
353
|
+
* `organizationId` is honoured for a Super-Admin only.
|
|
354
|
+
*/
|
|
355
|
+
export interface SafetyAnalyticsQuery {
|
|
356
|
+
from?: string;
|
|
357
|
+
to?: string;
|
|
358
|
+
timeZone?: string;
|
|
359
|
+
organizationId?: number;
|
|
360
|
+
}
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "clarion-shared-types",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "dist/cjs/index.js",
|
|
5
|
-
"module": "dist/esm/index.js",
|
|
6
|
-
"types": "dist/types/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/types/index.d.ts",
|
|
10
|
-
"import": "./dist/esm/index.js",
|
|
11
|
-
"require": "./dist/cjs/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./dist/modules/*": {
|
|
14
|
-
"types": "./dist/types/modules/*.d.ts",
|
|
15
|
-
"import": "./dist/esm/modules/*.js",
|
|
16
|
-
"require": "./dist/cjs/modules/*.js"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"dist/**/*"
|
|
21
|
-
],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"clean": "rimraf dist dist-test",
|
|
24
|
-
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
25
|
-
"build:esm": "tsc -p tsconfig.esm.json",
|
|
26
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
27
|
-
"build": "npm run clean && npm run build:types && npm run build:cjs && npm run build:esm",
|
|
28
|
-
"prepublishOnly": "npm run build",
|
|
29
|
-
"pretest": "rimraf dist-test",
|
|
30
|
-
"test": "tsc -p tsconfig.spec.json && node --test \"dist-test/**/*.spec.js\""
|
|
31
|
-
},
|
|
32
|
-
"keywords": [],
|
|
33
|
-
"author": "vince_lawino",
|
|
34
|
-
"license": "ISC",
|
|
35
|
-
"description": "",
|
|
36
|
-
"publishConfig": {
|
|
37
|
-
"access": "public"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@types/geojson": "^7946.0.16",
|
|
41
|
-
"@types/node": "^20.11.2",
|
|
42
|
-
"rimraf": "^5.0.5",
|
|
43
|
-
"typescript": "^5.7.3"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "clarion-shared-types",
|
|
3
|
+
"version": "1.0.108",
|
|
4
|
+
"main": "dist/cjs/index.js",
|
|
5
|
+
"module": "dist/esm/index.js",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"import": "./dist/esm/index.js",
|
|
11
|
+
"require": "./dist/cjs/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./dist/modules/*": {
|
|
14
|
+
"types": "./dist/types/modules/*.d.ts",
|
|
15
|
+
"import": "./dist/esm/modules/*.js",
|
|
16
|
+
"require": "./dist/cjs/modules/*.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist/**/*"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"clean": "rimraf dist dist-test",
|
|
24
|
+
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
25
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
26
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
27
|
+
"build": "npm run clean && npm run build:types && npm run build:cjs && npm run build:esm",
|
|
28
|
+
"prepublishOnly": "npm run build",
|
|
29
|
+
"pretest": "rimraf dist-test",
|
|
30
|
+
"test": "tsc -p tsconfig.spec.json && node --test \"dist-test/**/*.spec.js\""
|
|
31
|
+
},
|
|
32
|
+
"keywords": [],
|
|
33
|
+
"author": "vince_lawino",
|
|
34
|
+
"license": "ISC",
|
|
35
|
+
"description": "",
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/geojson": "^7946.0.16",
|
|
41
|
+
"@types/node": "^20.11.2",
|
|
42
|
+
"rimraf": "^5.0.5",
|
|
43
|
+
"typescript": "^5.7.3"
|
|
44
|
+
}
|
|
45
|
+
}
|