mirror of
				https://github.com/valentineus/iii-client.git
				synced 2025-11-04 03:49:44 +03:00 
			
		
		
		
	Release of version 1.0.0.
This commit is contained in:
		
							
								
								
									
										662
									
								
								docs/global.html
									
									
									
									
									
								
							
							
						
						
									
										662
									
								
								docs/global.html
									
									
									
									
									
								
							@@ -24,7 +24,7 @@
 | 
			
		||||
<label for="nav-trigger" class="overlay"></label>
 | 
			
		||||
 | 
			
		||||
<nav>
 | 
			
		||||
    <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading"><a href="global.html">Globals</a></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_createPackage">_createPackage</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_decrypt">_decrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_decryptJSON">_decryptJSON</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_encrypt">_encrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_merger">_merger</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_verification">_verification</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#connect">connect</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#http">http</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#send">send</a></span></li>
 | 
			
		||||
    <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading"><a href="global.html">Globals</a></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#connect">connect</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#createPackage">createPackage</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#decrypt">decrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#decryptJSON">decryptJSON</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#encrypt">encrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#http">http</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isVerification">isVerification</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#mergerString">mergerString</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#send">send</a></span></li>
 | 
			
		||||
</nav>
 | 
			
		||||
 | 
			
		||||
<div id="main">
 | 
			
		||||
@@ -160,7 +160,7 @@
 | 
			
		||||
    
 | 
			
		||||
    <dt class="tag-source">Source:</dt>
 | 
			
		||||
    <dd class="tag-source"><ul class="dummy"><li>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line7">line 7</a>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line6">line 6</a>
 | 
			
		||||
    </li></ul></dd>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -191,7 +191,168 @@
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    <h4 class="name" id="_createPackage"><span class="type-signature"></span>_createPackage<span class="signature">(raw)</span><span class="type-signature"> → {String}</span></h4>
 | 
			
		||||
    <h4 class="name" id="connect"><span class="type-signature"></span>connect<span class="signature">(uuid, callback)</span><span class="type-signature"></span></h4>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<div class="description">
 | 
			
		||||
    Connects to the server and returns the connection data.
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<dl class="details">
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    <dt class="tag-source">Source:</dt>
 | 
			
		||||
    <dd class="tag-source"><ul class="dummy"><li>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line14">line 14</a>
 | 
			
		||||
    </li></ul></dd>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
</dl>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <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>uuid</code></td>
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="type">
 | 
			
		||||
            
 | 
			
		||||
                
 | 
			
		||||
<span class="param-type"><code>String</code></span>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            </td>
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="description last">
 | 
			
		||||
                The bot UUID.
 | 
			
		||||
                
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
        <tr>
 | 
			
		||||
            
 | 
			
		||||
                <td class="name"><code>callback</code></td>
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="type">
 | 
			
		||||
            
 | 
			
		||||
                
 | 
			
		||||
<span class="param-type"><code>requestCallback</code></span>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            </td>
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="description last">
 | 
			
		||||
                The callback that handles the response.
 | 
			
		||||
                
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    </tbody>
 | 
			
		||||
</table>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
        
 | 
			
		||||
            
 | 
			
		||||
