Base class for all RAAIN nodes in the system. Implements versioning and link management functionality.

Remarks

This is the foundation class for all API entities in the RAAIN system. It provides common functionality for:

  • Version management
  • HATEOAS link handling
  • JSON serialization

Example

const node = new RaainNode({
id: 'node1',
version: '1.0.0',
links: [
new Link('self', '/api/nodes/node1')
]
});

Hierarchy (view full)

Constructors

Properties

date: Date
validity: number
id: string

Unique identifier for the node

version: string

Version string of the node

Accessors

Methods

  • Converts the node to a JSON object.

    Parameters

    • options: {
          removeValues?: boolean;
      } = {}
      • Optional removeValues?: boolean

    Returns {
        date: Date;
        validity: number;
        configurationAsJSON: string;
        values: number[] | IPolarMeasureValue[] | ICartesianMeasureValue[];
        id: string;
        links: Link[];
        version?: string;
    }

    A JSON object containing the node's data

  • Gets the count of links, optionally filtered by type.

    Parameters

    • Optional linkType: string

      Optional type of links to count

    Returns number

    The number of links