1 | import { Storage, StoreItems } from 'botbuilder';
|
2 | export interface Host {
|
3 | |
4 |
|
5 |
|
6 | primaryHost: string;
|
7 | |
8 |
|
9 |
|
10 | secondaryHost: string;
|
11 | }
|
12 |
|
13 |
|
14 |
|
15 | export interface BlobStorageSettings {
|
16 | |
17 |
|
18 |
|
19 | containerName: string;
|
20 | |
21 |
|
22 |
|
23 | storageAccountOrConnectionString: string;
|
24 | |
25 |
|
26 |
|
27 | storageAccessKey?: string;
|
28 | |
29 |
|
30 |
|
31 | host?: string | Host;
|
32 | }
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export declare class BlobStorage implements Storage {
|
44 | private settings;
|
45 | private client;
|
46 | private useEmulator;
|
47 | |
48 |
|
49 |
|
50 |
|
51 |
|
52 | constructor(settings: BlobStorageSettings);
|
53 | /**
|
54 | * Retrieve entities from the configured blob container.
|
55 | *
|
56 | * @param keys An array of entity keys.
|
57 | * @returns The read items.
|
58 | */
|
59 | read(keys: string[]): Promise<StoreItems>;
|
60 | /**
|
61 | * Store a new entity in the configured blob container.
|
62 | *
|
63 | * @param changes The changes to write to storage.
|
64 | */
|
65 | write(changes: StoreItems): Promise<void>;
|
66 | /**
|
67 | * Delete entity blobs from the configured container.
|
68 | *
|
69 | * @param keys An array of entity keys.
|
70 | */
|
71 | delete(keys: string[]): Promise<void>;
|
72 | /**
|
73 | * Get a blob name validated representation of an entity to be used as a key.
|
74 | *
|
75 | * @param key The key used to identify the entity.
|
76 | */
|
77 | private sanitizeKey;
|
78 | /**
|
79 | * Check if a container name is valid.
|
80 | *
|
81 | * @param container String representing the container name to validate.
|
82 | * @returns A boolean value that indicates whether or not the name is valid.
|
83 | */
|
84 | private checkContainerName;
|
85 | /**
|
86 | * Delay Container creation if it does not exist.
|
87 | */
|
88 | private ensureContainerExists;
|
89 | /**
|
90 | * Create a Blob Service.
|
91 | *
|
92 | * @param storageAccountOrConnectionString Azure CloudStorageAccount instance or Connection String.
|
93 | * @param storageAccessKey Blob Service Access Key.
|
94 | * @param host Blob Service Host.
|
95 | * @returns The blob services created.
|
96 | */
|
97 | private createBlobService;
|
98 | /**
|
99 | * @private
|
100 | * Turn a cb based azure method into a Promisified one.
|
101 | */
|
102 | private denodeify;
|
103 | }
|
104 | //# sourceMappingURL=blobStorage.d.ts.map |
\ | No newline at end of file |