UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

170 lines 5.46 kB
import { APIResource } from "../../resource.js"; import * as Core from "../../core.js"; import * as DNSAPI from "./dns.js"; import * as Shared from "../shared.js"; import * as EmailRoutingAPI from "./email-routing.js"; import { SinglePage } from "../../pagination.js"; export declare class DNS extends APIResource { /** * Enable you Email Routing zone. Add and lock the necessary MX and SPF records. */ create(params: DNSCreateParams, options?: Core.RequestOptions): Core.APIPromise<EmailRoutingAPI.Settings>; /** * Disable your Email Routing zone. Also removes additional MX records previously * required for Email Routing to work. */ delete(params: DNSDeleteParams, options?: Core.RequestOptions): Core.PagePromise<DNSRecordsSinglePage, DNSRecord>; /** * Unlock MX Records previously locked by Email Routing. */ edit(params: DNSEditParams, options?: Core.RequestOptions): Core.APIPromise<EmailRoutingAPI.Settings>; /** * Show the DNS records needed to configure your Email Routing zone. */ get(params: DNSGetParams, options?: Core.RequestOptions): Core.APIPromise<DNSGetResponse>; } export declare class DNSRecordsSinglePage extends SinglePage<DNSRecord> { } /** * List of records needed to enable an Email Routing zone. */ export interface DNSRecord { /** * DNS record content. */ content?: string; /** * DNS record name (or @ for the zone apex). */ name?: string; /** * Required for MX, SRV and URI records. Unused by other record types. Records with * lower priorities are preferred. */ priority?: number; /** * Time to live, in seconds, of the DNS record. Must be between 60 and 86400, or 1 * for 'automatic'. */ ttl?: number | 1; /** * DNS record type. */ type?: 'A' | 'AAAA' | 'CNAME' | 'HTTPS' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'CERT' | 'DNSKEY' | 'DS' | 'NAPTR' | 'SMIMEA' | 'SSHFP' | 'SVCB' | 'TLSA' | 'URI'; } export type DNSGetResponse = DNSGetResponse.EmailEmailRoutingDNSQueryResponse | DNSGetResponse.EmailDNSSettingsResponseCollection; export declare namespace DNSGetResponse { interface EmailEmailRoutingDNSQueryResponse { errors: Array<Shared.ResponseInfo>; messages: Array<Shared.ResponseInfo>; /** * Whether the API call was successful */ success: true; result?: EmailEmailRoutingDNSQueryResponse.Result; result_info?: EmailEmailRoutingDNSQueryResponse.ResultInfo; } namespace EmailEmailRoutingDNSQueryResponse { interface Result { errors?: Array<Result.Error>; record?: Array<DNSAPI.DNSRecord>; } namespace Result { interface Error { code?: string; /** * List of records needed to enable an Email Routing zone. */ missing?: DNSAPI.DNSRecord; } } interface ResultInfo { /** * Total number of results for the requested service */ count?: number; /** * Current page within paginated list of results */ page?: number; /** * Number of results per page of results */ per_page?: number; /** * Total results available without any search parameters */ total_count?: number; } } interface EmailDNSSettingsResponseCollection { errors: Array<Shared.ResponseInfo>; messages: Array<Shared.ResponseInfo>; /** * Whether the API call was successful */ success: true; result?: Array<DNSAPI.DNSRecord>; result_info?: EmailDNSSettingsResponseCollection.ResultInfo; } namespace EmailDNSSettingsResponseCollection { interface ResultInfo { /** * Total number of results for the requested service */ count?: number; /** * Current page within paginated list of results */ page?: number; /** * Number of results per page of results */ per_page?: number; /** * Total results available without any search parameters */ total_count?: number; } } } export interface DNSCreateParams { /** * Path param: Identifier */ zone_id: string; /** * Body param: Domain of your zone. */ name: string; } export interface DNSDeleteParams { /** * Identifier */ zone_id: string; } export interface DNSEditParams { /** * Path param: Identifier */ zone_id: string; /** * Body param: Domain of your zone. */ name: string; } export interface DNSGetParams { /** * Path param: Identifier */ zone_id: string; /** * Query param: Domain of your zone. */ subdomain?: string; } export declare namespace DNS { export { type DNSRecord as DNSRecord, type DNSGetResponse as DNSGetResponse, DNSRecordsSinglePage as DNSRecordsSinglePage, type DNSCreateParams as DNSCreateParams, type DNSDeleteParams as DNSDeleteParams, type DNSEditParams as DNSEditParams, type DNSGetParams as DNSGetParams, }; } //# sourceMappingURL=dns.d.ts.map