cloudflare
Version:
The official TypeScript library for the Cloudflare API
72 lines • 3.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Top = exports.BaseTop = 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 AsesAPI = tslib_1.__importStar(require("./ases.js"));
const ases_1 = require("./ases.js");
const LocationsAPI = tslib_1.__importStar(require("./locations.js"));
const locations_1 = require("./locations.js");
var BaseTop = /* @__PURE__ */ (() => {
class BaseTop extends resource_1.APIResource {
/**
* Retrieves the top attacks from origin to target location. Values are percentages
* of the total layer 7 attacks (with billing country). The attack magnitude can be
* defined by the number of mitigated requests or by the number of zones affected.
* You can optionally limit the number of attacks by origin/target location (useful
* if all the top attacks are from or to the same location).
*
* @example
* ```ts
* const response =
* await client.radar.attacks.layer7.top.attacks();
* ```
*/
attacks(query = {}, options) {
return this._client.get('/radar/attacks/layer7/top/attacks', { query, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* This endpoint is deprecated. To continue getting this data, switch to the
* summary by industry endpoint.
*
* @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead.
*/
industry(query = {}, options) {
return this._client.get('/radar/attacks/layer7/top/industry', { query, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* This endpoint is deprecated. To continue getting this data, switch to the
* summary by vertical endpoint.
*
* @deprecated Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead.
*/
vertical(query = {}, options) {
return this._client.get('/radar/attacks/layer7/top/vertical', { query, ...options })._thenUnwrap((obj) => obj.result);
}
}
BaseTop._key = Object.freeze([
'radar',
'attacks',
'layer7',
'top',
]);
return BaseTop;
})();
exports.BaseTop = BaseTop;
var Top = /* @__PURE__ */ (() => {
class Top extends BaseTop {
constructor() {
super(...arguments);
this.locations = new LocationsAPI.Locations(this._client);
this.ases = new AsesAPI.Ases(this._client);
}
}
Top.Locations = locations_1.Locations;
Top.BaseLocations = locations_1.BaseLocations;
Top.Ases = ases_1.Ases;
Top.BaseAses = ases_1.BaseAses;
return Top;
})();
exports.Top = Top;
//# sourceMappingURL=top.js.map