JS API Reference

Class: ActivityApiAdapter

shared/yagna/adapters/activity-api-adapter.ActivityApiAdapter

Represents a set of use cases related to managing the lifetime of an activity

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new ActivityApiAdapter(state, control, exec, activityRepo): ActivityApiAdapter

Parameters

NameType
stateRequestorStateService
controlRequestorControlService
execYagnaExeScriptObserver
activityRepoIActivityRepository

Returns

ActivityApiAdapter

Defined in

src/shared/yagna/adapters/activity-api-adapter.ts:12

Methods

getActivity

getActivity(id): Promise<Activity>

Parameters

NameType
idstring

Returns

Promise<Activity>

Implementation of

IActivityApi.getActivity

Defined in

src/shared/yagna/adapters/activity-api-adapter.ts:19


createActivity

createActivity(agreement): Promise<Activity>

Parameters

NameType
agreementAgreement

Returns

Promise<Activity>

Implementation of

IActivityApi.createActivity

Defined in

src/shared/yagna/adapters/activity-api-adapter.ts:23


destroyActivity

destroyActivity(activity): Promise<Activity>

Parameters

NameType
activityActivity

Returns

Promise<Activity>

Implementation of

IActivityApi.destroyActivity

Defined in

src/shared/yagna/adapters/activity-api-adapter.ts:47


getActivityState

getActivityState(id): Promise<ActivityStateEnum>

Parameters

NameType
idstring

Returns

Promise<ActivityStateEnum>

Implementation of

IActivityApi.getActivityState

Defined in

src/shared/yagna/adapters/activity-api-adapter.ts:63


executeScript

executeScript(activity, script): Promise<string>

Parameters

NameType
activityActivity
scriptExeScriptRequest

Returns

Promise<string>

Implementation of

IActivityApi.executeScript

Defined in

src/shared/yagna/adapters/activity-api-adapter.ts:67


getExecBatchResults

getExecBatchResults(activity, batchId, commandIndex?, timeout?): Promise<Result<any>[]>

Parameters

NameType
activityActivity
batchIdstring
commandIndex?number
timeout?number

Returns

Promise<Result<any>[]>

Implementation of

IActivityApi.getExecBatchResults

Defined in

src/shared/yagna/adapters/activity-api-adapter.ts:82


getExecBatchEvents

getExecBatchEvents(activity, batchId): Observable<StreamingBatchEvent>

Parameters

NameType
activityActivity
batchIdstring

Returns

Observable<StreamingBatchEvent>

Implementation of

IActivityApi.getExecBatchEvents

Defined in

src/shared/yagna/adapters/activity-api-adapter.ts:104