cloudflare
Version:
The official TypeScript library for the Cloudflare API
67 lines • 2.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Findings = exports.BaseFindings = 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 BaseFindings = /* @__PURE__ */ (() => {
class BaseFindings extends resource_1.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((0, path_1.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((0, path_1.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;
})();
exports.BaseFindings = BaseFindings;
class Findings extends BaseFindings {
}
exports.Findings = Findings;
//# sourceMappingURL=findings.js.map