@dative-gpi/foundation-core-domain 0.0.103 → 0.0.105

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.
Files changed (33) hide show
  1. package/models/alerts/alertInfos.ts +9 -9
  2. package/models/articles/articleInfos.ts +1 -1
  3. package/models/authTokens/authTokenInfos.ts +1 -1
  4. package/models/chartOrganisationTypes/chartOrganisationTypeInfos.ts +2 -2
  5. package/models/chartOrganisations/chartOrganisationInfos.ts +2 -2
  6. package/models/comments/commentInfos.ts +1 -1
  7. package/models/connectivityAlerts/connectivityAlertInfos.ts +3 -3
  8. package/models/connectivityScenarios/connectivityScenarioInfos.ts +1 -1
  9. package/models/customProperties/customPropertyInfos.ts +3 -3
  10. package/models/dashboardOrganisationTypes/dashboardOrganisationTypeInfos.ts +12 -12
  11. package/models/dashboardOrganisations/dashboardOrganisationInfos.ts +3 -3
  12. package/models/dashboardShallows/dashboardShallowInfos.ts +47 -47
  13. package/models/dataCategories/dataCategoryInfos.ts +3 -3
  14. package/models/dataDefinitions/dataDefinitionInfos.ts +4 -4
  15. package/models/deviceOrganisations/deviceOrganisationInfos.ts +109 -109
  16. package/models/folders/folderInfos.ts +41 -41
  17. package/models/groups/groupInfos.ts +5 -5
  18. package/models/locations/locationInfos.ts +3 -3
  19. package/models/manufacturers/manufacturerInfos.ts +1 -1
  20. package/models/modelStatuses/modelStatusInfos.ts +2 -2
  21. package/models/models/modelInfos.ts +2 -2
  22. package/models/permissionCategories/permissionCategoryInfos.ts +1 -1
  23. package/models/roleOrganisationTypes/roleOrganisationTypeInfos.ts +2 -2
  24. package/models/roleOrganisations/roleOrganisationInfos.ts +2 -2
  25. package/models/scenarioDeviceOrganisations/scenarioDeviceOrganisationInfos.ts +2 -2
  26. package/models/scenarioOrganisationTypes/scenarioOrganisationTypeInfos.ts +1 -1
  27. package/models/scenarioOrganisations/scenarioOrganisationInfos.ts +1 -1
  28. package/models/serviceAccounts/serviceAccountInfos.ts +1 -1
  29. package/models/userOrganisations/userOrganisationInfos.ts +1 -1
  30. package/models/widgetTemplates/widgetTemplateInfos.ts +1 -1
  31. package/package.json +2 -2
  32. package/tools/customPropertiesTools.ts +49 -0
  33. package/tools/index.ts +1 -0
@@ -110,13 +110,13 @@ export interface AlertInfosDTO {
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
  }
@@ -17,5 +17,5 @@ export interface ArticleInfosDTO {
17
17
  }
18
18
 
19
19
  export interface ArticleFilters {
20
- search: string | null;
20
+ search?: string | null;
21
21
  }
@@ -25,5 +25,5 @@ export interface AuthTokenInfosDTO {
25
25
  }
26
26
 
27
27
  export interface AuthTokenFilters {
28
- userId: string | null;
28
+ userId?: string | null;
29
29
  }
@@ -61,6 +61,6 @@ export interface ChartOrganisationTypeInfosDTO {
61
61
  }
62
62
 
63
63
  export interface ChartOrganisationTypeFilters {
64
- modelsIds: string[] | null;
65
- search: string | null;
64
+ modelsIds?: string[] | null;
65
+ search?: string | null;
66
66
  }
@@ -58,6 +58,6 @@ export interface ChartOrganisationInfosDTO {
58
58
  }
59
59
 
60
60
  export interface ChartOrganisationFilters {
61
- modelsIds: string[] | null;
62
- search: string | null;
61
+ modelsIds?: string[] | null;
62
+ search?: string | null;
63
63
  }
