Global

Methods

dbFilter(filter){Object}

infra/database/repositories/propertyConversion.js, line 156

Returns a database-compatible filter for queries

Name Type Description
filter Object

A filter key/value set

Returns:
Type Description
Object the database-compatible filter

decrypt(text){string}

infra/encryption/index.js, line 33

Decrypts an AES-256 encrypted string

Name Type Description
text string

The text to decrypt

Returns:
Type Description
string decrypted text (utf8)

encrypt(text){string}

infra/encryption/index.js, line 14

Encrypts a string using AES-256

Name Type Description
text string

The text to encrypt

Returns:
Type Description
string encrypted text (hex)

asyncgetHighwatermark(database, mailboxId, operation){object}

infra/database/utilities/getHighwatermark.js, line 16

Returns the high water mark from the most recent IDP Messaging API call

Name Type Description
database DatabaseContext

The database client/connection

mailboxId string

The mailbox id the operation was made against

operation string

The api operation

Returns:
Type Description
object { nextStartTimeUtc, [nextStartId] }

asyncgetMailboxes(database, satelliteGatewayName, mailboxId){Array.<Mailbox>|Mailbox}

infra/database/utilities/getMailboxes.js, line 12

Returns a list of Mailbox entities in the database

Name Type Description
database DatabaseContext

The database context/connection

satelliteGatewayName string optional

Optional filter on message gateway system

mailboxId string optional

Optional filter on mailbox ID

Returns:
Type Description
Array.<Mailbox> | Mailbox A list of Mailboxes or single if ID was specified

asyncgetMailboxGateway(dbContext, mailbox)

infra/database/utilities/getMailboxGateway.js, line 10

Returns the message gateway system parameters for a given mailbox

Name Type Description
dbContext DatabaseContext

The database context/connection

mailbox Mailbox

A Mailbox entity

asyncgetMobileMailbox(database, mobileId){Mailbox}

infra/database/utilities/getMobileMailbox.js, line 12

Returns the Mailbox entity for a given Mobile

Name Type Description
database DatabaseContext

The database context/connection

mobileId string

The Mobile ID

Returns:
Type Description
Mailbox

asyncgetStatusMailbox(database, messageId){Object}

infra/database/utilities/getStatusMailbox.js, line 14

Returns the Mailbox entity for a given Forward Message

Name Type Description
database DatabaseContext

The database context/connection

messageId number

The Mobile ID

Throws:

if messageId or mobileId not found in database

Type
Error
Returns:
Type Description
Object the Mailbox entity

asynchandleApiFailure(err, database, satelliteGateway, operation){boolean}

infra/database/utilities/handleApiFailure.js, line 16

Determines if the error was an API timeout Emits event ApiOutage

Name Type Description
err Error

The candidate error

database DatabaseContext

The database to update

satelliteGateway SatelliteGateway

The SatelliteGateway entity

operation string optional

The API operation that failed

Returns:
Type Description
boolean true if API endpoint is known unavailable

asynchandleApiResponse(database, errorId, apiCallLog, satelliteGateway){boolean}

infra/database/utilities/handleApiResponse.js, line 16

Updates the ApiCallLog and MessageGateway based on IDP API response Emits ApiError

Name Type Description
database DatabaseContext

The database context/connection

errorId number

The error ID returned by the API call

apiCallLog ApiCallLog

An ApiCallLog entity

satelliteGateway SatelliteGateway

A SatelliteGateway entity

Returns:
Type Description
boolean true if the response had no errors

Model(category)

infra/database/models/Model.js, line 10

Model Class prototype

Name Type Description
category string

require("getEntity")(category, filter)

services/getEntity.js, line 22

Retrieves all entity metadata for the given model and filter criteria

Name Type Description
category string

The category/type of the model

filter Object optional

A set of filter criteria

Name Type Description
include Object optional

Filters to include

exclude Object optional

Filters to exclude

