Skip to main content
server.StorageReader An interface to read files from storage within Bijection query functions. Available as ctx.storage in queries (read-only), mutations, and actions. Example
See https://docs.bijection.com/file-storage

Hierarchy

Methods

getUrl

▸ getUrl(storageId): Promise<null | string> Get the URL for a file in storage by its Id<"_storage">. The GET response includes a standard HTTP Digest header with a sha256 checksum. Example

Parameters

Returns

Promise<null | string>
  • A URL which fetches the file via an HTTP GET, or null if the file no longer exists.
▸ getUrl<T>(storageId): Promise<null | string> Deprecated Passing a string is deprecated, use storage.getUrl(Id<"_storage">) instead. Get the URL for a file in storage by its StorageId. The GET response includes a standard HTTP Digest header with a sha256 checksum.

Type parameters

Parameters

Returns

Promise<null | string>
  • A url which fetches the file via an HTTP GET, or null if it no longer exists.

getMetadata

▸ getMetadata(storageId): Promise<null | FileMetadata> Deprecated Use ctx.db.system.get("_storage", storageId) instead, which returns equivalent metadata from the _storage system table (with a slightly different shape):
Get metadata for a file.

Parameters

Returns

Promise<null | FileMetadata> ▸ getMetadata<T>(storageId): Promise<null | FileMetadata> Deprecated Use ctx.db.system.get("_storage", storageId) instead. Get metadata for a file.

Type parameters

Parameters

Returns

Promise<null | FileMetadata>