@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.
@@ -1,5 +1,5 @@
1
1
  import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/models";
2
- import { DatesTools } from "@dative-gpi/foundation-shared-domain/tools";
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
- 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[];
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
- 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
- DatesTools.utcToEpoch(params.acknowledgingTimestamp) : null;
59
- this.initialState = new AlertState(params.initialState);
60
- this.triggerSourceTimestamp = params.triggerSourceTimestamp ?
61
- DatesTools.utcToEpoch(params.triggerSourceTimestamp) : null;
62
- this.triggerEnqueuedTimestamp = params.triggerEnqueuedTimestamp ?
63
- DatesTools.utcToEpoch(params.triggerEnqueuedTimestamp) : null;
64
- this.triggerProcessedTimestamp = params.triggerProcessedTimestamp ?
65
- DatesTools.utcToEpoch(params.triggerProcessedTimestamp) : null;
66
- this.lastState = new AlertState(params.lastState);
67
- this.currentSourceTimestamp = params.currentSourceTimestamp ?
68
- DatesTools.utcToEpoch(params.currentSourceTimestamp) : null;
69
- this.currentEnqueuedTimestamp = params.currentEnqueuedTimestamp ?
70
- DatesTools.utcToEpoch(params.currentEnqueuedTimestamp) : null;
71
- this.currentProcessedTimestamp = params.currentProcessedTimestamp ?
72
- DatesTools.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
- }
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
- 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[];
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
- 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;
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 { DatesTools } from "@dative-gpi/foundation-shared-domain/tools";
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 = DatesTools.utcToEpoch(params.sourceTimestamp);
18
- this.enqueuedTimestamp = DatesTools.utcToEpoch(params.enqueuedTimestamp);
19
- this.processedTimestamp = DatesTools.utcToEpoch(params.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 { DatesTools } from "@dative-gpi/foundation-shared-domain/tools";
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 = DatesTools.utcToEpoch(params.creationDate);
15
- this.dateMax = DatesTools.utcToEpoch(params.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 { DatesTools } from "@dative-gpi/foundation-shared-domain/tools";
1
+ import { utcToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
2
2
 
3
3
  export class CommentInfos {
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 = DatesTools.utcToEpoch(params.timestamp)!;
21
- this.comment = params.comment;
22
- this.edited = params.edited;
23
- this.editTimestamp = params.editTimestamp ?
24
- DatesTools.utcToEpoch(params.editTimestamp) : null;
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
- 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;
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
- alertId: string;
41
+ alertId: string;
42
42
  }
@@ -1,5 +1,5 @@
1
1
  import { AlertStatus } from "@dative-gpi/foundation-shared-domain/models";
2
- import { DatesTools } from "@dative-gpi/foundation-shared-domain/tools";
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 = DatesTools.utcToEpoch(params.triggerProcessedTimestamp);
27
+ this.triggerProcessedTimestamp = utcToEpoch(params.triggerProcessedTimestamp);
28
28
  this.resolveProcessedTimestamp = params.resolveProcessedTimestamp ?
29
- DatesTools.utcToEpoch(params.resolveProcessedTimestamp) : null;
29
+ utcToEpoch(params.resolveProcessedTimestamp) : null;
30
30
  this.status = params.status;
31
31
  }
32
32
  }
@@ -1,4 +1,4 @@
1
- import { DatesTools } from "@dative-gpi/foundation-shared-domain/tools";
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
- DatesTools.utcToEpoch(params.timestamp) : null;
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 { DatesTools } from "@dative-gpi/foundation-shared-domain/tools";
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
- DatesTools.utcToEpoch(params.sourceTimestamp) : null;
16
+ utcToEpoch(params.sourceTimestamp) : null;
17
17
  this.enqueuedTimestamp = params.enqueuedTimestamp ?
18
- DatesTools.utcToEpoch(params.enqueuedTimestamp) : null;
18
+ utcToEpoch(params.enqueuedTimestamp) : null;
19
19
  this.processedTimestamp = params.processedTimestamp ?
20
- DatesTools.utcToEpoch(params.processedTimestamp) : null;
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 { DatesTools } from "@dative-gpi/foundation-shared-domain/tools";
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 ? DatesTools.utcToEpoch(params.sourceTimestamp) : undefined;
18
- this.enqueuedTimestamp = params.enqueuedTimestamp ? DatesTools.utcToEpoch(params.enqueuedTimestamp) : undefined;
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 { DatesTools } from "@dative-gpi/foundation-shared-domain/tools";
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
- DatesTools.utcToEpoch(params.sourceTimestamp) : null;
36
+ utcToEpoch(params.sourceTimestamp) : null;
37
37
  this.enqueuedTimestamp = params.enqueuedTimestamp ?
38
- DatesTools.utcToEpoch(params.enqueuedTimestamp) : null;
38
+ utcToEpoch(params.enqueuedTimestamp) : null;
39
39
  this.processedTimestamp = params.processedTimestamp ?
40
- DatesTools.utcToEpoch(params.processedTimestamp) : null;
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.101",
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": "8ab763942b592e5d46dc629ca95e80cfb7729400"
12
+ "gitHead": "dd1b4c1e23a1826d70e02de27cb419205392fc5c"
13
13
  }