webgme-engine
Version:
WebGME server and Client API without a GUI
222 lines (184 loc) • 9.54 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: common/storage/constants.js</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">Source: common/storage/constants.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/*globals define*/
/*eslint-env node, browser*/
/**
* @author pmeijer / https://github.com/pmeijer
* @module Storage
*/
/**
* @typedef {string} CommitHash - Unique SHA-1 hash for commit object.
* @example
* '#5496cf226542fcceccf89056f0d27564abc88c99'
*/
/**
* @typedef {object} CommitResult
* @prop {module:Storage~CommitHash} hash - The commitHash for the commit.
* @prop {string} status - 'SYNCED', 'FORKED', 'CANCELED', undefined
*
* @example
* {
* status: 'SYNCED',
* hash: '#someHash'
* }
* @example
* {
* hash: '<hash from makeCommit with no branch provided>'
* }
*/
/**
* @typedef {object} CommitObject
* @prop {module:Storage~CommitHash} _id - Hash of the commit object, a.k.a commitHash.
* @prop {module:Core~ObjectHash} root - Hash of the associated root object, a.k.a. rootHash.
* @prop {module:Storage~CommitHash[]} parents - Commits from where this commit evolved.
* @prop {number} time - When the commit object was created Date.now().
* @prop {string} message - Commit message.
* @prop {string[]} updater - Commit message.
* @prop {string} type - 'commit'
*
* @example
* {
* _id: '#5496cf226542fcceccf89056f0d27564abc88c99',
* root: '#04009ecd1e68117cd3e9d39c87aadd9ed1ee5cb3',
* parents: ['#87d9fd309ec6a5d84776d7731ce1f1ab2790aac2']
* updater: ['guest'],
* time: 1430169614741,
* message: "createChildren({\"/1008889918/1998840078\":\"/1182870936/737997118/1736829087/1966323860\"})",
* type: 'commit'
* }
*/
/**
* @typedef {object} PatchObject
* @prop {module:Core~ObjectHash} _id - Hash of the expected result object.
* @prop {module:Core~ObjectHash} base - Hash of the base object where the patch should be applied.
* @prop {string} type - 'patch'.
* @prop {object} patch - The patch instructions (based on [RFC6902]{@link http://tools.ietf.org/html/rfc6902}).
*
* @example
* {
* _id: '#5496cf226542fcceccf89056f0d27564abc88c99',
* base: '#04009ecd1e68117cd3e9d39c87aadd9ed1ee5cb3',
* type: 'patch',
* patch: [{op: 'add', path: '/atr/new', value: 'value'}]
* }
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof module === 'object' && module.exports) {
module.exports = factory();
}
}(function () {
'use strict';
return {
//Version
VERSION: '1.2.0',
// Database related
MONGO_ID: '_id',
COMMIT_TYPE: 'commit',
OVERLAY_SHARD_TYPE: 'shard',
PROJECT_INFO_KEYS: [
'createdAt',
'creator',
'viewedAt',
'viewer',
'modifiedAt',
'modifier',
'kind',
'description',
'icon'
],
EMPTY_PROJECT_DATA: 'empty',
PROJECT_ID_SEP: '+',
PROJECT_DISPLAYED_NAME_SEP: '/',
// Socket IO
DATABASE_ROOM: 'database',
ROOM_DIVIDER: '%',
NETWORK_STATUS_CHANGED: 'NETWORK_STATUS_CHANGED',
CONNECTED: 'CONNECTED',
DISCONNECTED: 'DISCONNECTED',
RECONNECTED: 'RECONNECTED',
INCOMPATIBLE_CONNECTION: 'INCOMPATIBLE_CONNECTION',
CONNECTION_ERROR: 'CONNECTION_ERROR',
JWT_ABOUT_TO_EXPIRE: 'JWT_ABOUT_TO_EXPIRE',
JWT_EXPIRED: 'JWT_EXPIRED',
RECONNECTING: 'RECONNECTING', // Internal storage state where the websocket connection has been established,
// but work is still be done to join branch and document rooms correctly.
// Branch commit status - this is the status returned after setting the hash of a branch
SYNCED: 'SYNCED', // The commitData was inserted in the database and the branchHash updated.
FORKED: 'FORKED', // The commitData was inserted in the database, but the branchHash NOT updated.
CANCELED: 'CANCELED', // The commitData was never inserted to the database.
MERGED: 'MERGED', // The commit was initially forked, but successfully merged.
BRANCH_STATUS: {
SYNC: 'SYNC',
AHEAD_SYNC: 'AHEAD_SYNC',
AHEAD_NOT_SYNC: 'AHEAD_NOT_SYNC',
PULLING: 'PULLING',
MERGING: 'MERGING',
ERROR: 'ERROR'
},
// Events
PROJECT_DELETED: 'PROJECT_DELETED',
PROJECT_CREATED: 'PROJECT_CREATED',
BRANCH_DELETED: 'BRANCH_DELETED',
BRANCH_CREATED: 'BRANCH_CREATED',
BRANCH_HASH_UPDATED: 'BRANCH_HASH_UPDATED',
TAG_DELETED: 'TAG_DELETED',
TAG_CREATED: 'TAG_CREATED',
COMMIT: 'COMMIT',
BRANCH_UPDATED: 'BRANCH_UPDATED',
BRANCH_JOINED: 'BRANCH_JOINED',
BRANCH_LEFT: 'BRANCH_LEFT',
NOTIFICATION: 'NOTIFICATION',
DOCUMENT_OPERATION: 'DOCUMENT_OPERATION',
DOCUMENT_SELECTION: 'DOCUMENT_SELECTION',
// Types of notifications
BRANCH_ROOM_SOCKETS: 'BRANCH_ROOM_SOCKETS',
PLUGIN_NOTIFICATION: 'PLUGIN_NOTIFICATION',
ADD_ON_NOTIFICATION: 'ADD_ON_NOTIFICATION',
CLIENT_STATE_NOTIFICATION: 'CLIENT_STATE_NOTIFICATION',
// Additional sub types for plugin notification
PLUGIN_NOTIFICATION_TYPE: {
INITIATED: 'INITIATED',
ABORT: 'ABORT',
MESSAGE: 'MESSAGE'
},
WEBSOCKET_ROUTER_ROOM_ID_PREFIX: 'wsr-room-',
WEBSOCKET_ROUTER_MESSAGE_TYPES: {
CONNECT: 'wsm-connect',
DISCONNECT: 'wsm-disconnect',
MESSAGE: 'wsm-message'
}
};
}));
</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="Server_GMEAuth.html">Server:GMEAuth</a></li><li><a href="Server_SafeStorage.html">Server:SafeStorage</a></li><li><a href="Server_UserProject.html">Server:UserProject</a></li><li><a href="module-Core.html">Core</a></li><li><a href="module-Storage.html">Storage</a></li><li><a href="module-crosscuts.html">crosscuts</a></li><li><a href="module-serialization.html">serialization</a></li></ul><h3>Externals</h3><ul><li><a href="external-Promise.html">Promise</a></li></ul><h3>Classes</h3><ul><li><a href="AddOnBase.html">AddOnBase</a></li><li><a href="AddOnUpdateResult.html">AddOnUpdateResult</a></li><li><a href="Artifact.html">Artifact</a></li><li><a href="BlobClient.html">BlobClient</a></li><li><a href="BlobMetadata.html">BlobMetadata</a></li><li><a href="BlobRunPluginClient.html">BlobRunPluginClient</a></li><li><a href="Client.html">Client</a></li><li><a href="Core.html">Core</a></li><li><a href="ExecutorClient.html">ExecutorClient</a></li><li><a href="GMENode.html">GMENode</a></li><li><a href="GmeLogger.html">GmeLogger</a></li><li><a href="InterPluginResult.html">InterPluginResult</a></li><li><a href="JobInfo.html">JobInfo</a></li><li><a href="OutputInfo.html">OutputInfo</a></li><li><a href="PluginBase.html">PluginBase</a></li><li><a href="PluginConfig.html">PluginConfig</a></li><li><a href="PluginMessage.html">PluginMessage</a></li><li><a href="PluginNodeDescription.html">PluginNodeDescription</a></li><li><a href="PluginResult.html">PluginResult</a></li><li><a href="Project.html">Project</a></li><li><a href="ProjectInterface.html">ProjectInterface</a></li><li><a href="Server_GMEAuth-GMEAuth.html">GMEAuth</a></li><li><a href="Server_SafeStorage-SafeStorage.html">SafeStorage</a></li><li><a href="Server_UserProject-UserProject.html">UserProject</a></li><li><a href="WebsocketRouter.html">WebsocketRouter</a></li><li><a href="WebsocketRouterUser.html">WebsocketRouterUser</a></li></ul><h3>Events</h3><ul><li><a href="Client.html#event:BRANCH_CHANGED">BRANCH_CHANGED</a></li><li><a href="Client.html#event:BRANCH_CLOSED">BRANCH_CLOSED</a></li><li><a href="Client.html#event:BRANCH_OPENED">BRANCH_OPENED</a></li><li><a href="Client.html#event:BRANCH_STATUS_CHANGED">BRANCH_STATUS_CHANGED</a></li><li><a href="Client.html#event:CONNECTED_USERS_CHANGED">CONNECTED_USERS_CHANGED</a></li><li><a href="Client.html#event:NETWORK_STATUS_CHANGED">NETWORK_STATUS_CHANGED</a></li><li><a href="Client.html#event:NOTIFICATION">NOTIFICATION</a></li><li><a href="Client.html#event:PLUGIN_FINISHED">PLUGIN_FINISHED</a></li><li><a href="Client.html#event:PLUGIN_INITIATED">PLUGIN_INITIATED</a></li><li><a href="Client.html#event:PLUGIN_NOTIFICATION">PLUGIN_NOTIFICATION</a></li><li><a href="Client.html#event:PROJECT_CLOSED">PROJECT_CLOSED</a></li><li><a href="Client.html#event:PROJECT_OPENED">PROJECT_OPENED</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Fri Jun 21 2024 09:43:40 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>