@@ -38,5 +38,5 @@ export interface CommentInfosDTO {
38
38
  }
39
39
 
40
40
  export interface CommentFilters {
41
- alertId: string;
41
+ alertId?: string;
42
42
  }
@@ -45,7 +45,7 @@ export interface ConnectivityAlertInfosDTO {
45
45
  }
46
46
 
47
47
  export interface ConnectivityAlertFilters {
48
- deviceOrganisationId: string | null;
49
- startDate: string | null;
50
- endDate: string | null;
48
+ deviceOrganisationId?: string | null;
49
+ startDate?: string | null;
50
+ endDate?: string | null;
51
51
  }
@@ -44,5 +44,5 @@ export interface ConnectivityScenarioInfosDTO {
44
44
  }
45
45
 
46
46
  export interface ConnectivityScenarioFilters {
47
- deviceOrganisationId: string | null;
47
+ deviceOrganisationId?: string | null;
48
48
  }
@@ -62,7 +62,7 @@ export class CustomPropertyInfos {
62
62
  }
63
63
 
64
64
  export interface CustomPropertyFilters {
65
- entities: PropertyEntity[] | null;
66
- editableCore: boolean | null;
67
- search: string | null;
65
+ entities?: PropertyEntity[] | null;
66
+ editableCore?: boolean | null;
67
+ search?: string | null;
68
68
  }
@@ -29,19 +29,19 @@ export class DashboardOrganisationTypeInfos {
29
29
  }
30
30
 
31
31
  export interface DashboardOrganisationTypeInfosDTO {
32
- id: string;
33
- dashboardId: string;
34
- organisationTypeId: string | null;
35
- organisationTypeLabel: string | null;
36
- scope: ApplicationScope;
37
- locked: boolean;
38
- label: string;
39
- code: string;
40
- icon: string;
41
- tags: string[];
42
- colors: string[];
32
+ id: string;
33
+ dashboardId: string;
34
+ organisationTypeId: string | null;
35
+ organisationTypeLabel: string | null;
36
+ scope: ApplicationScope;
37
+ locked: boolean;
38
+ label: string;
39
+ code: string;
40
+ icon: string;
41
+ tags: string[];
42
+ colors: string[];
43
43
  }
44
44
 
45
45
  export interface DashboardOrganisationTypeFilters {
46
- search: string | null;
46
+ search?: string | null;
47
47
  }
@@ -49,7 +49,7 @@ export interface DashboardOrganisationInfosDTO {
49
49
  }
50
50
 
51
51
  export interface DashboardOrganisationFilters {
52
- root: boolean | null;
53
- folderId: string | null;
54
- search: string | null;
52
+ root?: boolean | null;
53
+ folderId?: string | null;
54
+ search?: string | null;
55
55
  }
@@ -1,58 +1,58 @@
1
1
  import { ApplicationScope } from "../enums/applicationEnums";
2
2
 
