Methods
-
dbFilter(filter){Object}
infra/database/repositories/propertyConversion.js, line 156 -
Returns a database-compatible filter for queries
Name Type Description filterObject 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 textstring 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 textstring 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 databaseDatabaseContext The database client/connection
mailboxIdstring The mailbox id the operation was made against
operationstring The api operation
Returns:
Type Description object { nextStartTimeUtc, [nextStartId] } -
Returns a list of Mailbox entities in the database
Name Type Description databaseDatabaseContext The database context/connection
satelliteGatewayNamestring optional Optional filter on message gateway system
mailboxIdstring 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 dbContextDatabaseContext The database context/connection
mailboxMailbox 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 databaseDatabaseContext The database context/connection
mobileIdstring 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 databaseDatabaseContext The database context/connection
messageIdnumber 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 errError The candidate error
databaseDatabaseContext The database to update
satelliteGatewaySatelliteGateway The SatelliteGateway entity
operationstring 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 databaseDatabaseContext The database context/connection
errorIdnumber The error ID returned by the API call
apiCallLogApiCallLog An ApiCallLog entity
satelliteGatewaySatelliteGateway 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 categorystring -
require("getEntity")(category, filter)
services/getEntity.js, line 22 -
Retrieves all entity metadata for the given model and filter criteria
Name Type Description categorystring The category/type of the model
filterObject optional A set of filter criteria
Name Type Description includeObject optional Filters to include
excludeObject optional Filters to exclude
optionsObject optional Additional options
limitnumber optional Maximum quantity to return
descstring optional Property name for sort descending
ascstring 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:
NewForwardMessageNewMobileApiErrorApiOutageApiRecovery
Name Type Description mailboxIdnumber | string The unique Mailbox ID to retrieve from
messageIdsArray.<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:
ForwardMessageStateChangeOtherClientForwardSubmissionApiErrorApiOutageApiRecovery
-
require("getMobiles")(satelliteGatewayName, mailboxId)
services/getMobiles.js, line 21 -
Retrieves all Mobile metadata provisioned against a Mailbox
Emits event:
NewMobileName Type Description satelliteGatewayNamestring optional Shorthand name of the network gateway
mailboxIdnumber | 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:
NewReturnMessageNewMobileApiErrorApiOutageApiRecovery
-
require("submitForwardMessages")(mobileId, message, userMessageId)
services/submitForwardMessages.js, line 54 -
Submits a command/message to a specified remote modem.
Emits events:
NewForwardMessageNewMobileApiErrorApiOutageApiRecovery
Name Type Description mobileIdstring The destination of the message
messageObject A wrapper for the command/message
Name Type Description payloadJsonObject optional payloadRawArray.<number> optional An array of decimal bytes [0..255]
modemCommandModemCommand optional A supported modem command shorthand
userMessageIdnumber 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 mailboxParametersobject The Mailbox details
Name Type Description mailboxIdstring namestring optional accessIdstring optional passwordstring optional satelliteGatewayNamestring optional -
require("updateSatelliteGateway")(gatewayParameters)
services/updateSatelliteGateway.js, line 18 -
Adds or updates a Satellite Gateway in the database
Name Type Description gatewayParametersObject Name Type Description namestring A shorthand name e.g. Inmarsat
urlstring 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 dbPropstring The property name/key from the database
dbValueany 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 modelPropstring The model property
modelValueany 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 databaseDatabaseContext The database context/connection
satelliteGatewaySatelliteGateway The satellite message gateway
operationstring 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 -