cloudflare
Version:
The official TypeScript library for the Cloudflare API
68 lines • 2.64 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.mjs";
import { BaseTop, Top, } from "./top.mjs";
import { path } from "../../../internal/utils/path.mjs";
export var BaseDNS = /* @__PURE__ */ (() => {
class BaseDNS extends APIResource {
/**
* Retrieves the distribution of DNS queries by the specified dimension.
*
* @example
* ```ts
* const response = await client.radar.dns.summaryV2('AS');
* ```
*/
summaryV2(dimension, query = {}, options) {
return this._client.get(path `/radar/dns/summary/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves normalized query volume to the 1.1.1.1 DNS resolver over time.
*
* @example
* ```ts
* const response = await client.radar.dns.timeseries();
* ```
*/
timeseries(query = {}, options) {
return this._client.get('/radar/dns/timeseries', { query, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves the distribution of DNS queries grouped by dimension over time.
*
* @example
* ```ts
* const response = await client.radar.dns.timeseriesGroupsV2(
* 'AS',
* );
* ```
*/
timeseriesGroupsV2(dimension, query = {}, options) {
return this._client.get(path `/radar/dns/timeseries_groups/${dimension}`, { query, ...options })._thenUnwrap((obj) => obj.result);
}
}
BaseDNS._key = Object.freeze(['radar', 'dns']);
return BaseDNS;
})();
export var DNS = /* @__PURE__ */ (() => {
class DNS extends BaseDNS {
constructor() {
super(...arguments);
this.top = new TopAPI.Top(this._client);
this.summary = new SummaryAPI.Summary(this._client);
this.timeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups(this._client);
}
}
DNS.Top = Top;
DNS.BaseTop = BaseTop;
DNS.Summary = Summary;
DNS.BaseSummary = BaseSummary;
DNS.TimeseriesGroups = TimeseriesGroups;
DNS.BaseTimeseriesGroups = BaseTimeseriesGroups;
return DNS;
})();
//# sourceMappingURL=dns.mjs.map