Valid JSON types.
Type representing the ID of an entity.
A JSON array.
Type consisting of the body
and contentType
fields from Post
.
Community model used for manipulating the MongoDB database.
Post model used for manipulating the MongoDB database.
User model used for manipulating the MongoDB database.
Used for logging messages throughout the application.
Examples:
logger.log('silly', "127.0.0.1 - there's no place like home");
logger.log('debug', "127.0.0.1 - there's no place like home");
logger.log('verbose', "127.0.0.1 - there's no place like home");
logger.log('info', "127.0.0.1 - there's no place like home");
logger.log('warn', "127.0.0.1 - there's no place like home");
logger.log('error', "127.0.0.1 - there's no place like home");
logger.info("127.0.0.1 - there's no place like home");
logger.warn("127.0.0.1 - there's no place like home");
logger.error("127.0.0.1 - there's no place like home");
Converts a date to a UNIX timestamp.
The date to convert.
The date as a UNIX timestamp (in seconds).
Extracts the body of a post from a post object, if it exists.
Throws a InvalidPostBodyFormatError
or InvalidPostBodyTypeError
if there are
problems during the extraction.
The post object to extract the body from.
The post's body and content type.
Gets an ID from a reference object.
References can either be documents (resolved) or an ID to a document (unresolved). This function always returns the ID, even in the resolved case.
The reference to get the ID from.
The reference's ID.
Converts an array of validation errors (produced by the
class-validator
package) to a string representation.
The validation errors.
A string representation of the errors, or undefined if there were no errors.
Generated using TypeDoc
@unifed/backend-core
This package is a collection of functions and classes used across the backend of the application. Mostly, this includes code for the database models, logging, and accessing configuration properties.