Skip to content

Commit b6308a5

Browse files
committed
Merge remote-tracking branch 'origin/main' into doc_parsing
2 parents 0ce8246 + 60c4e07 commit b6308a5

File tree

6 files changed

+34
-11
lines changed

6 files changed

+34
-11
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ package, run:
4848
$ npm install --save @terminusdb/terminusdb-client
4949
```
5050

51-
This command update your `package.json`.
51+
This command updates your `package.json`.
5252

5353
### Script
5454

@@ -69,7 +69,7 @@ it to your sources, and use that in the `<script>` instead.
6969
This example creates a simple dataProduct, starting to create a database model the schema
7070
and insert a simple document
7171

72-
For the [full Documentation](https://terminusdb.com/docs/guides/reference-guides/javascript-client-reference)
72+
For the [full Documentation](https://terminusdb.com/docs/javascript)
7373

7474
```javascript
7575
const TerminusClient = require("@terminusdb/terminusdb-client");
@@ -158,9 +158,9 @@ The TerminusDB API can be found at the [TerminusDB Documentation][terminusdb-doc
158158

159159
## Report Issues
160160

161-
If you have encounter any issues, please report it with your os and environment setup, version that you are using and a simple reproducible case.
161+
If you encounter any issues, please report it with your os and environment setup, the version that you are using, and a simple reproducible case.
162162

163-
If you encounter other questions, you can ask in our [Discord Server](https://discord.gg/hTU3XWSzuZ).
163+
If you encounter other questions, you can ask them on our [Discord Server](https://discord.gg/hTU3XWSzuZ).
164164

165165
## Contribute
166166

RELEASE_NOTES.md

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

312
## Fixes 🛠

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/typedef.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,11 @@ const { ACTIONS } = Utils.ACTIONS;
177177
* @property {boolean} [created] - Created date of object (excludes history) false is the default
178178
*/
179179

180+
/**
181+
* @typedef {Object} DiffObject
182+
* @property {keep} [Object] - Index to start from, 0 is the default
183+
* @property {start} [number] - Amount of commits to show, 10 is the default
184+
* @property {count} [number] - Last updated time (excludes history) false is the default
185+
*/
186+
180187
module.exports = {};

lib/woqlClient.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ WOQLClient.prototype.updateDocument = function (json, params, dbId, message = 'u
13201320
const docParams = params || {};
13211321
docParams.author = this.author();
13221322
docParams.message = message;
1323-
if (docParams.create) {
1323+
if (create) {
13241324
docParams.create = create;
13251325
}
13261326
if (dbId) {
@@ -1585,7 +1585,7 @@ WOQLClient.prototype.userOrganizations = function (orgList) {
15851585
* //{ "@id" : "Person/Jane", "@type" : "Person", "name" : "Jannet"}
15861586
*/
15871587
WOQLClient.prototype.patch = function (before, patch) {
1588-
if (typeof before !== 'object' || typeof after !== 'object') {
1588+
if (typeof before !== 'object' || typeof patch !== 'object') {
15891589
const errmsg = '"before" or "after" parameter error - you must specify a valid before and after json document';
15901590

15911591
return Promise.reject(
@@ -1743,7 +1743,8 @@ WOQLClient.prototype.getVersionObjectDiff = function (dataVersion, jsonObject, i
17431743
* @param {string} afterVersion - After branch/commit to compare
17441744
* @param {string} [id] - The document id to be diffed,
17451745
* if it is omitted all the documents will be compared
1746-
* @param {object} [options] - {keep:{}} Options to send to the diff endpoint.
1746+
* @param {typedef.DiffObject} [options] - {keep:{},count:10,start:0}
1747+
* Options to send to the diff endpoint.
17471748
* The diff api outputs the changes between the input (branches or commits),
17481749
* in options you can list the properties that you would like to see in the diff result in any case.
17491750
* @returns {Promise} A promise that returns the call response object, or an Error if rejected.
@@ -1767,7 +1768,7 @@ WOQLClient.prototype.getVersionObjectDiff = function (dataVersion, jsonObject, i
17671768
* })
17681769
*
17691770
* //This is to view the changes between two branches with the keep options
1770-
* const options = {"keep":{"@id":true, "name": true}}
1771+
* const options = {"keep":{"@id":true, "name": true}, start:0, count:10}
17711772
* client.getVersionDiff("main","mybranch",options).then(diffResult=>{
17721773
* console.log(diffResult)
17731774
* })
@@ -1847,7 +1848,7 @@ WOQLClient.prototype.apply = function (beforeVersion, afterVersion, message, mat
18471848
* })
18481849
*/
18491850
// eslint-disable-next-line max-len
1850-
WOQLClient.prototype.docHistory = function (id, historyParams) {
1851+
WOQLClient.prototype.getDocumentHistory = function (id, historyParams) {
18511852
const params = historyParams || {};
18521853
params.id = id;
18531854
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)