basalt / files-versions/src / FileVersionStore
Interface: FileVersionStore
Defined in: files-versions/src/store.ts:31
Where the revision history lives.
Every method is scoped by tenant, and that is not decoration. The obvious signature — history(groupId) — reads one firm's document history from another firm's session the moment a group id leaks into a URL. A group id is exactly the kind of value that ends up in a URL.
Methods
append()
> append(tenantId, groupId, fileId, meta?): Promise<FileVersion>
Defined in: files-versions/src/store.ts:40
Records a new revision and returns it with the version number it was given.
The number is the store's to assign: a caller that reads the latest and adds one has a race, and two uploads landing together would both claim the same revision — of a contract, in a business where which draft you are reading is the whole question.
Parameters
tenantId
string
groupId
string
fileId
string
meta?
by?
string
note?
string
Returns
Promise<FileVersion>
at()
> at(tenantId, groupId, version): Promise<FileVersion | null>
Defined in: files-versions/src/store.ts:51
One revision by number, or null.
Parameters
tenantId
string
groupId
string
version
number
Returns
Promise<FileVersion | null>
history()
> history(tenantId, groupId): Promise<FileVersion[]>
Defined in: files-versions/src/store.ts:49
Every revision, newest first.
Parameters
tenantId
string
groupId
string
Returns
Promise<FileVersion[]>
latest()
> latest(tenantId, groupId): Promise<FileVersion | null>
Defined in: files-versions/src/store.ts:47
The current revision, or null for a group that has none.
Parameters
tenantId
string
groupId
string
Returns
Promise<FileVersion | null>