import { type WeekDay } from '../utils/timeFrames';
import { type ProjectGroupAccess } from './projectGroupAccess';
export declare enum ProjectType {
    DEFAULT = "DEFAULT",
    PREVIEW = "PREVIEW"
}
export declare enum DbtProjectType {
    DBT = "dbt",
    DBT_CLOUD_IDE = "dbt_cloud_ide",
    GITHUB = "github",
    GITLAB = "gitlab",
    BITBUCKET = "bitbucket",
    AZURE_DEVOPS = "azure_devops",
    NONE = "none",
    MANIFEST = "manifest"
}
export declare enum WarehouseTypes {
    BIGQUERY = "bigquery",
    POSTGRES = "postgres",
    REDSHIFT = "redshift",
    SNOWFLAKE = "snowflake",
    DATABRICKS = "databricks",
    TRINO = "trino",
    CLICKHOUSE = "clickhouse"
}
export type SshTunnelConfiguration = {
    useSshTunnel?: boolean;
    sshTunnelHost?: string;
    sshTunnelPort?: number;
    sshTunnelUser?: string;
    sshTunnelPublicKey?: string;
    sshTunnelPrivateKey?: string;
};
export declare enum BigqueryAuthenticationType {
    SSO = "sso",
    PRIVATE_KEY = "private_key",
    ADC = "adc"
}
export type CreateBigqueryCredentials = {
    type: WarehouseTypes.BIGQUERY;
    project: string;
    dataset: string;
    threads?: number;
    timeoutSeconds: number | undefined;
    priority: 'interactive' | 'batch' | undefined;
    authenticationType?: BigqueryAuthenticationType;
    keyfileContents: Record<string, string>;
    requireUserCredentials?: boolean;
    retries: number | undefined;
    location: string | undefined;
    maximumBytesBilled: number | undefined;
    startOfWeek?: WeekDay | null;
    executionProject?: string;
};
export declare const sensitiveCredentialsFieldNames: readonly ["user", "password", "keyfileContents", "personalAccessToken", "privateKey", "privateKeyPass", "sshTunnelPrivateKey", "sslcert", "sslkey", "sslrootcert", "token", "refreshToken", "oauthClientId", "oauthClientSecret"];
export type SensitiveCredentialsFieldNames = (typeof sensitiveCredentialsFieldNames)[number];
export type BigqueryCredentials = Omit<CreateBigqueryCredentials, SensitiveCredentialsFieldNames>;
export declare enum DatabricksAuthenticationType {
    PERSONAL_ACCESS_TOKEN = "personal_access_token",
    OAUTH_M2M = "oauth_m2m",
    OAUTH_U2M = "oauth_u2m"
}
export type CreateDatabricksCredentials = {
    type: WarehouseTypes.DATABRICKS;
    catalog?: string;
    database: string;
    serverHostName: string;
    httpPath: string;
    authenticationType?: DatabricksAuthenticationType;
    personalAccessToken?: string;
    refreshToken?: string;
    token?: string;
    oauthClientId?: string;
    oauthClientSecret?: string;
    requireUserCredentials?: boolean;
    startOfWeek?: WeekDay | null;
    compute?: Array<{
        name: string;
        httpPath: string;
    }>;
};
export type DatabricksCredentials = Omit<CreateDatabricksCredentials, SensitiveCredentialsFieldNames>;
export type SslConfiguration = {
    sslmode?: string;
    sslcertFileName?: string;
    sslcert?: string | null;
    sslkeyFileName?: string;
    sslkey?: string | null;
    sslrootcertFileName?: string;
    sslrootcert?: string | null;
};
export type CreatePostgresCredentials = SshTunnelConfiguration & SslConfiguration & {
    type: WarehouseTypes.POSTGRES;
    host: string;
    user: string;
    password: string;
    requireUserCredentials?: boolean;
    port: number;
    dbname: string;
    schema: string;
    threads?: number;
    keepalivesIdle?: number;
    searchPath?: string;
    role?: string;
    startOfWeek?: WeekDay | null;
    timeoutSeconds?: number;
};
export type PostgresCredentials = Omit<CreatePostgresCredentials, SensitiveCredentialsFieldNames>;
export type CreateTrinoCredentials = {
    type: WarehouseTypes.TRINO;
    host: string;
    user: string;
    password: string;
    requireUserCredentials?: boolean;
    port: number;
    dbname: string;
    schema: string;
    http_scheme: string;
    source?: string;
    startOfWeek?: WeekDay | null;
};
export type TrinoCredentials = Omit<CreateTrinoCredentials, SensitiveCredentialsFieldNames>;
export type CreateClickhouseCredentials = {
    type: WarehouseTypes.CLICKHOUSE;
    host: string;
    user: string;
    password: string;
    requireUserCredentials?: boolean;
    port: number;
    schema: string;
    secure?: boolean;
    startOfWeek?: WeekDay | null;
    timeoutSeconds?: number;
};
export type ClickhouseCredentials = Omit<CreateClickhouseCredentials, SensitiveCredentialsFieldNames>;
export type CreateRedshiftCredentials = SshTunnelConfiguration & {
    type: WarehouseTypes.REDSHIFT;
    host: string;
    user: string;
    password: string;
    requireUserCredentials?: boolean;
    port: number;
    dbname: string;
    schema: string;
    threads?: number;
    keepalivesIdle?: number;
    sslmode?: string;
    ra3Node?: boolean;
    startOfWeek?: WeekDay | null;
    timeoutSeconds?: number;
};
export type RedshiftCredentials = Omit<CreateRedshiftCredentials, SensitiveCredentialsFieldNames>;
export declare enum SnowflakeAuthenticationType {
    PASSWORD = "password",
    PRIVATE_KEY = "private_key",
    SSO = "sso",
    EXTERNAL_BROWSER = "external_browser"
}
export type CreateSnowflakeCredentials = {
    type: WarehouseTypes.SNOWFLAKE;
    account: string;
    user: string;
    password?: string;
    requireUserCredentials?: boolean;
    privateKey?: string;
    privateKeyPass?: string;
    authenticationType?: SnowflakeAuthenticationType;
    refreshToken?: string;
    token?: string;
    role?: string;
    database: string;
    warehouse: string;
    schema: string;
    threads?: number;
    clientSessionKeepAlive?: boolean;
    queryTag?: string;
    accessUrl?: string;
    startOfWeek?: WeekDay | null;
    quotedIdentifiersIgnoreCase?: boolean;
    disableTimestampConversion?: boolean;
    override?: boolean;
    organizationWarehouseCredentialsUuid?: string;
};
export type SnowflakeCredentials = Omit<CreateSnowflakeCredentials, SensitiveCredentialsFieldNames>;
export type CreateWarehouseCredentials = CreateRedshiftCredentials | CreateBigqueryCredentials | CreatePostgresCredentials | CreateSnowflakeCredentials | CreateDatabricksCredentials | CreateTrinoCredentials | CreateClickhouseCredentials;
export type WarehouseCredentials = SnowflakeCredentials | RedshiftCredentials | PostgresCredentials | BigqueryCredentials | DatabricksCredentials | TrinoCredentials | ClickhouseCredentials;
export type CreatePostgresLikeCredentials = CreateRedshiftCredentials | CreatePostgresCredentials;
export declare const maybeOverrideWarehouseConnection: <T extends WarehouseCredentials>(connection: T, overrides: {
    schema?: string;
}) => T;
/**
 * Merges new warehouse credentials with base credentials, preserving advanced settings
 * like requireUserCredentials from the base credentials.
 *
 * This is useful when creating preview projects where we want to use new connection details
 * (like from dbt profiles) but preserve advanced configuration from the parent project.
 */
