From 0308b134603d92b4a37bf2cac30c9e86c2e6ea0d Mon Sep 17 00:00:00 2001 From: azivner Date: Fri, 18 Jan 2019 23:57:08 +0100 Subject: [PATCH] expose app info on the backend script api #345 --- src/services/backend_script_api.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/services/backend_script_api.js b/src/services/backend_script_api.js index e02051c20..b909f346e 100644 --- a/src/services/backend_script_api.js +++ b/src/services/backend_script_api.js @@ -11,6 +11,7 @@ const repository = require('./repository'); const axios = require('axios'); const cloningService = require('./cloning'); const messagingService = require('./messaging'); +const appInfo = require('./app_info'); /** * This is the main backend API interface for scripts. It's published in the local "api" object. @@ -234,6 +235,11 @@ function BackendScriptApi(startNote, currentNote, originEntity) { * @returns {Promise} */ this.refreshTree = () => messagingService.sendMessageToAllClients({ type: 'refresh-tree' }); + + /** + * @return {{syncVersion, appVersion, buildRevision, dbVersion, dataDirectory, buildDate}|*} - object representing basic info about running Trilium version + */ + this.getAppInfo = () => appInfo } module.exports = BackendScriptApi; \ No newline at end of file