The source data object for this DataModel instance. Once constructed, the source object is sealed such that no keys may be added nor removed.
An immutable reverse-reference to a parent DataModel to which this model belongs.
Define the data schema for this document instance.
Is the current state of this DataModel invalid?
Define the data schema for documents of this type.
Reset the state of this data instance back to mirror the contained source data, erasing any changes.
Clone a model, creating a new data model by combining current data with provided overrides.
The cloned Document instance
Validate the data contained in the document to check for type and content This function throws an error if data within the document is not valid
Optional parameters which customize how validation occurs.
An indicator for whether the document contains valid data
Update the DataModel locally by applying an object of changes to its source data. The provided changes are cleaned, validated, and stored to the source data object for this model. The source data is then re-initialized to apply those changes to the prepared data. The method returns an object of differential changes which modified the original data.
New values which should be applied to the data model
An object containing the changed keys and values
Copy and transform the DataModel into a plain object. Draw the values of the extracted object from the data source (by default) otherwise from its transformed values.
The extracted primitive object
Extract the source data for the DataModel into a simple object format that can be serialized.
The document source data expressed as a plain object
Configure the data model instance before validation and initialization workflows are performed.
Initialize the source data for a new DataModel instance. One-time migrations and initial cleaning operations are applied to the source data.
The candidate source data from which the model will be constructed
Migrated and cleaned source data which will be stored to the model instance
Initialize the instance by copying data from the source object to instance attributes. This mirrors the workflow of SchemaField#initialize but with some added functionality.
Jointly validate the overall data model after each field has been individually validated.
The candidate data object to validate
Define the data schema for documents of this type. The schema is populated the first time it is accessed and cached for future reuse.
Clean a data source object to conform to a specific provided schema.
The cleaned source data
Get an array of validation errors from the provided error structure
Create a new instance of this DataModel from a source record. The source is presumed to be trustworthy and is not strictly validated.
Initial document data which comes from a trusted source.
Model construction context
Create a DataModel instance using a provided serialized JSON string.
Serialized document data in string format
A constructed data model instance
Wrap data migration in a try/catch which attempts it safely
The candidate source data from which the model will be constructed
Migrated source data, if necessary
Take data which conforms to the current data schema and add backwards-compatible accessors to it in order to support older code which uses this data.
Data which matches the current schema
Additional shimming options
Data with added backwards-compatible properties
Validate a port assignment.
The requested port
A data model definition which describes the application configuration options. These options are persisted in the user data Config folder in the options.json file. The server-side software extends this class and provides additional validations and
config
{string|null} adminPassword The server administrator password (obscured)
{string|null} awsConfig The relative path (to Config) of an AWS configuration file
{boolean} compressStatic Whether to compress static files? True by default
{string} dataPath The absolute path of the user data directory (obscured)
{boolean} fullscreen Whether the application should automatically start in fullscreen mode?
{string|null} hostname A custom hostname applied to internet invitation addresses and URLs
{string} language The default language for the application
{string|null} localHostname A custom hostname applied to local invitation addresses
{string|null} passwordSalt A custom salt used for hashing user passwords (obscured)
{number} port The port on which the server is listening
{number} [protocol] The Internet Protocol version to use, either 4 or 6.
{number} proxyPort An external-facing proxied port used for invitation addresses and URLs
{boolean} proxySSL Is the application running in SSL mode at a reverse-proxy level?
{string|null} routePrefix A URL path part which prefixes normal application routing
{string|null} sslCert The relative path (to Config) of a used SSL certificate
{string|null} sslKey The relative path (to Config) of a used SSL key
{string} updateChannel The current application update channel
{boolean} upnp Is UPNP activated?
{number} upnpLeaseDuration The duration in seconds of a UPNP lease, if UPNP is active
{string} world A default world name which starts automatically on launch