auth0
Version:
Auth0 Node.js SDK for the Management API v2.
158 lines (157 loc) • 7.34 kB
TypeScript
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 { ExecutionsClient } from "../resources/executions/client/Client.js";
import { TriggersClient } from "../resources/triggers/client/Client.js";
import { VersionsClient } from "../resources/versions/client/Client.js";
export declare namespace ActionsClient {
type Options = BaseClientOptions;
interface RequestOptions extends BaseRequestOptions {
}
}
export declare class ActionsClient {
protected readonly _options: NormalizedClientOptionsWithAuth<ActionsClient.Options>;
protected _versions: VersionsClient | undefined;
protected _executions: ExecutionsClient | undefined;
protected _triggers: TriggersClient | undefined;
constructor(options: ActionsClient.Options);
get versions(): VersionsClient;
get executions(): ExecutionsClient;
get triggers(): TriggersClient;
/**
* Retrieve all actions.
*
* @param {Management.ListActionsRequestParameters} request
* @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
* @throws {@link Management.TooManyRequestsError}
*
* @example
* await client.actions.list({
* triggerId: "triggerId",
* actionName: "actionName",
* deployed: true,
* page: 1,
* per_page: 1,
* installed: true
* })
*/
list(request?: Management.ListActionsRequestParameters, requestOptions?: ActionsClient.RequestOptions): Promise<core.Page<Management.Action, Management.ListActionsPaginatedResponseContent>>;
/**
* Create an action. Once an action is created, it must be deployed, and then bound to a trigger before it will be executed as part of a flow.
*
* @param {Management.CreateActionRequestContent} request
* @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
* @throws {@link Management.TooManyRequestsError}
*
* @example
* await client.actions.create({
* name: "name",
* supported_triggers: [{
* id: "id"
* }]
* })
*/
create(request: Management.CreateActionRequestContent, requestOptions?: ActionsClient.RequestOptions): core.HttpResponsePromise<Management.CreateActionResponseContent>;
private __create;
/**
* Retrieve an action by its ID.
*
* @param {string} id - The ID of the action to retrieve.
* @param {ActionsClient.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.actions.get("id")
*/
get(id: string, requestOptions?: ActionsClient.RequestOptions): core.HttpResponsePromise<Management.GetActionResponseContent>;
private __get;
/**
* Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted.
*
* @param {string} id - The ID of the action to delete.
* @param {Management.DeleteActionRequestParameters} request
* @param {ActionsClient.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.actions.delete("id", {
* force: true
* })
*/
delete(id: string, request?: Management.DeleteActionRequestParameters, requestOptions?: ActionsClient.RequestOptions): core.HttpResponsePromise<void>;
private __delete;
/**
* Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong> affect any user flows until the action is deployed.
*
* @param {string} id - The id of the action to update.
* @param {Management.UpdateActionRequestContent} request
* @param {ActionsClient.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.actions.update("id")
*/
update(id: string, request?: Management.UpdateActionRequestContent, requestOptions?: ActionsClient.RequestOptions): core.HttpResponsePromise<Management.UpdateActionResponseContent>;
private __update;
/**
* Deploy an action. Deploying an action will create a new immutable version of the action. If the action is currently bound to a trigger, then the system will begin executing the newly deployed version of the action immediately. Otherwise, the action will only be executed as a part of a flow once it is bound to that flow.
*
* @param {string} id - The ID of an action.
* @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
* @throws {@link Management.TooManyRequestsError}
*
* @example
* await client.actions.deploy("id")
*/
deploy(id: string, requestOptions?: ActionsClient.RequestOptions): core.HttpResponsePromise<Management.DeployActionResponseContent>;
private __deploy;
/**
* Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected.
*
* @param {string} id - The id of the action to test.
* @param {Management.TestActionRequestContent} request
* @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Management.BadRequestError}
* @throws {@link Management.UnauthorizedError}
* @throws {@link Management.ForbiddenError}
* @throws {@link Management.TooManyRequestsError}
*
* @example
* await client.actions.test("id", {
* payload: {
* "key": "value"
* }
* })
*/
test(id: string, request: Management.TestActionRequestContent, requestOptions?: ActionsClient.RequestOptions): core.HttpResponsePromise<Management.TestActionResponseContent>;
private __test;
}