UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

87 lines • 3.55 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HTTP = exports.BaseHTTP = 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 TimeseriesGroupsAPI = tslib_1.__importStar(require("./timeseries-groups.js")); const timeseries_groups_1 = require("./timeseries-groups.js"); const TopAPI = tslib_1.__importStar(require("./top.js")); const top_1 = require("./top.js"); const AsesAPI = tslib_1.__importStar(require("./ases/ases.js")); const ases_1 = require("./ases/ases.js"); const LocationsAPI = tslib_1.__importStar(require("./locations/locations.js")); const locations_1 = require("./locations/locations.js"); const path_1 = require("../../../internal/utils/path.js"); var BaseHTTP = /* @__PURE__ */ (() => { class BaseHTTP extends resource_1.APIResource { /** * Retrieves the distribution of HTTP requests by the specified dimension. * * @example * ```ts * const response = await client.radar.http.summaryV2('ADM1'); * ``` */ summaryV2(dimension, query = {}, options) { return this._client.get((0, path_1.path) `/radar/http/summary/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the HTTP requests over time. * * @example * ```ts * const response = await client.radar.http.timeseries(); * ``` */ timeseries(query = {}, options) { return this._client.get('/radar/http/timeseries', { query, ...options })._thenUnwrap((obj) => obj.result); } /** * Retrieves the distribution of HTTP requests grouped by dimension. * * @example * ```ts * const response = await client.radar.http.timeseriesGroupsV2( * 'ADM1', * ); * ``` */ timeseriesGroupsV2(dimension, query = {}, options) { return this._client.get((0, path_1.path) `/radar/http/timeseries_groups/${dimension}`, { query, ...options, })._thenUnwrap((obj) => obj.result); } } BaseHTTP._key = Object.freeze(['radar', 'http']); return BaseHTTP; })(); exports.BaseHTTP = BaseHTTP; var HTTP = /* @__PURE__ */ (() => { class HTTP extends BaseHTTP { constructor() { super(...arguments); this.locations = new LocationsAPI.Locations(this._client); this.ases = new AsesAPI.Ases(this._client); this.summary = new SummaryAPI.Summary(this._client); this.timeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups(this._client); this.top = new TopAPI.Top(this._client); } } HTTP.Locations = locations_1.Locations; HTTP.BaseLocations = locations_1.BaseLocations; HTTP.Ases = ases_1.Ases; HTTP.BaseAses = ases_1.BaseAses; HTTP.Summary = summary_1.Summary; HTTP.BaseSummary = summary_1.BaseSummary; HTTP.TimeseriesGroups = timeseries_groups_1.TimeseriesGroups; HTTP.BaseTimeseriesGroups = timeseries_groups_1.BaseTimeseriesGroups; HTTP.Top = top_1.Top; HTTP.BaseTop = top_1.BaseTop; return HTTP; })(); exports.HTTP = HTTP; //# sourceMappingURL=http.js.map