Interface: IBlobAdapter
Defined in: internal/file-store/types.ts:155
Blob storage seam.
Methods
get()
get(
args):Promise<Uint8Array<ArrayBufferLike>>
Defined in: internal/file-store/types.ts:187
get -- the bytes of a key
About
The whole blob, as stored.
Throws a 404 for a key that does not exist.
Who needs it
FileStore.getBytes.
Parameters
args
key
string
Returns
Promise<Uint8Array<ArrayBufferLike>>
put()
put(
args):Promise<void>
Defined in: internal/file-store/types.ts:169
put -- stores the bytes under a key
About
Replace what was there; keep the media type with the bytes.
The mime is stored with the bytes so the signed URL can serve them with the right type.
Who needs it
FileStore.put.
Parameters
args
bytes
Uint8Array
key
string
mime
string
Returns
Promise<void>
remove()
remove(
args):Promise<void>
Defined in: internal/file-store/types.ts:218
remove -- deletes one blob
About
Nothing when the key does not exist.
Removes the bytes and the media type stored under the key.
Who needs it
FileStore.remove.
Parameters
args
key
string
Returns
Promise<void>
removeByPrefix()
removeByPrefix(
args):Promise<number>
Defined in: internal/file-store/types.ts:232
removeByPrefix -- deletes every blob under a prefix
About
A folder at a time: the prefix ends with "/".
Removes every blob whose key starts with the prefix and returns how many went.
Who needs it
FileStore.removeFilesByUser, for the user's folder (GDPR erasure).
Parameters
args
prefix
string
Returns
Promise<number>
signedUrl()
signedUrl(
args):Promise<string>
Defined in: internal/file-store/types.ts:201
signedUrl -- a URL that serves the blob for a while
About
The storage serves the file, not the gateway.
A URL valid for ttlSec seconds. Throws a 404 for a key that does not exist.
Who needs it
FileStore.getSignedUrl.
Parameters
args
key
string
ttlSec
number
Returns
Promise<string>