cloudflare
Version:
The official TypeScript library for the Cloudflare API
83 lines • 2.97 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import * as SummaryAPI from "./summary.mjs";
import { BaseSummary, Summary, } from "./summary.mjs";
import * as TimeseriesGroupsAPI from "./timeseries-groups.mjs";
import { BaseTimeseriesGroups, TimeseriesGroups, } from "./timeseries-groups.mjs";
import * as TopAPI from "./top/top.mjs";
import { BaseTop, Top, } from "./top/top.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export var BaseLayer7 = /* @__PURE__ */ (() => {
class BaseLayer7 extends APIResource {
/**
* Retrieves the distribution of layer 7 attacks by the specified dimension.
*
* @example
* ```ts
* const response =
* await client.radar.attacks.layer7.summaryV2(
* 'HTTP_METHOD',
* );
* ```
*/
summaryV2(dimension, query = {}, options) {
return this._client.get(path `/radar/attacks/layer7/summary/${dimension}`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves layer 7 attacks over time.
*
* @example
* ```ts
* const response =
* await client.radar.attacks.layer7.timeseries();
* ```
*/
timeseries(query = {}, options) {
return this._client.get('/radar/attacks/layer7/timeseries', { query, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves the distribution of layer 7 attacks grouped by dimension over time.
*
* @example
* ```ts
* const response =
* await client.radar.attacks.layer7.timeseriesGroupsV2(
* 'HTTP_METHOD',
* );
* ```
*/
timeseriesGroupsV2(dimension, query = {}, options) {
return this._client.get(path `/radar/attacks/layer7/timeseries_groups/${dimension}`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseLayer7._key = Object.freeze([
'radar',
'attacks',
'layer7',
]);
return BaseLayer7;
})();
export var Layer7 = /* @__PURE__ */ (() => {
class Layer7 extends BaseLayer7 {
constructor() {
super(...arguments);
this.summary = new SummaryAPI.Summary(this._client);
this.timeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups(this._client);
this.top = new TopAPI.Top(this._client);
}
}
Layer7.Summary = Summary;
Layer7.BaseSummary = BaseSummary;
Layer7.TimeseriesGroups = TimeseriesGroups;
Layer7.BaseTimeseriesGroups = BaseTimeseriesGroups;
Layer7.Top = Top;
Layer7.BaseTop = BaseTop;
return Layer7;
})();
//# sourceMappingURL=layer7.mjs.map