@dative-gpi/foundation-core-services 0.0.56 → 0.0.57
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.
|
@@ -9,13 +9,13 @@ const AlertServiceFactory = new ServiceFactory<AlertDetailsDTO, AlertDetails>("a
|
|
|
9
9
|
factory.addGet(ALERT_URL),
|
|
10
10
|
factory.addGetMany<AlertInfosDTO, AlertInfos, AlertFilters>(ALERTS_URL, AlertInfos),
|
|
11
11
|
factory.addRemove(ALERT_URL),
|
|
12
|
-
factory.addNotify(
|
|
13
|
-
notifyCreate: (alert: AlertDetails) =>
|
|
14
|
-
notifyUpdate: (alert: AlertDetails) =>
|
|
15
|
-
notifyRemove: (alertId: string) =>
|
|
12
|
+
factory.addNotify(notifyService => ({
|
|
13
|
+
notifyCreate: (alert: AlertDetails) => notifyService.notify("add", alert),
|
|
14
|
+
notifyUpdate: (alert: AlertDetails) => notifyService.notify("update", alert),
|
|
15
|
+
notifyRemove: (alertId: string) => notifyService.notify("delete", alertId),
|
|
16
16
|
...ServiceFactory.addCustom("acknowledge", (axios, alertId: string) => axios.patch(ALERT_URL(alertId)), (dto: AlertDetailsDTO) => {
|
|
17
17
|
const result = new AlertDetails(dto);
|
|
18
|
-
|
|
18
|
+
notifyService.notify("update", result);
|
|
19
19
|
return result;
|
|
20
20
|
})
|
|
21
21
|
}))
|
|
@@ -4,8 +4,8 @@ import { ChangeDeviceOrganisationGroupDTO, ChangeDeviceOrganisationLocationDTO,
|
|
|
4
4
|
|
|
5
5
|
import { DEVICE_ORGANISATIONS_URL, DEVICE_ORGANISATION_URL, DEVICE_ORGANISATION_GROUP_URL, DEVICE_ORGANISATION_LOCATION_URL } from "../../config/urls";
|
|
6
6
|
|
|
7
|
-
import { useTrackDeviceStatuses, useWatchDeviceStatuses } from "./useDeviceStatuses";
|
|
8
7
|
import { useTrackDeviceConnectivity, useWatchDeviceConnectivity } from "./useDeviceConnectivities";
|
|
8
|
+
import { useTrackDeviceStatuses, useWatchDeviceStatuses } from "./useDeviceStatuses";
|
|
9
9
|
|
|
10
10
|
const DeviceOrganisationServiceFactory = new ServiceFactory<DeviceOrganisationDetailsDTO, DeviceOrganisationDetails>("deviceOrganisation", DeviceOrganisationDetails)
|
|
11
11
|
.create(factory => factory.build(
|
|
@@ -14,15 +14,15 @@ const DeviceOrganisationServiceFactory = new ServiceFactory<DeviceOrganisationDe
|
|
|
14
14
|
factory.addCreate<CreateDeviceOrganisationDTO>(DEVICE_ORGANISATIONS_URL),
|
|
15
15
|
factory.addUpdate<UpdateDeviceOrganisationDTO>(DEVICE_ORGANISATION_URL),
|
|
16
16
|
factory.addRemove(DEVICE_ORGANISATION_URL),
|
|
17
|
-
factory.addNotify(
|
|
17
|
+
factory.addNotify(notifyService => ({
|
|
18
18
|
...ServiceFactory.addCustom("changeGroup", (axios, deviceOrganisationId: string, payload: ChangeDeviceOrganisationGroupDTO) => axios.put(DEVICE_ORGANISATION_GROUP_URL(deviceOrganisationId), payload), (dto: DeviceOrganisationDetailsDTO) => {
|
|
19
19
|
const result = new DeviceOrganisationDetails(dto);
|
|
20
|
-
|
|
20
|
+
notifyService.notify("update", result);
|
|
21
21
|
return result;
|
|
22
22
|
}),
|
|
23
23
|
...ServiceFactory.addCustom("changeLocation", (axios, deviceOrganisationId: string, payload: ChangeDeviceOrganisationLocationDTO) => axios.put(DEVICE_ORGANISATION_LOCATION_URL(deviceOrganisationId), payload), (dto: DeviceOrganisationDetailsDTO) => {
|
|
24
24
|
const result = new DeviceOrganisationDetails(dto);
|
|
25
|
-
|
|
25
|
+
notifyService.notify("update", result);
|
|
26
26
|
return result;
|
|
27
27
|
})
|
|
28
28
|
}))
|
|
@@ -9,10 +9,10 @@ const GroupServiceFactory = new ServiceFactory<GroupDetailsDTO, GroupDetails>("g
|
|
|
9
9
|
factory.addCreate<CreateGroupDTO>(GROUPS_URL),
|
|
10
10
|
factory.addUpdate<UpdateGroupDTO>(GROUP_URL),
|
|
11
11
|
factory.addRemove(GROUP_URL),
|
|
12
|
-
factory.addNotify(
|
|
12
|
+
factory.addNotify(notifyService => ({
|
|
13
13
|
...ServiceFactory.addCustom("changeParent", (axios, groupdId: string, payload: ChangeGroupParentDTO) => axios.put(GROUP_URL(groupdId), payload), (dto: GroupDetailsDTO) => {
|
|
14
14
|
const result = new GroupDetails(dto);
|
|
15
|
-
|
|
15
|
+
notifyService.notify("update", result);
|
|
16
16
|
return result;
|
|
17
17
|
})
|
|
18
18
|
}))
|
|
@@ -5,10 +5,10 @@ import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
|
|
|
5
5
|
import { ORGANISATION_DASHBOARD_URL } from "../../config/urls";
|
|
6
6
|
|
|
7
7
|
const OrganisationServiceFactory = new ServiceFactory<OrganisationDetailsDTO, OrganisationDetails>("organisation", OrganisationDetails).create(factory => factory.build(
|
|
8
|
-
factory.addNotify(
|
|
8
|
+
factory.addNotify(notifyService => ({
|
|
9
9
|
...ServiceFactory.addCustom("changeDashboard", (axios, payload: ChangeOrganisationDashboardDTO) => axios.put(ORGANISATION_DASHBOARD_URL(), payload), (dto: OrganisationDetailsDTO) => {
|
|
10
10
|
const result = new OrganisationDetails(dto);
|
|
11
|
-
|
|
11
|
+
notifyService.notify("update", result);
|
|
12
12
|
return result;
|
|
13
13
|
})
|
|
14
14
|
}))
|
|
@@ -11,10 +11,10 @@ const UserOrganisationServiceFactory = new ServiceFactory<UserOrganisationDetail
|
|
|
11
11
|
factory.addUpdate<UpdateUserOrganisationDTO>(USER_ORGANISATION_URL),
|
|
12
12
|
factory.addRemove(USER_ORGANISATION_URL),
|
|
13
13
|
ServiceFactory.addCustom("getCurrent", (axios) => axios.get(USER_ORGANISATION_CURRENT_URL()), (dto: UserOrganisationDetailsDTO) => new UserOrganisationDetails(dto)),
|
|
14
|
-
factory.addNotify(
|
|
14
|
+
factory.addNotify(notifyService => ({
|
|
15
15
|
...ServiceFactory.addCustom("updateCurrent", (axios, payload: UpdateUserOrganisationDTO) => axios.post(USER_ORGANISATION_CURRENT_URL(), payload), (dto: UserOrganisationDetailsDTO) => {
|
|
16
16
|
const result = new UserOrganisationDetails(dto)
|
|
17
|
-
|
|
17
|
+
notifyService.notify("update", result);
|
|
18
18
|
return result;
|
|
19
19
|
}),
|
|
20
20
|
}))
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-services",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.57",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@dative-gpi/bones-ui": "^0.0.73",
|
|
14
|
-
"@dative-gpi/foundation-core-domain": "0.0.
|
|
14
|
+
"@dative-gpi/foundation-core-domain": "0.0.57",
|
|
15
15
|
"@microsoft/signalr": "^8.0.0",
|
|
16
16
|
"vue": "^3.2.0",
|
|
17
17
|
"vue-router": "^4.2.5"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "98fa5fc3463c71d1cf0e34d7ece8e874f7343e44"
|
|
20
20
|
}
|