UNPKG

auth0

Version:

Auth0 Node.js SDK for the Management API v2.

113 lines (112 loc) 5.42 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 { PermissionsClient } from "../resources/permissions/client/Client.js"; import { UsersClient } from "../resources/users/client/Client.js"; export declare namespace RolesClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class RolesClient { protected readonly _options: NormalizedClientOptionsWithAuth<RolesClient.Options>; protected _permissions: PermissionsClient | undefined; protected _users: UsersClient | undefined; constructor(options: RolesClient.Options); get permissions(): PermissionsClient; get users(): UsersClient; /** * Retrieve detailed list of user roles created in your tenant. * * <b>Note</b>: The returned list does not include standard roles available for tenant members, such as Admin or Support Access. * * @param {Management.ListRolesRequestParameters} request * @param {RolesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.TooManyRequestsError} * * @example * await client.roles.list({ * per_page: 1, * page: 1, * include_totals: true, * name_filter: "name_filter" * }) */ list(request?: Management.ListRolesRequestParameters, requestOptions?: RolesClient.RequestOptions): Promise<core.Page<Management.Role, Management.ListRolesOffsetPaginatedResponseContent>>; /** * Create a user role for <a href="https://auth0.com/docs/manage-users/access-control/rbac">Role-Based Access Control</a>. * * <b>Note</b>: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions. * * @param {Management.CreateRoleRequestContent} request * @param {RolesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.TooManyRequestsError} * * @example * await client.roles.create({ * name: "name" * }) */ create(request: Management.CreateRoleRequestContent, requestOptions?: RolesClient.RequestOptions): core.HttpResponsePromise<Management.CreateRoleResponseContent>; private __create; /** * Retrieve details about a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. * * @param {string} id - ID of the role to retrieve. * @param {RolesClient.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.roles.get("id") */ get(id: string, requestOptions?: RolesClient.RequestOptions): core.HttpResponsePromise<Management.GetRoleResponseContent>; private __get; /** * Delete a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> from your tenant. Once deleted, it is removed from any user who was previously assigned that role. This action cannot be undone. * * @param {string} id - ID of the role to delete. * @param {RolesClient.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.roles.delete("id") */ delete(id: string, requestOptions?: RolesClient.RequestOptions): core.HttpResponsePromise<void>; private __delete; /** * Modify the details of a specific <a href="https://auth0.com/docs/manage-users/access-control/rbac">user role</a> specified by ID. * * @param {string} id - ID of the role to update. * @param {Management.UpdateRoleRequestContent} request * @param {RolesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.TooManyRequestsError} * * @example * await client.roles.update("id") */ update(id: string, request?: Management.UpdateRoleRequestContent, requestOptions?: RolesClient.RequestOptions): core.HttpResponsePromise<Management.UpdateRoleResponseContent>; private __update; }