@dative-gpi/foundation-core-services 0.0.83 → 0.0.85

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.
@@ -25,7 +25,7 @@ export * from "./useOrganisationTypes";
25
25
  export * from "./usePermissionCategories";
26
26
  export * from "./useRoleOrganisations";
27
27
  export * from "./useRoleOrganisationTypes";
28
+ export * from "./useServiceAccounts";
28
29
  export * from "./useUserOrganisations";
29
30
  export * from "./useUserOrganisationTables";
30
- export * from "./useUsers";
31
31
  export * from "./useWidgetTemplates";
@@ -0,0 +1,13 @@
1
+ import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
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);
@@ -1,8 +1,8 @@
1
1
  import { Ref } from "vue";
2
2
  import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
3
- import { CreateUserOrganisationDTO, CreateServiceUserOrganisationDTO, UpdateUserOrganisationDTO, UserOrganisationDetails, UserOrganisationDetailsDTO, UserOrganisationFilters, UserOrganisationInfos, UserOrganisationInfosDTO } from "@dative-gpi/foundation-core-domain/models";
3
+ import { ChangeCurrentUserOrganisationDashboardDTO, CreateUserOrganisationDTO, UpdateUserOrganisationDTO, UserOrganisationDetails, UserOrganisationDetailsDTO, UserOrganisationFilters, UserOrganisationInfos, UserOrganisationInfosDTO } from "@dative-gpi/foundation-core-domain/models";
4
4
 
5
- import { USER_ORGANISATIONS_URL, USER_ORGANISATIONS_SERVICE_URL, USER_ORGANISATION_CURRENT_URL, USER_ORGANISATION_URL } from "../../config/urls";
5
+ import { USER_ORGANISATIONS_URL, USER_ORGANISATION_CURRENT_DASHBOARD_URL, USER_ORGANISATION_CURRENT_URL, USER_ORGANISATION_URL } from "../../config/urls";
6
6
 
