Skip to main content
Module

x/mandarinets/mod.ts

Mandarine.TS is a typescript, decorator-driven framework that allows you to create server-side applications. Mandarine.TS provides a range of built-in solutions such as Dependency Injection, Components, ORM and more. Under its umbrella, Mandarine.TS has 4 modules: Core, Data, Security and MVC, these modules will offer you the requirements to build a Mandarine-powered application.
Latest
import * as mandarinets from "https://deno.land/x/mandarinets@v2.3.2/mod.ts";

Namespaces

This namespace contains all the essentials for mandarine to work Gnerally, global functionings are added to this namespace in order to be easily accesible across Mandarine

Refers to the Application Context. The application context is used to manipulate elemental behaviors of Mandarine It is a singleton class

Contains the different properties different stereotypes/components take

Contains the default information Mandarine needs to work.

Handles the interaction with the global environment of Mandarine Mandarine uses a global environment to store and manipulate essential information to work

Refers to all the elements part of the core.

Contains all the essentials for Mandarine's security core to work

Classes

Contains the "application context" of mandarine. The Application Context is used to interact with various namespaces & initializations

The authenticator class contains the logic behind executing built-in authentication by Mandarine. This class is requested by Mandarine's built-in authentication

This class is also known as the DI container. This class handles the addition, initialization and injection for all mandarine components This class is also responsible for connection repository methods to a repository proxy method in order to resolve queries

Includes the instance of DependencyInjectionFactory

Class responsible for storing resource handlers

Contains core methods & information related to Mandarine

This class is the bridge between the HTTP server & the Mandarine Compiler.

Repositories must extend to this class. This class makes interaction beetween the database layer & mandarine engine possible. This class is generic where T equals your model. This class has a parameter in its constructor, which should be your model's instance.

This class represents the default resolver for resources. It is used by Mandarine to resolve static content. It can be overriden or you can create a personalized resolver with your own code. Refer to the documentation https://mandarineframework.gitbook.io/mandarine-ts/mandarine-core/resource-handlers/resource-resolver

MandarineSessionHandler serves as the default implementation of the SessionStore. If not implementation is overriden, you may still use Sessions as this class is already implemented by Mandarine's core

The optional class is used to avoid repetitive validation with If's. If an object is present, you can verify this with Optional.isPresent() If An object is not present but you would like to get a default value, you can do this with Optional.orElseGet(defaultValue); This classs allows you to avoid null exceptions.

This class serves a promise repeater which will re-try your promise until they are successfully resolved or the max attempt limit has been reached.

This class works as a container for resource handlers. This class contains the paths where the resolver will be invoked. This class contains the locations where the resolver should look up for resources. This class contains the indexes of the paths. This class contains the resolver to be used when intercepting.

This class serves as a modeler for templates. A modeler is used to make working with templates & its variables easier

Enums

List of all the possible injection types. NOTE INJECTABLE_OBJECT refers to a injection that is not part of Mandarine Components but it has been defined as a component by the user.

List of all recognizable mandarine components.

List of all native components by Mandarine

List of known authentication exceptions

Used in callbacks from Mandarine's native Session storage system. This is not necessary to use.

Enum to define the SQL Types of every Column. The majority of this file is from the Java source code Part of this file has been written by Mandarine Collaborators

Variables

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator Defines what configuration file component will be using.

Decorator

Decorator

Decorator

Decorator

Initializes the DI factory.

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Used to verify that a method is async

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator

Decorator Inject a value from the configuration file.

Functions

Get the Components' registry from Mandarine's global environment

Get the entity manager to manipulate the current DB connection

Get the properties mandarine is using. If no properties are set by the user then it gets the default properties.

Read .env file located under the current working directory and adds its values to Deno.env

Get the global environment based on interface @MandarineGlobalInterface

Get the properties (MandarineJsonProperties) from mandarine.json

Get the list of registered middlewares Middleware are added to the global environment in order to not request the DI container every time there is an HTTP Request

Get the resource handler registry for incoming requests.

Get the instance of the Session Container

Get the entity manager to manipulate the current DB connection

Initializes the Session Container. The session container is used to determine the configuration of Mandarine's sessions

