UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

177 lines • 4.81 kB
import { APIResource } from "../../core/resource.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class BaseSecurityTXT extends APIResource { static readonly _key: readonly ['securityTXT']; /** * 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: SecurityTXTUpdateParams, options?: RequestOptions): APIPromise<SecurityTXTUpdateResponse>; /** * 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: SecurityTXTDeleteParams, options?: RequestOptions): APIPromise<SecurityTXTDeleteResponse>; /** * 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: SecurityTXTGetParams, options?: RequestOptions): APIPromise<SecurityTXTGetResponse>; } export declare class SecurityTXT extends BaseSecurityTXT { } export interface SecurityTXTUpdateResponse { errors: Array<SecurityTXTUpdateResponse.Error>; messages: Array<SecurityTXTUpdateResponse.Message>; /** * Whether the API call was successful. */ success: true; } export declare namespace SecurityTXTUpdateResponse { interface Error { code: number; message: string; documentation_url?: string; source?: Error.Source; } namespace Error { interface Source { pointer?: string; } } interface Message { code: number; message: string; documentation_url?: string; source?: Message.Source; } namespace Message { interface Source { pointer?: string; } } } export interface SecurityTXTDeleteResponse { errors: Array<SecurityTXTDeleteResponse.Error>; messages: Array<SecurityTXTDeleteResponse.Message>; /** * Whether the API call was successful. */ success: true; } export declare namespace SecurityTXTDeleteResponse { interface Error { code: number; message: string; documentation_url?: string; source?: Error.Source; } namespace Error { interface Source { pointer?: string; } } interface Message { code: number; message: string; documentation_url?: string; source?: Message.Source; } namespace Message { interface Source { pointer?: string; } } } export interface SecurityTXTGetResponse { acknowledgments?: Array<string>; canonical?: Array<string>; contact?: Array<string>; enabled?: boolean; encryption?: Array<string>; expires?: string; hiring?: Array<string>; policy?: Array<string>; preferred_languages?: string; } export interface SecurityTXTUpdateParams { /** * Path param: Identifier. */ zone_id: string; /** * Body param */ acknowledgments?: Array<string>; /** * Body param */ canonical?: Array<string>; /** * Body param */ contact?: Array<string>; /** * Body param */ enabled?: boolean; /** * Body param */ encryption?: Array<string>; /** * Body param */ expires?: string; /** * Body param */ hiring?: Array<string>; /** * Body param */ policy?: Array<string>; /** * Body param */ preferred_languages?: string; } export interface SecurityTXTDeleteParams { /** * Identifier. */ zone_id: string; } export interface SecurityTXTGetParams { /** * Identifier. */ zone_id: string; } export declare namespace SecurityTXT { export { type SecurityTXTUpdateResponse as SecurityTXTUpdateResponse, type SecurityTXTDeleteResponse as SecurityTXTDeleteResponse, type SecurityTXTGetResponse as SecurityTXTGetResponse, type SecurityTXTUpdateParams as SecurityTXTUpdateParams, type SecurityTXTDeleteParams as SecurityTXTDeleteParams, type SecurityTXTGetParams as SecurityTXTGetParams, }; } //# sourceMappingURL=security-txt.d.ts.map