3
3
  export class DashboardShallowInfos {
4
- id: string;
5
- organisationId: string;
6
- dashboardOrganisationTypeId: string;
7
- dashboardOrganisationTypeLabel: string;
8
- folderId: string | null;
9
- folderLabel: string | null;
10
- folderIcon: string | null;
11
- label: string;
12
- code: string;
13
- icon: string;
14
- tags: string[];
15
- colors: string[];
16
- dashboardId: string;
17
- scope: ApplicationScope;
4
+ id: string;
5
+ organisationId: string;
6
+ dashboardOrganisationTypeId: string;
7
+ dashboardOrganisationTypeLabel: string;
8
+ folderId: string | null;
9
+ folderLabel: string | null;
10
+ folderIcon: string | null;
11
+ label: string;
12
+ code: string;
13
+ icon: string;
14
+ tags: string[];
15
+ colors: string[];
16
+ dashboardId: string;
17
+ scope: ApplicationScope;
18
18
 
19
- constructor(params: DashboardShallowInfosDTO) {
20
- this.id = params.id;
21
- this.organisationId = params.organisationId;
22
- this.dashboardOrganisationTypeId = params.dashboardOrganisationTypeId;
23
- this.dashboardOrganisationTypeLabel = params.dashboardOrganisationTypeLabel;
24
- this.folderId = params.folderId;
25
- this.folderLabel = params.folderLabel;
26
- this.folderIcon = params.folderIcon;
27
- this.label = params.label;
28
- this.code = params.code;
29
- this.icon = params.icon;
30
- this.tags = params.tags.slice();
31
- this.colors = params.colors.slice();
32
- this.dashboardId = params.dashboardId;
33
- this.scope = params.scope;
34
- }
19
+ constructor(params: DashboardShallowInfosDTO) {
20
+ this.id = params.id;
21
+ this.organisationId = params.organisationId;
22
+ this.dashboardOrganisationTypeId = params.dashboardOrganisationTypeId;
23
+ this.dashboardOrganisationTypeLabel = params.dashboardOrganisationTypeLabel;
24
+ this.folderId = params.folderId;
25
+ this.folderLabel = params.folderLabel;
26
+ this.folderIcon = params.folderIcon;
27
+ this.label = params.label;
28
+ this.code = params.code;
29
+ this.icon = params.icon;
30
+ this.tags = params.tags.slice();
31
+ this.colors = params.colors.slice();
32
+ this.dashboardId = params.dashboardId;
33
+ this.scope = params.scope;
34
+ }
35
35
  }
36
36
 
37
37
  export interface DashboardShallowInfosDTO {
38
- id: string;
39
- organisationId: string;
40
- dashboardOrganisationTypeId: string;
41
- dashboardOrganisationTypeLabel: string;
42
- folderId: string | null;
43
- folderLabel: string | null;
44
- folderIcon: string | null;
45
- label: string;
46
- code: string;
47
- icon: string;
48
- tags: string[];
49
- colors: string[];
50
- dashboardId: string;
51
- scope: ApplicationScope;
38
+ id: string;
39
+ organisationId: string;
40
+ dashboardOrganisationTypeId: string;
41
+ dashboardOrganisationTypeLabel: string;
42
+ folderId: string | null;
43
+ folderLabel: string | null;
44
+ folderIcon: string | null;
45
+ label: string;
46
+ code: string;
47
+ icon: string;
48
+ tags: string[];
49
+ colors: string[];
50
+ dashboardId: string;
51
+ scope: ApplicationScope;
52
52
  }
53
53
 
54
54
  export interface DashboardShallowFilters {
55
- root: boolean | null;
56
- folderId: string | null;
57
- search: string | null;
55
+ root?: boolean | null;
56
+ folderId?: string | null;
57
+ search?: string | null;
58
58
  }
@@ -23,7 +23,7 @@ export interface DataCategoryInfosDTO {
23
23
  }
24
24
 
25
25
  export interface DataCategoryFilters {
26
- modelId: string | null;
27
- correlated: boolean | null;
28
- search: string | null;
26
+ modelId?: string | null;
27
+ correlated?: boolean | null;
28
+ search?: string | null;
29
29
  }
@@ -50,8 +50,8 @@ export interface DataDefinitionInfosDTO {
50
50
  }
51
51
 
52
52
  export interface DataDefinitionFilters {
53
- modelsIds: string[] | null;
54
- dataCategoryId: string | null;
55
- dataTable: DataTable | null;
56
- search: string | null;
53
+ modelsIds?: string[] | null;
54
+ dataCategoryId?: string | null;
55
+ dataTable?: DataTable | null;
56
+ search?: string | null;
57
57
  }
@@ -4,121 +4,121 @@ import { DeviceOrganisationAlert, DeviceOrganisationAlertDTO } from "./deviceOrg
4
4
  import { ModelStatusInfos, ModelStatusInfosDTO } from "../modelStatuses/modelStatusInfos";
5
5
 
