This module provides an easy way to use DocBase API.
$ npm install docbase
set DOCBASE_API_TOKEN instead of DocBaseApi
's option.
$ export DOCBASE_API_TOKEN=xxxxxxxxxx
import module
import DocBaseApi from 'docbase';
const docbase = new DocBaseApi({
token: 'xxxxxxxxxxxxx'
});
docbase.team.find().then(teams => {
const domain = teams[0].domain;
// => teams
}).then(done, done);
docbase.post.search(domain, {
q: 'test',
author: 'keita_moromizato',
tag: '日報',
group: '日報'
}).then(res => {
// => posts
});
docbase.group.find(domain).then(groups => {
// => groups
});
docbase.tag.find(domain).then(tags => {
// => tags
});
const params = {
title: 'test title',
body: 'test body',
draft: false,
tags: ['test'],
scope: 'group',
groups: [1],
notice: false
};
docbase.post.create(domain, params).then(post => {
// post
});
docbase.post.find(domain, 111).then(post => {
// => post
});
TODO
TODO
MIT
$ export DOCBASE_API_TOKEN=xxxxxxxxxx
$ npm test