grm-shared-library 1.1.240 → 1.1.242
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/gis/dtos/trip-path-snapshot.dto.js +58 -0
- package/dist/cjs/modules/gis/dtos/trip-path-snapshot.dto.js.map +1 -0
- package/dist/cjs/modules/gis/index.js +2 -0
- package/dist/cjs/modules/gis/index.js.map +1 -1
- package/dist/cjs/modules/gis/interfaces/trip-path-snapshot.js +3 -0
- package/dist/cjs/modules/gis/interfaces/trip-path-snapshot.js.map +1 -0
- package/dist/cjs/modules/permission/data/permissions.data.js +8 -0
- package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +17 -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/responder/constants/responder.const.js +124 -0
- package/dist/cjs/modules/responder/constants/responder.const.js.map +1 -0
- package/dist/cjs/modules/responder/dtos/responder.dto.js +582 -0
- package/dist/cjs/modules/responder/dtos/responder.dto.js.map +1 -0
- package/dist/cjs/modules/responder/enums/responder.enums.js +142 -0
- package/dist/cjs/modules/responder/enums/responder.enums.js.map +1 -0
- package/dist/cjs/modules/responder/index.js +29 -0
- package/dist/cjs/modules/responder/index.js.map +1 -0
- package/dist/cjs/modules/responder/interfaces/responder-dispatch.js +3 -0
- package/dist/cjs/modules/responder/interfaces/responder-dispatch.js.map +1 -0
- package/dist/cjs/modules/responder/interfaces/responder-policy.js +3 -0
- package/dist/cjs/modules/responder/interfaces/responder-policy.js.map +1 -0
- package/dist/cjs/modules/responder/interfaces/responder.js +3 -0
- package/dist/cjs/modules/responder/interfaces/responder.js.map +1 -0
- package/dist/cjs/modules/responder/utils/responder.util.js +65 -0
- package/dist/cjs/modules/responder/utils/responder.util.js.map +1 -0
- package/dist/cjs/modules/role/data/roles.data.js +25 -4
- package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
- package/dist/cjs/modules/safety/constants/safety-history.const.js +75 -0
- package/dist/cjs/modules/safety/constants/safety-history.const.js.map +1 -0
- package/dist/cjs/modules/safety/constants/safety-integration.const.js +4 -0
- package/dist/cjs/modules/safety/constants/safety-integration.const.js.map +1 -1
- package/dist/cjs/modules/safety/dtos/safety-history.dto.js +112 -0
- package/dist/cjs/modules/safety/dtos/safety-history.dto.js.map +1 -0
- package/dist/cjs/modules/safety/enums/safety-history.enums.js +30 -0
- package/dist/cjs/modules/safety/enums/safety-history.enums.js.map +1 -0
- package/dist/cjs/modules/safety/index.js +4 -0
- package/dist/cjs/modules/safety/index.js.map +1 -1
- package/dist/cjs/modules/safety/interfaces/safety-history.js +3 -0
- package/dist/cjs/modules/safety/interfaces/safety-history.js.map +1 -0
- package/dist/cjs/modules/tracking/enums/tracking-provider-code.enum.js +8 -0
- package/dist/cjs/modules/tracking/enums/tracking-provider-code.enum.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/gis/dtos/trip-path-snapshot.dto.js +54 -0
- package/dist/esm/modules/gis/dtos/trip-path-snapshot.dto.js.map +1 -0
- package/dist/esm/modules/gis/index.js +2 -0
- package/dist/esm/modules/gis/index.js.map +1 -1
- package/dist/esm/modules/gis/interfaces/trip-path-snapshot.js +2 -0
- package/dist/esm/modules/gis/interfaces/trip-path-snapshot.js.map +1 -0
- package/dist/esm/modules/permission/data/permissions.data.js +8 -0
- package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +17 -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/responder/constants/responder.const.js +121 -0
- package/dist/esm/modules/responder/constants/responder.const.js.map +1 -0
- package/dist/esm/modules/responder/dtos/responder.dto.js +560 -0
- package/dist/esm/modules/responder/dtos/responder.dto.js.map +1 -0
- package/dist/esm/modules/responder/enums/responder.enums.js +139 -0
- package/dist/esm/modules/responder/enums/responder.enums.js.map +1 -0
- package/dist/esm/modules/responder/index.js +13 -0
- package/dist/esm/modules/responder/index.js.map +1 -0
- package/dist/esm/modules/responder/interfaces/responder-dispatch.js +2 -0
- package/dist/esm/modules/responder/interfaces/responder-dispatch.js.map +1 -0
- package/dist/esm/modules/responder/interfaces/responder-policy.js +2 -0
- package/dist/esm/modules/responder/interfaces/responder-policy.js.map +1 -0
- package/dist/esm/modules/responder/interfaces/responder.js +2 -0
- package/dist/esm/modules/responder/interfaces/responder.js.map +1 -0
- package/dist/esm/modules/responder/utils/responder.util.js +59 -0
- package/dist/esm/modules/responder/utils/responder.util.js.map +1 -0
- package/dist/esm/modules/role/data/roles.data.js +24 -3
- package/dist/esm/modules/role/data/roles.data.js.map +1 -1
- package/dist/esm/modules/safety/constants/safety-history.const.js +72 -0
- package/dist/esm/modules/safety/constants/safety-history.const.js.map +1 -0
- package/dist/esm/modules/safety/constants/safety-integration.const.js +4 -0
- package/dist/esm/modules/safety/constants/safety-integration.const.js.map +1 -1
- package/dist/esm/modules/safety/dtos/safety-history.dto.js +107 -0
- package/dist/esm/modules/safety/dtos/safety-history.dto.js.map +1 -0
- package/dist/esm/modules/safety/enums/safety-history.enums.js +27 -0
- package/dist/esm/modules/safety/enums/safety-history.enums.js.map +1 -0
- package/dist/esm/modules/safety/index.js +4 -0
- package/dist/esm/modules/safety/index.js.map +1 -1
- package/dist/esm/modules/safety/interfaces/safety-history.js +2 -0
- package/dist/esm/modules/safety/interfaces/safety-history.js.map +1 -0
- package/dist/esm/modules/tracking/enums/tracking-provider-code.enum.js +8 -0
- package/dist/esm/modules/tracking/enums/tracking-provider-code.enum.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/modules/gis/dtos/trip-path-snapshot.dto.d.ts +18 -0
- package/dist/types/modules/gis/index.d.ts +2 -0
- package/dist/types/modules/gis/interfaces/trip-path-snapshot.d.ts +38 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +3 -0
- package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +2 -1
- package/dist/types/modules/responder/constants/responder.const.d.ts +67 -0
- package/dist/types/modules/responder/dtos/responder.dto.d.ts +144 -0
- package/dist/types/modules/responder/enums/responder.enums.d.ts +128 -0
- package/dist/types/modules/responder/index.d.ts +7 -0
- package/dist/types/modules/responder/interfaces/responder-dispatch.d.ts +144 -0
- package/dist/types/modules/responder/interfaces/responder-policy.d.ts +55 -0
- package/dist/types/modules/responder/interfaces/responder.d.ts +113 -0
- package/dist/types/modules/responder/utils/responder.util.d.ts +24 -0
- package/dist/types/modules/role/data/roles.data.d.ts +7 -0
- package/dist/types/modules/safety/constants/safety-history.const.d.ts +31 -0
- package/dist/types/modules/safety/constants/safety-integration.const.d.ts +4 -0
- package/dist/types/modules/safety/dtos/safety-history.dto.d.ts +20 -0
- package/dist/types/modules/safety/enums/safety-history.enums.d.ts +24 -0
- package/dist/types/modules/safety/index.d.ts +4 -0
- package/dist/types/modules/safety/interfaces/safety-history.d.ts +217 -0
- package/dist/types/modules/tracking/enums/tracking-provider-code.enum.d.ts +9 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a session's recorded path can be drawn in its history.
|
|
3
|
+
*
|
|
4
|
+
* RECORDED clarion-gis holds at least one location for the session (a
|
|
5
|
+
* track point, or the location the device reported at start).
|
|
6
|
+
* NOT_RECORDED nothing was ever recorded: no trip was opened, or it holds no
|
|
7
|
+
* location. The map says so - it never shows where the user is now.
|
|
8
|
+
* UNAVAILABLE clarion-gis could not be read just now. Try again later; the
|
|
9
|
+
* rest of the history does not depend on it.
|
|
10
|
+
*/
|
|
11
|
+
export var SafetyHistoryPathStatus;
|
|
12
|
+
(function (SafetyHistoryPathStatus) {
|
|
13
|
+
SafetyHistoryPathStatus["RECORDED"] = "RECORDED";
|
|
14
|
+
SafetyHistoryPathStatus["NOT_RECORDED"] = "NOT_RECORDED";
|
|
15
|
+
SafetyHistoryPathStatus["UNAVAILABLE"] = "UNAVAILABLE";
|
|
16
|
+
})(SafetyHistoryPathStatus || (SafetyHistoryPathStatus = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Where a history timeline entry comes from: the session's lifecycle audit trail
|
|
19
|
+
* (what the user, the timer or the platform did), or - Follow Me only - what the
|
|
20
|
+
* journey monitors observed.
|
|
21
|
+
*/
|
|
22
|
+
export var SafetyHistoryEventSource;
|
|
23
|
+
(function (SafetyHistoryEventSource) {
|
|
24
|
+
SafetyHistoryEventSource["LIFECYCLE"] = "LIFECYCLE";
|
|
25
|
+
SafetyHistoryEventSource["MONITOR"] = "MONITOR";
|
|
26
|
+
})(SafetyHistoryEventSource || (SafetyHistoryEventSource = {}));
|
|
27
|
+
//# sourceMappingURL=safety-history.enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety-history.enums.js","sourceRoot":"","sources":["../../../../../src/modules/safety/enums/safety-history.enums.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IAC/B,gDAAqB,CAAA;IACrB,wDAA6B,CAAA;IAC7B,sDAA2B,CAAA;AAC/B,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAChC,mDAAuB,CAAA;IACvB,+CAAmB,CAAA;AACvB,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,QAGnC"}
|
|
@@ -3,17 +3,20 @@ export * from './enums/safety-check-status.enum';
|
|
|
3
3
|
export * from './enums/safety-enums';
|
|
4
4
|
export * from './enums/safety-error-code.enum';
|
|
5
5
|
export * from './enums/follow-me.enums';
|
|
6
|
+
export * from './enums/safety-history.enums';
|
|
6
7
|
// Constants
|
|
7
8
|
export * from './constants/safety-check-limits.const';
|
|
8
9
|
export * from './constants/safety-taxonomy.const';
|
|
9
10
|
export * from './constants/safety-integration.const';
|
|
10
11
|
export * from './constants/follow-me.const';
|
|
12
|
+
export * from './constants/safety-history.const';
|
|
11
13
|
// Interfaces
|
|
12
14
|
export * from './interfaces/safety-check';
|
|
13
15
|
export * from './interfaces/safety-check-event';
|
|
14
16
|
export * from './interfaces/safety-alert-context';
|
|
15
17
|
export * from './interfaces/follow-me';
|
|
16
18
|
export * from './interfaces/safety-analytics';
|
|
19
|
+
export * from './interfaces/safety-history';
|
|
17
20
|
// DTOs
|
|
18
21
|
export * from './dtos/safety-check.dto';
|
|
19
22
|
export * from './dtos/safety-admin.dto';
|
|
@@ -21,6 +24,7 @@ export * from './dtos/safety-internal.dto';
|
|
|
21
24
|
export * from './dtos/safety-alert-context.dto';
|
|
22
25
|
export * from './dtos/follow-me.dto';
|
|
23
26
|
export * from './dtos/safety-analytics.dto';
|
|
27
|
+
export * from './dtos/safety-history.dto';
|
|
24
28
|
// Utilities
|
|
25
29
|
export * from './utils/safety-check-state-machine';
|
|
26
30
|
export * from './utils/safety-check-timing.util';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/safety/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/safety/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAE7C,YAAY;AACZ,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AAEjD,aAAa;AACb,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAE5C,OAAO;AACP,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAE1C,YAAY;AACZ,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety-history.js","sourceRoot":"","sources":["../../../../../src/modules/safety/interfaces/safety-history.ts"],"names":[],"mappings":""}
|
|
@@ -24,5 +24,13 @@ export var TrackingProviderCode;
|
|
|
24
24
|
TrackingProviderCode["GENERIC_WEBSOCKET"] = "GENERIC_WEBSOCKET";
|
|
25
25
|
/** Generic HTTP polling adapter (reserved). */
|
|
26
26
|
TrackingProviderCode["GENERIC_HTTP_POLLING"] = "GENERIC_HTTP_POLLING";
|
|
27
|
+
/**
|
|
28
|
+
* The responder app: the phone of the responder on duty with a unit reports
|
|
29
|
+
* the unit's position (`POST /tracking/responder/positions`). Inbound only -
|
|
30
|
+
* there is no connection to open, so the connector never runs a session
|
|
31
|
+
* for it. Used only for units with no enabled hardware tracker binding, so
|
|
32
|
+
* a vehicle's tracker and a crew member's phone never compete.
|
|
33
|
+
*/
|
|
34
|
+
TrackingProviderCode["MOBILE_APP"] = "MOBILE_APP";
|
|
27
35
|
})(TrackingProviderCode || (TrackingProviderCode = {}));
|
|
28
36
|
//# sourceMappingURL=tracking-provider-code.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracking-provider-code.enum.js","sourceRoot":"","sources":["../../../../../src/modules/tracking/enums/tracking-provider-code.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"tracking-provider-code.enum.js","sourceRoot":"","sources":["../../../../../src/modules/tracking/enums/tracking-provider-code.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAN,IAAY,oBAmBX;AAnBD,WAAY,oBAAoB;IAC5B,0DAA0D;IAC1D,uCAAe,CAAA;IACf,iEAAiE;IACjE,yCAAiB,CAAA;IACjB,iFAAiF;IACjF,+CAAuB,CAAA;IACvB,4CAA4C;IAC5C,+DAAuC,CAAA;IACvC,+CAA+C;IAC/C,qEAA6C,CAAA;IAC7C;;;;;;OAMG;IACH,iDAAyB,CAAA;AAC7B,CAAC,EAnBW,oBAAoB,KAApB,oBAAoB,QAmB/B"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export * from './modules/safety/index';
|
|
|
29
29
|
export * from './modules/billing/index';
|
|
30
30
|
export * from './modules/newsfeed/index';
|
|
31
31
|
export * from './modules/dispatch/index';
|
|
32
|
+
export * from './modules/responder/index';
|
|
32
33
|
export * from './modules/incident-sla/index';
|
|
33
34
|
export * from './interfaces/server-message';
|
|
34
35
|
export * from './interfaces/i-request-with-user';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Bounds of a path snapshot - small enough for a phone to draw quickly. */
|
|
2
|
+
export declare const TRIP_PATH_SNAPSHOT_LIMITS: {
|
|
3
|
+
readonly defaultMaxPoints: 500;
|
|
4
|
+
readonly minMaxPoints: 2;
|
|
5
|
+
readonly maxMaxPoints: 2000;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* GET /trips/:tripId/path-snapshot (internal, clarion-safety only).
|
|
9
|
+
*
|
|
10
|
+
* `ownerUserId` is the user the caller has already established owns the safety
|
|
11
|
+
* record; clarion-gis refuses the read unless the trip is theirs too, so a
|
|
12
|
+
* mixed-up trip id can never draw somebody else's path.
|
|
13
|
+
*/
|
|
14
|
+
export declare class TripPathSnapshotQueryDto {
|
|
15
|
+
ownerUserId: number;
|
|
16
|
+
until?: string;
|
|
17
|
+
maxPoints?: number;
|
|
18
|
+
}
|
|
@@ -16,6 +16,7 @@ export * from './dtos/point-location.dto';
|
|
|
16
16
|
export * from './dtos/private-trip.dto';
|
|
17
17
|
export * from './dtos/routing.dto';
|
|
18
18
|
export * from './dtos/trip-points.dto';
|
|
19
|
+
export * from './dtos/trip-path-snapshot.dto';
|
|
19
20
|
export * from './dtos/post-gis-geometry.dto';
|
|
20
21
|
export * from './dtos/route-incident.dto';
|
|
21
22
|
export * from './dtos/routing-coverage-result.dto';
|
|
@@ -39,6 +40,7 @@ export * from './interfaces/point-location';
|
|
|
39
40
|
export * from './interfaces/polygon-validation-result';
|
|
40
41
|
export * from './interfaces/trip-summary';
|
|
41
42
|
export * from './interfaces/trip-point';
|
|
43
|
+
export * from './interfaces/trip-path-snapshot';
|
|
42
44
|
export * from './interfaces/routing';
|
|
43
45
|
export * from './interfaces/zone';
|
|
44
46
|
export * from './interfaces/zone-for-point';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TripPurpose } from '../enums/trip-privacy.enum';
|
|
2
|
+
/** A recorded fix reduced to what a map draws. */
|
|
3
|
+
export interface TripPathPoint {
|
|
4
|
+
lat: number;
|
|
5
|
+
lng: number;
|
|
6
|
+
timestamp: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A trip's recorded path, thinned for drawing on a map - what clarion-safety
|
|
10
|
+
* shows the owner of a Safety Check or Follow Me journey in their history.
|
|
11
|
+
*
|
|
12
|
+
* Everything here was recorded: the thinning only drops fixes that lie on the
|
|
13
|
+
* line between the ones kept, and the first and last fix in the window are
|
|
14
|
+
* always kept. Nothing is ever interpolated or snapped to a road.
|
|
15
|
+
*/
|
|
16
|
+
export interface TripPathSnapshot {
|
|
17
|
+
tripId: string;
|
|
18
|
+
purpose: TripPurpose;
|
|
19
|
+
status: string;
|
|
20
|
+
startedAt: string;
|
|
21
|
+
endedAt: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Where the device was when the trip was opened, when it reported a fix then.
|
|
24
|
+
* Not a track point, and null when the device had no fix at the start.
|
|
25
|
+
*/
|
|
26
|
+
startLocation: {
|
|
27
|
+
lat: number;
|
|
28
|
+
lng: number;
|
|
29
|
+
} | null;
|
|
30
|
+
/** Fixes recorded inside the window, before thinning. */
|
|
31
|
+
totalPoints: number;
|
|
32
|
+
/** Oldest first, at most `maxPoints` of them. */
|
|
33
|
+
points: TripPathPoint[];
|
|
34
|
+
/** True when fixes were dropped to stay under `maxPoints`. */
|
|
35
|
+
simplified: boolean;
|
|
36
|
+
/** Length of the recorded path inside the window, over every fix (not the thinned ones). */
|
|
37
|
+
distanceMeters: number | null;
|
|
38
|
+
}
|
|
@@ -215,6 +215,9 @@ export declare enum PermissionActions {
|
|
|
215
215
|
READ_INCIDENT_SLA_POLICY = "read:incident-sla-policy",
|
|
216
216
|
MANAGE_INCIDENT_SLA_POLICY = "manage:incident-sla-policy",
|
|
217
217
|
READ_INCIDENT_SLA_ANALYTICS = "read:incident-sla-analytics",
|
|
218
|
+
USE_RESPONDER_APP = "use:responder-app",
|
|
219
|
+
RESPOND_RESPONSE_UNIT_DISPATCH = "respond:response-unit-dispatch",
|
|
220
|
+
REPORT_RESPONDER_POSITION = "report:responder-position",
|
|
218
221
|
/**
|
|
219
222
|
* @deprecated Split into the connection / message / screened-message /
|
|
220
223
|
* analytics actions above, which the gateway now requires instead. Still
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ResponseUnitDispatchStatus } from '../../dispatch/enums/response-unit-dispatch-status.enum';
|
|
2
|
+
import { ResponderPolicy } from '../interfaces/responder-policy';
|
|
3
|
+
/**
|
|
4
|
+
* The moves a responder may make on their own unit's dispatch - a strict
|
|
5
|
+
* subset of RESPONSE_UNIT_DISPATCH_TRANSITIONS.
|
|
6
|
+
*
|
|
7
|
+
* - Standing a unit down (CANCELLED) stays the control room's decision.
|
|
8
|
+
* - Declining (REJECTED) is only possible before the unit is moving, as for
|
|
9
|
+
* the control room.
|
|
10
|
+
* - COMPLETED only from ON_SCENE: a responder who never arrived did not
|
|
11
|
+
* complete anything; the control room stands the unit down instead.
|
|
12
|
+
* - EN_ROUTE straight from DISPATCHED is allowed: "I'm on my way" is an
|
|
13
|
+
* acknowledgement too, and making the responder tap twice while driving off
|
|
14
|
+
* helps nobody.
|
|
15
|
+
*/
|
|
16
|
+
export declare const RESPONDER_DISPATCH_TRANSITIONS: Readonly<Record<ResponseUnitDispatchStatus, readonly ResponseUnitDispatchStatus[]>>;
|
|
17
|
+
/** Every status a responder may ever set. */
|
|
18
|
+
export declare const RESPONDER_SETTABLE_DISPATCH_STATUSES: readonly ResponseUnitDispatchStatus[];
|
|
19
|
+
export declare const RESPONDER_FIELD_LIMITS: {
|
|
20
|
+
readonly statusReason: 500;
|
|
21
|
+
readonly dutyEndReason: 300;
|
|
22
|
+
readonly reportSummary: 4000;
|
|
23
|
+
readonly reportActionsTaken: 4000;
|
|
24
|
+
readonly reportPersonsContacted: 2000;
|
|
25
|
+
readonly reportHandoverTo: 500;
|
|
26
|
+
readonly reportFollowUpNotes: 2000;
|
|
27
|
+
readonly reportRemarks: 2000;
|
|
28
|
+
readonly reportChecklistItems: 50;
|
|
29
|
+
readonly reportChecklistItemId: 64;
|
|
30
|
+
readonly reportChecklistItemLabel: 200;
|
|
31
|
+
readonly reportAttachments: 50;
|
|
32
|
+
/** Positions per POST /responder/positions. The app sends smaller batches; this bounds a backlog. */
|
|
33
|
+
readonly positionBatchSize: 100;
|
|
34
|
+
readonly dispatchPageSize: 50;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A position older than this is still stored in the history but never moves
|
|
38
|
+
* the unit's current position (the projector's out-of-order rule) - and the
|
|
39
|
+
* ingestion refuses anything older than the backlog window outright.
|
|
40
|
+
*/
|
|
41
|
+
export declare const RESPONDER_POSITION_LIMITS: {
|
|
42
|
+
/** Samples older than this are refused (an offline backlog is kept this long). */
|
|
43
|
+
readonly maxSampleAgeSeconds: number;
|
|
44
|
+
/** Samples further in the future than this (clock skew) are refused. */
|
|
45
|
+
readonly maxFutureSkewSeconds: 120;
|
|
46
|
+
/** Worse than this is refused: it would put the unit in the wrong street. */
|
|
47
|
+
readonly maxAccuracyMetres: 1000;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The defaults every organization starts from. An organization may override any
|
|
51
|
+
* part through `organizations.responderPolicy` (validated by ResponderPolicyDto);
|
|
52
|
+
* clarion-organization merges the override over these and serves the result in
|
|
53
|
+
* the responder profile, and clarion-incident enforces the dispatch and report
|
|
54
|
+
* parts server-side. The app only ever READS the policy - a client cannot relax
|
|
55
|
+
* it.
|
|
56
|
+
*/
|
|
57
|
+
export declare const DEFAULT_RESPONDER_POLICY: ResponderPolicy;
|
|
58
|
+
/**
|
|
59
|
+
* Cluster-internal routes. Not proxied by the gateway; callers carry the
|
|
60
|
+
* internal service token and no user context.
|
|
61
|
+
*/
|
|
62
|
+
export declare const RESPONDER_INTERNAL_PATHS: {
|
|
63
|
+
/** clarion-organization: a user's units, active duty and effective policy. */
|
|
64
|
+
readonly userUnits: (userId: number) => string;
|
|
65
|
+
/** clarion-organization: who is on duty with a unit right now. */
|
|
66
|
+
readonly unitOnDuty: (responseUnitId: number) => string;
|
|
67
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { ResponseUnitDispatchStatus } from '../../dispatch/enums/response-unit-dispatch-status.enum';
|
|
2
|
+
import { ResponderArrivalMethod, ResponderDispatchListState, ResponderReportField, ResponderReportOutcome } from '../enums/responder.enums';
|
|
3
|
+
/** `POST /responder/duty` - go on duty with one of the caller's units. */
|
|
4
|
+
export declare class StartResponderDutyDto {
|
|
5
|
+
responseUnitId: number;
|
|
6
|
+
}
|
|
7
|
+
/** `POST /responder/duty/end` - go off duty. Idempotent: ending no duty is not an error. */
|
|
8
|
+
export declare class EndResponderDutyDto {
|
|
9
|
+
reason?: string;
|
|
10
|
+
}
|
|
11
|
+
/** `POST /response-units/:id/responders/:userId/end-duty` - the control room ends someone's duty. */
|
|
12
|
+
export declare class EndResponderDutyByControlCentreDto extends EndResponderDutyDto {
|
|
13
|
+
}
|
|
14
|
+
/** `POST /response-units/:id/responders` - link a Responder account to a unit. */
|
|
15
|
+
export declare class AddResponseUnitResponderDto {
|
|
16
|
+
userId: number;
|
|
17
|
+
}
|
|
18
|
+
/** `GET /responder/dispatches`. Newest first. */
|
|
19
|
+
export declare class ResponderDispatchListQueryDto {
|
|
20
|
+
state?: ResponderDispatchListState;
|
|
21
|
+
page?: number;
|
|
22
|
+
limit?: number;
|
|
23
|
+
/** `123` or `#123`: only that incident's dispatches. */
|
|
24
|
+
search?: string;
|
|
25
|
+
}
|
|
26
|
+
/** A position fix the phone took, sent as evidence with an action. */
|
|
27
|
+
export declare class ResponderLocationFixDto {
|
|
28
|
+
latitude: number;
|
|
29
|
+
longitude: number;
|
|
30
|
+
accuracyMetres?: number;
|
|
31
|
+
/** When the phone took the fix (ISO 8601). */
|
|
32
|
+
recordedAt: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* `POST /responder/dispatches/:dispatchId/status` - acknowledge, set off,
|
|
36
|
+
* arrive, complete or decline.
|
|
37
|
+
*
|
|
38
|
+
* Idempotent by target: asking for the status the dispatch already has returns
|
|
39
|
+
* it unchanged (HTTP 200) instead of a conflict, so a retry after a lost
|
|
40
|
+
* response is safe. `clientActionId` is recorded with the change for the audit.
|
|
41
|
+
*/
|
|
42
|
+
export declare class RespondToDispatchDto {
|
|
43
|
+
status: ResponseUnitDispatchStatus;
|
|
44
|
+
clientActionId: string;
|
|
45
|
+
/** Why - required to decline, and for a manual arrival, when policy says so. */
|
|
46
|
+
reason?: string;
|
|
47
|
+
/** The phone's position when the action was taken, when it has one. */
|
|
48
|
+
location?: ResponderLocationFixDto;
|
|
49
|
+
/** ON_SCENE only: how the arrival was established. Defaults to GPS when a location is sent. */
|
|
50
|
+
arrivalMethod?: ResponderArrivalMethod;
|
|
51
|
+
}
|
|
52
|
+
export declare class ResponderChecklistAnswerDto {
|
|
53
|
+
itemId: string;
|
|
54
|
+
checked: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* `POST /responder/dispatches/:dispatchId/report` - submit, or amend, the
|
|
58
|
+
* response report. The first submission is idempotent on `clientReportId`; an
|
|
59
|
+
* amendment must name the `expectedVersion` it was edited from.
|
|
60
|
+
*/
|
|
61
|
+
export declare class SubmitResponderReportDto {
|
|
62
|
+
clientReportId: string;
|
|
63
|
+
/** Absent for the first submission; the version being amended otherwise. */
|
|
64
|
+
expectedVersion?: number;
|
|
65
|
+
summary: string;
|
|
66
|
+
actionsTaken?: string;
|
|
67
|
+
outcome: ResponderReportOutcome;
|
|
68
|
+
personsContacted?: string;
|
|
69
|
+
handoverTo?: string;
|
|
70
|
+
followUpRequired: boolean;
|
|
71
|
+
followUpNotes?: string;
|
|
72
|
+
remarks?: string;
|
|
73
|
+
checklist?: ResponderChecklistAnswerDto[];
|
|
74
|
+
/** DMS file ids (images, documents, videos) to attach to the incident with this report. */
|
|
75
|
+
attachmentIds?: number[];
|
|
76
|
+
}
|
|
77
|
+
export declare class ResponderPositionSampleDto {
|
|
78
|
+
latitude: number;
|
|
79
|
+
longitude: number;
|
|
80
|
+
accuracyMetres?: number;
|
|
81
|
+
altitudeMetres?: number;
|
|
82
|
+
/** Metres per second, as the phone reports it. */
|
|
83
|
+
speedMetresPerSecond?: number;
|
|
84
|
+
headingDegrees?: number;
|
|
85
|
+
/** When the phone took the fix (ISO 8601) - never the upload time. */
|
|
86
|
+
recordedAt: string;
|
|
87
|
+
/** The OS flagged it as a mock location. Kept and flagged, never used for arrival. */
|
|
88
|
+
isMocked?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* `POST /responder/positions` - positions of the unit the caller is on duty
|
|
92
|
+
* with. The server decides the unit from the caller's active duty session;
|
|
93
|
+
* the client never names one.
|
|
94
|
+
*/
|
|
95
|
+
export declare class ReportResponderPositionsDto {
|
|
96
|
+
samples: ResponderPositionSampleDto[];
|
|
97
|
+
}
|
|
98
|
+
export declare class ResponderLocationPolicyDto {
|
|
99
|
+
onDutyIntervalSeconds?: number;
|
|
100
|
+
activeIntervalSeconds?: number;
|
|
101
|
+
distanceFilterMetres?: number;
|
|
102
|
+
maxAccuracyMetres?: number;
|
|
103
|
+
staleAfterSeconds?: number;
|
|
104
|
+
}
|
|
105
|
+
export declare class ResponderArrivalPolicyDto {
|
|
106
|
+
radiusMetres?: number;
|
|
107
|
+
allowManualConfirmation?: boolean;
|
|
108
|
+
manualReasonRequired?: boolean;
|
|
109
|
+
}
|
|
110
|
+
export declare class ResponderDispatchPolicyDto {
|
|
111
|
+
allowDecline?: boolean;
|
|
112
|
+
declineReasonRequired?: boolean;
|
|
113
|
+
}
|
|
114
|
+
export declare class ResponderChecklistItemDto {
|
|
115
|
+
id: string;
|
|
116
|
+
label: string;
|
|
117
|
+
required: boolean;
|
|
118
|
+
}
|
|
119
|
+
export declare class ResponderReportPolicyDto {
|
|
120
|
+
requiredToComplete?: boolean;
|
|
121
|
+
requiredFields?: ResponderReportField[];
|
|
122
|
+
checklist?: ResponderChecklistItemDto[];
|
|
123
|
+
minPhotos?: number;
|
|
124
|
+
}
|
|
125
|
+
export declare class ResponderEvidencePolicyDto {
|
|
126
|
+
allowPhotos?: boolean;
|
|
127
|
+
allowDocuments?: boolean;
|
|
128
|
+
allowVideo?: boolean;
|
|
129
|
+
maxImageMegabytes?: number;
|
|
130
|
+
maxDocumentMegabytes?: number;
|
|
131
|
+
maxVideoMegabytes?: number;
|
|
132
|
+
}
|
|
133
|
+
export declare class ResponderReporterContactPolicyDto {
|
|
134
|
+
visible?: boolean;
|
|
135
|
+
}
|
|
136
|
+
/** An organization's override of DEFAULT_RESPONDER_POLICY; every part optional. */
|
|
137
|
+
export declare class ResponderPolicyDto {
|
|
138
|
+
location?: ResponderLocationPolicyDto;
|
|
139
|
+
arrival?: ResponderArrivalPolicyDto;
|
|
140
|
+
dispatch?: ResponderDispatchPolicyDto;
|
|
141
|
+
report?: ResponderReportPolicyDto;
|
|
142
|
+
evidence?: ResponderEvidencePolicyDto;
|
|
143
|
+
reporterContact?: ResponderReporterContactPolicyDto;
|
|
144
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The responder app: field personnel (role `Responder`) who staff a response
|
|
3
|
+
* unit, go on duty with it, receive its dispatches on their phone and report
|
|
4
|
+
* progress, arrival, position and the outcome back to the control room.
|
|
5
|
+
*
|
|
6
|
+
* A responder is linked to the units they may staff by an explicit membership
|
|
7
|
+
* (clarion-organization, managed by whoever holds update:response-unit). There
|
|
8
|
+
* is deliberately no implicit link by phone number: a crew phone typed into a
|
|
9
|
+
* unit form is not proof that an app account belongs to that crew.
|
|
10
|
+
*/
|
|
11
|
+
/** Whether a responder is currently on duty with one of their units. */
|
|
12
|
+
export declare enum ResponderDutyStatus {
|
|
13
|
+
ON_DUTY = "ON_DUTY",
|
|
14
|
+
OFF_DUTY = "OFF_DUTY"
|
|
15
|
+
}
|
|
16
|
+
/** A duty session's own lifecycle. One session is ACTIVE per responder at most. */
|
|
17
|
+
export declare enum ResponderDutySessionStatus {
|
|
18
|
+
ACTIVE = "ACTIVE",
|
|
19
|
+
ENDED = "ENDED"
|
|
20
|
+
}
|
|
21
|
+
/** Why a duty session ended. */
|
|
22
|
+
export declare enum ResponderDutyEndReason {
|
|
23
|
+
/** The responder went off duty in the app. */
|
|
24
|
+
RESPONDER = "RESPONDER",
|
|
25
|
+
/** The control room ended it (update:response-unit). */
|
|
26
|
+
CONTROL_CENTRE = "CONTROL_CENTRE",
|
|
27
|
+
/** The responder was removed from the unit while on duty with it. */
|
|
28
|
+
MEMBERSHIP_REMOVED = "MEMBERSHIP_REMOVED",
|
|
29
|
+
/** The unit was deactivated or deleted while the responder was on duty with it. */
|
|
30
|
+
UNIT_DEACTIVATED = "UNIT_DEACTIVATED"
|
|
31
|
+
}
|
|
32
|
+
/** How an arrival on scene was established by the responder. */
|
|
33
|
+
export declare enum ResponderArrivalMethod {
|
|
34
|
+
/** The phone's position was within the organization's arrival radius. */
|
|
35
|
+
GPS = "GPS",
|
|
36
|
+
/** The responder confirmed it by hand (with a reason, when policy asks for one). */
|
|
37
|
+
MANUAL = "MANUAL"
|
|
38
|
+
}
|
|
39
|
+
/** How a response ended, as the responder reports it. */
|
|
40
|
+
export declare enum ResponderReportOutcome {
|
|
41
|
+
RESOLVED_ON_SCENE = "RESOLVED_ON_SCENE",
|
|
42
|
+
HANDED_OVER = "HANDED_OVER",
|
|
43
|
+
REFERRED = "REFERRED",
|
|
44
|
+
NO_ACTION_REQUIRED = "NO_ACTION_REQUIRED",
|
|
45
|
+
FALSE_ALARM = "FALSE_ALARM",
|
|
46
|
+
UNABLE_TO_LOCATE = "UNABLE_TO_LOCATE",
|
|
47
|
+
OTHER = "OTHER"
|
|
48
|
+
}
|
|
49
|
+
/** The free-text fields of a responder report a policy may make mandatory. */
|
|
50
|
+
export declare enum ResponderReportField {
|
|
51
|
+
SUMMARY = "summary",
|
|
52
|
+
ACTIONS_TAKEN = "actionsTaken",
|
|
53
|
+
PERSONS_CONTACTED = "personsContacted",
|
|
54
|
+
HANDOVER_TO = "handoverTo",
|
|
55
|
+
REMARKS = "remarks"
|
|
56
|
+
}
|
|
57
|
+
/** Which dispatches `GET /responder/dispatches` lists. */
|
|
58
|
+
export declare enum ResponderDispatchListState {
|
|
59
|
+
/** DISPATCHED, ACKNOWLEDGED, EN_ROUTE, ON_SCENE. */
|
|
60
|
+
ACTIVE = "ACTIVE",
|
|
61
|
+
/** COMPLETED, CANCELLED, REJECTED. */
|
|
62
|
+
HISTORY = "HISTORY",
|
|
63
|
+
ALL = "ALL"
|
|
64
|
+
}
|
|
65
|
+
/** How a unit's live position reaches clarion-response-tracking. */
|
|
66
|
+
export declare enum ResponderTrackingMode {
|
|
67
|
+
/** The on-duty responder's phone reports the unit's position. */
|
|
68
|
+
PHONE = "PHONE",
|
|
69
|
+
/** The unit has an enabled hardware tracker binding; the phone stays quiet so the two never compete. */
|
|
70
|
+
UNIT_DEVICE = "UNIT_DEVICE",
|
|
71
|
+
/** The caller is not on duty, so no position is accepted. */
|
|
72
|
+
NOT_ON_DUTY = "NOT_ON_DUTY"
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* `data.action` of the pushes clarion-notification sends a responder's phone.
|
|
76
|
+
* Every one carries `dispatchId`, `incidentId` and `route`; none carries the
|
|
77
|
+
* reporter's name, number, address or the incident description, because a
|
|
78
|
+
* push is shown on a lock screen.
|
|
79
|
+
*/
|
|
80
|
+
export declare enum ResponderPushAction {
|
|
81
|
+
/** A unit the responder is on duty with was dispatched. */
|
|
82
|
+
DISPATCH_ASSIGNED = "RESPONDER_DISPATCH_ASSIGNED",
|
|
83
|
+
/** The control room stood the unit down (CANCELLED). */
|
|
84
|
+
DISPATCH_STOOD_DOWN = "RESPONDER_DISPATCH_STOOD_DOWN",
|
|
85
|
+
/** Any other status change made by somebody else (control room, lifecycle, tracking). */
|
|
86
|
+
DISPATCH_UPDATED = "RESPONDER_DISPATCH_UPDATED"
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Machine-readable refusals of the responder endpoints, in the error body's
|
|
90
|
+
* `code` (the same `{statusCode, code, message, ...details}` envelope the
|
|
91
|
+
* dispatch endpoints use).
|
|
92
|
+
*/
|
|
93
|
+
export declare enum ResponderErrorCode {
|
|
94
|
+
/** The caller does not hold the Responder role. */
|
|
95
|
+
NOT_A_RESPONDER = "RESPONDER_NOT_A_RESPONDER",
|
|
96
|
+
/** The responder account has no control centre, so nothing can be scoped. */
|
|
97
|
+
NO_CONTROL_CENTRE = "RESPONDER_NO_CONTROL_CENTRE",
|
|
98
|
+
UNIT_NOT_FOUND = "RESPONDER_UNIT_NOT_FOUND",
|
|
99
|
+
/** The caller is not a member of that unit. */
|
|
100
|
+
NOT_A_UNIT_MEMBER = "RESPONDER_NOT_A_UNIT_MEMBER",
|
|
101
|
+
UNIT_INACTIVE = "RESPONDER_UNIT_INACTIVE",
|
|
102
|
+
/** Already on duty with ANOTHER unit; end that duty first. `details.activeDuty` names it. */
|
|
103
|
+
ALREADY_ON_DUTY = "RESPONDER_ALREADY_ON_DUTY",
|
|
104
|
+
NOT_ON_DUTY = "RESPONDER_NOT_ON_DUTY",
|
|
105
|
+
/** Membership: the user is not a Responder of the unit's organization and control centre. */
|
|
106
|
+
USER_NOT_ELIGIBLE = "RESPONDER_USER_NOT_ELIGIBLE",
|
|
107
|
+
ALREADY_A_MEMBER = "RESPONDER_ALREADY_A_MEMBER",
|
|
108
|
+
MEMBERSHIP_NOT_FOUND = "RESPONDER_MEMBERSHIP_NOT_FOUND",
|
|
109
|
+
/** The dispatch does not exist or is not for one of the caller's units (never says which). */
|
|
110
|
+
DISPATCH_NOT_FOUND = "RESPONDER_DISPATCH_NOT_FOUND",
|
|
111
|
+
/** The move is not one a responder may make from the current status. `details.currentStatus`. */
|
|
112
|
+
INVALID_STATUS_TRANSITION = "RESPONDER_INVALID_STATUS_TRANSITION",
|
|
113
|
+
REASON_REQUIRED = "RESPONDER_REASON_REQUIRED",
|
|
114
|
+
DECLINE_NOT_ALLOWED = "RESPONDER_DECLINE_NOT_ALLOWED",
|
|
115
|
+
MANUAL_ARRIVAL_NOT_ALLOWED = "RESPONDER_MANUAL_ARRIVAL_NOT_ALLOWED",
|
|
116
|
+
/** Completing needs the response report first (organization policy). */
|
|
117
|
+
REPORT_REQUIRED = "RESPONDER_REPORT_REQUIRED",
|
|
118
|
+
/** A report can only be written once the unit reached the scene. */
|
|
119
|
+
REPORT_NOT_ALLOWED = "RESPONDER_REPORT_NOT_ALLOWED",
|
|
120
|
+
/** The report changed since the version the client edited. `details.currentVersion`. */
|
|
121
|
+
REPORT_VERSION_CONFLICT = "RESPONDER_REPORT_VERSION_CONFLICT",
|
|
122
|
+
/** The incident is closed or archived, so its reports can no longer be amended. */
|
|
123
|
+
REPORT_LOCKED = "RESPONDER_REPORT_LOCKED",
|
|
124
|
+
/** A required report field or checklist item is missing. `details.missing`. */
|
|
125
|
+
REPORT_INCOMPLETE = "RESPONDER_REPORT_INCOMPLETE",
|
|
126
|
+
/** An attachment id is not a file the caller may link. */
|
|
127
|
+
ATTACHMENT_NOT_READABLE = "RESPONDER_ATTACHMENT_NOT_READABLE"
|
|
128
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './enums/responder.enums';
|
|
2
|
+
export * from './interfaces/responder-policy';
|
|
3
|
+
export * from './interfaces/responder';
|
|
4
|
+
export * from './interfaces/responder-dispatch';
|
|
5
|
+
export * from './constants/responder.const';
|
|
6
|
+
export * from './dtos/responder.dto';
|
|
7
|
+
export * from './utils/responder.util';
|