cloudflare
Version:
The official TypeScript library for the Cloudflare API
54 lines • 2.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DMARCReports = exports.BaseDMARCReports = 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 BaseDMARCReports = /* @__PURE__ */ (() => {
class BaseDMARCReports extends resource_1.APIResource {
/**
* Updates the DMARC report configuration for a zone. At least one of `enabled` or
* `skip_wizard` must be provided. When enabling, the handler will ensure the DMARC
* RUA record exists in DNS.
*
* @example
* ```ts
* const response = await client.emailAuth.dmarcReports.edit({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch((0, path_1.path) `/zones/${zone_id}/email/auth/dmarc-reports`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves the current DMARC report configuration and status for a zone. Returns
* the RUA prefix, enabled status, approved sources, and DNS records.
*
* @example
* ```ts
* const dmarcReport = await client.emailAuth.dmarcReports.get(
* { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(params, options) {
const { zone_id } = params;
return this._client.get((0, path_1.path) `/zones/${zone_id}/email/auth/dmarc-reports`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseDMARCReports._key = Object.freeze([
'emailAuth',
'dmarcReports',
]);
return BaseDMARCReports;
})();
exports.BaseDMARCReports = BaseDMARCReports;
class DMARCReports extends BaseDMARCReports {
}
exports.DMARCReports = DMARCReports;
//# sourceMappingURL=dmarc-reports.js.map