@@ -13,191 +13,149 @@ 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
1822- [ id] ( activity_activity.Activity#id )
1923- [ agreement] ( activity_activity.Activity#agreement )
20- - [ yagnaApi] ( activity_activity.Activity#yagnaapi )
21- - [ options] ( activity_activity.Activity#options )
24+ - [ currentState] ( activity_activity.Activity#currentstate )
25+ - [ previousState] ( activity_activity.Activity#previousstate )
26+ - [ usage] ( activity_activity.Activity#usage )
2227
23- ### Methods
28+ ### Accessors
2429
25- - [ create] ( activity_activity.Activity#create )
26- - [ getProviderInfo] ( activity_activity.Activity#getproviderinfo )
27- - [ execute] ( activity_activity.Activity#execute )
28- - [ stop] ( activity_activity.Activity#stop )
29- - [ getState] ( activity_activity.Activity#getstate )
30- - [ send] ( activity_activity.Activity#send )
30+ - [ provider] ( activity_activity.Activity#provider )
3131
32- ## Properties
33-
34- ### id
32+ ### Methods
3533
36- • ` Readonly ` ** id** : ` string `
34+ - [ getState] ( activity_activity.Activity#getstate )
35+ - [ getPreviousState] ( activity_activity.Activity#getpreviousstate )
3736
38- activity ID
37+ ## Constructors
3938
40- #### Defined in
39+ ### constructor
4140
42- [ src/activity/activity.ts:62 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L62 )
41+ • ** new Activity ** ( ` id ` , ` agreement ` , ` currentState? ` , ` previousState? ` , ` usage ` ): [ ` Activity ` ] ( activity_activity.Activity )
4342
44- ___
43+ #### Parameters
4544
46- ### agreement
45+ | Name | Type | Default value | Description |
46+ | :------ | :------ | :------ | :------ |
47+ | ` id ` | ` string ` | ` undefined ` | The ID of the activity in Yagna |
48+ | ` agreement ` | [ ` Agreement ` ] ( market_agreement_agreement.Agreement ) | ` undefined ` | The agreement that's related to this activity |
49+ | ` currentState ` | [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum ) | ` ActivityStateEnum.New ` | The current state as it was obtained from yagna |
50+ | ` previousState ` | [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum ) | ` ActivityStateEnum.Unknown ` | The previous state (or New if this is the first time we're creating the activity) |
51+ | ` usage ` | [ ` ActivityUsageInfo ` ] ( ../modules/activity_activity#activityusageinfo ) | ` undefined ` | Current resource usage vector information |
4752
48- • ` Readonly ` ** agreement ** : ` Agreement `
53+ #### Returns
4954
50- Agreement
55+ [ ` Activity ` ] ( activity_activity.Activity )
5156
5257#### Defined in
5358
54- [ src/activity/activity.ts:63 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L63 )
59+ [ src/activity/activity.ts:37 ] ( https://github.com/golemfactory/golem-js/blob/570126bc /src/activity/activity.ts#L37 )
5560
56- ___
61+ ## Properties
5762
58- ### yagnaApi
63+ ### id
5964
60- • ` Protected ` ` Readonly ` ** yagnaApi ** : [ ` YagnaApi ` ] ( ../modules/utils_yagna_yagna#yagnaapi )
65+ • ` Readonly ` ** id ** : ` string `
6166
62- [ YagnaApi ] ( ../modules/utils_yagna_yagna#yagnaapi )
67+ The ID of the activity in Yagna
6368
6469#### Defined in
6570
66- [ src/activity/activity.ts:64 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L64 )
71+ [ src/activity/activity.ts:38 ] ( https://github.com/golemfactory/golem-js/blob/570126bc /src/activity/activity.ts#L38 )
6772
6873___
6974
70- ### options
75+ ### agreement
7176
72- • ` Protected ` ` Readonly ` ** options ** : ` ActivityConfig `
77+ • ` Readonly ` ** agreement ** : [ ` Agreement ` ] ( market_agreement_agreement.Agreement )
7378
74- [ ActivityOptions ] ( ../interfaces/activity_activity.ActivityOptions )
79+ The agreement that's related to this activity
7580
7681#### Defined in
7782
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
83-
84- ▸ ** create** (` agreement ` , ` yagnaApi ` , ` options? ` , ` secure? ` ): ` Promise ` \< [ ` Activity ` ] ( activity_activity.Activity ) \>
85-
86- Create activity for given agreement ID
83+ [ src/activity/activity.ts:39] ( https://github.com/golemfactory/golem-js/blob/570126bc/src/activity/activity.ts#L39 )
8784
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 |
85+ ___
9686
97- #### Returns
87+ ### currentState
9888
99- ` Promise ` \< [ ` Activity ` ] ( activity_activity.Activity ) \>
89+ • ` Protected ` ` Readonly ` ** currentState ** : [ ` ActivityStateEnum ` ] ( ../enums/ activity_activity.ActivityStateEnum ) = ` ActivityStateEnum.New `
10090
101- Activity
91+ The current state as it was obtained from yagna
10292
10393#### Defined in
10494
105- [ src/activity/activity.ts:79 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L79 )
95+ [ src/activity/activity.ts:40 ] ( https://github.com/golemfactory/golem-js/blob/570126bc /src/activity/activity.ts#L40 )
10696
10797___
10898
109- ### getProviderInfo
99+ ### previousState
110100
111- ▸ ** getProviderInfo ** () : [ ` ProviderInfo ` ] ( ../interfaces/agreement_agreement.ProviderInfo )
101+ • ` Protected ` ` Readonly ` ** previousState ** : [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum ) = ` ActivityStateEnum.Unknown `
112102
113- #### Returns
114-
115- [ ` ProviderInfo ` ] ( ../interfaces/agreement_agreement.ProviderInfo )
103+ The previous state (or New if this is the first time we're creating the activity)
116104
117105#### Defined in
118106
119- [ src/activity/activity.ts:89 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L89 )
107+ [ src/activity/activity.ts:41 ] ( https://github.com/golemfactory/golem-js/blob/570126bc /src/activity/activity.ts#L41 )
120108
121109___
122110
123- ### execute
124-
125- ▸ ** execute** (` script ` , ` stream? ` , ` timeout? ` ): ` Promise ` \< ` Readable ` \>
126-
127- Execute script
128-
129- #### Parameters
130-
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 |
111+ ### usage
136112
137- #### Returns
113+ • ` Protected ` ` Readonly ` ** usage ** : [ ` ActivityUsageInfo ` ] ( ../modules/activity_activity#activityusageinfo )
138114
139- ` Promise ` \< ` Readable ` \>
115+ Current resource usage vector information
140116
141117#### Defined in
142118
143- [ src/activity/activity.ts:100] ( https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L100 )
144-
145- ___
119+ [ src/activity/activity.ts:42] ( https://github.com/golemfactory/golem-js/blob/570126bc/src/activity/activity.ts#L42 )
146120
147- ### stop
121+ ## Accessors
148122
149- ▸ ** stop ** (): ` Promise ` \< ` boolean ` \>
123+ ### provider
150124
151- Stop and destroy activity
125+ • ` get ` ** provider ** (): [ ` ProviderInfo ` ] ( ../interfaces/market_agreement_agreement.ProviderInfo )
152126
153127#### Returns
154128
155- ` Promise ` \< ` boolean ` \>
156-
157- boolean
129+ [ ` ProviderInfo ` ] ( ../interfaces/market_agreement_agreement.ProviderInfo )
158130
159131#### Defined in
160132
161- [ src/activity/activity.ts:138 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L138 )
133+ [ src/activity/activity.ts:45 ] ( https://github.com/golemfactory/golem-js/blob/570126bc /src/activity/activity.ts#L45 )
162134
163- ___
135+ ## Methods
164136
165137### getState
166138
167- ▸ ** getState** (): ` Promise ` \< [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum ) \>
168-
169- Getting current state of activity
139+ ▸ ** getState** (): [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum )
170140
171141#### Returns
172142
173- ` Promise ` \< [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum ) \>
174-
175- state
176-
177- ** ` Throws ` **
178-
179- Error when cannot query the state
143+ [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum )
180144
181145#### Defined in
182146
183- [ src/activity/activity.ts:150 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L150 )
147+ [ src/activity/activity.ts:49 ] ( https://github.com/golemfactory/golem-js/blob/570126bc /src/activity/activity.ts#L49 )
184148
185149___
186150
187- ### send
188-
189- ▸ ** send** (` script ` ): ` Promise ` \< ` string ` \>
190-
191- #### Parameters
151+ ### getPreviousState
192152
193- | Name | Type |
194- | :------ | :------ |
195- | ` script ` | [ ` ExeScriptRequest ` ] ( ../interfaces/activity_activity.ExeScriptRequest ) |
153+ ▸ ** getPreviousState** (): [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum )
196154
197155#### Returns
198156
199- ` Promise ` \< ` string ` \>
157+ [ ` ActivityStateEnum ` ] ( ../enums/activity_activity.ActivityStateEnum )
200158
201159#### Defined in
202160
203- [ src/activity/activity.ts:176 ] ( https://github.com/golemfactory/golem-js/blob/7cee55b /src/activity/activity.ts#L176 )
161+ [ src/activity/activity.ts:53 ] ( https://github.com/golemfactory/golem-js/blob/570126bc /src/activity/activity.ts#L53 )
0 commit comments