Skip to content

js-bao-wss-client


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? ​

optional accessSource?: "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? ​

optional documentFormat?: 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? ​

optional grantedAt?: string


lastModified ​

lastModified: string


linkAccess? ​

optional linkAccess?: "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? ​

optional metadata?: 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? ​

optional tags?: string[]


thumbnailBlobId? ​

optional thumbnailBlobId?: 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

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30