@aztec/blob-client 0.0.1-commit.f504929 → 0.0.1-commit.f650c0a5c
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/dest/client/config.d.ts +7 -1
- package/dest/client/config.d.ts.map +1 -1
- package/dest/client/config.js +16 -1
- package/dest/client/factory.d.ts +1 -1
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +7 -1
- package/dest/client/http.d.ts +11 -9
- package/dest/client/http.d.ts.map +1 -1
- package/dest/client/http.js +177 -98
- package/dest/client/interface.d.ts +2 -4
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/filestore/factory.d.ts +5 -4
- package/dest/filestore/factory.d.ts.map +1 -1
- package/dest/filestore/factory.js +4 -4
- package/package.json +7 -7
- package/src/client/config.ts +25 -0
- package/src/client/factory.ts +8 -1
- package/src/client/http.ts +191 -102
- package/src/client/interface.ts +1 -3
- package/src/filestore/factory.ts +7 -2
package/src/filestore/factory.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import {
|
|
3
3
|
type FileStore,
|
|
4
|
+
type HttpFileStoreOptions,
|
|
4
5
|
type ReadOnlyFileStore,
|
|
5
6
|
createFileStore,
|
|
6
7
|
createReadOnlyFileStore,
|
|
@@ -44,16 +45,19 @@ export async function createReadOnlyFileStoreBlobClient(
|
|
|
44
45
|
storeUrl: string,
|
|
45
46
|
metadata: BlobFileStoreMetadata,
|
|
46
47
|
logger?: Logger,
|
|
48
|
+
httpOptions?: HttpFileStoreOptions,
|
|
47
49
|
): Promise<FileStoreBlobClient>;
|
|
48
50
|
export async function createReadOnlyFileStoreBlobClient(
|
|
49
51
|
storeUrl: string | undefined,
|
|
50
52
|
metadata: BlobFileStoreMetadata,
|
|
51
53
|
logger?: Logger,
|
|
54
|
+
httpOptions?: HttpFileStoreOptions,
|
|
52
55
|
): Promise<FileStoreBlobClient | undefined>;
|
|
53
56
|
export async function createReadOnlyFileStoreBlobClient(
|
|
54
57
|
storeUrl: string | undefined,
|
|
55
58
|
metadata: BlobFileStoreMetadata,
|
|
56
59
|
logger?: Logger,
|
|
60
|
+
httpOptions?: HttpFileStoreOptions,
|
|
57
61
|
): Promise<FileStoreBlobClient | undefined> {
|
|
58
62
|
if (!storeUrl) {
|
|
59
63
|
return undefined;
|
|
@@ -64,7 +68,7 @@ export async function createReadOnlyFileStoreBlobClient(
|
|
|
64
68
|
|
|
65
69
|
log.debug(`Creating read-only filestore blob client`, { storeUrl, basePath });
|
|
66
70
|
|
|
67
|
-
const store: ReadOnlyFileStore = await createReadOnlyFileStore(storeUrl, log);
|
|
71
|
+
const store: ReadOnlyFileStore = await createReadOnlyFileStore(storeUrl, log, httpOptions);
|
|
68
72
|
return new FileStoreBlobClient(store, basePath, log);
|
|
69
73
|
}
|
|
70
74
|
|
|
@@ -80,6 +84,7 @@ export async function createReadOnlyFileStoreBlobClients(
|
|
|
80
84
|
storeUrls: string[] | undefined,
|
|
81
85
|
metadata: BlobFileStoreMetadata,
|
|
82
86
|
logger?: Logger,
|
|
87
|
+
httpOptions?: HttpFileStoreOptions,
|
|
83
88
|
): Promise<FileStoreBlobClient[]> {
|
|
84
89
|
if (!storeUrls || storeUrls.length === 0) {
|
|
85
90
|
return [];
|
|
@@ -90,7 +95,7 @@ export async function createReadOnlyFileStoreBlobClients(
|
|
|
90
95
|
|
|
91
96
|
for (const storeUrl of storeUrls) {
|
|
92
97
|
try {
|
|
93
|
-
const client = await createReadOnlyFileStoreBlobClient(storeUrl, metadata, log);
|
|
98
|
+
const client = await createReadOnlyFileStoreBlobClient(storeUrl, metadata, log, httpOptions);
|
|
94
99
|
if (client) {
|
|
95
100
|
clients.push(client);
|
|
96
101
|
}
|