diff --git a/README.md b/README.md index b8d463fd..532d76b1 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ const bankerSchema = [ "@type":"Class", "@id":"Person", "@key":{ - "@type":"Hash", + "@type":"Lexical", "@fields":[ "name" ] diff --git a/docs/api/woqlclient.md b/docs/api/woqlclient.md index 647df72e..96737759 100644 --- a/docs/api/woqlclient.md +++ b/docs/api/woqlclient.md @@ -384,14 +384,14 @@ user has fields: [id, name, notes, author] **Desription**: Gets the user's organization id ## databaseInfo -##### woqlClient.databaseInfo([dbId]) ⇒ object +##### woqlClient.databaseInfo([dbName]) ⇒ object Gets the database's details -**Returns**: object - the database description object //getDatabaseInfo +**Returns**: object - the database description object | Param | Type | Description | | --- | --- | --- | -| [dbId] | string | the datbase id | +| [dbName] | string | the datbase name | ## db diff --git a/lib/woqlClient.js b/lib/woqlClient.js index 92a2e9cb..3c4dd9d2 100644 --- a/lib/woqlClient.js +++ b/lib/woqlClient.js @@ -208,13 +208,13 @@ WOQLClient.prototype.userOrganization = function () { /** * Gets the database's details - * @param {string} [dbId] - the datbase id - * @returns {object} the database description object //getDatabaseInfo + * @param {string} [dbName] - the datbase name + * @returns {object} the database description object */ -WOQLClient.prototype.databaseInfo = function (dbId) { +WOQLClient.prototype.databaseInfo = function (dbName) { // const dbIdVal = dbId || this.db(); // const orgIdVal = orgId || this.organization() - const database = this.databases().find((element) => element.name === dbId); + const database = this.databases().find((element) => element.name === dbName); return database || {}; }; @@ -1518,8 +1518,8 @@ WOQLClient.prototype.getJSONDiff = function (before, after, options) { * }) */ WOQLClient.prototype.getVersionObjectDiff = function (dataVersion, jsonObject, id, options) { - if (typeof jsonObject !== 'object' || typeof dataVersion !== 'string') { - const errmsg = 'Parameters error - you must specify a valid jsonObject document and valid branch or commit'; + if (typeof jsonObject !== 'object' || typeof dataVersion !== 'string' || typeof id !== 'string') { + const errmsg = 'Parameters error - you must specify a valid jsonObject document, a valid branch or commit and a valid id'; return Promise.reject( new Error(ErrorMessage.getInvalidParameterMessage(CONST.GET_DIFF, errmsg)), @@ -1529,11 +1529,9 @@ WOQLClient.prototype.getVersionObjectDiff = function (dataVersion, jsonObject, i const payload = { after: jsonObject, before_data_version: dataVersion, + id, ...opt, }; - if (id) { - payload.id = id; - } return this.dispatch( CONST.POST, this.connectionConfig.diffURL(), diff --git a/package-lock.json b/package-lock.json index ac1a35c7..3be22898 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@terminusdb/terminusdb-client", - "version": "10.0.15", + "version": "10.0.16", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@terminusdb/terminusdb-client", - "version": "10.0.15", + "version": "10.0.16", "license": "Apache-2.0", "dependencies": { "ajv": ">=6.12.3",