n8n
Version:
n8n Workflow Automation Tool
19 lines (18 loc) • 1.01 kB
TypeScript
import { DataSource, Repository } from '@n8n/typeorm';
import { AgentExecutionThread } from '../entities/agent-execution-thread.entity';
export interface AgentExecutionThreadPage {
threads: AgentExecutionThread[];
nextCursor: string | null;
}
export declare class AgentExecutionThreadRepository extends Repository<AgentExecutionThread> {
constructor(dataSource: DataSource);
findOrCreate(threadId: string, agentId: string, agentName: string, projectId: string): Promise<{
thread: AgentExecutionThread;
created: boolean;
}>;
private findOrCreateInSerializableTransaction;
findByProjectIdPaginated(projectId: string, limit: number, cursor?: string, agentId?: string): Promise<AgentExecutionThreadPage>;
bumpUpdatedAt(threadId: string): Promise<void>;
incrementUsage(threadId: string, promptTokens: number, completionTokens: number, cost: number, duration: number): Promise<void>;
deleteByIdAndProjectId(threadId: string, projectId: string): Promise<boolean>;
}