cloudflare
Version:
The official TypeScript library for the Cloudflare API
51 lines • 1.9 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Fraud = exports.BaseFraud = 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 BaseFraud = /* @__PURE__ */ (() => {
class BaseFraud extends resource_1.APIResource {
/**
* Update Fraud Detection settings for a zone.
*
* Notes on `username_expressions` behavior:
*
* - If omitted or set to null, expressions are not modified.
* - If provided as an empty array `[]`, all expressions will be cleared.
*
* @example
* ```ts
* const fraudSettings = await client.fraud.update({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* username_expressions: [],
* });
* ```
*/
update(params, options) {
const { zone_id, ...body } = params;
return this._client.put((0, path_1.path) `/zones/${zone_id}/fraud_detection/settings`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Retrieve Fraud Detection settings for a zone.
*
* @example
* ```ts
* const fraudSettings = await client.fraud.get({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(params, options) {
const { zone_id } = params;
return this._client.get((0, path_1.path) `/zones/${zone_id}/fraud_detection/settings`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseFraud._key = Object.freeze(['fraud']);
return BaseFraud;
})();
exports.BaseFraud = BaseFraud;
class Fraud extends BaseFraud {
}
exports.Fraud = Fraud;
//# sourceMappingURL=fraud.js.map