Skip to content

Commit

Permalink
feat: Update golem-js API Reference for branch beta
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptobench authored Jun 19, 2024
1 parent 305e193 commit bda6ee2
Show file tree
Hide file tree
Showing 387 changed files with 24,587 additions and 12,644 deletions.
966 changes: 705 additions & 261 deletions src/navigation/jsreference.js

Large diffs are not rendered by default.

429 changes: 284 additions & 145 deletions src/pages/docs/golem-js/reference/README.md

Large diffs are not rendered by default.

162 changes: 44 additions & 118 deletions src/pages/docs/golem-js/reference/classes/activity_activity.Activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,191 +13,117 @@ As part of a given activity, it is possible to execute exe script commands and c

## Table of contents

### Constructors

- [constructor](activity_activity.Activity#constructor)

### Properties

- [id](activity_activity.Activity#id)
- [agreement](activity_activity.Activity#agreement)
- [yagnaApi](activity_activity.Activity#yagnaapi)
- [options](activity_activity.Activity#options)
- [currentState](activity_activity.Activity#currentstate)
- [usage](activity_activity.Activity#usage)

### Methods

- [create](activity_activity.Activity#create)
- [getProviderInfo](activity_activity.Activity#getproviderinfo)
- [execute](activity_activity.Activity#execute)
- [stop](activity_activity.Activity#stop)
- [getState](activity_activity.Activity#getstate)
- [send](activity_activity.Activity#send)

## Properties

### id
## Constructors

`Readonly` **id**: `string`

activity ID

#### Defined in
### constructor

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

___
#### Parameters

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

`Readonly` **agreement**: `Agreement`
#### Returns

Agreement
[`Activity`](activity_activity.Activity)

#### Defined in

[src/activity/activity.ts:63](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L63)
[src/activity/activity.ts:36](https://github.com/golemfactory/golem-js/blob/bfd958ac/src/activity/activity.ts#L36)

___
## Properties

### yagnaApi
### id

`Protected` `Readonly` **yagnaApi**: [`YagnaApi`](../modules/utils_yagna_yagna#yagnaapi)
`Readonly` **id**: `string`

[YagnaApi](../modules/utils_yagna_yagna#yagnaapi)
The ID of the activity in Yagna

#### Defined in

[src/activity/activity.ts:64](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L64)
[src/activity/activity.ts:37](https://github.com/golemfactory/golem-js/blob/bfd958ac/src/activity/activity.ts#L37)

___

### options

`Protected` `Readonly` **options**: `ActivityConfig`

[ActivityOptions](../interfaces/activity_activity.ActivityOptions)

#### Defined in

[src/activity/activity.ts:65](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L65)

## Methods

### create

**create**(`agreement`, `yagnaApi`, `options?`, `secure?`): `Promise`\<[`Activity`](activity_activity.Activity)\>

Create activity for given agreement ID

#### Parameters

| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `agreement` | `Agreement` | `undefined` | |
| `yagnaApi` | [`YagnaApi`](../modules/utils_yagna_yagna#yagnaapi) | `undefined` | |
| `options?` | [`ActivityOptions`](../interfaces/activity_activity.ActivityOptions) | `undefined` | [ActivityOptions](../interfaces/activity_activity.ActivityOptions) |
| `secure` | `boolean` | `false` | defines if activity will be secure type |

#### Returns
### agreement

`Promise`\<[`Activity`](activity_activity.Activity)\>
`Readonly` **agreement**: [`Agreement`](market_agreement_agreement.Agreement)

Activity
The agreement that's related to this activity

#### Defined in

[src/activity/activity.ts:79](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L79)
[src/activity/activity.ts:38](https://github.com/golemfactory/golem-js/blob/bfd958ac/src/activity/activity.ts#L38)

___

### getProviderInfo
### currentState

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

#### Returns

[`ProviderInfo`](../interfaces/agreement_agreement.ProviderInfo)
The current state as it was obtained from yagna

#### Defined in

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

___

### execute

**execute**(`script`, `stream?`, `timeout?`): `Promise`\<`Readable`\>
### usage

Execute script

#### Parameters
`Protected` `Readonly` **usage**: [`ActivityUsageInfo`](../modules/activity_activity#activityusageinfo)

| Name | Type | Description |
| :------ | :------ | :------ |
| `script` | [`ExeScriptRequest`](../interfaces/activity_activity.ExeScriptRequest) | exe script request |
| `stream?` | `boolean` | define type of getting results from execution (polling or streaming) |
| `timeout?` | `number` | execution timeout |

#### Returns

`Promise`\<`Readable`\>
Current resource usage vector information

#### Defined in

[src/activity/activity.ts:100](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L100)

___
[src/activity/activity.ts:40](https://github.com/golemfactory/golem-js/blob/bfd958ac/src/activity/activity.ts#L40)

### stop
## Methods

**stop**(): `Promise`\<`boolean`\>
### getProviderInfo

Stop and destroy activity
**getProviderInfo**(): [`ProviderInfo`](../interfaces/market_agreement_agreement.ProviderInfo)

#### Returns

`Promise`\<`boolean`\>

boolean
[`ProviderInfo`](../interfaces/market_agreement_agreement.ProviderInfo)

#### Defined in

[src/activity/activity.ts:138](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L138)
[src/activity/activity.ts:43](https://github.com/golemfactory/golem-js/blob/bfd958ac/src/activity/activity.ts#L43)

___

### getState

**getState**(): `Promise`\<[`ActivityStateEnum`](../enums/activity_activity.ActivityStateEnum)\>

Getting current state of activity

#### Returns

`Promise`\<[`ActivityStateEnum`](../enums/activity_activity.ActivityStateEnum)\>

state

**`Throws`**

Error when cannot query the state

#### Defined in

[src/activity/activity.ts:150](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L150)

___

### send

**send**(`script`): `Promise`\<`string`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `script` | [`ExeScriptRequest`](../interfaces/activity_activity.ExeScriptRequest) |
**getState**(): [`ActivityStateEnum`](../enums/activity_activity.ActivityStateEnum)

#### Returns

`Promise`\<`string`\>
[`ActivityStateEnum`](../enums/activity_activity.ActivityStateEnum)

#### Defined in

[src/activity/activity.ts:176](https://github.com/golemfactory/golem-js/blob/7cee55b/src/activity/activity.ts#L176)
[src/activity/activity.ts:47](https://github.com/golemfactory/golem-js/blob/bfd958ac/src/activity/activity.ts#L47)
Loading

0 comments on commit bda6ee2

Please sign in to comment.