UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

68 lines • 2.33 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../../core/resource.mjs"; import * as SummaryAPI from "./summary.mjs"; import { BaseSummary, Summary } from "./summary.mjs"; import { path } from "../../../../internal/utils/path.mjs"; export var BaseBots = /* @__PURE__ */ (() => { class BaseBots extends APIResource { /** * Retrieves an aggregated summary of AI bots HTTP requests grouped by the * specified dimension. * * @example * ```ts * const response = await client.radar.ai.bots.summaryV2( * 'USER_AGENT', * ); * ``` */ summaryV2(dimension, query = {}, options) { return this._client.get(path `/radar/ai/bots/summary/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves AI bots HTTP request volume over time. * * @example * ```ts * const response = await client.radar.ai.bots.timeseries(); * ``` */ timeseries(query = {}, options) { return this._client.get('/radar/ai/bots/timeseries', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of HTTP requests from AI bots, grouped by the * specified dimension over time. * * @example * ```ts * const response = * await client.radar.ai.bots.timeseriesGroups('USER_AGENT'); * ``` */ timeseriesGroups(dimension, query = {}, options) { return this._client.get(path `/radar/ai/bots/timeseries_groups/${dimension}`, { query, ...options, })._thenUnwrap((obj) => obj.result); } } BaseBots._key = Object.freeze([ 'radar', 'ai', 'bots', ]); return BaseBots; })(); export var Bots = /* @__PURE__ */ (() => { class Bots extends BaseBots { constructor() { super(...arguments); this.summary = new SummaryAPI.Summary(this._client); } } Bots.Summary = Summary; Bots.BaseSummary = BaseSummary; return Bots; })(); //# sourceMappingURL=bots.mjs.map