npm

Need private packages and team management tools?Check out npm Orgs. »

docbase-js

1.0.1 • Public • Published

docbase-js DocBase API client for browser and node

Installing

npm:

$ npm install --save docbase-js

yarn:

$ yarn add docbase-js

Example

Using mzabriskie/axios

Initialize

new DocBase(domain, token, [{ baseUrl, timeout, version }])

import DocBase from 'docbase-js'
 
const docBase = new DocBase(
  'your_team_domain',
  'your_docbase_api_token',
  {
    baseUrl: 'https://api.docbase.io',
    timeout: 1000,
    version: 1
  }
)

Team

docBase.team.teams()

const teams = await docBase.team.teams()
console.log(teams.data)

docBase.team.groups()

const groups = await docBase.team.groups()
console.log(groups.data)

docBase.team.tags()

const tags = await docBase.team.tags()
console.log(tags.data)

Memo

docBase.memo.post({ title, body, [draft, notice, tags, scope, groups] })

const memo = await docBase.memo.post({
  title: 'title',
  body: 'body',
  draft: false,
  notice: true,
  tags: [],
  scope: 'everyone',
  groups: []
})
console.log(memo.data)

docBase.memo.get(id)

const memo = await docBase.memo.get(1)
console.log(memo.data)

docBase.memo.patch(id, { title, body, [draft, notice, tags, scope, groups] })

const memo = await docBase.memo.patch(1, {
  title: 'title',
  body: 'body',
  draft: false,
  notice: true,
  tags: [],
  scope: 'everyone',
  groups: []
})
console.log(memo.data)

docBase.memo.delete(id)

docBase.memo.delete(1)

Note

License

MIT

Keywords

install

npm i docbase-js

Downloadsweekly downloads

4

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability