clarion-shared-types 1.0.80 → 1.0.81

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.
@@ -24,4 +24,6 @@ __exportStar(require("./interfaces/tracking-provider-connection.dto"), exports);
24
24
  __exportStar(require("./interfaces/tracking-device-binding.dto"), exports);
25
25
  __exportStar(require("./interfaces/tracking-position.dto"), exports);
26
26
  __exportStar(require("./interfaces/tracking-socket-events"), exports);
27
+ __exportStar(require("./interfaces/tracking-operations.dto"), exports);
28
+ __exportStar(require("./interfaces/tracking-playback.dto"), exports);
27
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/tracking/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,sEAAoD;AACpD,uEAAqD;AACrD,0EAAwD;AACxD,2EAAyD;AAEzD,oBAAoB;AACpB,gFAA8D;AAC9D,2EAAyD;AACzD,qEAAmD;AACnD,sEAAoD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/tracking/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,sEAAoD;AACpD,uEAAqD;AACrD,0EAAwD;AACxD,2EAAyD;AAEzD,oBAAoB;AACpB,gFAA8D;AAC9D,2EAAyD;AACzD,qEAAmD;AACnD,sEAAoD;AACpD,uEAAqD;AACrD,qEAAmD"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=tracking-operations.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking-operations.dto.js","sourceRoot":"","sources":["../../../../../src/modules/tracking/interfaces/tracking-operations.dto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=tracking-playback.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking-playback.dto.js","sourceRoot":"","sources":["../../../../../src/modules/tracking/interfaces/tracking-playback.dto.ts"],"names":[],"mappings":""}
@@ -8,4 +8,6 @@ export * from './interfaces/tracking-provider-connection.dto';
8
8
  export * from './interfaces/tracking-device-binding.dto';
9
9
  export * from './interfaces/tracking-position.dto';
10
10
  export * from './interfaces/tracking-socket-events';
11
+ export * from './interfaces/tracking-operations.dto';
12
+ export * from './interfaces/tracking-playback.dto';
11
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/tracking/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AAEzD,oBAAoB;AACpB,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/tracking/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AAEzD,oBAAoB;AACpB,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tracking-operations.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking-operations.dto.js","sourceRoot":"","sources":["../../../../../src/modules/tracking/interfaces/tracking-operations.dto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tracking-playback.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking-playback.dto.js","sourceRoot":"","sources":["../../../../../src/modules/tracking/interfaces/tracking-playback.dto.ts"],"names":[],"mappings":""}
@@ -6,3 +6,5 @@ export * from './interfaces/tracking-provider-connection.dto';
6
6
  export * from './interfaces/tracking-device-binding.dto';
7
7
  export * from './interfaces/tracking-position.dto';
8
8
  export * from './interfaces/tracking-socket-events';
