UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

74 lines • 2.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Bots = exports.BaseBots = void 0; const tslib_1 = require("../../../../internal/tslib.js"); // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../../core/resource.js"); const SummaryAPI = tslib_1.__importStar(require("./summary.js")); const summary_1 = require("./summary.js"); const path_1 = require("../../../../internal/utils/path.js"); var BaseBots = /* @__PURE__ */ (() => { class BaseBots extends resource_1.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((0, path_1.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((0, path_1.path) `/radar/ai/bots/timeseries_groups/${dimension}`, { query, ...options, })._thenUnwrap((obj) => obj.result); } } BaseBots._key = Object.freeze([ 'radar', 'ai', 'bots', ]); return BaseBots; })(); exports.BaseBots = BaseBots; var Bots = /* @__PURE__ */ (() => { class Bots extends BaseBots { constructor() { super(...arguments); this.summary = new SummaryAPI.Summary(this._client); } } Bots.Summary = summary_1.Summary; Bots.BaseSummary = summary_1.BaseSummary; return Bots; })(); exports.Bots = Bots; //# sourceMappingURL=bots.js.map