// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, CloudflarePaginatedProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { cloudflarePaginate, ResultInfo } from "../pagination.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { allowOutOfRegionAccess: "allow_out_of_region_access", createdAt: "created_at", datasetId: "dataset_id", objectId: "object_id", objectType: "object_type", timestampField: "timestamp_field", updatedAt: "updated_at", }; export class CmbConfigNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("CmbConfigNotFound", { code: S.Number, message: S.String, }), [{ status: 404 }], ) {} export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export class LogsControlNotAuthorized extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "LogsControlNotAuthorized", { code: S.Number, message: S.String, }, ), [{ code: 10000, message: { includes: "Unauthorized" } }], ) {} export interface CreateControlCmbConfigRequest { /** Identifier. */ accountId: string; /** Allow out of region access */ allowOutOfRegionAccess?: boolean; /** Name of the region. */ regions?: string; } export const CreateControlCmbConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), allowOutOfRegionAccess: S.optional( S.Boolean.pipe(T.Body("allow_out_of_region_access")), ), regions: S.optional(S.String), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/logs/control/cmb/config", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateControlCmbConfigRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateControlCmbConfigResponse { /** Allow out of region access */ allowOutOfRegionAccess?: boolean | null; /** Name of the region. */ regions?: string | null; } export const CreateControlCmbConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ allowOutOfRegionAccess: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_out_of_region_access")), ), regions: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateControlCmbConfigResponse", }) as any as S.Schema; export interface CreateControlRetentionRequest { /** Identifier. */ zoneId: string; /** The log retention flag for Logpull API. */ flag?: boolean; } export const CreateControlRetentionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), flag: S.optional(S.Boolean), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/logs/control/retention/flag", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateControlRetentionRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateControlRetentionResponse { /** The log retention flag for Logpull API. */ flag?: boolean | null; } export const CreateControlRetentionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ flag: S.optional(S.NullOr(S.Boolean)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateControlRetentionResponse", }) as any as S.Schema; export interface LogExplorerDatasetsCreateRequestFieldsItem { /** Whether the API includes this field in log ingest. */ enabled: boolean; /** Field name in lowercase. */ name: string; } export const LogExplorerDatasetsCreateRequestFieldsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ enabled: S.Boolean, name: S.String, }), ).annotate({ identifier: "LogExplorerDatasetsCreateRequestFieldsItem", }) as any as S.Schema; export type LogExplorerDatasetsCreateRequestFieldsList = Array; export const LogExplorerDatasetsCreateRequestFieldsList = /*@__PURE__*/ S.Array( LogExplorerDatasetsCreateRequestFieldsItem, ) as any as S.Schema; export interface CreateLogExplorerDatasetForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; /** Dataset type name to create (e.g. `http_requests`). */ dataset: string; /** Controls which fields the API ingests. Defaults to all available */ fields?: LogExplorerDatasetsCreateRequestFieldsList; } export const CreateLogExplorerDatasetForAccountRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), dataset: S.String, fields: S.optional(LogExplorerDatasetsCreateRequestFieldsList), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/logs/explorer/datasets", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateLogExplorerDatasetForAccountRequest", }) as any as S.Schema; export type LogExplorerDatasetsCreateResponseObjectType = "account" | "zone"; export const LogExplorerDatasetsCreateResponseObjectType = /*@__PURE__*/ S.String; export type LogExplorerDatasetsCreateResponseFieldsItem = LogExplorerDatasetsCreateRequestFieldsItem; export const LogExplorerDatasetsCreateResponseFieldsItem = LogExplorerDatasetsCreateRequestFieldsItem; export type LogExplorerDatasetsCreateResponseFieldsList = Array; export const LogExplorerDatasetsCreateResponseFieldsList = /*@__PURE__*/ S.Array( LogExplorerDatasetsCreateRequestFieldsItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateLogExplorerDatasetResponse { /** RFC3339 timestamp recording when the API created this dataset. */ createdAt: string; /** Dataset type name (e.g. `http_requests`). */ dataset: string; /** Unique dataset ID. */ datasetId: string; /** Whether log ingest is currently active for this dataset. */ enabled: boolean; /** Public ID of the account or zone that owns this dataset. */ objectId: string; /** Whether this dataset belongs to an account or a zone. */ objectType: LogExplorerDatasetsCreateResponseObjectType; /** RFC3339 timestamp recording when the API last updated this dataset. */ updatedAt: string; /** The field configuration for this dataset. */ fields?: LogExplorerDatasetsCreateResponseFieldsList | null; } export const CreateLogExplorerDatasetResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ createdAt: S.String.pipe(T.Body("created_at")), dataset: S.String, datasetId: S.String.pipe(T.Body("dataset_id")), enabled: S.Boolean, objectId: S.String.pipe(T.Body("object_id")), objectType: LogExplorerDatasetsCreateResponseObjectType.pipe( T.Body("object_type"), ), updatedAt: S.String.pipe(T.Body("updated_at")), fields: S.optional(S.NullOr(LogExplorerDatasetsCreateResponseFieldsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateLogExplorerDatasetResponse", }) as any as S.Schema; export interface CreateLogExplorerDatasetForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; /** Dataset type name to create (e.g. `http_requests`). */ dataset: string; /** Controls which fields the API ingests. Defaults to all available */ fields?: LogExplorerDatasetsCreateRequestFieldsList; } export const CreateLogExplorerDatasetForZoneRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), dataset: S.String, fields: S.optional(LogExplorerDatasetsCreateRequestFieldsList), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/logs/explorer/datasets", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateLogExplorerDatasetForZoneRequest", }) as any as S.Schema; export interface DeleteControlCmbConfigRequest { /** Identifier. */ accountId: string; } export const DeleteControlCmbConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/logs/control/cmb/config", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteControlCmbConfigRequest", }) as any as S.Schema; export type DeleteControlCmbConfigResponse = unknown; export const DeleteControlCmbConfigResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteControlCmbConfigResponse", }) as any as S.Schema; export interface GetControlCmbConfigRequest { /** Identifier. */ accountId: string; } export const GetControlCmbConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/logs/control/cmb/config", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetControlCmbConfigRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetControlCmbConfigResponse { /** Allow out of region access */ allowOutOfRegionAccess?: boolean | null; /** Name of the region. */ regions?: string | null; } export const GetControlCmbConfigResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ allowOutOfRegionAccess: S.optional( S.NullOr(S.Boolean).pipe(T.Body("allow_out_of_region_access")), ), regions: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetControlCmbConfigResponse", }) as any as S.Schema; export interface GetControlRetentionRequest { /** Identifier. */ zoneId: string; } export const GetControlRetentionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/logs/control/retention/flag", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetControlRetentionRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetControlRetentionResponse { /** The log retention flag for Logpull API. */ flag?: boolean | null; } export const GetControlRetentionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ flag: S.optional(S.NullOr(S.Boolean)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetControlRetentionResponse", }) as any as S.Schema; export interface GetLogExplorerDatasetForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; datasetId: string; } export const GetLogExplorerDatasetForAccountRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), datasetId: S.String.pipe(T.Label("dataset_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/logs/explorer/datasets/{dataset_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetLogExplorerDatasetForAccountRequest", }) as any as S.Schema; export type LogExplorerDatasetsGetResponseObjectType = "account" | "zone"; export const LogExplorerDatasetsGetResponseObjectType = /*@__PURE__*/ S.String; export type LogExplorerDatasetsGetResponseFieldsItem = LogExplorerDatasetsCreateRequestFieldsItem; export const LogExplorerDatasetsGetResponseFieldsItem = LogExplorerDatasetsCreateRequestFieldsItem; export type LogExplorerDatasetsGetResponseFieldsList = Array; export const LogExplorerDatasetsGetResponseFieldsList = /*@__PURE__*/ S.Array( LogExplorerDatasetsCreateRequestFieldsItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetLogExplorerDatasetResponse { /** RFC3339 timestamp recording when the API created this dataset. */ createdAt: string; /** Dataset type name (e.g. `http_requests`). */ dataset: string; /** Unique dataset ID. */ datasetId: string; /** Whether log ingest is currently active for this dataset. */ enabled: boolean; /** Public ID of the account or zone that owns this dataset. */ objectId: string; /** Whether this dataset belongs to an account or a zone. */ objectType: LogExplorerDatasetsGetResponseObjectType; /** RFC3339 timestamp recording when the API last updated this dataset. */ updatedAt: string; /** The field configuration for this dataset. */ fields?: LogExplorerDatasetsGetResponseFieldsList | null; } export const GetLogExplorerDatasetResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ createdAt: S.String.pipe(T.Body("created_at")), dataset: S.String, datasetId: S.String.pipe(T.Body("dataset_id")), enabled: S.Boolean, objectId: S.String.pipe(T.Body("object_id")), objectType: LogExplorerDatasetsGetResponseObjectType.pipe( T.Body("object_type"), ), updatedAt: S.String.pipe(T.Body("updated_at")), fields: S.optional(S.NullOr(LogExplorerDatasetsGetResponseFieldsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetLogExplorerDatasetResponse", }) as any as S.Schema; export interface GetLogExplorerDatasetForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; datasetId: string; } export const GetLogExplorerDatasetForZoneRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), datasetId: S.String.pipe(T.Label("dataset_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/logs/explorer/datasets/{dataset_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetLogExplorerDatasetForZoneRequest", }) as any as S.Schema; export type RayidGetRequestTimestamps = "unix" | "unixnano" | "rfc3339"; export const RayidGetRequestTimestamps = /*@__PURE__*/ S.String; export interface GetRayidRequest { /** Identifier. */ zoneId: string; /** Ray identifier. */ rayId: string; /** The `/received` route by default returns a limited set of fields, and allows customers to override the default field set by specifying individual fields. The reasons for this are: 1. Most customers require only a small subset of fields, but that subset varies from customer to customer; 2. Flat schema is much easier to work with downstream (importing into BigTable etc); 3. Performance (time to process, file size). If `?fields=` is not specified, default field set is returned. This default field set may change at any time. When `?fields=` is provided, each record is returned with the specified fields. `fields` must be specified as a comma separated list without any whitespaces, and all fields must exist. The order in which fields are specified does not matter, and the order of fields in the response is not specified. */ fields?: string; /** By default, timestamps in responses are returned as Unix nanosecond integers. The `?timestamps=` argument can be set to change the format in which response timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns timestamps as strings. */ timestamps?: RayidGetRequestTimestamps | (string & {}); } export const GetRayidRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), rayId: S.String.pipe(T.Label("ray_id")), fields: S.optional(S.String.pipe(T.Query())), timestamps: S.optional(RayidGetRequestTimestamps.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/logs/rayids/{ray_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRayidRequest", }) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface GetRayidResponse {} export const GetRayidResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRayidResponse", }) as any as S.Schema; export type ReceivedGetRequestTimestamps = "unix" | "unixnano" | "rfc3339"; export const ReceivedGetRequestTimestamps = /*@__PURE__*/ S.String; export interface GetReceivedRequest { /** Identifier. */ zoneId: string; /** Sets the (exclusive) end of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to RFC 3339. `end` must be at least five minutes earlier than now and must be later than `start`. Difference between `start` and `end` must be not greater than one hour. */ end: string; /** When `?count=` is provided, the response will contain up to `count` results. Since results are not sorted, you are likely to get different data for repeated requests. `count` must be an integer > 0. */ count?: number; /** The `/received` route by default returns a limited set of fields, and allows customers to override the default field set by specifying individual fields. The reasons for this are: 1. Most customers require only a small subset of fields, but that subset varies from customer to customer; 2. Flat schema is much easier to work with downstream (importing into BigTable etc); 3. Performance (time to process, file size). If `?fields=` is not specified, default field set is returned. This default field set may change at any time. When `?fields=` is provided, each record is returned with the specified fields. `fields` must be specified as a comma separated list without any whitespaces, and all fields must exist. The order in which fields are specified does not matter, and the order of fields in the response is not specified. */ fields?: string; /** When `?sample=` is provided, a sample of matching records is returned. If `sample=0.1` then 10% of records will be returned. Sampling is random: repeated calls will not only return different records, but likely will also vary slightly in number of returned records. When `?count=` is also specified, `count` is applied to the number of returned records, not the sampled records. So, with `sample=0.05` and `count=7`, when there is a total of 100 records available, approximately five will be returned. When there are 1000 records, seven will be returned. When there are 10,000 records, seven will be returned. */ sample?: number; /** Sets the (inclusive) beginning of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to RFC 3339. At this point in time, it cannot exceed a time in the past greater than seven days. */ start?: string; /** By default, timestamps in responses are returned as Unix nanosecond integers. The `?timestamps=` argument can be set to change the format in which response timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns timestamps as strings. */ timestamps?: ReceivedGetRequestTimestamps | (string & {}); } export const GetReceivedRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), end: S.String.pipe(T.Query()), count: S.optional(S.Number.pipe(T.Query())), fields: S.optional(S.String.pipe(T.Query())), sample: S.optional(S.Number.pipe(T.Query())), start: S.optional(S.String.pipe(T.Query())), timestamps: S.optional(ReceivedGetRequestTimestamps.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/logs/received", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetReceivedRequest", }) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface GetReceivedResponse {} export const GetReceivedResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetReceivedResponse", }) as any as S.Schema; export interface GetReceivedFieldRequest { /** Identifier. */ zoneId: string; } export const GetReceivedFieldRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/logs/received/fields", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetReceivedFieldRequest", }) as any as S.Schema; /** Raw response payload (operation does not use the standard v4 result envelope). */ export interface GetReceivedFieldResponse { key?: string | null; } export const GetReceivedFieldResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ key: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetReceivedFieldResponse", }) as any as S.Schema; export interface ListLogExplorerDatasetAvailablesForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; } export const ListLogExplorerDatasetAvailablesForAccountRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/logs/explorer/datasets/available", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLogExplorerDatasetAvailablesForAccountRequest", }) as any as S.Schema; export type LogExplorerDatasetsAvailableListResultItemObjectType = | "account" | "zone"; export const LogExplorerDatasetsAvailableListResultItemObjectType = /*@__PURE__*/ S.String; export type LogExplorerDatasetsAvailableListResultItemSchemaPropertiesMap = { [key: string]: unknown | undefined; }; export const LogExplorerDatasetsAvailableListResultItemSchemaPropertiesMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type LogExplorerDatasetsAvailableListResultItemSchemaRequiredList = Array; export const LogExplorerDatasetsAvailableListResultItemSchemaRequiredList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type LogExplorerDatasetsAvailableListResultItemSchemaType = "object"; export const LogExplorerDatasetsAvailableListResultItemSchemaType = /*@__PURE__*/ S.String; export interface LogExplorerDatasetsAvailableListResultItemSchema { properties?: LogExplorerDatasetsAvailableListResultItemSchemaPropertiesMap | null; required?: LogExplorerDatasetsAvailableListResultItemSchemaRequiredList | null; type?: LogExplorerDatasetsAvailableListResultItemSchemaType | null; } export const LogExplorerDatasetsAvailableListResultItemSchema = /*@__PURE__*/ S.suspend(() => S.Struct({ properties: S.optional( S.NullOr(LogExplorerDatasetsAvailableListResultItemSchemaPropertiesMap), ), required: S.optional( S.NullOr(LogExplorerDatasetsAvailableListResultItemSchemaRequiredList), ), type: S.optional( S.NullOr(LogExplorerDatasetsAvailableListResultItemSchemaType), ), }), ).annotate({ identifier: "LogExplorerDatasetsAvailableListResultItemSchema", }) as any as S.Schema; export interface LogExplorerDatasetsAvailableListResultItem { /** Dataset type name (e.g. `http_requests`). */ dataset: string; /** Whether this dataset type is account-scoped or zone-scoped. */ objectType: LogExplorerDatasetsAvailableListResultItemObjectType; /** JSON Schema that describes the fields this dataset exposes. */ schema: LogExplorerDatasetsAvailableListResultItemSchema; /** The primary timestamp field name for this dataset. */ timestampField: string; } export const LogExplorerDatasetsAvailableListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ dataset: S.String, objectType: LogExplorerDatasetsAvailableListResultItemObjectType.pipe( T.Body("object_type"), ), schema: LogExplorerDatasetsAvailableListResultItemSchema, timestampField: S.String.pipe(T.Body("timestamp_field")), }), ).annotate({ identifier: "LogExplorerDatasetsAvailableListResultItem", }) as any as S.Schema; export type LogExplorerDatasetsAvailableListResultList = Array; export const LogExplorerDatasetsAvailableListResultList = /*@__PURE__*/ S.Array( LogExplorerDatasetsAvailableListResultItem, ) as any as S.Schema; export interface ListLogExplorerDatasetAvailablesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: LogExplorerDatasetsAvailableListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListLogExplorerDatasetAvailablesResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ result: LogExplorerDatasetsAvailableListResultList.pipe( T.EnvelopePayload(), ), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLogExplorerDatasetAvailablesResponse", }) as any as S.Schema; export interface ListLogExplorerDatasetAvailablesForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; } export const ListLogExplorerDatasetAvailablesForZoneRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/logs/explorer/datasets/available", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLogExplorerDatasetAvailablesForZoneRequest", }) as any as S.Schema; export interface ListLogExplorerDatasetsForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; /** Set to true to include zone-scoped datasets belonging to this account. */ includeZones?: boolean; } export const ListLogExplorerDatasetsForAccountRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), includeZones: S.optional(S.Boolean.pipe(T.Query("include_zones"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/logs/explorer/datasets", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLogExplorerDatasetsForAccountRequest", }) as any as S.Schema; export type LogExplorerDatasetsListResultItemObjectType = "account" | "zone"; export const LogExplorerDatasetsListResultItemObjectType = /*@__PURE__*/ S.String; export interface LogExplorerDatasetsListResultItem { /** RFC3339 timestamp recording when the API created this dataset. */ createdAt: string; /** Dataset type name (e.g. `http_requests`). */ dataset: string; /** Unique dataset ID. */ datasetId: string; /** Whether log ingest is currently active for this dataset. */ enabled: boolean; /** Public ID of the account or zone that owns this dataset. */ objectId: string; /** Whether this dataset belongs to an account or a zone. */ objectType: LogExplorerDatasetsListResultItemObjectType; /** RFC3339 timestamp recording when the API last updated this dataset. */ updatedAt: string; } export const LogExplorerDatasetsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ createdAt: S.String.pipe(T.Body("created_at")), dataset: S.String, datasetId: S.String.pipe(T.Body("dataset_id")), enabled: S.Boolean, objectId: S.String.pipe(T.Body("object_id")), objectType: LogExplorerDatasetsListResultItemObjectType.pipe( T.Body("object_type"), ), updatedAt: S.String.pipe(T.Body("updated_at")), }), ).annotate({ identifier: "LogExplorerDatasetsListResultItem", }) as any as S.Schema; export type LogExplorerDatasetsListResultList = Array; export const LogExplorerDatasetsListResultList = /*@__PURE__*/ S.Array( LogExplorerDatasetsListResultItem, ) as any as S.Schema; export interface ListLogExplorerDatasetsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: LogExplorerDatasetsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListLogExplorerDatasetsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: LogExplorerDatasetsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLogExplorerDatasetsResponse", }) as any as S.Schema; export interface ListLogExplorerDatasetsForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; /** Set to true to include zone-scoped datasets belonging to this account. */ includeZones?: boolean; } export const ListLogExplorerDatasetsForZoneRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), includeZones: S.optional(S.Boolean.pipe(T.Query("include_zones"))), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/logs/explorer/datasets", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLogExplorerDatasetsForZoneRequest", }) as any as S.Schema; export interface SqlLogExplorerQueryForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; } export const SqlLogExplorerQueryForAccountRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/logs/explorer/query/sql", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "SqlLogExplorerQueryForAccountRequest", }) as any as S.Schema; export type LogExplorerQuerySqlResultItemMap = { [key: string]: unknown | undefined; }; export const LogExplorerQuerySqlResultItemMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type LogExplorerQuerySqlResultList = Array; export const LogExplorerQuerySqlResultList = /*@__PURE__*/ S.Array( LogExplorerQuerySqlResultItemMap, ) as any as S.Schema; export interface SqlLogExplorerQueryResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: LogExplorerQuerySqlResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const SqlLogExplorerQueryResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: LogExplorerQuerySqlResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "SqlLogExplorerQueryResponse", }) as any as S.Schema; export interface SqlLogExplorerQueryForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; } export const SqlLogExplorerQueryForZoneRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "POST", uri: "/zones/{zone_id}/logs/explorer/query/sql", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "SqlLogExplorerQueryForZoneRequest", }) as any as S.Schema; export type LogExplorerDatasetsUpdateRequestFieldsItem = LogExplorerDatasetsCreateRequestFieldsItem; export const LogExplorerDatasetsUpdateRequestFieldsItem = LogExplorerDatasetsCreateRequestFieldsItem; export type LogExplorerDatasetsUpdateRequestFieldsList = Array; export const LogExplorerDatasetsUpdateRequestFieldsList = /*@__PURE__*/ S.Array( LogExplorerDatasetsCreateRequestFieldsItem, ) as any as S.Schema; export interface UpdateLogExplorerDatasetForAccountRequest { /** The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. */ accountId: string; datasetId: string; /** Whether to enable or disable log ingest for this dataset. */ enabled: boolean; /** Controls which fields the API ingests after the update. Defaults */ fields?: LogExplorerDatasetsUpdateRequestFieldsList; } export const UpdateLogExplorerDatasetForAccountRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), datasetId: S.String.pipe(T.Label("dataset_id")), enabled: S.Boolean, fields: S.optional(LogExplorerDatasetsUpdateRequestFieldsList), }) .pipe( T.Http({ method: "PUT", uri: "/accounts/{account_id}/logs/explorer/datasets/{dataset_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateLogExplorerDatasetForAccountRequest", }) as any as S.Schema; export type LogExplorerDatasetsUpdateResponseObjectType = "account" | "zone"; export const LogExplorerDatasetsUpdateResponseObjectType = /*@__PURE__*/ S.String; export type LogExplorerDatasetsUpdateResponseFieldsItem = LogExplorerDatasetsCreateRequestFieldsItem; export const LogExplorerDatasetsUpdateResponseFieldsItem = LogExplorerDatasetsCreateRequestFieldsItem; export type LogExplorerDatasetsUpdateResponseFieldsList = Array; export const LogExplorerDatasetsUpdateResponseFieldsList = /*@__PURE__*/ S.Array( LogExplorerDatasetsCreateRequestFieldsItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateLogExplorerDatasetResponse { /** RFC3339 timestamp recording when the API created this dataset. */ createdAt: string; /** Dataset type name (e.g. `http_requests`). */ dataset: string; /** Unique dataset ID. */ datasetId: string; /** Whether log ingest is currently active for this dataset. */ enabled: boolean; /** Public ID of the account or zone that owns this dataset. */ objectId: string; /** Whether this dataset belongs to an account or a zone. */ objectType: LogExplorerDatasetsUpdateResponseObjectType; /** RFC3339 timestamp recording when the API last updated this dataset. */ updatedAt: string; /** The field configuration for this dataset. */ fields?: LogExplorerDatasetsUpdateResponseFieldsList | null; } export const UpdateLogExplorerDatasetResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ createdAt: S.String.pipe(T.Body("created_at")), dataset: S.String, datasetId: S.String.pipe(T.Body("dataset_id")), enabled: S.Boolean, objectId: S.String.pipe(T.Body("object_id")), objectType: LogExplorerDatasetsUpdateResponseObjectType.pipe( T.Body("object_type"), ), updatedAt: S.String.pipe(T.Body("updated_at")), fields: S.optional(S.NullOr(LogExplorerDatasetsUpdateResponseFieldsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateLogExplorerDatasetResponse", }) as any as S.Schema; export interface UpdateLogExplorerDatasetForZoneRequest { /** The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. */ zoneId: string; datasetId: string; /** Whether to enable or disable log ingest for this dataset. */ enabled: boolean; /** Controls which fields the API ingests after the update. Defaults */ fields?: LogExplorerDatasetsUpdateRequestFieldsList; } export const UpdateLogExplorerDatasetForZoneRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), datasetId: S.String.pipe(T.Label("dataset_id")), enabled: S.Boolean, fields: S.optional(LogExplorerDatasetsUpdateRequestFieldsList), }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/logs/explorer/datasets/{dataset_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateLogExplorerDatasetForZoneRequest", }) as any as S.Schema; export type CreateControlCmbConfigError = | LogsControlNotAuthorized | Forbidden | CloudflareOpError; /** Updates CMB config. */ export const createControlCmbConfig: API.OperationMethod< CreateControlCmbConfigRequest, CreateControlCmbConfigResponse, CreateControlCmbConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateControlCmbConfigRequest, output: CreateControlCmbConfigResponse, errors: [ LogsControlNotAuthorized, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateControlRetentionError = | LogsControlNotAuthorized | Forbidden | CloudflareOpError; /** Updates log retention flag for Logpull API. */ export const createControlRetention: API.OperationMethod< CreateControlRetentionRequest, CreateControlRetentionResponse, CreateControlRetentionError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateControlRetentionRequest, output: CreateControlRetentionResponse, errors: [ LogsControlNotAuthorized, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateLogExplorerDatasetForAccountError = CloudflareOpError; /** Create a new Log Explorer dataset for the account or zone. Use the `/account or zones/{account or zone_id}/logs/explorer/datasets/available` endpoint to list dataset types you can create along with their available fields. The `fields` property is optional. If not specified, all available fields will be enabled. For zone-level datasets use the zone-scoped endpoint: POST /zones/{zone_id}/logs/explorer/datasets For dataset field definitions, see: https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/ */ export const createLogExplorerDatasetForAccount: API.OperationMethod< CreateLogExplorerDatasetForAccountRequest, CreateLogExplorerDatasetResponse, CreateLogExplorerDatasetForAccountError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateLogExplorerDatasetForAccountRequest, output: CreateLogExplorerDatasetResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateLogExplorerDatasetForZoneError = CloudflareOpError; /** Create a new Log Explorer dataset for the account or zone. Use the `/account or zones/{account or zone_id}/logs/explorer/datasets/available` endpoint to list dataset types you can create along with their available fields. The `fields` property is optional. If not specified, all available fields will be enabled. For zone-level datasets use the zone-scoped endpoint: POST /zones/{zone_id}/logs/explorer/datasets For dataset field definitions, see: https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/ */ export const createLogExplorerDatasetForZone: API.OperationMethod< CreateLogExplorerDatasetForZoneRequest, CreateLogExplorerDatasetResponse, CreateLogExplorerDatasetForZoneError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateLogExplorerDatasetForZoneRequest, output: CreateLogExplorerDatasetResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteControlCmbConfigError = | LogsControlNotAuthorized | CmbConfigNotFound | Forbidden | CloudflareOpError; /** Deletes CMB config. */ export const deleteControlCmbConfig: API.OperationMethod< DeleteControlCmbConfigRequest, DeleteControlCmbConfigResponse, DeleteControlCmbConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteControlCmbConfigRequest, output: DeleteControlCmbConfigResponse, errors: [ LogsControlNotAuthorized, CmbConfigNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetControlCmbConfigError = | LogsControlNotAuthorized | CmbConfigNotFound | Forbidden | CloudflareOpError; /** Gets CMB config. */ export const getControlCmbConfig: API.OperationMethod< GetControlCmbConfigRequest, GetControlCmbConfigResponse, GetControlCmbConfigError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetControlCmbConfigRequest, output: GetControlCmbConfigResponse, errors: [ LogsControlNotAuthorized, CmbConfigNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetControlRetentionError = | LogsControlNotAuthorized | Forbidden | CloudflareOpError; /** Gets log retention flag for Logpull API. */ export const getControlRetention: API.OperationMethod< GetControlRetentionRequest, GetControlRetentionResponse, GetControlRetentionError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetControlRetentionRequest, output: GetControlRetentionResponse, errors: [ LogsControlNotAuthorized, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetLogExplorerDatasetForAccountError = CloudflareOpError; /** Retrieve a single Log Explorer dataset by ID for the account or zone. */ export const getLogExplorerDatasetForAccount: API.OperationMethod< GetLogExplorerDatasetForAccountRequest, GetLogExplorerDatasetResponse, GetLogExplorerDatasetForAccountError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetLogExplorerDatasetForAccountRequest, output: GetLogExplorerDatasetResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetLogExplorerDatasetForZoneError = CloudflareOpError; /** Retrieve a single Log Explorer dataset by ID for the account or zone. */ export const getLogExplorerDatasetForZone: API.OperationMethod< GetLogExplorerDatasetForZoneRequest, GetLogExplorerDatasetResponse, GetLogExplorerDatasetForZoneError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetLogExplorerDatasetForZoneRequest, output: GetLogExplorerDatasetResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetRayidError = CloudflareOpError; /** The `/rayids` api route allows lookups by specific rayid. The rayids route will return zero, one, or more records (ray ids are not unique). */ export const getRayid: API.OperationMethod< GetRayidRequest, GetRayidResponse, GetRayidError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetRayidRequest, output: GetRayidResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetReceivedError = CloudflareOpError; /** The `/received` api route allows customers to retrieve their edge HTTP logs. The basic access pattern is "give me all the logs for zone Z for minute M", where the minute M refers to the time records were received at Cloudflare's central data center. `start` is inclusive, and `end` is exclusive. Because of that, to get all data, at minutely cadence, starting at 10AM, the proper values are: `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap will be handled properly. */ export const getReceived: API.OperationMethod< GetReceivedRequest, GetReceivedResponse, GetReceivedError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetReceivedRequest, output: GetReceivedResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetReceivedFieldError = CloudflareOpError; /** Lists all fields available. The response is json object with key-value pairs, where keys are field names, and values are descriptions. */ export const getReceivedField: API.OperationMethod< GetReceivedFieldRequest, GetReceivedFieldResponse, GetReceivedFieldError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetReceivedFieldRequest, output: GetReceivedFieldResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListLogExplorerDatasetAvailablesForAccountError = CloudflareOpError; /** Returns all dataset types that this account or zone can create. Each entry includes the dataset schema and timestamp field. The schema shows all possible fields for a dataset. However, not all fields may be available for your account or zone. When creating or updating a dataset, only fields available to your account or zone can be enabled. If you request a field that is not available, you will receive an error. */ export const listLogExplorerDatasetAvailablesForAccount: API.PaginatedOperationMethod< ListLogExplorerDatasetAvailablesForAccountRequest, ListLogExplorerDatasetAvailablesResponse, ListLogExplorerDatasetAvailablesForAccountError, CloudflareOpContext, LogExplorerDatasetsAvailableListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListLogExplorerDatasetAvailablesForAccountRequest, output: ListLogExplorerDatasetAvailablesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type ListLogExplorerDatasetAvailablesForZoneError = CloudflareOpError; /** Returns all dataset types that this account or zone can create. Each entry includes the dataset schema and timestamp field. The schema shows all possible fields for a dataset. However, not all fields may be available for your account or zone. When creating or updating a dataset, only fields available to your account or zone can be enabled. If you request a field that is not available, you will receive an error. */ export const listLogExplorerDatasetAvailablesForZone: API.PaginatedOperationMethod< ListLogExplorerDatasetAvailablesForZoneRequest, ListLogExplorerDatasetAvailablesResponse, ListLogExplorerDatasetAvailablesForZoneError, CloudflareOpContext, LogExplorerDatasetsAvailableListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListLogExplorerDatasetAvailablesForZoneRequest, output: ListLogExplorerDatasetAvailablesResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type ListLogExplorerDatasetsForAccountError = CloudflareOpError; /** Returns all Log Explorer datasets configured for the account or zone. Pass `include_zones=true` to also include zone-level datasets that belong to this account or zone. List responses omit the `fields` property; use the single-dataset endpoint to retrieve field configuration. */ export const listLogExplorerDatasetsForAccount: API.PaginatedOperationMethod< ListLogExplorerDatasetsForAccountRequest, ListLogExplorerDatasetsResponse, ListLogExplorerDatasetsForAccountError, CloudflareOpContext, LogExplorerDatasetsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListLogExplorerDatasetsForAccountRequest, output: ListLogExplorerDatasetsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type ListLogExplorerDatasetsForZoneError = CloudflareOpError; /** Returns all Log Explorer datasets configured for the account or zone. Pass `include_zones=true` to also include zone-level datasets that belong to this account or zone. List responses omit the `fields` property; use the single-dataset endpoint to retrieve field configuration. */ export const listLogExplorerDatasetsForZone: API.PaginatedOperationMethod< ListLogExplorerDatasetsForZoneRequest, ListLogExplorerDatasetsResponse, ListLogExplorerDatasetsForZoneError, CloudflareOpContext, LogExplorerDatasetsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListLogExplorerDatasetsForZoneRequest, output: ListLogExplorerDatasetsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type SqlLogExplorerQueryForAccountError = CloudflareOpError; /** 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/ */ export const sqlLogExplorerQueryForAccount: API.PaginatedOperationMethod< SqlLogExplorerQueryForAccountRequest, SqlLogExplorerQueryResponse, SqlLogExplorerQueryForAccountError, CloudflareOpContext, LogExplorerQuerySqlResultItemMap > = /*@__PURE__*/ API.makePaginated( () => ({ input: SqlLogExplorerQueryForAccountRequest, output: SqlLogExplorerQueryResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type SqlLogExplorerQueryForZoneError = CloudflareOpError; /** 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/ */ export const sqlLogExplorerQueryForZone: API.PaginatedOperationMethod< SqlLogExplorerQueryForZoneRequest, SqlLogExplorerQueryResponse, SqlLogExplorerQueryForZoneError, CloudflareOpContext, LogExplorerQuerySqlResultItemMap > = /*@__PURE__*/ API.makePaginated( () => ({ input: SqlLogExplorerQueryForZoneRequest, output: SqlLogExplorerQueryResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type UpdateLogExplorerDatasetForAccountError = CloudflareOpError; /** Updates the enabled state and/or field configuration of an account or zone dataset. */ export const updateLogExplorerDatasetForAccount: API.OperationMethod< UpdateLogExplorerDatasetForAccountRequest, UpdateLogExplorerDatasetResponse, UpdateLogExplorerDatasetForAccountError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateLogExplorerDatasetForAccountRequest, output: UpdateLogExplorerDatasetResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateLogExplorerDatasetForZoneError = CloudflareOpError; /** Updates the enabled state and/or field configuration of an account or zone dataset. */ export const updateLogExplorerDatasetForZone: API.OperationMethod< UpdateLogExplorerDatasetForZoneRequest, UpdateLogExplorerDatasetResponse, UpdateLogExplorerDatasetForZoneError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateLogExplorerDatasetForZoneRequest, output: UpdateLogExplorerDatasetResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, }));