import type { Context } from '@temporalio/activity';
import type { NangoConnection } from '../../models/Connection.js';
import type { Metadata } from '@nangohq/types';
import type { SyncType, IntegrationServiceInterface } from '../../models/Sync.js';
import type { ServiceResponse } from '../../models/Generic.js';
import type { LogContext, LogContextGetter } from '@nangohq/logs';
import type { NangoProps } from '../../sdk/sync.js';
import type { UpsertSummary } from '@nangohq/records';
interface BigQueryClientInterface {
    insert(row: RunScriptRow): Promise<void>;
}
interface RunScriptRow {
    executionType: string;
    internalConnectionId: number | undefined;
    connectionId: string;
    accountId: number | undefined;
    accountName: string;
    scriptName: string;
    scriptType: string;
    environmentId: number;
    environmentName: string;
    providerConfigKey: string;
    status: string;
    syncId: string;
    content: string;
    runTimeInSeconds: number;
    createdAt: number;
}
export interface SyncRunConfig {
    bigQueryClient?: BigQueryClientInterface;
    integrationService: IntegrationServiceInterface;
    recordsService: RecordsServiceInterface;
    dryRunService?: NangoProps['dryRunService'];
    logContextGetter: LogContextGetter;
    writeToDb: boolean;
    isAction?: boolean;
    isInvokedImmediately?: boolean;
    isWebhook?: boolean;
    nangoConnection: NangoConnection;
    syncName: string;
    syncType: SyncType;
    syncId?: string;
    syncJobId?: number;
    activityLogId?: number | undefined;
    provider?: string;
    loadLocation?: string;
    debug?: boolean;
    input?: object;
    logMessages?: {
        counts: {
            updated: number;
            added: number;
            deleted: number;
        };
        messages: unknown[];
    } | undefined;
    stubbedMetadata?: Metadata | undefined;
    accountName?: string;
    environmentName?: string;
    temporalContext?: Context;
}
export interface RecordsServiceInterface {
    markNonCurrentGenerationRecordsAsDeleted({ connectionId, model, syncId, generation }: {
        connectionId: number;
        model: string;
        syncId: string;
        generation: number;
    }): Promise<string[]>;
}
export default class SyncRun {
    bigQueryClient?: BigQueryClientInterface;
    integrationService: IntegrationServiceInterface;
    recordsService: RecordsServiceInterface;
    dryRunService?: NangoProps['dryRunService'];
    logContextGetter: LogContextGetter;
    writeToDb: boolean;
    isAction: boolean;
    isInvokedImmediately: boolean;
    nangoConnection: NangoConnection;
    syncName: string;
    syncType: SyncType;
    syncId?: string;
    syncJobId?: number;
    activityLogId?: number;
    provider?: string;
    loadLocation?: string;
    debug?: boolean;
    input?: object;
    logMessages?: {
        counts: {
            updated: number;
            added: number;
            deleted: number;
        };
        messages: unknown[];
    } | undefined;
    stubbedMetadata?: Metadata | undefined;
    accountName?: string;
    environmentName?: string;
    temporalContext?: Context;
    isWebhook: boolean;
    logCtx?: LogContext;
    constructor(config: SyncRunConfig);
    cancel(): Promise<ServiceResponse<boolean>>;
    run(optionalLastSyncDate?: Date | null, bypassEnvironment?: boolean, optionalSecretKey?: string, optionalHost?: string): Promise<ServiceResponse<boolean | object>>;
    finishFlow(models: string[], syncStartDate: Date, version: string, totalRunTime: number, trackDeletes?: boolean): Promise<void>;
    reportResults(model: string, responseResults: UpsertSummary, index: number, numberOfModels: number, syncStartDate: Date, version: string, totalRunTime: number): Promise<void>;
    reportFailureForResults({ content, runTime, isCancel }: {
        content: string;
        runTime: number;
        isCancel?: true;
    }): Promise<void>;
    private determineExecutionType;
    private determineErrorType;
}
export {};
