@dative-gpi/foundation-shared-services 0.0.13 → 0.0.15

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.
@@ -1,13 +1,7 @@
1
1
  export * from "./useApplications";
2
2
  export * from "./useAuthTokens";
3
- export * from "./useFrequentlyAskedQuestions";
4
3
  export * from "./useImages";
5
- export * from "./useLandingPages";
6
- export * from "./useLayoutPages";
7
- export * from "./useLegalInformations";
8
4
  export * from "./useOrganisations";
9
- export * from "./useSecuritySettings";
10
5
  export * from "./useTimeZones";
11
6
  export * from "./useTranslations";
12
- export * from "./useUserLegalInformations";
13
7
  export * from "./useUsers";
@@ -1,15 +1,8 @@
1
- export * from "./accounts";
2
1
  export * from "./applications";
3
2
  export * from "./authTokens";
4
3
  export * from "./files";
5
- export * from "./frequentlyAskedQuestions";
6
4
  export * from "./images";
7
- export * from "./landingPages";
8
- export * from "./layoutPages";
9
- export * from "./legalInformations";
10
5
  export * from "./organisations";
11
- export * from "./securitySettings";
12
6
  export * from "./timeZones";
13
7
  export * from "./translations";
14
- export * from "./userLegalInformations";
15
8
  export * from "./users";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-services",
3
3
  "sideEffects": false,
4
- "version": "0.0.13",
4
+ "version": "0.0.15",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -11,11 +11,11 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "@dative-gpi/bones-ui": "^0.0.61",
14
- "@dative-gpi/foundation-shared-domain": "0.0.13",
14
+ "@dative-gpi/foundation-shared-domain": "0.0.15",
15
15
  "@microsoft/signalr": "^8.0.0",
16
16
  "date-fns": "^3.2.0",
17
17
  "vue": "^3.2.0",
18
18
  "vue-router": "^4.2.5"
19
19
  },
20
- "gitHead": "c99a5f4be0427449b3b00ef6d467528bae8b1ada"
20
+ "gitHead": "f6e18a1e01b07e70a7a79301ed29bc397dc10749"
21
21
  }