6
6
  export class DeviceOrganisationInfos {
7
- id: string;
8
- deviceId: string;
9
- manufacturerId: string;
10
- manufacturerLabel: string;
11
- articleId: string;
12
- articleLabel: string;
13
- modelId: string;
14
- modelLabel: string;
15
- ownerId: string | null;
16
- ownerLabel: string | null;
17
- organisationId: string | null;
18
- managerId: string | null;
19
- managerName: string | null;
20
- locationId: string | null;
21
- locationLabel: string | null;
22
- locationAddress: string | null;
23
- groupId: string | null;
24
- groupLabel: string | null;
25
- groupIcon: string | null;
26
- label: string;
27
- code: string;
28
- imageId: string | null;
29
- tags: string[];
30
- unrestricted: boolean;
31
- online: number;
32
- meta: { [key: string]: string };
33
- modelStatuses: ModelStatusInfos[];
34
- status: DeviceStatusDetails;
35
- connectivity: DeviceConnectivityDetails;
36
- alerts: DeviceOrganisationAlert[];
37
- worstAlert: DeviceOrganisationAlert | null;
7
+ id: string;
8
+ deviceId: string;
9
+ manufacturerId: string;
10
+ manufacturerLabel: string;
11
+ articleId: string;
12
+ articleLabel: string;
13
+ modelId: string;
14
+ modelLabel: string;
15
+ ownerId: string | null;
16
+ ownerLabel: string | null;
17
+ organisationId: string | null;
18
+ managerId: string | null;
19
+ managerName: string | null;
20
+ locationId: string | null;
21
+ locationLabel: string | null;
22
+ locationAddress: string | null;
23
+ groupId: string | null;
24
+ groupLabel: string | null;
25
+ groupIcon: string | null;
26
+ label: string;
27
+ code: string;
28
+ imageId: string | null;
29
+ tags: string[];
30
+ unrestricted: boolean;
31
+ online: number;
32
+ meta: { [key: string]: string };
33
+ modelStatuses: ModelStatusInfos[];
34
+ status: DeviceStatusDetails;
35
+ connectivity: DeviceConnectivityDetails;
36
+ alerts: DeviceOrganisationAlert[];
37
+ worstAlert: DeviceOrganisationAlert | null;
38
38
 
39
- get connectable(): DeviceConnectivityDetails | undefined {
40
- return this.connectivity;
41
- }
39
+ get connectable(): DeviceConnectivityDetails | undefined {
40
+ return this.connectivity;
41
+ }
42
42
 
43
- constructor(params: DeviceOrganisationInfosDTO) {
44
- this.id = params.id;
45
- this.deviceId = params.deviceId;
46
- this.manufacturerId = params.manufacturerId;
47
- this.manufacturerLabel = params.manufacturerLabel;
48
- this.articleId = params.articleId;
49
- this.articleLabel = params.articleLabel;
50
- this.modelId = params.modelId;
51
- this.modelLabel = params.modelLabel;
52
- this.ownerId = params.ownerId;
53
- this.ownerLabel = params.ownerLabel;
54
- this.organisationId = params.organisationId;
55
- this.managerId = params.managerId;
56
- this.managerName = params.managerName;
57
- this.locationId = params.locationId;
58
- this.locationLabel = params.locationLabel;
59
- this.locationAddress = params.locationAddress;
60
- this.groupId = params.groupId;
61
- this.groupLabel = params.groupLabel;
62
- this.groupIcon = params.groupIcon;
63
- this.label = params.label;
64
- this.code = params.code;
65
- this.imageId = params.imageId;
66
- this.tags = params.tags.slice();
67
- this.unrestricted = params.unrestricted;
68
- this.online = params.online;
69
- this.meta = { ...params.meta };
70
- this.modelStatuses = params.modelStatuses.map(dto => new ModelStatusInfos(dto));
71
- this.status = new DeviceStatusDetails(params.status);
72
- this.connectivity = new DeviceConnectivityDetails(params.connectivity);
73
- this.alerts = params.alerts.map(dto => new DeviceOrganisationAlert(dto));
74
- this.worstAlert = params.worstAlert != null ?
75
- new DeviceOrganisationAlert(params.worstAlert) : null;
76
- }
43
+ constructor(params: DeviceOrganisationInfosDTO) {
44
+ this.id = params.id;
45
+ this.deviceId = params.deviceId;
46
+ this.manufacturerId = params.manufacturerId;
47
+ this.manufacturerLabel = params.manufacturerLabel;
48
+ this.articleId = params.articleId;
49
+ this.articleLabel = params.articleLabel;
50
+ this.modelId = params.modelId;
51
+ this.modelLabel = params.modelLabel;
52
+ this.ownerId = params.ownerId;
53
+ this.ownerLabel = params.ownerLabel;
54
+ this.organisationId = params.organisationId;
55
+ this.managerId = params.managerId;
56
+ this.managerName = params.managerName;
57
+ this.locationId = params.locationId;
58
+ this.locationLabel = params.locationLabel;
59
+ this.locationAddress = params.locationAddress;
60
+ this.groupId = params.groupId;
61
+ this.groupLabel = params.groupLabel;
62
+ this.groupIcon = params.groupIcon;
63
+ this.label = params.label;
64
+ this.code = params.code;
65
+ this.imageId = params.imageId;
66
+ this.tags = params.tags.slice();
67
+ this.unrestricted = params.unrestricted;
68
+ this.online = params.online;
69
+ this.meta = { ...params.meta };
70
+ this.modelStatuses = params.modelStatuses.map(dto => new ModelStatusInfos(dto));
71
+ this.status = new DeviceStatusDetails(params.status);
72
+ this.connectivity = new DeviceConnectivityDetails(params.connectivity);
73
+ this.alerts = params.alerts.map(dto => new DeviceOrganisationAlert(dto));
74
+ this.worstAlert = params.worstAlert != null ?
75
+ new DeviceOrganisationAlert(params.worstAlert) : null;
76
+ }
77
77
  }
