firefly-iii
Version:
Unofficial Firefly III API SDK for firefly-iii
91 lines (86 loc) • 6.2 kB
JavaScript
const getCron = require('./src/about/cron')
const getAbout = require('./src/about')
const getAboutUser = require('./src/about/user')
const getConfiguration = require('./src/configuration')
const putConfiguration = require('./src/configuration/put')
const getCharts = require('./src/charts')
const getSummaryBasic = require('./src/summary/basic')
const getCategories = require('./src/categories')
const postCategories = require('./src/categories/post')
const getCategoriesTransactions = require('./src/categories/transactions')
const getCategoriesAttachments = require('./src/categories/attachments')
const putCategories = require('./src/categories/put')
const deleteCategories = require('./src/categories/delete')
const getTags = require('./src/tags')
const postTags = require('./src/tags/post')
const putTags = require('./src/tags/put')
const deleteTags = require('./src/tags/delete')
const getTagsTransactions = require('./src/tags/transactions')
const getTagsAttachments = require('./src/tags/attachments')
const getSearchAccounts = require('./src/search/accounts')
const getSearchTransactions = require('./src/search/transactions')
const getPreferences = require('./src/preferences')
const postPreferences = require('./src/preferences/post')
const putPreferences = require('./src/preferences/put')
const getTransactionLinks = require('./src/links/transaction_links')
const postTransactionLinks = require('./src/links/transaction_links/post')
const putTransactionLinks = require('./src/links/transaction_links/put')
const deleteTransactionLinks = require('./src/links/transaction_links/delete')
const getLinkTypes = require('./src/links/link_types')
const postLinkTypes = require('./src/links/link_types/post')
const putLinkTypes = require('./src/links/link_types/put')
const deleteLinkTypes = require('./src/links/link_types/delete')
const getLinkTypesTransactions = require('./src/links/link_types/transactions')
const getAccounts = require('./src/accounts')
const postAccounts = require('./src/accounts/post')
const putAccounts = require('./src/accounts/put')
const deleteAccounts = require('./src/accounts/delete')
const getAccountsTransactions = require('./src/accounts/transactions')
const getAccountsAttachments = require('./src/accounts/attachments')
const VERSION = 1
class FireflyIII {
constructor (host, token) {
this.host = `${host}/api/v${VERSION}`
this.token = token
}
async getCron (cli, body) { return await getCron(this.host, this.token, cli, body) }
async getAbout () { return await getAbout(this.host, this.token) }
async getAboutUser () { return await getAboutUser(this.host, this.token) }
async getConfiguration (name) { return await getConfiguration(this.host, this.token, name) }
async putConfiguration (name, body) { return await putConfiguration(this.host, this.token, name, body) }
async getCharts (body) { return await getCharts(this.host, this.token, body) }
async getSummaryBasic (body) { return await getSummaryBasic(this.host, this.token, body) }
async getCategories (id, body) { return await getCategories(this.host, this.token, id, body) }
async postCategories (body) { return await postCategories(this.host, this.token, body) }
async getCategoriesTransactions (id, body) { return await getCategoriesTransactions(this.host, this.token, id, body) }
async getCategoriesAttachments (id, body) { return await getCategoriesAttachments(this.host, this.token, id, body) }
async putCategories (id, body) { return await putCategories(this.host, this.token, id, body) }
async deleteCategories (id) { return await deleteCategories(this.host, this.token, id) }
async getTags (id, body) { return await getTags(this.host, this.token, id, body) }
async postTags (body) { return await postTags(this.host, this.token, body) }
async putTags (id, body) { return await putTags(this.host, this.token, id, body) }
async deleteTags (id) { return await deleteTags(this.host, this.token, id) }
async getTagsTransactions (id, body) { return await getTagsTransactions(this.host, this.token, id, body) }
async getTagsAttachments (id, body) { return await getTagsAttachments(this.host, this.token, id, body) }
async getSearchAccounts (body) { return await getSearchAccounts(this.host, this.token, body) }
async getSearchTransactions (body) { return await getSearchTransactions(this.host, this.token, body) }
async getPreferences (id, body) { return await getPreferences(this.host, this.token, id, body) }
async postPreferences (body) { return await postPreferences(this.host, this.token, body) }
async putPreferences (id, body) { return await putPreferences(this.host, this.token, id, body) }
async getTransactionLinks (id, body) { return await getTransactionLinks(this.host, this.token, id, body) }
async postTransactionLinks (body) { return await postTransactionLinks(this.host, this.token, body) }
async putTransactionLinks (id, body) { return await putTransactionLinks(this.host, this.token, id, body) }
async deleteTransactionLinks (id) { return await deleteTransactionLinks(this.host, this.token, id) }
async getLinkTypes (id, body) { return await getLinkTypes(this.host, this.token, id, body) }
async postLinkTypes (body) { return await postLinkTypes(this.host, this.token, body) }
async putLinkTypes (id, body) { return await putLinkTypes(this.host, this.token, id, body) }
async deleteLinkTypes (id) { return await deleteLinkTypes(this.host, this.token, id) }
async getLinkTypesTransactions (id, body) { return await getLinkTypesTransactions(this.host, this.token, id, body) }
async getAccounts (id, body) { return await getAccounts(this.host, this.token, id, body) }
async postAccounts (body) { return await postAccounts(this.host, this.token, body) }
async putAccounts (id, body) { return await putAccounts(this.host, this.token, id, body) }
async deleteAccounts (id) { return await deleteAccounts(this.host, this.token, id) }
async getAccountsTransactions (id, body) { return await getAccountsTransactions(this.host, this.token, id, body) }
async getAccountsAttachments (id, body) { return await getAccountsAttachments(this.host, this.token, id, body) }
}
module.exports = FireflyIII