@@ -1,11 +0,0 @@
1
- import { FrequentlyAskedQuestionDetails, FrequentlyAskedQuestionDetailsDTO, FrequentlyAskedQuestionFilters, FrequentlyAskedQuestionInfos, FrequentlyAskedQuestionInfosDTO } from "@dative-gpi/foundation-shared-domain/models";
2
- import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
3
-
4
- import { FREQUENTLY_ASKED_QUESTIONS_URL } from "../../config/urls";
5
-
6
- const FrequentlyAskedQuestionServiceFactory = new ServiceFactory<FrequentlyAskedQuestionDetailsDTO, FrequentlyAskedQuestionDetails>("frequentlyAskedQuestions", FrequentlyAskedQuestionDetails).create(factory => factory.build(
7
- factory.addGetMany<FrequentlyAskedQuestionInfosDTO, FrequentlyAskedQuestionInfos, FrequentlyAskedQuestionFilters>(FREQUENTLY_ASKED_QUESTIONS_URL, FrequentlyAskedQuestionInfos),
8
- factory.addNotify()
9
- ));
10
-
11
- export const useFrequentlyAskedQuestions = ComposableFactory.getMany(FrequentlyAskedQuestionServiceFactory);
@@ -1,50 +0,0 @@
1
- import { onUnmounted, ref } from "vue";
2
-
3
- import { LandingPageDetails, LandingPageDetailsDTO } from "@dative-gpi/foundation-shared-domain/models";
4
- import { onEntityChanged, ServiceFactory } from "@dative-gpi/bones-ui";
5
-
6
- import { LANDING_PAGE_CURRENT_URL } from "../../config/urls";
7
-
8
- const LandingPageServiceFactory = new ServiceFactory<LandingPageDetailsDTO, LandingPageDetails>("landingPage", LandingPageDetails).create(factory => factory.build(
9
- factory.addNotify((notifyService) => ({
10
- getCurrent: async (): Promise<LandingPageDetails> => {
11
- const response = await ServiceFactory.http.get(LANDING_PAGE_CURRENT_URL());
12
- const result = new LandingPageDetails(response.data);
13
-
14
- notifyService.notify("update", result);
15
-
16
- return result;
17
- }
18
- }))
19
- ));
20
-
21
- export const useCurrentLandingPage = () => {
22
- const service = LandingPageServiceFactory();
23
- const subscribersIds: number[] = [];
24
-
25
- const getting = ref(false);
26
- const entity = ref<LandingPageDetails | null>(null);
27
-
28
- onUnmounted(() => {
29
- subscribersIds.forEach(id => service.unsubscribe(id));
30
- subscribersIds.length = 0;
31
- });
32
-
33
- const get = async () => {
34
- getting.value = true;
35
- try {
36
- entity.value = await service.getCurrent();
37
- }
38
- finally {
39
- getting.value = false;
40
- }
41
- subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
42
- return entity;
43
- }
44
-
45
- return {
46
- getting,
47
- get,
48
- entity
49
- }
50
- }
@@ -1,50 +0,0 @@
1
- import { onUnmounted, ref } from "vue";
2
-
3
- import { LayoutPageDetails, LayoutPageDetailsDTO } from "@dative-gpi/foundation-shared-domain/models";
4
- import { onEntityChanged, ServiceFactory } from "@dative-gpi/bones-ui";
5
-
6
- import { LAYOUT_PAGE_CURRENT_URL } from "../../config/urls";
7
-
8
- const LayoutPageServiceFactory = new ServiceFactory<LayoutPageDetailsDTO, LayoutPageDetails>("layoutPage", LayoutPageDetails).create(factory => factory.build(
9
- factory.addNotify((notifyService) => ({
10
- getCurrent: async (): Promise<LayoutPageDetails> => {
11
- const response = await ServiceFactory.http.get(LAYOUT_PAGE_CURRENT_URL());
12
- const result = new LayoutPageDetails(response.data);
13
-
14
- notifyService.notify("update", result);
15
-
16
- return result;
17
- }
18
- }))
19
- ));
20
-
21
- export const useCurrentLayoutPage = () => {
22
- const service = LayoutPageServiceFactory();
23
- const subscribersIds: number[] = [];
24
-
25
- const getting = ref(false);
26
- const entity = ref<LayoutPageDetails | null>(null);
27
-
28
- onUnmounted(() => {
29
- subscribersIds.forEach(id => service.unsubscribe(id));
30
- subscribersIds.length = 0;
31
- });
32
-
33
- const get = async () => {
34
- getting.value = true;
35
- try {
36
- entity.value = await service.getCurrent();
37
- }
38
- finally {
39
- getting.value = false;
40
- }
41
- subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
42
- return entity;
43
- }
44
-
45
- return {
46
- getting,
47
- get,
48
- entity
49
- }
50
- }
@@ -1,50 +0,0 @@
1
- import { onUnmounted, ref } from "vue";
2
-
3
- import { LegalInformationDetails, LegalInformationDetailsDTO } from "@dative-gpi/foundation-shared-domain/models";
4
- import { onEntityChanged, ServiceFactory } from "@dative-gpi/bones-ui";
5
-
6
- import { LEGAL_INFORMATION_CURRENT_URL } from "../../config/urls";
7
-
8
- const LegalInformationServiceFactory = new ServiceFactory<LegalInformationDetailsDTO, LegalInformationDetails>("legalInformation", LegalInformationDetails).create(factory => factory.build(
9
- factory.addNotify((notifyService) => ({
10
- getCurrent: async (): Promise<LegalInformationDetails> => {
11
- const response = await ServiceFactory.http.get(LEGAL_INFORMATION_CURRENT_URL());
12
- const result = new LegalInformationDetails(response.data);
13
-
14
- notifyService.notify("update", result);
15
-
16
- return result;
17
- }
18
- }))
19
- ));
20
-
21
- export const useCurrentLegalInformation = () => {
22
- const service = LegalInformationServiceFactory();
23
- const subscribersIds: number[] = [];
24
-
25
- const getting = ref(false);
26
- const entity = ref<LegalInformationDetails | null>(null);
27
-
28
- onUnmounted(() => {
29
- subscribersIds.forEach(id => service.unsubscribe(id));
30
- subscribersIds.length = 0;
31
- });
32
-
33
- const get = async () => {
34
- getting.value = true;
35
- try {
36
- entity.value = await service.getCurrent();
37
- }
38
- finally {
39
- getting.value = false;
40
- }
41
- subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
42
- return entity;
43
- }
44
-
45
- return {
46
- getting,
47
- get,
48
- entity
49
- }
50
- }
@@ -1,50 +0,0 @@
1
- import { onUnmounted, ref } from "vue";
2
-
3
- import { SecuritySettingDetails, SecuritySettingDetailsDTO } from "@dative-gpi/foundation-shared-domain/models";
4
- import { onEntityChanged, ServiceFactory } from "@dative-gpi/bones-ui";
5
-
6
- import { SECURITY_SETTING_CURRENT_URL } from "../../config/urls";
7
-
8
- const SecuritySettingServiceFactory = new ServiceFactory<SecuritySettingDetailsDTO, SecuritySettingDetails>("securitySetting", SecuritySettingDetails).create(factory => factory.build(
9
- factory.addNotify((notifyService) => ({
10
- getCurrent: async (): Promise<SecuritySettingDetails> => {
11
- const response = await ServiceFactory.http.get(SECURITY_SETTING_CURRENT_URL());
12
- const result = new SecuritySettingDetails(response.data);
13
-
14
- notifyService.notify("update", result);
15
-
16
- return result;
17
- }
18
- }))
19
- ));
20
-
21
- export const useCurrentSecuritySettings = () => {
22
- const service = SecuritySettingServiceFactory();
23
- const subscribersIds: number[] = [];
24
-
25
- const getting = ref(false);
26
- const entity = ref<SecuritySettingDetails | null>(null);
27
-
28
- onUnmounted(() => {
29
- subscribersIds.forEach(id => service.unsubscribe(id));
30
- subscribersIds.length = 0;
31
- });
32
-
33
- const get = async () => {
34
- getting.value = true;
35
- try {
36
- entity.value = await service.getCurrent();
37
- }
38
- finally {
39
- getting.value = false;
40
- }
41
- subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
42
- return entity;
43
- }
44
-
45
- return {
46
- getting,
47
- get,
48
- entity
49
- }
50
- }
@@ -1,52 +0,0 @@
1
- import { onUnmounted, ref } from "vue";
2
-
3
- import { CreateUserLegalInformationDTO, UserLegalInformationDetails, UserLegalInformationDetailsDTO } from "@dative-gpi/foundation-shared-domain/models";
4
- import { ComposableFactory, onEntityChanged, ServiceFactory } from "@dative-gpi/bones-ui";
5
-
6
- import { USER_LEGAL_INFORMATIONS_URL, USER_LEGAL_INFORMATION_CURRENT_URL } from "../../config/urls";
7
-
8
- const UserLegalInformationServiceFactory = new ServiceFactory<UserLegalInformationDetailsDTO, UserLegalInformationDetails>("userLegalInformation", UserLegalInformationDetails).create(factory => factory.build(
9
- factory.addCreate<CreateUserLegalInformationDTO>(USER_LEGAL_INFORMATIONS_URL),
10
- factory.addNotify((notifyService) => ({
11
- getCurrent: async (): Promise<UserLegalInformationDetails> => {
12
- const response = await ServiceFactory.http.get(USER_LEGAL_INFORMATION_CURRENT_URL());
13
- const result = new UserLegalInformationDetails(response.data);
14
-
15
- notifyService.notify("update", result);
16
-
17
- return result;
18
- }
19
- }))
20
- ));
21
-
22
- export const useCreateUserLegalInformation = ComposableFactory.create(UserLegalInformationServiceFactory);
23
- export const useCurrentUserLegalInformation = () => {
24
- const service = UserLegalInformationServiceFactory();
25
- const subscribersIds: number[] = [];
26
-
27
- const getting = ref(false);
28
- const entity = ref<UserLegalInformationDetails | null>(null);
29
-
30
- onUnmounted(() => {
31
- subscribersIds.forEach(id => service.unsubscribe(id));
32
- subscribersIds.length = 0;
33
- });
34
-
35
- const get = async () => {
36
- getting.value = true;
37
- try {
38
- entity.value = await service.getCurrent();
39
- }
40
- finally {
41
- getting.value = false;
42
- }
43
- subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
44
- return entity;
45
- }
46
-
47
- return {
48
- getting,
49
- get,
50
- entity
51
- }
52
- }
@@ -1,15 +0,0 @@
1
- import { GATEWAY_URL } from "./base";
2
-
3
- export const LOCAL_ACCOUNT_URL = () => `${GATEWAY_URL}/local-accounts`
4
-
5
- export const INVITATION_URL = (token: string) => `${LOCAL_ACCOUNT_URL}/invitations/${encodeURIComponent(token)}`;
6
- export const VALIDATION_URL = () => `${LOCAL_ACCOUNT_URL}/validations`;
7
-
8
- export const LOGIN_LOCAL_ACCOUNT_URL = () => `${LOCAL_ACCOUNT_URL}/login`;
9
- export const LOCAL_ACCOUNT_PASSWORD_URL = () => `${LOCAL_ACCOUNT_URL}/password`;
10
-
11
- export const LOGIN_EXTERNAL_URL = () => `${GATEWAY_URL}/external-accounts/login`;
12
- export const SIGNUP_EXTERNAL_URL = () => `${GATEWAY_URL}/external-accounts`;
13
-
14
- export const LOGOUT_URL = () => `${GATEWAY_URL}/accounts/logout`;
15
- export const GLOBAL_LOGOUT_URL = () => `${GATEWAY_URL}/accounts/global-logout`;
@@ -1,3 +0,0 @@
1
- import { GATEWAY_URL } from "./base";
2
-
3
- export const FREQUENTLY_ASKED_QUESTIONS_URL = () => `${GATEWAY_URL()}/frequently-asked-questions`;
@@ -1,4 +0,0 @@
1
- import { GATEWAY_URL } from "./base";
2
-
3
- export const LANDING_PAGES_URL = () => `${GATEWAY_URL()}/landing-pages`;
4
- export const LANDING_PAGE_CURRENT_URL = () => `${LANDING_PAGES_URL()}/current`;
@@ -1,4 +0,0 @@
1
- import { GATEWAY_URL } from "./base";
2
-
3
- export const LAYOUT_PAGES_URL = () => `${GATEWAY_URL()}/layout-pages`;
4
- export const LAYOUT_PAGE_CURRENT_URL = () => `${LAYOUT_PAGES_URL()}/current`;
@@ -1,4 +0,0 @@
1
- import { GATEWAY_URL } from "./base";
2
-
3
- export const LEGAL_INFORMATIONS_URL = () => `${GATEWAY_URL()}/legal-informations`;
4
- export const LEGAL_INFORMATION_CURRENT_URL = () => `${LEGAL_INFORMATIONS_URL()}/current`;
@@ -1,4 +0,0 @@
1
- import { GATEWAY_URL } from "./base";
2
-
3
- export const SECURITY_SETTINGS_URL = () => `${GATEWAY_URL()}/security-settings`;
4
- export const SECURITY_SETTING_CURRENT_URL = () => `${SECURITY_SETTINGS_URL()}/current`;
@@ -1,4 +0,0 @@
1
- import { GATEWAY_URL } from "./base";
2
-
3
- export const USER_LEGAL_INFORMATIONS_URL = () => `${GATEWAY_URL()}/user-legal-informations`;
4
- export const USER_LEGAL_INFORMATION_CURRENT_URL = () => `${USER_LEGAL_INFORMATIONS_URL()}/current`;