webgme-engine
Version:
WebGME server and Client API without a GUI
3,456 lines (1,034 loc) • 80.5 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: ProjectInterface</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: ProjectInterface</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>ProjectInterface<span class="signature">(projectId, storageObjectsAccessor, mainLogger, gmeConfig)</span><span class="type-signature"></span></h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="ProjectInterface"><span class="type-signature"></span>new ProjectInterface<span class="signature">(projectId, storageObjectsAccessor, mainLogger, gmeConfig)</span><span class="type-signature"></span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>projectId</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="description last"><p>Id of project to be opened.</p></td>
</tr>
<tr>
<td class="name"><code>storageObjectsAccessor</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="description last"><p>Exposes loadObject towards the database.</p></td>
</tr>
<tr>
<td class="name"><code>mainLogger</code></td>
<td class="type">
<span class="param-type"><a href="GmeLogger.html">GmeLogger</a></span>
</td>
<td class="description last"><p>Logger instance from instantiator.</p></td>
</tr>
<tr>
<td class="name"><code>gmeConfig</code></td>
<td class="type">
<span class="param-type"><a href="global.html#GmeConfig">GmeConfig</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line29">line 29</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="gmeConfig"><span class="type-signature"></span>gmeConfig<span class="type-signature"> :<a href="global.html#GmeConfig">GmeConfig</a></span></h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="global.html#GmeConfig">GmeConfig</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line48">line 48</a>
</li></ul></dd>
</dl>
<h4 class="name" id="logger"><span class="type-signature"></span>logger<span class="type-signature"> :<a href="GmeLogger.html">GmeLogger</a></span></h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="GmeLogger.html">GmeLogger</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line53">line 53</a>
</li></ul></dd>
</dl>
<h4 class="name" id="projectId"><span class="type-signature"></span>projectId<span class="type-signature"> :<a href="global.html#string">string</a></span></h4>
<div class="description">
<p>Unique ID of project, built up by the ownerId and projectName.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="global.html#string">string</a></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line38">line 38</a>
</li></ul></dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>'guest+TestProject', 'organization+TestProject2'</code></pre>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="createBranch"><span class="type-signature"></span>createBranch<span class="signature">(branchName, newHash, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Creates a new branch with head pointing to the provided commit hash.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>branchName</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Name of branch to create.</p></td>
</tr>
<tr>
<td class="name"><code>newHash</code></td>
<td class="type">
<span class="param-type"><a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>New commit hash for branch head.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If provided no promise will be returned.</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#null">null</a></span>
|
<span class="param-type"><a href="global.html#Error">Error</a></span>
</td>
<td class="description last"><p>The result of the execution.</p></td>
</tr>
<tr>
<td class="name"><code>result</code></td>
<td class="type">
<span class="param-type"><a href="module-Storage.html#~CommitResult">module:Storage~CommitResult</a></span>
</td>
<td class="description last"><p>Status about the branch update.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line282">line 282</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>On success the promise will be resolved with
<a href="module-Storage.html#~CommitResult">module:Storage~CommitResult</a> <b>result</b>.<br>
On error the promise will be rejected with <a href="global.html#Error">Error</a> <b>error</b>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="createTag"><span class="type-signature"></span>createTag<span class="signature">(tagName, commitHash, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Creates a new tag pointing to the provided commit hash.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tagName</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Name of tag to create.</p></td>
</tr>
<tr>
<td class="name"><code>commitHash</code></td>
<td class="type">
<span class="param-type"><a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Commit hash tag will point to.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If provided no promise will be returned.</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#null">null</a></span>
|
<span class="param-type"><a href="global.html#Error">Error</a></span>
</td>
<td class="description last"><p>The result of the execution.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line396">line 396</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>On success the promise will be resolved with nothing.<br>
On error the promise will be rejected with <a href="global.html#Error">Error</a> <b>error</b>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="deleteBranch"><span class="type-signature"></span>deleteBranch<span class="signature">(branchName, oldHash, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Deletes the branch.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>branchName</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Name of branch to create.</p></td>
</tr>
<tr>
<td class="name"><code>oldHash</code></td>
<td class="type">
<span class="param-type"><a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Previous commit hash for branch head.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If provided no promise will be returned.</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#null">null</a></span>
|
<span class="param-type"><a href="global.html#Error">Error</a></span>
</td>
<td class="description last"><p>The result of the execution.</p></td>
</tr>
<tr>
<td class="name"><code>result</code></td>
<td class="type">
<span class="param-type"><a href="module-Storage.html#~CommitResult">module:Storage~CommitResult</a></span>
</td>
<td class="description last"><p>Status about the branch update.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line298">line 298</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>On success the promise will be resolved with
<a href="module-Storage.html#~CommitResult">module:Storage~CommitResult</a> <b>result</b>.<br>
On error the promise will be rejected with <a href="global.html#Error">Error</a> <b>error</b>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="deleteTag"><span class="type-signature"></span>deleteTag<span class="signature">(tagName, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Deletes the given tag.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tagName</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Name of tag to delete.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If provided no promise will be returned.</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#null">null</a></span>
|
<span class="param-type"><a href="global.html#Error">Error</a></span>
</td>
<td class="description last"><p>The result of the execution.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line409">line 409</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>On success the promise will be resolved with nothing.<br>
On error the promise will be rejected with <a href="global.html#Error">Error</a> <b>error</b>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="getBranchHash"><span class="type-signature"></span>getBranchHash<span class="signature">(branchName, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Retrieves the commit hash for the head of the branch.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>branchName</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Name of branch.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If provided no promise will be returned.</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#null">null</a></span>
|
<span class="param-type"><a href="global.html#Error">Error</a></span>
</td>
<td class="description last"><p>The result of the execution.</p></td>
</tr>
<tr>
<td class="name"><code>commitHash</code></td>
<td class="type">
<span class="param-type"><a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a></span>
</td>
<td class="description last"><p>The commit hash.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line247">line 247</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>On success the promise will be resolved with
<a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a> <b>commitHash</b>.<br>
On error the promise will be rejected with <a href="global.html#Error">Error</a> <b>error</b>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="getBranches"><span class="type-signature"></span>getBranches<span class="signature">(callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Retrieves all branches and their current heads within the project.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If provided no promise will be returned.</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#null">null</a></span>
|
<span class="param-type"><a href="global.html#Error">Error</a></span>
</td>
<td class="description last"><p>The result of the execution.</p></td>
</tr>
<tr>
<td class="name"><code>branches</code></td>
<td class="type">
<span class="param-type">Object.<<a href="global.html#string">string</a>, <a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a>></span>
</td>
<td class="description last"><p>An object with branch names as keys
and their commit-hashes as values.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line312">line 312</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>On success the promise will be resolved with
Object.<string, <a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a>> <b>branches</b>.<br>
On error the promise will be rejected with <a href="global.html#Error">Error</a> <b>error</b>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="getCommitObject"><span class="type-signature"></span>getCommitObject<span class="signature">(branchNameOrCommitHash, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Retrieves the commit-object at the provided branch or commit-hash.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>branchNameOrCommitHash</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Name of branch or a commit-hash.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If provided no promise will be returned.</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#null">null</a></span>
|
<span class="param-type"><a href="global.html#Error">Error</a></span>
</td>
<td class="description last"><p>The result of the execution.</p></td>
</tr>
<tr>
<td class="name"><code>commit</code></td>
<td class="type">
<span class="param-type"><a href="module-Storage.html#~CommitObject">module:Storage~CommitObject</a></span>
</td>
<td class="description last"><p>The commit-object.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line327">line 327</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>On success the promise will be resolved with
<a href="module-Storage.html#~CommitObject">module:Storage~CommitObject</a> <b>commitObject</b>.<br>
On error the promise will be rejected with <a href="global.html#Error">Error</a> <b>error</b>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="getCommits"><span class="type-signature"></span>getCommits<span class="signature">(before, number, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Retrieves and array of the latest (sorted by timestamp) commits for the project.
If timestamp is given it will get <b>number</b> of commits strictly before <b>before</b>.
If commit hash is specified that commit will be included too.
<br> N.B. due to slight time differences on different machines, ancestors may be returned before
their descendants. Unless looking for 'headless' commits 'getHistory' is the preferred method.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>before</code></td>
<td class="type">
<span class="param-type"><a href="global.html#number">number</a></span>
|
<span class="param-type"><a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Timestamp or commitHash to load history from.</p></td>
</tr>
<tr>
<td class="name"><code>number</code></td>
<td class="type">
<span class="param-type"><a href="global.html#number">number</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Number of commits to load.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If provided no promise will be returned.</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#null">null</a></span>
|
<span class="param-type"><a href="global.html#Error">Error</a></span>
</td>
<td class="description last"><p>The result of the execution.</p></td>
</tr>
<tr>
<td class="name"><code>commits</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Array">Array</a>.<<a href="module-Storage.html#~CommitObject">module:Storage~CommitObject</a>></span>
</td>
<td class="description last"><p>The commits that match the input, ordered
by their time of insertion.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line382">line 382</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>On success the promise will be resolved with
Array.<<a href="module-Storage.html#~CommitObject">module:Storage~CommitObject</a>> <b>commits</b>.<br>
On error the promise will be rejected with <a href="global.html#Error">Error</a> <b>error</b>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="getCommonAncestorCommit"><span class="type-signature"></span>getCommonAncestorCommit<span class="signature">(commitA, commitB, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Retrieves the common ancestor of two commits. If no ancestor exists it will result in an error.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>commitA</code></td>
<td class="type">
<span class="param-type"><a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Commit hash.</p></td>
</tr>
<tr>
<td class="name"><code>commitB</code></td>
<td class="type">
<span class="param-type"><a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Commit hash.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If provided no promise will be returned.</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#null">null</a></span>
|
<span class="param-type"><a href="global.html#Error">Error</a></span>
</td>
<td class="description last"><p>The result of the execution (will be non-null if e.g. the commits do
not exist or have no common ancestor).</p></td>
</tr>
<tr>
<td class="name"><code>commitHash</code></td>
<td class="type">
<span class="param-type"><a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a></span>
</td>
<td class="description last"><p>The commit hash of the common ancestor.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line441">line 441</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>On success the promise will be resolved with
<a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a> <b>commitHash</b>.<br>
On error the promise will be rejected with <a href="global.html#Error">Error</a> <b>error</b>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="getHistory"><span class="type-signature"></span>getHistory<span class="signature">(start, number, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Retrieves an array of commits starting from a branch(es) and/or commitHash(es).
<br> The result is ordered by the rules (applied in order)
<br> 1. Descendants are always returned before their ancestors.
<br> 2. By their timestamp.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>start</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
|
<span class="param-type"><a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a></span>
|
<span class="param-type"><a href="global.html#Array">Array</a>.<<a href="global.html#string">string</a>></span>
|
<span class="param-type"><a href="global.html#Array">Array</a>.<<a href="module-Storage.html#~CommitHash">module:Storage~CommitHash</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Branch name,
commit hash or array of these.</p></td>
</tr>
<tr>
<td class="name"><code>number</code></td>
<td class="type">
<span class="param-type"><a href="global.html#number">number</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Number of commits to load.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If provided no promise will be returned.</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#null">null</a></span>
|
<span class="param-type"><a href="global.html#Error">Error</a></span>
</td>
<td class="description last"><p>The result of the execution.</p></td>
</tr>
<tr>
<td class="name"><code>commits</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Array">Array</a>.<<a href="module-Storage.html#~CommitObject">module:Storage~CommitObject</a>></span>
</td>
<td class="description last"><p>The commits that match the input ordered
as explained.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="common_storage_project_interface.js.html">common/storage/project/interface.js</a>, <a href="common_storage_project_interface.js.html#line361">line 361</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>On success the promise will be resolved with
Array.<<a href="module-Storage.html#~CommitObject">module:Storage~CommitObject</a>> <b>commits</b>.<br>
On error the promise will be rejected with <a href="global.html#Error">Error</a> <b>error</b>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="getProjectInfo"><span class="type-signature"></span>getProjectInfo<span class="signature">(callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Retrieves the metadata of the project.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><