UNPKG

auth0

Version:

Auth0 Node.js SDK for the Management API v2.

116 lines (115 loc) 4.97 kB
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; import * as core from "../../../../core/index.js"; import * as Management from "../../../index.js"; import { SecretsClient } from "../resources/secrets/client/Client.js"; export declare namespace HooksClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class HooksClient { protected readonly _options: NormalizedClientOptionsWithAuth<HooksClient.Options>; protected _secrets: SecretsClient | undefined; constructor(options: HooksClient.Options); get secrets(): SecretsClient; /** * Retrieve all <a href="https://auth0.com/docs/hooks">hooks</a>. Accepts a list of fields to include or exclude in the result. * * @param {Management.ListHooksRequestParameters} request * @param {HooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.NotFoundError} * @throws {@link Management.TooManyRequestsError} * * @example * await client.hooks.list({ * page: 1, * per_page: 1, * include_totals: true, * enabled: true, * fields: "fields", * triggerId: "credentials-exchange" * }) */ list(request?: Management.ListHooksRequestParameters, requestOptions?: HooksClient.RequestOptions): Promise<core.Page<Management.Hook, Management.ListHooksOffsetPaginatedResponseContent>>; /** * Create a new hook. * * @param {Management.CreateHookRequestContent} request * @param {HooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.ConflictError} * @throws {@link Management.TooManyRequestsError} * * @example * await client.hooks.create({ * name: "name", * script: "script", * triggerId: "credentials-exchange" * }) */ create(request: Management.CreateHookRequestContent, requestOptions?: HooksClient.RequestOptions): core.HttpResponsePromise<Management.CreateHookResponseContent>; private __create; /** * Retrieve <a href="https://auth0.com/docs/hooks">a hook</a> by its ID. Accepts a list of fields to include in the result. * * @param {string} id - ID of the hook to retrieve. * @param {Management.GetHookRequestParameters} request * @param {HooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.NotFoundError} * @throws {@link Management.TooManyRequestsError} * * @example * await client.hooks.get("id", { * fields: "fields" * }) */ get(id: string, request?: Management.GetHookRequestParameters, requestOptions?: HooksClient.RequestOptions): core.HttpResponsePromise<Management.GetHookResponseContent>; private __get; /** * Delete a hook. * * @param {string} id - ID of the hook to delete. * @param {HooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.TooManyRequestsError} * * @example * await client.hooks.delete("id") */ delete(id: string, requestOptions?: HooksClient.RequestOptions): core.HttpResponsePromise<void>; private __delete; /** * Update an existing hook. * * @param {string} id - ID of the hook to update. * @param {Management.UpdateHookRequestContent} request * @param {HooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.NotFoundError} * @throws {@link Management.ConflictError} * @throws {@link Management.TooManyRequestsError} * * @example * await client.hooks.update("id") */ update(id: string, request?: Management.UpdateHookRequestContent, requestOptions?: HooksClient.RequestOptions): core.HttpResponsePromise<Management.UpdateHookResponseContent>; private __update; }