78
78
 
79
79
  export interface DeviceOrganisationInfosDTO {
80
- id: string;
81
- deviceId: string;
82
- manufacturerId: string;
83
- manufacturerLabel: string;
84
- articleId: string;
85
- articleLabel: string;
86
- modelId: string;
87
- modelLabel: string;
88
- ownerId: string | null;
89
- ownerLabel: string | null;
90
- organisationId: string;
91
- managerId: string | null;
92
- managerName: string | null;
93
- locationId: string | null;
94
- locationLabel: string | null;
95
- locationAddress: string | null;
96
- groupId: string | null;
97
- groupLabel: string | null;
98
- groupIcon: string | null;
99
- label: string;
100
- code: string;
101
- imageId: string | null;
102
- tags: string[];
103
- unrestricted: boolean;
104
- online: number;
105
- meta: { [key: string]: string };
106
- modelStatuses: ModelStatusInfosDTO[];
107
- status: DeviceStatusDetailsDTO;
108
- connectivity: DeviceConnectivityDetailsDTO;
109
- alerts: DeviceOrganisationAlertDTO[];
110
- worstAlert: DeviceOrganisationAlertDTO | null;
80
+ id: string;
81
+ deviceId: string;
82
+ manufacturerId: string;
83
+ manufacturerLabel: string;
84
+ articleId: string;
85
+ articleLabel: string;
86
+ modelId: string;
87
+ modelLabel: string;
88
+ ownerId: string | null;
89
+ ownerLabel: string | null;
90
+ organisationId: string;
91
+ managerId: string | null;
92
+ managerName: string | null;
93
+ locationId: string | null;
94
+ locationLabel: string | null;
95
+ locationAddress: string | null;
96
+ groupId: string | null;
97
+ groupLabel: string | null;
98
+ groupIcon: string | null;
99
+ label: string;
100
+ code: string;
101
+ imageId: string | null;
102
+ tags: string[];
103
+ unrestricted: boolean;
104
+ online: number;
105
+ meta: { [key: string]: string };
106
+ modelStatuses: ModelStatusInfosDTO[];
107
+ status: DeviceStatusDetailsDTO;
108
+ connectivity: DeviceConnectivityDetailsDTO;
109
+ alerts: DeviceOrganisationAlertDTO[];
110
+ worstAlert: DeviceOrganisationAlertDTO | null;
111
111
  }
