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

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.
@@ -22,29 +22,29 @@ export const useCurrentApplication = () => {
22
22
  const service = ApplicationServiceFactory();
23
23
  const subscribersIds: number[] = [];
24
24
 
25
- const fetching = ref(false);
26
- const fetched = ref<ApplicationDetails | null>(null);
25
+ const getting = ref(false);
26
+ const entity = ref<ApplicationDetails | null>(null);
27
27
 
28
28
  onUnmounted(() => {
29
29
  subscribersIds.forEach(id => service.unsubscribe(id));
30
30
  subscribersIds.length = 0;
31
31
  });
32
32
 
33
- const fetch = async () => {
34
- fetching.value = true;
33
+ const get = async () => {
34
+ getting.value = true;
35
35
  try {
36
- fetched.value = await service.getCurrent();
36
+ entity.value = await service.getCurrent();
37
37
  }
38
38
  finally {
39
- fetching.value = false;
39
+ getting.value = false;
40
40
  }
41
- subscribersIds.push(service.subscribe("all", onEntityChanged(fetched)));
42
- return fetched;
41
+ subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
42
+ return entity;
43
43
  }
44
44
 
45
45
  return {
46
- fetching,
47
- fetch,
48
- fetched
46
+ getting,
47
+ get,
48
+ entity
49
49
  }
50
50
  }
@@ -24,46 +24,46 @@ const ImageServiceFactory = new ServiceFactory("image", BlurHash).create(factory
24
24
  export const useImageRaw = () => {
25
25
  const service = ImageServiceFactory();
26
26
 
27
- const fetching = ref(false);
28
- const fetched = ref<string | null>(null);
27
+ const getting = ref(false);
28
+ const entity = ref<string | null>(null);
29
29
 
30
- const fetch = async (imageId: string) => {
31
- fetching.value = true;
30
+ const get = async (imageId: string) => {
31
+ getting.value = true;
32
32
  try {
33
- fetched.value = await service.getRaw(imageId);
33
+ entity.value = await service.getRaw(imageId);
34
34
  }
35
35
  finally {
36
- fetching.value = false;
36
+ getting.value = false;
37
37
  }
38
- return fetched;
38
+ return entity;
39
39
  }
40
40
 
41
41
  return {
42
- fetching,
43
- fetch,
44
- fetched
42
+ getting,
43
+ get,
44
+ entity
45
45
  }
46
46
  }
47
47
  export const useImageBlurHash = () => {
48
48
  const service = ImageServiceFactory();
49
49
 
50
- const fetching = ref(false);
51
- const fetched = ref<BlurHash | null>(null);
50
+ const getting = ref(false);
51
+ const entity = ref<BlurHash | null>(null);
52
52
 
53
- const fetch = async (imageId: string) => {
54
- fetching.value = true;
53
+ const get = async (imageId: string) => {
54
+ getting.value = true;
55
55
  try {
56
- fetched.value = await service.getBlurHash(imageId);
56
+ entity.value = await service.getBlurHash(imageId);
57
57
  }
58
58
  finally {
59
- fetching.value = false;
59
+ getting.value = false;
60
60
  }
61
- return fetched;
61
+ return entity;
62
62
  }
63
63
 
64
64
  return {
65
- fetching,
66
- fetch,
67
- fetched
65
+ getting,
66
+ get,
67
+ entity
68
68
  }
69
69
  }
@@ -22,29 +22,29 @@ export const useCurrentLandingPage = () => {
22
22
  const service = LandingPageServiceFactory();
23
23
  const subscribersIds: number[] = [];
24
24
 
25
- const fetching = ref(false);
26
- const fetched = ref<LandingPageDetails | null>(null);
25
+ const getting = ref(false);
26
+ const entity = ref<LandingPageDetails | null>(null);
27
27
 
28
28
  onUnmounted(() => {
29
29
  subscribersIds.forEach(id => service.unsubscribe(id));
30
30
  subscribersIds.length = 0;
31
31
  });
32
32
 
33
- const fetch = async () => {
34
- fetching.value = true;
33
+ const get = async () => {
34
+ getting.value = true;
35
35
  try {
36
- fetched.value = await service.getCurrent();
36
+ entity.value = await service.getCurrent();
37
37
  }
38
38
  finally {
39
- fetching.value = false;
39
+ getting.value = false;
40
40
  }
41
- subscribersIds.push(service.subscribe("all", onEntityChanged(fetched)));
42
- return fetched;
41
+ subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
42
+ return entity;
43
43
  }
44
44
 
45
45
  return {
46
- fetching,
47
- fetch,
48
- fetched
46
+ getting,
47
+ get,
48
+ entity
49
49
  }
50
50
  }
@@ -22,29 +22,29 @@ export const useCurrentLayoutPage = () => {
22
22
  const service = LayoutPageServiceFactory();
23
23
  const subscribersIds: number[] = [];
24
24
 
25
- const fetching = ref(false);
26
- const fetched = ref<LayoutPageDetails | null>(null);
25
+ const getting = ref(false);
26
+ const entity = ref<LayoutPageDetails | null>(null);
27
27
 
28
28
  onUnmounted(() => {
29
29
  subscribersIds.forEach(id => service.unsubscribe(id));
30
30
  subscribersIds.length = 0;
31
31
  });
32
32
 
33
- const fetch = async () => {
34
- fetching.value = true;
33
+ const get = async () => {
34
+ getting.value = true;
35
35
  try {
36
- fetched.value = await service.getCurrent();
36
+ entity.value = await service.getCurrent();
37
37
  }
38
38
  finally {
39
- fetching.value = false;
39
+ getting.value = false;
40
40
  }
41
- subscribersIds.push(service.subscribe("all", onEntityChanged(fetched)));
42
- return fetched;
41
+ subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
42
+ return entity;
43
43
  }
44
44
 
45
45
  return {
46
- fetching,
47
- fetch,
48
- fetched
46
+ getting,
47
+ get,
48
+ entity
49
49
  }
50
50
  }
@@ -22,29 +22,29 @@ export const useCurrentLegalInformation = () => {
22
22
  const service = LegalInformationServiceFactory();
23
23
  const subscribersIds: number[] = [];
24
24
 
25
- const fetching = ref(false);
26
- const fetched = ref<LegalInformationDetails | null>(null);
25
+ const getting = ref(false);
26
+ const entity = ref<LegalInformationDetails | null>(null);
27
27
 
28
28
  onUnmounted(() => {
29
29
  subscribersIds.forEach(id => service.unsubscribe(id));
30
30
  subscribersIds.length = 0;
31
31
  });
32
32
 
33
- const fetch = async () => {
34
- fetching.value = true;
33
+ const get = async () => {
34
+ getting.value = true;
35
35
  try {
36
- fetched.value = await service.getCurrent();
36
+ entity.value = await service.getCurrent();
37
37
  }
38
38
  finally {
39
- fetching.value = false;
39
+ getting.value = false;
40
40
  }
41
- subscribersIds.push(service.subscribe("all", onEntityChanged(fetched)));
42
- return fetched;
41
+ subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
42
+ return entity;
43
43
  }
44
44
 
45
45
  return {
46
- fetching,
47
- fetch,
48
- fetched
46
+ getting,
47
+ get,
48
+ entity
49
49
  }
50
50
  }
@@ -22,29 +22,29 @@ export const useCurrentSecuritySettings = () => {
22
22
  const service = SecuritySettingServiceFactory();
23
23
  const subscribersIds: number[] = [];
24
24
 
25
- const fetching = ref(false);
26
- const fetched = ref<SecuritySettingDetails | null>(null);
25
+ const getting = ref(false);
26
+ const entity = ref<SecuritySettingDetails | null>(null);
27
27
 
28
28
  onUnmounted(() => {
29
29
  subscribersIds.forEach(id => service.unsubscribe(id));
30
30
  subscribersIds.length = 0;
31
31
  });
32
32
 
33
- const fetch = async () => {
34
- fetching.value = true;
33
+ const get = async () => {
34
+ getting.value = true;
35
35
  try {
36
- fetched.value = await service.getCurrent();
36
+ entity.value = await service.getCurrent();
37
37
  }
38
38
  finally {
39
- fetching.value = false;
39
+ getting.value = false;
40
40
  }
41
- subscribersIds.push(service.subscribe("all", onEntityChanged(fetched)));
42
- return fetched;
41
+ subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
42
+ return entity;
43
43
  }
44
44
 
45
45
  return {
46
- fetching,
47
- fetch,
48
- fetched
46
+ getting,
47
+ get,
48
+ entity
49
49
  }
50
50
  }
@@ -20,22 +20,22 @@ export const useTranslations = () => {
20
20
  const service = TranslationServiceFactory();
21
21
 
22
22
  const fetching = ref(false);
23
- const fetched = ref<TranslationInfos[]>([]);
23
+ const entities = ref<TranslationInfos[]>([]);
24
24
 
25
- const fetch = async (languageCode: string) => {
25
+ const getMany = async (languageCode: string) => {
26
26
  fetching.value = true;
27
27
  try {
28
- fetched.value = await service.getMany(languageCode);
28
+ entities.value = await service.getMany(languageCode);
29
29
  }
30
30
  finally {
31
31
  fetching.value = false;
32
32
  }
33
- return fetched;
33
+ return entities;
34
34
  }
35
35
 
36
36
  return {
37
37
  fetching,
38
- fetch,
39
- fetched
38
+ getMany,
39
+ entities
40
40
  }
41
41
  }
@@ -24,29 +24,29 @@ export const useCurrentUserLegalInformation = () => {
24
24
  const service = UserLegalInformationServiceFactory();
25
25
  const subscribersIds: number[] = [];
26
26
 
27
- const fetching = ref(false);
28
- const fetched = ref<UserLegalInformationDetails | null>(null);
27
+ const getting = ref(false);
28
+ const entity = ref<UserLegalInformationDetails | null>(null);
29
29
 
30
30
  onUnmounted(() => {
31
31
  subscribersIds.forEach(id => service.unsubscribe(id));
32
32
  subscribersIds.length = 0;
33
33
  });
34
34
 
35
- const fetch = async () => {
36
- fetching.value = true;
35
+ const get = async () => {
36
+ getting.value = true;
37
37
  try {
38
- fetched.value = await service.getCurrent();
38
+ entity.value = await service.getCurrent();
39
39
  }
40
40
  finally {
41
- fetching.value = false;
41
+ getting.value = false;
42
42
  }
43
- subscribersIds.push(service.subscribe("all", onEntityChanged(fetched)));
44
- return fetched;
43
+ subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
44
+ return entity;
45
45
  }
46
46
 
47
47
  return {
48
- fetching,
49
- fetch,
50
- fetched
48
+ getting,
49
+ get,
50
+ entity
51
51
  }
52
52
  }
@@ -30,30 +30,30 @@ export const useCurrentUser = () => {
30
30
  const service = UserServiceFactory();
31
31
  const subscribersIds: number[] = [];
32
32
 
33
- const fetching = ref(false);
34
- const fetched = ref<UserDetails | null>(null);
33
+ const getting = ref(false);
34
+ const entity = ref<UserDetails | null>(null);
35
35
 
36
36
  onUnmounted(() => {
37
37
  subscribersIds.forEach(id => service.unsubscribe(id));
38
38
  subscribersIds.length = 0;
39
39
  });
40
40
 
41
- const fetch = async () => {
42
- fetching.value = true;
41
+ const get = async () => {
42
+ getting.value = true;
43
43
  try {
44
- fetched.value = await service.getCurrent();
44
+ entity.value = await service.getCurrent();
45
45
  }
46
46
  finally {
47
- fetching.value = false;
47
+ getting.value = false;
48
48
  }
49
- subscribersIds.push(service.subscribe("all", onEntityChanged(fetched)));
50
- return fetched;
49
+ subscribersIds.push(service.subscribe("all", onEntityChanged(entity)));
50
+ return entity;
51
51
  }
52
52
 
53
53
  return {
54
- fetching,
55
- fetch,
56
- fetched
54
+ getting,
55
+ get,
56
+ entity
57
57
  }
58
58
  }
59
59
  export const useUpdateCurrentUser = () => {
@@ -11,30 +11,30 @@ let called = false;
11
11
  const ready = ref(false);
12
12
 
13
13
  export function useShared() {
14
- if (called) {
15
- return {
16
- ready
17
- };
18
- }
14
+ if (called) {
15
+ return {
16
+ ready
17
+ };
18
+ }
19
19
 
20
- called = true;
20
+ called = true;
21
21
 
22
- const { ready: languageCodeReady, languageCode } = useLanguageCode();
23
- const { ready: timeZoneReady } = useTimeZone();
24
- const { fetch, fetched } = useTranslations();
25
- const { set } = useTranslationsProvider();
22
+ const { ready: languageCodeReady, languageCode } = useLanguageCode();
23
+ const { ready: timeZoneReady } = useTimeZone();
24
+ const { getMany, entities } = useTranslations();
25
+ const { set } = useTranslationsProvider();
26
26
 
27
- onMounted(async () => {
28
- await languageCodeReady
29
- await timeZoneReady;
30
- if (languageCode.value) {
31
- await fetch(languageCode.value!);
32
- set(fetched.value.map(t => ({ code: t.code, value: t.value })));
33
- }
34
- ready.value = true;
35
- });
27
+ onMounted(async () => {
28
+ await languageCodeReady
29
+ await timeZoneReady;
30
+ if (languageCode.value) {
31
+ await getMany(languageCode.value!);
32
+ set(entities.value.map(t => ({ code: t.code, value: t.value })));
33
+ }
34
+ ready.value = true;
35
+ });
36
36
 
37
- return {
38
- ready
39
- };
37
+ return {
38
+ ready
39
+ };
40
40
  }
@@ -0,0 +1,15 @@
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 +1,4 @@
1
+ export * from "./accounts";
1
2
  export * from "./applications";
2
3
  export * from "./authTokens";
3
4
  export * from "./files";
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.12",
4
+ "version": "0.0.13",
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.12",
14
+ "@dative-gpi/foundation-shared-domain": "0.0.13",
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": "73c686b3b0343ac4b42d34c2aa7cf7604ad0d298"
20
+ "gitHead": "c99a5f4be0427449b3b00ef6d467528bae8b1ada"
21
21
  }