Back to Node Auth0

Class ActionsClient

docs/classes/management.SDK.ActionsClient.html

5.9.113.4 KB
Original Source

Class ActionsClient

Index

Accessors

versionsexecutionsmodulestriggers

Constructors

constructor

Methods

listcreategetdeleteupdatedeploytest

Properties

_options_versions_executions_modules_triggers

Accessors

versions

get versions(): VersionsClient

Returns VersionsClient

executions

get executions(): ExecutionsClient

Returns ExecutionsClient

modules

get modules(): ModulesClient

Returns ModulesClient

triggers

get triggers(): TriggersClient

Returns TriggersClient

Constructors

constructor

new ActionsClient(options: BaseClientOptions): ActionsClient

Parameters

Returns ActionsClient

Methods

list

list(
request?: ListActionsRequestParameters,
requestOptions?: ActionsClient.RequestOptions,
): Promise<Page<Management.Action, ListActionsPaginatedResponseContent>>

Retrieve all actions.

Parameters

Request-specific configuration.

Returns Promise<Page<Management.Action, ListActionsPaginatedResponseContent>>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.actions.list({ triggerId: "post-login", actionName: "actionName", deployed: true, page: 1, per_page: 1, installed: true })Copy

create

create(
request: CreateActionRequestContent,
requestOptions?: ActionsClient.RequestOptions,
): HttpResponsePromise<CreateActionResponseContent>

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.

Parameters

Request-specific configuration.

Returns HttpResponsePromise<CreateActionResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.actions.create({ name: "name", supported_triggers: [{ id: "post-login" }] })Copy

get

get(
id: string,
requestOptions?: ActionsClient.RequestOptions,
): HttpResponsePromise<GetActionResponseContent>

Retrieve an action by its ID.

Parameters

  • id: string

The ID of the action to retrieve.

Request-specific configuration.

Returns HttpResponsePromise<GetActionResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.actions.get("id")Copy

delete

delete(
id: string,
request?: DeleteActionRequestParameters,
requestOptions?: ActionsClient.RequestOptions,
): HttpResponsePromise<void>

Deletes an action and all of its associated versions. An action must be unbound from all triggers before it can be deleted.

Parameters

  • id: string

The ID of the action to delete.

Request-specific configuration.

Returns HttpResponsePromise<void>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.actions.delete("id", { force: true })Copy

update

update(
id: string,
request?: UpdateActionRequestContent,
requestOptions?: ActionsClient.RequestOptions,
): HttpResponsePromise<UpdateActionResponseContent>

Update an existing action. If this action is currently bound to a trigger, updating it will not affect any user flows until the action is deployed.

Parameters

  • id: string

The id of the action to update.

Request-specific configuration.

Returns HttpResponsePromise<UpdateActionResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.NotFoundError

Throws

Management.TooManyRequestsError

Example

await client.actions.update("id")Copy

deploy

deploy(
id: string,
requestOptions?: ActionsClient.RequestOptions,
): HttpResponsePromise<DeployActionResponseContent>

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.

Parameters

  • id: string

The ID of an action.

Request-specific configuration.

Returns HttpResponsePromise<DeployActionResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.actions.deploy("id")Copy

test

test(
id: string,
request: TestActionRequestContent,
requestOptions?: ActionsClient.RequestOptions,
): HttpResponsePromise<TestActionResponseContent>

Test an action. After updating an action, it can be tested prior to being deployed to ensure it behaves as expected.

Parameters

  • id: string

The id of the action to test.

Request-specific configuration.

Returns HttpResponsePromise<TestActionResponseContent>

Throws

Management.BadRequestError

Throws

Management.UnauthorizedError

Throws

Management.ForbiddenError

Throws

Management.TooManyRequestsError

Example

await client.actions.test("id", { payload: { "key": "value" } })Copy

Properties

Protected Readonly_options

_options: NormalizedClientOptionsWithAuth<BaseClientOptions>

Protected_versions

_versions: VersionsClient | undefined

Protected_executions

_executions: ExecutionsClient | undefined

Protected_modules

_modules: ModulesClient | undefined

Protected_triggers

_triggers: TriggersClient | undefined

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Accessors versionsexecutionsmodulestriggers Constructors constructor Methods listcreategetdeleteupdatedeploytest Properties _options_versions_executions_modules_triggers