Skip to content

Commit 653ea70

Browse files
authored
feat: Update golem-js API Reference for branch beta
1 parent 305e193 commit 653ea70

File tree

387 files changed

+24599
-12644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

387 files changed

+24599
-12644
lines changed

src/navigation/jsreference.js

Lines changed: 705 additions & 261 deletions
Large diffs are not rendered by default.

src/pages/docs/golem-js/reference/README.md

Lines changed: 284 additions & 145 deletions
Large diffs are not rendered by default.

src/pages/docs/golem-js/reference/classes/activity_activity.Activity.md

Lines changed: 44 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -13,191 +13,117 @@ 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+
- [usage](activity_activity.Activity#usage)
2226

2327
### Methods
2428

25-
- [create](activity_activity.Activity#create)
2629
- [getProviderInfo](activity_activity.Activity#getproviderinfo)
27-
- [execute](activity_activity.Activity#execute)
28-
- [stop](activity_activity.Activity#stop)
2930
- [getState](activity_activity.Activity#getstate)
30-
- [send](activity_activity.Activity#send)
3131

32-
## Properties
33-
34-
### id
32+
## Constructors
3533

36-
`Readonly` **id**: `string`
37-
38-
activity ID
39-
40-
#### Defined in
34+
### constructor
4135

42-
[src/activity/activity.ts:62](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L62)
36+
**new Activity**(`id`, `agreement`, `currentState?`, `usage`): [`Activity`](activity_activity.Activity)
4337

44-
___
38+
#### Parameters
4539

46-
### agreement
40+
| Name | Type | Default value | Description |
41+
| :------ | :------ | :------ | :------ |
42+
| `id` | `string` | `undefined` | The ID of the activity in Yagna |
43+
| `agreement` | [`Agreement`](market_agreement_agreement.Agreement) | `undefined` | The agreement that's related to this activity |
44+
| `currentState` | [`ActivityStateEnum`](../enums/activity_activity.ActivityStateEnum) | `ActivityStateEnum.New` | The current state as it was obtained from yagna |
45+
| `usage` | [`ActivityUsageInfo`](../modules/activity_activity#activityusageinfo) | `undefined` | Current resource usage vector information |
4746

48-
`Readonly` **agreement**: `Agreement`
47+
#### Returns
4948

50-
Agreement
49+
[`Activity`](activity_activity.Activity)
5150

5251
#### Defined in
5352

54-
[src/activity/activity.ts:63](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L63)
53+
[src/activity/activity.ts:36](https://github.com/golemfactory/golem-js/blob/2ee73d8e/src/activity/activity.ts#L36)
5554

56-
___
55+
## Properties
5756

58-
### yagnaApi
57+
### id
5958

60-
`Protected` `Readonly` **yagnaApi**: [`YagnaApi`](../modules/utils_yagna_yagna#yagnaapi)
59+
`Readonly` **id**: `string`
6160

62-
[YagnaApi](../modules/utils_yagna_yagna#yagnaapi)
61+
The ID of the activity in Yagna
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:37](https://github.com/golemfactory/golem-js/blob/2ee73d8e/src/activity/activity.ts#L37)
6766

6867
___
6968

70-
### options
71-
72-
`Protected` `Readonly` **options**: `ActivityConfig`
73-
74-
[ActivityOptions](../interfaces/activity_activity.ActivityOptions)
75-
76-
#### Defined in
77-
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
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 |
96-
97-
#### Returns
69+
### agreement
9870

99-
`Promise`\<[`Activity`](activity_activity.Activity)\>
71+
`Readonly` **agreement**: [`Agreement`](market_agreement_agreement.Agreement)
10072

101-
Activity
73+
The agreement that's related to this activity
10274

10375
#### Defined in
10476

105-
[src/activity/activity.ts:79](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L79)
77+
[src/activity/activity.ts:38](https://github.com/golemfactory/golem-js/blob/2ee73d8e/src/activity/activity.ts#L38)
10678

10779
___
10880

109-
### getProviderInfo
81+
### currentState
11082

111-
**getProviderInfo**(): [`ProviderInfo`](../interfaces/agreement_agreement.ProviderInfo)
83+
`Protected` `Readonly` **currentState**: [`ActivityStateEnum`](../enums/activity_activity.ActivityStateEnum) = `ActivityStateEnum.New`
11284

113-
#### Returns
114-
115-
[`ProviderInfo`](../interfaces/agreement_agreement.ProviderInfo)
85+
The current state as it was obtained from yagna
11686

11787
#### Defined in
11888

119-
[src/activity/activity.ts:89](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L89)
89+
[src/activity/activity.ts:39](https://github.com/golemfactory/golem-js/blob/2ee73d8e/src/activity/activity.ts#L39)
12090

12191
___
12292

123-
### execute
124-
125-
**execute**(`script`, `stream?`, `timeout?`): `Promise`\<`Readable`\>
93+
### usage
12694

127-
Execute script
128-
129-
#### Parameters
95+
`Protected` `Readonly` **usage**: [`ActivityUsageInfo`](../modules/activity_activity#activityusageinfo)
13096

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`\>
97+
Current resource usage vector information
14098

14199
#### Defined in
142100

143-
[src/activity/activity.ts:100](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L100)
144-
145-
___
101+
[src/activity/activity.ts:40](https://github.com/golemfactory/golem-js/blob/2ee73d8e/src/activity/activity.ts#L40)
146102

147-
### stop
103+
## Methods
148104

149-
**stop**(): `Promise`\<`boolean`\>
105+
### getProviderInfo
150106

151-
Stop and destroy activity
107+
**getProviderInfo**(): [`ProviderInfo`](../interfaces/market_agreement_agreement.ProviderInfo)
152108

153109
#### Returns
154110

155-
`Promise`\<`boolean`\>
156-
157-
boolean
111+
[`ProviderInfo`](../interfaces/market_agreement_agreement.ProviderInfo)
158112

159113
#### Defined in
160114

161-
[src/activity/activity.ts:138](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L138)
115+
[src/activity/activity.ts:43](https://github.com/golemfactory/golem-js/blob/2ee73d8e/src/activity/activity.ts#L43)
162116

163117
___
164118

165119
### getState
166120

167-
**getState**(): `Promise`\<[`ActivityStateEnum`](../enums/activity_activity.ActivityStateEnum)\>
168-
169-
Getting current state of activity
170-
171-
#### Returns
172-
173-
`Promise`\<[`ActivityStateEnum`](../enums/activity_activity.ActivityStateEnum)\>
174-
175-
state
176-
177-
**`Throws`**
178-
179-
Error when cannot query the state
180-
181-
#### Defined in
182-
183-
[src/activity/activity.ts:150](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L150)
184-
185-
___
186-
187-
### send
188-
189-
**send**(`script`): `Promise`\<`string`\>
190-
191-
#### Parameters
192-
193-
| Name | Type |
194-
| :------ | :------ |
195-
| `script` | [`ExeScriptRequest`](../interfaces/activity_activity.ExeScriptRequest) |
121+
**getState**(): [`ActivityStateEnum`](../enums/activity_activity.ActivityStateEnum)
196122

197123
#### Returns
198124

199-
`Promise`\<`string`\>
125+
[`ActivityStateEnum`](../enums/activity_activity.ActivityStateEnum)
200126

201127
#### Defined in
202128

203-
[src/activity/activity.ts:176](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L176)
129+
[src/activity/activity.ts:47](https://github.com/golemfactory/golem-js/blob/2ee73d8e/src/activity/activity.ts#L47)

0 commit comments

Comments
 (0)