Skip to content

js-bao-wss-client


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

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.

Inherited from ​

DocumentInfo.accessSource


createdAt ​

createdAt: string

Inherited from ​

DocumentInfo.createdAt


createdBy ​

createdBy: string

Inherited from ​

DocumentInfo.createdBy


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.

Inherited from ​

DocumentInfo.documentFormat


documentId ​

documentId: string

Inherited from ​

DocumentInfo.documentId


grantedAt? ​

optional grantedAt?: string

Inherited from ​

DocumentInfo.grantedAt


grantedBy ​

grantedBy: string

Who granted access (the actor) — always present on shared rows.


lastModified ​

lastModified: string

Inherited from ​

DocumentInfo.lastModified


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.

Inherited from ​

DocumentInfo.linkAccess


metadata? ​

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

DocumentInfo.metadata


permission ​

permission: "owner" | "read-write" | "reader" | "admin"

Inherited from ​

DocumentInfo.permission


source? ​

optional source?: "permission"

Always "permission": the row is a direct, non-owner grant.


tags? ​

optional tags?: string[]

Inherited from ​

DocumentInfo.tags


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).

Inherited from ​

DocumentInfo.thumbnailBlobId


title ​

title: string

Inherited from ​

DocumentInfo.title

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