UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

33 lines • 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IPs = exports.BaseIPs = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../core/resource.js"); const path_1 = require("../../internal/utils/path.js"); var BaseIPs = /* @__PURE__ */ (() => { class BaseIPs extends resource_1.APIResource { /** * Gets the geolocation, ASN, infrastructure type of the ASN, and any security * threat categories of an IP address. **Must provide ip query parameters.** For * example, `/intel/ip?ipv4=1.1.1.1` or `/intel/ip?ipv6=2001:db8::1`. * * @example * ```ts * const ips = await client.intel.ips.get({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ get(params, options) { const { account_id, ...query } = params; return this._client.get((0, path_1.path) `/accounts/${account_id}/intel/ip`, { query, ...options })._thenUnwrap((obj) => obj.result); } } BaseIPs._key = Object.freeze(['intel', 'ips']); return BaseIPs; })(); exports.BaseIPs = BaseIPs; class IPs extends BaseIPs { } exports.IPs = IPs; //# sourceMappingURL=ips.js.map