UNPKG

auth0

Version:

Auth0 Node.js SDK for the Management API v2.

115 lines (114 loc) 5.05 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"; export declare namespace RulesClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class RulesClient { protected readonly _options: NormalizedClientOptionsWithAuth<RulesClient.Options>; constructor(options: RulesClient.Options); /** * Retrieve a filtered list of <a href="https://auth0.com/docs/rules">rules</a>. Accepts a list of fields to include or exclude. * * @param {Management.ListRulesRequestParameters} request * @param {RulesClient.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.rules.list({ * page: 1, * per_page: 1, * include_totals: true, * enabled: true, * fields: "fields", * include_fields: true * }) */ list(request?: Management.ListRulesRequestParameters, requestOptions?: RulesClient.RequestOptions): Promise<core.Page<Management.Rule, Management.ListRulesOffsetPaginatedResponseContent>>; /** * Create a <a href="https://auth0.com/docs/rules#create-a-new-rule-using-the-management-api">new rule</a>. * * Note: Changing a rule's stage of execution from the default <code>login_success</code> can change the rule's function signature to have user omitted. * * @param {Management.CreateRuleRequestContent} request * @param {RulesClient.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.rules.create({ * name: "name", * script: "script" * }) */ create(request: Management.CreateRuleRequestContent, requestOptions?: RulesClient.RequestOptions): core.HttpResponsePromise<Management.CreateRuleResponseContent>; private __create; /** * Retrieve <a href="https://auth0.com/docs/rules">rule</a> details. Accepts a list of fields to include or exclude in the result. * * @param {string} id - ID of the rule to retrieve. * @param {Management.GetRuleRequestParameters} request * @param {RulesClient.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.rules.get("id", { * fields: "fields", * include_fields: true * }) */ get(id: string, request?: Management.GetRuleRequestParameters, requestOptions?: RulesClient.RequestOptions): core.HttpResponsePromise<Management.GetRuleResponseContent>; private __get; /** * Delete a rule. * * @param {string} id - ID of the rule to delete. * @param {RulesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.TooManyRequestsError} * * @example * await client.rules.delete("id") */ delete(id: string, requestOptions?: RulesClient.RequestOptions): core.HttpResponsePromise<void>; private __delete; /** * Update an existing rule. * * @param {string} id - ID of the rule to retrieve. * @param {Management.UpdateRuleRequestContent} request * @param {RulesClient.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.rules.update("id") */ update(id: string, request?: Management.UpdateRuleRequestContent, requestOptions?: RulesClient.RequestOptions): core.HttpResponsePromise<Management.UpdateRuleResponseContent>; private __update; }