UNPKG

@jesseditson/dnsimple

Version:

A Node.JS client for the DNSimple API.

64 lines (63 loc) 1.97 kB
import type { DNSimple, QueryParams } from "./main"; import type * as types from "./types"; export declare class Webhooks { private readonly _client; constructor(_client: DNSimple); /** * List the webhooks in the account. * * GET /{account}/webhooks * * @see https://developer.dnsimple.com/v2/webhooks/webhooks/#listWebhooks * * @param account The account id * @param params Query parameters * @param params.sort Sort results. Default sorting is by name ascending. */ listWebhooks: (account: number, params?: QueryParams & { sort?: "id:asc" | "id:desc"; }) => Promise<{ data: Array<types.Webhook>; }>; /** * Registers a webhook endpoint. * * POST /{account}/webhooks * * @see https://developer.dnsimple.com/v2/webhooks/webhooks/#createWebhook * * @param account The account id * @param params Query parameters */ createWebhook: (account: number, data: Partial<{ url: string; }>, params?: QueryParams & {}) => Promise<{ data: types.Webhook; }>; /** * Retrieves the details of a registered webhook. * * GET /{account}/webhooks/{webhook} * * @see https://developer.dnsimple.com/v2/webhooks/webhooks/#getWebhook * * @param account The account id * @param webhook The webhoook id * @param params Query parameters */ getWebhook: (account: number, webhook: number, params?: QueryParams & {}) => Promise<{ data: types.Webhook; }>; /** * De-registers a webhook endpoint. * * DELETE /{account}/webhooks/{webhook} * * @see https://developer.dnsimple.com/v2/webhooks/webhooks/#deleteWebhook * * @param account The account id * @param webhook The webhoook id * @param params Query parameters */ deleteWebhook: (account: number, webhook: number, params?: QueryParams & {}) => Promise<{}>; }