112
112
 
113
113
  export interface DeviceOrganisationFilters {
114
- locationId: string | null;
115
- otherLocationId: string | null;
116
- groupId: string | null;
117
- otherGroupId: string | null;
118
- root: boolean | null;
119
- unrestricted: boolean | null;
120
- modelsIds: string[] | null;
121
- deviceOrganisationsIds: string[] | null;
122
- otherDeviceOrganisationsIds: string[] | null;
123
- search: string | null;
114
+ locationId?: string | null;
115
+ otherLocationId?: string | null;
116
+ groupId?: string | null;
117
+ otherGroupId?: string | null;
118
+ root?: boolean | null;
119
+ unrestricted?: boolean | null;
120
+ modelsIds?: string[] | null;
121
+ deviceOrganisationsIds?: string[] | null;
122
+ otherDeviceOrganisationsIds?: string[] | null;
123
+ search?: string | null;
124
124
  }
@@ -1,52 +1,52 @@
1
1
  import { PathCrumb, PathCrumbDTO } from "../shared/pathCrumb";
2
2
 
3
3
  export class FolderInfos {
4
- id: string;
5
- organisationId: string;
6
- parentId: string | null;
7
- parentLabel: string | null;
8
- parentIcon: string | null;
9
- label: string;
10
- icon: string;
11
- code: string;
12
- tags: string[];
13
- colors: string[];
14
- imageId: string | null;
15
- path: PathCrumb[];
4
+ id: string;
5
+ organisationId: string;
6
+ parentId: string | null;
7
+ parentLabel: string | null;
8
+ parentIcon: string | null;
9
+ label: string;
10
+ icon: string;
11
+ code: string;
12
+ tags: string[];
13
+ colors: string[];
14
+ imageId: string | null;
15
+ path: PathCrumb[];
16
16
 
17
- constructor(params: FolderInfosDTO) {
18
- this.id = params.id;
19
- this.organisationId = params.organisationId;
20
- this.parentId = params.parentId;
21
- this.parentLabel = params.parentLabel;
22
- this.parentIcon = params.parentIcon;
23
- this.label = params.label;
24
- this.icon = params.icon;
25
- this.code = params.code;
26
- this.tags = params.tags.slice();
27
- this.colors = params.colors.slice();
28
- this.imageId = params.imageId;
29
- this.path = params.path.map(dto => new PathCrumb(dto)).sort((a, b) => b.index - a.index);
30
- }
17
+ constructor(params: FolderInfosDTO) {
18
+ this.id = params.id;
19
+ this.organisationId = params.organisationId;
20
+ this.parentId = params.parentId;
21
+ this.parentLabel = params.parentLabel;
22
+ this.parentIcon = params.parentIcon;
23
+ this.label = params.label;
24
+ this.icon = params.icon;
25
+ this.code = params.code;
26
+ this.tags = params.tags.slice();
27
+ this.colors = params.colors.slice();
28
+ this.imageId = params.imageId;
29
+ this.path = params.path.map(dto => new PathCrumb(dto)).sort((a, b) => b.index - a.index);
30
+ }
31
31
  }
32
32
 
33
33
  export interface FolderInfosDTO {
34
- id: string;
35
- organisationId: string;
36
- parentId: string | null;
37
- parentLabel: string | null;
38
- parentIcon: string | null;
39
- label: string;
40
- icon: string;
41
- code: string;
42
- tags: string[];
43
- colors: string[];
44
- imageId: string | null;
45
- path: PathCrumbDTO[];
34
+ id: string;
35
+ organisationId: string;
36
+ parentId: string | null;
37
+ parentLabel: string | null;
38
+ parentIcon: string | null;
39
+ label: string;
40
+ icon: string;
41
+ code: string;
42
+ tags: string[];
43
+ colors: string[];
44
+ imageId: string | null;
45
+ path: PathCrumbDTO[];
46
46
  }
