The estisia WallAPI provides a simple way to add a message board
to you node base apps.
Methods
(static) createComment(wall, msgIdx, author, message, cb)
Add comment for a message
Parameters:
Name | Type | Description |
---|---|---|
wall |
ObjectId | |
msgIdx |
Integer | |
author |
ObjectId | |
message |
String | |
cb |
wallCallback |
Example
wall.createComment(wallId, 0, user.id, 'This is a reply on the first message', function(err, wall){});
(static) createMessage(wall, author, title, message, cb)
Create a message on the wall
Parameters:
Name | Type | Description |
---|---|---|
wall |
ObjectId | |
author |
ObjectId | |
title |
string | |
message |
string | |
cb |
wallCallback |
Example
wall.createMessage(wallId, user.id, 'My subject', 'Lorem ipsum', function(err, wall){});
(static) createWall(title, owner, participants, cb)
Creates a new wall
Parameters:
Name | Type | Description |
---|---|---|
title |
string | |
owner |
ObjectId | |
participants |
ParticipantList | |
cb |
wallCallback |
Examples
Create wall without initial participants
wall.createWall('My wall', user.id, function(err, wall){});
Create wall with initial participants
var participants = [{
object: editor.id,
role: 'editor'
}, {
object: reader.id,
role: 'reader'
}];
wall.createWall('My wall, admin.id, participants, function(err, wall){});
(static) dropWall(wallId, cb)
Drops a wall
Parameters:
Name | Type | Description |
---|---|---|
wallId |
ObjectId | |
cb |
wallCallback |
Example
wall.dropWall(wallId, function(err){});
(static) getWall(wallId, cb)
Returns a Wall instance
Parameters:
Name | Type | Description |
---|---|---|
wallId |
ObjectId | |
cb |
wallCallback |
Example
wall.getWall(wallId, function(err, wall){});
(static) joinWall(wall, participantId, role, cb)
Adds participant to a wall
Parameters:
Name | Type | Description |
---|---|---|
wall |
ObjectId | |
participantId |
ObjectId | |
role |
string | one of admin, editor, member |
cb |
wallCallback |
Example
wall.joinWall(wallId, user.id, 'editor', function(err, wall){});
(static) leaveWall(wall, participantId, cb)
Removes participant from the wall
Parameters:
Name | Type | Description |
---|---|---|
wall |
ObjectId | |
participantId |
ObjectId | |
cb |
wallCallback |
Example
wall.leaveWall(wallId, user.id, function(err, wall){});
Type Definitions
wallCallback(err, wall)
Callback used for all the API calls
Parameters:
Name | Type | Description |
---|---|---|
err |
object | |
wall |
Wall | Wall instance |