@dative-gpi/foundation-shared-services 0.0.76 → 0.0.77
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/app/index.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { computed, ref } from "vue";
|
|
2
|
+
|
|
3
|
+
const jwt = ref<string | undefined>(undefined);
|
|
4
|
+
|
|
5
|
+
export const useExtensionJwt = () => {
|
|
6
|
+
const setExtensionJwt = (payload: string) => {
|
|
7
|
+
jwt.value = payload;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const ready = computed(() => jwt.value !== null);
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
jwt,
|
|
14
|
+
ready,
|
|
15
|
+
setExtensionJwt
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
|
|
2
2
|
import { BlurHash, BlurHashDTO } from "@dative-gpi/foundation-shared-domain/models";
|
|
3
3
|
|
|
4
|
-
import { IMAGE_BLURHASH_URL
|
|
4
|
+
import { IMAGE_BLURHASH_URL } from "../../config/urls";
|
|
5
5
|
|
|
6
6
|
const ImageServiceFactory = {
|
|
7
|
-
...ServiceFactory.addCustom("getRaw", (axios, imageId: string) => axios.get(IMAGE_RAW_URL(imageId)), (image: string) => image),
|
|
8
7
|
...ServiceFactory.addCustom("getBlurHash", (axios, imageId: string) => axios.get(IMAGE_BLURHASH_URL(imageId)), (dto: BlurHashDTO) => new BlurHash(dto))
|
|
9
8
|
};
|
|
10
9
|
|
|
11
|
-
export const useRawImage = ComposableFactory.custom(ImageServiceFactory.getRaw);
|
|
12
10
|
export const useImageBlurHash = ComposableFactory.custom(ImageServiceFactory.getBlurHash);
|
package/config/urls/images.ts
CHANGED
|
@@ -4,6 +4,7 @@ export const IMAGES_URL = () => `${GATEWAY_EXTENSION_URL()}/images`;
|
|
|
4
4
|
|
|
5
5
|
export const IMAGES_RAW_URL = () => `${IMAGES_URL()}/raw`;
|
|
6
6
|
export const IMAGE_RAW_URL = (imageId: string) => `${IMAGES_RAW_URL()}/${encodeURIComponent(imageId)}`;
|
|
7
|
+
export const IMAGE_RAW_EXTENSION_URL = (imageId: string, jwt: string) => `${IMAGE_RAW_URL(imageId)}?access_token=${jwt}`;
|
|
7
8
|
|
|
8
9
|
export const IMAGES_THUMBNAIL_URL = () => `${IMAGES_URL()}/thumbnail`;
|
|
9
10
|
export const IMAGE_THUMBNAIL_URL = (imageId: string) => `${IMAGES_THUMBNAIL_URL()}/${encodeURIComponent(imageId)}`;
|
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.
|
|
4
|
+
"version": "0.0.77",
|
|
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-shared-domain": "0.0.
|
|
14
|
+
"@dative-gpi/foundation-shared-domain": "0.0.77",
|
|
15
15
|
"@microsoft/signalr": "^8.0.0",
|
|
16
16
|
"vue": "^3.2.0",
|
|
17
17
|
"vue-router": "^4.2.5"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "6b19cf784bb4bb763d8d437425caf7ace12e6067"
|
|
20
20
|
}
|