options Object optional

Additional options

limit number optional

Maximum quantity to return

desc string optional

Property name for sort descending

asc string optional

Property name for sort ascending

require("getForwardMessages")(mailboxId, messageIds)

services/getForwardMessages.js, line 26

Retrieves a specific list of messages by unique ID.

Emits events:

  • NewForwardMessage
  • NewMobile
  • ApiError
  • ApiOutage
  • ApiRecovery
Name Type Description
mailboxId number | string

The unique Mailbox ID to retrieve from

messageIds Array.<number> | number

Unique/list of message IDs to retrieve

require("getForwardStatuses")()

services/getForwardStatuses.js, line 24

Retrieves all outstanding forward message statuses from all Mailboxes.

Emits events:

  • ForwardMessageStateChange
  • OtherClientForwardSubmission
  • ApiError
  • ApiOutage
  • ApiRecovery

require("getMobiles")(satelliteGatewayName, mailboxId)

services/getMobiles.js, line 21

Retrieves all Mobile metadata provisioned against a Mailbox

Emits event: NewMobile

Name Type Description
satelliteGatewayName string optional

Shorthand name of the network gateway

mailboxId number | string optional

Unique Mailbox ID to retrieve from

require("getReturnMessages")()

services/getReturnMessages.js, line 27

Fetches new mobile-originated messages, stores by unique ID and puts API metadata in the database for use as high water mark.
Updates Mobile metadata from Core Modem messages.

Emits events:

  • NewReturnMessage
  • NewMobile
  • ApiError
  • ApiOutage
  • ApiRecovery

require("submitForwardMessages")(mobileId, message, userMessageId)

services/submitForwardMessages.js, line 54

Submits a command/message to a specified remote modem.

Emits events:

  • NewForwardMessage
  • NewMobile
  • ApiError
  • ApiOutage
  • ApiRecovery
Name Type Description
mobileId string

The destination of the message

message Object

A wrapper for the command/message

Name Type Description
payloadJson Object optional
payloadRaw Array.<number> optional

An array of decimal bytes [0..255]

modemCommand ModemCommand optional

A supported modem command shorthand

userMessageId number optional

an optional user message ID number

require("updateMailbox")(mailboxParameters)

services/updateMailbox.js, line 20

Adds a mailbox or updates existing mailbox parameters

Name Type Description
mailboxParameters object

The Mailbox details

Name Type Description
mailboxId string
name string optional
accessId string optional
password string optional
satelliteGatewayName string optional

require("updateSatelliteGateway")(gatewayParameters)

services/updateSatelliteGateway.js, line 18

Adds or updates a Satellite Gateway in the database

Name Type Description
gatewayParameters Object
Name Type Description
name string

A shorthand name e.g. Inmarsat

url string

The base URL of the REST API

propFromDb(dbProp, dbValue){string|Object}

infra/database/repositories/propertyConversion.js, line 77

Converts database-compatible to model property and optionally its value

Name Type Description
dbProp string

The property name/key from the database

dbValue any optional

Optional value stored in the database

Returns:
Type Description
string | Object the model property name/object

propToDb(modelProp, modelValue){string|Object}

infra/database/repositories/propertyConversion.js, line 46

Converts a property and optionally its value to database-compatible

Name Type Description
modelProp string

The model property

modelValue any optional

Optional property value

Returns:
Type Description
string | Object the db property name/object

asyncupdateSatelliteGateway(database, satelliteGateway, operation){boolean}

infra/database/utilities/updateSatelliteGateway.js, line 16

Updates the SatelliteGateway entity and checks for state change Emits ApiOutage or ApiRecovery on state change

Name Type Description
database DatabaseContext

The database context/connection

satelliteGateway SatelliteGateway

The satellite message gateway

operation string optional

The API operation if triggering the update

Throws:

if gateway not found in database

Type
Error
Returns:
Type Description
boolean true if state changed from prior