Skip to content

Commit 2b5f435

Browse files
Merge pull request #279 from terminusdb/add_baseServer
update config, add baseServer property
2 parents 48db9d8 + a860bc8 commit 2b5f435

File tree

5 files changed

+19
-28
lines changed

5 files changed

+19
-28
lines changed

RELEASE_NOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# TerminusDB Client v10.0.29
2+
## Fixes 🛠
3+
* Fix getCommitsLog in WOQLClient
4+
5+
## New 🚀
6+
* add getDocumentHistory in WOQLClient class
7+
* add baseServer property to ConnectionConfig class
8+
19
# TerminusDB Client v10.0.28
210

311
## Fixes 🛠

docs/api/woqlclient.md

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,31 +1388,8 @@ client.apply("mybranch","mybranch_new","merge main").then(result=>{
13881388
})
13891389
```
13901390
1391-
## docHistory
1392-
##### woqlClient.docHistory(id, [historyParams])
1393-
Get the document's history for a specific database or branch
1394-
1395-
1396-
| Param | Type | Description |
1397-
| --- | --- | --- |
1398-
| id | <code>string</code> | id of document to report history of |
1399-
| [historyParams] | <code>typedef.DocHistoryParams</code> | |
1400-
1401-
**Example**
1402-
```javascript
1403-
//this will return the last 5 commits for the Person/Anna document
1404-
client.checkout("mybranch")
1405-
client.docHistory("Person/Anna",{start:0,count:5}).then(result=>{
1406-
console.log(result)
1407-
})
1408-
//this will return the last and the first commit for the Person/Anna document
1409-
client.docHistory("Person/Anna",{updated:true,created:true}).then(result=>{
1410-
console.log(result)
1411-
})
1412-
```
1413-
1414-
## docHistory
1415-
##### woqlClient.docHistory(id, [historyParams])
1391+
## getDocumentHistory
1392+
##### woqlClient.getDocumentHistory(id, [historyParams])
14161393
Get the document's history for a specific database or branch
14171394
14181395

lib/connectionConfig.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ function ConnectionConfig(serverUrl, params) {
2020
*/
2121
this.server = undefined;
2222

23+
// the base server url without the team name
24+
this.baseServer = undefined;
25+
2326
// remote auth for authenticating to remote servers for push / fetch / clone
2427
/** @type {typedef.CredentialObj} */
2528
this.remote_auth = undefined;
@@ -229,7 +232,9 @@ ConnectionConfig.prototype.parseServerURL = function (str) {
229232

230233
ConnectionConfig.prototype.serverUrlEncoding = function (str) {
231234
const orgArr = str.split('/');
232-
if (orgArr.length > 3) {
235+
if (orgArr.length > 4) {
236+
// we can need only the server baseurl
237+
this.baseServer = str.replace(`${orgArr[3]}/`, '');
233238
// const org = encodeURI(orgArr[3])
234239
/*
235240
* if we pass the organization name like Francesca-Bit-9e73
@@ -239,6 +244,7 @@ ConnectionConfig.prototype.serverUrlEncoding = function (str) {
239244
const org = encodeURISegment(orgArr[3]);
240245
return str.replace(orgArr[3], org);
241246
}
247+
this.baseServer = str;
242248
return str;
243249
};
244250

lib/woqlClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,7 @@ WOQLClient.prototype.apply = function (beforeVersion, afterVersion, message, mat
18571857
*/
18581858

18591859
// eslint-disable-next-line max-len
1860-
WOQLClient.prototype.docHistory = function (id, historyParams) {
1860+
WOQLClient.prototype.getDocumentHistory = function (id, historyParams) {
18611861
const params = historyParams || {};
18621862
params.id = id;
18631863
return this.dispatch(

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@terminusdb/terminusdb-client",
3-
"version": "10.0.28",
3+
"version": "10.0.29",
44
"description": "TerminusDB client library",
55
"main": "index.js",
66
"types": "./dist/typescript/index.d.ts",

0 commit comments

Comments
 (0)