Skip to main content
Module

x/oak_nest/mod.ts

Refer to nestjs to realize some common functions for Deno
Go to Latest
import * as oakNest from "https://deno.land/x/oak_nest@v2.0.0/mod.ts";

Classes

A class which registers middleware (via .use()) and then processes inbound requests against that middleware (via .listen()).

Provides context about the current request and response to middleware functions, and the current instance being processed is the first argument provided a Middleware function.

Provides an way to manage cookies in a request and response on the server as a single iterable collection, as well as the ability to sign and verify cookies to prevent tampering.

An interface for registering middleware that will run when certain HTTP methods and paths are requested, as well as provides a way to parameterize parts of the requested path.

An interface which provides information about the current request. The instance related to the current request is available on the Context's .request property.

An interface to control what response will be sent when the middleware finishes processing the request.

Validation error description.

Enums

Standard HTTP status codes.

Variables

this is a high function which will return a param decorator.

this is a lower function which compared with createParamDecorator, it remove one player.

A symbol that indicates to response.redirect() to attempt to redirect back to the request referrer. For example:

A record of all the status codes text.

Functions

Make an assertion, error will be thrown if expr does not have truthy value.

Set background color to blue.

Set background color using 24bit rgb. color can be a number in range 0x000000 to 0xffffff or an Rgb.

Set background color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Set text color to blue.

Make the text bold.

Cache decorator

Calculate an ETag for an entity. When the entity is a specific set of data it will be fingerprinted as a "strong" tag, otherwise if it is just file information, it will be calculated as a weak tag.

check etag and set etag header

A factory function which provides a way to create errors. It takes up to 3 arguments, the error Status, an message, which defaults to the status text and error options, which includes the expose property to set the .expose value on the error.

Takes an input date and a formatString to format to a string.

Set text color to green.

A helper function that takes the value from the If-Match header and a calculated etag for the target. By using strong comparison, return true if the values match, otherwise false.

A helper function that takes the value from the If-None-Match header and a calculated etag for the target entity and returns false if the etag for the entity matches the supplied value, otherwise true.

Inject decorator

A type guard that determines if the value is an HttpError or not.

Make the text italic.

Get params by router

Middleware that provides a back-to-back proxy for requests.

get the params from the request, if has key, then return the value which is parse by it`s type

Set text color to red.

A default metadata decorator factory that can be used on a class, class member, or parameter.

Set text color using 24bit rgb. color can be a number in range 0x000000 to 0xffffff or an Rgb.

Set text color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Asynchronously fulfill a response with a file from the local file system.

Decorator that assigns metadata to the class/function using the specified key.

Validates given object and reject on error.

Set text color to yellow.

Interfaces

Interface defining a Class type provider.

Interface defining a Dynamic Module.

Interface defining an Existing (aliased) type provider.

Interface defining a Factory type provider.

When reading a body in full via .read() from a FormDataReader this is what is what the value is resolved, providing a split between any fields, and multi-part files that were provided.

Options which impact how the form data is decoded for a FormDataReader. All these options have sensible defaults for most applications, but can be modified for different use cases. Many of these options can have an impact on the stability of a server, especially if there is someone attempting a denial of service attack on your server, so be careful when changing the defaults.

Middleware are functions which are chained together to deal with requests.

Interface describing implementation of an interceptor.

Interface describing options for serving static assets.

Interface defining a Value type provider.