idanalyzer
Version:
ID Analyzer API client library, scan and verify global passport, driver license and identification card.
1,977 lines (517 loc) • 21.4 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Vault</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: Vault</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>Vault<span class="signature">(apikey, region)</span><span class="type-signature"></span></h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Vault"><span class="type-signature"></span>new Vault<span class="signature">(apikey, region)</span><span class="type-signature"></span></h4>
<div class="description">
Initialize Vault API with an API key, and optional region (US, EU)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>apikey</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="default">
</td>
<td class="description last">You API key</td>
</tr>
<tr>
<td class="name"><code>region</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="default">
US
</td>
<td class="description last">US/EU</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="idanalyzer.js.html">idanalyzer.js</a>, <a href="idanalyzer.js.html#line1440">line 1440</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="addImage"><span class="type-signature"></span>addImage<span class="signature">(id, image, type)</span><span class="type-signature"> → {Promise.<object>}</span></h4>
<div class="description">
Add a document or face image into an existing vault entry
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="default">
</td>
<td class="description last">Vault entry ID</td>
</tr>
<tr>
<td class="name"><code>image</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="default">
</td>
<td class="description last">Image file path, base64 content or URL</td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="default">
0
</td>
<td class="description last">Type of image: 0 = document, 1 = person</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="idanalyzer.js.html">idanalyzer.js</a>, <a href="idanalyzer.js.html#line1340">line 1340</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<div class="param-desc">
New image object
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
<h4 class="name" id="delete"><span class="type-signature"></span>delete<span class="signature">(id)</span><span class="type-signature"> → {Promise.<object>}</span></h4>
<div class="description">
Delete a single or multiple vault entries
</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>id</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last">Vault entry ID or array of IDs</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="idanalyzer.js.html">idanalyzer.js</a>, <a href="idanalyzer.js.html#line1320">line 1320</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
<h4 class="name" id="deleteImage"><span class="type-signature"></span>deleteImage<span class="signature">(vaultId, imageId)</span><span class="type-signature"> → {Promise.<object>}</span></h4>
<div class="description">
Delete an image from vault
</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>vaultId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Vault entry ID</td>
</tr>
<tr>
<td class="name"><code>imageId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Image ID</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="idanalyzer.js.html">idanalyzer.js</a>, <a href="idanalyzer.js.html#line1371">line 1371</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
<h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(id)</span><span class="type-signature"> → {Promise.<object>}</span></h4>
<div class="description">
Get a single vault entry
</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>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Vault entry ID</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="idanalyzer.js.html">idanalyzer.js</a>, <a href="idanalyzer.js.html#line1239">line 1239</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
<h4 class="name" id="list"><span class="type-signature"></span>list<span class="signature">()</span><span class="type-signature"> → {Promise.<object>}</span></h4>
<div class="description">
List multiple vault entries with optional filter, sorting and paging arguments
</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>options.filter</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">Array of filter statements, refer to https://developer.idanalyzer.com/vaultapi.html for filter construction</td>
</tr>
<tr>
<td class="name"><code>options.orderby</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Field name used to order the results, refer to https://developer.idanalyzer.com/vaultapi.html for available fields</td>
</tr>
<tr>
<td class="name"><code>options.sort</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Sort results by ASC = Ascending, DESC = DESCENDING</td>
</tr>
<tr>
<td class="name"><code>options.limit</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">Number of results to return</td>
</tr>
<tr>
<td class="name"><code>options.offset</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">Offset the first result using specified index</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="idanalyzer.js.html">idanalyzer.js</a>, <a href="idanalyzer.js.html#line1259">line 1259</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
<h4 class="name" id="searchFace"><span class="type-signature"></span>searchFace<span class="signature">(image, maxEntry, threshold)</span><span class="type-signature"> → {Promise.<object>}</span></h4>
<div class="description">
Search vault using a person's face image
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>image</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="default">
</td>
<td class="description last">Face image file path, base64 content or URL</td>
</tr>
<tr>
<td class="name"><code>maxEntry</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="default">
10
</td>
<td class="description last">Number of entries to return, 1 to 10.</td>
</tr>
<tr>
<td class="name"><code>threshold</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="default">
0.5
</td>
<td class="description last">Minimum confidence score required for face matching</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="idanalyzer.js.html">idanalyzer.js</a>, <a href="idanalyzer.js.html#line1393">line 1393</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<div class="param-desc">
List of vault entries
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
<h4 class="name" id="trainFace"><span class="type-signature"></span>trainFace<span class="signature">()</span><span class="type-signature"> → {Promise.<object>}</span></h4>
<div class="description">
Train vault for face search
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="idanalyzer.js.html">idanalyzer.js</a>, <a href="idanalyzer.js.html#line1416">line 1416</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
<h4 class="name" id="trainingStatus"><span class="type-signature"></span>trainingStatus<span class="signature">()</span><span class="type-signature"> → {Promise.<object>}</span></h4>
<div class="description">
Get vault training status
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="idanalyzer.js.html">idanalyzer.js</a>, <a href="idanalyzer.js.html#line1427">line 1427</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
<h4 class="name" id="update"><span class="type-signature"></span>update<span class="signature">(id, data)</span><span class="type-signature"> → {Promise.<object>}</span></h4>
<div class="description">
Update vault entry with new data
</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>id</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Vault entry ID</td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">Key-value pairs of the field name and its value</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="idanalyzer.js.html">idanalyzer.js</a>, <a href="idanalyzer.js.html#line1301">line 1301</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<span class="param-type">Error</span>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<object></span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AMLAPI.html">AMLAPI</a></li><li><a href="CoreAPI.html">CoreAPI</a></li><li><a href="DocuPass.html">DocuPass</a></li><li><a href="Vault.html">Vault</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Sat Apr 17 2021 04:17:06 GMT+0800 (Taipei Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>