This type is used to interface entities of the
account_integrations collection with mongoose and permits to
instanciate objects representing these entities.
This type is used to interface entities of the
account-sessions collection with mongoose and permits to
instanciate objects representing these entities.
e.g. alongside AccountSessionSchema, we also define
AccountDocument which is a mixin that comprises of
AccountSession and this Documentable class.
In class Queryable, the first generic accepted
permits to use documents that are typed with this, to filter
results in a documents query.
This type consists of an URL, a host, a port and a
flag to enable/disable HTTPS. This type is used to establish a
connection to the frontend or the backendapps from the
outside of the hosting network ("public internet").
example
Using the AppConnectionPayload type to configure apps
This type is used to interface entities of the
operations collection with mongoose and permits to
instanciate objects representing these entities.
e.g. alongside AssetSchema, we also define
AssetDocument which is a mixin that comprises of
Asset and this Documentable class.
In class Queryable, the first generic accepted
permits to use documents that are typed with this, to filter
results in a documents query.
since
v0.3.0
AssetType
AssetType:string | "base" | "earn"
label
COMMON
description
This interface consists of a set of configuration
fields that must be provided to configure a custom asset.
Note that newly implemented assets must be added to this
type such that they are correctly understood and configured
for the backend runtime endpoints.
This type consists of a list of dHealth Account
Addresses or Public Keys that are used for authentication
purposes (registry), as well as an authentication secret
which is used for signing access tokens.
example
Using the AuthParameters type to configure authentication
This type is used to interface entities of the
operations collection with mongoose and permits to
instanciate objects representing these entities.
e.g. alongside BlockSchema, we also define
BlockDocument which is a mixin that comprises of
Block and this Documentable class.
In class Queryable, the first generic accepted
permits to use documents that are typed with this, to filter
results in a documents query.
since
v0.3.2
BoosterAssetsMap
BoosterAssetsMap:{}
label
COMMON
description
A discoverable asset configuration object.
This configuration field consists of a key as listed
in BoosterGroup and a configuration object as
defined by DiscoverableAssetsMap.
This interface consists of a set of configuration
fields that must be provided to configure a booster asset.
Note that newly implemented boosters must be added to this
type such that they are correctly understood and configured
for the backend runtime endpoints.
This type consists of the security configuration
related to the backend runtime API. It sets the valid origins
to enable/disable CORS and permits to stop accepting requests
from unknown locations ("origins").
example
Using the CrossOriginParameters type with a wildcard origin
{ origin: "*" }
example
Using the CrossOriginParameters type with a list of origins
// this allows both localhost and example.com { origin: ["http://localhost", "http://example.com"] }
example
Using the CrossOriginParameters type to disable CORS
// Setting `origin: false` disables CORS { origin: false }
// Setting `origin: true` is the equivalent of a wilcard { origin: true }
This type consists of an URL anda publicKey that are used
to establish the connection and query info of the default node.
example
Using the DefaultNodePayload type to configure nodes
// by default the URL can contain the schema and port constdefaultNode = { url:"http://dual-02.dhealth.cloud:3000", publicKey:"613010BCE1FBF3CE1503DEF3003C76E451EA4DD9205FAD3530BFF7B1D78BC989" } asDefaultNodePayload;
link
NetworkConfig
since
v0.3.0
Type declaration
publicKey: string
url: string
DiscoverableAssetsMap
DiscoverableAssetsMap:{}
label
COMMON
description
A discoverable asset configuration object.
This configuration field consists of a key as listed
in AssetType and a parameters object as
defined by AssetParameters.
A type that represents a mongo query operations using
the $dec-operator that updates document field values by decrementing
it as defined in the specification object. This type is used whenever a
$dec operation shall be executed to decrement field values.
A type that represents a mongo query operations using
the $eq-operator that matches documents based of a field value.This
type is used whenever a $eq operation shall be executed for filters
additionally to query conditions.
A type that represents a mongo query operations using
the $eq-operator that matches documents based of a field value.This
type is used whenever a $eq operation shall be executed for filters
additionally to query conditions.
A type that represents a mongo query operations using
the $gt-operator that matches documents based of a field value.This
type is used whenever a $gt operation shall be executed for filters
additionally to query conditions.
A type that represents a mongo query operations using
the $gte-operator that matches documents based of a field value.This
type is used whenever a $gte operation shall be executed for filters
additionally to query conditions.
A type that represents a mongo query operations using
the $inc-operator that updates document field values by incrementing
it as defined in the specification object. This type is used whenever a
$inc operation shall be executed to increment field values.
A type that represents a mongo query operations using
the $lt-operator that matches documents based of a field value.This
type is used whenever a $lt operation shall be executed for filters
additionally to query conditions.
A type that represents a mongo query operations using
the $lte-operator that matches documents based of a field value.This
type is used whenever a $lte operation shall be executed for filters
additionally to query conditions.
A type that represents a mongo query operations using
the $ne-operator that matches documents based of a field value.This
type is used whenever a $eq operation shall be executed for filters
additionally to query conditions.
A type that represents a mongo query operations using
the $set-operator that updates document field values. This type is
used whenever a $set operation shall be executed to create or update
individual field values.
A type that represents a mongo routine used for preparing
the result set that will be aggregated. This type notably configures
the pagination of an individual mongo query and possible enables the
$count routine with the corresponding field name in the result set.
A type that represents a mongo pipeline stage that
uses the $match operator. This type is used whenever a search query
shall be executed for any type of query conditions.
A type that represents mongo query conditions individually
and is used to perform safe database queries with typed conditions.
since
v0.3.2
MongoQueryConditions
MongoQueryConditions:{}
description
A type that consists of a container for multiple
mongo query conditions that are typed using MongoQueryConditionValue
and used to perform safe queries using typed conditions.
A type that represents mongo query operations raw specification
and is used to perform safe database query with added typed operations.
since
v0.3.2
MongoQueryOperationValue
MongoQueryOperationValue:boolean | boolean[] | number | number[] | string | string[] | Date | null | any[]
description
A type that represents mongo query conditions individually
and is used to perform safe database queries with typed conditions.
since
v0.3.2
MongoQueryOperations
MongoQueryOperations:{}
description
A type that consists of a container for multiple
mongo query operations, e.g. $ne or $eq that are typed using
MongoQueryOperation and used to perform safe queries
using typed operations.
A type that represents mongo query pipelines. A pipeline
typically consists of one or more mongo routines that impact the result
set that the query execution will return.
A type that represents mongo query pipeline stages. A pipeline
stage consists of one mongo routines that impacts the result set that a
query execution will return.
since
v0.3.2
MongoQueryResultSet
MongoQueryResultSet:{}
description
A type that consists of a container for multiple
mongo result values that are typed using MongoQueryResultValue
and used to type the result set of a mongo query.
A type that represents a union pipeline used for preparing
the result set that will be aggregated. This type notably configures
the collection name of an individual union group.
Note that the _id field is obligatory in the union group, as well
as the coll - collection name - and the query pipeline stages
A type that represents a mongo routine using the $count
operator. This type is used whenever a $count routine shall be executed
i.e. when the result set contains an aggregated total number of entries.
since
v0.3.2
Type declaration
$count: string
MongoRoutineIn
MongoRoutineIn:{ $in: number[] | string[] }
description
A type that represents a mongo routine using the $in
operator. This type is used whenever a $in routine shall be executed
for number- or string-typed query conditions.
since
v0.3.2
Type declaration
$in: number[] | string[]
MongoRoutineRegex
MongoRoutineRegex:{ $regex: string | RegExp }
description
A type that represents a mongo routine using the $regex
operator. This type is used whenever a $regex condition shall be executed.
This type encapsulates parameters that can be
used when connecting to a dHealth Network node. Configuring
the connection object (repository factory) permits to avoid
extra node requests to be issued before connection can be
established.
example
Example network connection payload object for dHealth Network
This type consists of network parameters that are
necessary when trying to establish connection to an operating
node of dHealth Network.
Important network connection parameters include the network type,
which can be MAIN_NET (104) or TEST_NET (152), a network identifier
that is used as a security against transaction replays, and some
other network related fields like it's starting epoch (UTC timestamp).
example
Example network configuration object for dHealth Network
NodeConnectionPayload:{ port?: number | string; url: string }
label
COMMON
description
This type consists of an URL and an optional port
that are used to establish the connection with an operating
dHealth Network Node. Typically, this node connection payload
refers to a node by its URL with scheme, domain name and port.
example
Using the NodeConnectionPayload type to configure nodes
// by default the URL can contain the schema and port constmyNode1 = { url:"http://dual-02.dhealth.cloud:3000" } asNodeConnectionPayload;
// or also, the port can be split in a separate field constmyNode2 = { url:"http://dual-02.dhealth.cloud", port:3000 } asNodeConnectionPayload;
link
NetworkConfig
since
v0.3.0
Type declaration
Optional port?: number | string
url: string
NotifierResult
NotifierResult:object | SentMessageInfo
OAuthProviderType
OAuthProviderType:string | "strava"
label
OAUTH
description
This interface consists of a set of configuration
fields that must be provided to configure a custom OAuth provider.
Note that newly implemented OAuth provider must be added to
this type such that they are correctly understood and configured
for the backend runtime endpoints (/oauth).
link
OAuthConfig
since
v0.3.0
OAuthProvidersMap
OAuthProvidersMap:{}
label
OAUTH
description
An OAuth Providers configuration object.
This configuration field consists of a key as listed
in {@link ProviderType} and a parameters object as
defined by {@link ProviderParameters}.
This type is used to interface entities of the
operations collection with mongoose and permits to
instanciate objects representing these entities.
e.g. alongside OperationSchema, we also define
OperationDocument which is a mixin that comprises of
Operation and this Documentable class.
In class Queryable, the first generic accepted
permits to use documents that are typed with this, to filter
results in a documents query.
since
v0.3.0
OperationParameters
OperationParameters:{ contract: string; label: string; query: TransactionDocument | any }
label
COMMON
description
This type consists of operation parameters that are
necessary when processing high-level information from data that
is communicated using dHealth Network Transactions. The query
field is passed as a mongo filter query for relevant subjects.
This type is used to interface entities of the
payouts collection with mongoose and permits to create
an instance and objects representing these entities.
e.g. alongside PayoutSchema, we also define
PayoutDocument which is a mixin that comprises of
Payout and this Documentable class.
In class Queryable, the first generic accepted
permits to use documents that are typed with this, to filter
results in a documents query.
This enumeration contains the configurable scopes for
the runtime. Any newly added scope must be added here as well to make
sure, and in case it's necessary, that the scope can be enabled
through the configuration of the backend runtime.
This type is used to interface entities of the
transactions collection with mongoose and permits to
instanciate objects representing these entities.
e.g. alongside TransactionSchema, we also define
TransactionDocument which is a mixin that comprises of
Transaction and this Documentable class.
In class Queryable, the first generic accepted
permits to use documents that are typed with this, to filter
results in a documents query.
since
v0.3.0
UnknownFieldValue
UnknownFieldValue:boolean | number | string | any[] | null | any
description
A type that represents data that is largely typed and
thereby unsafe. This type is used internally before type-casting
the mongo query conditions using MongoQueryConditions.
since
v0.3.2
UnsafeQueryConditions
UnsafeQueryConditions:{}
description
A type that represents data that is largely typed and
thereby unsafe, formatted into a query condition format. This
type is used internally before type-casting the mongo query conditions
using MongoQueryConditions.
Contains a labelled map of connected websocket clients. The
value always contains a connectedSocket instance that is used to
interact with UDP datagram sockets.
This export creates a mongoose schema using the custom
AccountIntegration class and should be used mainly when inferring the
type of fields in a document for the corresponding collection.
This export creates a mongoose schema using the custom
Account class and should be used mainly when inferring the
type of fields in a document for the corresponding collection.
This export creates a mongoose schema using the custom
AccountSession class and should be used mainly when inferring the
type of fields in a document for the corresponding collection.
This export creates a mongoose schema using the custom
ActivityData class and should be used mainly when inferring the
type of fields in a document for the corresponding collection.
This export creates a mongoose schema using the custom
Activity class and should be used mainly when inferring the
type of fields in a document for the corresponding collection.
This export creates a mongoose schema using the custom
Asset class and should be used mainly when
inferring the type of fields in a document for the corresponding
collection.
This export creates a mongoose schema using the custom
AuthChallenge class and should be used mainly when inferring the
type of fields in a document for the corresponding collection.
This export creates a mongoose schema using the custom
Block class and should be used mainly when
inferring the type of fields in a document for the corresponding
collection.
This export creates a mongoose schema using the custom
Log class and should be used mainly when inferring the
type of fields in a document for the corresponding collection.
This export creates a mongoose schema using the custom
Operation class and should be used mainly when
inferring the type of fields in a document for the corresponding
collection.
This export creates a mongoose schema using the custom
Activity class and should be used mainly when inferring the
type of fields in a document for the corresponding collection.
since
v0.4.0
Const Schedulers
Schedulers:{} = ...
label
COMMON
description
This exported constant enumerates all available scheduler
modules. Schedulers are opt-in through the scopes field value of a
dApp's configuration files (config/dapp.json). Schedulers always belong to
and are registered through a scoped module, i.e. "discovery" defines some
schedulers and "payout" may define more schedulers.
Note that the database password is intentionally read only from environment
variables and is not added to the configuration to reduce potential leaks.
Schedulers that are currently available are represented in the following
information table:
A notifier command that aggregates and sorts persisted warn/error logs and periodically creates and send reports.
var
{[key: string]: any[]}
since
v0.1.0
Type declaration
[key: string]: any[]
Const Scopes
Scopes:{} = ...
label
COMMON
description
This exported constant enumerates all available scoped
modules. Scopes are opt-in and only enabled if they are present in a
dApp's configuration files (config/dapp.json).
Note that the database password is intentionally read only from environment
variables and is not added to the configuration to reduce potential leaks.
Scopes that are currently available are represented in the following
information table:
Scope
Reference
Description
database
{@link MongooseModule}
A database scope that consists in a connection adapter for the mongo database background process.
This export creates a mongoose schema using the custom
State class and should be used mainly when inferring the
type of fields in a document for the corresponding collection.
This export creates a mongoose schema using the custom
Statistics class and should be used mainly when inferring the
type of fields in a document for the corresponding collection.
This export creates a mongoose schema using the custom
Transaction class and should be used mainly when
inferring the type of fields in a document for the corresponding
collection.
This helper function parses a transfer transaction
message into an operation type, a.k.a "a contract identifier".
For purposes of backwards compatibility, this function permits
to parse Health2Earn v0 messages as well and maps them to
the elevate:earn operation type.
Note that this method will return "elevate:base" given a plain
message that cannot be parsed into a contracts object.
This type is used to interface entities of the
accounts
collection with mongoose and permits to instanciate objects representing these entities.e.g. alongside AccountSchema, we also define
AccountDocument
which is a mixin that comprises of Account and thisDocumentable
class.In class Queryable, the first generic accepted permits to use documents that are typed with this, to filter results in a documents query.
v0.3.0