22const WOQLQuery = require ( './woqlCore' )
33
44/**
5- * Library Functions
5+ * Library Functions to manage the commits graph
6+ * @example
7+ * const woqlLib = WOQLLibrary()
8+ * woqlLib.branches()
9+ *
10+ * //or you can call this functions using WOQL Class
11+ * WOQL.lib().branches()
612 **/
713function WOQLLibrary ( ) {
814 this . default_schema_resource = 'schema/main'
@@ -28,9 +34,10 @@ WOQLLibrary.prototype.branches = function(){//values, variables, cresource) {
2834/**
2935 * get all the commits of a specific branch
3036 * if a timestamp is given, gets all the commits before the specified timestamp
31- * @param {string } branch - the branch name
32- * @param {number } limit - the max number of result
33- * @param {number } timestamp - Unix timestamp in seconds
37+ * @param {string } [branch] - the branch name
38+ * @param {number } [limit] - the max number of result
39+ * @param {number } [start] - the start of the pagination
40+ * @param {number } [timestamp] - Unix timestamp in seconds
3441 */
3542
3643WOQLLibrary . prototype . commits = function ( branch = "main" , limit = 0 , start = 0 , timestamp = 0 ) {
@@ -55,6 +62,8 @@ WOQLLibrary.prototype.commits = function (branch="main",limit=0,start=0,timestam
5562
5663/**
5764*get commits older than the specified commit id
65+ * @param {string } [commit_id] - the commit id
66+ * @param {number } [limit] - the max number of result
5867*/
5968WOQLLibrary . prototype . previousCommits = function ( commit_id , limit = 10 ) {
6069 return new WOQLQuery ( ) . using ( "_commits" ) . limit ( limit ) . select ( "v:Parent ID" , "v:Message" , "v:Commit ID" , "v:Time" , "v:Author" ) . and (
@@ -76,7 +85,7 @@ WOQLLibrary.prototype.previousCommits = function(commit_id,limit=10){
7685 *
7786 * This is useful for finding information about when, by who and why the database was created
7887 * The first commit is the only commit in the database that does not have a parent commit
79- * Therefore this query will not change performance markedly with the size of the database - it does not have to traverse any commit chain
88+ *
8089 */
8190WOQLLibrary . prototype . first_commit = function ( ) {
8291 let noparent = new WOQLQuery ( )
0 commit comments