Dominevo
ReferenceHTTP API

storage

The storage router: 17 methods of the storage capability, with tier, scope, input and output.

Capability storage · scope system · mode singleton · source packages/types/src/capabilities/storage.cap.ts:30.

Every method is called at /trpc/storage.<method> — queries with GET, mutations with POST. See How to call and Authorization.

MethodKindTierToken scopeViewer
resolvequeryadminadmin onlyno
writemutationadminadmin onlyno
readqueryadminadmin onlyno
existsqueryadminadmin onlyno
listqueryadminadmin onlyno
deletemutationadminadmin onlyno
getAvailableSpacequeryprotectedviewno
beginUploadmutationadminadmin onlyno
writeChunkmutationadminadmin onlyno
finalizeUploadmutationadminadmin onlyno
abortUploadmutationadminadmin onlyno
beginDownloadmutationadminadmin onlyno
readChunkqueryadminadmin onlyno
endDownloadmutationadminadmin onlyno
listLocationsqueryprotectedviewno
listLocationDeclarationsqueryprotectedviewno
listDrainProgressqueryprotectedviewno

storage.resolve

  • Kind: query — GET /trpc/storage.resolve
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.resolve on your hub

Input

{ location: string | string; relativePath: string }

Output

string

storage.write

  • Kind: mutation — POST /trpc/storage.write
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.write on your hub

Input

{ location: string | string; relativePath: string; data: <custom> }

Output

void

storage.read

  • Kind: query — GET /trpc/storage.read
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.read on your hub

Input

{ location: string | string; relativePath: string }

Output

<custom>

storage.exists

  • Kind: query — GET /trpc/storage.exists
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.exists on your hub

Input

{ location: string | string; relativePath: string }

Output

boolean

storage.list

  • Kind: query — GET /trpc/storage.list
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.list on your hub

Input

{ location: string | string; prefix?: string }

Output

string[]

storage.delete

  • Kind: mutation — POST /trpc/storage.delete
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.delete on your hub

Input

{ location: string | string; relativePath: string }

Output

void

storage.getAvailableSpace

  • Kind: query — GET /trpc/storage.getAvailableSpace
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability storage, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.getAvailableSpace on your hub

Input

{ location: string | string }

Output

number | null

storage.beginUpload

  • Kind: mutation — POST /trpc/storage.beginUpload
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.beginUpload on your hub

Input

{ location: string | string; relativePath: string; sizeBytes?: number }

Output

{ uploadId: string }

storage.writeChunk

  • Kind: mutation — POST /trpc/storage.writeChunk
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.writeChunk on your hub

Input

{ uploadId: string; offset: number; data: <custom> }

Output

void

storage.finalizeUpload

  • Kind: mutation — POST /trpc/storage.finalizeUpload
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.finalizeUpload on your hub

Input

{ uploadId: string }

Output

void

storage.abortUpload

  • Kind: mutation — POST /trpc/storage.abortUpload
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.abortUpload on your hub

Input

{ uploadId: string }

Output

void

storage.beginDownload

  • Kind: mutation — POST /trpc/storage.beginDownload
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.beginDownload on your hub

Input

{ location: string | string; relativePath: string }

Output

{ downloadId: string; sizeBytes: number }

storage.readChunk

  • Kind: query — GET /trpc/storage.readChunk
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.readChunk on your hub

Input

{ downloadId: string; offset: number; length: number }

Output

<custom>

storage.endDownload

  • Kind: mutation — POST /trpc/storage.endDownload
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.endDownload on your hub

Input

{ downloadId: string }

Output

void

storage.listLocations

  • Kind: query — GET /trpc/storage.listLocations
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability storage, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.listLocations on your hub

Input

{ type?: string }

Output

({ id: string; type: string; displayName: string; providerId: string; config: Record<string, unknown>; nodeId?: string; isSystem?: boolean = false; enabled?: boolean; mode?: "active" | "readonly" | "drain" | "disabled"; capacity?: { totalBytes: number; availableBytes: number } | null; owned?: { bytes: number; measuredAtMs: number }; createdAt: number; updatedAt: number })[]

storage.listLocationDeclarations

  • Kind: query — GET /trpc/storage.listLocationDeclarations
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability storage, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.listLocationDeclarations on your hub

Input

void

Output

({ id: string; displayName: string; description?: string; cardinality: "single" | "multi"; access?: "local-path" | "cap-mediated"; defaultsTo?: string; defaultRoot?: "data" | "media" | "backup" })[]

storage.listDrainProgress

  • Kind: query — GET /trpc/storage.listDrainProgress
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability storage, or category system
  • Viewer: no
  • Try it: open /system/api-explorer?method=storage.listDrainProgress on your hub

Input

void

Output

({ locationId: string; startedAtMs: number; startBytes: number; bytesRemaining: number; drained: boolean; estimatedEmptyAtMs: number | null })[]