@dative-gpi/foundation-core-domain 1.0.137 → 1.0.139-auth-token

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.
@@ -16,6 +16,8 @@ export class AlertInfos {
16
16
  deviceOrganisationImageId: string | null;
17
17
  deviceOrganisationCode: string;
18
18
  deviceOrganisationLabel: string;
19
+ deviceOrganisationLocationLabel: string | null;
20
+ deviceOrganisationOwnerLabel: string | null;
19
21
  icon: string;
20
22
  code: string;
21
23
  label: string;
@@ -48,6 +50,8 @@ export class AlertInfos {
48
50
  this.deviceOrganisationImageId = params.deviceOrganisationImageId;
49
51
  this.deviceOrganisationCode = params.deviceOrganisationCode;
50
52
  this.deviceOrganisationLabel = params.deviceOrganisationLabel;
53
+ this.deviceOrganisationLocationLabel = params.deviceOrganisationLocationLabel;
54
+ this.deviceOrganisationOwnerLabel = params.deviceOrganisationOwnerLabel;
51
55
  this.icon = params.icon;
52
56
  this.code = params.code;
53
57
  this.label = params.label;
@@ -89,6 +93,8 @@ export interface AlertInfosDTO {
89
93
  deviceOrganisationImageId: string | null;
90
94
  deviceOrganisationCode: string;
91
95
  deviceOrganisationLabel: string;
96
+ deviceOrganisationLocationLabel: string | null;
97
+ deviceOrganisationOwnerLabel: string | null;
92
98
  icon: string;
93
99
  code: string;
94
100
  label: string;
@@ -0,0 +1,4 @@
1
+ export interface CreateDashboardShallowWidgetDTO {
2
+ widgetId: string;
3
+ meta: { [key: string]: string };
4
+ }
@@ -0,0 +1,30 @@
1
+ import _ from "lodash";
2
+
3
+ const clean = <T>(meta: T): T => {
4
+ const newMeta = _.cloneDeepWith(meta, (value) => {
5
+ if (typeof value === "string") {
6
+ try {
7
+ return JSON.parse(value as string);
8
+ }
9
+ catch {
10
+ return value
11
+ }
12
+ }
13
+ });
14
+ return newMeta;
15
+ }
16
+
17
+ export class DashboardShallowWidgetInfos {
18
+ widgetId: string;
19
+ meta: { [key: string]: string };
20
+
21
+ constructor(params: DashboardShallowWidgetInfosDTO) {
22
+ this.widgetId = params.widgetId;
23
+ this.meta = clean(params.meta);
24
+ }
25
+ }
26
+
27
+ export interface DashboardShallowWidgetInfosDTO {
28
+ widgetId: string;
29
+ meta: { [key: string]: string };
30
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./dashboardShallowWidgetDetails";
2
+ export * from "./dashboardShallowWidgetInfos";
@@ -1,42 +1,32 @@
1
- import type { CreateDashboardShallowEntityPresetDTO, DashboardShallowEntityPresetInfosDTO } from "../dashboardShallowEntityPresets";
2
- import { DashboardShallowEntityPresetInfos } from "../dashboardShallowEntityPresets";
3
- import type { CreateDashboardShallowDatePresetDTO, DashboardShallowDatePresetInfosDTO } from "../dashboardShallowDatePresets";
4
- import { DashboardShallowDatePresetInfos } from "../dashboardShallowDatePresets";
5
- import type { CreateDashboardShallowVariableDTO, DashboardShallowVariableInfosDTO } from "../dashboardShallowVariables";
6
- import { DashboardShallowVariableInfos } from "../dashboardShallowVariables";
7
- import type { DashboardEntityPresetInfosDTO } from "../dashboardEntityPresets";
8
- import { DashboardEntityPresetInfos } from "../dashboardEntityPresets";
9
- import type { DashboardDatePresetInfosDTO } from "../dashboardDatePresets";
10
- import { DashboardDatePresetInfos } from "../dashboardDatePresets";
11
- import type { DashboardVariableInfosDTO } from "../dashboardVariables";
12
- import { DashboardVariableInfos } from "../dashboardVariables";
13
- import type { DashboardShallowInfosDTO } from "./dashboardShallowInfos";
14
- import { DashboardShallowInfos } from "./dashboardShallowInfos";
15
- import type { DashboardTranslationDTO } from "../dashboards";
16
- import { DashboardTranslation } from "../dashboards";
17
- import type { WidgetInfosDTO } from "../widgets/widgetInfos";
18
- import { WidgetInfos } from "../widgets/widgetInfos";
19
- import type { PathCrumbDTO } from "../shared/pathCrumb";
20
- import { PathCrumb } from "../shared/pathCrumb";
21
-
1
+ import { type CreateDashboardShallowEntityPresetDTO, DashboardShallowEntityPresetInfos, type DashboardShallowEntityPresetInfosDTO } from "../dashboardShallowEntityPresets";
2
+ import { type CreateDashboardShallowDatePresetDTO, DashboardShallowDatePresetInfos, type DashboardShallowDatePresetInfosDTO } from "../dashboardShallowDatePresets";
3
+ import { type CreateDashboardShallowVariableDTO, DashboardShallowVariableInfos, type DashboardShallowVariableInfosDTO } from "../dashboardShallowVariables";
4
+ import { type CreateDashboardShallowWidgetDTO, DashboardShallowWidgetInfos, type DashboardShallowWidgetInfosDTO } from "../dashboardShallowWidgets";
5
+ import { DashboardEntityPresetInfos, type DashboardEntityPresetInfosDTO } from "../dashboardEntityPresets";
6
+ import { DashboardDatePresetInfos, type DashboardDatePresetInfosDTO } from "../dashboardDatePresets";
7
+ import { DashboardVariableInfos, type DashboardVariableInfosDTO } from "../dashboardVariables";
8
+ import { DashboardShallowInfos, type DashboardShallowInfosDTO } from "./dashboardShallowInfos";
9
+ import { DashboardTranslation, type DashboardTranslationDTO } from "../dashboards";
10
+ import { WidgetInfos, type WidgetInfosDTO } from "../widgets/widgetInfos";
11
+ import { PathCrumb, type PathCrumbDTO } from "../shared/pathCrumb";
22
12
 
23
13
  export class DashboardShallowDetails extends DashboardShallowInfos {
24
14
  labelDefault: string;
25
15
  translations: DashboardTranslation[];
26
16
  path: PathCrumb[];
27
17
 
28
- widgets: WidgetInfos[];
29
-
30
18
  entityPresetCode: string | null;
31
19
  datePresetCode: string | null;
32
20
  variableCode: string | null;
33
21
  defaultDatePresets: DashboardDatePresetInfos[];
34
22
  defaultEntityPresets: DashboardEntityPresetInfos[];
35
23
  defaultVariables: DashboardVariableInfos[];
24
+ defaultWidgets: WidgetInfos[];
36
25
 
37
26
  overrideDatePresets: DashboardShallowDatePresetInfos[];
38
27
  overrideEntityPresets: DashboardShallowEntityPresetInfos[];
39
28
  overrideVariables: DashboardShallowVariableInfos[];
29
+ overrideWidgets: DashboardShallowWidgetInfos[];
40
30
 
41
31
  get datePresets() : DashboardDatePresetInfos[] {
42
32
  return this.defaultDatePresets.map(d => {
@@ -59,17 +49,24 @@ export class DashboardShallowDetails extends DashboardShallowInfos {
59
49
  });
60
50
  }
61
51
 
52
+ get widgets() {
53
+ return this.defaultWidgets.map(d => {
54
+ const override = this.overrideWidgets.find(od => od.widgetId === d.id);
55
+ return override ? new WidgetInfos({ ...d, ...override }) : d;
56
+ });
57
+ }
58
+
62
59
  constructor(params: DashboardShallowDetailsDTO) {
63
60
  super(params);
64
61
 
65
62
  this.labelDefault = params.labelDefault;
66
63
  this.path = params.path.map(dto => new PathCrumb(dto)).sort((a, b) => b.index - a.index);
67
64
  this.translations = params.translations.map(t => new DashboardTranslation(t));
68
- this.widgets = params.widgets.map(dto => new WidgetInfos(dto));
69
65
 
70
66
  this.overrideDatePresets = params.overrideDatePresets.map(dto => new DashboardShallowDatePresetInfos(dto));
71
67
  this.overrideEntityPresets = params.overrideEntityPresets.map(dto => new DashboardShallowEntityPresetInfos(dto));
72
68
  this.overrideVariables = params.overrideVariables.map(dto => new DashboardShallowVariableInfos(dto));
69
+ this.overrideWidgets = params.overrideWidgets.map(dto => new DashboardShallowWidgetInfos(dto));
73
70
 
74
71
  this.entityPresetCode = params.entityPresetCode;
75
72
  this.datePresetCode = params.datePresetCode;
@@ -77,6 +74,7 @@ export class DashboardShallowDetails extends DashboardShallowInfos {
77
74
  this.defaultDatePresets = params.defaultDatePresets.map(dto => new DashboardDatePresetInfos(dto));
78
75
  this.defaultEntityPresets = params.defaultEntityPresets.map(dto => new DashboardEntityPresetInfos(dto));
79
76
  this.defaultVariables = params.defaultVariables.map(dto => new DashboardVariableInfos(dto));
77
+ this.defaultWidgets = params.defaultWidgets.map(dto => new WidgetInfos(dto));
80
78
  }
81
79
  }
82
80
 
@@ -86,6 +84,7 @@ export interface DashboardShallowDetailsDTO extends DashboardShallowInfosDTO {
86
84
  overrideDatePresets: DashboardShallowDatePresetInfosDTO[];
87
85
  overrideEntityPresets: DashboardShallowEntityPresetInfosDTO[];
88
86
  overrideVariables: DashboardShallowVariableInfosDTO[];
87
+ overrideWidgets: DashboardShallowWidgetInfosDTO[];
89
88
  translations: DashboardTranslationDTO[];
90
89
  dashboardId: string;
91
90
  scope: number;
@@ -95,7 +94,7 @@ export interface DashboardShallowDetailsDTO extends DashboardShallowInfosDTO {
95
94
  defaultDatePresets: DashboardDatePresetInfosDTO[];
96
95
  defaultEntityPresets: DashboardEntityPresetInfosDTO[];
97
96
  defaultVariables: DashboardVariableInfosDTO[];
98
- widgets: WidgetInfosDTO[];
97
+ defaultWidgets: WidgetInfosDTO[];
99
98
  }
100
99
 
101
100
  export interface CreateDashboardShallowDTO {
@@ -114,6 +113,7 @@ export interface UpdateDashboardShallowDTO {
114
113
  overrideDatePresets: CreateDashboardShallowDatePresetDTO[];
115
114
  overrideEntityPresets: CreateDashboardShallowEntityPresetDTO[];
116
115
  overrideVariables: CreateDashboardShallowVariableDTO[];
116
+ overrideWidgets: CreateDashboardShallowWidgetDTO[];
117
117
  translations: DashboardTranslationDTO[];
118
118
  }
119
119
 
@@ -0,0 +1,22 @@
1
+ import type { ApplicationScope } from "@dative-gpi/foundation-shared-domain/enums";
2
+ import type { CreateDashboardDatePresetDTO, CreateDashboardEntityPresetDTO, CreateDashboardVariableDTO, DashboardTranslationDTO } from "@dative-gpi/foundation-core-domain/models";
3
+
4
+ export interface DashboardSettings {
5
+ folderId: string | null;
6
+ imageId: string | null;
7
+ image: string | null;
8
+ labelDefault: string;
9
+ locked: boolean;
10
+ code: string;
11
+ colors: string[];
12
+ icon: string;
13
+ tags: string[];
14
+ translations: DashboardTranslationDTO[];
15
+ entityPresetCode: string | null;
16
+ datePresetCode: string | null;
17
+ variableCode: string | null;
18
+ datePresets: CreateDashboardDatePresetDTO[];
19
+ entityPresets: CreateDashboardEntityPresetDTO[];
20
+ variables: CreateDashboardVariableDTO[];
21
+ scope: ApplicationScope;
22
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./dashboardDetails";
2
2
  export * from "./dashboardInfos";
3
+ export * from "./dashboardSettings";
3
4
  export * from "./dashboardTranslation";
@@ -46,6 +46,8 @@ export interface CreateDeviceOrganisationDTO {
46
46
  export interface UpdateDeviceOrganisationDTO {
47
47
  managerId: string | null;
48
48
  locationId: string | null;
49
+ latitude: number | null;
50
+ longitude: number | null;
49
51
  groupId: string | null;
50
52
  imageId: string | null;
51
53
  image: string | null;
@@ -2,6 +2,7 @@ import { DeviceConnectivityDetails, type DeviceConnectivityDetailsDTO } from "..
2
2
  import { DeviceStatusDetails, type DeviceStatusDetailsDTO } from "../deviceStatuses/deviceStatusDetails";
3
3
  import { DeviceOrganisationAlert, type DeviceOrganisationAlertDTO } from "./deviceOrganisationAlert";
4
4
  import { ModelStatusInfos, type ModelStatusInfosDTO } from "../modelStatuses/modelStatusInfos";
5
+ import { type EntityType } from '@dative-gpi/foundation-shared-domain/enums';
5
6
  import { PathCrumb, type PathCrumbDTO } from "../shared/pathCrumb";
6
7
 
7
8
  export class DeviceOrganisationInfos {
@@ -9,6 +10,8 @@ export class DeviceOrganisationInfos {
9
10
  deviceId: string;
10
11
  manufacturerId: string;
11
12
  manufacturerLabel: string;
13
+ latitude: number | null;
14
+ longitude: number | null;
12
15
  articleId: string;
13
16
  articleLabel: string;
14
17
  modelId: string;
@@ -44,6 +47,8 @@ export class DeviceOrganisationInfos {
44
47
  this.deviceId = params.deviceId;
45
48
  this.manufacturerId = params.manufacturerId;
46
49
  this.manufacturerLabel = params.manufacturerLabel;
50
+ this.latitude = params.latitude;
51
+ this.longitude = params.longitude;
47
52
  this.articleId = params.articleId;
48
53
  this.articleLabel = params.articleLabel;
49
54
  this.modelId = params.modelId;
@@ -82,6 +87,8 @@ export interface DeviceOrganisationInfosDTO {
82
87
  deviceId: string;
83
88
  manufacturerId: string;
84
89
  manufacturerLabel: string;
90
+ latitude: number | null;
91
+ longitude: number | null;
85
92
  articleId: string;
86
93
  articleLabel: string;
87
94
  modelId: string;
@@ -124,4 +131,6 @@ export interface DeviceOrganisationFilters {
124
131
  deviceOrganisationsIds?: string[] | null;
125
132
  otherDeviceOrganisationsIds?: string[] | null;
126
133
  search?: string | null;
134
+ entityType?: EntityType | null;
135
+ entitiesIds?: string[] | null;
127
136
  }
package/models/index.ts CHANGED
@@ -19,6 +19,7 @@ export * from "./dashboardShallowDatePresets"; // No service
19
19
  export * from "./dashboardShallowEntityPresets"; // No service
20
20
  export * from "./dashboardShallows";
21
21
  export * from "./dashboardShallowVariables"; // No service
22
+ export * from "./dashboardShallowWidgets"; // No service
22
23
  export * from "./dashboardVariables"; // No service
23
24
  export * from "./dashboardVariableValues"; // No service
24
25
  export * from "./dataCategories";
@@ -1,3 +1,4 @@
1
+ import type { EntityType } from '@dative-gpi/foundation-shared-domain/enums';
1
2
  import { Address, type AddressDTO } from "@dative-gpi/foundation-shared-domain/models";
2
3
 
3
4
  export class LocationInfos {
@@ -46,4 +47,6 @@ export interface LocationFilters {
46
47
  locationsIds?: string[] | null;
47
48
  modelsIds?: string[] | null;
48
49
  search?: string | null;
50
+ entityType?: EntityType | null;
51
+ entitiesIds?: string[] | null;
49
52
  }
@@ -3,22 +3,15 @@ import { PermissionInfos, type PermissionInfosDTO } from "@dative-gpi/foundation
3
3
  import { ServiceAccountOrganisationInfos, type ServiceAccountOrganisationInfosDTO } from "./serviceAccountOrganisationInfos";
4
4
 
5
5
  export class ServiceAccountOrganisationDetails extends ServiceAccountOrganisationInfos {
6
- languageCode: string;
7
- timeZoneId: string;
8
6
  permissions: PermissionInfos[];
9
7
 
10
8
  constructor(params: ServiceAccountOrganisationDetailsDTO) {
11
9
  super(params);
12
-
13
- this.languageCode = params.languageCode;
14
- this.timeZoneId = params.timeZoneId;
15
10
  this.permissions = params.permissions.map(dto => new PermissionInfos(dto));
16
11
  }
17
12
  }
18
13
 
19
14
  export interface ServiceAccountOrganisationDetailsDTO extends ServiceAccountOrganisationInfosDTO {
20
- languageCode: string;
21
- timeZoneId: string;
22
15
  permissions: PermissionInfosDTO[];
23
16
  }
24
17
 
@@ -4,6 +4,8 @@ export class ServiceAccountOrganisationInfos {
4
4
  id: string;
5
5
  userId: string;
6
6
  organisationId: string;
7
+ languageCode: string;
8
+ timeZoneId: string;
7
9
  roleId: string | null;
8
10
  roleLabel: string;
9
11
  roleIcon: string;
@@ -18,6 +20,8 @@ export class ServiceAccountOrganisationInfos {
18
20
  this.id = params.id;
19
21
  this.userId = params.userId;
20
22
  this.organisationId = params.organisationId;
23
+ this.languageCode = params.languageCode;
24
+ this.timeZoneId = params.timeZoneId;
21
25
  this.roleId = params.roleId;
22
26
  this.roleLabel = params.roleLabel;
23
27
  this.roleIcon = params.roleIcon;
@@ -34,6 +38,8 @@ export interface ServiceAccountOrganisationInfosDTO {
34
38
  id: string;
35
39
  userId: string;
36
40
  organisationId: string;
41
+ languageCode: string;
42
+ timeZoneId: string;
37
43
  roleId: string | null;
38
44
  roleLabel: string;
39
45
  roleIcon: string;
@@ -16,6 +16,8 @@ const clean = <T>(meta: T): T => {
16
16
 
17
17
  export class WidgetTemplateInfos {
18
18
  id: string;
19
+ extensionId: string | null;
20
+ extensionHost: string | null;
19
21
  label: string;
20
22
  code: string;
21
23
  icon: string;
@@ -27,6 +29,8 @@ export class WidgetTemplateInfos {
27
29
 
28
30
  constructor(params: WidgetTemplateInfosDTO) {
29
31
  this.id = params.id;
32
+ this.extensionId = params.extensionId ?? null;
33
+ this.extensionHost = params.extensionHost ?? null;
30
34
  this.label = params.label;
31
35
  this.code = params.code;
32
36
  this.icon = params.icon;
@@ -40,6 +44,8 @@ export class WidgetTemplateInfos {
40
44
 
41
45
  export interface WidgetTemplateInfosDTO {
42
46
  id: string;
47
+ extensionId?: string;
48
+ extensionHost?: string;
43
49
  label: string;
44
50
  code: string;
45
51
  icon: string;
@@ -1,2 +1,3 @@
1
1
  export * from "./widgetDetails";
2
- export * from "./widgetInfos";
2
+ export * from "./widgetInfos";
3
+ export * from "./widgetInterface";
@@ -0,0 +1,11 @@
1
+ export interface Widget {
2
+ id: string;
3
+ templateId: string;
4
+ hideBorders: boolean;
5
+ width: number;
6
+ height: number;
7
+ x: number;
8
+ y: number;
9
+ targetScreenSize: "s" | "m" | "l" | "xl";
10
+ meta: { [key: string]: string };
11
+ }
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.137",
4
+ "version": "1.0.139-auth-token",
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.137",
14
- "@dative-gpi/foundation-shared-services": "1.0.137"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.139-auth-token",
14
+ "@dative-gpi/foundation-shared-services": "1.0.139-auth-token"
15
15
  },
16
- "gitHead": "676162c4362dd556d5ef714f7b17a047ad7f2bad"
16
+ "gitHead": "af9d894b3fa209b796f8466b8545bb1ecc46a399"
17
17
  }