No JSDoc comment in source yet.
API
@Interface()
export abstract class AgentApi {
abstract get(projectId: string, agentId: string): AgentApiRow | null;
abstract set(projectId: string, agentId: string, patch: AgentApiPatch, at: string): AgentApiRow;
abstract enabledAgents(projectId: string): string[];
abstract listKeys(projectId: string, agentId: string): AgentApiKeyRow[];
abstract insertKey(row: AgentApiKeyRow & { tokenHash: string }): void;
abstract findKeyByHash(tokenHash: string): AgentApiKeyRow | null;
abstract touchKey(keyId: string, at: string): void;
abstract deleteKey(projectId: string, agentId: string, keyId: string): boolean;
abstract deleteByAgent(projectId: string, agentId: string): void;
abstract deleteByProject(projectId: string): void;
}Contract Topology
Static AST wiring across @Module / @Provide / @UseMembers (10)
get
get(projectId: string, agentId: string): AgentApiRow | nullThe Agent's row; null = never configured, which reads as disabled, keyed, allow-all.
@paramprojectId
string@paramagentId
string@returns
AgentApiRow | nullset
set(projectId: string, agentId: string, patch: AgentApiPatch, at: string): AgentApiRowWrites the patch over the stored row (or the defaults) and returns the row as stored.
@paramprojectId
string@paramagentId
string@parampatch
AgentApiPatch@paramat
string@returns
AgentApiRowenabledAgents
enabledAgents(projectId: string): string[]The Project's Agents whose switch is on, in one query (the Agent list's apiEnabled).
@paramprojectId
string@returns
string[]listKeys
listKeys(projectId: string, agentId: string): AgentApiKeyRow[]The Agent's keys, oldest first.
@paramprojectId
string@paramagentId
string@returns
AgentApiKeyRow[]insertKey
insertKey(row: AgentApiKeyRow & { tokenHash: string }): void@paramrow
AgentApiKeyRow & { tokenHash: string }@returns
voidfindKeyByHash
findKeyByHash(tokenHash: string): AgentApiKeyRow | nullThe key whose secret hashes to tokenHash; null when none does.
@paramtokenHash
string@returns
AgentApiKeyRow | nulltouchKey
touchKey(keyId: string, at: string): void@paramkeyId
string@paramat
string@returns
voiddeleteKey
deleteKey(projectId: string, agentId: string, keyId: string): booleanHard delete; false when the Agent has no such key.
@paramprojectId
string@paramagentId
string@paramkeyId
string@returns
booleandeleteByAgent
deleteByAgent(projectId: string, agentId: string): voidDrops the Agent's settings and keys (the Agent was deleted).
@paramprojectId
string@paramagentId
string@returns
voiddeleteByProject
deleteByProject(projectId: string): voidDrops every settings row and key of the Project (the Project was deleted).
@paramprojectId
string@returns
void