<div class="section-method">
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    <h4 class="name" id="createPackage"><span class="type-signature"></span>createPackage<span class="signature">(raw)</span><span class="type-signature"> → {String}</span></h4>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -234,7 +395,7 @@
 | 
			
		||||
    
 | 
			
		||||
    <dt class="tag-source">Source:</dt>
 | 
			
		||||
    <dd class="tag-source"><ul class="dummy"><li>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line140">line 140</a>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line139">line 139</a>
 | 
			
		||||
    </li></ul></dd>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -428,7 +589,7 @@
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    <h4 class="name" id="_decrypt"><span class="type-signature"></span>_decrypt<span class="signature">(raw)</span><span class="type-signature"> → {String}</span></h4>
 | 
			
		||||
    <h4 class="name" id="decrypt"><span class="type-signature"></span>decrypt<span class="signature">(raw)</span><span class="type-signature"> → {String}</span></h4>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -471,7 +632,7 @@
 | 
			
		||||
    
 | 
			
		||||
    <dt class="tag-source">Source:</dt>
 | 
			
		||||
    <dd class="tag-source"><ul class="dummy"><li>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line92">line 92</a>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line91">line 91</a>
 | 
			
		||||
    </li></ul></dd>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -588,7 +749,7 @@
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    <h4 class="name" id="_decryptJSON"><span class="type-signature"></span>_decryptJSON<span class="signature">(raw)</span><span class="type-signature"> → {Object}</span></h4>
 | 
			
		||||
    <h4 class="name" id="decryptJSON"><span class="type-signature"></span>decryptJSON<span class="signature">(raw)</span><span class="type-signature"> → {Object}</span></h4>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -631,7 +792,7 @@
 | 
			
		||||
    
 | 
			
		||||
    <dt class="tag-source">Source:</dt>
 | 
			
		||||
    <dd class="tag-source"><ul class="dummy"><li>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line106">line 106</a>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line105">line 105</a>
 | 
			
		||||
    </li></ul></dd>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -748,7 +909,7 @@
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    <h4 class="name" id="_encrypt"><span class="type-signature"></span>_encrypt<span class="signature">(raw)</span><span class="type-signature"> → {String}</span></h4>
 | 
			
		||||
    <h4 class="name" id="encrypt"><span class="type-signature"></span>encrypt<span class="signature">(raw)</span><span class="type-signature"> → {String}</span></h4>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -791,7 +952,7 @@
 | 
			
		||||
    
 | 
			
		||||
    <dt class="tag-source">Source:</dt>
 | 
			
		||||
    <dd class="tag-source"><ul class="dummy"><li>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line78">line 78</a>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line77">line 77</a>
 | 
			
		||||
    </li></ul></dd>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -908,7 +1069,163 @@
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    <h4 class="name" id="_merger"><span class="type-signature"></span>_merger<span class="signature">(raw)</span><span class="type-signature"> → {String}</span></h4>
 | 
			
		||||
    <h4 class="name" id="isVerification"><span class="type-signature"></span>isVerification<span class="signature">(data)</span><span class="type-signature"> → {Boolean}</span></h4>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<div class="description">
 | 
			
		||||
    Validation UUID format string.
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<dl class="details">
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    <dt class="tag-source">Source:</dt>
 | 
			
		||||
    <dd class="tag-source"><ul class="dummy"><li>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line164">line 164</a>
 | 
			
		||||
    </li></ul></dd>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
</dl>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <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>data</code></td>
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="type">
 | 
			
		||||
            
 | 
			
		||||
                
 | 
			
		||||
<span class="param-type"><code>String</code></span>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            </td>
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="description last">
 | 
			
		||||
                The string to check.
 | 
			
		||||
                
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    </tbody>
 | 
			
		||||
</table>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<div class="section-returns">
 | 
			
		||||
<h5>Returns:</h5>
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
<dl class="param-type">
 | 
			
		||||
    <dt>
 | 
			
		||||
        Type:
 | 
			
		||||
    </dt>
 | 
			
		||||
    <dd>
 | 
			
		||||
        
 | 
			
		||||
<span class="param-type"><code>Boolean</code></span>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    </dd>
 | 
			
		||||
</dl>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
        
 | 
			
		||||
            
 | 
			
		||||
<div class="section-method">
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    <h4 class="name" id="mergerString"><span class="type-signature"></span>mergerString<span class="signature">(raw)</span><span class="type-signature"> → {String}</span></h4>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -951,7 +1268,7 @@
 | 
			
		||||
    
 | 
			
		||||
    <dt class="tag-source">Source:</dt>
 | 
			
		||||
    <dd class="tag-source"><ul class="dummy"><li>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line120">line 120</a>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line119">line 119</a>
 | 
			
		||||
    </li></ul></dd>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -1061,323 +1378,6 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
        
 | 
			
		||||
            
 | 
			
		||||
<div class="section-method">
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    <h4 class="name" id="_verification"><span class="type-signature"></span>_verification<span class="signature">(data)</span><span class="type-signature"> → {Boolean}</span></h4>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<div class="description">
 | 
			
		||||
    Validation UUID format string.
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<dl class="details">
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    <dt class="tag-source">Source:</dt>
 | 
			
		||||
    <dd class="tag-source"><ul class="dummy"><li>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line165">line 165</a>
 | 
			
		||||
    </li></ul></dd>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
</dl>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <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>data</code></td>
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="type">
 | 
			
		||||
            
 | 
			
		||||
                
 | 
			
		||||
