@dative-gpi/foundation-core-services 0.1.120 → 1.0.0
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.
- package/composables/services/index.ts +9 -2
- package/composables/services/useActions.ts +4 -3
- package/composables/services/useAlerts.ts +38 -38
- package/composables/services/useArticles.ts +2 -1
- package/composables/services/useChartCategories.ts +14 -0
- package/composables/services/useChartOrganisationTypes.ts +5 -5
- package/composables/services/useChartOrganisations.ts +5 -5
- package/composables/services/useCharts.ts +3 -1
- package/composables/services/useComments.ts +2 -1
- package/composables/services/useConnectivityAlerts.ts +3 -2
- package/composables/services/useConnectivityScenarios.ts +15 -0
- package/composables/services/useCustomProperties.ts +2 -1
- package/composables/services/useCustomPropertyValues.ts +2 -1
- package/composables/services/useDashboardOrganisationTypes.ts +23 -5
- package/composables/services/useDashboardOrganisations.ts +27 -9
- package/composables/services/useDashboardShallows.ts +24 -11
- package/composables/services/useDashboards.ts +2 -1
- package/composables/services/useDataCategories.ts +2 -1
- package/composables/services/useDataDefinitions.ts +2 -1
- package/composables/services/useDataTables.ts +90 -0
- package/composables/services/useDeviceConnectivities.ts +2 -1
- package/composables/services/useDeviceOrganisations.ts +3 -2
- package/composables/services/useDeviceStatuses.ts +2 -1
- package/composables/services/useFolders.ts +2 -1
- package/composables/services/useGroups.ts +2 -1
- package/composables/services/useLocations.ts +1 -1
- package/composables/services/useManufacturers.ts +2 -1
- package/composables/services/useModels.ts +1 -1
- package/composables/services/useNotifications.ts +48 -0
- package/composables/services/useOrganisationTypes.ts +2 -1
- package/composables/services/useOrganisations.ts +3 -2
- package/composables/services/usePermissionCategories.ts +2 -1
- package/composables/services/useRoleOrganisationTypes.ts +2 -1
- package/composables/services/useRoleOrganisations.ts +2 -1
- package/composables/services/useScenarioDeviceOrganisations.ts +15 -0
- package/composables/services/useScenarioOrganisationTypes.ts +32 -0
- package/composables/services/useScenarioOrganisations.ts +26 -0
- package/composables/services/useServiceAccountOrganisationAuthTokens.ts +20 -0
- package/composables/services/useServiceAccountOrganisations.ts +14 -0
- package/composables/services/useUserOrganisationTables.ts +2 -1
- package/composables/services/useUserOrganisations.ts +3 -2
- package/composables/services/useWidgetTemplates.ts +2 -1
- package/config/literals/hubs.ts +3 -1
- package/config/urls/chartCategories.ts +4 -0
- package/config/urls/connectivityScenarios.ts +4 -0
- package/config/urls/customPropertyValues.ts +1 -1
- package/config/urls/index.ts +8 -2
- package/config/urls/notifications.ts +6 -0
- package/config/urls/scenarioDeviceOrganisations.ts +4 -0
- package/config/urls/scenarioOrganisationTypes.ts +4 -0
- package/config/urls/scenarioOrganisations.ts +4 -0
- package/config/urls/serviceAccountOrganisationAuthTokens.ts +5 -0
- package/config/urls/serviceAccountOrganisations.ts +4 -0
- package/package.json +8 -6
- package/composables/services/useAuthTokens.ts +0 -13
- package/composables/services/useServiceAccounts.ts +0 -13
- package/config/urls/authTokens.ts +0 -4
- package/config/urls/serviceAccounts.ts +0 -4
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export * from "./useActions";
|
|
2
2
|
export * from "./useAlerts";
|
|
3
3
|
export * from "./useArticles";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./useChartCategories";
|
|
5
5
|
export * from "./useChartOrganisationTypes";
|
|
6
6
|
export * from "./useChartOrganisations";
|
|
7
7
|
export * from "./useCharts";
|
|
8
8
|
export * from "./useComments";
|
|
9
9
|
export * from "./useConnectivityAlerts";
|
|
10
|
+
export * from "./useConnectivityScenarios";
|
|
10
11
|
export * from "./useCustomProperties";
|
|
11
12
|
export * from "./useCustomPropertyValues";
|
|
12
13
|
export * from "./useDashboardOrganisations";
|
|
@@ -15,6 +16,7 @@ export * from "./useDashboards";
|
|
|
15
16
|
export * from "./useDashboardShallows";
|
|
16
17
|
export * from "./useDataCategories";
|
|
17
18
|
export * from "./useDataDefinitions";
|
|
19
|
+
export * from "./useDataTables";
|
|
18
20
|
export * from "./useDeviceConnectivities";
|
|
19
21
|
export * from "./useDeviceOrganisations";
|
|
20
22
|
export * from "./useDeviceStatuses";
|
|
@@ -23,12 +25,17 @@ export * from "./useGroups";
|
|
|
23
25
|
export * from "./useLocations";
|
|
24
26
|
export * from "./useManufacturers";
|
|
25
27
|
export * from "./useModels";
|
|
28
|
+
export * from "./useNotifications";
|
|
26
29
|
export * from "./useOrganisations";
|
|
27
30
|
export * from "./useOrganisationTypes";
|
|
28
31
|
export * from "./usePermissionCategories";
|
|
29
32
|
export * from "./useRoleOrganisations";
|
|
30
33
|
export * from "./useRoleOrganisationTypes";
|
|
31
|
-
export * from "./
|
|
34
|
+
export * from "./useScenarioDeviceOrganisations";
|
|
35
|
+
export * from "./useScenarioOrganisations";
|
|
36
|
+
export * from "./useScenarioOrganisationTypes";
|
|
37
|
+
export * from "./useServiceAccountOrganisationAuthTokens";
|
|
38
|
+
export * from "./useServiceAccountOrganisations";
|
|
32
39
|
export * from "./useUserOrganisations";
|
|
33
40
|
export * from "./useUserOrganisationTables";
|
|
34
41
|
export * from "./useWidgetTemplates";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ActionDetailsDTO, ActionFilters, ActionInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { ActionDetails, ActionInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
|
|
3
4
|
|
|
4
5
|
import { ACTIONS_URL } from "../../config/urls";
|
|
5
6
|
|
|
6
7
|
const ActionServiceFactory = new ServiceFactory<ActionDetailsDTO, ActionDetails>("action", ActionDetails).create(factory => factory.build(
|
|
7
|
-
factory.addGetMany<ActionInfosDTO, ActionInfos,
|
|
8
|
+
factory.addGetMany<ActionInfosDTO, ActionInfos, ActionFilters>(ACTIONS_URL, ActionInfos),
|
|
8
9
|
factory.addNotify()
|
|
9
10
|
));
|
|
10
11
|
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AlertDetails, AlertDetailsDTO, AlertFilters, AlertInfos, AlertInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { AlertDetails, type AlertDetailsDTO, type AlertFilters, AlertInfos, type AlertInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
2
|
import { HubFactory } from "@dative-gpi/foundation-shared-services/tools/hubFactory";
|
|
3
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
4
|
|
|
5
|
-
import { HUBS } from "../../config/literals";
|
|
6
5
|
import { ALERTS_HUB_URL, ALERTS_URL, ALERT_URL } from "../../config/urls";
|
|
6
|
+
import { HUBS } from "../../config/literals";
|
|
7
7
|
|
|
8
8
|
const AlertServiceFactory = new ServiceFactory<AlertDetailsDTO, AlertDetails>("alert", AlertDetails).create(factory => factory.build(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
factory.addGet(ALERT_URL),
|
|
10
|
+
factory.addGetMany<AlertInfosDTO, AlertInfos, AlertFilters>(ALERTS_URL, AlertInfos),
|
|
11
|
+
factory.addRemove(ALERT_URL),
|
|
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
|
+
...ServiceFactory.addCustom("acknowledge", (axios, alertId: string) => axios.patch(ALERT_URL(alertId)), (dto: AlertDetailsDTO) => {
|
|
17
|
+
const result = new AlertDetails(dto);
|
|
18
|
+
notifyService.notify("update", result);
|
|
19
|
+
return result;
|
|
20
|
+
})
|
|
21
|
+
}))
|
|
22
22
|
));
|
|
23
23
|
|
|
24
24
|
const useAlertsHub = HubFactory.create(ALERTS_HUB_URL,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
(connection, { isWatched, hasWatchers }) => {
|
|
26
|
+
connection.on(HUBS.CREATE_ALERT, (alertId: string) => hasWatchers()
|
|
27
|
+
? AlertServiceFactory.get(alertId).then(AlertServiceFactory.notifyCreate)
|
|
28
|
+
: null);
|
|
29
|
+
connection.on(HUBS.UPDATE_ALERT, (alertId: string) => isWatched(alertId) || hasWatchers()
|
|
30
|
+
? AlertServiceFactory.get(alertId).then(AlertServiceFactory.notifyUpdate)
|
|
31
|
+
: null);
|
|
32
|
+
connection.on(HUBS.REMOVE_ALERT, (alertId: string) => hasWatchers()
|
|
33
|
+
? AlertServiceFactory.notifyRemove(alertId)
|
|
34
|
+
: null);
|
|
35
|
+
},
|
|
36
|
+
async (connection) => {
|
|
37
|
+
await connection.invoke(HUBS.SUBSCRIBE);
|
|
38
|
+
}
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
const useWatchAlerts = HubFactory.createWatcher(useAlertsHub);
|
|
42
42
|
|
|
43
43
|
export const useAlert = ComposableFactory.get(AlertServiceFactory, () => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const { watchOne } = useWatchAlerts();
|
|
45
|
+
return (alert) => {
|
|
46
|
+
watchOne(alert.value.id);
|
|
47
|
+
}
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
export const useAlerts = ComposableFactory.getMany(AlertServiceFactory, () => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
const { watchMany } = useWatchAlerts();
|
|
52
|
+
return () => {
|
|
53
|
+
watchMany();
|
|
54
|
+
}
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
export const useRemoveAlert = ComposableFactory.remove(AlertServiceFactory);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ArticleDetailsDTO, ArticleFilters, ArticleInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { ArticleDetails, ArticleInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { ARTICLES_URL, ARTICLE_URL } from "../../config/urls";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CreateChartCategoryDTO, ChartCategoryDetailsDTO, ChartCategoryFilters, ChartCategoryInfosDTO, UpdateChartCategoryDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { ChartCategoryDetails, ChartCategoryInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
|
+
|
|
5
|
+
import { CHART_CATEGORIES_URL, CHART_CATEGORY_URL } from "../../config/urls";
|
|
6
|
+
|
|
7
|
+
const ChartCategoryServiceFactory = new ServiceFactory<ChartCategoryDetailsDTO, ChartCategoryDetails>("chartCategory", ChartCategoryDetails)
|
|
8
|
+
.createComplete<ChartCategoryInfos, ChartCategoryInfosDTO, CreateChartCategoryDTO, UpdateChartCategoryDTO, ChartCategoryFilters>(CHART_CATEGORIES_URL, CHART_CATEGORY_URL, ChartCategoryInfos);
|
|
9
|
+
|
|
10
|
+
export const useChartCategory = ComposableFactory.get(ChartCategoryServiceFactory);
|
|
11
|
+
export const useChartCategories = ComposableFactory.getMany(ChartCategoryServiceFactory);
|
|
12
|
+
export const useCreateChartCategory = ComposableFactory.create(ChartCategoryServiceFactory);
|
|
13
|
+
export const useUpdateChartCategory = ComposableFactory.update(ChartCategoryServiceFactory);
|
|
14
|
+
export const useRemoveChartCategory = ComposableFactory.remove(ChartCategoryServiceFactory);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ChartOrganisationTypeDetailsDTO, ChartOrganisationTypeFilters, ChartOrganisationTypeInfosDTO, CreateChartOrganisationTypeDTO, UpdateChartOrganisationTypeDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { ChartOrganisationTypeDetails, ChartOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
-
import { CHART_ORGANISATION_TYPE_URL, CHART_ORGANISATION_TYPES_URL } from "../../config/urls";
|
|
3
|
-
import { ChartOrganisationTypeDetails, ChartOrganisationTypeDetailsDTO, ChartOrganisationTypeFilters, ChartOrganisationTypeInfos, ChartOrganisationTypeInfosDTO, CreateChartOrganisationTypeDTO, UpdateChartOrganisationTypeDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
4
4
|
|
|
5
|
+
import { CHART_ORGANISATION_TYPE_URL, CHART_ORGANISATION_TYPES_URL } from "../../config/urls";
|
|
5
6
|
|
|
6
7
|
const ChartOrganisationTypeServiceFactory = new ServiceFactory<ChartOrganisationTypeDetailsDTO, ChartOrganisationTypeDetails>("chartOrganisationType", ChartOrganisationTypeDetails)
|
|
7
8
|
.createComplete<ChartOrganisationTypeInfos, ChartOrganisationTypeInfosDTO, CreateChartOrganisationTypeDTO, UpdateChartOrganisationTypeDTO, ChartOrganisationTypeFilters>(CHART_ORGANISATION_TYPES_URL, CHART_ORGANISATION_TYPE_URL, ChartOrganisationTypeInfos);
|
|
@@ -9,7 +10,7 @@ const ChartOrganisationTypeServiceFactory = new ServiceFactory<ChartOrganisation
|
|
|
9
10
|
const ChartOrganisationTypeServiceFactoryIncomplete = new ServiceFactory("chartOrganisationType", ChartOrganisationTypeDetails)
|
|
10
11
|
.create(factory => factory.build(
|
|
11
12
|
factory.addNotify(notifyService => ({
|
|
12
|
-
...ServiceFactory.addCustom("
|
|
13
|
+
...ServiceFactory.addCustom("duplicate", (axios, charOrganisationTypeId: string) => axios.patch(CHART_ORGANISATION_TYPE_URL(charOrganisationTypeId)), (dto: ChartOrganisationTypeDetailsDTO) => {
|
|
13
14
|
const result = new ChartOrganisationTypeDetails(dto);
|
|
14
15
|
notifyService.notify("update", result);
|
|
15
16
|
return result;
|
|
@@ -22,5 +23,4 @@ export const useChartOrganisationTypes = ComposableFactory.getMany(ChartOrganisa
|
|
|
22
23
|
export const useCreateChartOrganisationType = ComposableFactory.create(ChartOrganisationTypeServiceFactory);
|
|
23
24
|
export const useUpdateChartOrganisationType = ComposableFactory.update(ChartOrganisationTypeServiceFactory);
|
|
24
25
|
export const useRemoveChartOrganisationType = ComposableFactory.remove(ChartOrganisationTypeServiceFactory);
|
|
25
|
-
export const useDuplicateChartOrganisationType = ComposableFactory.custom(ChartOrganisationTypeServiceFactoryIncomplete.
|
|
26
|
-
|
|
26
|
+
export const useDuplicateChartOrganisationType = ComposableFactory.custom(ChartOrganisationTypeServiceFactoryIncomplete.duplicate);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ChartOrganisationDetailsDTO, ChartOrganisationFilters, ChartOrganisationInfosDTO, CreateChartOrganisationDTO, UpdateChartOrganisationDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { ChartOrganisationDetails, ChartOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
-
import { CHART_ORGANISATION_URL, CHART_ORGANISATIONS_URL } from "../../config/urls";
|
|
3
|
-
import { ChartOrganisationDetails, ChartOrganisationDetailsDTO, ChartOrganisationFilters, ChartOrganisationInfos, ChartOrganisationInfosDTO, CreateChartOrganisationDTO, UpdateChartOrganisationDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
4
4
|
|
|
5
|
+
import { CHART_ORGANISATION_URL, CHART_ORGANISATIONS_URL } from "../../config/urls";
|
|
5
6
|
|
|
6
7
|
const ChartOrganisationServiceFactory = new ServiceFactory<ChartOrganisationDetailsDTO, ChartOrganisationDetails>("chartOrganisation", ChartOrganisationDetails)
|
|
7
8
|
.createComplete<ChartOrganisationInfos, ChartOrganisationInfosDTO, CreateChartOrganisationDTO, UpdateChartOrganisationDTO, ChartOrganisationFilters>(CHART_ORGANISATIONS_URL, CHART_ORGANISATION_URL, ChartOrganisationInfos);
|
|
@@ -9,7 +10,7 @@ const ChartOrganisationServiceFactory = new ServiceFactory<ChartOrganisationDeta
|
|
|
9
10
|
const ChartOrganisationServiceFactoryIncomplete = new ServiceFactory("chartOrganisation", ChartOrganisationDetails)
|
|
10
11
|
.create(factory => factory.build(
|
|
11
12
|
factory.addNotify(notifyService => ({
|
|
12
|
-
...ServiceFactory.addCustom("
|
|
13
|
+
...ServiceFactory.addCustom("duplicate", (axios, chartOrganisationId: string) => axios.patch(CHART_ORGANISATION_URL(chartOrganisationId)), (dto: ChartOrganisationDetailsDTO) => {
|
|
13
14
|
const result = new ChartOrganisationDetails(dto);
|
|
14
15
|
notifyService.notify("update", result);
|
|
15
16
|
return result;
|
|
@@ -22,5 +23,4 @@ export const useChartOrganisations = ComposableFactory.getMany(ChartOrganisation
|
|
|
22
23
|
export const useCreateChartOrganisation = ComposableFactory.create(ChartOrganisationServiceFactory);
|
|
23
24
|
export const useUpdateChartOrganisation = ComposableFactory.update(ChartOrganisationServiceFactory);
|
|
24
25
|
export const useRemoveChartOrganisation = ComposableFactory.remove(ChartOrganisationServiceFactory);
|
|
25
|
-
export const useDuplicateChartOrganisation = ComposableFactory.custom(ChartOrganisationServiceFactoryIncomplete.
|
|
26
|
-
|
|
26
|
+
export const useDuplicateChartOrganisation = ComposableFactory.custom(ChartOrganisationServiceFactoryIncomplete.duplicate);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
|
|
2
|
+
import type { ChartDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { ChartDetails } from "@dative-gpi/foundation-core-domain/models";
|
|
2
4
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
5
|
+
|
|
3
6
|
import { CHART_URL } from "../../config/urls";
|
|
4
|
-
import { ChartDetails, ChartDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
5
7
|
|
|
6
8
|
const ChartServiceFactory = new ServiceFactory<ChartDetailsDTO, ChartDetails>("chart", ChartDetails).create(factory => factory.build(
|
|
7
9
|
factory.addGet(CHART_URL),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CreateCommentDTO,
|
|
1
|
+
import type { CreateCommentDTO, CommentDetailsDTO, CommentFilters, CommentInfosDTO, UpdateCommentDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { CommentDetails, CommentInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { COMMENTS_URL, COMMENT_URL } from "../../config/urls";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
-
import {
|
|
2
|
+
import type { ConnectivityAlertDetailsDTO, ConnectivityAlertFilters, ConnectivityAlertInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { ConnectivityAlertDetails, ConnectivityAlertInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
3
4
|
import { HubFactory } from "@dative-gpi/foundation-shared-services/tools/hubFactory";
|
|
4
5
|
|
|
5
6
|
import { CONNECTIVITY_ALERTS_HUB_URL, CONNECTIVITY_ALERTS_URL, CONNECTIVITY_ALERT_URL } from "../../config/urls";
|
|
@@ -44,7 +45,7 @@ export const useConnectivityAlert = ComposableFactory.get(ConnectivityAlertServi
|
|
|
44
45
|
|
|
45
46
|
export const useConnectivityAlerts = ComposableFactory.getMany(ConnectivityAlertServiceFactory, () => {
|
|
46
47
|
const { watchMany } = useWatchConnectivityAlerts();
|
|
47
|
-
return (
|
|
48
|
+
return () => {
|
|
48
49
|
watchMany();
|
|
49
50
|
}
|
|
50
51
|
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
+
import type { CreateConnectivityScenarioDTO, ConnectivityScenarioDetailsDTO, ConnectivityScenarioFilters, ConnectivityScenarioInfosDTO, UpdateConnectivityScenarioDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { ConnectivityScenarioDetails, ConnectivityScenarioInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
+
|
|
5
|
+
import { CONNECTIVITY_SCENARIOS_URL, CONNECTIVITY_SCENARIO_URL } from "../../config";
|
|
6
|
+
|
|
7
|
+
const ConnectivityScenarioServiceFactory = new ServiceFactory<ConnectivityScenarioDetailsDTO, ConnectivityScenarioDetails>("ConnectivityScenario", ConnectivityScenarioDetails)
|
|
8
|
+
.createComplete<ConnectivityScenarioInfos, ConnectivityScenarioInfosDTO, CreateConnectivityScenarioDTO, UpdateConnectivityScenarioDTO, ConnectivityScenarioFilters>(CONNECTIVITY_SCENARIOS_URL, CONNECTIVITY_SCENARIO_URL, ConnectivityScenarioInfos);
|
|
9
|
+
|
|
10
|
+
export const useConnectivityScenario = ComposableFactory.get(ConnectivityScenarioServiceFactory);
|
|
11
|
+
export const useConnectivityScenarios = ComposableFactory.getMany(ConnectivityScenarioServiceFactory);
|
|
12
|
+
export const useCreateConnectivityScenario = ComposableFactory.create(ConnectivityScenarioServiceFactory);
|
|
13
|
+
export const useUpdateConnectivityScenario = ComposableFactory.update(ConnectivityScenarioServiceFactory);
|
|
14
|
+
export const useRemoveConnectivityScenario = ComposableFactory.remove(ConnectivityScenarioServiceFactory);
|
|
15
|
+
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CustomPropertyDetailsDTO, CustomPropertyFilters, CustomPropertyInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { CustomPropertyDetails, CustomPropertyInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { CUSTOM_PROPERTIES_URL } from "../../config/urls";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CustomPropertyValueInfosDTO, PropertyEntity } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { CustomPropertyValueInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { CUSTOM_PROPERTY_VALUES_URL } from "../../config/urls";
|
|
@@ -1,21 +1,39 @@
|
|
|
1
|
+
import type { DashboardOrganisationTypeDetailsDTO, DashboardOrganisationTypeFilters, DashboardOrganisationTypeInfosDTO, LockDashboardOrganisationTypeDTO, PublishDashboardOrganisationTypeDTO, UpdateDashboardOrganisationTypeDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { DashboardOrganisationTypeDetails, DashboardOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
-
import { CreateDashboardOrganisationTypeDTO, DashboardOrganisationTypeDetails, DashboardOrganisationTypeDetailsDTO, DashboardOrganisationTypeFilters, DashboardOrganisationTypeInfos, DashboardOrganisationTypeInfosDTO, UpdateDashboardOrganisationTypeDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
4
|
|
|
4
|
-
import { DASHBOARD_ORGANISATION_TYPE_URL, DASHBOARD_ORGANISATION_TYPES_URL } from "../../config";
|
|
5
|
+
import { DASHBOARD_ORGANISATION_TYPE_LOCK_URL, DASHBOARD_ORGANISATION_TYPE_URL, DASHBOARD_ORGANISATION_TYPES_URL } from "../../config";
|
|
5
6
|
|
|
6
7
|
const DashboardOrganisationTypeServiceFactory = new ServiceFactory<DashboardOrganisationTypeDetailsDTO, DashboardOrganisationTypeDetails>("dashboardOrganisationType", DashboardOrganisationTypeDetails)
|
|
7
8
|
.create(factory => factory.build(
|
|
8
9
|
factory.addGet(DASHBOARD_ORGANISATION_TYPE_URL),
|
|
9
10
|
factory.addGetMany<DashboardOrganisationTypeInfosDTO, DashboardOrganisationTypeInfos, DashboardOrganisationTypeFilters>(DASHBOARD_ORGANISATION_TYPES_URL, DashboardOrganisationTypeInfos),
|
|
10
|
-
factory.addCreate<CreateDashboardOrganisationTypeDTO>(DASHBOARD_ORGANISATION_TYPES_URL),
|
|
11
11
|
factory.addUpdate<UpdateDashboardOrganisationTypeDTO>(DASHBOARD_ORGANISATION_TYPE_URL),
|
|
12
12
|
factory.addRemove(DASHBOARD_ORGANISATION_TYPE_URL),
|
|
13
|
-
factory.addNotify(
|
|
13
|
+
factory.addNotify(notifyService => ({
|
|
14
|
+
...ServiceFactory.addCustom("publish", (axios, payload: PublishDashboardOrganisationTypeDTO) => axios.post(DASHBOARD_ORGANISATION_TYPES_URL(), payload), (dto: DashboardOrganisationTypeDetailsDTO) => {
|
|
15
|
+
const result = new DashboardOrganisationTypeDetails(dto);
|
|
16
|
+
notifyService.notify("update", result);
|
|
17
|
+
return result;
|
|
18
|
+
}),
|
|
19
|
+
...ServiceFactory.addCustom("duplicate", (axios, dashboardOrganisationTypeId: string) => axios.patch(DASHBOARD_ORGANISATION_TYPE_URL(dashboardOrganisationTypeId)), (dto: DashboardOrganisationTypeDetailsDTO) => {
|
|
20
|
+
const result = new DashboardOrganisationTypeDetails(dto);
|
|
21
|
+
notifyService.notify("update", result);
|
|
22
|
+
return result;
|
|
23
|
+
}),
|
|
24
|
+
...ServiceFactory.addCustom("lock", (axios, dashboardOrganisationTypeId: string, payload: LockDashboardOrganisationTypeDTO) => axios.put(DASHBOARD_ORGANISATION_TYPE_LOCK_URL(dashboardOrganisationTypeId), payload), (dto: DashboardOrganisationTypeDetailsDTO) => {
|
|
25
|
+
const result = new DashboardOrganisationTypeDetails(dto);
|
|
26
|
+
notifyService.notify("update", result);
|
|
27
|
+
return result;
|
|
28
|
+
})
|
|
29
|
+
}))
|
|
14
30
|
));
|
|
15
31
|
|
|
16
32
|
export const useDashboardOrganisationType = ComposableFactory.get(DashboardOrganisationTypeServiceFactory);
|
|
17
33
|
export const useDashboardOrganisationTypes = ComposableFactory.getMany(DashboardOrganisationTypeServiceFactory);
|
|
18
|
-
export const useCreateDashboardOrganisationType = ComposableFactory.create(DashboardOrganisationTypeServiceFactory);
|
|
19
34
|
export const useUpdateDashboardOrganisationType = ComposableFactory.update(DashboardOrganisationTypeServiceFactory);
|
|
20
35
|
export const useRemoveDashboardOrganisationType = ComposableFactory.remove(DashboardOrganisationTypeServiceFactory);
|
|
36
|
+
export const usePublishDashboardOrganisationType = ComposableFactory.custom(DashboardOrganisationTypeServiceFactory.publish);
|
|
37
|
+
export const useDuplicateDashboardOrganisationType = ComposableFactory.custom(DashboardOrganisationTypeServiceFactory.duplicate);
|
|
38
|
+
export const useLockDashboardOrganisationType = ComposableFactory.custom(DashboardOrganisationTypeServiceFactory.lock);
|
|
21
39
|
|
|
@@ -1,15 +1,31 @@
|
|
|
1
|
+
import type { DashboardOrganisationDetailsDTO, DashboardOrganisationFilters, DashboardOrganisationInfosDTO, CreateDashboardOrganisationDTO, UpdateDashboardOrganisationDTO, LockDashboardOrganisationDTO, ChangeDashboardOrganisationFolderDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { DashboardOrganisationDetails, DashboardOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
-
|
|
3
|
-
import { DASHBOARD_ORGANISATION_URL, DASHBOARD_ORGANISATIONS_URL } from "../../config";
|
|
4
|
+
|
|
5
|
+
import { DASHBOARD_ORGANISATION_FOLDER_URL, DASHBOARD_ORGANISATION_LOCK_URL, DASHBOARD_ORGANISATION_URL, DASHBOARD_ORGANISATIONS_URL } from "../../config/urls";
|
|
4
6
|
|
|
5
7
|
const DashboardOrganisationServiceFactory = new ServiceFactory<DashboardOrganisationDetailsDTO, DashboardOrganisationDetails>("dashboardOrganisation", DashboardOrganisationDetails)
|
|
8
|
+
.createComplete<DashboardOrganisationInfos, DashboardOrganisationInfosDTO, CreateDashboardOrganisationDTO, UpdateDashboardOrganisationDTO, DashboardOrganisationFilters>(DASHBOARD_ORGANISATIONS_URL, DASHBOARD_ORGANISATION_URL, DashboardOrganisationInfos);
|
|
9
|
+
|
|
10
|
+
const DashboardOrganisationServiceFactoryIncomplete = new ServiceFactory("dashboardOrganisation", DashboardOrganisationDetails)
|
|
6
11
|
.create(factory => factory.build(
|
|
7
|
-
factory.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
factory.addNotify(notifyService => ({
|
|
13
|
+
...ServiceFactory.addCustom("duplicate", (axios, dashboardOrganisationId: string) => axios.patch(DASHBOARD_ORGANISATION_URL(dashboardOrganisationId)), (dto: DashboardOrganisationDetailsDTO) => {
|
|
14
|
+
const result = new DashboardOrganisationDetails(dto);
|
|
15
|
+
notifyService.notify("update", result);
|
|
16
|
+
return result;
|
|
17
|
+
}),
|
|
18
|
+
...ServiceFactory.addCustom("lock", (axios, dashboardOrganisationId: string, payload: LockDashboardOrganisationDTO) => axios.put(DASHBOARD_ORGANISATION_LOCK_URL(dashboardOrganisationId), payload), (dto: DashboardOrganisationDetailsDTO) => {
|
|
19
|
+
const result = new DashboardOrganisationDetails(dto);
|
|
20
|
+
notifyService.notify("update", result);
|
|
21
|
+
return result;
|
|
22
|
+
}),
|
|
23
|
+
...ServiceFactory.addCustom("changeFolder", (axios, dashboardOrganisationId: string, payload: ChangeDashboardOrganisationFolderDTO) => axios.put(DASHBOARD_ORGANISATION_FOLDER_URL(dashboardOrganisationId), payload), (dto: DashboardOrganisationDetailsDTO) => {
|
|
24
|
+
const result = new DashboardOrganisationDetails(dto);
|
|
25
|
+
notifyService.notify("update", result);
|
|
26
|
+
return result;
|
|
27
|
+
})
|
|
28
|
+
}))
|
|
13
29
|
));
|
|
14
30
|
|
|
15
31
|
export const useDashboardOrganisation = ComposableFactory.get(DashboardOrganisationServiceFactory);
|
|
@@ -17,4 +33,6 @@ export const useDashboardOrganisations = ComposableFactory.getMany(DashboardOrga
|
|
|
17
33
|
export const useCreateDashboardOrganisation = ComposableFactory.create(DashboardOrganisationServiceFactory);
|
|
18
34
|
export const useUpdateDashboardOrganisation = ComposableFactory.update(DashboardOrganisationServiceFactory);
|
|
19
35
|
export const useRemoveDashboardOrganisation = ComposableFactory.remove(DashboardOrganisationServiceFactory);
|
|
20
|
-
|
|
36
|
+
export const useDuplicateDashboardOrganisation = ComposableFactory.custom(DashboardOrganisationServiceFactoryIncomplete.duplicate);
|
|
37
|
+
export const useLockDashboardOrganisation = ComposableFactory.custom(DashboardOrganisationServiceFactoryIncomplete.lock);
|
|
38
|
+
export const useChangeDashboardOrganisationFolder = ComposableFactory.custom(DashboardOrganisationServiceFactoryIncomplete.changeFolder);
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
+
import type { ChangeDashboardShallowFolderDTO, CreateDashboardShallowDTO, DashboardShallowDetailsDTO, DashboardShallowFilters, DashboardShallowInfosDTO, UpdateDashboardShallowDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { DashboardShallowDetails, DashboardShallowInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
-
|
|
3
|
-
import { DASHBOARD_SHALLOW_URL, DASHBOARD_SHALLOWS_URL } from "../../config/urls/dashboardShallows";
|
|
4
|
+
|
|
5
|
+
import { DASHBOARD_SHALLOW_FOLDER_URL, DASHBOARD_SHALLOW_URL, DASHBOARD_SHALLOWS_URL } from "../../config/urls/dashboardShallows";
|
|
4
6
|
|
|
5
7
|
const DashboardShallowServiceFactory = new ServiceFactory<DashboardShallowDetailsDTO, DashboardShallowDetails>("dashboardShallow", DashboardShallowDetails)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
.createComplete<DashboardShallowInfos, DashboardShallowInfosDTO, CreateDashboardShallowDTO, UpdateDashboardShallowDTO, DashboardShallowFilters>(DASHBOARD_SHALLOWS_URL, DASHBOARD_SHALLOW_URL, DashboardShallowInfos);
|
|
9
|
+
|
|
10
|
+
const DashboardShallowServiceFactoryIncomplete = new ServiceFactory("dashboardShallow", DashboardShallowDetails)
|
|
11
|
+
.create(factory => factory.build(
|
|
12
|
+
factory.addNotify(notifyService => ({
|
|
13
|
+
...ServiceFactory.addCustom("duplicate", (axios, dashboardShallowId: string) => axios.patch(DASHBOARD_SHALLOW_URL(dashboardShallowId)), (dto: DashboardShallowDetailsDTO) => {
|
|
14
|
+
const result = new DashboardShallowDetails(dto);
|
|
15
|
+
notifyService.notify("update", result);
|
|
16
|
+
return result;
|
|
17
|
+
}),
|
|
18
|
+
...ServiceFactory.addCustom("changeFolder", (axios, dashboardShallowId: string, payload: ChangeDashboardShallowFolderDTO) => axios.put(DASHBOARD_SHALLOW_FOLDER_URL(dashboardShallowId), payload), (dto: DashboardShallowDetailsDTO) => {
|
|
19
|
+
const result = new DashboardShallowDetails(dto);
|
|
20
|
+
notifyService.notify("update", result);
|
|
21
|
+
return result;
|
|
22
|
+
})
|
|
23
|
+
}))
|
|
24
|
+
));
|
|
14
25
|
|
|
15
26
|
export const useDashboardShallow = ComposableFactory.get(DashboardShallowServiceFactory);
|
|
16
27
|
export const useDashboardShallows = ComposableFactory.getMany(DashboardShallowServiceFactory);
|
|
17
28
|
export const useCreateDashboardShallow = ComposableFactory.create(DashboardShallowServiceFactory);
|
|
18
29
|
export const useUpdateDashboardShallow = ComposableFactory.update(DashboardShallowServiceFactory);
|
|
19
|
-
export const useRemoveDashboardShallow = ComposableFactory.remove(DashboardShallowServiceFactory);
|
|
30
|
+
export const useRemoveDashboardShallow = ComposableFactory.remove(DashboardShallowServiceFactory);
|
|
31
|
+
export const useDuplicateDashboardShallow = ComposableFactory.custom(DashboardShallowServiceFactoryIncomplete.duplicate);
|
|
32
|
+
export const useChangeDashboardShallowFolder = ComposableFactory.custom(DashboardShallowServiceFactoryIncomplete.changeFolder);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import type { DashboardDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
+
import { DashboardDetails } from "@dative-gpi/foundation-core-domain/models";
|
|
4
5
|
|
|
5
6
|
import { DASHBOARD_CURRENT_URL } from "../../config";
|
|
6
7
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DataCategoryDetailsDTO, DataCategoryFilters, DataCategoryInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { DataCategoryDetails, DataCategoryInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { DATA_CATEGORIES_URL, DATA_CATEGORY_URL } from "../../config/urls";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DataDefinitionDetailsDTO, DataDefinitionFilters, DataDefinitionInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { DataDefinitionDetails, DataDefinitionInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { DATA_DEFINITIONS_URL, DATA_DEFINITION_URL } from "../../config/urls";
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ref, type Ref } from "vue";
|
|
2
|
+
|
|
3
|
+
import { type UpdateUserOrganisationTableDTO, type UserOrganisationTableDetails } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
+
import { type FSDataTable } from "@dative-gpi/foundation-shared-components/models";
|
|
5
|
+
|
|
6
|
+
export const useDataTables = () => {
|
|
7
|
+
const initialized = ref(false);
|
|
8
|
+
|
|
9
|
+
const table = ref<FSDataTable>({
|
|
10
|
+
headers: [],
|
|
11
|
+
mode: "table",
|
|
12
|
+
sortBy: null,
|
|
13
|
+
rowsPerPage: 10,
|
|
14
|
+
filters: {},
|
|
15
|
+
page: 1
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const computeTable = ((customSorts: { [key: string]: any }, customSortRaws: { [key: string]: any }) => ({
|
|
19
|
+
...table.value,
|
|
20
|
+
headers: table.value.headers.map(header => ({
|
|
21
|
+
...header,
|
|
22
|
+
sort: header.value && customSorts[header.value] || null,
|
|
23
|
+
sortRaw: header.value && customSortRaws[header.value] || null
|
|
24
|
+
}))
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
const updateTable = (
|
|
28
|
+
updateUserOrganisationTable: (id: string, payload: UpdateUserOrganisationTableDTO) => Promise<Ref<UserOrganisationTableDetails>>,
|
|
29
|
+
setTable: (tableCode: string, value: FSDataTable) => void,
|
|
30
|
+
tableCode: string
|
|
31
|
+
): void => {
|
|
32
|
+
if (table.value) {
|
|
33
|
+
setTable(tableCode, table.value);
|
|
34
|
+
updateUserOrganisationTable(tableCode, {
|
|
35
|
+
columns: table.value.headers.map(column => ({
|
|
36
|
+
columnId: column.columnId,
|
|
37
|
+
hidden: column.hidden,
|
|
38
|
+
index: column.index
|
|
39
|
+
})),
|
|
40
|
+
rowsPerPage: table.value.rowsPerPage,
|
|
41
|
+
sortByKey: table.value.sortBy?.key ?? null,
|
|
42
|
+
sortByOrder: table.value.sortBy?.order ?? null,
|
|
43
|
+
mode: table.value.mode
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const onTableCodeChange = async (
|
|
49
|
+
getUserOrganisationTable: (id: string) => Promise<Ref<UserOrganisationTableDetails | null>>,
|
|
50
|
+
getTable: (tableCode: string) => FSDataTable | null,
|
|
51
|
+
tableCode: string
|
|
52
|
+
): Promise<void> => {
|
|
53
|
+
if (tableCode) {
|
|
54
|
+
const composableTable = getTable(tableCode);
|
|
55
|
+
if (composableTable) {
|
|
56
|
+
table.value = composableTable;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
try {
|
|
60
|
+
const userOrganisationTable = await getUserOrganisationTable(tableCode);
|
|
61
|
+
if (userOrganisationTable.value) {
|
|
62
|
+
table.value = {
|
|
63
|
+
headers: userOrganisationTable.value.columns,
|
|
64
|
+
sortBy: {
|
|
65
|
+
key: userOrganisationTable.value.sortByKey,
|
|
66
|
+
order: userOrganisationTable.value.sortByOrder
|
|
67
|
+
},
|
|
68
|
+
mode: userOrganisationTable.value.mode,
|
|
69
|
+
rowsPerPage: userOrganisationTable.value.rowsPerPage,
|
|
70
|
+
filters: {},
|
|
71
|
+
page: 1
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// Do nothing
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
initialized.value = true;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
initialized,
|
|
85
|
+
table,
|
|
86
|
+
onTableCodeChange,
|
|
87
|
+
computeTable,
|
|
88
|
+
updateTable
|
|
89
|
+
};
|
|
90
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
-
import {
|
|
2
|
+
import type { DeviceConnectivityDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { DeviceConnectivityDetails } from "@dative-gpi/foundation-core-domain/models";
|
|
3
4
|
import { HubFactory } from "@dative-gpi/foundation-shared-services/tools/hubFactory";
|
|
4
5
|
|
|
5
6
|
import { DEVICE_CONNECTIVITIES_HUB_URL, DEVICE_CONNECTIVITY_URL } from "../../config/urls";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Ref } from "vue";
|
|
1
|
+
import type { Ref } from "vue";
|
|
2
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
|
-
import { ChangeDeviceOrganisationGroupDTO, ChangeDeviceOrganisationLocationDTO, CreateDeviceOrganisationDTO,
|
|
3
|
+
import type { ChangeDeviceOrganisationGroupDTO, ChangeDeviceOrganisationLocationDTO, CreateDeviceOrganisationDTO, DeviceOrganisationDetailsDTO, DeviceOrganisationFilters, DeviceOrganisationInfosDTO, UpdateDeviceOrganisationDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
+
import { DeviceOrganisationDetails, DeviceOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
4
5
|
|
|
5
6
|
import { DEVICE_ORGANISATIONS_URL, DEVICE_ORGANISATION_URL, DEVICE_ORGANISATION_GROUP_URL, DEVICE_ORGANISATION_LOCATION_URL } from "../../config/urls";
|
|
6
7
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
-
import {
|
|
2
|
+
import type { DeviceStatusDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { DeviceStatusDetails } from "@dative-gpi/foundation-core-domain/models";
|
|
3
4
|
import { HubFactory } from "@dative-gpi/foundation-shared-services/tools/hubFactory";
|
|
4
5
|
|
|
5
6
|
import { DEVICE_STATUSES_HUB_URL, DEVICE_STATUS_URL } from "../../config/urls";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
-
import { CreateFolderDTO,
|
|
2
|
+
import type { CreateFolderDTO, FolderDetailsDTO, FolderFilters, FolderInfosDTO, UpdateFolderDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { FolderDetails, FolderInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
3
4
|
|
|
4
5
|
import { FOLDER_URL, FOLDERS_URL } from "../../config";
|
|
5
6
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ChangeGroupParentDTO, CreateGroupDTO,
|
|
1
|
+
import type { ChangeGroupParentDTO, CreateGroupDTO, GroupDetailsDTO, GroupFilters, GroupInfosDTO, UpdateGroupDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { GroupDetails, GroupInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { GROUPS_URL, GROUP_URL } from "../../config/urls";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateLocationDTO, LocationDetails, LocationDetailsDTO, LocationFilters, LocationInfos, LocationInfosDTO, UpdateLocationDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { type CreateLocationDTO, LocationDetails, type LocationDetailsDTO, type LocationFilters, LocationInfos, type LocationInfosDTO, type UpdateLocationDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
3
|
|
|
4
4
|
import { LOCATIONS_URL, LOCATION_URL } from "../../config/urls";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ManufacturerDetailsDTO, ManufacturerFilters, ManufacturerInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { ManufacturerDetails, ManufacturerInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { MANUFACTURERS_URL, MANUFACTURER_URL } from "../../config/urls";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelDetails, ModelDetailsDTO, ModelFilters, ModelInfos, ModelInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
1
|
+
import { ModelDetails, type ModelDetailsDTO, type ModelFilters, ModelInfos, type ModelInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
3
|
|
|
4
4
|
import { MODELS_URL, MODEL_URL } from "../../config/urls";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { NotificationDetails, type NotificationDetailsDTO, NotificationInfos, type NotificationInfosDTO, type NotificationFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { HubFactory } from "@dative-gpi/foundation-shared-services/tools/hubFactory";
|
|
3
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
|
+
|
|
5
|
+
import { NOTIFICATIONS_HUB_URL, NOTIFICATIONS_URL, NOTIFICATION_URL } from "../../config";
|
|
6
|
+
import { HUBS } from "../../config/literals";
|
|
7
|
+
|
|
8
|
+
const NotificationServiceFactory = new ServiceFactory<NotificationDetailsDTO, NotificationDetails>("notifications", NotificationDetails).create(factory => factory.build(
|
|
9
|
+
factory.addGet(NOTIFICATION_URL),
|
|
10
|
+
factory.addGetMany<NotificationInfosDTO, NotificationInfos, NotificationFilters>(NOTIFICATIONS_URL, NotificationInfos),
|
|
11
|
+
factory.addNotify(notifyService => ({
|
|
12
|
+
notifyCreate: (notification: NotificationDetails) => notifyService.notify("add", notification),
|
|
13
|
+
...ServiceFactory.addCustom("acknowledge", (axios, notificationId: string) => axios.patch(NOTIFICATION_URL(notificationId)), (dto: NotificationDetailsDTO) => {
|
|
14
|
+
const result = new NotificationDetails(dto);
|
|
15
|
+
notifyService.notify("update", result);
|
|
16
|
+
return result;
|
|
17
|
+
})
|
|
18
|
+
}))
|
|
19
|
+
));
|
|
20
|
+
|
|
21
|
+
const useNotificationsHub = HubFactory.create(NOTIFICATIONS_HUB_URL,
|
|
22
|
+
(connection, { hasWatchers }) => {
|
|
23
|
+
connection.on(HUBS.CREATE_NOTIFICATION, (notificationId: string) => hasWatchers()
|
|
24
|
+
? NotificationServiceFactory.get(notificationId).then(NotificationServiceFactory.notifyCreate)
|
|
25
|
+
: null);
|
|
26
|
+
},
|
|
27
|
+
async (connection) => {
|
|
28
|
+
await connection.invoke(HUBS.SUBSCRIBE);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const useWatchNotifications = HubFactory.createWatcher(useNotificationsHub);
|
|
33
|
+
|
|
34
|
+
export const useNotification = ComposableFactory.get(NotificationServiceFactory, () => {
|
|
35
|
+
const { watchOne } = useWatchNotifications();
|
|
36
|
+
return (notification) => {
|
|
37
|
+
watchOne(notification.value.id);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const useNotifications = ComposableFactory.getMany(NotificationServiceFactory, () => {
|
|
42
|
+
const { watchMany } = useWatchNotifications();
|
|
43
|
+
return () => {
|
|
44
|
+
watchMany();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const useAcknowledgeNotification = ComposableFactory.custom(NotificationServiceFactory.acknowledge);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { OrganisationTypeDetailsDTO, OrganisationTypeFilters, OrganisationTypeInfosDTO } from "@dative-gpi/foundation-shared-domain/models";
|
|
2
|
+
import { OrganisationTypeDetails, OrganisationTypeInfos } from "@dative-gpi/foundation-shared-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { ORGANISATION_TYPES_URL, ORGANISATION_TYPE_URL } from "../../config/urls";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { OrganisationDetailsDTO } from "@dative-gpi/foundation-shared-domain/models";
|
|
2
|
+
import { OrganisationDetails } from "@dative-gpi/foundation-shared-domain/models";
|
|
3
|
+
import type { ChangeOrganisationDashboardDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
4
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
5
|
|
|
5
6
|
import { ORGANISATION_DASHBOARD_URL } from "../../config/urls";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PermissionCategoryDetailsDTO, PermissionCategoryFilters, PermissionCategoryInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { PermissionCategoryDetails, PermissionCategoryInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { PERMISSION_CATEGORIES_URL } from "../../config/urls";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RoleOrganisationTypeDetailsDTO, RoleOrganisationTypeFilters, RoleOrganisationTypeInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { RoleOrganisationTypeDetails, RoleOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { ROLE_ORGANISATION_TYPES_URL, ROLE_ORGANISATION_TYPE_URL } from "../../config/urls";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CreateRoleOrganisationDTO,
|
|
1
|
+
import type { CreateRoleOrganisationDTO, RoleOrganisationDetailsDTO, RoleOrganisationFilters, RoleOrganisationInfosDTO, UpdateRoleOrganisationDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { RoleOrganisationDetails, RoleOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { ROLE_ORGANISATIONS_URL, ROLE_ORGANISATION_URL } from "../../config/urls";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
+
import type { CreateScenarioDeviceOrganisationDTO, ScenarioDeviceOrganisationDetailsDTO, ScenarioDeviceOrganisationFilters, ScenarioDeviceOrganisationInfosDTO, UpdateScenarioDeviceOrganisationDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { ScenarioDeviceOrganisationDetails, ScenarioDeviceOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
+
|
|
5
|
+
import { SCENARIO_DEVICE_ORGANISATIONS_URL, SCENARIO_DEVICE_ORGANISATION_URL } from "../../config";
|
|
6
|
+
|
|
7
|
+
const ScenarioDeviceOrganisationServiceFactory = new ServiceFactory<ScenarioDeviceOrganisationDetailsDTO, ScenarioDeviceOrganisationDetails>("scenarioDeviceOrganisation", ScenarioDeviceOrganisationDetails)
|
|
8
|
+
.createComplete<ScenarioDeviceOrganisationInfos, ScenarioDeviceOrganisationInfosDTO, CreateScenarioDeviceOrganisationDTO, UpdateScenarioDeviceOrganisationDTO, ScenarioDeviceOrganisationFilters>(SCENARIO_DEVICE_ORGANISATIONS_URL, SCENARIO_DEVICE_ORGANISATION_URL, ScenarioDeviceOrganisationInfos);
|
|
9
|
+
|
|
10
|
+
export const useScenarioDeviceOrganisation = ComposableFactory.get(ScenarioDeviceOrganisationServiceFactory);
|
|
11
|
+
export const useScenarioDeviceOrganisations = ComposableFactory.getMany(ScenarioDeviceOrganisationServiceFactory);
|
|
12
|
+
export const useCreateScenarioDeviceOrganisation = ComposableFactory.create(ScenarioDeviceOrganisationServiceFactory);
|
|
13
|
+
export const useUpdateScenarioDeviceOrganisation = ComposableFactory.update(ScenarioDeviceOrganisationServiceFactory);
|
|
14
|
+
export const useRemoveScenarioDeviceOrganisation = ComposableFactory.remove(ScenarioDeviceOrganisationServiceFactory);
|
|
15
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
+
import type { CreateScenarioOrganisationTypeDTO, ScenarioOrganisationTypeDetailsDTO, ScenarioOrganisationTypeFilters, ScenarioOrganisationTypeInfosDTO, UpdateScenarioOrganisationTypeDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { ScenarioOrganisationTypeDetails, ScenarioOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
+
import { SCENARIO_ORGANISATION_TYPE_URL, SCENARIO_ORGANISATION_TYPES_URL } from "../../config/urls/scenarioOrganisationTypes";
|
|
5
|
+
|
|
6
|
+
const ScenarioOrganisationTypeServiceFactory = new ServiceFactory<ScenarioOrganisationTypeDetailsDTO, ScenarioOrganisationTypeDetails>("scenarioOrganisationType", ScenarioOrganisationTypeDetails)
|
|
7
|
+
.create(factory => factory.build(
|
|
8
|
+
factory.addGet(SCENARIO_ORGANISATION_TYPE_URL),
|
|
9
|
+
factory.addGetMany<ScenarioOrganisationTypeInfosDTO, ScenarioOrganisationTypeInfos, ScenarioOrganisationTypeFilters>(SCENARIO_ORGANISATION_TYPES_URL, ScenarioOrganisationTypeInfos),
|
|
10
|
+
factory.addUpdate<UpdateScenarioOrganisationTypeDTO>(SCENARIO_ORGANISATION_TYPE_URL),
|
|
11
|
+
factory.addRemove(SCENARIO_ORGANISATION_TYPE_URL),
|
|
12
|
+
factory.addRemove(SCENARIO_ORGANISATION_TYPE_URL),
|
|
13
|
+
factory.addNotify(notifyService => ({
|
|
14
|
+
...ServiceFactory.addCustom("duplicate", (axios, scenarioOrganisationTypeId: string) => axios.patch(SCENARIO_ORGANISATION_TYPE_URL(scenarioOrganisationTypeId)), (dto: ScenarioOrganisationTypeDetailsDTO) => {
|
|
15
|
+
const result = new ScenarioOrganisationTypeDetails(dto);
|
|
16
|
+
notifyService.notify("update", result);
|
|
17
|
+
return result;
|
|
18
|
+
}),
|
|
19
|
+
...ServiceFactory.addCustom("publish", (axios, payload: CreateScenarioOrganisationTypeDTO) => axios.post(SCENARIO_ORGANISATION_TYPES_URL(), payload), (dto: ScenarioOrganisationTypeDetailsDTO) => {
|
|
20
|
+
const result = new ScenarioOrganisationTypeDetails(dto);
|
|
21
|
+
notifyService.notify("add", result);
|
|
22
|
+
return result;
|
|
23
|
+
})
|
|
24
|
+
}))
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
export const useScenarioOrganisationType = ComposableFactory.get(ScenarioOrganisationTypeServiceFactory);
|
|
28
|
+
export const useScenarioOrganisationTypes = ComposableFactory.getMany(ScenarioOrganisationTypeServiceFactory);
|
|
29
|
+
export const useUpdateScenarioOrganisationType = ComposableFactory.update(ScenarioOrganisationTypeServiceFactory);
|
|
30
|
+
export const useRemoveScenarioOrganisationType = ComposableFactory.remove(ScenarioOrganisationTypeServiceFactory);
|
|
31
|
+
export const useDuplicateScenarioOrganisationType = ComposableFactory.custom(ScenarioOrganisationTypeServiceFactory.duplicate);
|
|
32
|
+
export const usePublishScenarioOrganisationType = ComposableFactory.custom(ScenarioOrganisationTypeServiceFactory.publish);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
+
import type { CreateScenarioOrganisationDTO, ScenarioOrganisationDetailsDTO, ScenarioOrganisationFilters, ScenarioOrganisationInfosDTO, UpdateScenarioOrganisationDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { ScenarioOrganisationDetails, ScenarioOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
+
import { SCENARIO_ORGANISATION_URL, SCENARIO_ORGANISATIONS_URL } from "../../config/urls/scenarioOrganisations";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const ScenarioOrganisationServiceFactory = new ServiceFactory<ScenarioOrganisationDetailsDTO, ScenarioOrganisationDetails>("scenarioOrganisation", ScenarioOrganisationDetails)
|
|
8
|
+
.createComplete<ScenarioOrganisationInfos, ScenarioOrganisationInfosDTO, CreateScenarioOrganisationDTO, UpdateScenarioOrganisationDTO, ScenarioOrganisationFilters>(SCENARIO_ORGANISATIONS_URL, SCENARIO_ORGANISATION_URL, ScenarioOrganisationInfos);
|
|
9
|
+
|
|
10
|
+
const ScenarioOrganisationServiceFactoryIncomplete = new ServiceFactory<ScenarioOrganisationDetailsDTO, ScenarioOrganisationDetails>("scenarioOrganisation", ScenarioOrganisationDetails)
|
|
11
|
+
.create(factory => factory.build(
|
|
12
|
+
factory.addNotify(notifyService => ({
|
|
13
|
+
...ServiceFactory.addCustom("duplicate", (axios, scenarioOrganisationId: string) => axios.patch(SCENARIO_ORGANISATION_URL(scenarioOrganisationId)), (dto: ScenarioOrganisationDetailsDTO) => {
|
|
14
|
+
const result = new ScenarioOrganisationDetails(dto);
|
|
15
|
+
notifyService.notify("add", result);
|
|
16
|
+
return result;
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
)));
|
|
20
|
+
|
|
21
|
+
export const useScenarioOrganisation = ComposableFactory.get(ScenarioOrganisationServiceFactory);
|
|
22
|
+
export const useScenarioOrganisations = ComposableFactory.getMany(ScenarioOrganisationServiceFactory);
|
|
23
|
+
export const useCreateScenarioOrganisation = ComposableFactory.create(ScenarioOrganisationServiceFactory);
|
|
24
|
+
export const useUpdateScenarioOrganisation = ComposableFactory.update(ScenarioOrganisationServiceFactory);
|
|
25
|
+
export const useRemoveScenarioOrganisation = ComposableFactory.remove(ScenarioOrganisationServiceFactory);
|
|
26
|
+
export const useDuplicateScenarioOrganisation = ComposableFactory.custom(ScenarioOrganisationServiceFactoryIncomplete.duplicate);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ServiceAccountOrganisationAuthTokenDetailsDTO, ServiceAccountOrganisationAuthTokenFilters, CreateServiceAccountOrganisationAuthTokenDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { ServiceAccountOrganisationAuthTokenDetails } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
4
|
+
|
|
5
|
+
import { SERVICE_ACCOUNT_ORGANISATION_AUTH_TOKENS_URL, SERVICE_ACCOUNT_ORGANISATION_AUTH_TOKEN_URL } from "../../config/urls";
|
|
6
|
+
|
|
7
|
+
const ServiceAccountOrganisationAuthTokenServiceFactory = new ServiceFactory<ServiceAccountOrganisationAuthTokenDetailsDTO, ServiceAccountOrganisationAuthTokenDetails>("serviceAccountOrganisationAuthToken", ServiceAccountOrganisationAuthTokenDetails).create(factory => factory.build(
|
|
8
|
+
ServiceFactory.addCustom("getMany", (axios, serviceAccountOrganisationId: string, filters: ServiceAccountOrganisationAuthTokenFilters) => axios.get(SERVICE_ACCOUNT_ORGANISATION_AUTH_TOKENS_URL(serviceAccountOrganisationId), filters), (dtos: ServiceAccountOrganisationAuthTokenDetailsDTO[]) => dtos.map((dto: ServiceAccountOrganisationAuthTokenDetailsDTO) => new ServiceAccountOrganisationAuthTokenDetails(dto))),
|
|
9
|
+
factory.addNotify(notifyService => ({
|
|
10
|
+
...ServiceFactory.addCustom("create", (axios, serviceAccountOrganisationId: string, data: CreateServiceAccountOrganisationAuthTokenDTO) => axios.post(SERVICE_ACCOUNT_ORGANISATION_AUTH_TOKENS_URL(serviceAccountOrganisationId), data), (dto: ServiceAccountOrganisationAuthTokenDetailsDTO) => {
|
|
11
|
+
const result = new ServiceAccountOrganisationAuthTokenDetails(dto);
|
|
12
|
+
notifyService.notify("add", result);
|
|
13
|
+
}),
|
|
14
|
+
...ServiceFactory.addCustom("remove", (axios, serviceAccountOrganisationId: string, authTokenId: string) => axios.delete(SERVICE_ACCOUNT_ORGANISATION_AUTH_TOKEN_URL(serviceAccountOrganisationId, authTokenId)), () => {})
|
|
15
|
+
}))
|
|
16
|
+
));
|
|
17
|
+
|
|
18
|
+
export const useServiceAccountOrganisationAuthTokens = ComposableFactory.custom(ServiceAccountOrganisationAuthTokenServiceFactory.getMany);
|
|
19
|
+
export const useCreateServiceAccountOrganisationAuthToken = ComposableFactory.custom(ServiceAccountOrganisationAuthTokenServiceFactory.create);
|
|
20
|
+
export const useRemoveServiceAccountOrganisationAuthToken = ComposableFactory.custom(ServiceAccountOrganisationAuthTokenServiceFactory.remove);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
+
import type { CreateServiceAccountOrganisationDTO, UpdateServiceAccountOrganisationDTO, ServiceAccountOrganisationDetailsDTO, ServiceAccountOrganisationFilters, ServiceAccountOrganisationInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { ServiceAccountOrganisationDetails, ServiceAccountOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
+
|
|
5
|
+
import { SERVICE_ACCOUNT_ORGANISATIONS_URL, SERVICE_ACCOUNT_ORGANISATION_URL } from "../../config/urls";
|
|
6
|
+
|
|
7
|
+
const ServiceAccountOrganisationServiceFactory = new ServiceFactory<ServiceAccountOrganisationDetailsDTO, ServiceAccountOrganisationDetails>("serviceAccountOrganisation", ServiceAccountOrganisationDetails)
|
|
8
|
+
.createComplete<ServiceAccountOrganisationInfos, ServiceAccountOrganisationInfosDTO, CreateServiceAccountOrganisationDTO, UpdateServiceAccountOrganisationDTO, ServiceAccountOrganisationFilters>(SERVICE_ACCOUNT_ORGANISATIONS_URL, SERVICE_ACCOUNT_ORGANISATION_URL, ServiceAccountOrganisationInfos);
|
|
9
|
+
|
|
10
|
+
export const useServiceAccountOrganisation = ComposableFactory.get(ServiceAccountOrganisationServiceFactory);
|
|
11
|
+
export const useServiceAccountOrganisations = ComposableFactory.getMany(ServiceAccountOrganisationServiceFactory);
|
|
12
|
+
export const useCreateServiceAccountOrganisation = ComposableFactory.create(ServiceAccountOrganisationServiceFactory);
|
|
13
|
+
export const useUpdateServiceAccountOrganisation = ComposableFactory.update(ServiceAccountOrganisationServiceFactory);
|
|
14
|
+
export const useRemoveServiceAccountOrganisation = ComposableFactory.remove(ServiceAccountOrganisationServiceFactory);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { UserOrganisationTableDetailsDTO, UpdateUserOrganisationTableDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { UserOrganisationTableDetails } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { USER_ORGANISATION_TABLE_URL } from "../../config/urls";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Ref } from "vue";
|
|
1
|
+
import type { Ref } from "vue";
|
|
2
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
|
-
import { ChangeCurrentUserOrganisationDashboardDTO, CreateUserOrganisationDTO, UpdateUserOrganisationDTO,
|
|
3
|
+
import type { ChangeCurrentUserOrganisationDashboardDTO, CreateUserOrganisationDTO, UpdateUserOrganisationDTO, UserOrganisationDetailsDTO, UserOrganisationFilters, UserOrganisationInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
+
import { UserOrganisationDetails, UserOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
4
5
|
|
|
5
6
|
import { USER_ORGANISATIONS_URL, USER_ORGANISATION_CURRENT_DASHBOARD_URL, USER_ORGANISATION_CURRENT_URL, USER_ORGANISATION_URL } from "../../config/urls";
|
|
6
7
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { WidgetTemplateFilters,
|
|
1
|
+
import type { WidgetTemplateFilters, WidgetTemplateInfosDTO, WidgetTemplateDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { WidgetTemplateInfos, WidgetTemplateDetails } from "@dative-gpi/foundation-core-domain/models";
|
|
2
3
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
4
|
|
|
4
5
|
import { WIDGET_TEMPLATES_URL, WIDGET_TEMPLATE_URL } from "../../config/urls";
|
package/config/literals/hubs.ts
CHANGED
|
@@ -11,4 +11,6 @@ export const REMOVE_ALERT = "RemoveAlert";
|
|
|
11
11
|
|
|
12
12
|
export const CREATE_CONNECTIVITY_ALERT = "CreateConnectivityAlert";
|
|
13
13
|
export const UPDATE_CONNECTIVITY_ALERT = "UpdateConnectivityAlert";
|
|
14
|
-
export const REMOVE_CONNECTIVITY_ALERT = "RemoveConnectivityAlert";
|
|
14
|
+
export const REMOVE_CONNECTIVITY_ALERT = "RemoveConnectivityAlert";
|
|
15
|
+
|
|
16
|
+
export const CREATE_NOTIFICATION = "CreateNotification";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CORE_URL } from "./base";
|
|
2
|
+
|
|
3
|
+
export const CONNECTIVITY_SCENARIOS_URL = () => `${CORE_URL()}/connectivity-scenarios`;
|
|
4
|
+
export const CONNECTIVITY_SCENARIO_URL = (connectivityScenarioId: string) => `${CONNECTIVITY_SCENARIOS_URL()}/${encodeURIComponent(connectivityScenarioId)}`;
|
package/config/urls/index.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export * from "./actions";
|
|
2
2
|
export * from "./alerts";
|
|
3
3
|
export * from "./articles";
|
|
4
|
-
export * from "./authTokens";
|
|
5
4
|
export * from "./charts";
|
|
5
|
+
export * from "./chartCategories";
|
|
6
6
|
export * from "./chartOrganisations";
|
|
7
7
|
export * from "./chartOrganisationTypes";
|
|
8
8
|
export * from "./comments";
|
|
9
9
|
export * from "./connectivityAlerts";
|
|
10
|
+
export * from "./connectivityScenarios";
|
|
10
11
|
export * from "./customProperties";
|
|
11
12
|
export * from "./customPropertyValues";
|
|
12
13
|
export * from "./dashboardOrganisations";
|
|
@@ -22,13 +23,18 @@ export * from "./groups";
|
|
|
22
23
|
export * from "./locations";
|
|
23
24
|
export * from "./manufacturers";
|
|
24
25
|
export * from "./models";
|
|
26
|
+
export * from "./notifications";
|
|
25
27
|
export * from "./organisations";
|
|
26
28
|
export * from "./organisationTypes";
|
|
27
29
|
export * from "./permissionCategories";
|
|
28
30
|
export * from "./permissions";
|
|
29
31
|
export * from "./roleOrganisations";
|
|
30
32
|
export * from "./roleOrganisationTypes";
|
|
31
|
-
export * from "./
|
|
33
|
+
export * from "./scenarioDeviceOrganisations";
|
|
34
|
+
export * from "./scenarioOrganisations";
|
|
35
|
+
export * from "./scenarioOrganisationTypes";
|
|
36
|
+
export * from "./serviceAccountOrganisationAuthTokens";
|
|
37
|
+
export * from "./serviceAccountOrganisations";
|
|
32
38
|
export * from "./userOrganisations";
|
|
33
39
|
export * from "./userOrganisationTables";
|
|
34
40
|
export * from "./widgetTemplates";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CORE_URL, HUBS_URL } from "./base";
|
|
2
|
+
|
|
3
|
+
export const NOTIFICATIONS_URL = () => `${CORE_URL()}/notifications`;
|
|
4
|
+
export const NOTIFICATION_URL = (notificationId: string) => `${CORE_URL()}/notifications/${notificationId}`;
|
|
5
|
+
|
|
6
|
+
export const NOTIFICATIONS_HUB_URL = () => `${HUBS_URL()}/notifications`;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CORE_URL } from "./base";
|
|
2
|
+
|
|
3
|
+
export const SCENARIO_DEVICE_ORGANISATIONS_URL = () => `${CORE_URL()}/scenario-device-organisations`;
|
|
4
|
+
export const SCENARIO_DEVICE_ORGANISATION_URL = (scenarioDeviceOrganisation : string) => `${SCENARIO_DEVICE_ORGANISATIONS_URL()}/${encodeURIComponent(scenarioDeviceOrganisation)}`;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CORE_URL } from "./base";
|
|
2
|
+
|
|
3
|
+
export const SCENARIO_ORGANISATION_TYPES_URL = () => `${CORE_URL()}/scenario-organisation-types`;
|
|
4
|
+
export const SCENARIO_ORGANISATION_TYPE_URL = (scenarioOrganisationTypeId: string) => `${SCENARIO_ORGANISATION_TYPES_URL()}/${encodeURIComponent(scenarioOrganisationTypeId)}`;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CORE_URL } from "./base";
|
|
2
|
+
|
|
3
|
+
export const SCENARIO_ORGANISATIONS_URL = () => `${CORE_URL()}/scenario-organisations`;
|
|
4
|
+
export const SCENARIO_ORGANISATION_URL = (scenarioOrganisationId: string) => `${SCENARIO_ORGANISATIONS_URL()}/${encodeURIComponent(scenarioOrganisationId)}`;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SERVICE_ACCOUNT_ORGANISATION_URL } from "./serviceAccountOrganisations";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const SERVICE_ACCOUNT_ORGANISATION_AUTH_TOKENS_URL = (serviceAccountOrganisationId: string) => `${SERVICE_ACCOUNT_ORGANISATION_URL(serviceAccountOrganisationId)}/pats`;
|
|
5
|
+
export const SERVICE_ACCOUNT_ORGANISATION_AUTH_TOKEN_URL = (serviceAccountOrganisationId: string, authTokenId: string) => `${SERVICE_ACCOUNT_ORGANISATION_AUTH_TOKENS_URL(serviceAccountOrganisationId)}/${encodeURIComponent(authTokenId)}`;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CORE_URL } from "./base";
|
|
2
|
+
|
|
3
|
+
export const SERVICE_ACCOUNT_ORGANISATIONS_URL = () => `${CORE_URL()}/service-account-organisations`;
|
|
4
|
+
export const SERVICE_ACCOUNT_ORGANISATION_URL = (serviceAccountOrganisationId: string) => `${SERVICE_ACCOUNT_ORGANISATIONS_URL()}/${encodeURIComponent(serviceAccountOrganisationId)}`;
|
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.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/
|
|
14
|
-
|
|
13
|
+
"@dative-gpi/foundation-core-domain": "1.0.0"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@dative-gpi/bones-ui": "^0.0.75",
|
|
15
17
|
"@microsoft/signalr": "^8.0.0",
|
|
16
|
-
"vue": "^3.4.
|
|
17
|
-
"vue-router": "^4.
|
|
18
|
+
"vue": "^3.4.29",
|
|
19
|
+
"vue-router": "^4.3.0"
|
|
18
20
|
},
|
|
19
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "93365f65d39d6c9cc3821ffb48cba187200deaf9"
|
|
20
22
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AuthTokenDetails, AuthTokenDetailsDTO, AuthTokenFilters, AuthTokenInfos, AuthTokenInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
-
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
|
-
|
|
4
|
-
import { AUTH_TOKENS_URL, AUTH_TOKEN_URL } from "../../config/urls";
|
|
5
|
-
|
|
6
|
-
const AuthTokenServiceFactory = new ServiceFactory<AuthTokenDetailsDTO, AuthTokenDetails>("authToken", AuthTokenDetails).create(factory => factory.build(
|
|
7
|
-
factory.addGetMany<AuthTokenInfosDTO, AuthTokenInfos, AuthTokenFilters>(AUTH_TOKENS_URL, AuthTokenInfos),
|
|
8
|
-
factory.addRemove(AUTH_TOKEN_URL),
|
|
9
|
-
factory.addNotify()
|
|
10
|
-
));
|
|
11
|
-
|
|
12
|
-
export const useAuthTokens = ComposableFactory.getMany(AuthTokenServiceFactory);
|
|
13
|
-
export const useRemoveAuthToken = ComposableFactory.remove(AuthTokenServiceFactory);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
2
|
-
import { CreateServiceAccountDTO, UpdateServiceAccountDTO, ServiceAccountDetails, ServiceAccountDetailsDTO, ServiceAccountFilters, ServiceAccountInfos, ServiceAccountInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
-
|
|
4
|
-
import { SERVICE_ACCOUNTS_URL, SERVICE_ACCOUNT_URL } from "../../config/urls";
|
|
5
|
-
|
|
6
|
-
const ServiceAccountServiceFactory = new ServiceFactory<ServiceAccountDetailsDTO, ServiceAccountDetails>("serviceAccount", ServiceAccountDetails)
|
|
7
|
-
.createComplete<ServiceAccountInfos, ServiceAccountInfosDTO, CreateServiceAccountDTO, UpdateServiceAccountDTO, ServiceAccountFilters>(SERVICE_ACCOUNTS_URL, SERVICE_ACCOUNT_URL, ServiceAccountInfos);
|
|
8
|
-
|
|
9
|
-
export const useServiceAccount = ComposableFactory.get(ServiceAccountServiceFactory);
|
|
10
|
-
export const useServiceAccounts = ComposableFactory.getMany(ServiceAccountServiceFactory);
|
|
11
|
-
export const useCreateServiceAccount = ComposableFactory.create(ServiceAccountServiceFactory);
|
|
12
|
-
export const useUpdateServiceAccount = ComposableFactory.update(ServiceAccountServiceFactory);
|
|
13
|
-
export const useRemoveServiceAccount = ComposableFactory.remove(ServiceAccountServiceFactory);
|