JS API Reference

Class: Transfer<T>

activity/script/command.Transfer

Generic command that can be send to an exe-unit via yagna's API

Type parameters

NameType
Tunknown

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Transfer<T>(from?, to?, args?): Transfer<T>

Type parameters

NameType
Tunknown

Parameters

NameType
from?string
to?string
args?object

Returns

Transfer<T>

Overrides

Command.constructor

Defined in

src/activity/script/command.ts:109

Properties

from

Protected Optional from: string

Defined in

src/activity/script/command.ts:110


to

Protected Optional to: string

Defined in

src/activity/script/command.ts:111


args

Protected args: Record<string, unknown>

Inherited from

Command.args

Defined in

src/activity/script/command.ts:16

Methods

toJson

toJson(): Object

Serializes the command to a JSON representation

Returns

Object

Inherited from

Command.toJson

Defined in

src/activity/script/command.ts:28


toExeScriptRequest

toExeScriptRequest(): ExeScriptRequest

Converts the command into

Returns

ExeScriptRequest

Inherited from

Command.toExeScriptRequest

Defined in

src/activity/script/command.ts:37


before

before(): Promise<void>

Setup local environment for executing this command.

Returns

Promise<void>

Inherited from

Command.before

Defined in

src/activity/script/command.ts:44


after

after(result?): Promise<Result<T>>

Cleanup local setup that was needed for the command to run.

It is called after the command was sent to the activity, and the command was processed.

When run within scripts or batch commands, after() might be called without any results, as one of the previous commands might have failed. In this case, the command should still cleanup its local setup and return an empty error result.

Parameters

NameType
result?Result<T>

Returns

Promise<Result<T>>

Inherited from

Command.after

Defined in

src/activity/script/command.ts:57

Was this helpful?