import type { JsonObject, ToolDef } from "@fabric-harness/sdk"; import type { JobsClient } from "@databricks/sdk-jobs/v2"; export type DatabricksJobsAuthoringClient = Pick; export interface DatabricksNotebookTaskSpec { notebookPath: string; baseParameters?: JsonObject; source?: "WORKSPACE" | "GIT"; } export interface DatabricksSparkJarTaskSpec { mainClassName: string; parameters?: string[]; } export interface DatabricksPythonWheelTaskSpec { packageName: string; entryPoint: string; parameters?: string[]; namedParameters?: Record; } export interface DatabricksDbtTaskSpec { commands: string[]; warehouseId?: string; catalog?: string; schema?: string; } export interface DatabricksSqlTaskSpec { warehouseId: string; queryId?: string; filePath?: string; parameters?: Record; } export interface DatabricksNewClusterSpec { policyId: string; sparkVersion: string; nodeTypeId: string; numWorkers: number; customTags?: Record; } interface DatabricksTaskBase { taskKey: string; dependsOn?: string[]; existingClusterId?: string; newCluster?: DatabricksNewClusterSpec; } export type DatabricksJobTask = (DatabricksTaskBase & { notebook: DatabricksNotebookTaskSpec; }) | (DatabricksTaskBase & { sparkJar: DatabricksSparkJarTaskSpec; }) | (DatabricksTaskBase & { pythonWheel: DatabricksPythonWheelTaskSpec; }) | (DatabricksTaskBase & { dbt: DatabricksDbtTaskSpec; }) | (DatabricksTaskBase & { pipeline: { pipelineId: string; fullRefresh?: boolean; }; }) | (DatabricksTaskBase & { sql: DatabricksSqlTaskSpec; }); export interface DatabricksJobSchedule { quartzCronExpression: string; timezoneId: string; pauseStatus?: "PAUSED" | "UNPAUSED"; } export interface DatabricksJobSpec { name: string; tasks: DatabricksJobTask[]; description?: string; maxConcurrentRuns?: number; timeoutSeconds?: number; schedule?: DatabricksJobSchedule; tags?: Record; serverlessPerformance?: "STANDARD" | "PERFORMANCE_OPTIMIZED"; } export type DatabricksJobField = "name" | "description" | "tasks" | "schedule" | "timeout_seconds" | "max_concurrent_runs" | "tags"; export interface DatabricksJobUpdate { set?: Partial; remove?: DatabricksJobField[]; } export interface DatabricksComputePolicy { allowedPolicyIds?: string[]; /** Existing all-purpose clusters are denied unless explicitly allowlisted. */ allowedExistingClusterIds?: string[]; maxWorkers?: number; maxConcurrentRuns?: number; maxRunTimeoutSeconds?: number; allowedNodeTypes?: string[]; allowedRuntimeVersions?: string[]; requiredTags?: Record; schedules?: boolean; serverlessPerformance?: "STANDARD" | "PERFORMANCE_OPTIMIZED"; } export declare function validateDatabricksComputePolicy(policy: DatabricksComputePolicy): void; export interface DatabricksCreateJobOptions { ifExists?: "error" | "reuse"; } export interface DatabricksCreatedJob { jobId: number; reused: boolean; fingerprint: string; } export declare class DatabricksJobsAuthoring { private readonly client; private readonly computePolicy; constructor(client: DatabricksJobsAuthoringClient, computePolicy?: DatabricksComputePolicy); createJob(spec: DatabricksJobSpec, options?: DatabricksCreateJobOptions): Promise; getJob(jobIdValue: number): Promise>; listJobs(options?: { name?: string; limit?: number; pageToken?: string; expandTasks?: boolean; }): Promise<{ jobs: Record[]; nextPageToken?: string; }>; updateJob(jobIdValue: number, update: DatabricksJobUpdate): Promise; deleteJob(jobIdValue: number): Promise; repairRun(runId: number, rerunTasks?: string[]): Promise<{ repairId?: number; }>; submitRun(spec: Omit & { runName: string; idempotencyToken?: string; }): Promise<{ runId: number; }>; } export declare function databricksJobsAuthoring(client: DatabricksJobsAuthoringClient, computePolicy?: DatabricksComputePolicy): DatabricksJobsAuthoring; export declare function databricksJobsAuthoringTools(client: DatabricksJobsAuthoringClient, computePolicy?: DatabricksComputePolicy, options?: { oneOffCompute?: boolean; }): ToolDef[]; export declare function validateJobSpec(spec: DatabricksJobSpec, policy: DatabricksComputePolicy): void; export {}; //# sourceMappingURL=jobs-authoring.d.ts.map