<span class="param-type"><code>String</code></span>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            </td>
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="description last">
 | 
			
		||||
                The string to check.
 | 
			
		||||
                
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    </tbody>
 | 
			
		||||
</table>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<div class="section-returns">
 | 
			
		||||
<h5>Returns:</h5>
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
<dl class="param-type">
 | 
			
		||||
    <dt>
 | 
			
		||||
        Type:
 | 
			
		||||
    </dt>
 | 
			
		||||
    <dd>
 | 
			
		||||
        
 | 
			
		||||
<span class="param-type"><code>Boolean</code></span>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    </dd>
 | 
			
		||||
</dl>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
        
 | 
			
		||||
            
 | 
			
		||||
<div class="section-method">
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    <h4 class="name" id="connect"><span class="type-signature"></span>connect<span class="signature">(uuid, callback)</span><span class="type-signature"></span></h4>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<div class="description">
 | 
			
		||||
    Connects to the server and returns the connection data.
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<dl class="details">
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    <dt class="tag-source">Source:</dt>
 | 
			
		||||
    <dd class="tag-source"><ul class="dummy"><li>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line15">line 15</a>
 | 
			
		||||
    </li></ul></dd>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
</dl>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <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>uuid</code></td>
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="type">
 | 
			
		||||
            
 | 
			
		||||
                
 | 
			
		||||
<span class="param-type"><code>String</code></span>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            </td>
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="description last">
 | 
			
		||||
                The bot UUID.
 | 
			
		||||
                
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
        <tr>
 | 
			
		||||
            
 | 
			
		||||
                <td class="name"><code>callback</code></td>
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="type">
 | 
			
		||||
            
 | 
			
		||||
                
 | 
			
		||||
<span class="param-type"><code>requestCallback</code></span>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            </td>
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            <td class="description last">
 | 
			
		||||
                The callback that handles the response.
 | 
			
		||||
                
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    </tbody>
 | 
			
		||||
</table>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
        
 | 
			
		||||
            
 | 
			
		||||
@@ -1428,7 +1428,7 @@
 | 
			
		||||
    
 | 
			
		||||
    <dt class="tag-source">Source:</dt>
 | 
			
		||||
    <dd class="tag-source"><ul class="dummy"><li>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line48">line 48</a>
 | 
			
		||||
        <a href="index.js.html">index.js</a>, <a href="index.js.html#line47">line 47</a>
 | 
			
		||||
    </li></ul></dd>
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@@ -1635,7 +1635,7 @@
 | 
			
		||||
<br class="clear">
 | 
			
		||||
 | 
			
		||||
<footer>
 | 
			
		||||
    Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon May 29 2017 07:00:49 GMT+0300 (MSK) using the Minami theme.
 | 
			
		||||
    Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue May 30 2017 16:03:16 GMT+0300 (MSK) using the Minami theme.
 | 
			
		||||
</footer>
 | 
			
		||||
 | 
			
		||||
<script>prettyPrint();</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@
 | 
			
		||||
<label for="nav-trigger" class="overlay"></label>
 | 
			
		||||
 | 
			
		||||
<nav>
 | 
			
		||||
    <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading"><a href="global.html">Globals</a></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_createPackage">_createPackage</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_decrypt">_decrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_decryptJSON">_decryptJSON</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_encrypt">_encrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_merger">_merger</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_verification">_verification</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#connect">connect</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#http">http</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#send">send</a></span></li>
 | 
			
		||||
    <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading"><a href="global.html">Globals</a></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#connect">connect</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#createPackage">createPackage</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#decrypt">decrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#decryptJSON">decryptJSON</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#encrypt">encrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#http">http</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isVerification">isVerification</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#mergerString">mergerString</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#send">send</a></span></li>
 | 
			
		||||
</nav>
 | 
			
		||||
 | 
			
		||||
<div id="main">
 | 
			
		||||
@@ -57,7 +57,7 @@
 | 
			
		||||
<br class="clear">
 | 
			
		||||
 | 
			
		||||
<footer>
 | 
			
		||||
    Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon May 29 2017 07:00:49 GMT+0300 (MSK) using the Minami theme.
 | 
			
		||||
    Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue May 30 2017 16:03:16 GMT+0300 (MSK) using the Minami theme.
 | 
			
		||||
</footer>
 | 
			
		||||
 | 
			
		||||
<script>prettyPrint();</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@
 | 
			
		||||
<label for="nav-trigger" class="overlay"></label>
 | 
			
		||||
 | 
			
		||||