export declare const mergeWarehouseCredentials: <T extends CreateWarehouseCredentials>(baseCredentials: T, newCredentials: T) => T;
export interface DbtProjectConfigBase {
    type: DbtProjectType;
}
export type DbtProjectEnvironmentVariable = {
    key: string;
    value: string;
};
export declare enum SupportedDbtVersions {
    V1_4 = "v1.4",
    V1_5 = "v1.5",
    V1_6 = "v1.6",
    V1_7 = "v1.7",
    V1_8 = "v1.8",
    V1_9 = "v1.9",
    V1_10 = "v1.10"
}
export declare enum DbtVersionOptionLatest {
    LATEST = "latest"
}
export declare function isDbtVersion110OrHigher(version: SupportedDbtVersions | undefined): boolean;
export type DbtVersionOption = SupportedDbtVersions | DbtVersionOptionLatest;
export declare const getLatestSupportDbtVersion: () => SupportedDbtVersions;
export declare const DefaultSupportedDbtVersion = DbtVersionOptionLatest.LATEST;
export interface DbtProjectCompilerBase extends DbtProjectConfigBase {
    target?: string;
    environment?: DbtProjectEnvironmentVariable[];
    selector?: string;
}
export interface DbtNoneProjectConfig extends DbtProjectCompilerBase {
    type: DbtProjectType.NONE;
    hideRefreshButton?: boolean;
}
export interface DbtManifestProjectConfig extends DbtProjectConfigBase {
    type: DbtProjectType.MANIFEST;
    manifest: string;
    hideRefreshButton: boolean;
}
export interface DbtLocalProjectConfig extends DbtProjectCompilerBase {
    type: DbtProjectType.DBT;
    profiles_dir?: string;
    project_dir?: string;
}
export interface DbtCloudIDEProjectConfig extends DbtProjectConfigBase {
    type: DbtProjectType.DBT_CLOUD_IDE;
    api_key: string;
    environment_id: string;
    discovery_api_endpoint?: string;
    tags?: string[];
}
export interface DbtGithubProjectConfig extends DbtProjectCompilerBase {
    type: DbtProjectType.GITHUB;
    authorization_method: 'personal_access_token' | 'installation_id';
    personal_access_token?: string;
    installation_id?: string;
    repository: string;
    branch: string;
    project_sub_path: string;
    host_domain?: string;
}
export interface DbtGitlabProjectConfig extends DbtProjectCompilerBase {
    type: DbtProjectType.GITLAB;
    personal_access_token: string;
    repository: string;
    branch: string;
    project_sub_path: string;
    host_domain?: string;
}
export interface DbtBitBucketProjectConfig extends DbtProjectCompilerBase {
    type: DbtProjectType.BITBUCKET;
    username: string;
    personal_access_token: string;
    repository: string;
    branch: string;
    project_sub_path: string;
    host_domain?: string;
}
export interface DbtAzureDevOpsProjectConfig extends DbtProjectCompilerBase {
    type: DbtProjectType.AZURE_DEVOPS;
    personal_access_token: string;
    organization: string;
    project: string;
    repository: string;
    branch: string;
    project_sub_path: string;
}
export type DbtProjectConfig = DbtLocalProjectConfig | DbtCloudIDEProjectConfig | DbtGithubProjectConfig | DbtBitBucketProjectConfig | DbtGitlabProjectConfig | DbtAzureDevOpsProjectConfig | DbtNoneProjectConfig | DbtManifestProjectConfig;
export declare const isGitProjectType: (connection: DbtProjectConfig) => connection is DbtGithubProjectConfig | DbtBitBucketProjectConfig | DbtGitlabProjectConfig;
export declare const maybeOverrideDbtConnection: <T extends DbtProjectConfig>(connection: T, overrides: {
    branch?: string;
    environment?: DbtProjectEnvironmentVariable[];
    manifest?: string;
}) => T;
export type Project = {
    organizationUuid: string;
    projectUuid: string;
    name: string;
    type: ProjectType;
    dbtConnection: DbtProjectConfig;
    warehouseConnection?: WarehouseCredentials;
    pinnedListUuid?: string;
    upstreamProjectUuid?: string;
    dbtVersion: DbtVersionOption;
    schedulerTimezone: string;
    createdByUserUuid: string | null;
    organizationWarehouseCredentialsUuid?: string;
};
export type ProjectSummary = Pick<Project, 'name' | 'projectUuid' | 'organizationUuid' | 'type' | 'upstreamProjectUuid'>;
export type ApiProjectResponse = {
    status: 'ok';
    results: Project;
};
export type ApiGetProjectGroupAccesses = {
    status: 'ok';
    results: ProjectGroupAccess[];
};
export type IdContentMapping = {
    id: number | string;
    newId: number | string;
};
export type PreviewContentMapping = {
    charts: IdContentMapping[];
    chartVersions: IdContentMapping[];
    spaces: IdContentMapping[];
    dashboards: IdContentMapping[];
    dashboardVersions: IdContentMapping[];
    savedSql: IdContentMapping[];
    savedSqlVersions: IdContentMapping[];
    aiAgents: IdContentMapping[];
};
export type UpdateSchedulerSettings = {
    schedulerTimezone: string;
};
//# sourceMappingURL=projects.d.ts.map