UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

62 lines • 2.17 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../core/resource.mjs"; import { path } from "../../../internal/utils/path.mjs"; export var BaseFindings = /* @__PURE__ */ (() => { class BaseFindings extends APIResource { /** * Returns aggregate current-period and previous-period totals for CASB findings. * * @example * ```ts * const response = * await client.analyticsQuery.dataSecurity.findings.summary( * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * filters: [], * from: '2024-11-01T00:00:00Z', * to: '2024-11-08T00:00:00Z', * }, * ); * ``` */ summary(params, options) { const { account_id, ...body } = params; return this._client.post(path `/accounts/${account_id}/analytics/query/data-security/findings/summary`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Returns merged time-bucketed CASB findings. * * @example * ```ts * const response = * await client.analyticsQuery.dataSecurity.findings.timeseries( * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * filters: [], * from: '2024-11-01T00:00:00Z', * to: '2024-11-08T00:00:00Z', * }, * ); * ``` */ timeseries(params, options) { const { account_id, ...body } = params; return this._client.post(path `/accounts/${account_id}/analytics/query/data-security/findings/timeseries`, { body, ...options, })._thenUnwrap((obj) => obj.result); } } BaseFindings._key = Object.freeze([ 'analyticsQuery', 'dataSecurity', 'findings', ]); return BaseFindings; })(); export class Findings extends BaseFindings { } //# sourceMappingURL=findings.mjs.map