Base class for all RAAIN nodes in the system. Implements versioning and link management functionality.
This is the foundation class for all API entities in the RAAIN system. It provides common functionality for:
const node = new RaainNode({ id: 'node1', version: '1.0.0', links: [ new Link('self', '/api/nodes/node1') ]}); Copy
const node = new RaainNode({ id: 'node1', version: '1.0.0', links: [ new Link('self', '/api/nodes/node1') ]});
Creates a new RaainNode instance.
Configuration object
Unique identifier
Optional
Array of HATEOAS links
Version string
Unique identifier for the node
Version string of the node
Gets all links associated with the node.
Sets the links for the node.
Array of links to set
Converts the node to a JSON object.
A JSON object containing the node's data
Gets all link IDs associated with the node.
Array of link IDs
Gets the count of links, optionally filtered by type.
Optional type of links to count
The number of links
Adds new links to the node.
Array of links to add
Gets the version string of the node.
The version string
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:
Example