js-bao-wss-client / DocumentInfo
Interface: DocumentInfo<M>
A document's metadata, including the caller's effective permission. Returned by documents.get() and the document list methods. M optionally types the opaque metadata blob.
Extended by
Type Parameters
M
M = unknown
Properties
accessSource?
optionalaccessSource?:"owner"|"link"|"grant"|"group"
How the caller's effective permission was obtained. "link" means the level came from the document's "anyone with the link" access floor, not an explicit grant — a link-opened document does NOT appear in me/shared-documents, so the app should track it itself if it wants a "get back to it" affordance. Present on single-document GET.
createdAt
createdAt:
string
createdBy
createdBy:
string
documentFormat?
optionaldocumentFormat?:number
2 for a large document, absent for an ordinary one.
The server has always sent this on the single-document read, and omits it for an ordinary document so that read's historic shape is unchanged — so treat an absent value as "ordinary", not as "unknown". The format is chosen at creation and never migrated.
documentId
documentId:
string
grantedAt?
optionalgrantedAt?:string
lastModified
lastModified:
string
linkAccess?
optionallinkAccess?:"read-write"|"reader"
The document's "anyone with the link" access level, or absent when link access is off. Visible to everyone who can open the document.
metadata?
optionalmetadata?:M
Opaque JSON-stringified metadata blob (≤ 4 KB serialized UTF-8). The platform does not introspect this — it round-trips whatever the caller sets. Use replace semantics on update; pass null to clear.
M is an optional additive generic that types this opaque blob; it defaults to unknown, so bare DocumentInfo references are unchanged. Bind it via documents.get<M>(id).
permission
permission:
"owner"|"read-write"|"reader"|"admin"
tags?
optionaltags?:string[]
thumbnailBlobId?
optionalthumbnailBlobId?:string
Optional reference to a Blob owned by this document. The blob lifecycle is independent — a dangling reference (blob deleted out-of-band) is the UI's responsibility to handle (typically: render a placeholder on 404).
title
title:
string