Home Manual Reference Source
public class | source

Datapoint

Datapoints contain any type of data produced by an action.

Constructor Summary

Public Constructor
public

constructor(type: string, format: string)

Datapoints contain any type of data produced by an action.

Member Summary

Public Members
public

body: *

Declare empty JSON as body to store values

public get

content: *

The content of the Datapoint.

public get

data: *

The data stored in a Datapoint.

public get

format: *

The data type for the Datapoint's value.

public get

parent: *

The parent of this Datapoint.

public get

Permissions associated with this Datapoint.

public get

type: *

The type of Datapoint.

Method Summary

Public Methods
public

addPermission(type: string, perm: *): Datapoint

Add a new permission.

public

Check for missing fields and generate a JSON object of the datapoint.

public

setContent(content: *): Datapoint

Set the content of a datapoint.

public

setCustomPermissions(perms: *, override: boolean): Datapoint

Set custom permissions.

public

Set the format of the Datapoint.

public

setParent(parent: *): Datapoint

Set the parent field.

public

setPermissions(perms: object, override: boolean): Datapoint

Assign permissions using standard format: GET, PUT, and DELETE.

public

Set the type of the Datapoint.

public

Convert the datapoint to a string.

Public Constructors

public constructor(type: string, format: string) source

Datapoints contain any type of data produced by an action.

Params:

NameTypeAttributeDescription
type string

What kind of Datapoint is this?

format string

What type of value does this Datapoint store? ('string' or 'number')

Public Members

public body: * source

Declare empty JSON as body to store values

public get content: * source

The content of the Datapoint.

public get data: * source

The data stored in a Datapoint.

public get format: * source

The data type for the Datapoint's value.

public get parent: * source

The parent of this Datapoint.

public get permissions: * source

Permissions associated with this Datapoint.

public get type: * source

The type of Datapoint.

Public Methods

public addPermission(type: string, perm: *): Datapoint source

Add a new permission.

Params:

NameTypeAttributeDescription
type string

'GET', 'PUT', or 'DELETE'

perm *

Who shoudld receive the permission?

Return:

Datapoint

this Datapoint

public generate(): object source

Check for missing fields and generate a JSON object of the datapoint.

Return:

object

this Datapoint's data

public setContent(content: *): Datapoint source

Set the content of a datapoint.

Params:

NameTypeAttributeDescription
content *

The value of the Datapoint. If object, must have 'value' field.

Return:

Datapoint

this Datapoint

public setCustomPermissions(perms: *, override: boolean): Datapoint source

Set custom permissions.

Params:

NameTypeAttributeDescription
perms *

Custom permissions object.

override boolean

Set as true to override existing permissions.

Return:

Datapoint

this Datapoint

public setFormat(format: string): Datapoint source

Set the format of the Datapoint.

Params:

NameTypeAttributeDescription
format string

What type of value does this Datapoint hold?

Return:

Datapoint

this Datapoint

public setParent(parent: *): Datapoint source

Set the parent field.

Params:

NameTypeAttributeDescription
parent *

The parent of this process.

Return:

Datapoint

this Datapoint

public setPermissions(perms: object, override: boolean): Datapoint source

Assign permissions using standard format: GET, PUT, and DELETE.

Params:

NameTypeAttributeDescription
perms object

Permissions JSON. Must have GET, PUT, or DELETE fields.

override boolean

Set as true to override existing permissions

Return:

Datapoint

this Datapoint

public setType(type: string): Datapoint source

Set the type of the Datapoint.

Params:

NameTypeAttributeDescription
type string

What kind of Datapoint is this?

Return:

Datapoint

this Datapoint

public toString(): string source

Convert the datapoint to a string.

Return:

string

string representation of this Datapoint's data