Skip to content

Commit 7fb7102

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

File tree

368 files changed

+20642
-12071
lines changed

Some content is hidden

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

368 files changed

+20642
-12071
lines changed

src/navigation/jsreference.js

Lines changed: 651 additions & 263 deletions
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ distributed, computational loads through Golem Network.
5050

5151
## System requirements
5252

53-
To use `golem-js`, it is necessary to have yagna installed, with a **minimum version requirement of v0.13.2**. Yagna is a
53+
To use `golem-js`, it is necessary to have yagna installed, with a **recommended minimum version of v0.14.0**. Yagna is a
5454
service that communicates and performs operations on the Golem Network, upon your requests via the SDK. You
5555
can [follow these instructions](https://docs.golem.network/docs/creators/javascript/quickstarts/quickstart#install-yagna-2)
5656
to set it up.
@@ -72,13 +72,13 @@ yagna service run
7272

7373
# IN SEPARATE TERMINAL (if not daemonized)
7474
# Initialize your requestor
75-
yagna payment init --sender --network goerli
75+
yagna payment init --sender --network holesky
7676

7777
# Request funds on the test network
78-
yagna payment fund --network goerli
78+
yagna payment fund --network holesky
7979

8080
# Check the status of the funds
81-
yagna payment status --network goerli
81+
yagna payment status --network holesky
8282
```
8383

8484
#### Obtain your `app-key` to use with SDK

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

Lines changed: 64 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -13,191 +13,154 @@ 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:50](https://github.com/golemfactory/golem-js/blob/ed33d45c/src/activity/activity.ts#L50)
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:42](https://github.com/golemfactory/golem-js/blob/ed33d45c/src/activity/activity.ts#L42)
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:51](https://github.com/golemfactory/golem-js/blob/ed33d45c/src/activity/activity.ts#L51)
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:52](https://github.com/golemfactory/golem-js/blob/ed33d45c/src/activity/activity.ts#L52)
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:53](https://github.com/golemfactory/golem-js/blob/ed33d45c/src/activity/activity.ts#L53)
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:54](https://github.com/golemfactory/golem-js/blob/ed33d45c/src/activity/activity.ts#L54)
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:57](https://github.com/golemfactory/golem-js/blob/ed33d45c/src/activity/activity.ts#L57)
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**(`activityControl`, `execObserver`, `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+
| `activityControl` | `RequestorControlService` |
142+
| `execObserver` | [`YagnaExeScriptObserver`](../interfaces/shared_yagna_yagnaApi.YagnaExeScriptObserver) |
143+
| `logger` | [`Logger`](../interfaces/shared_utils_logger_logger.Logger) |
144+
| `options?` | [`ExecutionOptions`](../interfaces/activity_exe_script_executor.ExecutionOptions) |
176145

177-
**`Throws`**
146+
#### Returns
178147

179-
Error when cannot query the state
148+
[`ExeScriptExecutor`](activity_exe_script_executor.ExeScriptExecutor)
180149

181150
#### Defined in
182151

183-
[src/activity/activity.ts:150](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L150)
152+
[src/activity/activity.ts:64](https://github.com/golemfactory/golem-js/blob/ed33d45c/src/activity/activity.ts#L64)
184153

185154
___
186155

187-
### send
188-
189-
**send**(`script`): `Promise`\<`string`\>
190-
191-
#### Parameters
156+
### getState
192157

193-
| Name | Type |
194-
| :------ | :------ |
195-
| `script` | [`ExeScriptRequest`](../interfaces/activity_activity.ExeScriptRequest) |
158+
**getState**(): [`ActivityStateEnum`](../enums/activity_activity.ActivityStateEnum)
196159

197160
#### Returns
198161

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

201164
#### Defined in
202165

203-
[src/activity/activity.ts:176](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L176)
166+
[src/activity/activity.ts:73](https://github.com/golemfactory/golem-js/blob/ed33d45c/src/activity/activity.ts#L73)

0 commit comments

Comments
 (0)