UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

82 lines • 3.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NetFlows = exports.BaseNetFlows = 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 TopAPI = tslib_1.__importStar(require("./top.js")); const top_1 = require("./top.js"); const path_1 = require("../../../internal/utils/path.js"); var BaseNetFlows = /* @__PURE__ */ (() => { class BaseNetFlows extends resource_1.APIResource { /** * Retrieves the distribution of network traffic (NetFlows) by HTTP vs other * protocols. * * @deprecated Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead. */ summary(query = {}, options) { return this._client.get('/radar/netflows/summary', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of network traffic (NetFlows) by the specified * dimension. * * @example * ```ts * const response = await client.radar.netFlows.summaryV2( * 'ADM1', * ); * ``` */ summaryV2(dimension, query = {}, options) { return this._client.get((0, path_1.path) `/radar/netflows/summary/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves network traffic (NetFlows) over time. * * @example * ```ts * const response = await client.radar.netFlows.timeseries(); * ``` */ timeseries(query = {}, options) { return this._client.get('/radar/netflows/timeseries', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of NetFlows traffic, grouped by the specified * dimension over time. * * @example * ```ts * const response = * await client.radar.netFlows.timeseriesGroups('ADM1'); * ``` */ timeseriesGroups(dimension, query = {}, options) { return this._client.get((0, path_1.path) `/radar/netflows/timeseries_groups/${dimension}`, { query, ...options, })._thenUnwrap((obj) => obj.result); } } BaseNetFlows._key = Object.freeze([ 'radar', 'netFlows', ]); return BaseNetFlows; })(); exports.BaseNetFlows = BaseNetFlows; var NetFlows = /* @__PURE__ */ (() => { class NetFlows extends BaseNetFlows { constructor() { super(...arguments); this.top = new TopAPI.Top(this._client); } } NetFlows.Top = top_1.Top; NetFlows.BaseTop = top_1.BaseTop; return NetFlows; })(); exports.NetFlows = NetFlows; //# sourceMappingURL=netflows.js.map