grm-shared-library 1.1.207 → 1.1.208
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/tracking/enums/tracking-provider-code.enum.js +7 -4
- package/dist/cjs/modules/tracking/enums/tracking-provider-code.enum.js.map +1 -1
- package/dist/cjs/modules/tracking/enums/tracking-transport-type.enum.js +3 -3
- package/dist/cjs/modules/tracking/enums/tracking-transport-type.enum.js.map +1 -1
- package/dist/cjs/modules/tracking/index.js +2 -0
- package/dist/cjs/modules/tracking/index.js.map +1 -1
- package/dist/cjs/modules/tracking/interfaces/tracking-provider-descriptor.js +79 -0
- package/dist/cjs/modules/tracking/interfaces/tracking-provider-descriptor.js.map +1 -0
- package/dist/esm/modules/tracking/enums/tracking-provider-code.enum.js +7 -4
- package/dist/esm/modules/tracking/enums/tracking-provider-code.enum.js.map +1 -1
- package/dist/esm/modules/tracking/enums/tracking-transport-type.enum.js +3 -3
- package/dist/esm/modules/tracking/enums/tracking-transport-type.enum.js.map +1 -1
- package/dist/esm/modules/tracking/index.js +2 -0
- package/dist/esm/modules/tracking/index.js.map +1 -1
- package/dist/esm/modules/tracking/interfaces/tracking-provider-descriptor.js +75 -0
- package/dist/esm/modules/tracking/interfaces/tracking-provider-descriptor.js.map +1 -0
- package/dist/types/modules/tracking/enums/tracking-provider-code.enum.d.ts +7 -4
- package/dist/types/modules/tracking/enums/tracking-transport-type.enum.d.ts +3 -3
- package/dist/types/modules/tracking/index.d.ts +1 -0
- package/dist/types/modules/tracking/interfaces/tracking-provider-descriptor.d.ts +117 -0
- package/package.json +1 -1
|
@@ -8,15 +8,18 @@ exports.TrackingProviderCode = void 0;
|
|
|
8
8
|
* per-provider adapter inside clarion-response-tracking understands the raw
|
|
9
9
|
* wire format.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* remaining values are reserved so future adapters can be
|
|
13
|
-
* the shared contracts, database columns or Kafka events.
|
|
11
|
+
* {@link TrackingProviderCode.TELOX} and {@link TrackingProviderCode.WIALON} have
|
|
12
|
+
* working adapters. The remaining values are reserved so future adapters can be
|
|
13
|
+
* added without changing the shared contracts, database columns or Kafka events.
|
|
14
|
+
*
|
|
15
|
+
* A value here does NOT mean the provider can be connected — ask the service
|
|
16
|
+
* (`GET /tracking/providers`, see TrackingProviderDescriptor) which adapters exist.
|
|
14
17
|
*/
|
|
15
18
|
var TrackingProviderCode;
|
|
16
19
|
(function (TrackingProviderCode) {
|
|
17
20
|
/** Telox WebSocket platform (G4S Phase 1 integration). */
|
|
18
21
|
TrackingProviderCode["TELOX"] = "TELOX";
|
|
19
|
-
/** Wialon
|
|
22
|
+
/** Wialon Hosting / Wialon Local, polled over the Remote API. */
|
|
20
23
|
TrackingProviderCode["WIALON"] = "WIALON";
|
|
21
24
|
/** Teltonika direct device ingestion (reserved — not implemented in Phase 1). */
|
|
22
25
|
TrackingProviderCode["TELTONIKA"] = "TELTONIKA";
|
|
@@ -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
|
|
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,IAAY,oBAWX;AAXD,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;AACjD,CAAC,EAXW,oBAAoB,oCAApB,oBAAoB,QAW/B"}
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TrackingTransportType = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* How a provider connection physically transports telemetry into
|
|
6
|
-
* clarion-response-tracking.
|
|
7
|
-
* the remaining values are reserved for future adapters.
|
|
6
|
+
* clarion-response-tracking. {@link WEBSOCKET} (Telox) and {@link HTTP_POLLING}
|
|
7
|
+
* (Wialon) are implemented; the remaining values are reserved for future adapters.
|
|
8
8
|
*/
|
|
9
9
|
var TrackingTransportType;
|
|
10
10
|
(function (TrackingTransportType) {
|
|
11
11
|
/** Outbound WebSocket client maintained by the connector worker (Telox). */
|
|
12
12
|
TrackingTransportType["WEBSOCKET"] = "WEBSOCKET";
|
|
13
|
-
/** Outbound HTTP polling loop. */
|
|
13
|
+
/** Outbound HTTP polling loop maintained by the connector worker (Wialon). */
|
|
14
14
|
TrackingTransportType["HTTP_POLLING"] = "HTTP_POLLING";
|
|
15
15
|
/** Inbound TCP listener (direct device ingestion). */
|
|
16
16
|
TrackingTransportType["TCP"] = "TCP";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracking-transport-type.enum.js","sourceRoot":"","sources":["../../../../../src/modules/tracking/enums/tracking-transport-type.enum.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAC7B,4EAA4E;IAC5E,gDAAuB,CAAA;IACvB,
|
|
1
|
+
{"version":3,"file":"tracking-transport-type.enum.js","sourceRoot":"","sources":["../../../../../src/modules/tracking/enums/tracking-transport-type.enum.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAC7B,4EAA4E;IAC5E,gDAAuB,CAAA;IACvB,8EAA8E;IAC9E,sDAA6B,CAAA;IAC7B,sDAAsD;IACtD,oCAAW,CAAA;IACX,sDAAsD;IACtD,oCAAW,CAAA;IACX,yBAAyB;IACzB,sCAAa,CAAA;AACjB,CAAC,EAXW,qBAAqB,qCAArB,qBAAqB,QAWhC"}
|
|
@@ -32,6 +32,8 @@ __exportStar(require("./interfaces/response-unit-lifecycle-events"), exports);
|
|
|
32
32
|
__exportStar(require("./interfaces/tracking-unit-current-state"), exports);
|
|
33
33
|
__exportStar(require("./interfaces/tracking-socket-payloads"), exports);
|
|
34
34
|
__exportStar(require("./interfaces/tracking-realtime-envelope"), exports);
|
|
35
|
+
// Interfaces — provider catalog (what each adapter needs from an operator)
|
|
36
|
+
__exportStar(require("./interfaces/tracking-provider-descriptor"), exports);
|
|
35
37
|
// Constants
|
|
36
38
|
__exportStar(require("./constants/tracking-kafka.const"), exports);
|
|
37
39
|
// Utilities
|
|
@@ -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;AACzD,sEAAoD;AAEpD,+CAA+C;AAC/C,+EAA6D;AAC7D,+EAA6D;AAC7D,6EAA2D;AAC3D,iFAA+D;AAC/D,iFAA+D;AAC/D,iFAA+D;AAC/D,8EAA4D;AAE5D,+CAA+C;AAC/C,2EAAyD;AACzD,wEAAsD;AACtD,0EAAwD;AAExD,YAAY;AACZ,mEAAiD;AAEjD,YAAY;AACZ,iEAA+C;AAC/C,mEAAiD"}
|
|
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;AACzD,sEAAoD;AAEpD,+CAA+C;AAC/C,+EAA6D;AAC7D,+EAA6D;AAC7D,6EAA2D;AAC3D,iFAA+D;AAC/D,iFAA+D;AAC/D,iFAA+D;AAC/D,8EAA4D;AAE5D,+CAA+C;AAC/C,2EAAyD;AACzD,wEAAsD;AACtD,0EAAwD;AAExD,2EAA2E;AAC3E,4EAA0D;AAE1D,YAAY;AACZ,mEAAiD;AAEjD,YAAY;AACZ,iEAA+C;AAC/C,mEAAiD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildDefaultTrackingProviderConfiguration = buildDefaultTrackingProviderConfiguration;
|
|
4
|
+
exports.validateTrackingProviderSettings = validateTrackingProviderSettings;
|
|
5
|
+
/**
|
|
6
|
+
* The `configuration` a connection gets when the operator supplies none: every
|
|
7
|
+
* setting at its default. Stored explicitly on the connection so that readers
|
|
8
|
+
* which know nothing about adapters (the status evaluator, ingestion guards) see
|
|
9
|
+
* the provider's thresholds rather than the service-wide fallbacks.
|
|
10
|
+
*/
|
|
11
|
+
function buildDefaultTrackingProviderConfiguration(descriptor) {
|
|
12
|
+
const configuration = {};
|
|
13
|
+
for (const setting of descriptor.settings) {
|
|
14
|
+
configuration[setting.key] = setting.defaultValue;
|
|
15
|
+
}
|
|
16
|
+
return configuration;
|
|
17
|
+
}
|
|
18
|
+
function isBlank(value) {
|
|
19
|
+
return value === undefined || value === null || value === '';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validate a raw `configuration` blob against a provider's setting descriptors.
|
|
23
|
+
* Returns human-readable errors (empty ⇒ valid). Absent keys are valid — they
|
|
24
|
+
* take their default. Keys the descriptor does not know are ignored, not
|
|
25
|
+
* rejected: a connection saved before a setting was retired must stay editable.
|
|
26
|
+
*
|
|
27
|
+
* Cross-field rules (e.g. "offline must not precede stale") are the adapter's.
|
|
28
|
+
*/
|
|
29
|
+
function validateTrackingProviderSettings(settings, configuration) {
|
|
30
|
+
var _a;
|
|
31
|
+
const errors = [];
|
|
32
|
+
const config = configuration !== null && configuration !== void 0 ? configuration : {};
|
|
33
|
+
for (const setting of settings) {
|
|
34
|
+
const raw = config[setting.key];
|
|
35
|
+
if (isBlank(raw))
|
|
36
|
+
continue;
|
|
37
|
+
switch (setting.type) {
|
|
38
|
+
case 'number': {
|
|
39
|
+
const value = typeof raw === 'string' ? Number(raw) : raw;
|
|
40
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
41
|
+
errors.push(`${setting.key} must be a finite number`);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
if (setting.integer && !Number.isInteger(value)) {
|
|
45
|
+
errors.push(`${setting.key} must be a whole number`);
|
|
46
|
+
}
|
|
47
|
+
if (setting.min !== undefined && value < setting.min) {
|
|
48
|
+
errors.push(`${setting.key} must be at least ${setting.min}`);
|
|
49
|
+
}
|
|
50
|
+
if (setting.max !== undefined && value > setting.max) {
|
|
51
|
+
errors.push(`${setting.key} must be at most ${setting.max}`);
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case 'boolean':
|
|
56
|
+
if (typeof raw !== 'boolean' && raw !== 'true' && raw !== 'false') {
|
|
57
|
+
errors.push(`${setting.key} must be a boolean`);
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
case 'select': {
|
|
61
|
+
const allowed = ((_a = setting.options) !== null && _a !== void 0 ? _a : []).map((option) => option.value);
|
|
62
|
+
if (!allowed.includes(String(raw))) {
|
|
63
|
+
errors.push(`${setting.key} must be one of ${allowed.join(', ')}`);
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
case 'text':
|
|
68
|
+
if (typeof raw !== 'string') {
|
|
69
|
+
errors.push(`${setting.key} must be text`);
|
|
70
|
+
}
|
|
71
|
+
else if (setting.maxLength !== undefined && raw.length > setting.maxLength) {
|
|
72
|
+
errors.push(`${setting.key} must be at most ${setting.maxLength} characters`);
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return errors;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=tracking-provider-descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking-provider-descriptor.js","sour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BACvE,CAAC;gBACD,MAAM;YACV,CAAC;YACD,KAAK,MAAM;gBACP,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;oBAC1B,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,eAAe,CAAC,CAAC;gBAC/C,CAAC;qBAAM,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;oBAC3E,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,oBAAoB,OAAO,CAAC,SAAS,aAAa,CAAC,CAAC;gBAClF,CAAC;gBACD,MAAM;QACd,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -5,15 +5,18 @@
|
|
|
5
5
|
* per-provider adapter inside clarion-response-tracking understands the raw
|
|
6
6
|
* wire format.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* remaining values are reserved so future adapters can be
|
|
10
|
-
* the shared contracts, database columns or Kafka events.
|
|
8
|
+
* {@link TrackingProviderCode.TELOX} and {@link TrackingProviderCode.WIALON} have
|
|
9
|
+
* working adapters. The remaining values are reserved so future adapters can be
|
|
10
|
+
* added without changing the shared contracts, database columns or Kafka events.
|
|
11
|
+
*
|
|
12
|
+
* A value here does NOT mean the provider can be connected — ask the service
|
|
13
|
+
* (`GET /tracking/providers`, see TrackingProviderDescriptor) which adapters exist.
|
|
11
14
|
*/
|
|
12
15
|
export var TrackingProviderCode;
|
|
13
16
|
(function (TrackingProviderCode) {
|
|
14
17
|
/** Telox WebSocket platform (G4S Phase 1 integration). */
|
|
15
18
|
TrackingProviderCode["TELOX"] = "TELOX";
|
|
16
|
-
/** Wialon
|
|
19
|
+
/** Wialon Hosting / Wialon Local, polled over the Remote API. */
|
|
17
20
|
TrackingProviderCode["WIALON"] = "WIALON";
|
|
18
21
|
/** Teltonika direct device ingestion (reserved — not implemented in Phase 1). */
|
|
19
22
|
TrackingProviderCode["TELTONIKA"] = "TELTONIKA";
|
|
@@ -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
|
|
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,oBAWX;AAXD,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;AACjD,CAAC,EAXW,oBAAoB,KAApB,oBAAoB,QAW/B"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* How a provider connection physically transports telemetry into
|
|
3
|
-
* clarion-response-tracking.
|
|
4
|
-
* the remaining values are reserved for future adapters.
|
|
3
|
+
* clarion-response-tracking. {@link WEBSOCKET} (Telox) and {@link HTTP_POLLING}
|
|
4
|
+
* (Wialon) are implemented; the remaining values are reserved for future adapters.
|
|
5
5
|
*/
|
|
6
6
|
export var TrackingTransportType;
|
|
7
7
|
(function (TrackingTransportType) {
|
|
8
8
|
/** Outbound WebSocket client maintained by the connector worker (Telox). */
|
|
9
9
|
TrackingTransportType["WEBSOCKET"] = "WEBSOCKET";
|
|
10
|
-
/** Outbound HTTP polling loop. */
|
|
10
|
+
/** Outbound HTTP polling loop maintained by the connector worker (Wialon). */
|
|
11
11
|
TrackingTransportType["HTTP_POLLING"] = "HTTP_POLLING";
|
|
12
12
|
/** Inbound TCP listener (direct device ingestion). */
|
|
13
13
|
TrackingTransportType["TCP"] = "TCP";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracking-transport-type.enum.js","sourceRoot":"","sources":["../../../../../src/modules/tracking/enums/tracking-transport-type.enum.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAC7B,4EAA4E;IAC5E,gDAAuB,CAAA;IACvB,
|
|
1
|
+
{"version":3,"file":"tracking-transport-type.enum.js","sourceRoot":"","sources":["../../../../../src/modules/tracking/enums/tracking-transport-type.enum.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAC7B,4EAA4E;IAC5E,gDAAuB,CAAA;IACvB,8EAA8E;IAC9E,sDAA6B,CAAA;IAC7B,sDAAsD;IACtD,oCAAW,CAAA;IACX,sDAAsD;IACtD,oCAAW,CAAA;IACX,yBAAyB;IACzB,sCAAa,CAAA;AACjB,CAAC,EAXW,qBAAqB,KAArB,qBAAqB,QAWhC"}
|
|
@@ -16,6 +16,8 @@ export * from './interfaces/response-unit-lifecycle-events';
|
|
|
16
16
|
export * from './interfaces/tracking-unit-current-state';
|
|
17
17
|
export * from './interfaces/tracking-socket-payloads';
|
|
18
18
|
export * from './interfaces/tracking-realtime-envelope';
|
|
19
|
+
// Interfaces — provider catalog (what each adapter needs from an operator)
|
|
20
|
+
export * from './interfaces/tracking-provider-descriptor';
|
|
19
21
|
// Constants
|
|
20
22
|
export * from './constants/tracking-kafka.const';
|
|
21
23
|
// Utilities
|
|
@@ -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;AACzD,cAAc,qCAAqC,CAAC;AAEpD,+CAA+C;AAC/C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6CAA6C,CAAC;AAE5D,+CAA+C;AAC/C,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AAExD,YAAY;AACZ,cAAc,kCAAkC,CAAC;AAEjD,YAAY;AACZ,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,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;AACzD,cAAc,qCAAqC,CAAC;AAEpD,+CAA+C;AAC/C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6CAA6C,CAAC;AAE5D,+CAA+C;AAC/C,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AAExD,2EAA2E;AAC3E,cAAc,2CAA2C,CAAC;AAE1D,YAAY;AACZ,cAAc,kCAAkC,CAAC;AAEjD,YAAY;AACZ,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `configuration` a connection gets when the operator supplies none: every
|
|
3
|
+
* setting at its default. Stored explicitly on the connection so that readers
|
|
4
|
+
* which know nothing about adapters (the status evaluator, ingestion guards) see
|
|
5
|
+
* the provider's thresholds rather than the service-wide fallbacks.
|
|
6
|
+
*/
|
|
7
|
+
export function buildDefaultTrackingProviderConfiguration(descriptor) {
|
|
8
|
+
const configuration = {};
|
|
9
|
+
for (const setting of descriptor.settings) {
|
|
10
|
+
configuration[setting.key] = setting.defaultValue;
|
|
11
|
+
}
|
|
12
|
+
return configuration;
|
|
13
|
+
}
|
|
14
|
+
function isBlank(value) {
|
|
15
|
+
return value === undefined || value === null || value === '';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Validate a raw `configuration` blob against a provider's setting descriptors.
|
|
19
|
+
* Returns human-readable errors (empty ⇒ valid). Absent keys are valid — they
|
|
20
|
+
* take their default. Keys the descriptor does not know are ignored, not
|
|
21
|
+
* rejected: a connection saved before a setting was retired must stay editable.
|
|
22
|
+
*
|
|
23
|
+
* Cross-field rules (e.g. "offline must not precede stale") are the adapter's.
|
|
24
|
+
*/
|
|
25
|
+
export function validateTrackingProviderSettings(settings, configuration) {
|
|
26
|
+
var _a;
|
|
27
|
+
const errors = [];
|
|
28
|
+
const config = configuration !== null && configuration !== void 0 ? configuration : {};
|
|
29
|
+
for (const setting of settings) {
|
|
30
|
+
const raw = config[setting.key];
|
|
31
|
+
if (isBlank(raw))
|
|
32
|
+
continue;
|
|
33
|
+
switch (setting.type) {
|
|
34
|
+
case 'number': {
|
|
35
|
+
const value = typeof raw === 'string' ? Number(raw) : raw;
|
|
36
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
37
|
+
errors.push(`${setting.key} must be a finite number`);
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
if (setting.integer && !Number.isInteger(value)) {
|
|
41
|
+
errors.push(`${setting.key} must be a whole number`);
|
|
42
|
+
}
|
|
43
|
+
if (setting.min !== undefined && value < setting.min) {
|
|
44
|
+
errors.push(`${setting.key} must be at least ${setting.min}`);
|
|
45
|
+
}
|
|
46
|
+
if (setting.max !== undefined && value > setting.max) {
|
|
47
|
+
errors.push(`${setting.key} must be at most ${setting.max}`);
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
case 'boolean':
|
|
52
|
+
if (typeof raw !== 'boolean' && raw !== 'true' && raw !== 'false') {
|
|
53
|
+
errors.push(`${setting.key} must be a boolean`);
|
|
54
|
+
}
|
|
55
|
+
break;
|
|
56
|
+
case 'select': {
|
|
57
|
+
const allowed = ((_a = setting.options) !== null && _a !== void 0 ? _a : []).map((option) => option.value);
|
|
58
|
+
if (!allowed.includes(String(raw))) {
|
|
59
|
+
errors.push(`${setting.key} must be one of ${allowed.join(', ')}`);
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
case 'text':
|
|
64
|
+
if (typeof raw !== 'string') {
|
|
65
|
+
errors.push(`${setting.key} must be text`);
|
|
66
|
+
}
|
|
67
|
+
else if (setting.maxLength !== undefined && raw.length > setting.maxLength) {
|
|
68
|
+
errors.push(`${setting.key} must be at most ${setting.maxLength} characters`);
|
|
69
|
+
}
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return errors;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=tracking-provider-descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking-provider-descriptor.js","sourceRoot":"","sources":["../../../../../src/modules/tracking/interfaces/tracking-provider-descriptor.ts"],"names":[],"mappings":"AA+GA;;;;;GAKG;AACH,MAAM,UAAU,yCAAyC,CACrD,UAAwD;IAExD,MAAM,aAAa,GAA8C,EAAE,CAAC;IACpE,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;IACtD,CAAC;IACD,OAAO,aAAa,CAAC;AACzB,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC3B,OAAO,KAAK,KAAK,SAAS,IAAI,K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IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -5,14 +5,17 @@
|
|
|
5
5
|
* per-provider adapter inside clarion-response-tracking understands the raw
|
|
6
6
|
* wire format.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* remaining values are reserved so future adapters can be
|
|
10
|
-
* the shared contracts, database columns or Kafka events.
|
|
8
|
+
* {@link TrackingProviderCode.TELOX} and {@link TrackingProviderCode.WIALON} have
|
|
9
|
+
* working adapters. The remaining values are reserved so future adapters can be
|
|
10
|
+
* added without changing the shared contracts, database columns or Kafka events.
|
|
11
|
+
*
|
|
12
|
+
* A value here does NOT mean the provider can be connected — ask the service
|
|
13
|
+
* (`GET /tracking/providers`, see TrackingProviderDescriptor) which adapters exist.
|
|
11
14
|
*/
|
|
12
15
|
export declare enum TrackingProviderCode {
|
|
13
16
|
/** Telox WebSocket platform (G4S Phase 1 integration). */
|
|
14
17
|
TELOX = "TELOX",
|
|
15
|
-
/** Wialon
|
|
18
|
+
/** Wialon Hosting / Wialon Local, polled over the Remote API. */
|
|
16
19
|
WIALON = "WIALON",
|
|
17
20
|
/** Teltonika direct device ingestion (reserved — not implemented in Phase 1). */
|
|
18
21
|
TELTONIKA = "TELTONIKA",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* How a provider connection physically transports telemetry into
|
|
3
|
-
* clarion-response-tracking.
|
|
4
|
-
* the remaining values are reserved for future adapters.
|
|
3
|
+
* clarion-response-tracking. {@link WEBSOCKET} (Telox) and {@link HTTP_POLLING}
|
|
4
|
+
* (Wialon) are implemented; the remaining values are reserved for future adapters.
|
|
5
5
|
*/
|
|
6
6
|
export declare enum TrackingTransportType {
|
|
7
7
|
/** Outbound WebSocket client maintained by the connector worker (Telox). */
|
|
8
8
|
WEBSOCKET = "WEBSOCKET",
|
|
9
|
-
/** Outbound HTTP polling loop. */
|
|
9
|
+
/** Outbound HTTP polling loop maintained by the connector worker (Wialon). */
|
|
10
10
|
HTTP_POLLING = "HTTP_POLLING",
|
|
11
11
|
/** Inbound TCP listener (direct device ingestion). */
|
|
12
12
|
TCP = "TCP",
|
|
@@ -13,6 +13,7 @@ export * from './interfaces/response-unit-lifecycle-events';
|
|
|
13
13
|
export * from './interfaces/tracking-unit-current-state';
|
|
14
14
|
export * from './interfaces/tracking-socket-payloads';
|
|
15
15
|
export * from './interfaces/tracking-realtime-envelope';
|
|
16
|
+
export * from './interfaces/tracking-provider-descriptor';
|
|
16
17
|
export * from './constants/tracking-kafka.const';
|
|
17
18
|
export * from './utils/tracking-event-id.util';
|
|
18
19
|
export * from './utils/tracking-validation.util';
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { TrackingProviderCode } from '../enums/tracking-provider-code.enum';
|
|
2
|
+
import { TrackingTransportType } from '../enums/tracking-transport-type.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Self-description of a tracking provider, published by clarion-response-tracking
|
|
5
|
+
* (`GET /tracking/providers`) and rendered by the admin client.
|
|
6
|
+
*
|
|
7
|
+
* Why it exists: every provider needs different things from an operator. Telox
|
|
8
|
+
* wants a WebSocket URL, a username, a domain and a password; Wialon wants an
|
|
9
|
+
* HTTPS host and an API token and has no domain at all; and each scales its raw
|
|
10
|
+
* telemetry differently. Encoding that in the client meant a form that only fit
|
|
11
|
+
* one provider and defaults that had to be kept in step with the service by hand.
|
|
12
|
+
* With a descriptor the service that owns the adapter is the single source of
|
|
13
|
+
* truth: adding a provider changes no client code, and a default can never drift.
|
|
14
|
+
*
|
|
15
|
+
* Only providers with a registered adapter are described, so the catalog also
|
|
16
|
+
* answers "which providers can I actually connect?" — the enum alone cannot,
|
|
17
|
+
* because it reserves codes for adapters that do not exist yet.
|
|
18
|
+
*
|
|
19
|
+
* SECURITY: a descriptor is static metadata. It never carries a secret, a secret
|
|
20
|
+
* reference, or anything tenant-specific.
|
|
21
|
+
*/
|
|
22
|
+
export type TrackingProviderSettingType = 'number' | 'boolean' | 'select' | 'text';
|
|
23
|
+
export interface TrackingProviderSettingOption {
|
|
24
|
+
value: string;
|
|
25
|
+
label: string;
|
|
26
|
+
}
|
|
27
|
+
/** One key of a provider connection's `configuration` blob. */
|
|
28
|
+
export interface TrackingProviderSettingDescriptor {
|
|
29
|
+
/** The `configuration` key this setting is stored under. */
|
|
30
|
+
key: string;
|
|
31
|
+
label: string;
|
|
32
|
+
type: TrackingProviderSettingType;
|
|
33
|
+
/** Key of the {@link TrackingProviderSettingGroupDescriptor} it is shown under. */
|
|
34
|
+
group: string;
|
|
35
|
+
/** Applied by the service when the key is absent, and pre-filled by the client. */
|
|
36
|
+
defaultValue: number | boolean | string;
|
|
37
|
+
description?: string;
|
|
38
|
+
/** Display unit, e.g. `s`, `m`, `km/h`. */
|
|
39
|
+
unit?: string;
|
|
40
|
+
/** `number` settings only. Bounds are inclusive and enforced by the service. */
|
|
41
|
+
min?: number;
|
|
42
|
+
max?: number;
|
|
43
|
+
step?: number;
|
|
44
|
+
/** `number` settings only: reject fractional values. */
|
|
45
|
+
integer?: boolean;
|
|
46
|
+
/** `text` settings only. */
|
|
47
|
+
maxLength?: number;
|
|
48
|
+
/** `select` settings only: the closed set of accepted values. */
|
|
49
|
+
options?: TrackingProviderSettingOption[];
|
|
50
|
+
}
|
|
51
|
+
export interface TrackingProviderSettingGroupDescriptor {
|
|
52
|
+
key: string;
|
|
53
|
+
label: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
}
|
|
56
|
+
/** An optional connection field whose meaning (or existence) depends on the provider. */
|
|
57
|
+
export interface TrackingProviderFieldDescriptor {
|
|
58
|
+
/** false ⇒ the provider has no such concept: hide the field and send nothing. */
|
|
59
|
+
used: boolean;
|
|
60
|
+
required: boolean;
|
|
61
|
+
label: string;
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface TrackingProviderEndpointDescriptor {
|
|
66
|
+
label: string;
|
|
67
|
+
placeholder: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
/** Pre-filled for providers with one well-known public endpoint. */
|
|
70
|
+
defaultValue?: string;
|
|
71
|
+
/** Accepted URL schemes, with the trailing colon: `wss:`, `https:`… */
|
|
72
|
+
protocols: string[];
|
|
73
|
+
}
|
|
74
|
+
/** What the referenced secret must contain. Describes the secret; never holds it. */
|
|
75
|
+
export interface TrackingProviderSecretDescriptor {
|
|
76
|
+
label: string;
|
|
77
|
+
description: string;
|
|
78
|
+
placeholder?: string;
|
|
79
|
+
}
|
|
80
|
+
/** How the provider identifies a unit — what an operator binds to a response unit. */
|
|
81
|
+
export interface TrackingProviderExternalUnitDescriptor {
|
|
82
|
+
label: string;
|
|
83
|
+
description: string;
|
|
84
|
+
placeholder?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface TrackingProviderDescriptor {
|
|
87
|
+
providerCode: TrackingProviderCode;
|
|
88
|
+
displayName: string;
|
|
89
|
+
description: string;
|
|
90
|
+
/** Supported transports; the first is the default. */
|
|
91
|
+
transportTypes: TrackingTransportType[];
|
|
92
|
+
endpoint: TrackingProviderEndpointDescriptor;
|
|
93
|
+
externalUsername: TrackingProviderFieldDescriptor;
|
|
94
|
+
externalDomain: TrackingProviderFieldDescriptor;
|
|
95
|
+
secret: TrackingProviderSecretDescriptor;
|
|
96
|
+
externalUnitId: TrackingProviderExternalUnitDescriptor;
|
|
97
|
+
/** Display order of the setting groups. */
|
|
98
|
+
settingGroups: TrackingProviderSettingGroupDescriptor[];
|
|
99
|
+
settings: TrackingProviderSettingDescriptor[];
|
|
100
|
+
documentationUrl?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The `configuration` a connection gets when the operator supplies none: every
|
|
104
|
+
* setting at its default. Stored explicitly on the connection so that readers
|
|
105
|
+
* which know nothing about adapters (the status evaluator, ingestion guards) see
|
|
106
|
+
* the provider's thresholds rather than the service-wide fallbacks.
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildDefaultTrackingProviderConfiguration(descriptor: Pick<TrackingProviderDescriptor, 'settings'>): Record<string, number | boolean | string>;
|
|
109
|
+
/**
|
|
110
|
+
* Validate a raw `configuration` blob against a provider's setting descriptors.
|
|
111
|
+
* Returns human-readable errors (empty ⇒ valid). Absent keys are valid — they
|
|
112
|
+
* take their default. Keys the descriptor does not know are ignored, not
|
|
113
|
+
* rejected: a connection saved before a setting was retired must stay editable.
|
|
114
|
+
*
|
|
115
|
+
* Cross-field rules (e.g. "offline must not precede stale") are the adapter's.
|
|
116
|
+
*/
|
|
117
|
+
export declare function validateTrackingProviderSettings(settings: readonly TrackingProviderSettingDescriptor[], configuration: Record<string, unknown> | null | undefined): string[];
|