webgme-engine
Version:
WebGME server and Client API without a GUI
3,834 lines (1,142 loc) • 85.4 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: SafeStorage</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: SafeStorage</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>
<span class="ancestors"><a href="Server_SafeStorage.html">Server:SafeStorage</a>~</span>SafeStorage<span class="signature">(database, logger, gmeConfig, gmeAuth)</span><span class="type-signature"></span></h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="SafeStorage"><span class="type-signature"></span>new SafeStorage<span class="signature">(database, logger, gmeConfig, gmeAuth)</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>database</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>logger</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>gmeConfig</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>gmeAuth</code></td>
<td class="type">
</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="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line38">line 38</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="_getProject"><span class="type-signature"></span>_getProject<span class="signature">(data, callback)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
<p>Authorization: read access</p>
</div>
<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>data</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
</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="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line1344">line 1344</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id="createBranch"><span class="type-signature"></span>createBranch<span class="signature">(data, callback)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
<p>Authorization: write access for data.projectId</p>
</div>
<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>data</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
</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="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line1055">line 1055</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id="createProject"><span class="type-signature"></span>createProject<span class="signature">(data, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {promise}</span></h4>
<div class="description">
<p>Creates a project and assigns a projectId by concatenating the username and the provided project name.
The user with the given username becomes the owner of the project.</p>
<p>Authorization level: canCreate</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>input parameters</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>projectName</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>name of new project.</p></td>
</tr>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
gmeConfig.authentication.guestAccount
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>ownerId</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
data.username
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>kind</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
</td>
<td class="description last"><p>Category of project typically based on meta.</p></td>
</tr>
</tbody>
</table>
</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"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line234">line 234</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>//TODO: jsdocify this</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">promise</span>
</dd>
</dl>
<h4 class="name" id="createTag"><span class="type-signature"></span>createTag<span class="signature">(data, callback)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
<p>Authorization: write access for data.projectId</p>
</div>
<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>data</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
</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="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line1163">line 1163</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id="deleteBranch"><span class="type-signature"></span>deleteBranch<span class="signature">(data, callback)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
<p>Authorization: write access for data.projectId</p>
</div>
<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>data</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
</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="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line1110">line 1110</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id="deleteProject"><span class="type-signature"></span>deleteProject<span class="signature">(data, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
<p>Deletes a project from the _projects collection, deletes the collection for the the project and removes
the rights from all users.</p>
<p>Authorization level: delete access for 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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>input parameters</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</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="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>identifier for project.</p></td>
</tr>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
gmeConfig.authentication.guestAccount
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
</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"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line173">line 173</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>//TODO: jsdocify this</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id="deleteTag"><span class="type-signature"></span>deleteTag<span class="signature">(data, callback)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
<p>Authorization: delete access for data.projectId</p>
</div>
<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>data</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
</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="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line1219">line 1219</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id="duplicateProject"><span class="type-signature"></span>duplicateProject<span class="signature">(data, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {promise}</span></h4>
<div class="description">
<p>Duplicates a project including all data-objects, commits, branches etc.</p>
<p>Authorization level: canCreate and read access for 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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>input parameters</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</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="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>id of existing project that will be duplicated.</p></td>
</tr>
<tr>
<td class="name"><code>projectName</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>name of new project.</p></td>
</tr>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
gmeConfig.authentication.guestAccount
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>ownerId</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
data.username
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
</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"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line429">line 429</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>//TODO: jsdocify this</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">promise</span>
</dd>
</dl>
<h4 class="name" id="getBranchHash"><span class="type-signature"></span>getBranchHash<span class="signature">(data, callback)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
<p>Authorization: read access for data.projectId</p>
</div>
<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>data</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
</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="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line900">line 900</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id="getBranches"><span class="type-signature"></span>getBranches<span class="signature">(data, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {promise}</span></h4>
<div class="description">
<p>Returns a dictionary with all the branches and their hashes within a project.
Example: {
master: '#someHash',
b1: '#someOtherHash'
}</p>
<p>Authorization level: read access for 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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>input parameters</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</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="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>identifier for project.</p></td>
</tr>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
gmeConfig.authentication.guestAccount
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
</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"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line536">line 536</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>//TODO: jsdocify this</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">promise</span>
</dd>
</dl>
<h4 class="name" id="getCommits"><span class="type-signature"></span>getCommits<span class="signature">(data, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {promise}</span></h4>
<div class="description">
<p>Returns an array of commits for a project ordered by their timestamp.</p>
<p>Authorization level: read access for 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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>input parameters</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</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="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>identifier for project.</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="default">
</td>
<td class="description last"><p>maximum number of commits to load.</p></td>
</tr>
<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="global.html#string">string</a></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>timestamp or commitHash to load history from. When number given it will load
data.number of commits strictly before data.before, when commitHash is given it will return that commit too.</p></td>
</tr>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
gmeConfig.authentication.guestAccount
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
</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"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line588">line 588</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>//TODO: jsdocify this</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">promise</span>
</dd>
</dl>
<h4 class="name" id="getCommonAncestorCommit"><span class="type-signature"></span>getCommonAncestorCommit<span class="signature">(data, callback)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
<p>Authorization: read access for data.projectId</p>
</div>
<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>data</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
</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="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line1003">line 1003</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id="getHistory"><span class="type-signature"></span>getHistory<span class="signature">(data, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {promise}</span></h4>
<div class="description">
<p>Returns an array of commits starting from either a branch(es) or commitHash(es).
They are ordered by the rules (applied in order)</p>
<ol>
<li>Descendants are always before their ancestors</li>
<li>By their timestamp</li>
</ol>
<p>Authorization level: read access for 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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>input parameters</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</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="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>identifier for project.</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="default">
</td>
<td class="description last"><p>maximum number of commits to load.</p></td>
</tr>
<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="global.html#Array">Array</a>.<<a href="global.html#string">string</a>></span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>BranchName or commitHash, or an array of such.</p></td>
</tr>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
gmeConfig.authentication.guestAccount
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
</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"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="server_storage_safestorage.js.html">server/storage/safestorage.js</a>, <a href="server_storage_safestorage.js.html#line650">line 650</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>//TODO: jsdocify this</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">promise</span>
</dd>
</dl>
<h4 class="name" id="getLatestCommitData"><span class="type-signature"></span>getLatestCommitData<span class="signature">(data, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {promise}</span></h4>
<div class="description">
<p>Returns the latest commit data for a branch within the project. (This is the same data that is provided during
a BRANCH_UPDATE event.)</p>
<p>Example: {
projectId: 'guest+TestProject',
branchName: 'master',
commitObject: {
_id: '#someCommitHash',
root: '#someNodeHash',
parents: ['#someOtherCommitHash'],
update: ['guest'],
time: 1430169614741,
message: 'createChild(/1/2)',
type: 'commit'
},
coreObject: [{coreObj}, ..., {coreObj}],
}</p>
<p>Authorization level: read access for 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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>input parameters</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</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="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>identifier for project.</p></td>
</tr>
<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="default">
</td>
<td class="description last"><p>name of the branch.</p></td>
</tr>
<tr>
<td class="name"><code>username</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
gmeConfig.authentication.guestAccount
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
</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"></td>
</tr>