Skip to content

Commit 67e8137

Browse files
committed
adding Info Api to get server version info
1 parent 3ab1e53 commit 67e8137

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

lib/const.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ module.exports = Object.freeze({
3838
GET_CSV: 'get_csv',
3939
UPDATE_CSV: 'update_csv',
4040
DELETE_CSV: 'delete_csv',
41-
MESSAGE: 'message'
41+
MESSAGE: 'message',
42+
INFO: 'info'
4243
})

lib/dispatchRequest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ function DispatchRequest(url, action, payload, local_auth, remote_auth = null) {
8686
case CONST.READ_ORGANIZATION:
8787
case CONST.CONNECT:
8888
case CONST.GET_CSV:
89+
case CONST.INFO:
8990
if (payload) {
9091
const ext = UTILS.URIEncodePayload(payload)
9192
if (ext) url += `?${ext}`

lib/woqlClient.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,17 @@ WOQLClient.prototype.message = function(message) {
509509
})
510510
}
511511

512+
/**
513+
* gets terminusdb server info
514+
* @param {string} msg - textual string
515+
*/
516+
WOQLClient.prototype.info = function() {
517+
const url = this.api() + 'info'
518+
return this.dispatch(CONST.INFO, url).then(response => {
519+
return response
520+
})
521+
}
522+
512523

513524
/**
514525
* Executes a WOQL query on the specified database and returns the results

0 commit comments

Comments
 (0)