9
+ export * from './interfaces/tracking-operations.dto';
10
+ export * from './interfaces/tracking-playback.dto';
@@ -0,0 +1,124 @@
1
+ import { TrackingConnectionStatus } from '../enums/tracking-connection-status.enum';
2
+ import { TrackingProviderCode } from '../enums/tracking-provider-code.enum';
3
+ /**
4
+ * Frontend contracts for the tracking operations dashboard + reconciliation.
5
+ * Browser-safe: no secrets, no auth frames, no Node-only types. Shapes mirror
6
+ * clarion-response-tracking's OperationsService / ReconciliationService responses.
7
+ */
8
+ export interface TrackingConnectionCountsDto {
9
+ total: number;
10
+ connected: number;
11
+ degraded: number;
12
+ authenticationFailed: number;
13
+ error: number;
14
+ disabled: number;
15
+ }
16
+ export interface TrackingUnitCountsDto {
17
+ mappedUnits: number;
18
+ unmappedUnits: number;
19
+ online: number;
20
+ stale: number;
21
+ offline: number;
22
+ }
23
+ export interface TrackingIngestionSummaryDto {
24
+ messagesReceived: number;
25
+ locationsReceived: number;
26
+ locationsNormalized: number;
27
+ locationsRejected: number;
28
+ duplicates: number;
29
+ outOfOrder: number;
30
+ unmappedSeen: number;
31
+ historyWriteFailures: number;
32
+ redisUpdateFailures: number;
33
+ kafkaPublishFailures: number;
34
+ leaseAcquireFailures: number;
35
+ leaseOwnershipChanges: number;
36
+ reconciliationDiscrepancies: number;
37
+ }
38
+ export interface TrackingOperationsSummaryDto {
39
+ connections: TrackingConnectionCountsDto;
40
+ units: TrackingUnitCountsDto;
41
+ ingestion: TrackingIngestionSummaryDto;
42
+ }
43
+ export interface TrackingProviderSummaryDto {
44
+ id: number;
45
+ name: string;
46
+ organizationId: number;
47
+ controlCentreId: number | null;
48
+ providerCode: TrackingProviderCode;
49
+ connectionStatus: TrackingConnectionStatus;
50
+ enabled: boolean;
51
+ lastConnectedAt: string | null;
52
+ lastEventAt: string | null;
53
+ lastErrorAt: string | null;
54
+ lastErrorCode: string | null;
55
+ /** Sanitized upstream — never contains credentials. */
56
+ lastErrorMessage: string | null;
57
+ /** Optional counts when the API augments provider rows. */
58
+ mappedUnits?: number;
59
+ unmappedUnits?: number;
60
+ reconnectCount?: number;
61
+ }
62
+ export interface TrackingUnitSummaryDto {
63
+ total: number;
64
+ online: number;
65
+ stale: number;
66
+ offline: number;
67
+ }
68
+ /**
69
+ * Per-connection readiness indicators, computed on the frontend from a provider
70
+ * connection + its health (or a future backend readiness endpoint).
71
+ */
72
+ export interface TrackingConfigReadinessDto {
73
+ connectionId: number;
74
+ endpointConfigured: boolean;
75
+ secretReferenceConfigured: boolean;
76
+ normalizationValid: boolean;
77
+ thresholdsValid: boolean;
78
+ enabled: boolean;
79
+ hasSuccessfulConnection: boolean;
80
+ hasRecentEvent: boolean;
81
+ }
82
+ /** Optional per-connection metrics (future endpoint; shape reserved). */
83
+ export interface TrackingProviderMetricsDto {
84
+ connectionId: number;
85
+ connectAttempts?: number;
86
+ successfulConnections?: number;
87
+ authenticationFailures?: number;
88
+ reconnects?: number;
89
+ lastEventAt?: string | null;
90
+ locationsReceived?: number;
91
+ locationsRejected?: number;
92
+ duplicates?: number;
93
+ outOfOrder?: number;
94
+ }
95
+ export type ReconciliationDiscrepancyType = 'missing-in-projection' | 'missing-in-source' | 'control-centre-mismatch' | 'invalid-binding';
96
+ export interface ResponseUnitReconciliationDiscrepancyDto {
97
+ responseUnitId: number;
98
+ type: ReconciliationDiscrepancyType;
99
+ detail?: string;
100
+ }
101
+ export interface ResponseUnitReconciliationResultDto {
102
+ dryRun: boolean;
103
+ organizationId?: number;
104
+ scanned: number;
105
+ created: number;
106
+ updated: number;
107
+ moved: number;
108
+ unchanged: number;
109
+ orphansDetected: number;
110
+ orphansMarkedDeleted: number;
111
+ invalidBindingsSurfaced: number;
112
+ pages: number;
113
+ errors: string[];
114
+ discrepancies?: ResponseUnitReconciliationDiscrepancyDto[];
115
+ }
116
+ export interface ReconcileRequestDto {
117
+ organizationId?: number;
118
+ }
119
+ export interface UnmappedUnitResolutionDto {
120
+ resolved: true;
121
+ }
122
+ export interface ReopenUnmappedUnitDto {
123
+ reopened: true;
124
+ }
@@ -0,0 +1,46 @@
1
+ import { TrackingProviderCode } from '../enums/tracking-provider-code.enum';
2
+ import { TrackingUnitOnlineStatus } from '../enums/tracking-unit-online-status.enum';
3
+ /**
4
+ * Frontend playback contracts for tracking history. A "route" is the processed,
5
+ * client-side representation used by the playback UI — actual provider points
6
+ * plus detected long gaps. Interpolation is visual-only and NEVER sent back to
7
+ * the server / Kafka / Socket.IO.
8
+ */
9
+ export interface TrackingPlaybackPointDto {
10
+ eventId: string;
11
+ responseUnitId: number;
12
+ /** ISO 8601 UTC (actual provider event time — playback is time-driven). */
13
+ eventTime: string;
14
+ receivedAt?: string;
15
+ latitude: number;
16
+ longitude: number;
17
+ speedKph?: number | null;
18
+ /** Degrees clockwise from north, [0,360); null/undefined ⇒ do not rotate. */
19
+ courseDegrees?: number | null;
20
+ moving?: boolean | null;
21
+ accuracyMetres?: number | null;
22
+ status?: TrackingUnitOnlineStatus;
23
+ providerCode?: TrackingProviderCode;
24
+ /** True when the segment leading INTO this point exceeds the gap threshold. */
25
+ gapBefore?: boolean;
26
+ /** Seconds since the previous point (undefined for the first point). */
27
+ secondsSincePrevious?: number;
28
+ }
29
+ export interface TrackingHistoryGapDto {
30
+ /** Index (in the points array) of the point BEFORE the gap. */
31
+ fromIndex: number;
32
+ /** Index of the point AFTER the gap. */
33
+ toIndex: number;
34
+ fromEventTime: string;
35
+ toEventTime: string;
36
+ gapSeconds: number;
37
+ }
38
+ export interface TrackingPlaybackRouteDto {
39
+ responseUnitId: number;
40
+ points: TrackingPlaybackPointDto[];
41
+ gaps: TrackingHistoryGapDto[];
42
+ startEventTime: string | null;
43
+ endEventTime: string | null;
44
+ /** Total actual points (before any downsampling). */
45
+ totalPoints: number;
46
+ }
package/package.json CHANGED
@@ -1,45 +1,45 @@
1
- {
2
- "name": "clarion-shared-types",
3
- "version": "1.0.80",
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.81",
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
+ }