Skip to content

Commit a6496cc

Browse files
committed
add pagination to getVersionDiff
1 parent a2c0cae commit a6496cc

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Fix getCommitsLog in WOQLClient
44

55
## New 🚀
6+
* add pagination to getVersionDiff
67
* add getDocumentHistory in WOQLClient class
78
* add baseServer property to ConnectionConfig class
89

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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,8 @@ WOQLClient.prototype.getVersionObjectDiff = function (dataVersion, jsonObject, i
17501750
* @param {string} afterVersion - After branch/commit to compare
17511751
* @param {string} [id] - The document id to be diffed,
17521752
* if it is omitted all the documents will be compared
1753-
* @param {object} [options] - {keep:{}} Options to send to the diff endpoint.
1753+
* @param {typedef.DiffObject} [options] - {keep:{},count:10,start:0}
1754+
* Options to send to the diff endpoint.
17541755
* The diff api outputs the changes between the input (branches or commits),
17551756
* in options you can list the properties that you would like to see in the diff result in any case.
17561757
* @returns {Promise} A promise that returns the call response object, or an Error if rejected.
@@ -1774,7 +1775,7 @@ WOQLClient.prototype.getVersionObjectDiff = function (dataVersion, jsonObject, i
17741775
* })
17751776
*
17761777
* //This is to view the changes between two branches with the keep options
1777-
* const options = {"keep":{"@id":true, "name": true}}
1778+
* const options = {"keep":{"@id":true, "name": true}, start:0, count:10}
17781779
* client.getVersionDiff("main","mybranch",options).then(diffResult=>{
17791780
* console.log(diffResult)
17801781
* })

0 commit comments

Comments
 (0)