UNPKG

auth0

Version:

Auth0 Node.js SDK for the Management API v2.

159 lines (158 loc) 8.08 kB
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs"; import * as core from "../../../../core/index.mjs"; import * as Management from "../../../index.mjs"; import { ClientGrantsClient } from "../resources/clientGrants/client/Client.mjs"; import { ConnectionsClient } from "../resources/connections/client/Client.mjs"; import { DiscoveryDomainsClient } from "../resources/discoveryDomains/client/Client.mjs"; import { EnabledConnectionsClient } from "../resources/enabledConnections/client/Client.mjs"; import { GroupsClient } from "../resources/groups/client/Client.mjs"; import { InvitationsClient } from "../resources/invitations/client/Client.mjs"; import { MembersClient } from "../resources/members/client/Client.mjs"; export declare namespace OrganizationsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class OrganizationsClient { protected readonly _options: NormalizedClientOptionsWithAuth<OrganizationsClient.Options>; protected _clientGrants: ClientGrantsClient | undefined; protected _connections: ConnectionsClient | undefined; protected _discoveryDomains: DiscoveryDomainsClient | undefined; protected _enabledConnections: EnabledConnectionsClient | undefined; protected _invitations: InvitationsClient | undefined; protected _members: MembersClient | undefined; protected _groups: GroupsClient | undefined; constructor(options: OrganizationsClient.Options); get clientGrants(): ClientGrantsClient; get connections(): ConnectionsClient; get discoveryDomains(): DiscoveryDomainsClient; get enabledConnections(): EnabledConnectionsClient; get invitations(): InvitationsClient; get members(): MembersClient; get groups(): GroupsClient; /** * Retrieve detailed list of all Organizations available in your tenant. For more information, see Auth0 Organizations. * * This endpoint supports two types of pagination: * * - Offset pagination * - Checkpoint pagination * * Checkpoint pagination must be used if you need to retrieve more than 1000 organizations. * * **Checkpoint Pagination** * * To search by checkpoint, use the following parameters: * * - `from`: Optional id from which to start selection. * - `take`: The total number of entries to retrieve when using the `from` parameter. Defaults to 50. * * **Note**: The first time you call this endpoint using checkpoint pagination, omit the `from` parameter. If there are more results, a `next` value is included in the response. You can use this for subsequent API calls. When `next` is no longer included in the response, no pages are remaining. * * @param {Management.ListOrganizationsRequestParameters} request * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.TooManyRequestsError} * * @example * await client.organizations.list({ * from: "from", * take: 1, * sort: "sort" * }) */ list(request?: Management.ListOrganizationsRequestParameters, requestOptions?: OrganizationsClient.RequestOptions): Promise<core.Page<Management.Organization, Management.ListOrganizationsPaginatedResponseContent>>; /** * Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review [Create Your First Organization](https://auth0.com/docs/manage-users/organizations/create-first-organization). * * @param {Management.CreateOrganizationRequestContent} request * @param {OrganizationsClient.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.organizations.create({ * name: "name" * }) */ create(request: Management.CreateOrganizationRequestContent, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<Management.CreateOrganizationResponseContent>; private __create; /** * Retrieve details about a single Organization specified by name. * * @param {string} name - name of the organization to retrieve. * @param {OrganizationsClient.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.organizations.getByName("name") */ getByName(name: string, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<Management.GetOrganizationByNameResponseContent>; private __getByName; /** * Retrieve details about a single Organization specified by ID. * * @param {string} id - ID of the organization to retrieve. * @param {OrganizationsClient.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.organizations.get("id") */ get(id: string, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<Management.GetOrganizationResponseContent>; private __get; /** * Remove an Organization from your tenant. This action cannot be undone. * * **Note**: Members are automatically disassociated from an Organization when it is deleted. However, this action does **not** delete these users from your tenant. * * @param {string} id - Organization identifier. * @param {OrganizationsClient.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.organizations.delete("id") */ delete(id: string, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<void>; private __delete; /** * Update the details of a specific [Organization](https://auth0.com/docs/manage-users/organizations/configure-organizations/create-organizations), such as name and display name, branding options, and metadata. * * @param {string} id - ID of the organization to update. * @param {Management.UpdateOrganizationRequestContent} request * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Management.BadRequestError} * @throws {@link Management.UnauthorizedError} * @throws {@link Management.ForbiddenError} * @throws {@link Management.TooManyRequestsError} * * @example * await client.organizations.update("id") */ update(id: string, request?: Management.UpdateOrganizationRequestContent, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<Management.UpdateOrganizationResponseContent>; private __update; }