<nav>
 | 
			
		||||
    <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading"><a href="global.html">Globals</a></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_createPackage">_createPackage</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_decrypt">_decrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_decryptJSON">_decryptJSON</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_encrypt">_encrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_merger">_merger</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#_verification">_verification</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#connect">connect</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#http">http</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#send">send</a></span></li>
 | 
			
		||||
    <li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading"><a href="global.html">Globals</a></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#connect">connect</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#createPackage">createPackage</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#decrypt">decrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#decryptJSON">decryptJSON</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#encrypt">encrypt</a></span></li><li class="nav-item"><span class="nav-item-type type-member">M</span><span class="nav-item-name"><a href="global.html#http">http</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#isVerification">isVerification</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#mergerString">mergerString</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="global.html#send">send</a></span></li>
 | 
			
		||||
</nav>
 | 
			
		||||
 | 
			
		||||
<div id="main">
 | 
			
		||||
@@ -44,7 +44,6 @@
 | 
			
		||||
 * @author Valentin Popov <info@valentineus.link>
 | 
			
		||||
 * @license See LICENSE.md file included in this distribution.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var http = require('http');
 | 
			
		||||
 | 
			
		||||
exports.connect = connect;
 | 
			
		||||
@@ -56,7 +55,7 @@ exports.connect = connect;
 | 
			
		||||
