@dative-gpi/foundation-core-services 0.0.87 → 0.0.88
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 +3 -0
- package/composables/services/useChartOrganisationTypes.ts +26 -0
- package/composables/services/useChartOrganisations.ts +26 -0
- package/composables/services/useCharts.ts +11 -0
- package/composables/services/useUserOrganisations.ts +1 -1
- package/config/urls/chartOrganisationTypes.ts +4 -0
- package/config/urls/chartOrganisations.ts +4 -0
- package/config/urls/charts.ts +4 -0
- package/config/urls/index.ts +3 -0
- package/package.json +3 -3
|
@@ -2,6 +2,9 @@ export * from "./useActions";
|
|
|
2
2
|
export * from "./useAlerts";
|
|
3
3
|
export * from "./useArticles";
|
|
4
4
|
export * from "./useAuthTokens";
|
|
5
|
+
export * from "./useChartOrganisationTypes";
|
|
6
|
+
export * from "./useChartOrganisations";
|
|
7
|
+
export * from "./useCharts";
|
|
5
8
|
export * from "./useComments";
|
|
6
9
|
export * from "./useConnectivityAlerts";
|
|
7
10
|
export * from "./useCustomProperties";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
|
|
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
|
+
|
|
5
|
+
|
|
6
|
+
const ChartOrganisationTypeServiceFactory = new ServiceFactory<ChartOrganisationTypeDetailsDTO, ChartOrganisationTypeDetails>("chartOrganisationType", ChartOrganisationTypeDetails)
|
|
7
|
+
.createComplete<ChartOrganisationTypeInfos, ChartOrganisationTypeInfosDTO, CreateChartOrganisationTypeDTO, UpdateChartOrganisationTypeDTO, ChartOrganisationTypeFilters>(CHART_ORGANISATION_TYPES_URL, CHART_ORGANISATION_TYPE_URL, ChartOrganisationTypeInfos);
|
|
8
|
+
|
|
9
|
+
const ChartOrganisationServiceFactoryIncomplete = new ServiceFactory("chartOrganisationType", ChartOrganisationTypeDetails)
|
|
10
|
+
.create(factory => factory.build(
|
|
11
|
+
factory.addNotify(notifyService => ({
|
|
12
|
+
...ServiceFactory.addCustom("chartOrganisationType", (axios, charOrganisationTypeId: string) => axios.patch(CHART_ORGANISATION_TYPE_URL(charOrganisationTypeId)), (dto: ChartOrganisationTypeDetailsDTO) => {
|
|
13
|
+
const result = new ChartOrganisationTypeDetails(dto);
|
|
14
|
+
notifyService.notify("update", result);
|
|
15
|
+
return result;
|
|
16
|
+
})
|
|
17
|
+
}))
|
|
18
|
+
));
|
|
19
|
+
|
|
20
|
+
export const useChartOrganisationType = ComposableFactory.get(ChartOrganisationTypeServiceFactory);
|
|
21
|
+
export const useChartOrganisationTypes = ComposableFactory.getMany(ChartOrganisationTypeServiceFactory);
|
|
22
|
+
export const useCreateChartOrganisationType = ComposableFactory.create(ChartOrganisationTypeServiceFactory);
|
|
23
|
+
export const useUpdateChartOrganisationType = ComposableFactory.update(ChartOrganisationTypeServiceFactory);
|
|
24
|
+
export const useRemoveChartOrganisationType = ComposableFactory.remove(ChartOrganisationTypeServiceFactory);
|
|
25
|
+
export const useChangeDashboardOrganisation = ComposableFactory.custom(ChartOrganisationServiceFactoryIncomplete.chartOrganisationType);
|
|
26
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
|
|
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
|
+
|
|
5
|
+
|
|
6
|
+
const ChartOrganisationServiceFactory = new ServiceFactory<ChartOrganisationDetailsDTO, ChartOrganisationDetails>("chartOrganisation", ChartOrganisationDetails)
|
|
7
|
+
.createComplete<ChartOrganisationInfos, ChartOrganisationInfosDTO, CreateChartOrganisationDTO, UpdateChartOrganisationDTO, ChartOrganisationFilters>(CHART_ORGANISATIONS_URL, CHART_ORGANISATION_URL, ChartOrganisationInfos);
|
|
8
|
+
|
|
9
|
+
const ChartOrganisationServiceFactoryIncomplete = new ServiceFactory("chartOrganisation", ChartOrganisationDetails)
|
|
10
|
+
.create(factory => factory.build(
|
|
11
|
+
factory.addNotify(notifyService => ({
|
|
12
|
+
...ServiceFactory.addCustom("chartOrganisation", (axios, chartOrganisationId: string) => axios.patch(CHART_ORGANISATION_URL(chartOrganisationId)), (dto: ChartOrganisationDetailsDTO) => {
|
|
13
|
+
const result = new ChartOrganisationDetails(dto);
|
|
14
|
+
notifyService.notify("update", result);
|
|
15
|
+
return result;
|
|
16
|
+
})
|
|
17
|
+
}))
|
|
18
|
+
));
|
|
19
|
+
|
|
20
|
+
export const useChartOrganisation = ComposableFactory.get(ChartOrganisationServiceFactory);
|
|
21
|
+
export const useChartOrganisations = ComposableFactory.getMany(ChartOrganisationServiceFactory);
|
|
22
|
+
export const useCreateChartOrganisation = ComposableFactory.create(ChartOrganisationServiceFactory);
|
|
23
|
+
export const useUpdateChartOrganisation = ComposableFactory.update(ChartOrganisationServiceFactory);
|
|
24
|
+
export const useRemoveChartOrganisation = ComposableFactory.remove(ChartOrganisationServiceFactory);
|
|
25
|
+
export const useChangeDashboardOrganisation = ComposableFactory.custom(ChartOrganisationServiceFactoryIncomplete.chartOrganisation);
|
|
26
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
|
|
3
|
+
import { CHART_URL } from "../../config/urls";
|
|
4
|
+
import { ChartDetails, ChartDetailsDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
5
|
+
|
|
6
|
+
const ChartServiceFactory = new ServiceFactory<ChartDetailsDTO, ChartDetails>("chart", ChartDetails).create(factory => factory.build(
|
|
7
|
+
factory.addGet(CHART_URL),
|
|
8
|
+
factory.addNotify()
|
|
9
|
+
));
|
|
10
|
+
|
|
11
|
+
export const useChart = ComposableFactory.get(ChartServiceFactory);
|
|
@@ -17,7 +17,7 @@ const UserOrganisationServiceFactory = new ServiceFactory<UserOrganisationDetail
|
|
|
17
17
|
notifyService.notify("update", result);
|
|
18
18
|
return result;
|
|
19
19
|
}),
|
|
20
|
-
...ServiceFactory.addCustom("changeCurrentDashboard", (axios, payload: ChangeCurrentUserOrganisationDashboardDTO) => axios.
|
|
20
|
+
...ServiceFactory.addCustom("changeCurrentDashboard", (axios, payload: ChangeCurrentUserOrganisationDashboardDTO) => axios.put(USER_ORGANISATION_CURRENT_DASHBOARD_URL(), payload), (dto: UserOrganisationDetailsDTO) => {
|
|
21
21
|
const result = new UserOrganisationDetails(dto)
|
|
22
22
|
notifyService.notify("update", result);
|
|
23
23
|
return result;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CORE_URL } from "./base";
|
|
2
|
+
|
|
3
|
+
export const CHART_ORGANISATION_TYPES_URL = () => `${CORE_URL()}/chart-organisation-types`;
|
|
4
|
+
export const CHART_ORGANISATION_TYPE_URL = (chartOrganisationrTypeId: string) => `${CHART_ORGANISATION_TYPES_URL()}/${encodeURIComponent(chartOrganisationrTypeId)}`;
|
package/config/urls/index.ts
CHANGED
|
@@ -2,6 +2,9 @@ export * from "./actions";
|
|
|
2
2
|
export * from "./alerts";
|
|
3
3
|
export * from "./articles";
|
|
4
4
|
export * from "./authTokens";
|
|
5
|
+
export * from "./charts";
|
|
6
|
+
export * from "./chartOrganisations";
|
|
7
|
+
export * from "./chartOrganisationTypes";
|
|
5
8
|
export * from "./comments";
|
|
6
9
|
export * from "./connectivityAlerts";
|
|
7
10
|
export * from "./customProperties";
|
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.88",
|
|
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.88",
|
|
15
15
|
"@microsoft/signalr": "^8.0.0",
|
|
16
16
|
"vue": "^3.4.23",
|
|
17
17
|
"vue-router": "^4.2.5"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "b45c82081a4df225154d4deabec996a607308966"
|
|
20
20
|
}
|