47
47
 
48
48
  export interface FolderFilters {
49
- parentId: string | null;
50
- root: boolean | null;
51
- search: string | null;
49
+ parentId?: string | null;
50
+ root?: boolean | null;
51
+ search?: string | null;
52
52
  }
@@ -55,9 +55,9 @@ export interface GroupInfosDTO {
55
55
  }
56
56
 
57
57
  export interface GroupFilters {
58
- parentId: string | null;
59
- root: boolean | null;
60
- modelsIds: string[] | null;
61
- groupsIds: string[] | null;
62
- search: string | null;
58
+ parentId?: string | null;
59
+ root?: boolean | null;
60
+ modelsIds?: string[] | null;
61
+ groupsIds?: string[] | null;
62
+ search?: string | null;
63
63
  }
@@ -40,7 +40,7 @@ export interface LocationInfosDTO {
40
40
  }
41
41
 
42
42
  export interface LocationFilters {
43
- locationsIds: string[] | null;
44
- modelsIds: string[] | null;
45
- search: string | null;
43
+ locationsIds?: string[] | null;
44
+ modelsIds?: string[] | null;
45
+ search?: string | null;
46
46
  }
@@ -17,5 +17,5 @@ export interface ManufacturerInfosDTO {
17
17
  }
18
18
 
19
19
  export interface ManufacturerFilters {
20
- search: string | null;
20
+ search?: string | null;
21
21
  }
@@ -53,6 +53,6 @@ export interface ModelStatusInfosDTO {
53
53
  }
54
54
 
55
55
  export interface ModelStatusFilters {
56
- modelId: string | null;
57
- search: string | null;
56
+ modelId?: string | null;
57
+ search?: string | null;
58
58
  }
@@ -29,6 +29,6 @@ export interface ModelInfosDTO {
29
29
  }
30
30
 
31
31
  export interface ModelFilters {
32
- modelsIds: string[] | null;
33
- search: string | null;
32
+ modelsIds?: string[] | null;
33
+ search?: string | null;
34
34
  }
@@ -20,5 +20,5 @@ export interface PermissionCategoryInfosDTO {
20
20
  }
21
21
 
22
22
  export interface PermissionCategoryFilters {
23
- search: string | null;
23
+ search?: string | null;
24
24
  }
@@ -48,6 +48,6 @@ export interface RoleOrganisationTypeInfosDTO {
48
48
  }
49
49
 
50
50
  export interface RoleOrganisationTypeFilters {
51
- userType: number | null;
52
- search: string | null;
51
+ userType?: number | null;
52
+ search?: string | null;
53
53
  }
@@ -43,6 +43,6 @@ export interface RoleOrganisationInfosDTO {
43
43
  }
44
44
 
45
45
  export interface RoleOrganisationFilters {
46
- userType: UserType | null;
47
- search: string | null;
46
+ userType?: UserType | null;
47
+ search?: string | null;
48
48
  }
@@ -57,6 +57,6 @@ export interface ScenarioDeviceOrganisationInfosDTO {
57
57
  }
58
58
 
59
59
  export interface ScenarioDeviceOrganisationFilters {
60
- scenarioId: string | null;
61
- deviceOrganisationId: string | null;
60
+ scenarioId?: string | null;
61
+ deviceOrganisationId?: string | null;
62
62
  }
@@ -60,5 +60,5 @@ export interface ScenarioOrganisationTypeInfosDTO {
60
60
  }
61
61
 
62
62
  export interface ScenarioOrganisationTypeFilters {
63
- modelId: string | null;
63
+ modelId?: string | null;
64
64
  }
@@ -57,5 +57,5 @@ export interface ScenarioOrganisationInfosDTO {
57
57
  }
58
58
 
59
59
  export interface ScenarioOrganisationFilters {
60
- modelId: string | null;
60
+ modelId?: string | null;
61
61
  }
