@@ -13,191 +13,153 @@ As part of a given activity, it is possible to execute exe script commands and c
1313
1414## Table of contents
1515
16+ ### Constructors
17+
18+ - [ constructor] ( activity_activity.Activity#constructor )
19+
1620### Properties
1721
22+ - [ events] ( activity_activity.Activity#events )
1823- [ id] ( activity_activity.Activity#id )
1924- [ agreement] ( activity_activity.Activity#agreement )
20- - [ yagnaApi ] ( activity_activity.Activity#yagnaapi )
21- - [ options ] ( activity_activity.Activity#options )
25+ - [ currentState ] ( activity_activity.Activity#currentstate )
26+ - [ usage ] ( activity_activity.Activity#usage )
2227
2328### Methods
2429
25- - [ create] ( activity_activity.Activity#create )
2630- [ getProviderInfo] ( activity_activity.Activity#getproviderinfo )
27- - [ execute] ( activity_activity.Activity#execute )
28- - [ stop] ( activity_activity.Activity#stop )
31+ - [ createExeScriptExecutor] ( activity_activity.Activity#createexescriptexecutor )
2932- [ getState] ( activity_activity.Activity#getstate )
30- - [ send] ( activity_activity.Activity#send )
31-
32- ## Properties
3333
34- ### id
35-
36- • ` Readonly ` ** id** : ` string `
34+ ## Constructors
3735
38- activity ID
36+ ### constructor
3937
40- #### Defined in
38+ • ** new Activity ** ( ` id ` , ` agreement ` , ` currentState? ` , ` usage ` ): [ ` Activity ` ] ( activity_activity.Activity )
4139
42- [ src/activity/activity.ts:62] ( https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L62 )
43-
44- ___
40+ #### Parameters
4541
46- ### agreement
42+ | Name | Type | Default value | Description |
43+ | :------ | :------ | :------ | :------ |
44+ | ` id ` | ` string ` | ` undefined ` | The ID of the activity in Yagna |
45+ | ` agreement ` | [ ` Agreement ` ] ( market_agreement_agreement.Agreement ) | ` undefined ` | The agreement that's related to this activity |
46+ | ` currentState ` | [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum ) | ` ActivityStateEnum.New ` | The current state as it was obtained from yagna |
47+ | ` usage ` | ` ActivityUsageInfo ` | ` undefined ` | Current resource usage vector information |
4748
48- • ` Readonly ` ** agreement ** : ` Agreement `
49+ #### Returns
4950
50- Agreement
51+ [ ` Activity ` ] ( activity_activity.Activity )
5152
5253#### Defined in
5354
54- [ src/activity/activity.ts:63 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L63 )
55+ [ src/activity/activity.ts:49 ] ( https://github.com/golemfactory/golem-js/blob/1d89cb07 /src/activity/activity.ts#L49 )
5556
56- ___
57-
58- ### yagnaApi
57+ ## Properties
5958
60- • ` Protected ` ` Readonly ` ** yagnaApi ** : [ ` YagnaApi ` ] ( ../modules/utils_yagna_yagna#yagnaapi )
59+ ### events
6160
62- [ YagnaApi ] ( ../modules/utils_yagna_yagna#yagnaapi )
61+ • ` Readonly ` ** events ** : ` EventEmitter ` \< [ ` ActivityEvents ` ] ( ../interfaces/activity_activity.ActivityEvents ) , ` any ` \>
6362
6463#### Defined in
6564
66- [ src/activity/activity.ts:64 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L64 )
65+ [ src/activity/activity.ts:41 ] ( https://github.com/golemfactory/golem-js/blob/1d89cb07 /src/activity/activity.ts#L41 )
6766
6867___
6968
70- ### options
69+ ### id
7170
72- • ` Protected ` ` Readonly ` ** options ** : ` ActivityConfig `
71+ • ` Readonly ` ** id ** : ` string `
7372
74- [ ActivityOptions ] ( ../interfaces/activity_activity.ActivityOptions )
73+ The ID of the activity in Yagna
7574
7675#### Defined in
7776
78- [ src/activity/activity.ts:65] ( https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L65 )
79-
80- ## Methods
81-
82- ### create
77+ [ src/activity/activity.ts:50] ( https://github.com/golemfactory/golem-js/blob/1d89cb07/src/activity/activity.ts#L50 )
8378
84- ▸ ** create** (` agreement ` , ` yagnaApi ` , ` options? ` , ` secure? ` ): ` Promise ` \< [ ` Activity ` ] ( activity_activity.Activity ) \>
85-
86- Create activity for given agreement ID
87-
88- #### Parameters
89-
90- | Name | Type | Default value | Description |
91- | :------ | :------ | :------ | :------ |
92- | ` agreement ` | ` Agreement ` | ` undefined ` | |
93- | ` yagnaApi ` | [ ` YagnaApi ` ] ( ../modules/utils_yagna_yagna#yagnaapi ) | ` undefined ` | |
94- | ` options? ` | [ ` ActivityOptions ` ] ( ../interfaces/activity_activity.ActivityOptions ) | ` undefined ` | [ ActivityOptions] ( ../interfaces/activity_activity.ActivityOptions ) |
95- | ` secure ` | ` boolean ` | ` false ` | defines if activity will be secure type |
79+ ___
9680
97- #### Returns
81+ ### agreement
9882
99- ` Promise ` \< [ ` Activity ` ] ( activity_activity.Activity ) \>
83+ • ` Readonly ` ** agreement ** : [ ` Agreement ` ] ( market_agreement_agreement.Agreement )
10084
101- Activity
85+ The agreement that's related to this activity
10286
10387#### Defined in
10488
105- [ src/activity/activity.ts:79 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L79 )
89+ [ src/activity/activity.ts:51 ] ( https://github.com/golemfactory/golem-js/blob/1d89cb07 /src/activity/activity.ts#L51 )
10690
10791___
10892
109- ### getProviderInfo
110-
111- ▸ ** getProviderInfo** (): [ ` ProviderInfo ` ] ( ../interfaces/agreement_agreement.ProviderInfo )
93+ ### currentState
11294
113- #### Returns
95+ • ` Protected ` ` Readonly ` ** currentState ** : [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum ) = ` ActivityStateEnum.New `
11496
115- [ ` ProviderInfo ` ] ( ../interfaces/agreement_agreement.ProviderInfo )
97+ The current state as it was obtained from yagna
11698
11799#### Defined in
118100
119- [ src/activity/activity.ts:89 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L89 )
101+ [ src/activity/activity.ts:52 ] ( https://github.com/golemfactory/golem-js/blob/1d89cb07 /src/activity/activity.ts#L52 )
120102
121103___
122104
123- ### execute
124-
125- ▸ ** execute** (` script ` , ` stream? ` , ` timeout? ` ): ` Promise ` \< ` Readable ` \>
105+ ### usage
126106
127- Execute script
128-
129- #### Parameters
107+ • ` Protected ` ` Readonly ` ** usage** : ` ActivityUsageInfo `
130108
131- | Name | Type | Description |
132- | :------ | :------ | :------ |
133- | ` script ` | [ ` ExeScriptRequest ` ] ( ../interfaces/activity_activity.ExeScriptRequest ) | exe script request |
134- | ` stream? ` | ` boolean ` | define type of getting results from execution (polling or streaming) |
135- | ` timeout? ` | ` number ` | execution timeout |
136-
137- #### Returns
138-
139- ` Promise ` \< ` Readable ` \>
109+ Current resource usage vector information
140110
141111#### Defined in
142112
143- [ src/activity/activity.ts:100 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L100 )
113+ [ src/activity/activity.ts:53 ] ( https://github.com/golemfactory/golem-js/blob/1d89cb07 /src/activity/activity.ts#L53 )
144114
145- ___
146-
147- ### stop
115+ ## Methods
148116
149- ▸ ** stop ** (): ` Promise ` \< ` boolean ` \>
117+ ### getProviderInfo
150118
151- Stop and destroy activity
119+ ▸ ** getProviderInfo ** (): [ ` ProviderInfo ` ] ( ../interfaces/market_agreement_agreement.ProviderInfo )
152120
153121#### Returns
154122
155- ` Promise ` \< ` boolean ` \>
156-
157- boolean
123+ [ ` ProviderInfo ` ] ( ../interfaces/market_agreement_agreement.ProviderInfo )
158124
159125#### Defined in
160126
161- [ src/activity/activity.ts:138 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L138 )
127+ [ src/activity/activity.ts:56 ] ( https://github.com/golemfactory/golem-js/blob/1d89cb07 /src/activity/activity.ts#L56 )
162128
163129___
164130
165- ### getState
166-
167- ▸ ** getState** (): ` Promise ` \< [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum ) \>
131+ ### createExeScriptExecutor
168132
169- Getting current state of activity
133+ ▸ ** createExeScriptExecutor ** ( ` activityApi ` , ` logger ` , ` options? ` ): [ ` ExeScriptExecutor ` ] ( activity_exe_script_executor.ExeScriptExecutor )
170134
171- #### Returns
135+ Temporary helper method that will build a script executor bound to this activity
172136
173- ` Promise ` \< [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum ) \>
137+ #### Parameters
174138
175- state
139+ | Name | Type |
140+ | :------ | :------ |
141+ | ` activityApi ` | [ ` IActivityApi ` ] ( ../interfaces/activity_types.IActivityApi ) |
142+ | ` logger ` | [ ` Logger ` ] ( ../interfaces/shared_utils_logger_logger.Logger ) |
143+ | ` options? ` | [ ` ExecutionOptions ` ] ( ../interfaces/activity_exe_script_executor.ExecutionOptions ) |
176144
177- ** ` Throws ` **
145+ #### Returns
178146
179- Error when cannot query the state
147+ [ ` ExeScriptExecutor ` ] ( activity_exe_script_executor.ExeScriptExecutor )
180148
181149#### Defined in
182150
183- [ src/activity/activity.ts:150 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L150 )
151+ [ src/activity/activity.ts:63 ] ( https://github.com/golemfactory/golem-js/blob/1d89cb07 /src/activity/activity.ts#L63 )
184152
185153___
186154
187- ### send
188-
189- ▸ ** send** (` script ` ): ` Promise ` \< ` string ` \>
190-
191- #### Parameters
155+ ### getState
192156
193- | Name | Type |
194- | :------ | :------ |
195- | ` script ` | [ ` ExeScriptRequest ` ] ( ../interfaces/activity_activity.ExeScriptRequest ) |
157+ ▸ ** getState** (): [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum )
196158
197159#### Returns
198160
199- ` Promise ` \< ` string ` \>
161+ [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum )
200162
201163#### Defined in
202164
203- [ src/activity/activity.ts:176 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L176 )
165+ [ src/activity/activity.ts:67 ] ( https://github.com/golemfactory/golem-js/blob/1d89cb07 /src/activity/activity.ts#L67 )
0 commit comments