import type { OAuth2Client, JWT } from 'google-auth-library'; /** BigQuery 호출에 쓰이는 인증 클라이언트 — 사용자 OAuth 또는 서비스 계정 JWT. */ export type BigQueryAuthClient = OAuth2Client | JWT; /** SELECT / WITH / FROM(파이프 문법) 단일 문장이 아니면 throw — API 를 부르기 전에 막는다. */ export declare function assertSelectOnlyQuery(query: string): void; /** 첫 jobs.query 가 미완료로 돌아왔을 때 getQueryResults 로 더 기다리는 총 시간 상한. */ export declare const QUERY_POLL_BUDGET_MS = 120000; export declare class ReadOnlyQueryError extends Error { } /** * 쿼리가 SELECT 한 문장인지 BigQuery 자신에게 묻는다 (dry run — 과금·실행 없음). * * 도구 설명은 예전부터 "SELECT" 라고 했지만 강제하지 않아서, 같은 도구로 DELETE/DROP/ * MERGE/스크립트가 그대로 실행됐다. 정규식으로 SQL 을 파싱하면 주석·CTE·스크립트에 뚫리므로 * 파서의 판정(`statistics.query.statementType`)을 쓴다. 스크립트는 'SCRIPT' 로 나와 거부된다. */ export declare function assertSelectOnly(auth: BigQueryAuthClient, projectId: string, query: string): Promise; export declare function runQuery(auth: BigQueryAuthClient, projectId: string, query: string, maxResults?: number, options?: { pollBudgetMs?: number; }): Promise<{ jobId?: string | null | undefined; note?: string | undefined; jobComplete: boolean | null | undefined; totalRows: string | null | undefined; schema: { name: string | null | undefined; type: string | null | undefined; }[]; rows: { [k: string]: unknown; }[]; }>; export declare function listDatasets(auth: BigQueryAuthClient, projectId: string): Promise<{ datasetId: string | null | undefined; location: string | undefined; }[]>; export declare function listTables(auth: BigQueryAuthClient, projectId: string, datasetId: string): Promise<{ tableId: string | null | undefined; type: string | undefined; }[]>; export declare function getTableSchema(auth: BigQueryAuthClient, projectId: string, datasetId: string, tableId: string): Promise<{ tableId: string; schema: { name: string | null | undefined; type: string | null | undefined; mode: string | null | undefined; description: string | null | undefined; }[] | undefined; }>;