@dative-gpi/foundation-core-domain 0.0.101 → 0.0.103
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/models/alerts/alertInfos.ts +106 -106
- package/models/alerts/alertState.ts +4 -4
- package/models/authTokens/authTokenInfos.ts +3 -3
- package/models/comments/commentInfos.ts +33 -33
- package/models/connectivityAlerts/connectivityAlertInfos.ts +3 -3
- package/models/customPropertyValues/customPropertyValueInfos.ts +2 -2
- package/models/deviceConnectivities/deviceConnectivityInfos.ts +4 -4
- package/models/deviceOrganisations/deviceOrganisationAlert.ts +3 -3
- package/models/deviceStatuses/deviceStatusInfos.ts +4 -4
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/models";
|
|
2
|
-
import {
|
|
2
|
+
import { utcToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
|
|
3
3
|
|
|
4
4
|
import { AlertDataDefinition, AlertDataDefinitionDTO } from "./alertDataDefinition";
|
|
5
5
|
import { AlertState, AlertStateDTO } from "./alertState";
|
|
@@ -7,116 +7,116 @@ import { SelectedEntities } from "../enums/sharedEnums";
|
|
|
7
7
|
import { DateVariable } from "../shared/dateVariable";
|
|
8
8
|
|
|
9
9
|
export class AlertInfos {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
10
|
+
id: string;
|
|
11
|
+
scenarioId: string;
|
|
12
|
+
scenarioLabel: string;
|
|
13
|
+
organisationId: string;
|
|
14
|
+
deviceOrganisationId: string;
|
|
15
|
+
deviceOrganisationImageId: string | null;
|
|
16
|
+
deviceOrganisationCode: string;
|
|
17
|
+
deviceOrganisationLabel: string;
|
|
18
|
+
icon: string;
|
|
19
|
+
code: string;
|
|
20
|
+
label: string;
|
|
21
|
+
criticity: Criticity;
|
|
22
|
+
acknowledged: boolean;
|
|
23
|
+
acknowledgingUserId: string | null;
|
|
24
|
+
acknowledgingUserName: string | null;
|
|
25
|
+
acknowledgingUserImageId: string | null;
|
|
26
|
+
acknowledgingTimestamp: number | null;
|
|
27
|
+
initialState: AlertState;
|
|
28
|
+
triggerSourceTimestamp: number | null;
|
|
29
|
+
triggerEnqueuedTimestamp: number | null;
|
|
30
|
+
triggerProcessedTimestamp: number | null;
|
|
31
|
+
lastState: AlertState;
|
|
32
|
+
currentSourceTimestamp: number | null;
|
|
33
|
+
currentEnqueuedTimestamp: number | null;
|
|
34
|
+
currentProcessedTimestamp: number | null;
|
|
35
|
+
status: AlertStatus;
|
|
36
|
+
tags: string[];
|
|
37
|
+
history: AlertState[];
|
|
38
|
+
groupByValues: AlertDataDefinition[];
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
40
|
+
constructor(params: AlertInfosDTO) {
|
|
41
|
+
this.id = params.id;
|
|
42
|
+
this.scenarioId = params.scenarioId;
|
|
43
|
+
this.scenarioLabel = params.scenarioLabel;
|
|
44
|
+
this.organisationId = params.organisationId;
|
|
45
|
+
this.deviceOrganisationId = params.deviceOrganisationId;
|
|
46
|
+
this.deviceOrganisationImageId = params.deviceOrganisationImageId;
|
|
47
|
+
this.deviceOrganisationCode = params.deviceOrganisationCode;
|
|
48
|
+
this.deviceOrganisationLabel = params.deviceOrganisationLabel;
|
|
49
|
+
this.icon = params.icon;
|
|
50
|
+
this.code = params.code;
|
|
51
|
+
this.label = params.label;
|
|
52
|
+
this.criticity = params.criticity;
|
|
53
|
+
this.acknowledged = params.acknowledged;
|
|
54
|
+
this.acknowledgingUserId = params.acknowledgingUserId;
|
|
55
|
+
this.acknowledgingUserName = params.acknowledgingUserName;
|
|
56
|
+
this.acknowledgingUserImageId = params.acknowledgingUserImageId;
|
|
57
|
+
this.acknowledgingTimestamp = params.acknowledgingTimestamp ?
|
|
58
|
+
utcToEpoch(params.acknowledgingTimestamp) : null;
|
|
59
|
+
this.initialState = new AlertState(params.initialState);
|
|
60
|
+
this.triggerSourceTimestamp = params.triggerSourceTimestamp ?
|
|
61
|
+
utcToEpoch(params.triggerSourceTimestamp) : null;
|
|
62
|
+
this.triggerEnqueuedTimestamp = params.triggerEnqueuedTimestamp ?
|
|
63
|
+
utcToEpoch(params.triggerEnqueuedTimestamp) : null;
|
|
64
|
+
this.triggerProcessedTimestamp = params.triggerProcessedTimestamp ?
|
|
65
|
+
utcToEpoch(params.triggerProcessedTimestamp) : null;
|
|
66
|
+
this.lastState = new AlertState(params.lastState);
|
|
67
|
+
this.currentSourceTimestamp = params.currentSourceTimestamp ?
|
|
68
|
+
utcToEpoch(params.currentSourceTimestamp) : null;
|
|
69
|
+
this.currentEnqueuedTimestamp = params.currentEnqueuedTimestamp ?
|
|
70
|
+
utcToEpoch(params.currentEnqueuedTimestamp) : null;
|
|
71
|
+
this.currentProcessedTimestamp = params.currentProcessedTimestamp ?
|
|
72
|
+
utcToEpoch(params.currentProcessedTimestamp) : null;
|
|
73
|
+
this.status = params.status;
|
|
74
|
+
this.tags = params.tags;
|
|
75
|
+
this.history = params.history.map(dto => new AlertState(dto));
|
|
76
|
+
this.groupByValues = params.groupByValues.map(dto => new AlertDataDefinition(dto));
|
|
77
|
+
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export interface AlertInfosDTO {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
81
|
+
id: string;
|
|
82
|
+
scenarioId: string;
|
|
83
|
+
scenarioLabel: string;
|
|
84
|
+
organisationId: string;
|
|
85
|
+
deviceOrganisationId: string;
|
|
86
|
+
deviceOrganisationImageId: string | null;
|
|
87
|
+
deviceOrganisationCode: string;
|
|
88
|
+
deviceOrganisationLabel: string;
|
|
89
|
+
icon: string;
|
|
90
|
+
code: string;
|
|
91
|
+
label: string;
|
|
92
|
+
criticity: Criticity;
|
|
93
|
+
acknowledged: boolean;
|
|
94
|
+
acknowledgingUserId: string | null;
|
|
95
|
+
acknowledgingUserName: string | null;
|
|
96
|
+
acknowledgingUserImageId: string | null;
|
|
97
|
+
acknowledgingTimestamp: string | null;
|
|
98
|
+
initialState: AlertStateDTO;
|
|
99
|
+
triggerSourceTimestamp: string | null;
|
|
100
|
+
triggerEnqueuedTimestamp: string | null;
|
|
101
|
+
triggerProcessedTimestamp: string | null;
|
|
102
|
+
lastState: AlertStateDTO;
|
|
103
|
+
currentSourceTimestamp: string | null;
|
|
104
|
+
currentEnqueuedTimestamp: string | null;
|
|
105
|
+
currentProcessedTimestamp: string | null;
|
|
106
|
+
status: AlertStatus;
|
|
107
|
+
tags: string[];
|
|
108
|
+
history: AlertStateDTO[];
|
|
109
|
+
groupByValues: AlertDataDefinitionDTO[];
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
export interface AlertFilters {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
113
|
+
scenarioId: string | null;
|
|
114
|
+
deviceOrganisationId: string | null;
|
|
115
|
+
statuses: AlertStatus[] | null;
|
|
116
|
+
acknowledged: boolean | null;
|
|
117
|
+
startDate: string | null;
|
|
118
|
+
endDate: string | null;
|
|
119
|
+
selectedEntities: SelectedEntities | null;
|
|
120
|
+
entitiesIds: string[] | null;
|
|
121
|
+
dateVariables: DateVariable[] | null;
|
|
122
122
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AlertStatus } from "@dative-gpi/foundation-shared-domain/models";
|
|
2
|
-
import {
|
|
2
|
+
import { utcToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
|
|
3
3
|
|
|
4
4
|
import { AlertDataDefinition, AlertDataDefinitionDTO } from "./alertDataDefinition";
|
|
5
5
|
|
|
@@ -14,9 +14,9 @@ export class AlertState {
|
|
|
14
14
|
constructor(params: AlertStateDTO) {
|
|
15
15
|
this.id = params.id;
|
|
16
16
|
this.status = params.status;
|
|
17
|
-
this.sourceTimestamp =
|
|
18
|
-
this.enqueuedTimestamp =
|
|
19
|
-
this.processedTimestamp =
|
|
17
|
+
this.sourceTimestamp = utcToEpoch(params.sourceTimestamp);
|
|
18
|
+
this.enqueuedTimestamp = utcToEpoch(params.enqueuedTimestamp);
|
|
19
|
+
this.processedTimestamp = utcToEpoch(params.processedTimestamp);
|
|
20
20
|
this.metadataValues = params.metadataValues?.map(dto => new AlertDataDefinition(dto));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { utcToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
|
|
2
2
|
|
|
3
3
|
export class AuthTokenInfos {
|
|
4
4
|
id: string;
|
|
@@ -11,8 +11,8 @@ export class AuthTokenInfos {
|
|
|
11
11
|
this.id = params.id;
|
|
12
12
|
this.userId = params.userId;
|
|
13
13
|
this.label = params.label;
|
|
14
|
-
this.creationDate =
|
|
15
|
-
this.dateMax =
|
|
14
|
+
this.creationDate = utcToEpoch(params.creationDate);
|
|
15
|
+
this.dateMax = utcToEpoch(params.dateMax);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { utcToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
|
|
2
2
|
|
|
3
3
|
export class CommentInfos {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
4
|
+
id: string;
|
|
5
|
+
alertId: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
userName: string;
|
|
8
|
+
userImageId: string | null;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
comment: string;
|
|
11
|
+
edited: boolean;
|
|
12
|
+
editTimestamp: number | null;
|
|
13
|
+
|
|
14
|
+
constructor(params: CommentInfosDTO) {
|
|
15
|
+
this.id = params.id;
|
|
16
|
+
this.alertId = params.alertId;
|
|
17
|
+
this.userId = params.userId;
|
|
18
|
+
this.userName = params.userName;
|
|
19
|
+
this.userImageId = params.userImageId;
|
|
20
|
+
this.timestamp = utcToEpoch(params.timestamp)!;
|
|
21
|
+
this.comment = params.comment;
|
|
22
|
+
this.edited = params.edited;
|
|
23
|
+
this.editTimestamp = params.editTimestamp ?
|
|
24
|
+
utcToEpoch(params.editTimestamp) : null;
|
|
25
|
+
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export interface CommentInfosDTO {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
id: string;
|
|
30
|
+
alertId: string;
|
|
31
|
+
userId: string;
|
|
32
|
+
userName: string;
|
|
33
|
+
userImageId: string | null;
|
|
34
|
+
timestamp: string;
|
|
35
|
+
comment: string;
|
|
36
|
+
edited: boolean;
|
|
37
|
+
editTimestamp: string | null;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export interface CommentFilters {
|
|
41
|
-
|
|
41
|
+
alertId: string;
|
|
42
42
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AlertStatus } from "@dative-gpi/foundation-shared-domain/models";
|
|
2
|
-
import {
|
|
2
|
+
import { utcToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
|
|
3
3
|
|
|
4
4
|
import { DeviceConnectivityInfos, DeviceConnectivityInfosDTO } from "../deviceConnectivities/deviceConnectivityInfos";
|
|
5
5
|
|
|
@@ -24,9 +24,9 @@ export class ConnectivityAlertInfos {
|
|
|
24
24
|
this.deviceOrganisationImageId = params.deviceOrganisationImageId;
|
|
25
25
|
this.deviceOrganisationConnectivity = params.deviceOrganisationConnectivity ?
|
|
26
26
|
new DeviceConnectivityInfos({ ...params.deviceOrganisationConnectivity, id: params.deviceOrganisationId }) : null;
|
|
27
|
-
this.triggerProcessedTimestamp =
|
|
27
|
+
this.triggerProcessedTimestamp = utcToEpoch(params.triggerProcessedTimestamp);
|
|
28
28
|
this.resolveProcessedTimestamp = params.resolveProcessedTimestamp ?
|
|
29
|
-
|
|
29
|
+
utcToEpoch(params.resolveProcessedTimestamp) : null;
|
|
30
30
|
this.status = params.status;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { utcToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
|
|
2
2
|
|
|
3
3
|
export class CustomPropertyValueInfos {
|
|
4
4
|
value: string;
|
|
@@ -7,7 +7,7 @@ export class CustomPropertyValueInfos {
|
|
|
7
7
|
constructor(params: CustomPropertyValueInfosDTO) {
|
|
8
8
|
this.value = params.value;
|
|
9
9
|
this.timestamp = params.timestamp ?
|
|
10
|
-
|
|
10
|
+
utcToEpoch(params.timestamp) : null;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/models";
|
|
2
|
-
import {
|
|
2
|
+
import { utcToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
|
|
3
3
|
|
|
4
4
|
export class DeviceConnectivityInfos {
|
|
5
5
|
id: string;
|
|
@@ -13,11 +13,11 @@ export class DeviceConnectivityInfos {
|
|
|
13
13
|
constructor(params: DeviceConnectivityInfosDTO) {
|
|
14
14
|
this.id = params.id;
|
|
15
15
|
this.sourceTimestamp = params.sourceTimestamp ?
|
|
16
|
-
|
|
16
|
+
utcToEpoch(params.sourceTimestamp) : null;
|
|
17
17
|
this.enqueuedTimestamp = params.enqueuedTimestamp ?
|
|
18
|
-
|
|
18
|
+
utcToEpoch(params.enqueuedTimestamp) : null;
|
|
19
19
|
this.processedTimestamp = params.processedTimestamp ?
|
|
20
|
-
|
|
20
|
+
utcToEpoch(params.processedTimestamp) : null;
|
|
21
21
|
this.status = params.status;
|
|
22
22
|
this.icon = params.icon;
|
|
23
23
|
this.color = params.color;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/models";
|
|
2
|
-
import {
|
|
2
|
+
import { utcToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
|
|
3
3
|
|
|
4
4
|
export class DeviceOrganisationAlert {
|
|
5
5
|
id: string;
|
|
@@ -14,8 +14,8 @@ export class DeviceOrganisationAlert {
|
|
|
14
14
|
this.label = params.label;
|
|
15
15
|
this.status = params.status;
|
|
16
16
|
this.criticity = params.criticity;
|
|
17
|
-
this.sourceTimestamp = params.sourceTimestamp ?
|
|
18
|
-
this.enqueuedTimestamp = params.enqueuedTimestamp ?
|
|
17
|
+
this.sourceTimestamp = params.sourceTimestamp ? utcToEpoch(params.sourceTimestamp) : undefined;
|
|
18
|
+
this.enqueuedTimestamp = params.enqueuedTimestamp ? utcToEpoch(params.enqueuedTimestamp) : undefined;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { utcToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
|
|
2
2
|
|
|
3
3
|
export class DeviceStatusInfos {
|
|
4
4
|
id: string;
|
|
@@ -33,11 +33,11 @@ export class DeviceStatusGroup {
|
|
|
33
33
|
|
|
34
34
|
constructor(params: DeviceStatusGroupDTO) {
|
|
35
35
|
this.sourceTimestamp = params.sourceTimestamp ?
|
|
36
|
-
|
|
36
|
+
utcToEpoch(params.sourceTimestamp) : null;
|
|
37
37
|
this.enqueuedTimestamp = params.enqueuedTimestamp ?
|
|
38
|
-
|
|
38
|
+
utcToEpoch(params.enqueuedTimestamp) : null;
|
|
39
39
|
this.processedTimestamp = params.processedTimestamp ?
|
|
40
|
-
|
|
40
|
+
utcToEpoch(params.processedTimestamp) : null;
|
|
41
41
|
this.groupByValue = params.groupByValue;
|
|
42
42
|
this.value = params.value;
|
|
43
43
|
this.unit = params.unit;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-domain",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.103",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"main": "index.ts",
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
|
-
"gitHead": "
|
|
12
|
+
"gitHead": "dd1b4c1e23a1826d70e02de27cb419205392fc5c"
|
|
13
13
|
}
|