cloudflare
Version:
The official TypeScript library for the Cloudflare API
66 lines • 2.85 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Mitigations = exports.BaseMitigations = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../core/resource.js");
const pagination_1 = require("../../core/pagination.js");
const path_1 = require("../../internal/utils/path.js");
var BaseMitigations = /* @__PURE__ */ (() => {
class BaseMitigations extends resource_1.APIResource {
/**
* List mitigations done to remediate the abuse report.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const mitigationListResponse of client.abuseReports.mitigations.list(
* 'report_id',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(reportID, params, options) {
const { account_id, ...query } = params;
return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/abuse-reports/${reportID}/mitigations`, (pagination_1.V4PagePagination), { query, ...options });
}
/**
* Request a review of mitigations applied because of an abuse report, or submit a
* report-level appeal.
*
* - To request a review of specific mitigations, send `appeals` with the
* mitigation IDs and reasons. Repeating a request for a mitigation with an
* unresolved appeal is idempotent and returns that mitigation in the in-review
* state.
* - To submit a report-level appeal, send `type` and, for a `counter_notice`, the
* counter-notice details in `data`. Report-level appeals are currently available
* only for DMCA (copyright) reports.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const mitigationReviewResponse of client.abuseReports.mitigations.review(
* 'report_id',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
review(reportID, params, options) {
const { account_id, ...body } = params;
return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/abuse-reports/${reportID}/mitigations/appeal`, (pagination_1.SinglePage), { body, method: 'post', ...options });
}
}
BaseMitigations._key = Object.freeze([
'abuseReports',
'mitigations',
]);
return BaseMitigations;
})();
exports.BaseMitigations = BaseMitigations;
class Mitigations extends BaseMitigations {
}
exports.Mitigations = Mitigations;
//# sourceMappingURL=mitigations.js.map