new SafeStorage(database, logger, gmeConfig, gmeAuth)
Parameters:
Name | Type | Description |
---|---|---|
database |
||
logger |
||
gmeConfig |
||
gmeAuth |
- Source:
Methods
_getProject(data, callback) → {*}
Authorization: read access
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *
createBranch(data, callback) → {*}
Authorization: write access for data.projectId
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *
createProject(data, callbackopt) → {promise}
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.
Authorization level: canCreate
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | input parameters Properties
|
||||||||||||||||||||||||||
callback |
function |
<optional> |
- Source:
Returns:
//TODO: jsdocify this
- Type
- promise
createTag(data, callback) → {*}
Authorization: write access for data.projectId
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *
deleteBranch(data, callback) → {*}
Authorization: write access for data.projectId
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *
deleteProject(data, callbackopt) → {Promise}
Deletes a project from the _projects collection, deletes the collection for the the project and removes the rights from all users.
Authorization level: delete access for project
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | input parameters Properties
|
||||||||||||||||
callback |
function |
<optional> |
- Source:
Returns:
//TODO: jsdocify this
- Type
- Promise
deleteTag(data, callback) → {*}
Authorization: delete access for data.projectId
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *
duplicateProject(data, callbackopt) → {promise}
Duplicates a project including all data-objects, commits, branches etc.
Authorization level: canCreate and read access for project
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | input parameters Properties
|
||||||||||||||||||||||||||
callback |
function |
<optional> |
- Source:
Returns:
//TODO: jsdocify this
- Type
- promise
getBranchHash(data, callback) → {*}
Authorization: read access for data.projectId
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *
getBranches(data, callbackopt) → {promise}
Returns a dictionary with all the branches and their hashes within a project. Example: { master: '#someHash', b1: '#someOtherHash' }
Authorization level: read access for project
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | input parameters Properties
|
||||||||||||||||
callback |
function |
<optional> |
- Source:
Returns:
//TODO: jsdocify this
- Type
- promise
getCommits(data, callbackopt) → {promise}
Returns an array of commits for a project ordered by their timestamp.
Authorization level: read access for project
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | input parameters Properties
|
||||||||||||||||||||||||||
callback |
function |
<optional> |
- Source:
Returns:
//TODO: jsdocify this
- Type
- promise
getCommonAncestorCommit(data, callback) → {*}
Authorization: read access for data.projectId
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *
getHistory(data, callbackopt) → {promise}
Returns an array of commits starting from either a branch(es) or commitHash(es). They are ordered by the rules (applied in order)
- Descendants are always before their ancestors
- By their timestamp
Authorization level: read access for project
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | input parameters Properties
|
||||||||||||||||||||||||||
callback |
function |
<optional> |
- Source:
Returns:
//TODO: jsdocify this
- Type
- promise
getLatestCommitData(data, callbackopt) → {promise}
Returns the latest commit data for a branch within the project. (This is the same data that is provided during a BRANCH_UPDATE event.)
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}], }
Authorization level: read access for project
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | input parameters Properties
|
|||||||||||||||||||||
callback |
function |
<optional> |
- Source:
Returns:
//TODO: jsdocify this
- Type
- promise
getProjects(data, callbackopt) → {Promise}
Returns and array of dictionaries for each project the user has at least read access to. If branches is set, the returned array will be filtered based on if the projects really do exist as collections on their own. If branches is not set, there is no guarantee that the returned projects really exist.
Authorization level: read access for each returned project.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | input parameters Properties
|
|||||||||||||||||||||||||||||||||||||||||
callback |
function |
<optional> |
- Source:
Returns:
//TODO: jsdocify this
- Type
- Promise
getTags(data, callbackopt) → {*}
Returns a dictionary with all the tags and their commitHashes within a project. Example: { tag1: '#someHash', taggen: '#someOtherHash' }
Authorization level: read access for project
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | input parameters Properties
|
||||||||||||||||
callback |
function |
<optional> |
- Source:
Returns:
- Type
- *
loadObjects(data, callback) → {*}
Authorization: TODO: read access for data.projectId
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *
loadPaths(data, callbackopt) → {promise}
Returns a dictionary with all the hashes needed to load the containment of the input paths.
Authorization level: read access for data.projectId
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | input parameters. Properties
|
|||||||||||||||||||||||||||||||
callback |
function |
<optional> |
- Source:
Returns:
//TODO: jsdocify this
- Type
- promise
makeCommit(data, callback) → {*}
Authorization: write access for data.projectId
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *
openProject(data, callback) → {*}
Authorization: read access
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *
setBranchHash(data, callback) → {*}
Authorization: write access for data.projectId
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *
squashCommits(data, callback) → {*}
Authorization: write access for data.projectId
Parameters:
Name | Type | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | input parameters Properties
|
|||||||||||||||||||||||||
callback |
- Source:
Returns:
- Type
- *
transferProject(data, callback) → {*}
Authorization level: canCreate and delete access for project
Parameters:
Name | Type | Description |
---|---|---|
data |
||
callback |
- Source:
Returns:
- Type
- *