isatdatapro-microservices
Version:
A library for creating microservices to access Inmarsat's IsatData Pro satellite IoT system
1,699 lines (667 loc) • 29.7 kB
HTML
<html>
<head>
<meta charset="utf-8">
<title>Module: eventHandler</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<script src="scripts/jquery.min.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/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="styles/jaguar.css">
<script>
var config = {"monospaceLinks":false,"cleverLinks":true,"default":{}};
</script>
</head>
<body>
<div id="wrap" class="clearfix">
<div class="navigation">
<h3 class="applicationName"><a href="index.html"></a></h3>
<div class="search">
<input id="search" type="text" class="form-control input-sm" placeholder="Search Documentations">
</div>
<ul class="list">
<li class="item" data-name="ApiCallLog">
<span class="title">
<a href="ApiCallLog.html">ApiCallLog</a>
</span>
<ul class="members itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="methods itemMembers">
</ul>
<ul class="events itemMembers">
</ul>
</li>
<li class="item" data-name="Field">
<span class="title">
<a href="Field.html">Field</a>
</span>
<ul class="members itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="methods itemMembers">
</ul>
<ul class="events itemMembers">
</ul>
</li>
<li class="item" data-name="Mailbox">
<span class="title">
<a href="Mailbox.html">Mailbox</a>
</span>
<ul class="members itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="methods itemMembers">
<span class="subtitle">Methods</span>
<li data-name="Mailbox#passwordGet"><a href="Mailbox.html#passwordGet">passwordGet</a></li>
<li data-name="Mailbox#passwordSet"><a href="Mailbox.html#passwordSet">passwordSet</a></li>
</ul>
<ul class="events itemMembers">
</ul>
</li>
<li class="item" data-name="Message">
<span class="title">
<a href="Message.html">Message</a>
</span>
<ul class="members itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="methods itemMembers">
<span class="subtitle">Methods</span>
<li data-name="Message#getCodecMessageId"><a href="Message.html#getCodecMessageId">getCodecMessageId</a></li>
<li data-name="Message#getCodecServiceId"><a href="Message.html#getCodecServiceId">getCodecServiceId</a></li>
</ul>
<ul class="events itemMembers">
</ul>
</li>
<li class="item" data-name="MessageForward">
<span class="title">
<a href="MessageForward.html">MessageForward</a>
</span>
<ul class="members itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="methods itemMembers">
<span class="subtitle">Methods</span>
<li data-name="MessageForward#getStateName"><a href="MessageForward.html#getStateName">getStateName</a></li>
<li data-name="MessageForward#getStateReason"><a href="MessageForward.html#getStateReason">getStateReason</a></li>
<li data-name="MessageForward#submit"><a href="MessageForward.html#submit">submit</a></li>
<li data-name="MessageForward#updateStatus"><a href="MessageForward.html#updateStatus">updateStatus</a></li>
<li data-name="MessageForward#wakeupPeriodEnum"><a href="MessageForward.html#wakeupPeriodEnum">wakeupPeriodEnum</a></li>
</ul>
<ul class="events itemMembers">
</ul>
</li>
<li class="item" data-name="MessageReturn">
<span class="title">
<a href="MessageReturn.html">MessageReturn</a>
</span>
<ul class="members itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="methods itemMembers">
</ul>
<ul class="events itemMembers">
</ul>
</li>
<li class="item" data-name="Mobile">
<span class="title">
<a href="Mobile.html">Mobile</a>
</span>
<ul class="members itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="methods itemMembers">
</ul>
<ul class="events itemMembers">
</ul>
</li>
<li class="item" data-name="module:repositories/azureCosmosRepository~DatabaseContext">
<span class="title">
<a href="module-repositories_azureCosmosRepository-DatabaseContext.html">module:repositories/azureCosmosRepository~DatabaseContext</a>
</span>
<ul class="members itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="methods itemMembers">
<span class="subtitle">Methods</span>
<li data-name="module:repositories/azureCosmosRepository~DatabaseContext#close"><a href="module-repositories_azureCosmosRepository-DatabaseContext.html#close">close</a></li>
<li data-name="module:repositories/azureCosmosRepository~DatabaseContext#delete"><a href="module-repositories_azureCosmosRepository-DatabaseContext.html#delete">delete</a></li>
<li data-name="module:repositories/azureCosmosRepository~DatabaseContext#find"><a href="module-repositories_azureCosmosRepository-DatabaseContext.html#find">find</a></li>
<li data-name="module:repositories/azureCosmosRepository~DatabaseContext#initialize"><a href="module-repositories_azureCosmosRepository-DatabaseContext.html#initialize">initialize</a></li>
<li data-name="module:repositories/azureCosmosRepository~DatabaseContext#upsert"><a href="module-repositories_azureCosmosRepository-DatabaseContext.html#upsert">upsert</a></li>
</ul>
<ul class="events itemMembers">
</ul>
</li>
<li class="item" data-name="module:repositories/mysqlRepository~DatabaseContext">
<span class="title">
<a href="module-repositories_mysqlRepository-DatabaseContext.html">module:repositories/mysqlRepository~DatabaseContext</a>
</span>
<ul class="members itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="methods itemMembers">
<span class="subtitle">Methods</span>
<li data-name="module:repositories/mysqlRepository~DatabaseContext#close"><a href="module-repositories_mysqlRepository-DatabaseContext.html#close">close</a></li>
<li data-name="module:repositories/mysqlRepository~DatabaseContext#delete"><a href="module-repositories_mysqlRepository-DatabaseContext.html#delete">delete</a></li>
<li data-name="module:repositories/mysqlRepository~DatabaseContext#find"><a href="module-repositories_mysqlRepository-DatabaseContext.html#find">find</a></li>
<li data-name="module:repositories/mysqlRepository~DatabaseContext#initialize"><a href="module-repositories_mysqlRepository-DatabaseContext.html#initialize">initialize</a></li>
<li data-name="module:repositories/mysqlRepository~DatabaseContext#upsert"><a href="module-repositories_mysqlRepository-DatabaseContext.html#upsert">upsert</a></li>
</ul>
<ul class="events itemMembers">
</ul>
</li>
<li class="item" data-name="Payload">
<span class="title">
<a href="Payload.html">Payload</a>
</span>
<ul class="members itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="methods itemMembers">
<span class="subtitle">Methods</span>
<li data-name="Payload#addField"><a href="Payload.html#addField">addField</a></li>
</ul>
<ul class="events itemMembers">
</ul>
</li>
<li class="item" data-name="SatelliteGateway">
<span class="title">
<a href="SatelliteGateway.html">SatelliteGateway</a>
</span>
<ul class="members itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="typedefs itemMembers">
</ul>
<ul class="methods itemMembers">
</ul>
<ul class="events itemMembers">
</ul>
</li>
</ul>
</div>
<div class="main">
<h1 class="page-title" data-filename="module-eventHandler.html">Module: eventHandler</h1>
<section>
<header>
<h2>
eventHandler
</h2>
</header>
<article>
<div class="container-overview">
<div class="description"><p>Event handler module</p></div>
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<dl>
<dt>
<div class="nameContainer">
<h4 class="name" id="~emitter"><span class="type-signature ">inner,constant</span>emitter</h4>
</div>
</dt>
<dd>
<div class="description">
<p>The event emitter singleton</p>
</div>
<dl class="details">
</dl>
</dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<div class="nameContainer">
<h4 class="name" id="~apiError">
<span class="type-signature ">inner</span>apiError<span class="signature">(operation, error)</span>
</h4>
<div class="tag-source">
infra/eventHandler/index.js, line 97
</div>
</div>
</dt>
<dd>
<div class="description">
<p>Emits a <code>ApiError</code> event with metadata:</p>
<pre class="prettyprint source"><code>{
operation: string,
error: string
}
</code></pre>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>operation</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">
<p>The API operation that resulted in error</p></td>
</tr>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">
</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="~apiOutage">
<span class="type-signature ">inner</span>apiOutage<span class="signature">(satelliteGatewayName, timestamp, source)</span>
</h4>
<div class="tag-source">
infra/eventHandler/index.js, line 114
</div>
</div>
</dt>
<dd>
<div class="description">
<p>Emits a <code>ApiOutage</code> event with metadata:</p>
<pre class="prettyprint source"><code>{
satelliteGatewayName: string,
timestamp: string,
verbose: string
}
</code></pre>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>satelliteGatewayName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">
<p>The gateway name</p></td>
</tr>
<tr>
<td class="name"><code>timestamp</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">
<p>The ISO datetime of the outage</p></td>
</tr>
<tr>
<td class="name"><code>source</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">
<p>The API operation that was non-responsive</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="~apiRecovery">
<span class="type-signature ">inner</span>apiRecovery<span class="signature">(satelliteGatewayName, timestamp, source)</span>
</h4>
<div class="tag-source">
infra/eventHandler/index.js, line 132
</div>
</div>
</dt>
<dd>
<div class="description">
<p>Emits a <code>ApiRecovery</code> event with metadata</p>
<pre class="prettyprint source"><code>{
satelliteGatewayName: string,
timestamp: string,
verbose: string
}
</code></pre>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>satelliteGatewayName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">
<p>The gateway name</p></td>
</tr>
<tr>
<td class="name"><code>timestamp</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">
<p>The ISO datetime of the outage</p></td>
</tr>
<tr>
<td class="name"><code>source</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">
<p>The API operation that was non-responsive</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="~forwardMessageStateChange">
<span class="type-signature ">inner</span>forwardMessageStateChange<span class="signature">(messageId, newState, reason, stateTimeUtc, <span class="optional">mobileId</span>)</span>
</h4>
<div class="tag-source">
infra/eventHandler/index.js, line 59
</div>
</div>
</dt>
<dd>
<div class="description">
<p>Emits a <code>ForwardMessageStateChange</code> event with metadata:</p>
<pre class="prettyprint source"><code>{
messageId: number,
mobileId: (string|undefined),
newState: string,
reason: string,
verbose: string
}
</code></pre>
<p>mobileId may not be known if the message was submitted by another client;
ideally other client submissions trigger a different event</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>messageId</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">
<p>Unique forward message ID from the Status</p></td>
</tr>
<tr>
<td class="name"><code>newState</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">
<p>The new state human-readable</p></td>
</tr>
<tr>
<td class="name"><code>reason</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">
<p>The reason for the new state, human-readable</p></td>
</tr>
<tr>
<td class="name"><code>stateTimeUtc</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">
<p>The time of the state change</p></td>
</tr>
<tr>
<td class="name"><code>mobileId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">
<span class="optional">optional</span>
<p>The mobile ID if known</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="~newForwardMessage">
<span class="type-signature ">inner</span>newForwardMessage<span class="signature">(message)</span>
</h4>
<div class="tag-source">
infra/eventHandler/index.js, line 35
</div>
</div>
</dt>
<dd>
<div class="description">
<p>Emits a <code>NewForwardMessage</code> event with MessageForward model metadata:</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>message</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<p>Uses MessageForward model</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="~newMobile">
<span class="type-signature ">inner</span>newMobile<span class="signature">(mobile)</span>
</h4>
<div class="tag-source">
infra/eventHandler/index.js, line 18
</div>
</div>
</dt>
<dd>
<div class="description">
<p>Emits a <code>NewMobile</code> event with Mobile model metadata.</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>mobile</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<p>Uses Mobile model</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="~newReturnMessage">
<span class="type-signature ">inner</span>newReturnMessage<span class="signature">(message)</span>
</h4>
<div class="tag-source">
infra/eventHandler/index.js, line 26
</div>
</div>
</dt>
<dd>
<div class="description">
<p>Emits a <code>NewReturnMessage</code> event with MessageReturn model metadata.</p>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>message</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<p>Uses MessageReturn model</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<div class="nameContainer">
<h4 class="name" id="~otherClientForwardSubmission">
<span class="type-signature ">inner</span>otherClientForwardSubmission<span class="signature">(messageId, mailboxId)</span>
</h4>
<div class="tag-source">
infra/eventHandler/index.js, line 80
</div>
</div>
</dt>
<dd>
<div class="description">
<p>Emits a <code>OtherClientForwardSubmission</code> event with metadata
to be used for message retrieval:</p>
<pre class="prettyprint source"><code>{
messageId: number,
mailboxId: (number|string),
verbose: string
}
</code></pre>
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>messageId</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">
<p>Unique forward message ID from the Status</p></td>
</tr>
<tr>
<td class="name"><code>mailboxId</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">number</span>
</td>
<td class="description last">
<p>Unique mailbox ID</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
</dl>
</article>
</section>
<footer>
Documentation generated by <a target="_blank" href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Sat Oct 24 2020 14:53:36 GMT-0400 (Eastern Daylight Time)
</footer>
</div>
</div>
<script>prettyPrint();</script>
<script src="scripts/jaguar.js"></script>
</body>
</html>