UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

62 lines • 2.44 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SecurityTXT = exports.BaseSecurityTXT = 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 BaseSecurityTXT = /* @__PURE__ */ (() => { class BaseSecurityTXT extends resource_1.APIResource { /** * Updates the security.txt file configuration for a zone, which provides security * researchers with vulnerability reporting information. * * @example * ```ts * const securityTXT = await client.securityTXT.update({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ update(params, options) { const { zone_id, ...body } = params; return this._client.put((0, path_1.path) `/zones/${zone_id}/security-center/securitytxt`, { body, ...options }); } /** * Removes the security.txt file configuration for a zone. The * /.well-known/security.txt endpoint will no longer be served. * * @example * ```ts * const securityTXT = await client.securityTXT.delete({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ delete(params, options) { const { zone_id } = params; return this._client.delete((0, path_1.path) `/zones/${zone_id}/security-center/securitytxt`, options); } /** * Retrieves the current security.txt file configuration for a zone, used for * security vulnerability reporting. * * @example * ```ts * const securityTXT = await client.securityTXT.get({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ get(params, options) { const { zone_id } = params; return this._client.get((0, path_1.path) `/zones/${zone_id}/security-center/securitytxt`, options)._thenUnwrap((obj) => obj.result); } } BaseSecurityTXT._key = Object.freeze(['securityTXT']); return BaseSecurityTXT; })(); exports.BaseSecurityTXT = BaseSecurityTXT; class SecurityTXT extends BaseSecurityTXT { } exports.SecurityTXT = SecurityTXT; //# sourceMappingURL=security-txt.js.map