js-bao-wss-client / SharedDocument
Interface: SharedDocument
A document shared with the current user.
Shared rows carry the same base Document fields owned rows do (createdBy/createdAt/lastModified + tags/metadata/ thumbnailBlobId when set) — hence the extends DocumentInfo. The shared-only semantic extras (source/grantedBy) are layered on top. permission is the granted level (never "owner" — owned docs surface via MeAPI.ownedDocuments instead).
Extends
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.
Inherited from
createdAt
createdAt:
string
Inherited from
createdBy
createdBy:
string
Inherited from
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.
Inherited from
documentId
documentId:
string
Inherited from
grantedAt?
optionalgrantedAt?:string
Inherited from
grantedBy
grantedBy:
string
Who granted access (the actor) — always present on shared rows.
lastModified
lastModified:
string
Inherited from
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.
Inherited from
metadata?
optionalmetadata?:unknown
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).
Inherited from
permission
permission:
"owner"|"read-write"|"reader"|"admin"
Inherited from
source?
optionalsource?:"permission"
Always "permission": the row is a direct, non-owner grant.
tags?
optionaltags?:string[]
Inherited from
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).
Inherited from
title
title:
string