UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

54 lines • 1.94 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WebCrawlers = exports.BaseWebCrawlers = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../core/resource.js"); const path_1 = require("../../../internal/utils/path.js"); var BaseWebCrawlers = /* @__PURE__ */ (() => { class BaseWebCrawlers extends resource_1.APIResource { /** * Retrieves an aggregated summary of HTTP requests from crawlers, grouped by the * specified dimension. * * @example * ```ts * const response = * await client.radar.bots.webCrawlers.summary( * 'CLIENT_TYPE', * ); * ``` */ summary(dimension, query = {}, options) { return this._client.get((0, path_1.path) `/radar/bots/crawlers/summary/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of HTTP requests from crawlers, grouped by the * specified dimension over time. * * @example * ```ts * const response = * await client.radar.bots.webCrawlers.timeseriesGroups( * 'CLIENT_TYPE', * ); * ``` */ timeseriesGroups(dimension, query = {}, options) { return this._client.get((0, path_1.path) `/radar/bots/crawlers/timeseries_groups/${dimension}`, { query, ...options, })._thenUnwrap((obj) => obj.result); } } BaseWebCrawlers._key = Object.freeze([ 'radar', 'bots', 'webCrawlers', ]); return BaseWebCrawlers; })(); exports.BaseWebCrawlers = BaseWebCrawlers; class WebCrawlers extends BaseWebCrawlers { } exports.WebCrawlers = WebCrawlers; //# sourceMappingURL=web-crawlers.js.map