UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

57 lines • 2.2 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import { path } from "../../internal/utils/path.mjs"; export var BaseSecurityTXT = /* @__PURE__ */ (() => { class BaseSecurityTXT extends 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(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(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(path `/zones/${zone_id}/security-center/securitytxt`, options)._thenUnwrap((obj) => obj.result); } } BaseSecurityTXT._key = Object.freeze(['securityTXT']); return BaseSecurityTXT; })(); export class SecurityTXT extends BaseSecurityTXT { } //# sourceMappingURL=security-txt.mjs.map