export interface CreateScheduleJobParams {
    name?: string;
    type: number;
    projectId: string;
    workspaceId?: string;
    applicationId?: string;
    libraryId?: string;
    securityConfigId?: string;
    startDate: string;
    runTime?: string;
    timeZone?: string;
    repeatEvery: number;
    repeatUnit: string;
    repeatOnDays?: number[];
    endsOn: string;
    endsDate?: string;
    endsAfter?: number;
}
export interface UpdateScheduleJobParams {
    name?: string;
    applicationId?: string;
    libraryId?: string;
    securityConfigId?: string;
    startDate?: string;
    runTime?: string;
    timeZone?: string;
    repeatEvery?: number;
    repeatUnit?: string;
    repeatOnDays?: number[];
    endsOn?: string;
    endsDate?: string;
    endsAfter?: number;
    status?: number;
}
export interface ScheduleJobListParams {
    projectId: string;
    workspaceId?: string;
    page?: number;
    limit?: number;
    search?: string;
    status?: number;
    type?: number;
    archived_data_required?: boolean;
}
export declare class ScheduleJobsService {
    /**
     * Compute nextRunAt for an existing DB row.
     * This is used by cron fallback paths (no testRunId) and internal recalculations.
     */
    computeNextRunAtForJob(job: {
        startDate: Date | null;
        repeatEvery: number | null;
        repeatUnit: string | null;
        repeatOnDays?: unknown;
        runTime?: string | null;
        timeZone?: string | null;
        endsOn?: string | null;
        endsDate?: Date | null;
    }, fromUtc: Date): Date | null;
    /**
     * Mark active schedule jobs as completed when their endsDate is in the past.
     */
    markEndedScheduleJobsAsCompleted(): Promise<number>;
    /**
     * Calculate next run time based on schedule
     */
    calculateNextRun(startDate: Date, repeatEvery: number, repeatUnit: string, lastRun?: Date | null): Date | null;
    /**
     * Create a new schedule job
     */
    createScheduleJob(params: CreateScheduleJobParams): Promise<{
        type: number;
        status: number;
        id: string;
        applicationId: string | null;
        name: string | null;
        securityConfigId: string | null;
        workspaceId: string | null;
        projectId: string;
        startDate: Date | null;
        createdAt: Date;
        updatedAt: Date;
        is_archived: boolean;
        libraryId: string | null;
        runTime: string | null;
        timeZone: string | null;
        repeatEvery: number | null;
        repeatUnit: string | null;
        repeatOnDays: number[] | null;
        endsOn: string | null;
        endsDate: Date | null;
        endsAfter: number | null;
        lastScheduleJobRun: Date | null;
        nextRunAt: Date | null;
    }>;
    /**
     * Get schedule job by ID
     */
    getScheduleJobById(scheduleJobId: string, projectId: string): Promise<{
        testRuns: {
            id: string;
            createdAt: Date;
            status: string;
            totalTestCase: number | null;
        }[];
        id: string;
        name: string | null;
        type: number;
        status: number;
        projectId: string;
        workspaceId: string | null;
        applicationId: string | null;
        libraryId: string | null;
        securityConfigId: string | null;
        startDate: Date | null;
        runTime: string | null;
        timeZone: string | null;
        repeatEvery: number | null;
        repeatUnit: string | null;
        repeatOnDays: number[] | null;
        endsOn: string | null;
        endsDate: Date | null;
        endsAfter: number | null;
        lastScheduleJobRun: Date | null;
        nextRunAt: Date | null;
        createdAt: Date;
        updatedAt: Date;
        is_archived: boolean;
        application: {
            id: string;
            name: string | null;
        } | null;
        library: {
            id: string;
            name: string | null;
        } | null;
        securityConfig: {
            id: string;
            name: string;
        } | null;
    } | null>;
    /**
     * Get list of schedule jobs with pagination
     */
    getScheduleJobsList(params: ScheduleJobListParams): Promise<{
        data: {
            testsRun: number;
            id: string;
            name: string | null;
            type: number;
            status: number;
            applicationId: string | null;
            securityConfig: string | null;
            startDate: Date | null;
            repeatEvery: number | null;
            repeatUnit: string | null;
            lastScheduleJobRun: Date | null;
            nextRunAt: Date | null;
            createdAt: Date;
            updatedAt: Date;
            is_archived: boolean;
            application: string | null;
            promptLibrary: string | null;
        }[];
        pagination: {
            page: number;
            limit: number;
            total: number;
            totalPages: number;
        };
    }>;
    /**
     * Update schedule job
     */
    updateScheduleJob(scheduleJobId: string, projectId: string, params: UpdateScheduleJobParams): Promise<{
        id: string;
        createdAt: Date;
        updatedAt: Date;
        name: string | null;
        type: number;
        status: number;
        projectId: string;
        workspaceId: string | null;
        applicationId: string | null;
        libraryId: string | null;
        securityConfigId: string | null;
        startDate: Date | null;
        runTime: string | null;
        timeZone: string | null;
        repeatEvery: number | null;
        repeatUnit: string | null;
        repeatOnDays: number[] | null;
        endsOn: string | null;
        endsDate: Date | null;
        endsAfter: number | null;
        lastScheduleJobRun: Date | null;
        nextRunAt: Date | null;
        is_archived: boolean;
    } | null>;
    /**
     * Archive schedule job
     */
    archiveScheduleJob(scheduleJobId: string, projectId: string): Promise<{
        id: string;
        createdAt: Date;
        updatedAt: Date;
        name: string | null;
        type: number;
        status: number;
        projectId: string;
        workspaceId: string | null;
        applicationId: string | null;
        libraryId: string | null;
        securityConfigId: string | null;
        startDate: Date | null;
        runTime: string | null;
        timeZone: string | null;
        repeatEvery: number | null;
        repeatUnit: string | null;
        repeatOnDays: number[] | null;
        endsOn: string | null;
        endsDate: Date | null;
        endsAfter: number | null;
        lastScheduleJobRun: Date | null;
        nextRunAt: Date | null;
        is_archived: boolean;
    }>;
    /**
     * Delete schedule job
     */
    deleteScheduleJob(scheduleJobId: string, projectId: string): Promise<{
        success: boolean;
    }>;
    /**
     * Get schedule jobs that are due to run
     * A job is due if:
     * 1. startDate is today AND nextRunAt is not today (or null)
     * 2. It's been repeatEvery units since last run (or startDate if no last run) AND nextRunAt is not set or is in the past
     */
    getDueScheduleJobs(): Promise<{
        testRunCount: number;
        id: string;
        name: string | null;
        type: number;
        status: number;
        projectId: string;
        workspaceId: string | null;
        applicationId: string | null;
        libraryId: string | null;
        securityConfigId: string | null;
        startDate: Date | null;
        runTime: string | null;
        timeZone: string | null;
        repeatEvery: number | null;
        repeatUnit: string | null;
        repeatOnDays: number[] | null;
        endsOn: string | null;
        endsDate: Date | null;
        endsAfter: number | null;
        lastScheduleJobRun: Date | null;
        nextRunAt: Date | null;
        createdAt: Date;
        updatedAt: Date;
        is_archived: boolean;
    }[]>;
    /**
     * Update last run time and calculate next run
     */
    updateLastRun(scheduleJobId: string, testRunId: string): Promise<{
        success: boolean;
        nextRunAt: Date | null;
        status: any;
    }>;
    /**
     * Calculate test run stats from eval results
     */
    private calculateTestRunStats;
    /**
     * Get evaluations for a schedule job
     */
    getScheduleJobEvaluations(scheduleJobId: string, page?: number, limit?: number): Promise<{
        data: {
            stats: null;
            id: string;
            createdAt: Date;
            status: string;
            totalTestCase: number | null;
            type: string | null;
            libraryId: string | null;
            securityConfigId: string | null;
            promptLibrary: {
                id: string;
                name: string | null;
            } | null;
            securityConfig: {
                id: string;
                name: string;
            } | null;
        }[];
        pagination: {
            page: number;
            limit: number;
            total: number;
            totalPages: number;
        };
    }>;
}
export declare const scheduleJobsService: ScheduleJobsService;
//# sourceMappingURL=scheduleJobsService.d.ts.map