7
7
  const UserOrganisationServiceFactory = new ServiceFactory<UserOrganisationDetailsDTO, UserOrganisationDetails>("userOrganisation", UserOrganisationDetails).create(factory => factory.build(
8
8
  factory.addGet(USER_ORGANISATION_URL),
@@ -12,16 +12,16 @@ const UserOrganisationServiceFactory = new ServiceFactory<UserOrganisationDetail
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
14
  factory.addNotify(notifyService => ({
15
- ...ServiceFactory.addCustom("createService", (axios, payload: CreateServiceUserOrganisationDTO) => axios.post(USER_ORGANISATIONS_SERVICE_URL(), payload), (dto: UserOrganisationDetailsDTO) => {
15
+ ...ServiceFactory.addCustom("updateCurrent", (axios, payload: UpdateUserOrganisationDTO) => axios.post(USER_ORGANISATION_CURRENT_URL(), payload), (dto: UserOrganisationDetailsDTO) => {
16
16
  const result = new UserOrganisationDetails(dto)
17
- notifyService.notify("add", result);
17
+ notifyService.notify("update", result);
18
18
  return result;
19
19
  }),
20
- ...ServiceFactory.addCustom("updateCurrent", (axios, payload: UpdateUserOrganisationDTO) => axios.post(USER_ORGANISATION_CURRENT_URL(), payload), (dto: UserOrganisationDetailsDTO) => {
20
+ ...ServiceFactory.addCustom("changeCurrentDashboard", (axios, payload: ChangeCurrentUserOrganisationDashboardDTO) => axios.post(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;
24
- }),
24
+ })
25
25
  }))
26
26
  ));
27
27
 
@@ -44,4 +44,4 @@ export const useRemoveUserOrganisation = ComposableFactory.remove(UserOrganisati
44
44
 
45
45
  export const useCurrentUserOrganisation = ComposableFactory.custom(UserOrganisationServiceFactory.getCurrent, trackUserOrganisation);
46
46
  export const useUpdateCurrentUserOrganisation = ComposableFactory.custom(UserOrganisationServiceFactory.updateCurrent, trackUserOrganisation);
47
- export const useCreateServiceUserOrganisation = ComposableFactory.custom(UserOrganisationServiceFactory.createService, trackUserOrganisation);
47
+ export const useChangeCurrentUserOrganisationDashboard = ComposableFactory.custom(UserOrganisationServiceFactory.changeCurrentDashboard, trackUserOrganisation);
@@ -25,7 +25,7 @@ export * from "./permissionCategories";
25
25
  export * from "./permissions";
26
26
  export * from "./roleOrganisations";
27
27
  export * from "./roleOrganisationTypes";
28
+ export * from "./serviceAccounts";
28
29
  export * from "./userOrganisations";
29
30
  export * from "./userOrganisationTables";
30
- export * from "./users";
31
31
  export * from "./widgetTemplates";
@@ -0,0 +1,4 @@
1
+ import { CORE_URL } from "./base";
2
+
3
+ export const SERVICE_ACCOUNTS_URL = () => `${CORE_URL()}/service-accounts`;
4
+ export const SERVICE_ACCOUNT_URL = (serviceAccountId: string) => `${SERVICE_ACCOUNTS_URL()}/${encodeURIComponent(serviceAccountId)}`;
@@ -1,4 +1,4 @@
1
- import { useAppOrganisationId } from "../../composables";
1
+ import { useAppOrganisationId } from "../../composables/app/useAppOrganisationId";
2
2
 
3
3
  const { organisationId } = useAppOrganisationId();
4
4
 
@@ -2,7 +2,6 @@ import { CORE_URL } from "./base";
2
2
 
3
3
  export const USER_ORGANISATIONS_URL = () => `${CORE_URL()}/user-organisations`;
4
4
  export const USER_ORGANISATION_URL = (userOrganisationId: string) => `${USER_ORGANISATIONS_URL()}/${encodeURIComponent(userOrganisationId)}`;
5
- export const USER_ORGANISATION_CURRENT_URL = () => `${USER_ORGANISATIONS_URL()}/current`;
6
5
 
7
- export const USER_ORGANISATIONS_SERVICE_URL = () => `${USER_ORGANISATIONS_URL()}/service`;
8
- export const USER_ORGANISATION_SERVICE_URL = (userOrganisationId: string) => `${USER_ORGANISATIONS_SERVICE_URL()}/${encodeURIComponent(userOrganisationId)}`;
6
+ export const USER_ORGANISATION_CURRENT_URL = () => `${USER_ORGANISATIONS_URL()}/current`;
7
+ export const USER_ORGANISATION_CURRENT_DASHBOARD_URL = () => `${USER_ORGANISATION_CURRENT_URL()}/dashboard`;
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.83",
4
+ "version": "0.0.85",
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.83",
14
+ "@dative-gpi/foundation-core-domain": "0.0.85",
15
15
  "@microsoft/signalr": "^8.0.0",
16
16
  "vue": "^3.4.23",
17
17
  "vue-router": "^4.2.5"
18
18
  },
19
- "gitHead": "97d34af7b3481be94f7fd50ca7a0a209f9eac517"
19
+ "gitHead": "9c0b770f8b54cce1cd3aa7c25c91ad1a99b08862"
20
20
  }
@@ -1,15 +0,0 @@
1
- import { UpdateUserDTO, UserDetails, UserDetailsDTO } from "@dative-gpi/foundation-shared-domain/models";
2
- import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
3
-
4
- import { USER_URL } from "../../config/urls";
5
-
6
- const UserServiceFactory = new ServiceFactory<UserDetailsDTO, UserDetails>("user", UserDetails).create(factory => factory.build(
7
- factory.addGet(USER_URL),
8
- factory.addUpdate<UpdateUserDTO>(USER_URL),
9
- factory.addRemove(USER_URL),
10
- factory.addNotify()
11
- ));
12
-
13
- export const useUser = ComposableFactory.get(UserServiceFactory);
14
- export const useUpdateUser = ComposableFactory.update(UserServiceFactory);
15
- export const useRemoveUser = ComposableFactory.remove(UserServiceFactory);
@@ -1,5 +0,0 @@
1
- import { CORE_URL } from "./base";
2
-
3
- export const USERS_URL = () => `${CORE_URL()}/users`;
4
- export const USER_URL = (userId: string) => `${USERS_URL()}/${encodeURIComponent(userId)}`;
5
- export const USER_CURRENT_URL = () => `${USERS_URL()}/current`;