function connect(uuid, callback) {
 | 
			
		||||
    uuid = uuid || '';
 | 
			
		||||
 | 
			
		||||
    if (!_verification(uuid)) {
 | 
			
		||||
    if (!isVerification(uuid)) {
 | 
			
		||||
        throw new Error('The UUID is not a valid value!');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -69,7 +68,7 @@ function connect(uuid, callback) {
 | 
			
		||||
 | 
			
		||||
    const request = http.request(query, function(response) {
 | 
			
		||||
        var json = '';
 | 
			
		||||
        response.on('data', (raw) => json = _decryptJSON(raw));
 | 
			
		||||
        response.on('data', (raw) => json = decryptJSON(raw));
 | 
			
		||||
        response.on('end', () => callback(json.result));
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
@@ -96,12 +95,12 @@ function send(raw, callback) {
 | 
			
		||||
        method: 'POST',
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    const data = _createPackage(raw);
 | 
			
		||||
    const data = createPackage(raw);
 | 
			
		||||
 | 
			
		||||
    const request = http.request(query, function(response) {
 | 
			
		||||
        var json = '';
 | 
			
		||||
        response.on('data', (raw) => json = _decryptJSON(raw));
 | 
			
		||||
        response.on('end', () => callback(json));
 | 
			
		||||
        response.on('data', (raw) => json = decryptJSON(raw));
 | 
			
		||||
        response.on('end', () => callback(json.result));
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    request.on('error', (error) => Error(error));
 | 
			
		||||
@@ -110,55 +109,55 @@ function send(raw, callback) {
 | 
			
		||||
    request.end();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports._encrypt = _encrypt;
 | 
			
		||||
exports.encrypt = encrypt;
 | 
			
		||||
/**
 | 
			
		||||
 * Encrypts the incoming data.
 | 
			
		||||
 * @param {String} raw - Decrypted data.
 | 
			
		||||
 * @returns {String} - Encrypted string.
 | 
			
		||||
 */
 | 
			
		||||
function _encrypt(raw) {
 | 
			
		||||
function encrypt(raw) {
 | 
			
		||||
    raw = raw || '';
 | 
			
		||||
 | 
			
		||||
    var base64 = Buffer.from(raw).toString('base64');
 | 
			
		||||
    var string = Buffer.from(base64);
 | 
			
		||||
    return _merger(string).toString('base64');
 | 
			
		||||
    return mergerString(string).toString('base64');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports._decrypt = _decrypt;
 | 
			
		||||
exports.decrypt = decrypt;
 | 
			
		||||
/**
 | 
			
		||||
 * Decrypts the incoming data.
 | 
			
		||||
 * @param {String} raw - Encrypted data.
 | 
			
		||||
 * @returns {String} - Decrypted string.
 | 
			
		||||
 */
 | 
			
		||||
function _decrypt(raw) {
 | 
			
		||||
function decrypt(raw) {
 | 
			
		||||
    raw = raw || '';
 | 
			
		||||
 | 
			
		||||
    var string = Buffer.from(raw, 'base64');
 | 
			
		||||
    var decrypted = _merger(string).toString();
 | 
			
		||||
    var decrypted = mergerString(string).toString();
 | 
			
		||||
    return Buffer.from(decrypted, 'base64');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports._decryptJSON = _decryptJSON;
 | 
			
		||||
exports.decryptJSON = decryptJSON;
 | 
			
		||||
/**
 | 
			
		||||
 * Decrypts an encrypted JSON object.
 | 
			
		||||
 * @param {String} raw - Encrypted data.
 | 
			
		||||
 * @returns {Object} - Decrypted JSON.
 | 
			
		||||
 */
 | 
			
		||||
function _decryptJSON(raw) {
 | 
			
		||||
function decryptJSON(raw) {
 | 
			
		||||
    raw = raw || '';
 | 
			
		||||
 | 
			
		||||
    var string = raw.toString('ascii');
 | 
			
		||||
    var data = _decrypt(string);
 | 
			
		||||
    var data = decrypt(string);
 | 
			
		||||
    return JSON.parse(data);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports._merger = _merger;
 | 
			
		||||
exports.mergerString = mergerString;
 | 
			
		||||
/**
 | 
			
		||||
 * Merge and convert a string.
 | 
			
		||||
 * @param {String} raw - The string to convert.
 | 
			
		||||
 * @returns {String} - The converted string.
 | 
			
		||||
 */
 | 
			
		||||
function _merger(data) {
 | 
			
		||||
function mergerString(data) {
 | 
			
		||||
    data = data || '';
 | 
			
		||||
 | 
			
		||||
    const salt = Buffer.from('some very-very long string without any non-latin characters due to different string representations inside of variable programming languages');
 | 
			
		||||
@@ -170,7 +169,7 @@ function _merger(data) {
 | 
			
		||||
    return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports._createPackage = _createPackage;
 | 
			
		||||
exports.createPackage = createPackage;
 | 
			
		||||
/**
 | 
			
		||||
 * Creates an encrypted package to send.
 | 
			
		||||
 * @param {Object} raw - The data to send.
 | 
			
		||||
@@ -178,14 +177,14 @@ exports._createPackage = _createPackage;
 | 
			
		||||
 * @param {String} raw.text - Message text.
 | 
			
		||||
 * @returns {String} - Encrypted string.
 | 
			
		||||
 */
 | 
			
		||||
function _createPackage(raw) {
 | 
			
		||||
function createPackage(raw) {
 | 
			
		||||
    raw = raw || {};
 | 
			
		||||
 | 
			
		||||
    if (!raw.text) {
 | 
			
		||||
        throw new Error('There is no data to send!');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!_verification(raw.cuid)) {
 | 
			
		||||
    if (!isVerification(raw.cuid)) {
 | 
			
		||||
        throw new Error('Parameter \'CUID\' is not a valid UUID value!');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -194,16 +193,16 @@ function _createPackage(raw) {
 | 
			
		||||
    data.push(raw.text.toString());
 | 
			
		||||
 | 
			
		||||
    var json = JSON.stringify(data);
 | 
			
		||||
    return _encrypt(json);
 | 
			
		||||
    return encrypt(json);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports._verification = _verification;
 | 
			
		||||
exports.isVerification = isVerification;
 | 
			
		||||
/**
 | 
			
		||||
 * Validation UUID format string.
 | 
			
		||||
 * @param {String} data - The string to check.
 | 
			
		||||
 * @returns {Boolean}
 | 
			
		||||
 */
 | 
			
		||||
function _verification(data) {
 | 
			
		||||
function isVerification(data) {
 | 
			
		||||
    data = data || '';
 | 
			
		||||
    const regexp = new RegExp('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', 'i');
 | 
			
		||||
    return regexp.test(data);
 | 
			
		||||
@@ -220,7 +219,7 @@ function _verification(data) {
 | 
			
		||||
<br class="clear">
 | 
			
		||||
 | 
			
		||||
<footer>
 | 
			
		||||
    Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon May 29 2017 07:00:49 GMT+0300 (MSK) using the Minami theme.
 | 
			
		||||
    Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue May 30 2017 16:03:16 GMT+0300 (MSK) using the Minami theme.
 | 
			
		||||
</footer>
 | 
			
		||||
 | 
			
		||||
<script>prettyPrint();</script>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user