Env
Provides a simple, semi-persistent key/value store
type EnvGetArrayFunction = (key: string) => Strings | undefined
type EnvGetFunction = (key: string, fallback?: string) => string
type EnvGetObjectFunction = (key: string) => JsonRecord | JsonArray | undefined
interface EnvPlugin
extends Plugable {
get: EnvGetFunction
getArray: EnvGetArrayFunction
getObject: EnvGetObjectFunction
install: function
set: EnvSetFunction
setArray: EnvSetArrayFunction
setObject: EnvSetObjectFunction
}
type EnvSetArrayFunction = (key: string, value: Strings) => void
type EnvSetFunction = (key: string, value: string) => void
type EnvSetObjectFunction = (key: string, value: object) => void
/** @implements EnvPlugin */
class ClientEnvPluginClass {
get: EnvGetFunction
getArray: EnvGetArrayFunction
getObject: EnvGetObjectFunction
install: function
set: EnvSetFunction
setArray: EnvSetArrayFunction
setObject: EnvSetObjectFunction
}
/** @implements EnvPlugin */
class EnvPluginClass
extends PluginClass {
get: EnvGetFunction
getArray: EnvGetArrayFunction
getObject: EnvGetObjectFunction
install: function
set: EnvSetFunction
setArray: EnvSetArrayFunction
setObject: EnvSetObjectFunction
}
/**
* Absolute directory path where JSON
* formatted
API configuration files are
* stored. These are
typically used by the
* server as a base for
responding to
* request for APIs.
Example:
* /node_modules/@mashermedia/server/json/apis
Previously:
* MASHER_APIS_DIR
*/
const $MM_APIS_DIR = 'MM_APIS_DIR'
/**
* A user ID associated with a special API
* that
provides access to shared media.
*
Example: shared-user
Previously:
* MASHER_SHARED_USER
*/
const $MM_API_USER_ID = 'MM_API_USER_ID'
/**
* Absolute directory path where remote
* media
files are temporarily downloaded
* for local
processing.
Example:
* /tmp/cache
Previously: MASHER_CACHE_ROOT
*/
const $MM_CACHE_DIR = 'MM_CACHE_DIR'
/**
* Absolute file path to the SQLite
* database
itself.
Example:
* /temp/sqlite.db
Previously:
* MASHER_DATA_FILE
*/
const $MM_DATABASE_FILE = 'MM_DATABASE_FILE'
/**
* Absolute directory path where JSON
* formatted
configuration objects are
* stored.
Typically these include
* default APIs, SVG
icons, and translated
* phrases used in the UI.
Example:
* /node_modules/@mashermedia/client/json
Previously:
* MASHER_JSON_DIR
*/
const $MM_DATA_DIR = 'MM_DATA_DIR'
/**
* Absolute directory path where the fonts
* are
stored before encoding. This must
* match the
directory that cairo uses to
* find fonts by
default.
Example:
* /usr/share/fonts
Previously:
* MASHER_FONT_DIR
*/
const $MM_FONT_DIR = 'MM_FONT_DIR'
/**
* Absolute directory path where
* the
MM_MEDIA_URL points to.
Example:
* /var/www/html
Previously:
* MASHER_REQUEST_ROOT
*/
const $MM_MEDIA_DIR = 'MM_MEDIA_DIR'
/**
* Used as the prefix for fully qualified
* URLs to
media files stored on the
* server. Always starts
with HTTP or
* HTTPS.
Example:
* https://example.com/media
*/
const $MM_MEDIA_URL = 'MM_MEDIA_URL'
/**
* Absolute directory path where SQLite
* database
migration are stored.
*
Example:
* /node_modules/@mashermedia/sqlite/sql
Previously:
* MASHER_DATA_DIR
*/
const $MM_MIGRATIONS_DIR = 'MM_MIGRATIONS_DIR'
/**
* Absolute file path to the base directory
* where
media files are created during
* processing. The
final output path
* typically also includes the
user ID,
* media ID, etc.
Example:
* /var/www/html/media
Previously:
* MASHER_OUTPUT_ROOT
*/
const $MM_OUTPUT_DIR = 'MM_OUTPUT_DIR'
/**
* Absolute directory path where HTML, CSS,
* and
other static files to serve are
* stored.
Example:
* /node_module/@mashermedia/express/public
Previously:
* MASHER_ROOT
*/
const $MM_PUBLIC_DIR = 'MM_PUBLIC_DIR'
/**
* The host name or IP address of the
* server, if
different from the one
* specified in URL. Used
in express as the
* host name for the server.
Example:
* 127.0.0.1 or 0.0.0.0
Previously:
* MASHER_HOST
*/
const $MM_SERVER_HOST = 'MM_SERVER_HOST'
/**
* The port the server responds to, if
* different
from the one specified in
* URL.
Example: 80, 443, etc.
Previously:
* MASHER_PORT
*/
const $MM_SERVER_PORT = 'MM_SERVER_PORT'
/**
* Absolute directory path where temporary
* files
related to job processing are
* stored.
Example: /tmp
Previously:
* MASHER_TEMP_ROOT
*/
const $MM_TEMP_DIR = 'MM_TEMP_DIR'
/**
* One or more absolute file paths to
* directories
that contain media files
* that are valid for
processing, separated
* by commas.
Example:
* /var/www/html/media,/tmp/cache
Previously:
* MASHER_VALID_ROOT
*/
const $MM_VALID_MEDIA_DIRS = 'MM_VALID_MEDIA_DIRS'