UserDraftsStore: the mechanism UserDraftsRepo implements.
API
@Interface()
export abstract class UserDraftsStore {
abstract list(userId: string): StoredDraft[];
abstract apply(
userId: string,
writes: readonly DraftWrite[],
bounds: { maxCount: number; maxChars: number },
): void;
abstract deleteBySession(sessionId: string): void;
abstract deleteByProject(projectId: string): void;
abstract deleteByAgent(projectId: string, agentId: string): void;
}Contract Topology
Static AST wiring across @Module / @Provide / @UseMembers (5)
list
list(userId: string): StoredDraft[]@paramuserId
string@returns
StoredDraft[]apply
apply(userId: string, writes: readonly DraftWrite[], bounds: { maxCount: number; maxChars: number }): voidApplies the writes together, then drops the user's least recently written drafts outside
them until the user holds at most maxCount drafts of at most maxChars characters in all.
@paramuserId
string@paramwrites
readonly DraftWrite[]@parambounds
{ maxCount: number; maxChars: number }@returns
voiddeleteBySession
deleteBySession(sessionId: string): voidEvery user's drafts of one Session (the Session is being deleted).
@paramsessionId
string@returns
voiddeleteByProject
deleteByProject(projectId: string): voidEvery user's drafts of one Project and of the Sessions indexed under it (the Project is being deleted).
@paramprojectId
string@returns
voiddeleteByAgent
deleteByAgent(projectId: string, agentId: string): voidEvery user's drafts of the Sessions indexed under one Agent (the Agent is being deleted).
@paramprojectId
string@paramagentId
string@returns
void