cloudflare
Version:
The official TypeScript library for the Cloudflare API
58 lines • 2.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CsamScanner = exports.BaseCsamScanner = 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 BaseCsamScanner = /* @__PURE__ */ (() => {
class BaseCsamScanner extends resource_1.APIResource {
/**
* Update the CSAM Scanner configuration for a zone. Allows enabling or disabling
* CSAM scanning, updating the notification email, and configuring scanning
* sources.
*
* When a new email is provided, email verification is triggered automatically. The
* `enabled` field is a toggle; the server may adjust it based on whether the
* notification email is verified.
*
* Returns 403 if the zone or account is locked by Trust & Safety.
*
* @example
* ```ts
* const response = await client.csamScanner.edit({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch((0, path_1.path) `/zones/${zone_id}/settings/csam_scanner_third_party`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Retrieve the current CSAM Scanner configuration for a zone.
*
* The notification email is masked by default in responses.
*
* @example
* ```ts
* const csamScanner = await client.csamScanner.get({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(params, options) {
const { zone_id } = params;
return this._client.get((0, path_1.path) `/zones/${zone_id}/settings/csam_scanner_third_party`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseCsamScanner._key = Object.freeze(['csamScanner']);
return BaseCsamScanner;
})();
exports.BaseCsamScanner = BaseCsamScanner;
class CsamScanner extends BaseCsamScanner {
}
exports.CsamScanner = CsamScanner;
//# sourceMappingURL=csam-scanner.js.map