2.0.1 • Published 6 years ago

mm-node v2.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Matter In Motion. Node resource extension

NPM Version NPM Downloads

This extension adds a node resource.

Usage

Extensions installation instructions

Node

Node is the simplest way to store chunks of content:

  • type — string, type of the node
  • content — various types of the node content dependent on the node type

API

get

returns a node

Request

  • id — node id

Response

  • id — uuid, node id
  • type — string, node type
  • content — various, node content

update

updates node content

Request

  • to
    • content various, node content to be updated

Response

  • node id

Controller Methods

get(id)

Return a node

  • id — uuid, node id;

create(nodes)

Creates a node or many nodes and return a list of new nodes ids.

  • nodes single node or array of nodes.

update(id, content)

updates a node and return node id that was updated

  • id — node id
  • content — new content. Note that content is updated, i.e., merged with old content.

delete(id)

Deletes a node and return deleted node id

  • id — node id

deleteAll(ids)

Deletes multiple nodes.

  • ids — array of node id

License: MIT.