@dative-gpi/foundation-core-domain 1.0.126 → 1.0.128-dvh

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,24 +1,17 @@
1
- import type { ApplicationScope } from "@/shared/foundation-shared-domain/enums";
2
1
  import { AlertInfos, type AlertInfosDTO } from "./alertInfos";
3
2
 
4
3
  export class AlertDetails extends AlertInfos {
5
4
  description: string;
6
5
  comments: string;
7
- scenarioId: string;
8
- scenarioScope: ApplicationScope;
9
6
 
10
7
  constructor(params: AlertDetailsDTO) {
11
8
  super(params);
12
9
  this.comments = params.comments;
13
10
  this.description = params.description;
14
- this.scenarioId = params.scenarioId;
15
- this.scenarioScope = params.scenarioScope;
16
11
  }
17
12
  }
18
13
 
19
14
  export interface AlertDetailsDTO extends AlertInfosDTO {
20
15
  description: string;
21
16
  comments: string;
22
- scenarioId: string;
23
- scenarioScope: ApplicationScope;
24
17
  }
@@ -1,4 +1,4 @@
1
- import { type AlertStatus, type Criticity } from "@dative-gpi/foundation-shared-domain/enums";
1
+ import { type ApplicationScope, type AlertStatus, type Criticity } from "@dative-gpi/foundation-shared-domain/enums";
2
2
  import { isoToEpoch } from "@dative-gpi/foundation-shared-domain/tools";
3
3
 
4
4
  import { AlertDataDefinition, type AlertDataDefinitionDTO } from "./alertDataDefinition";
@@ -8,7 +8,8 @@ import { type DateVariable } from "../shared/dateVariable";
8
8
 
