Skip to main content
server.BijectionStorageActionWriter

Hierarchy

Methods

share

▸ share(storageId, options): Promise<string> Grant one recipient access to a protected file under current source policy.

Parameters

Returns

Promise<string>

Inherited from

Pick.share

revokeShare

▸ revokeShare(storageId, shareId): Promise<void> Revoke one grant without changing other grants or the stored bytes.

Parameters

Returns

Promise<void>

Inherited from

Pick.revokeShare

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.

Inherited from

StorageActionWriter.getUrl ▸ 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.

Inherited from

StorageActionWriter.getUrl

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>

Inherited from

StorageActionWriter.getMetadata ▸ 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>

Inherited from

StorageActionWriter.getMetadata

generateUploadUrl

▸ generateUploadUrl(): Promise<string> Generate a short-lived URL for uploading a file into storage. The client should make a POST request to this URL with the file as the body. The response will be a JSON object containing a newly allocated Id<"_storage"> ({ storageId: "..." }). Example

Returns

Promise<string>
  • A short-lived URL for uploading a file via HTTP POST.

Inherited from

StorageActionWriter.generateUploadUrl

delete

▸ delete(storageId): Promise<void> Delete a file from Bijection storage. Once a file is deleted, any URLs previously generated by getUrl will return 404s. Example

Parameters

Returns

Promise<void>

Inherited from

StorageActionWriter.delete ▸ delete<T>(storageId): Promise<void> Deprecated Passing a string is deprecated, use storage.delete(Id<"_storage">) instead. Delete a file from Bijection storage. Once a file is deleted, any URLs previously generated by getUrl will return 404s.

Type parameters

Parameters

Returns

Promise<void>

Inherited from

StorageActionWriter.delete

get

▸ get(storageId): Promise<null | Blob> Download a file from storage as a Blob. Only available in actions and HTTP actions (not in mutations or queries).

Parameters

Returns

Promise<null | Blob> A Blob containing the file contents, or null if the file doesn’t exist.

Inherited from

StorageActionWriter.get ▸ get<T>(storageId): Promise<null | Blob> Deprecated Passing a string is deprecated, use storage.get(Id<"_storage">) instead. Get a Blob containing the file associated with the provided StorageId, or null if there is no file.

Type parameters

Parameters

Returns

Promise<null | Blob>

Inherited from

StorageActionWriter.get

store

▸ store(blob, options?): Promise<GenericId<"_storage">> Upload a Blob directly to storage. Only available in actions and HTTP actions. For client-side uploads from mutations, use generateUploadUrl() instead. Example

Parameters

Returns

Promise<GenericId<"_storage">> The Id<"_storage"> of the newly stored file.

Inherited from

StorageActionWriter.store