Skip to content

StorageService

Defined in: packages/core/src/utils.ts:25

Generic storage service interface that provides cloud storage operations. This interface abstracts storage operations to allow for different implementations (S3, R2, etc.) while maintaining a consistent API.

readonly computeFileHash: (filePath) => Effect<string, Error, FileSystem>

Defined in: packages/core/src/utils.ts:73

Computes the MD5 hash of a local file. This is useful for comparing local and remote file versions.

string

The path to the local file

Effect<string, Error, FileSystem>

An Effect that succeeds with the MD5 hash string or fails with an Error, requiring FileSystem


readonly delete: (bucket, key) => Effect<void, Error>

Defined in: packages/core/src/utils.ts:57

Deletes a file from the specified bucket.

string

The name of the storage bucket

string

The unique identifier/path for the file within the bucket

Effect<void, Error>

An Effect that succeeds with void or fails with an Error


readonly getETag: (bucket, key) => Effect<null | string, Error>

Defined in: packages/core/src/utils.ts:46

Retrieves the ETag (entity tag) for a file in the specified bucket. ETags are typically used for cache validation and change detection.

string

The name of the storage bucket

string

The unique identifier/path for the file within the bucket

Effect<null | string, Error>

An Effect that succeeds with the ETag string or null if not found, or fails with an Error


readonly listAll: (bucket) => Effect<string[], Error>

Defined in: packages/core/src/utils.ts:65

Lists all object keys in the specified bucket. This operation handles pagination automatically to retrieve all objects.

string

The name of the storage bucket

Effect<string[], Error>

An Effect that succeeds with an array of all object keys or fails with an Error


readonly upload: (bucket, key, body) => Effect<void, Error>

Defined in: packages/core/src/utils.ts:33

Uploads a file to the specified bucket with the given key.

string

The name of the storage bucket

string

The unique identifier/path for the file within the bucket

Uint8Array

The file content as a Uint8Array

Effect<void, Error>

An Effect that succeeds with void or fails with an Error