9
9
  export class AlertInfos {
10
10
  id: string;
11
- deprecatedScenarioId: string;
11
+ scenarioId: string;
12
+ scenarioScope: ApplicationScope;
12
13
  scenarioLabel: string;
13
14
  organisationId: string;
14
15
  deviceOrganisationId: string;
@@ -39,7 +40,8 @@ export class AlertInfos {
39
40
 
40
41
  constructor(params: AlertInfosDTO) {
41
42
  this.id = params.id;
42
- this.deprecatedScenarioId = params.deprecatedScenarioId;
43
+ this.scenarioId = params.scenarioId;
44
+ this.scenarioScope = params.scenarioScope;
43
45
  this.scenarioLabel = params.scenarioLabel;
44
46
  this.organisationId = params.organisationId;
45
47
  this.deviceOrganisationId = params.deviceOrganisationId;
@@ -79,7 +81,8 @@ export class AlertInfos {
79
81
 
80
82
  export interface AlertInfosDTO {
81
83
  id: string;
82
- deprecatedScenarioId: string;
84
+ scenarioId: string;
85
+ scenarioScope: ApplicationScope;
83
86
  scenarioLabel: string;
84
87
  organisationId: string;
85
88
  deviceOrganisationId: string;
@@ -110,7 +113,8 @@ export interface AlertInfosDTO {
110
113
  }
111
114
 
112
115
  export interface AlertFilters {
113
- deprecatedScenarioId?: string | null;
116
+ scenarioId?: string | null;
117
+ scenarioScope?: ApplicationScope | null;
114
118
  deviceOrganisationId?: string | null;
115
119
  statuses?: AlertStatus[] | null;
116
120
  acknowledged?: boolean | null;
@@ -1,10 +1,12 @@
1
- import { type DeviceExplorerElementType } from "@dative-gpi/foundation-shared-domain/enums";
1
+ import { DeviceExplorerElementType } from "@dative-gpi/foundation-shared-domain/enums";
2
2
 
3
3
  import { DeviceConnectivityDetails, type DeviceConnectivityDetailsDTO } from "../deviceConnectivities/deviceConnectivityDetails";
4
4
  import { DeviceOrganisationAlert, type DeviceOrganisationAlertDTO } from "../deviceOrganisations/deviceOrganisationAlert";
5
5
  import { DeviceStatusDetails, type DeviceStatusDetailsDTO } from "../deviceStatuses/deviceStatusDetails";
6
6
  import { ModelStatusInfos, type ModelStatusInfosDTO } from "../modelStatuses/modelStatusInfos";
7
+ import { type DeviceOrganisationInfos } from "../deviceOrganisations/deviceOrganisationInfos";
7
8
  import { PathCrumb, type PathCrumbDTO } from "../shared/pathCrumb";
9
+ import { type GroupInfos } from "../groups/groupInfos";
8
10
 
9
11
  export class DeviceExplorerElementInfos {
10
12
  id: string;
@@ -72,6 +74,37 @@ export class DeviceExplorerElementInfos {
72
74
  this.alerts = params.alerts?.map(dto => new DeviceOrganisationAlert(dto)) ?? null;
73
75
  this.worstAlert = params.worstAlert ? new DeviceOrganisationAlert(params.worstAlert) : null;
74
76
  }
77
+
78
+ static fromDeviceOrganisation = (deviceOrganisation: DeviceOrganisationInfos): DeviceExplorerElementInfos => ({
79
+ ...deviceOrganisation,
80
+ type: DeviceExplorerElementType.DeviceOrganisation,
81
+ parentId: deviceOrganisation.groupId,
82
+ icon: null,
83
+ groupsIds: null,
84
+ deviceOrganisationsIds: null,
85
+ modelsIds: null,
86
+ recursiveGroupsIds: null,
87
+ recursiveDeviceOrganisationsIds: null,
88
+ recursiveModelsIds: null
89
+ });
90
+
91
+ static fromGroup = (group: GroupInfos): DeviceExplorerElementInfos => ({
92
+ ...group,
93
+ type: DeviceExplorerElementType.Group,
94
+ manufacturerLabel: null,
95
+ articleLabel: null,
96
+ modelLabel: null,
97
+ ownerLabel: null,
98
+ managerName: null,
99
+ unrestricted: null,
100
+ online: null,
101
+ meta: null,
102
+ modelStatuses: null,
103
+ status: null,
104
+ connectivity: null,
105
+ alerts: null,
106
+ worstAlert: null
107
+ });
75
108
  }
76
109
 
77
110
  export interface DeviceExplorerElementInfosDTO {
package/models/index.ts CHANGED
@@ -28,7 +28,6 @@ export * from "./deviceConnectivities";
28
28
  export * from "./deviceExplorerElements";
29
29
  export * from "./deviceOrganisations";
30
30
  export * from "./deviceStatuses";
31
- export * from "./extensionApplications";
32
31
  export * from "./folders";
33
32
  export * from "./groups";
34
33
  export * from "./locations";
@@ -2,6 +2,7 @@ import type { CreateTimeRangeDTO } from "../shared/timeRange";
2
2
  import type { ScenarioDeviceOrganisationInfosDTO } from "./scenarioDeviceOrganisationInfos";
3
3
  import { ScenarioDeviceOrganisationInfos } from "./scenarioDeviceOrganisationInfos";
4
4
  import type { CreateScenarioParameterOverrideDTO } from "../scenarios/scenarioParameterOverride";
5
+ import type { ApplicationScope } from "@dative-gpi/foundation-shared-domain/enums";
5
6
 
6
7
 
7
8
  export class ScenarioDeviceOrganisationDetails extends ScenarioDeviceOrganisationInfos {
@@ -16,7 +17,8 @@ export interface ScenarioDeviceOrganisationDetailsDTO extends ScenarioDeviceOrga
16
17
  }
17
18
 
18
19
  export interface CreateScenarioDeviceOrganisationDTO {
19
- deprecatedScenarioId: string;
20
+ scenarioId: string;
21
+ scenarioScope: ApplicationScope;
20
22
  deviceOrganisationId: string;
21
23
  overrideTimeRanges: boolean;
22
24
  timeRanges: CreateTimeRangeDTO[] | null;
@@ -27,7 +29,8 @@ export interface CreateScenarioDeviceOrganisationDTO {
27
29
  }
28
30
 
29
31
  export interface CreateManyScenarioDeviceOrganisationDTO {
30
- deprecatedScenarioId: string;
32
+ scenarioId: string;
33
+ scenarioScope: ApplicationScope;
31
34
  deviceOrganisationsIds: string[];
32
35
  overrideTimeRanges: boolean;
33
36
  timeRanges: CreateTimeRangeDTO[] | null;
@@ -8,7 +8,6 @@ import type { ApplicationScope } from "@/shared/foundation-shared-domain/enums";
8
8
 
9
9
  export class ScenarioDeviceOrganisationInfos {
10
10
  id: string;
11
- deprecatedScenarioId: string;
12
11
  scenarioLabel: string;
13
12
  deviceOrganisationId: string;
14
13
  deviceOrganisationImageId: string | null;
@@ -28,7 +27,6 @@ export class ScenarioDeviceOrganisationInfos {
28
27
 
29
28
  constructor(params: ScenarioDeviceOrganisationInfosDTO) {
30
29
  this.id = params.id;
31
- this.deprecatedScenarioId = params.deprecatedScenarioId;
32
30
  this.scenarioLabel = params.scenarioLabel;
33
31
  this.deviceOrganisationId = params.deviceOrganisationId;
34
32
  this.deviceOrganisationImageId = params.deviceOrganisationImageId;
@@ -51,7 +49,6 @@ export class ScenarioDeviceOrganisationInfos {
51
49
 
52
50
  export interface ScenarioDeviceOrganisationInfosDTO {
53
51
  id: string;
54
- deprecatedScenarioId: string;
55
52
  scenarioLabel: string;
56
53
  deviceOrganisationId: string;
57
54
  deviceOrganisationImageId: string | null;
@@ -71,7 +68,8 @@ export interface ScenarioDeviceOrganisationInfosDTO {
71
68
  }
72
69
 
73
70
  export interface ScenarioDeviceOrganisationFilters {
74
- deprecatedScenarioId?: string | null;
71
+ scenarioId?: string | null;
72
+ scenarioScope?: ApplicationScope | null;
75
73
  deviceOrganisationId?: string | null;
76
74
  deviceOrganisationsIds?: string[] | null;
77
75
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-core-domain",
3
3
  "sideEffects": false,
4
- "version": "1.0.126",
4
+ "version": "1.0.128-dvh",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "1.0.126",
14
- "@dative-gpi/foundation-shared-services": "1.0.126"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.128-dvh",
14
+ "@dative-gpi/foundation-shared-services": "1.0.128-dvh"
15
15
  },
16
- "gitHead": "fa74ceb5e1e68ec7e0cf75fd43bdaf014f0ab552"
16
+ "gitHead": "02186299b1e99ef0040b5f09892143f046fe119d"
17
17
  }
@@ -1,18 +0,0 @@
1
- import type { ExtensionApplicationInfosDTO } from "./extensionApplicationInfos";
2
- import { ExtensionApplicationInfos } from "./extensionApplicationInfos";
3
-
4
- export class ExtensionApplicationDetails extends ExtensionApplicationInfos {
5
- host: string;
6
- extensionId: string;
7
-
8
- constructor(params: ExtensionApplicationDetailsDTO) {
9
- super(params);
10
- this.extensionId = params.extensionId;
11
- this.host = params.host
12
- }
13
- }
14
-
15
- export interface ExtensionApplicationDetailsDTO extends ExtensionApplicationInfosDTO {
16
- extensionId: string;
17
- host: string;
18
- }
@@ -1,18 +0,0 @@
1
- export class ExtensionApplicationInfos {
2
- id: string;
3
- label: string;
4
- description: string;
5
-
6
- constructor(params: ExtensionApplicationInfosDTO) {
7
- this.id = params.id;
8
- this.label = params.label;
9
- this.description = params.description;
10
- }
11
- }
12
-
13
- export interface ExtensionApplicationInfosDTO {
14
- id: string;
15
- label: string;
16
- description: string;
17
- }
18
-
@@ -1,2 +0,0 @@
1
- export * from "./extensionApplicationDetails";
2
- export * from "./extensionApplicationInfos";