@cellaware/utils 9.5.4 → 9.5.5
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,15 +1,15 @@
|
|
|
1
1
|
export declare function chatwmsStorageGetBlobId(clientId: string, blobName: string): string;
|
|
2
|
-
export declare function chatwmsStorageContainerCreate(): Promise<void>;
|
|
2
|
+
export declare function chatwmsStorageContainerCreate(containerClientId?: string): Promise<void>;
|
|
3
3
|
/**
|
|
4
4
|
* Stringifies `data` and uploads to blob storage.
|
|
5
5
|
*
|
|
6
6
|
* **Important:** `data` must not be a string.
|
|
7
7
|
*/
|
|
8
|
-
export declare function chatwmsStorageBlobUpload(blobId: string, data: any): Promise<void>;
|
|
8
|
+
export declare function chatwmsStorageBlobUpload(blobId: string, data: any, containerClientId?: string): Promise<void>;
|
|
9
9
|
/**
|
|
10
10
|
* Parses string data downloaded from blob storage and returns JSON object/JSON array.
|
|
11
11
|
*
|
|
12
12
|
* **Important:** will return `undefined` if any issues or blob does not exist.
|
|
13
13
|
*/
|
|
14
|
-
export declare function chatwmsStorageBlobDownload(blobId: string): Promise<any>;
|
|
15
|
-
export declare function chatwmsStorageBlobDelete(blobId: string): Promise<void>;
|
|
14
|
+
export declare function chatwmsStorageBlobDownload(blobId: string, containerClientId?: string): Promise<any>;
|
|
15
|
+
export declare function chatwmsStorageBlobDelete(blobId: string, containerClientId?: string): Promise<void>;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { storageBlobDelete, storageBlobDownload, storageBlobUpload, storageContainerCreate } from "../../azure/storage.js";
|
|
2
|
-
const
|
|
2
|
+
const DEFAULT_CONTAINER_CLIENT_ID = 'chatwms';
|
|
3
3
|
export function chatwmsStorageGetBlobId(clientId, blobName) {
|
|
4
4
|
return clientId.replaceAll('_', '-') + '-' + blobName;
|
|
5
5
|
}
|
|
6
|
-
export async function chatwmsStorageContainerCreate() {
|
|
7
|
-
return storageContainerCreate(
|
|
6
|
+
export async function chatwmsStorageContainerCreate(containerClientId) {
|
|
7
|
+
return storageContainerCreate(containerClientId ?? DEFAULT_CONTAINER_CLIENT_ID);
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Stringifies `data` and uploads to blob storage.
|
|
11
11
|
*
|
|
12
12
|
* **Important:** `data` must not be a string.
|
|
13
13
|
*/
|
|
14
|
-
export async function chatwmsStorageBlobUpload(blobId, data) {
|
|
15
|
-
return storageBlobUpload(
|
|
14
|
+
export async function chatwmsStorageBlobUpload(blobId, data, containerClientId) {
|
|
15
|
+
return storageBlobUpload(containerClientId ?? DEFAULT_CONTAINER_CLIENT_ID, blobId, data);
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Parses string data downloaded from blob storage and returns JSON object/JSON array.
|
|
19
19
|
*
|
|
20
20
|
* **Important:** will return `undefined` if any issues or blob does not exist.
|
|
21
21
|
*/
|
|
22
|
-
export async function chatwmsStorageBlobDownload(blobId) {
|
|
23
|
-
return storageBlobDownload(
|
|
22
|
+
export async function chatwmsStorageBlobDownload(blobId, containerClientId) {
|
|
23
|
+
return storageBlobDownload(containerClientId ?? DEFAULT_CONTAINER_CLIENT_ID, blobId);
|
|
24
24
|
}
|
|
25
|
-
export async function chatwmsStorageBlobDelete(blobId) {
|
|
26
|
-
return storageBlobDelete(
|
|
25
|
+
export async function chatwmsStorageBlobDelete(blobId, containerClientId) {
|
|
26
|
+
return storageBlobDelete(containerClientId ?? DEFAULT_CONTAINER_CLIENT_ID, blobId);
|
|
27
27
|
}
|