n8n
Version:
n8n Workflow Automation Tool
25 lines (24 loc) • 1.14 kB
TypeScript
import type { InstanceAiEvent } from '@n8n/api-types';
import type { StoredEvent } from '@n8n/instance-ai';
import { DataSource, Repository } from '@n8n/typeorm';
import { InstanceAiEventLogEntry } from '../entities/instance-ai-event-log-entry.entity';
export interface UnfinishedRun {
threadId: string;
runId: string;
}
export declare class InstanceAiEventLogRepository extends Repository<InstanceAiEventLogEntry> {
constructor(dataSource: DataSource);
maxSeq(threadId: string): Promise<number>;
appendBatch(threadId: string, firstSeq: number, events: InstanceAiEvent[]): Promise<number>;
payloadAt(threadId: string, seq: number): Promise<string | null>;
getAfter(threadId: string, afterSeq: number): Promise<StoredEvent[]>;
getForRuns(threadId: string, runIds: string[]): Promise<InstanceAiEvent[]>;
getForThread(threadId: string): Promise<Array<{
runId: string;
createdAt: Date;
event: InstanceAiEvent;
}>>;
lastFactAt(threadId: string, runId: string): Promise<Date | null>;
findUnfinishedRuns(threadId?: string): Promise<UnfinishedRun[]>;
private toEvent;
}