sentinel-api-js
v1.0.7
Published
JS library for building client websites that consume the sentinel platform API
Downloads
2
Readme
sentinel-js
JS library for building client websites that consume the sentinel platform API
Install the plugin
yarn add sentinel-api-js
Import into your project
import Sentinel from 'sentinel-api-js'
Declare a new instance of Sentinel in your code
The parameter is the url of the data you wish the access.
const sentinel = new Sentinel('http://yourapp.sentinel-api.com')
The rest of these docs will be a reference to the above
Pages
Pages only have 2 endpoints - they all return promises.
getPages()
sentinel.page.getPages()
getPage()
sentinel.page.getPage(1)
Blog
The blog is able to get posts and retrieve the comments from them posts - again all return promises.
getPosts()
sentinel.blog.getPosts()
getPost()
sentinel.blog.getPost(1)
getPostComments()
sentinel.blog.getPostComments()
postComment()
The data needs to be structured liks so and will need to be signed in to do so:
{
comment: {
body: ''
}
}
sentinel.blog.postComment(postId, data)
deleteComment()
To delete a comment you will need to be signed in as the user who made the comment.
sentinel.blog.deleteComment(postId, commentId)
editComment()
The data needs to be structured liks so and will need to be signed in to do so:
{
comment: {
body: ''
}
}
sentinel.blog.editComment(postId, commentId, data)
In future Releases there will be these endpoints
GET /api/v1/users/sign_in
POST /api/v1/users/sign_in
DELETE /api/v1/users/sign_out
GET /api/v1/users/password/new
GET /api/v1/users/password/edit
PATCH /api/v1/users/password
PUT /api/v1/users/password
POST /api/v1/users/password
GET /api/v1/users/cancel
GET /api/v1/users/sign_up
GET /api/v1/users/edit
PATCH /api/v1/users
PUT /api/v1/users
DELETE /api/v1/users
POST /api/v1/users
GET /api/v1/custom_data/tables/:table_name/records
POST /api/v1/custom_data/tables/:table_name/records
GET /api/v1/custom_data/tables
POST /api/v1/custom_data/tables
GET /api/v1/custom_data/tables/new
GET /api/v1/custom_data/tables/:name/edit
GET /api/v1/custom_data/tables/:name
PATCH /api/v1/custom_data/tables/:name
PUT /api/v1/custom_data/tables/:name
DELETE /api/v1/custom_data/tables/:name