Skip to main content

Interface: NexusServiceClient<T>

A Nexus client for invoking Nexus Operations for a specific service from a Workflow.

Type Parameters​

T​

T extends nexus.ServiceDefinition

Methods​

executeOperation()​

Call Signature​

executeOperation<O>(op, input, options?): Promise<OperationOutput<O>>

Start a Nexus Operation and wait for its completion taking a nexus.operation. Returns the operation's result.

Type Parameters​
O​

O extends OperationDefinition<any, any>

Parameters​
op​

O

input​

OperationInput<O>

options?​

Partial<StartNexusOperationOptions>

Returns​

Promise<OperationOutput<O>>

Call Signature​

executeOperation<K>(op, input, options?): Promise<OperationOutput<T["operations"][K]>>

Start a Nexus Operation and wait for its completion, taking an Operation's property name. Returns the operation's result.

An Operation's property name is the name of the property used to define that Operation in the nexus.ServiceDefinition object; it may differ from the value of the name property if one was explicitly specified on the nexus.OperationDefinition object.

Type Parameters​
K​

K extends string

Parameters​
op​

K

input​

OperationInput<T["operations"][K]>

options?​

Partial<StartNexusOperationOptions>

Returns​

Promise<OperationOutput<T["operations"][K]>>


startOperation()​

Call Signature​

startOperation<O>(op, input, options?): Promise<NexusOperationHandle<OperationOutput<O>>>

Start a Nexus Operation taking a nexus.operation.

Returns a handle that can be used to wait for the Operation's result.

Type Parameters​
O​

O extends OperationDefinition<any, any>

Parameters​
op​

O

input​

OperationInput<O>

options?​

Partial<StartNexusOperationOptions>

Returns​

Promise<NexusOperationHandle<OperationOutput<O>>>

Call Signature​

startOperation<K>(op, input, options?): Promise<NexusOperationHandle<OperationOutput<T["operations"][K]>>>

Start a Nexus Operation, taking an Operation's property name. Returns a handle that can be used to wait for the Operation's result.

An Operation's property name is the name of the property used to define that Operation in the nexus.ServiceDefinition object; it may differ from the value of the name property if one was explicitly specified on the nexus.OperationDefinition object.

Type Parameters​
K​

K extends string

Parameters​
op​

K

input​

OperationInput<T["operations"][K]>

options?​

Partial<StartNexusOperationOptions>

Returns​

Promise<NexusOperationHandle<OperationOutput<T["operations"][K]>>>