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.
Properties
Section titled “Properties”computeFileHash()
Section titled “computeFileHash()”
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.
Parameters
Section titled “Parameters”filePath
Section titled “filePath”string
The path to the local file
Returns
Section titled “Returns”Effect
<string
, Error
, FileSystem
>
An Effect that succeeds with the MD5 hash string or fails with an Error, requiring FileSystem
delete()
Section titled “delete()”
readonly
delete: (bucket
,key
) =>Effect
<void
,Error
>
Defined in: packages/core/src/utils.ts:57
Deletes a file from the specified bucket.
Parameters
Section titled “Parameters”bucket
Section titled “bucket”string
The name of the storage bucket
string
The unique identifier/path for the file within the bucket
Returns
Section titled “Returns”Effect
<void
, Error
>
An Effect that succeeds with void or fails with an Error
getETag()
Section titled “getETag()”
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.
Parameters
Section titled “Parameters”bucket
Section titled “bucket”string
The name of the storage bucket
string
The unique identifier/path for the file within the bucket
Returns
Section titled “Returns”Effect
<null
| string
, Error
>
An Effect that succeeds with the ETag string or null if not found, or fails with an Error
listAll()
Section titled “listAll()”
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.
Parameters
Section titled “Parameters”bucket
Section titled “bucket”string
The name of the storage bucket
Returns
Section titled “Returns”Effect
<string
[], Error
>
An Effect that succeeds with an array of all object keys or fails with an Error
upload()
Section titled “upload()”
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.
Parameters
Section titled “Parameters”bucket
Section titled “bucket”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
Returns
Section titled “Returns”Effect
<void
, Error
>
An Effect that succeeds with void or fails with an Error