UNPKG

webgme-engine

Version:

WebGME server and Client API without a GUI

1,625 lines (509 loc) 26.6 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Module: Core</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">Module: Core</h1> <section> <header> </header> <article> <div class="container-overview"> <div class="description"><p>This class defines the public API of the WebGME-Core</p></div> <dl class="details"> <dt class="tag-author">Author:</dt> <dd class="tag-author"> <ul> <li>kecso / https://github.com/kecso</li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line4">line 4</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Type Definitions</h3> <h4 class="name" id="~Constraint">Constraint</h4> <div class="description"> <p>An object that represents some additional rule regarding some node of the project.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="global.html#object">object</a></span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>script</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="description last"><p>The script which checks if the constraint is met.</p></td> </tr> <tr> <td class="name"><code>info</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="description last"><p>Short description of the constraint.</p></td> </tr> <tr> <td class="name"><code>priority</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="description last"><p>Gives instructions on how to deal with violations of the constraint.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line41">line 41</a> </li></ul></dd> </dl> <h4 class="name" id="~DataObject">DataObject</h4> <div class="description"> <p>Inner data of <a href="module-Core.html#~Node">module:Core~Node</a> that can be serialized and saved in the storage.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="global.html#object">object</a></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line15">line 15</a> </li></ul></dd> </dl> <h4 class="name" id="~DefinitionInfo">DefinitionInfo</h4> <div class="description"> <p>Contains the owner and the target of the meta-rule that makes the relationship between the given node and related node a valid one. There can be multiple meta-rules that make the relationship valid, but this is the first one that answers the question isValidChildOf, isValidTargetOf etc.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="global.html#object">object</a></span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>ownerNode</code></td> <td class="type"> <span class="param-type">Core~Node</span> </td> <td class="description last"><p>The meta-node where the meta-rule is stored.</p></td> </tr> <tr> <td class="name"><code>targetNode</code></td> <td class="type"> <span class="param-type">Core~Node</span> </td> <td class="description last"><p>The meta-node the meta-rule is targeting.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line48">line 48</a> </li></ul></dd> </dl> <h4 class="name" id="~GUID">GUID</h4> <div class="description"> <p>Globally unique identifier. A formatted string containing hexadecimal characters. If some projects share some GUIDs that can only be because the node with the given identification represents the same concept.</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_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line33">line 33</a> </li></ul></dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>'cd891e7b-e2ea-e929-f6cd-9faf4f1fc045'</code></pre> <h4 class="name" id="~GmePersisted">GmePersisted</h4> <div class="description"> <p>the result object of a persist which contains information about the newly created data objects.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="global.html#object">object</a></span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>rootHash</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~ObjectHash">module:Core~ObjectHash</a></span> </td> <td class="description last"><p>Hash of the root node.</p></td> </tr> <tr> <td class="name"><code>objects</code></td> <td class="type"> <span class="param-type"><a href="global.html#object">object</a>.&lt;<a href="module-Core.html#~ObjectHash">module:Core~ObjectHash</a>, <a href="module-Core.html#~DataObject">module:Core~DataObject</a>></span> </td> <td class="description last"><p>Hash of the root node.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line20">line 20</a> </li></ul></dd> </dl> <h4 class="name" id="~MixinViolation">MixinViolation</h4> <div class="description"> <p>An object that has information about a mixin violation in the given node.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="global.html#object">object</a></span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>severity</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The severity of the given error ('error','warning').</p></td> </tr> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>'missing', 'attribute collision', 'set collision', 'pointer collision', 'containment collision', 'aspect collision', 'constraint collision'</p></td> </tr> <tr> <td class="name"><code>ruleName</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#undefined">undefined</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The name of the affected rule definition (if available).</p></td> </tr> <tr> <td class="name"><code>targetInfo</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#undefined">undefined</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The path of the target of the violation (if available).</p></td> </tr> <tr> <td class="name"><code>targetNode</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> | <span class="param-type"><a href="global.html#undefined">undefined</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The target node of the violation (if available).</p></td> </tr> <tr> <td class="name"><code>collisionPaths</code></td> <td class="type"> <span class="param-type"><a href="global.html#Array">Array</a>.&lt;<a href="global.html#string">string</a>></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The list of paths of colliding nodes (if any).</p></td> </tr> <tr> <td class="name"><code>collisionNodes</code></td> <td class="type"> <span class="param-type"><a href="global.html#Array">Array</a>.&lt;<a href="module-Core.html#~Node">module:Core~Node</a>></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The colliding mixin nodes (if any).</p></td> </tr> <tr> <td class="name"><code>message</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The description of the violation.</p></td> </tr> <tr> <td class="name"><code>hint</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>Hint on how to resolve the issue.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line81">line 81</a> </li></ul></dd> </dl> <h5>Examples</h5> <pre class="prettyprint"><code>'{ 'severity': 'error', 'type': 'missing', 'targetInfo': '/E/b', 'message': '[MyObject]: mixin node "E/b" is missing from the Meta', 'hint': 'Remove mixin or add to the Meta' }'</code></pre> <pre class="prettyprint"><code>'{ 'severity': 'warning', 'type': 'attribute collision', 'ruleName': 'value', 'collisionPaths': ['/E/a','/E/Z'], 'collisionNodes': [Object,Object], 'message':'[MyObject]: inherits attribute definition "value" from [TypeA] and [TypeB]', 'hint': 'Remove one of the mixin relations' }'</code></pre> <h4 class="name" id="~Node">Node</h4> <div class="description"> <p>the object that represents the atomic element of the containment hierarchy.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="global.html#object">object</a></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line11">line 11</a> </li></ul></dd> </dl> <h4 class="name" id="~ObjectHash">ObjectHash</h4> <div class="description"> <p>Unique SHA-1 hash for the node object.</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_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line27">line 27</a> </li></ul></dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>'#5496cf226542fcceccf89056f0d27564abc88c99'</code></pre> <h4 class="name" id="~RelationRule">RelationRule</h4> <div class="description"> <p>An object that represents a relational type rule-set (pointer/set).</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="global.html#object">object</a></span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>min</code></td> <td class="type"> <span class="param-type"><a href="global.html#integer">integer</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The minimum amount of target necessary for the relationship (if not present or '-1' then there is no minimum rule that applies)</p></td> </tr> <tr> <td class="name"><code>max</code></td> <td class="type"> <span class="param-type"><a href="global.html#integer">integer</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The minimum amount of target necessary for the relationship (if not present or '-1' then there is no minimum rule that applies)</p></td> </tr> <tr> <td class="name"><code>absolutePathOfTarget</code></td> <td class="type"> <span class="param-type"><a href="global.html#object">object</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>special rules regarding the given type (if the object is empty, it still represents that the type is a valid target of the relationship)</p> <h6>Properties</h6> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>min</code></td> <td class="type"> <span class="param-type"><a href="global.html#integer">integer</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The minimum amount of target necessary for the relationship from the given type (if not present or '-1' then there is no minimum rule that applies)</p></td> </tr> <tr> <td class="name"><code>max</code></td> <td class="type"> <span class="param-type"><a href="global.html#integer">integer</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The minimum amount of target necessary for the relationship from the given type (if not present or '-1' then there is no minimum rule that applies)</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_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line56">line 56</a> </li></ul></dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>'{ 'min': 1, 'max': -1, 'any/path/of/node':{ 'min':-1, 'max':2 }, 'any/other/valid/path':{ } }'</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>