@@ -50,5 +50,5 @@ export interface ServiceAccountInfosDTO {
50
50
  }
51
51
 
52
52
  export interface ServiceAccountFilters {
53
- search: string | null;
53
+ search?: string | null;
54
54
  }
@@ -68,5 +68,5 @@ export interface UserOrganisationInfosDTO {
68
68
  }
69
69
 
70
70
  export interface UserOrganisationFilters {
71
- search: string | null;
71
+ search?: string | null;
72
72
  }
@@ -32,5 +32,5 @@ export interface WidgetTemplateInfosDTO {
32
32
  }
33
33
 
34
34
  export interface WidgetTemplateFilters {
35
- search: string | null;
35
+ search?: string | null;
36
36
  }
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.103",
4
+ "version": "0.0.105",
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": "dd1b4c1e23a1826d70e02de27cb419205392fc5c"
12
+ "gitHead": "87c3913599bcfc96f33e3f2528e2be91a252726e"
13
13
  }
@@ -0,0 +1,49 @@
1
+ import _ from "lodash";
2
+
3
+ import { CustomPropertyInfos, PropertyDataType } from "@dative-gpi/foundation-core-domain/models";
4
+ import { FSGridItem } from "@dative-gpi/foundation-shared-components/models";
5
+
6
+ export const CustomPropertiesTools = {
7
+ showCategory: (properties: CustomPropertyInfos[], category: string): boolean => {
8
+ return properties.some(cp => cp.categoryLabel === category);
9
+ },
10
+ getExtraGridItems: (properties: CustomPropertyInfos[], category: string): FSGridItem[] => {
11
+ return properties.filter(cp => cp.categoryLabel === category).map(cp => ({
12
+ label: cp.label,
13
+ code: `meta.${cp.code}`,
14
+ value: "",
15
+ hideDefault: cp.dataType === PropertyDataType.Boolean || cp.dataType === PropertyDataType.Icon
16
+ }));
17
+ },
18
+ getExtraGrids: (properties: CustomPropertyInfos[], categories: string[]): { [key: string]: FSGridItem[] } => {
19
+ const extraGrids: { [key: string]: FSGridItem[] } = {};
20
+ const extraCategories = _.groupBy(properties.filter(cp => !categories.includes(cp.categoryLabel)), cp => cp.categoryLabel);
21
+ for (const category in extraCategories) {
22
+ extraGrids[category] = extraCategories[category].map(cp => ({
23
+ label: cp.label,
24
+ code: `meta.${cp.code}`,
25
+ value: "",
26
+ hideDefault: cp.dataType === PropertyDataType.Boolean || cp.dataType === PropertyDataType.Icon
27
+ }));
28
+ }
29
+ return extraGrids;
30
+ },
31
+ getExtraFields: (properties: CustomPropertyInfos[], category: string): CustomPropertyInfos[] => {
32
+ return properties.filter(cp => cp.categoryLabel === category && !cp.readOnlyCore);
33
+ },
34
+ getExtraCategories: (properties: CustomPropertyInfos[], categories: string[], sortFirst: string[]): { [key: string]: CustomPropertyInfos[] } => {
35
+ const unordered = _.groupBy(properties.filter(cp => !categories.includes(cp.categoryLabel) && !cp.readOnlyCore), cp => cp.categoryLabel);
36
+
37
+ return Object.keys(unordered).sort((a: string, b: string) => {
38
+ const aIndex = sortFirst.indexOf(a);
39
+ const bIndex = sortFirst.indexOf(b);
40
+ if ((aIndex !== -1 && bIndex !== -1) || aIndex === bIndex) {
41
+ return 0;
42
+ }
43
+ return bIndex - aIndex;
44
+ }).reduce((obj: { [key: string]: any }, key: string) => {
45
+ obj[key] = unordered[key];
46
+ return obj
47
+ }, {});
48
+ }
49
+ }
package/tools/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./customPropertiesTools";