cloudflare
Version:
The official TypeScript library for the Cloudflare API
77 lines • 2.84 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DNS = exports.BaseDNS = 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 BaseDNS = /* @__PURE__ */ (() => {
class BaseDNS extends resource_1.APIResource {
/**
* Enable your Email Routing zone. Add and lock the necessary MX and SPF records.
*
* @example
* ```ts
* const settings = await client.emailRouting.dns.create({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
create(params, options) {
const { zone_id, ...body } = params;
return this._client.post((0, path_1.path) `/zones/${zone_id}/email/routing/dns`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Disable your Email Routing zone. Also removes additional MX records previously
* required for Email Routing to work.
*
* @example
* ```ts
* const settings = await client.emailRouting.dns.delete({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
delete(params, options) {
const { zone_id } = params;
return this._client.delete((0, path_1.path) `/zones/${zone_id}/email/routing/dns`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Unlock MX Records previously locked by Email Routing.
*
* @example
* ```ts
* const settings = await client.emailRouting.dns.edit({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch((0, path_1.path) `/zones/${zone_id}/email/routing/dns`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Show the DNS records needed to configure your Email Routing zone.
*
* @example
* ```ts
* const dnsRecords = await client.emailRouting.dns.get({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(params, options) {
const { zone_id, ...query } = params;
return this._client.get((0, path_1.path) `/zones/${zone_id}/email/routing/dns`, { query, ...options })._thenUnwrap((obj) => obj.result);
}
}
BaseDNS._key = Object.freeze([
'emailRouting',
'dns',
]);
return BaseDNS;
})();
exports.BaseDNS = BaseDNS;
class DNS extends BaseDNS {
}
exports.DNS = DNS;
//# sourceMappingURL=dns.js.map