import { APIResource } from "../../../core/resource.js"; import { PagePromise, SinglePage } from "../../../core/pagination.js"; import { type Uploadable } from "../../../core/uploads.js"; import { RequestOptions } from "../../../internal/request-options.js"; export declare class BaseQuery extends APIResource { static readonly _key: readonly ['logs', 'logExplorer', 'query']; /** * Run a SQL query against account or zone-level datasets. * * Timestamp fields are RFC3339 strings. Filter with: WHERE {timestamp_field} >= * now() - INTERVAL '30' DAY WHERE {timestamp_field} >= '2026-04-01T00:00:00Z' * WHERE {timestamp_field} BETWEEN '2026-04-01T00:00:00Z' AND * '2026-04-30T23:59:59Z' * * Check /account or zones/{account or zone_id}/logs/explorer/datasets to see * enabled account or zone level datasets. Zone-level datasets will not appear * here. Check /account or zones/{account or * zone_id}/logs/explorer/datasets/available for the schemas, and the name of the * timestamp fields. * * For zone-level datasets use the zone-scoped endpoint: POST * /zones/{zone_id}/logs/explorer/query/sql * * For more information about the datasets, and the meaning of each field, check * out https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/ * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const querySqlResponse of client.logs.logExplorer.query.sql( * fs.createReadStream('path/to/file'), * { account_id: 'account_id' }, * )) { * // ... * } * ``` */ sql(body: Uploadable, params: QuerySqlParams, options?: RequestOptions): PagePromise; } export declare class Query extends BaseQuery { } export type QuerySqlResponsesSinglePage = SinglePage; export type QuerySqlResponse = { [key: string]: unknown; }; export interface QuerySqlParams { /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the * Zone ID. */ account_id?: string; /** * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the * Account ID. */ zone_id?: string; } export declare namespace Query { export { type QuerySqlResponse as QuerySqlResponse, type QuerySqlResponsesSinglePage as QuerySqlResponsesSinglePage, type QuerySqlParams as QuerySqlParams, }; } //# sourceMappingURL=query.d.ts.map