UNPKG

webgme-engine

Version:

WebGME server and Client API without a GUI

426 lines (375 loc) 16.6 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: docs/client.getter.doc.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: docs/client.getter.doc.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>/** * @author kecso / https://github.com/kecso */ /** * @description This class provides the API for getting information about a gme node * in the model. To get hold of such object use the [getNode]{@link Client#getNode} function. * !!! The documentation of the functions of the class are not complete!!! The functions of this class * are aligned with the functions of the [Core]{@link Core}. * @class GMENode * * @param {string} _id - Path of node. * @param {GmeLogger} logger - logger. * @param {object} state - state of the client. * @param {function} storeNode - invoked when storing new nodes. */ /** * @description Returns the path of the parent of the node. * @function getParentId * @memberOf GMENode * @instance * * @return {string|null} The path of the parent. */ /** * @description Returns the path of the given node. * @function getId * @memberOf GMENode * @instance * * @return {string} The path of the node. */ /** * @description Returns the relative id of the node. * @function getRelid * @memberOf GMENode * @instance * * @return {(string|null|undefined)} The relative id of the node. */ /** * @description Get the GUID of a node. * @function getGuid * @memberOf GMENode * @instance * * @return {Core.GUID} Returns the globally unique identifier. */ /** * @description Collects the relative ids of all the children of the given node. * @function getChildrenRelids * @memberOf GMENode * @instance * * @return {string[]} The function returns an array of the relative ids. */ /** * @description Collects the paths of all the children of the given node. * @function getChildrenIds * @memberOf GMENode * @instance * * @return {string[]} The function returns an array of the absolute paths of the children. */ /** * @description Returns the path of the base of the node. * @function getBaseId * @memberOf GMENode * @instance * * @return {string} The paths of the base of the node. */ /** * @description Check if the given node would be a valid base for the node. * @memberOf GMENode * @instance * * @param {string} basePath - the path of the intended new base node. * * @return {boolean} */ /** * @description Checks if the given node would be a valid parent of the node. * @memberOf GMENode * @instance * * @param {string} parentPath - path of the intended new parent node. * * @return {boolean} */ /** * @description Gathers the paths of instances of the node. * @function getInheritorIds * @memberOf GMENode * @instance * * @return {string[]} The paths of the instances of the node. */ /** * @description Retrieves the value of the given attribute of the given node. * @function getAttribute * @memberOf GMENode * @instance * * @param {string} name - the name of the attribute. * * @return {(object|primitive|null|undefined)} The function returns the value of the attribute of the node. * The value can be an object or any primitive type. If the value is undefined that means the node do not have * such attribute defined. */ /** * @description Returns the value of the attribute defined for the given node. * @function getOwnAttribute * @memberOf GMENode * @instance * * @param {string} name - the name of the attribute. * * @return {(object|primitive|null|undefined)} Returns the value of the attribute defined specifically for * the node. If undefined then it means that there is no such attribute defined directly for the node, meaning * that it either inherits some value or there is no such attribute at all. * [The retrieved attribute should not be modified as is - it should be copied first!!] */ /** * @description Returns the value of the given registry entry. * @function getRegistry * @memberOf GMENode * @instance * * @param {string} name - The name of the registry entry. * * @return {primitive|object|null|undefined} The value of the registry entry. */ /** * @description Returns the value of the registry entry defined for the given node. * Please note that this return value should not be mutated! * @function getOwnRegistry * @memberOf GMENode * @instance * * @param {string} name - The name of the registry entry. * * @return {primitive|object|null|undefined} The value of the registry entry. */ /** * @description Returns the path of the target node of the given pointer. * @function getPointerId * @memberOf GMENode * @instance * * @param {string} name - The name of the pointer. * * @return {string|null|undefined} The path of the target node. If the response is null, then the pointer * is defined but has no target, if undefined, it is not defined. */ /** * @description Returns the path of the target node of the given pointer defined for this specific node. * @function getOwnPointerId * @memberOf GMENode * @instance * * @param {string} name - The name of the pointer. * * @return {string|null|undefined} The path of the target node. If the response is null, then the pointer * is defined but has no target, if undefined, it is not defined. */ /** * @description Retrieves a list of the defined pointer names of the node. * @function getPointerNames * @memberOf GMENode * @instance * * @return {string[]} The function returns an array of the names of the pointers of the node. */ /** * @description Returns the list of the names of the pointers that were defined specifically for the node. * @function getOwnPointerNames * @memberOf GMENode * @instance * * @return {string[]} Returns an array of names of pointers defined specifically for the node. */ /** * @description Returns the names of the defined attributes of the node. * @function getAttributeNames * @memberOf GMENode * @instance * * @return {string[]} The function returns an array of the names of the attributes of the node. */ /** * @description Returns the list of the META defined attribute names of the node. * @function getValidAttributeNames * @memberOf GMENode * @instance * * @return {string[]} The function returns all the attribute names that are defined among the META rules of the * node. */ /** * @description Returns the names of the attributes of the node that have been first defined for * the node and not for its bases. * @function getOwnAttributeNames * @memberOf GMENode * @instance * * @return {string[]} The function returns an array of the names of the own attributes of the node. */ /** * @description Returns the list of the META defined attribute names of * the node that were specifically defined for the node. * @function getOwnValidAttributeNames * @memberOf GMENode * @instance * * @return {string[]} The function returns the attribute names that are defined specifically for the node. */ /** * @description Returns the definition object of an attribute from the META rules of the node. * @function getAttributeMeta * @memberOf GMENode * @instance * * @param {string} name - the name of the attribute. * * @return {object} The function returns the definition object, where type is always defined. For examples * see the similar [Core]{@link Core#getAttributeMeta} definition. */ /** * @description Returns the id of meta-node of the node in question, that is the first base node that is part * of the meta. * (Aliased getBaseTypeId). * @function getMetaTypeId * @memberOf GMENode * @instance * * @return {string} Returns the id of the first node (including itself) among the inheritance chain * that is a META node. It returns null if it does not find such node (ideally the only node with this result * is the ROOT). */ /** * @description Returns the id of the meta-node of the node in question, that is the first base node that is part * of the meta. * (Aliased getMetaTypeId). * @function getBaseTypeId * @memberOf GMENode * @instance * * @return {string|null} Returns the id of the first node (including itself) among the inheritance chain * that is a META node. It returns null if it does not find such node (ideally the only node with this result * is the ROOT). */ /** * @description Checks if the given node in any way inherits type-node. In addition to checking if the node * "isInstanceOf" of type-node, this methods also takes mixins into account. * @function isTypeOf * @memberOf GMENode * @instance * @param {string} typeId - Id to the type node we want to check. * * * @return {bool} The function returns true if the type-node is a base node, or a mixin of any of the * base nodes, of the node. Every node is considered to be a type of itself. */ /** * @description Checks if the node is an instance of the node at base Id. * @function isInstanceOf * @memberOf GMENode * @instance * @param {string} baseId - Id to the base node we want to check. * * @return {bool} Returns true if the base is on the inheritance chain of node. A node is considered to be an * instance of itself here. */ /** * @description Checks if the node can have a child of the given type without causing containment inheritance loop. * @function isValidNewChild * @memberOf GMENode * @instance * @param {string} baseId - Id to the base node that would be the type of the child. * * @return {bool} Returns true if a child of the given type can be created. */ /** * @description Checks if base can be the new base of node. * @function isValidNewBase * @memberOf GMENode * @param {string | null | undefined} base - the new base. * * @return {boolean} True if the supplied base is a valid base for the node. */ /** * @description Returns the Id of the root of the library in question. * @function getLibraryRootId * @memberOf GMENode * @param {string} name - the name of the library. * * @return {string | null} If the library is found then the return value will be the Id of its root, * otherwise the function returns null. */ // expect(typeof node.getRegistryNames).to.equal('function'); // expect(typeof node.getOwnRegistryNames).to.equal('function'); // expect(typeof node.getMemberIds).to.equal('function'); // expect(typeof node.getSetNames).to.equal('function'); // expect(typeof node.getMemberAttributeNames).to.equal('function'); // expect(typeof node.getMemberAttribute).to.equal('function'); // expect(typeof node.getMemberRegistryNames).to.equal('function'); // expect(typeof node.getMemberRegistry).to.equal('function'); // expect(typeof node.getSetRegistry).to.equal('function'); // expect(typeof node.getSetRegistryNames).to.equal('function'); // expect(typeof node.getSetAttribute).to.equal('function'); // expect(typeof node.getSetAttributeNames).to.equal('function'); // expect(typeof node.getValidChildrenTypes).to.equal('function'); // expect(typeof node.getValidAttributeNames).to.equal('function'); // expect(typeof node.isValidAttributeValueOf).to.equal('function'); // expect(typeof node.getValidPointerNames).to.equal('function'); // expect(typeof node.getValidSetNames).to.equal('function'); // expect(typeof node.getConstraintNames).to.equal('function'); // expect(typeof node.getOwnConstraintNames).to.equal('function'); // expect(typeof node.getConstraint).to.equal('function'); // expect(typeof node.toString).to.equal('function'); // expect(typeof node.getCollectionPaths).to.equal('function'); // expect(typeof node.getInstancePaths).to.equal('function'); // expect(typeof node.getJsonMeta).to.equal('function'); // expect(typeof node.isConnection).to.equal('function'); // expect(typeof node.isAbstract).to.equal('function'); // expect(typeof node.isLibraryRoot).to.equal('function'); // expect(typeof node.isLibraryElement).to.equal('function'); // expect(typeof node.getFullyQualifiedName).to.equal('function'); // expect(typeof node.getNamespace).to.equal('function'); // expect(typeof node.getLibraryGuid).to.equal('function'); // expect(typeof node.getCrosscutsInfo).to.equal('function'); // expect(typeof node.getValidChildrenTypesDetailed).to.equal('function'); // expect(typeof node.getValidSetMemberTypesDetailed).to.equal('function'); // expect(typeof node.isMetaNode).to.equal('function'); // expect(typeof node.isValidChildOf).to.equal('function'); // expect(typeof node.getValidChildrenIds).to.equal('function'); // expect(typeof node.isValidTargetOf).to.equal('function'); // expect(typeof node.getValidAspectNames).to.equal('function'); // expect(typeof node.getOwnValidAspectNames).to.equal('function'); // expect(typeof node.getAspectMeta).to.equal('function'); // expect(typeof node.getMixinPaths).to.equal('function'); // expect(typeof node.canSetAsMixin).to.equal('function'); // expect(typeof node.isReadOnly).to.equal('function');</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>