Skip to content

Commit f541cd8

Browse files
Merge pull request #216 from terminusdb/docs-update
Docs update
2 parents 42278c3 + b06368e commit f541cd8

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const bankerSchema = [
100100
"@type":"Class",
101101
"@id":"Person",
102102
"@key":{
103-
"@type":"Hash",
103+
"@type":"Lexical",
104104
"@fields":[
105105
"name"
106106
]

docs/api/woqlclient.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,14 @@ user has fields: [id, name, notes, author]
384384
**Desription**: Gets the user's organization id
385385
386386
## databaseInfo
387-
##### woqlClient.databaseInfo([dbId]) ⇒ <code>object</code>
387+
##### woqlClient.databaseInfo([dbName]) ⇒ <code>object</code>
388388
Gets the database's details
389389
390-
**Returns**: <code>object</code> - the database description object //getDatabaseInfo
390+
**Returns**: <code>object</code> - the database description object
391391
392392
| Param | Type | Description |
393393
| --- | --- | --- |
394-
| [dbId] | <code>string</code> | the datbase id |
394+
| [dbName] | <code>string</code> | the datbase name |
395395
396396
397397
## db

lib/woqlClient.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ WOQLClient.prototype.userOrganization = function () {
208208

209209
/**
210210
* Gets the database's details
211-
* @param {string} [dbId] - the datbase id
212-
* @returns {object} the database description object //getDatabaseInfo
211+
* @param {string} [dbName] - the datbase name
212+
* @returns {object} the database description object
213213
*/
214-
WOQLClient.prototype.databaseInfo = function (dbId) {
214+
WOQLClient.prototype.databaseInfo = function (dbName) {
215215
// const dbIdVal = dbId || this.db();
216216
// const orgIdVal = orgId || this.organization()
217-
const database = this.databases().find((element) => element.name === dbId);
217+
const database = this.databases().find((element) => element.name === dbName);
218218
return database || {};
219219
};
220220

@@ -1518,8 +1518,8 @@ WOQLClient.prototype.getJSONDiff = function (before, after, options) {
15181518
* })
15191519
*/
15201520
WOQLClient.prototype.getVersionObjectDiff = function (dataVersion, jsonObject, id, options) {
1521-
if (typeof jsonObject !== 'object' || typeof dataVersion !== 'string') {
1522-
const errmsg = 'Parameters error - you must specify a valid jsonObject document and valid branch or commit';
1521+
if (typeof jsonObject !== 'object' || typeof dataVersion !== 'string' || typeof id !== 'string') {
1522+
const errmsg = 'Parameters error - you must specify a valid jsonObject document, a valid branch or commit and a valid id';
15231523

15241524
return Promise.reject(
15251525
new Error(ErrorMessage.getInvalidParameterMessage(CONST.GET_DIFF, errmsg)),
@@ -1529,11 +1529,9 @@ WOQLClient.prototype.getVersionObjectDiff = function (dataVersion, jsonObject, i
15291529
const payload = {
15301530
after: jsonObject,
15311531
before_data_version: dataVersion,
1532+
id,
15321533
...opt,
15331534
};
1534-
if (id) {
1535-
payload.id = id;
1536-
}
15371535
return this.dispatch(
15381536
CONST.POST,
15391537
this.connectionConfig.diffURL(),

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)