cloudflare
Version:
The official TypeScript library for the Cloudflare API
49 lines • 1.71 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { path } from "../../../internal/utils/path.mjs";
export var BaseWebCrawlers = /* @__PURE__ */ (() => {
class BaseWebCrawlers extends 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(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(path `/radar/bots/crawlers/timeseries_groups/${dimension}`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseWebCrawlers._key = Object.freeze([
'radar',
'bots',
'webCrawlers',
]);
return BaseWebCrawlers;
})();
export class WebCrawlers extends BaseWebCrawlers {
}
//# sourceMappingURL=web-crawlers.mjs.map