ArtifactStore
@forge/monorepo / backend/src / ArtifactStore
Interface: ArtifactStore
Defined in: backend/src/persistence/index.ts:1039
Methods
addVersion()
addVersion(
input):Promise<{added:boolean;version?:number; }>
Defined in: backend/src/persistence/index.ts:1055
Adds the next version — AC-2.
expectedLatestVersion makes this a compare-and-set. Without it two concurrent regenerations both become
version 2: one silently replaces the other, and "earlier versions remain resolvable" stops being true for
the one that lost. Reported rather than thrown, because losing that race is an ordinary outcome.
Parameters
input
TenantScope & object
Returns
Promise<{ added: boolean; version?: number; }>
create()
create(
input):Promise<Artifact>
Defined in: backend/src/persistence/index.ts:1041
Creates the artifact and its version 1 together: an artifact with no version is not a thing.
Parameters
input
TenantScope & object
Returns
Promise<Artifact>
get()
get(
input):Promise<Artifact|null>
Defined in: backend/src/persistence/index.ts:1064
null for another tenant's artifact as well as an absent one — the two must be indistinguishable.
Parameters
input
TenantScope & object
Returns
Promise<Artifact | null>
getVersion()
getVersion(
input):Promise<ArtifactVersion|null>
Defined in: backend/src/persistence/index.ts:1067
A specific version, or the latest when version is omitted.
Parameters
input
TenantScope & object
Returns
Promise<ArtifactVersion | null>
listByConversation()
Defined in: backend/src/persistence/index.ts:1072
Live artifacts of a conversation, newest cursor last.
Parameters
input
TenantScope & PageRequest & object
Returns
listVersions()
listVersions(
input):Promise<Page<ArtifactVersion>>
Defined in: backend/src/persistence/index.ts:1077
Every version, oldest first — the history a restore reads.
Parameters
input
TenantScope & PageRequest & object
Returns
Promise<Page<ArtifactVersion>>
softDelete()
softDelete(
input):Promise<{deleted:boolean; }>
Defined in: backend/src/persistence/index.ts:1080
Soft delete. Versions are kept: the row is what makes a shared link resolve to "deleted".
Parameters
input
TenantScope & object
Returns
Promise<{ deleted: boolean; }>