Skip to content

Class: Activity

activity/activity.Activity

Activity module - an object representing the runtime environment on the provider in accordance with the Package specification. As part of a given activity, it is possible to execute exe script commands and capture their results.

Table of contents

Methods

Properties

Methods

create

Static create(agreementId, options?, secure?): Promise<Activity>

Create activity for given agreement ID

Parameters

Name Type Default value Description
agreementId string undefined
options? ActivityOptions undefined ActivityOptions
secure boolean false defines if activity will be secure type

Returns

Promise<Activity>

Activity

Defined in

yajsapi/activity/activity.ts:78


execute

execute(script, stream?, timeout?): Promise<Readable>

Execute script

Parameters

Name Type Description
script ExeScriptRequest exe script request
stream? boolean define type of getting results from execution (polling or streaming)
timeout? number execution timeout

Returns

Promise<Readable>

Defined in

yajsapi/activity/activity.ts:90


stop

stop(): Promise<boolean>

Stop and destroy activity

Returns

Promise<boolean>

boolean

Defined in

yajsapi/activity/activity.ts:115


getState

getState(): Promise<ActivityStateEnum>

Getting current state of activity

Throws

Error when cannot query the state

Returns

Promise<ActivityStateEnum>

state

Defined in

yajsapi/activity/activity.ts:127


send

Protected send(script): Promise<string>

Parameters

Name Type
script ExeScriptRequest

Returns

Promise<string>

Defined in

yajsapi/activity/activity.ts:138

Properties

id

Readonly id: any

activity ID

Defined in

yajsapi/activity/activity.ts:66


agreementId

Readonly agreementId: any

agreement ID

Defined in

yajsapi/activity/activity.ts:66


options

Protected Readonly options: ActivityConfig

ActivityOptions

Defined in

yajsapi/activity/activity.ts:66