yajsapi - JavaScript high-level API
Yagna Contributor Guide

Class: Activity

yajsapi / Exports / props / Activity

Class: Activity

props.Activity

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

Returns: Activity

Inherited from: Model

Defined in: yajsapi/props/base.ts:108

Properties

cost_cap

cost_cap: Field

Defined in: yajsapi/props/index.ts:26

cost_warning

cost_warning: Field

Defined in: yajsapi/props/index.ts:32

expiration

expiration: Field

Defined in: yajsapi/props/index.ts:52

multi_activity

multi_activity: Field

Defined in: yajsapi/props/index.ts:56

timeout_secs

timeout_secs: Field

Defined in: yajsapi/props/index.ts:41

Methods

_custom_mapping

_custom_mapping(props: object, data: object): void

Parameters:

Name

Type

props

object

data

object

Returns: void

Inherited from: Model

Defined in: yajsapi/props/base.ts:111

fields

fields(cls: any): Field[]

Parameters:

Name

Type

cls

any

Returns: Field[]

Inherited from: Model

Defined in: yajsapi/props/base.ts:113

from_properties

from_properties(props: object): any

Initialize the model from an object representation.

description When provided with an object of properties, it will find the matching keys within it and fill the model fields with the values from the object.

It ignores non-matching keys - i.e. doesn't require filtering of the properties' object before the model is fed with the data. Thus, several models can be initialized from the same object and all models will only load their own data.

Parameters:

Name

Type

Description

props

object

Returns: any

Inherited from: Model

Defined in: yajsapi/props/base.ts:137

keys

keys(): any

example

import { props } from "yajsapi"
const { Field, Model } = props;
export class NodeInfo extends Model {
name: Field = new Field({ metadata: { key: "golem.node.id.name" } });
subnet_tag: Field = new Field({
metadata: { key: "golem.node.debug.subnet" },
});
}
new NodeInfo().keys().name()
// Output: 'golem.node.id.name'

Returns: any

a mapping between the model's field names and the property keys

Inherited from: Model

Defined in: yajsapi/props/base.ts:182