UNPKG

forerunnerdb

Version:

A NoSQL document store database for browsers and Node.js.

971 lines (248 loc) 13.7 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: NodeApiClient</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: NodeApiClient</h1> <section> <header> <h2>NodeApiClient</h2> </header> <article> <div class="container-overview"> <h4 class="name" id="NodeApiClient"><span class="type-signature"></span>new NodeApiClient<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> The NodeApiClient class. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="NodeApiClient.js.html">NodeApiClient.js</a>, <a href="NodeApiClient.js.html#line21">line 21</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <ul><li><a href="#rootPath"><span class="type-signature">(static) </span>rootPath<span class="signature">(val<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></a></li><li><a href="#init"><span class="type-signature"></span>init<span class="signature">(core)</span><span class="type-signature"></span></a></li><li><a href="#server"><span class="type-signature"></span>server<span class="signature">(host, port)</span><span class="type-signature"></span></a></li><li><a href="#session"><span class="type-signature"></span>session<span class="signature">(key, obj)</span><span class="type-signature"></span></a></li><li><a href="#sync"><span class="type-signature"></span>sync<span class="signature">(collectionInstance, path, query, options, callback)</span><span class="type-signature"></span></a></li></ul> <h4 class="name" id=".rootPath"><span class="type-signature">(static) </span>rootPath<span class="signature">(val<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></h4> <div class="description"> Gets / sets the rootPath for the client to use in each API call. </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>val</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">The path to set.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="NodeApiClient.js.html">NodeApiClient.js</a>, <a href="NodeApiClient.js.html#line46">line 46</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">*</span> </dd> </dl> <h4 class="name" id="init"><span class="type-signature"></span>init<span class="signature">(core)</span><span class="type-signature"></span></h4> <div class="description"> The init method that can be overridden or extended. </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>core</code></td> <td class="type"> <span class="param-type"><a href="Core.html">Core</a></span> </td> <td class="description last">The ForerunnerDB core instance.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="NodeApiClient.js.html">NodeApiClient.js</a>, <a href="NodeApiClient.js.html#line29">line 29</a> </li></ul></dd> </dl> <h4 class="name" id="server"><span class="type-signature"></span>server<span class="signature">(host, port)</span><span class="type-signature"></span></h4> <div class="description"> Set the url of the server to use for API. </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>host</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The server host name including protocol. E.g. "https://0.0.0.0".</td> </tr> <tr> <td class="name"><code>port</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The server port number e.g. "8080".</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="NodeApiClient.js.html">NodeApiClient.js</a>, <a href="NodeApiClient.js.html#line61">line 61</a> </li></ul></dd> </dl> <h4 class="name" id="session"><span class="type-signature"></span>session<span class="signature">(key, obj)</span><span class="type-signature"></span></h4> <div class="description"> Gets/ sets a global object that will be sent up with client requests to the API or REST server. </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>key</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The key to send the session object up inside.</td> </tr> <tr> <td class="name"><code>obj</code></td> <td class="type"> <span class="param-type">*</span> </td> <td class="description last">The object / value to send up with all requests. If a request has its own data to send up, this session data will be mixed in to the request data under the specified key.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="NodeApiClient.js.html">NodeApiClient.js</a>, <a href="NodeApiClient.js.html#line300">line 300</a> </li></ul></dd> </dl> <h4 class="name" id="sync"><span class="type-signature"></span>sync<span class="signature">(collectionInstance, path, query, options, callback)</span><span class="type-signature"></span></h4> <div class="description"> Initiates a client connection to the API server. </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>collectionInstance</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>path</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>query</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>options</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="NodeApiClient.js.html">NodeApiClient.js</a>, <a href="NodeApiClient.js.html#line320">line 320</a> </li></ul></dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ActiveBucket.html">ActiveBucket</a></li><li><a href="Angular.html">Angular</a></li><li><a href="AutoBind.html">AutoBind</a></li><li><a href="Collection.html">Collection</a></li><li><a href="CollectionGroup.html">CollectionGroup</a></li><li><a href="Condition.html">Condition</a></li><li><a href="Core.html">Core</a></li><li><a href="Db.html">Db</a></li><li><a href="Document.html">Document</a></li><li><a href="Grid.html">Grid</a></li><li><a href="Highchart.html">Highchart</a></li><li><a href="Index2d.html">Index2d</a></li><li><a href="IndexBinaryTree.html">IndexBinaryTree</a></li><li><a href="IndexHashMap.html">IndexHashMap</a></li><li><a href="Infinilist.html">Infinilist</a></li><li><a href="KeyValueStore.html">KeyValueStore</a></li><li><a href="Metrics.html">Metrics</a></li><li><a href="MyModule.html">MyModule</a></li><li><a href="NodeApiClient.html">NodeApiClient</a></li><li><a href="NodeApiServer.html">NodeApiServer</a></li><li><a href="NodeRAS.html">NodeRAS</a></li><li><a href="Odm.html">Odm</a></li><li><a href="OldView.html">OldView</a></li><li><a href="Operation.html">Operation</a></li><li><a href="Overload.html">Overload</a></li><li><a href="Overview.html">Overview</a></li><li><a href="Overview_init.html">init</a></li><li><a href="Path.html">Path</a></li><li><a href="Persist.html">Persist</a></li><li><a href="Procedure.html">Procedure</a></li><li><a href="ReactorIO.html">ReactorIO</a></li><li><a href="Section.html">Section</a></li><li><a href="Serialiser.html">Serialiser</a></li><li><a href="Shared.overload.html">overload</a></li><li><a href="View.html">View</a></li></ul><h3>Mixins</h3><ul><li><a href="ChainReactor.html">ChainReactor</a></li><li><a href="Common.html">Common</a></li><li><a href="Constants.html">Constants</a></li><li><a href="Events.html">Events</a></li><li><a href="Matching.html">Matching</a></li><li><a href="Shared.html">Shared</a></li><li><a href="Sorting.html">Sorting</a></li><li><a href="Tags.html">Tags</a></li><li><a href="Triggers.html">Triggers</a></li><li><a href="Updating.html">Updating</a></li></ul><h3><a href="global.html">Global</a></h3> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Mar 01 2018 11:34:23 GMT+0000 (GMT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>