Initializes Mandarine Global Environment.

Initializes the middleware list in the global environment.

Initializes the middleware list in the global environment.

Initializes the core modules of Mandarine's security core.

Set a new configuration for the mandarine properties If properties are ignored, it will set the default values.

Gets the current login builder which contains the information of the endpoints for built-in logins

This function creates a custom parameter decorator (used in a HTTP Handler). With this function, you can establish your own behaviors towards an injection which will be made when processing the handler This function can be generic in order to specify what type of data your parameter will receive, for this it takes two generic arguments (DecoratorData, DecoratorReturn)

Interfaces

Structure of data for requests in order to resolve dependencies.

Structure of injections in methods' arguments.

Provides information about an exception intercepted by a catch component.

Provides the necessary behavior to intercept an error thrown

Define the behavior of a user-side guard The guard target will be called at the time of a request. onGuard(requestContext, ...args) will be called before executing the endpoint.

Stats/Metadata of Mandarine's core. This includes information such as: When Mandarine was started, number of templates, controller, and others.

Interface used by the ApplicationContext class. Such class contains the necessary bridges for Mandarine's core to work

Interface that provides with the necessary fields for configuration in a Mandarine-powered component stereotype of Catch

Interface that provides with the necessary fields for configuration in a Mandarine-powered component stereotype of Middleware

${MY_VAR} will be considered an environmental reference. The environmental reference will be parsed by CommonUtils.getEnvironmentalReferences and CommonUtils.getEnvironmentalReferences will return an array of EnvironmentalReference

Contains all the Global objects that Mandarine uses

Refers to the essentials of a component class for the Mandarine Engine.

Contains the metadata information of the component. This information is initialized when a component decorator is used

Refers to the context of the component inside the DI container. When a request is made to the DI container, this is what the request returns.

Refers to the Components' Registry The components' registry is used to communicate the mandarine engine & DI layer This is possibly the most important class for mandarine to work. All components are registered inside this class

Handlers the information of a resource handler that will be processed.

Refers to the resource handler registry. All the resource handlers either initialized by the user or by Mandarine will be located here.

Refers to the templates' registry. All the templates that are read and initialized at mandarine compile time are registed inside the templates registry When an user requests a renderable endpoint, the templates' registry will get requested in order to get the template.

List of necessary fields for a Native Component

Properties used by the native components registry. This interface provides mandarine with the management of native components in the core.

Structure for mandarine.json If mandarine.json is present, some behaviors of the Mandarine starter can be altered such as the location of the properties.json file

Structure of Mandarine Properties. Mandarine uses these properties to determine how it should work Custom Properties must extend Mandarine.Properties

Principal interface for the authentication manager builder, which indicates what what service (implementing Mandarine.Security.Auth.UserDetailsService) we will call for built-in authentication

Contains the state of a built-in authentication process

Private API to perform authentication (Mandarine's built-in Authentication)

Handler for login/logout whether successful or not. This is executed after login/logout was called (from built-in authentication)

Data present in request.authentication AUTH_SES_ID refers to the session id with the data of the user that was logged in through Mandarine's built-in authentication AUTH_EXPIRES refers to the time when the session will expire AUTH_PRINCIPAL refers to all the data that was loaded (following the UserDetails implementation)

Interface for the minimum of information a user model must have when using Mandarine's built-in authentication.

Interface for a mandarine-powered component (type service) which will be used for built-in authentication

Data to be used for login/logout purposes from built-in authentication

Implementation of Login Builder, used to create the behaviors for built-in authentication

Represents the object of a mandarine session. This is not customizable.

Represents the object of the configuration for the Session Container

Data present in request regarding the current session

Represents how a SessionStore implementation should be designed. SessionStore is used to design & use the process of manipulating sessions

Define the behavior of a user-side middleware The middleware target will be called at the time of a request. onPreRequest(...args) will be called before executing the endpoint. onPostRequest(...args) will be called after executing the endpoint.

Type Aliases

Interprets the arguments to return after injection

Infer the arguments of constructor for dependency injection.

Permission validators are functions executed during the evaluation of a security expression. PermissionValidator is how Mandarine interprets a security expression