1 | import { AtLeastOne } from '../types';
|
2 | /** @deprecated This may be removed in the next major version. */
|
3 | export type StorageAccessLevel = 'guest' | 'protected' | 'private';
|
4 | /** Information on bucket used to store files/objects */
|
5 | export interface BucketInfo {
|
6 | /** Actual bucket name */
|
7 | bucketName: string;
|
8 | /** Region of the bucket */
|
9 | region: string;
|
10 | /** Paths to object with access permissions */
|
11 | paths?: Record<string, Record<string, string[] | undefined>>;
|
12 | }
|
13 | export interface S3ProviderConfig {
|
14 | S3: {
|
15 | bucket?: string;
|
16 | region?: string;
|
17 | /**
|
18 | * Internal-only configuration for testing purpose. You should not use this.
|
19 | *
|
20 | * @internal
|
21 | */
|
22 | dangerouslyConnectToHttpEndpointForTesting?: string;
|
23 | /** Map of friendly name for bucket to its information */
|
24 | buckets?: Record<string, BucketInfo>;
|
25 | };
|
26 | }
|
27 | export type StorageConfig = AtLeastOne<S3ProviderConfig>;
|
28 | /** @deprecated This may be removed in the next major version. */
|
29 | type StoragePrefixResolver = (params: {
|
30 | accessLevel: StorageAccessLevel;
|
31 | targetIdentityId?: string;
|
32 | }) => Promise<string>;
|
33 | export interface LibraryStorageOptions {
|
34 | S3: {
|
35 | /**
|
36 | * @deprecated This may be removed in the next major version.
|
37 | * This is currently used for Storage API signature using key as input parameter.
|
38 | * */
|
39 | prefixResolver?: StoragePrefixResolver;
|
40 | /**
|
41 | * @deprecated This may be removed in the next major version.
|
42 | * This is currently used for Storage API signature using key as input parameter.
|
43 | * */
|
44 | defaultAccessLevel?: StorageAccessLevel;
|
45 | isObjectLockEnabled?: boolean;
|
46 | };
|
47 | }
|
48 | export {};
|