UNPKG

dnsimple

Version:

A Node.JS client for the DNSimple API.

338 lines (337 loc) 14.1 kB
import type { DNSimple, QueryParams } from "./main"; import type * as types from "./types"; export declare class Domains { private readonly _client; constructor(_client: DNSimple); /** * Lists the domains in the account. * * This API is paginated. Call `listDomains.iterateAll(account, params)` to get an asynchronous iterator over individual items across all pages. You can also use `await listDomains.collectAll(account, params)` to quickly retrieve all items across all pages into an array. We suggest using `iterateAll` when possible, as `collectAll` will make all requests at once, which may increase latency and trigger rate limits. * * GET /{account}/domains * * @see https://developer.dnsimple.com/v2/domains/#listDomains * * @param account The account id * @param params Query parameters * @param params.name_like Only include results with a name field containing the given string * @param params.registrant_id Only include results with the registrant_id field matching the given value * @param params.sort Sort results. Default sorting is ascending by name. */ listDomains: { (account: number, params?: QueryParams & { name_like?: string; registrant_id?: number; sort?: "id:asc" | "id:desc" | "name:asc" | "name:desc" | "expiration:asc" | "expiration:desc"; }): Promise<{ data: Array<types.Domain>; pagination: types.Pagination; }>; iterateAll(account: number, params?: QueryParams & { name_like?: string; registrant_id?: number; sort?: "id:asc" | "id:desc" | "name:asc" | "name:desc" | "expiration:asc" | "expiration:desc"; }): AsyncGenerator<types.Domain, any, any>; collectAll(account: number, params?: QueryParams & { name_like?: string; registrant_id?: number; sort?: "id:asc" | "id:desc" | "name:asc" | "name:desc" | "expiration:asc" | "expiration:desc"; }): Promise<types.Domain[]>; }; /** * Creates a domain and the corresponding zone into the account. * * POST /{account}/domains * * @see https://developer.dnsimple.com/v2/domains/#createDomain * * @param account The account id * @param params Query parameters */ createDomain: (account: number, data: Partial<{ name: string; }>, params?: QueryParams & {}) => Promise<{ data: types.Domain; }>; /** * Retrieves the details of an existing domain. * * GET /{account}/domains/{domain} * * @see https://developer.dnsimple.com/v2/domains/#getDomain * * @param account The account id * @param domain The domain name or id * @param params Query parameters */ getDomain: (account: number, domain: string, params?: QueryParams & {}) => Promise<{ data: types.Domain; }>; /** * Permanently deletes a domain from the account. * * DELETE /{account}/domains/{domain} * * @see https://developer.dnsimple.com/v2/domains/#deleteDomain * * @param account The account id * @param domain The domain name or id * @param params Query parameters */ deleteDomain: (account: number, domain: string, params?: QueryParams & {}) => Promise<{}>; /** * Gets the DNSSEC status for an existing domain. * * GET /{account}/domains/{domain}/dnssec * * @see https://developer.dnsimple.com/v2/domains/dnssec/#getDomainDnssec * * @param account The account id * @param domain The domain name or id * @param params Query parameters */ getDnssec: (account: number, domain: string, params?: QueryParams & {}) => Promise<{ data: types.DNSSEC; }>; /** * Enables DNSSEC for the domain. * * It will enable signing of the zone. If the domain is registered with DNSimple, it will also add the DS record to the corresponding registry. * * POST /{account}/domains/{domain}/dnssec * * @see https://developer.dnsimple.com/v2/domains/dnssec/#enableDomainDnssec * * @param account The account id * @param domain The domain name or id * @param params Query parameters */ enableDnssec: (account: number, domain: string, params?: QueryParams & {}) => Promise<{ data: types.DNSSEC; }>; /** * Disables DNSSEC for the domain. * * It will disable signing of the zone. If the domain is registered with DNSimple, it will also remove the DS record at the registry corresponding to the disabled DNSSEC signing. * * DELETE /{account}/domains/{domain}/dnssec * * @see https://developer.dnsimple.com/v2/domains/dnssec/#disableDomainDnssec * * @param account The account id * @param domain The domain name or id * @param params Query parameters */ disableDnssec: (account: number, domain: string, params?: QueryParams & {}) => Promise<{}>; /** * Lists the DS records for the domain. * * This API is paginated. Call `listDelegationSignerRecords.iterateAll(account, domain, params)` to get an asynchronous iterator over individual items across all pages. You can also use `await listDelegationSignerRecords.collectAll(account, domain, params)` to quickly retrieve all items across all pages into an array. We suggest using `iterateAll` when possible, as `collectAll` will make all requests at once, which may increase latency and trigger rate limits. * * GET /{account}/domains/{domain}/ds_records * * @see https://developer.dnsimple.com/v2/domains/dnssec/#listDomainDelegationSignerRecords * * @param account The account id * @param domain The domain name or id * @param params Query parameters * @param params.sort Sort results. Default sorting is by id. */ listDelegationSignerRecords: { (account: number, domain: string, params?: QueryParams & { sort?: "id:asc" | "id:desc" | "created_at:asc" | "created_at:desc"; }): Promise<{ data: Array<types.DelegationSigner>; pagination: types.Pagination; }>; iterateAll(account: number, domain: string, params?: QueryParams & { sort?: "id:asc" | "id:desc" | "created_at:asc" | "created_at:desc"; }): AsyncGenerator<types.DelegationSigner, any, any>; collectAll(account: number, domain: string, params?: QueryParams & { sort?: "id:asc" | "id:desc" | "created_at:asc" | "created_at:desc"; }): Promise<types.DelegationSigner[]>; }; /** * Adds a DS record to the domain. * * POST /{account}/domains/{domain}/ds_records * * @see https://developer.dnsimple.com/v2/domains/dnssec/#createDomainDelegationSignerRecord * * @param account The account id * @param domain The domain name or id * @param params Query parameters */ createDelegationSignerRecord: (account: number, domain: string, data: Partial<{ algorithm: string; digest: string; digest_type: string; keytag: string; public_key: string; }>, params?: QueryParams & {}) => Promise<{ data: types.DelegationSigner; }>; /** * Retrieves the details of an existing DS record. * * GET /{account}/domains/{domain}/ds_records/{ds} * * @see https://developer.dnsimple.com/v2/domains/dnssec/#getDomainDelegationSignerRecord * * @param account The account id * @param domain The domain name or id * @param ds The delegation signer record id * @param params Query parameters */ getDelegationSignerRecord: (account: number, domain: string, ds: number, params?: QueryParams & {}) => Promise<{ data: types.DelegationSigner; }>; /** * Removes a DS record from the domain. * * DELETE /{account}/domains/{domain}/ds_records/{ds} * * @see https://developer.dnsimple.com/v2/domains/dnssec/#deleteDomainDelegationSignerRecord * * @param account The account id * @param domain The domain name or id * @param ds The delegation signer record id * @param params Query parameters */ deleteDelegationSignerRecord: (account: number, domain: string, ds: number, params?: QueryParams & {}) => Promise<{}>; /** * Lists email forwards for the domain. * * This API is paginated. Call `listEmailForwards.iterateAll(account, domain, params)` to get an asynchronous iterator over individual items across all pages. You can also use `await listEmailForwards.collectAll(account, domain, params)` to quickly retrieve all items across all pages into an array. We suggest using `iterateAll` when possible, as `collectAll` will make all requests at once, which may increase latency and trigger rate limits. * * GET /{account}/domains/{domain}/email_forwards * * @see https://developer.dnsimple.com/v2/domains/email-forwards/#listEmailForwards * * @param account The account id * @param domain The domain name or id * @param params Query parameters * @param params.sort Sort results. Default sorting is by id. */ listEmailForwards: { (account: number, domain: string, params?: QueryParams & { sort?: "id:asc" | "id:desc" | "from:asc" | "from:desc" | "to:asc" | "to:desc"; }): Promise<{ data: Array<types.EmailForward>; pagination: types.Pagination; }>; iterateAll(account: number, domain: string, params?: QueryParams & { sort?: "id:asc" | "id:desc" | "from:asc" | "from:desc" | "to:asc" | "to:desc"; }): AsyncGenerator<types.EmailForward, any, any>; collectAll(account: number, domain: string, params?: QueryParams & { sort?: "id:asc" | "id:desc" | "from:asc" | "from:desc" | "to:asc" | "to:desc"; }): Promise<types.EmailForward[]>; }; /** * Creates a new email forward for the domain. * * POST /{account}/domains/{domain}/email_forwards * * @see https://developer.dnsimple.com/v2/domains/email-forwards/#createEmailForward * * @param account The account id * @param domain The domain name or id * @param params Query parameters */ createEmailForward: (account: number, domain: string, data: Partial<{ alias_name: string; destination_email: string; }>, params?: QueryParams & {}) => Promise<{ data: types.EmailForward; }>; /** * Retrieves the details of an existing email forward. * * GET /{account}/domains/{domain}/email_forwards/{emailforward} * * @see https://developer.dnsimple.com/v2/domains/email-forwards/#getEmailForward * * @param account The account id * @param domain The domain name or id * @param emailforward The email forward id * @param params Query parameters */ getEmailForward: (account: number, domain: string, emailforward: number, params?: QueryParams & {}) => Promise<{ data: types.EmailForward; }>; /** * Permanently deletes an email forward. * * DELETE /{account}/domains/{domain}/email_forwards/{emailforward} * * @see https://developer.dnsimple.com/v2/domains/email-forwards/#deleteEmailForward * * @param account The account id * @param domain The domain name or id * @param emailforward The email forward id * @param params Query parameters */ deleteEmailForward: (account: number, domain: string, emailforward: number, params?: QueryParams & {}) => Promise<{}>; /** * Initiates a pust of a domain to another DNSimple account. * * POST /{account}/domains/{domain}/pushes * * @see https://developer.dnsimple.com/v2/domains/pushes/#initiateDomainPush * * @param account The account id * @param domain The domain name or id * @param params Query parameters */ initiatePush: (account: number, domain: string, data: Partial<{ new_account_email: string; }>, params?: QueryParams & {}) => Promise<{ data: types.Push; }>; /** * List pending pushes for the target account. * * This API is paginated. Call `listPushes.iterateAll(account, params)` to get an asynchronous iterator over individual items across all pages. You can also use `await listPushes.collectAll(account, params)` to quickly retrieve all items across all pages into an array. We suggest using `iterateAll` when possible, as `collectAll` will make all requests at once, which may increase latency and trigger rate limits. * * GET /{account}/pushes * * @see https://developer.dnsimple.com/v2/domains/pushes/#listPushes * * @param account The account id * @param params Query parameters */ listPushes: { (account: number, params?: QueryParams & {}): Promise<{ data: Array<types.Push>; pagination: types.Pagination; }>; iterateAll(account: number, params?: QueryParams & {}): AsyncGenerator<types.Push, any, any>; collectAll(account: number, params?: QueryParams & {}): Promise<types.Push[]>; }; /** * Accepts a push to the target account. * * POST /{account}/pushes/{push} * * @see https://developer.dnsimple.com/v2/domains/pushes/#acceptPush * * @param account The account id * @param push The push id * @param params Query parameters */ acceptPush: (account: number, push: number, data: Partial<{ contact_id: number; }>, params?: QueryParams & {}) => Promise<{}>; /** * Rejects a push to the target account. * * DELETE /{account}/pushes/{push} * * @see https://developer.dnsimple.com/v2/domains/pushes/#rejectPush * * @param account The account id * @param push The push id * @param params Query parameters */ rejectPush: (account: number, push: number, params?: QueryParams & {}) => Promise<{}>; }