Options
All
  • Public
  • Public/Protected
  • All
Menu

@nestjs/common

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

CacheTTLFactory

CacheTTLFactory: (ctx: ExecutionContext) => Promise<number> | number

Decorator that sets the cache ttl setting the duration for cache expiration.

For example: @CacheTTL(5)

param

number set the cache expiration time

see

Caching

publicapi

Type declaration

ColorTextFn

ColorTextFn: (text: string) => string

Type declaration

    • (text: string): string
    • Parameters

      • text: string

      Returns string

Constructor

Constructor<T>: {}

Type parameters

  • T

Type declaration

ContextType

ContextType: "http" | "ws" | "rpc"

Controller

Controller: object

CustomDecorator

CustomDecorator<TKey>: MethodDecorator & ClassDecorator & { KEY: TKey }

Type parameters

  • TKey = string

CustomOrigin

CustomOrigin: (requestOrigin: string, callback: (err: Error | null, allow?: boolean) => void) => void

Set origin to a function implementing some custom logic. The function takes the request origin as the first parameter and a callback (which expects the signature err [object], allow [bool]) as the second.

see

https://github.com/expressjs/cors

publicapi

Type declaration

    • (requestOrigin: string, callback: (err: Error | null, allow?: boolean) => void): void
    • Parameters

      • requestOrigin: string
      • callback: (err: Error | null, allow?: boolean) => void
          • (err: Error | null, allow?: boolean): void
          • Parameters

            • err: Error | null
            • Optional allow: boolean

            Returns void

      Returns void

CustomParamFactory

CustomParamFactory<TData, TInput, TOutput>: (data: TData, input: TInput) => TOutput

Type parameters

  • TData = any

  • TInput = any

  • TOutput = any

Type declaration

    • (data: TData, input: TInput): TOutput
    • Parameters

      • data: TData
      • input: TInput

      Returns TOutput

ErrorHandler

ErrorHandler<TRequest, TResponse>: (error: any, req: TRequest, res: TResponse, next?: Function) => any

Type parameters

  • TRequest = any

  • TResponse = any

Type declaration

    • (error: any, req: TRequest, res: TResponse, next?: Function): any
    • Parameters

      • error: any
      • req: TRequest
      • res: TResponse
      • Optional next: Function

      Returns any

ErrorHttpStatusCode

HttpModuleOptions

HttpModuleOptions: AxiosRequestConfig

Injectable

Injectable: unknown

InjectableOptions

InjectableOptions: ScopeOptions

Defines the injection scope.

see

Injection Scopes

publicapi

LogLevel

LogLevel: "log" | "error" | "warn" | "debug" | "verbose"

NestMicroserviceOptions

NestMicroserviceOptions: NestApplicationContextOptions

ParamData

ParamData: object | string | number

ParamDecoratorEnhancer

ParamDecoratorEnhancer: ParameterDecorator

Paramtype

Paramtype: "body" | "query" | "param" | "custom"

Provider

Provider<T>: Type<any> | ClassProvider<T> | ValueProvider<T> | FactoryProvider<T> | ExistingProvider<T>
publicapi

Type parameters

  • T = any

RequestHandler

RequestHandler<TRequest, TResponse>: (req: TRequest, res: TResponse, next?: Function) => any

Type parameters

  • TRequest = any

  • TResponse = any

Type declaration

    • (req: TRequest, res: TResponse, next?: Function): any
    • Parameters

      • req: TRequest
      • res: TResponse
      • Optional next: Function

      Returns any

Transform

Transform<T>: (value: T, metadata: ArgumentMetadata) => any

Type parameters

  • T = any

Type declaration

Variables

Const AXIOS_INSTANCE_TOKEN

AXIOS_INSTANCE_TOKEN: "AXIOS_INSTANCE_TOKEN" = "AXIOS_INSTANCE_TOKEN"

Const All

All: (Anonymous function) = createMappingDecorator(RequestMethod.ALL)

Route handler (method) Decorator. Routes all HTTP requests to the specified path.

see

Routing

publicapi

Axios

  • Axios(instanceConfig: any): void
  • Create a new instance of Axios

    Parameters

    • instanceConfig: any

      The default config for the instance

    Returns void

Const CACHE_KEY_METADATA

CACHE_KEY_METADATA: "cache_module:cache_key" = "cache_module:cache_key"

Const CACHE_MANAGER

CACHE_MANAGER: "CACHE_MANAGER" = "CACHE_MANAGER"

Const CACHE_MODULE_OPTIONS

CACHE_MODULE_OPTIONS: "CACHE_MODULE_OPTIONS" = "CACHE_MODULE_OPTIONS"

Const CACHE_TTL_METADATA

CACHE_TTL_METADATA: "cache_module:cache_ttl" = "cache_module:cache_ttl"

Const CLASS_SERIALIZER_OPTIONS

CLASS_SERIALIZER_OPTIONS: "class_serializer:options" = "class_serializer:options"

Const CUSTOM_ROUTE_AGRS_METADATA

CUSTOM_ROUTE_AGRS_METADATA: "__customRouteArgs__" = "__customRouteArgs__"

Const DEFAULT_ARRAY_SEPARATOR

DEFAULT_ARRAY_SEPARATOR: "," = ","

Const DNS

DNS: "6ba7b810-9dad-11d1-80b4-00c04fd430c8" = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"

Const Delete

Delete: (Anonymous function) = createMappingDecorator(RequestMethod.DELETE)

Route handler (method) Decorator. Routes HTTP DELETE requests to the specified path.

see

Routing

publicapi

Const EXCEPTION_FILTERS_METADATA

EXCEPTION_FILTERS_METADATA: "__exceptionFilters__" = "__exceptionFilters__"

Const FILTER_CATCH_EXCEPTIONS

FILTER_CATCH_EXCEPTIONS: "__filterCatchExceptions__" = "__filterCatchExceptions__"

Const GLOBAL_MODULE_METADATA

GLOBAL_MODULE_METADATA: "__module:global__" = "__module:global__"

Const GUARDS_METADATA

GUARDS_METADATA: "__guards__" = "__guards__"

Const Get

Get: (Anonymous function) = createMappingDecorator(RequestMethod.GET)

Route handler (method) Decorator. Routes HTTP GET requests to the specified path.

see

Routing

publicapi

Const HEADERS_METADATA

HEADERS_METADATA: "__headers__" = "__headers__"

Const HOST_METADATA

HOST_METADATA: "host" = "host"

Const HTTP_ADAPTER_HOST

HTTP_ADAPTER_HOST: "HttpAdapterHost" = "HttpAdapterHost"

Const HTTP_CODE_METADATA

HTTP_CODE_METADATA: "__httpCode__" = "__httpCode__"

Const HTTP_MODULE_ID

HTTP_MODULE_ID: "HTTP_MODULE_ID" = "HTTP_MODULE_ID"

Const HTTP_MODULE_OPTIONS

HTTP_MODULE_OPTIONS: "HTTP_MODULE_OPTIONS" = "HTTP_MODULE_OPTIONS"

Const Head

Head: (Anonymous function) = createMappingDecorator(RequestMethod.HEAD)

Route handler (method) Decorator. Routes HTTP HEAD requests to the specified path.

see

Routing

publicapi

Const Headers

Headers: (property?: string) => ParameterDecorator = createRouteParamDecorator(RouteParamtypes.HEADERS)

Route handler parameter decorator. Extracts the headers property from the req object and populates the decorated parameter with the value of headers.

For example: async update(@Headers('Cache-Control') cacheControl: string)

param

name of single header property to extract.

see

Request object

publicapi

Type declaration

    • (property?: string): ParameterDecorator
    • Parameters

      • Optional property: string

      Returns ParameterDecorator

Const INTERCEPTORS_METADATA

INTERCEPTORS_METADATA: "__interceptors__" = "__interceptors__"

InterceptorManager

  • InterceptorManager(): void
  • Returns void

Const Ip

Ip: () => ParameterDecorator = createRouteParamDecorator(RouteParamtypes.IP,)

Route handler parameter decorator. Extracts the Ip property from the req object and populates the decorated parameter with the value of ip.

see

Request object

publicapi

Type declaration

    • (): ParameterDecorator
    • Returns ParameterDecorator

Const METHOD_METADATA

METHOD_METADATA: "method" = "method"

Const MODULE_PATH

MODULE_PATH: "__module_path__" = "__module_path__"

MaxBodyLengthExceededError

MaxBodyLengthExceededError: CustomError = createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit")

Const Next

Next: () => ParameterDecorator = createRouteParamDecorator(RouteParamtypes.NEXT,)

Route handler parameter decorator. Extracts reference to the Next function from the underlying platform and populates the decorated parameter with the value of Next.

publicapi

Type declaration

    • (): ParameterDecorator
    • Returns ParameterDecorator

Const OPTIONAL_DEPS_METADATA

OPTIONAL_DEPS_METADATA: "optional:paramtypes" = "optional:paramtypes"

Const OPTIONAL_PROPERTY_DEPS_METADATA

OPTIONAL_PROPERTY_DEPS_METADATA: "optional:properties_metadata" = "optional:properties_metadata"

Const Options

Options: (Anonymous function) = createMappingDecorator(RequestMethod.OPTIONS)

Route handler (method) Decorator. Routes HTTP OPTIONS requests to the specified path.

see

Routing

publicapi

Const PARAMTYPES_METADATA

PARAMTYPES_METADATA: "design:paramtypes" = "design:paramtypes"

Const PATH_METADATA

PATH_METADATA: "path" = "path"

Const PIPES_METADATA

PIPES_METADATA: "__pipes__" = "__pipes__"

Const PROPERTY_DEPS_METADATA

PROPERTY_DEPS_METADATA: "self:properties_metadata" = "self:properties_metadata"

Const Patch

Patch: (Anonymous function) = createMappingDecorator(RequestMethod.PATCH)

Route handler (method) Decorator. Routes HTTP PATCH requests to the specified path.

see

Routing

publicapi

Const Post

Post: (Anonymous function) = createMappingDecorator(RequestMethod.POST)

Route handler (method) Decorator. Routes HTTP POST requests to the specified path.

see

Routing

publicapi

Const Put

Put: (Anonymous function) = createMappingDecorator(RequestMethod.PUT)

Route handler (method) Decorator. Routes HTTP PUT requests to the specified path.

see

Routing

publicapi

Const REDIRECT_METADATA

REDIRECT_METADATA: "__redirect__" = "__redirect__"

Const REFLECTOR

REFLECTOR: "Reflector" = "Reflector"

Const RENDER_METADATA

RENDER_METADATA: "__renderTemplate__" = "__renderTemplate__"

Const RESPONSE_PASSTHROUGH_METADATA

RESPONSE_PASSTHROUGH_METADATA: "__responsePassthrough__" = "__responsePassthrough__"

Const ROUTE_ARGS_METADATA

ROUTE_ARGS_METADATA: "__routeArguments__" = "__routeArguments__"

RedirectionError

RedirectionError: CustomError = createErrorType("ERR_FR_REDIRECTION_FAILURE","")

Const Req

Req: () => ParameterDecorator = Request

Type declaration

    • (): ParameterDecorator
    • Returns ParameterDecorator

Const Request

Request: () => ParameterDecorator = createRouteParamDecorator(RouteParamtypes.REQUEST,)

Route handler parameter decorator. Extracts the Request object from the underlying platform and populates the decorated parameter with the value of Request.

Example: logout(@Request() req)

see

Request object

publicapi

Type declaration

    • (): ParameterDecorator
    • Returns ParameterDecorator

Const Res

Res: (options?: ResponseDecoratorOptions) => ParameterDecorator = Response

Type declaration

Const SCOPE_OPTIONS_METADATA

SCOPE_OPTIONS_METADATA: "scope:options" = "scope:options"

Const SELF_DECLARED_DEPS_METADATA

SELF_DECLARED_DEPS_METADATA: "self:paramtypes" = "self:paramtypes"

Const SSE_METADATA

SSE_METADATA: "__sse__" = "__sse__"

Const Session

Session: () => ParameterDecorator = createRouteParamDecorator(RouteParamtypes.SESSION,)

Route handler parameter decorator. Extracts the Session object from the underlying platform and populates the decorated parameter with the value of Session.

see

Request object

publicapi

Type declaration

    • (): ParameterDecorator
    • Returns ParameterDecorator

TooManyRedirectsError

TooManyRedirectsError: CustomError = createErrorType("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded")

Const URL

URL: "6ba7b811-9dad-11d1-80b4-00c04fd430c8" = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"

Const UploadedFile

UploadedFile: (fileKey?: string) => ParameterDecorator = createRouteParamDecorator(RouteParamtypes.FILE)

Route handler parameter decorator. Extracts the file object and populates the decorated parameter with the value of file. Used in conjunction with multer middleware.

For example:

uploadFile(@UploadedFile() file) {
  console.log(file);
}
see

Request object

publicapi

Type declaration

    • (fileKey?: string): ParameterDecorator
    • Parameters

      • Optional fileKey: string

      Returns ParameterDecorator

Const UploadedFiles

UploadedFiles: () => ParameterDecorator = createRouteParamDecorator(RouteParamtypes.FILES,)

Route handler parameter decorator. Extracts the files object and populates the decorated parameter with the value of files. Used in conjunction with multer middleware.

For example:

uploadFile(@UploadedFiles() files) {
  console.log(files);
}
see

Request object

publicapi

Type declaration

    • (): ParameterDecorator
    • Returns ParameterDecorator

Const VALIDATION_ERROR_MESSAGE

VALIDATION_ERROR_MESSAGE: "Validation failed (parsable array expected)" = "Validation failed (parsable array expected)"

Writable

Writable: Writable = require("stream").Writable

WriteAfterEndError

WriteAfterEndError: CustomError = createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end")

__asyncDelegator

  • __asyncDelegator(o: any): {}
  • Parameters

    • o: any

    Returns {}

__asyncGenerator

  • __asyncGenerator(thisArg: any, _arguments: any, generator: any): {}
  • Parameters

    • thisArg: any
    • _arguments: any
    • generator: any

    Returns {}

__asyncValues

  • __asyncValues(o: any): any
  • Parameters

    • o: any

    Returns any

__await

  • __await(v: any): any
  • Parameters

    • v: any

    Returns any

__awaiter

  • __awaiter(thisArg: any, _arguments: any, P: any, generator: any): any
  • Parameters

    • thisArg: any
    • _arguments: any
    • P: any
    • generator: any

    Returns any

__classPrivateFieldGet

  • __classPrivateFieldGet(receiver: any, privateMap: any): any
  • Parameters

    • receiver: any
    • privateMap: any

    Returns any

__classPrivateFieldSet

  • __classPrivateFieldSet(receiver: any, privateMap: any, value: any): any
  • Parameters

    • receiver: any
    • privateMap: any
    • value: any

    Returns any

__createBinding

__createBinding: any = Object.create ? (function(o, m, k, k2) {if (k2 === undefined) k2 = k;Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });}) : (function(o, m, k, k2) {if (k2 === undefined) k2 = k;o[k2] = m[k];})

__decorate

  • __decorate(decorators: any, target: any, key: any, desc: any): any
  • Parameters

    • decorators: any
    • target: any
    • key: any
    • desc: any

    Returns any

__exportStar

  • __exportStar(m: any, o: any): void
  • Parameters

    • m: any
    • o: any

    Returns void

__extends

  • __extends(d: any, b: any): void
  • Parameters

    • d: any
    • b: any

    Returns void

__generator

  • __generator(thisArg: any, body: any): { next: (Anonymous function); return: (Anonymous function); throw: (Anonymous function) }
  • Parameters

    • thisArg: any
    • body: any

    Returns { next: (Anonymous function); return: (Anonymous function); throw: (Anonymous function) }

    • next: (Anonymous function)
    • return: (Anonymous function)
    • throw: (Anonymous function)

__importDefault

  • __importDefault(mod: any): any
  • Parameters

    • mod: any

    Returns any

__importStar

  • __importStar(mod: any): any
  • Parameters

    • mod: any

    Returns any

__makeTemplateObject

  • __makeTemplateObject(cooked: any, raw: any): any
  • Parameters

    • cooked: any
    • raw: any

    Returns any

__metadata

  • __metadata(metadataKey: any, metadataValue: any): { (target: Function): void; (target: Object, propertyKey: string | symbol): void }
  • Parameters

    • metadataKey: any
    • metadataValue: any

    Returns { (target: Function): void; (target: Object, propertyKey: string | symbol): void }

      • (target: Function): void
      • (target: Object, propertyKey: string | symbol): void
      • Parameters

        Returns void

      • Parameters

        • target: Object
        • propertyKey: string | symbol

        Returns void

__param

  • __param(paramIndex: any, decorator: any): (Anonymous function)
  • Parameters

    • paramIndex: any
    • decorator: any

    Returns (Anonymous function)

__read

  • __read(o: any, n: any): any
  • Parameters

    • o: any
    • n: any

    Returns any

__rest

  • __rest(s: any, e: any): t
  • Parameters

    • s: any
    • e: any

    Returns t

__setModuleDefault

__setModuleDefault: (Anonymous function) = Object.create ? (function(o, v) {Object.defineProperty(o, "default", { enumerable: true, value: v });}) : function(o, v) {o["default"] = v;}

__spread

  • __spread(): any[]
  • Returns any[]

__spreadArrays

  • __spreadArrays(): any[]
  • Returns any[]

__values

  • __values(o: any): any
  • Parameters

    • o: any

    Returns any

_assert

_assert: any = _interopRequireDefault(require("assert"))

Let _clockseq

_clockseq: any

_crypto

_crypto: any = _interopRequireDefault(require("crypto"))

_default

  • _default(name: any, version: any, hashfunc: any): generateUUID
  • Parameters

    • name: any
    • version: any
    • hashfunc: any

    Returns generateUUID

Let _lastMSecs

_lastMSecs: number = 0

Let _lastNSecs

_lastNSecs: number = 0

_md

_md: any = _interopRequireDefault(require("./md5.js"))

_nil

_nil: any = _interopRequireDefault(require("./nil.js"))

Let _nodeId

_nodeId: any

_parse

_parse: any = _interopRequireDefault(require("./parse.js"))

_regex

_regex: any = _interopRequireDefault(require("./regex.js"))

_rng

_rng: any = _interopRequireDefault(require("./rng.js"))

_sha

_sha: any = _interopRequireDefault(require("./sha1.js"))

_stringify

_stringify: any = _interopRequireDefault(require("./stringify.js"))

_v

_v: any = _interopRequireDefault(require("./v35.js"))

_v2

_v2: any = _interopRequireDefault(require("./v3.js"))

_v3

_v3: any = _interopRequireDefault(require("./v4.js"))

_v4

_v4: any = _interopRequireDefault(require("./v5.js"))

_validate

_validate: any = _interopRequireDefault(require("./validate.js"))

_version

_version: any = _interopRequireDefault(require("./version.js"))

Const args

args: string[] = process.argv.slice(2)

assert

assert: assert = require("assert")

axios

axios: Axios = createInstance(defaults)

bind

bind: bind = require('./helpers/bind')

buildFullPath

buildFullPath: buildFullPath = require('../core/buildFullPath')

buildURL

buildURL: buildURL = require('../helpers/buildURL')

Const byteToHex

byteToHex: any[] = []

Convert array of 16 byte values to UUID string format of the form: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX Convert array of 16 byte values to UUID string format of the form: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX Convert array of 16 byte values to UUID string format of the form: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

Let classTransformer

classTransformer: any

Let classValidator

classValidator: any

combineURLs

combineURLs: combineURLs = require('../helpers/combineURLs')

Const concat_1

concat_1: "D:/TS-doc/nest/packages/common/node_modules/iterare/lib/concat" = require("./concat")

cookies

cookies: { read: any; remove: any; write: any } | { read: any; remove: any; write: any } = require('./../helpers/cookies')

createError

createError: createError = require('./createError')

debug

debug: any = require("./debug")

dispatchRequest

dispatchRequest: dispatchRequest = require('./dispatchRequest')

enhanceError

enhanceError: enhanceError = require('./enhanceError')

eventHandlers

eventHandlers: any = Object.create(null)

Const filter_1

filter_1: "D:/TS-doc/nest/packages/common/node_modules/iterare/lib/filter" = require("./filter")

Const flatten_1

flatten_1: "D:/TS-doc/nest/packages/common/node_modules/iterare/lib/flatten" = require("./flatten")

Const getRandomValues

getRandomValues: any = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto)

http

http: "http" = require("http")

httpFollow

httpFollow: any = require('follow-redirects').http

https

https: "https" = require("https")

httpsFollow

httpsFollow: any = require('follow-redirects').https

ignoreDuplicateOf

ignoreDuplicateOf: string[] = ['age', 'authorization', 'content-length', 'content-type', 'etag','expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since','last-modified', 'location', 'max-forwards', 'proxy-authorization','referer', 'retry-after', 'user-agent']

isAbsoluteURL

isAbsoluteURL: isAbsoluteURL = require('../helpers/isAbsoluteURL')

isCancel

isCancel: isCancel = require('../cancel/isCancel')

isHttps

isHttps: RegExp = /https:?/

isURLSameOrigin

isURLSameOrigin: isURLSameOrigin = require('./../helpers/isURLSameOrigin')

Const iterate_1

iterate_1: "D:/TS-doc/nest/packages/common/node_modules/iterare/lib/iterate" = require("./iterate")

Const logger

logger: Logger = new Logger('PackageLoader')

Const map_1

map_1: "D:/TS-doc/nest/packages/common/node_modules/iterare/lib/map" = require("./map")

mergeConfig

mergeConfig: mergeConfig = require('./mergeConfig')

Const metadataKeys

metadataKeys: string[] = [metadataConstants.IMPORTS,metadataConstants.EXPORTS,metadataConstants.CONTROLLERS,metadataConstants.PROVIDERS,]

normalizeHeaderName

normalizeHeaderName: normalizeHeaderName = require('./helpers/normalizeHeaderName')

parseHeaders

parseHeaders: parseHeaders = require('./../helpers/parseHeaders')

pkg

pkg: any = require('./../../package.json')

Let poolPtr

poolPtr: number = rnds8Pool.length

Const process

process: any

Const rnds8

rnds8: Uint8Array = new Uint8Array(16)

Const rnds8Pool

rnds8Pool: Uint8Array = new Uint8Array(256)

settle

settle: settle = require('./../core/settle')

Const slice_1

slice_1: "D:/TS-doc/nest/packages/common/node_modules/iterare/lib/slice" = require("./slice")

toString

toString: toString = Object.prototype.toString

transformData

transformData: transformData = require('./transformData')

url

url: "url" = require("url")

utils

utils: { extend: extend; forEach: forEach; isArray: isArray; isArrayBuffer: isArrayBuffer; isArrayBufferView: isArrayBufferView; isBlob: isBlob; isBuffer: isBuffer; isDate: isDate; isFile: isFile; isFormData: isFormData; isFunction: isFunction; isNumber: isNumber; isObject: isObject; isPlainObject: isPlainObject; isStandardBrowserEnv: isStandardBrowserEnv; isStream: isStream; isString: isString; isURLSearchParams: isURLSearchParams; isUndefined: isUndefined; merge: merge; stripBOM: stripBOM; trim: trim } = require('./../utils')

Type declaration

Const utils_1

utils_1: "D:/TS-doc/nest/packages/common/node_modules/iterare/lib/utils" = require("./utils")

Const v3

v3: any = (0, _v.default)('v3', 0x30, _md.default)

Const v5

v5: any = (0, _v.default)('v5', 0x50, _sha.default)

Const yellow

yellow: (Anonymous function) = colorIfAllowed((text: string) => `\x1B[38;5;3m${text}\x1B[39m`,)

Const zip_1

zip_1: "D:/TS-doc/nest/packages/common/node_modules/iterare/lib/zip" = require("./zip")

zlib

zlib: "zlib" = require('zlib')

Functions

Bind

  • Bind(...decorators: any[]): MethodDecorator
  • Decorator that binds parameter decorators to the method that follows.

    Useful when the language doesn't provide a 'Parameter Decorator' feature (i.e., vanilla JavaScript).

    publicapi

    Parameters

    • Rest ...decorators: any[]

      one or more parameter decorators (e.g., Req())

    Returns MethodDecorator

Body

Const CacheKey

Const CacheTTL

Cancel

  • Cancel(message: string): void
  • A Cancel is an object that is thrown when an operation is canceled.

    Parameters

    • message: string

      The message.

    Returns void

CancelToken

  • A CancelToken is an object that can be used to request cancellation of an operation.

    Parameters

    • executor: Function

      The executor function.

    Returns void

Catch

  • Catch(...exceptions: Type<any>[]): ClassDecorator
  • Decorator that marks a class as a Nest exception filter. An exception filter handles exceptions thrown by or not handled by your application code.

    The decorated class must implement the ExceptionFilter interface.

    see

    Exception Filters

    usagenotes

    Exception filters are applied using the @UseFilters() decorator, or (globally) with app.useGlobalFilters().

    publicapi

    Parameters

    • Rest ...exceptions: Type<any>[]

      one or more exception types specifying the exceptions to be caught and handled by this filter.

    Returns ClassDecorator

Controller

  • Controller(): ClassDecorator
  • Controller(prefix: string): ClassDecorator
  • Controller(options: ControllerOptions): ClassDecorator
  • Decorator that marks a class as a Nest controller that can receive inbound requests and produce responses.

    An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses. It defines a class that provides the context for one or more related route handlers that correspond to HTTP request methods and associated routes for example GET /api/profile, POST /user/resume.

    A Microservice Controller responds to requests as well as events, running over a variety of transports (read more here). It defines a class that provides a context for one or more message or event handlers.

    see

    Controllers

    see

    Microservices

    publicapi

    Returns ClassDecorator

  • Decorator that marks a class as a Nest controller that can receive inbound requests and produce responses.

    An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses. It defines a class that provides the context for one or more related route handlers that correspond to HTTP request methods and associated routes for example GET /api/profile, POST /user/resume.

    A Microservice Controller responds to requests as well as events, running over a variety of transports (read more here). It defines a class that provides a context for one or more message or event handlers.

    see

    Routing

    see

    Controllers

    see

    Microservices

    publicapi

    Parameters

    • prefix: string

      string that defines a route path prefix. The prefix is pre-pended to the path specified in any request decorator in the class.

    Returns ClassDecorator

  • Decorator that marks a class as a Nest controller that can receive inbound requests and produce responses.

    An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses. It defines a class that provides the context for one or more related route handlers that correspond to HTTP request methods and associated routes for example GET /api/profile, POST /user/resume.

    A Microservice Controller responds to requests as well as events, running over a variety of transports (read more here). It defines a class that provides a context for one or more message or event handlers.

    see

    Routing

    see

    Controllers

    see

    Microservices

    publicapi

    Parameters

    • options: ControllerOptions

      configuration object specifying:

      • scope - symbol that determines the lifetime of a Controller instance. See Scope for more details.
      • prefix - string that defines a route path prefix. The prefix is pre-pended to the path specified in any request decorator in the class.

    Returns ClassDecorator

Const Dependencies

  • Dependencies(...dependencies: Array<unknown>): ClassDecorator

Foo

  • Foo(a: any): void

Global

  • Global(): ClassDecorator
  • Decorator that makes a module global-scoped.

    Once imported into any module, a global-scoped module will be visible in all modules. Thereafter, modules that wish to inject a service exported from a global module do not need to import the provider module.

    see

    Global modules

    publicapi

    Returns ClassDecorator

Const GuardCompositeDecorator

  • GuardCompositeDecorator(): (Anonymous function)

Header

  • Header(name: string, value: string): MethodDecorator
  • Request method Decorator. Sets a response header.

    For example: @Header('Cache-Control', 'none')

    see

    Headers

    publicapi

    Parameters

    • name: string

      string to be used for header name

    • value: string

      string to be used for header value

    Returns MethodDecorator

HostParam

  • HostParam(): ParameterDecorator
  • HostParam(property: string): ParameterDecorator
  • Route handler parameter decorator. Extracts the hosts property from the req object and populates the decorated parameter with the value of hosts. May also apply pipes to the bound parameter.

    For example, extracting all params:

    findOne(@HostParam() params: string[])

    For example, extracting a single param:

    findOne(@HostParam('id') id: string)
    see

    Request object

    publicapi

    Returns ParameterDecorator

  • Route handler parameter decorator. Extracts the hosts property from the req object and populates the decorated parameter with the value of hosts. May also apply pipes to the bound parameter.

    For example, extracting all params:

    findOne(@HostParam() params: string[])

    For example, extracting a single param:

    findOne(@HostParam('id') id: string)
    see

    Request object

    publicapi

    Parameters

    • property: string

      name of single property to extract from the req object

    Returns ParameterDecorator

HttpCode

  • HttpCode(statusCode: number): MethodDecorator

Const INVALID_MODULE_CONFIG_MESSAGE

  • INVALID_MODULE_CONFIG_MESSAGE(text: TemplateStringsArray, property: string): string

Inject

  • Inject<T>(token?: T): (Anonymous function)
  • Decorator that marks a constructor parameter as a target for Dependency Injection (DI).

    Any injected provider must be visible within the module scope (loosely speaking, the containing module) of the class it is being injected into. This can be done by:

    • defining the provider in the same module scope
    • exporting the provider from one module scope and importing that module into the module scope of the class being injected into
    • exporting the provider from a module that is marked as global using the @Global() decorator

    Injection tokens

    Can be types (class names), strings or symbols. This depends on how the provider with which it is associated was defined. Providers defined with the @Injectable() decorator use the class name. Custom Providers may use strings or symbols as the injection token.

    see

    Providers

    see

    Custom Providers

    see

    Injection Scopes

    publicapi

    Type parameters

    • T = any

    Parameters

    • Optional token: T

      lookup key for the provider to be injected (assigned to the constructor parameter).

    Returns (Anonymous function)

Injectable

  • Decorator that marks a class as a provider. Providers can be injected into other classes via constructor parameter injection using Nest's built-in Dependency Injection (DI) system.

    When injecting a provider, it must be visible within the module scope (loosely speaking, the containing module) of the class it is being injected into. This can be done by:

    • defining the provider in the same module scope
    • exporting the provider from one module scope and importing that module into the module scope of the class being injected into
    • exporting the provider from a module that is marked as global using the @Global() decorator

    Providers can also be defined in a more explicit and imperative form using various custom provider techniques that expose more capabilities of the DI system.

    see

    Providers

    see

    Custom Providers

    see

    Injection Scopes

    publicapi

    Parameters

    Returns ClassDecorator

Const MISSING_REQUIRED_DEPENDENCY

  • MISSING_REQUIRED_DEPENDENCY(name: string, reason: string): string

Const MergeWithValues

  • MergeWithValues<T>(data: {}): (Anonymous function)

Module

Optional

  • Optional(): (Anonymous function)

Param

  • Route handler parameter decorator. Extracts the params property from the req object and populates the decorated parameter with the value of params. May also apply pipes to the bound parameter.

    For example, extracting all params:

    findOne(@Param() params: string[])

    For example, extracting a single param:

    findOne(@Param('id') id: string)
    see

    Request object

    see

    Working with pipes

    publicapi

    Returns ParameterDecorator

  • Route handler parameter decorator. Extracts the params property from the req object and populates the decorated parameter with the value of params. May also apply pipes to the bound parameter.

    For example, extracting all params:

    findOne(@Param() params: string[])

    For example, extracting a single param:

    findOne(@Param('id') id: string)
    see

    Request object

    see

    Working with pipes

    publicapi

    Parameters

    Returns ParameterDecorator

  • Route handler parameter decorator. Extracts the params property from the req object and populates the decorated parameter with the value of params. May also apply pipes to the bound parameter.

    For example, extracting all params:

    findOne(@Param() params: string[])

    For example, extracting a single param:

    findOne(@Param('id') id: string)
    see

    Request object

    see

    Working with pipes

    publicapi

    Parameters

    • property: string

      name of single property to extract from the req object

    • Rest ...pipes: (Type<PipeTransform> | PipeTransform)[]

      one or more pipes - either instances or classes - to apply to the bound parameter.

    Returns ParameterDecorator

Query

  • Route handler parameter decorator. Extracts the query property from the req object and populates the decorated parameter with the value of query. May also apply pipes to the bound query parameter.

    For example:

    async find(@Query('user') user: string)
    see

    Request object

    publicapi

    Returns ParameterDecorator

  • Route handler parameter decorator. Extracts the query property from the req object and populates the decorated parameter with the value of query. May also apply pipes to the bound query parameter.

    For example:

    async find(@Query('user') user: string)
    see

    Request object

    publicapi

    Parameters

    Returns ParameterDecorator

  • Route handler parameter decorator. Extracts the query property from the req object and populates the decorated parameter with the value of query. May also apply pipes to the bound query parameter.

    For example:

    async find(@Query('user') user: string)
    see

    Request object

    publicapi

    Parameters

    • property: string

      name of single property to extract from the query object

    • Rest ...pipes: (Type<PipeTransform> | PipeTransform)[]

      one or more pipes to apply to the bound query parameter

    Returns ParameterDecorator

ROTL

  • ROTL(x: any, n: any): number
  • Parameters

    • x: any
    • n: any

    Returns number

Redirect

  • Redirect(url?: string, statusCode?: number): MethodDecorator

RedirectableRequest

  • RedirectableRequest(options: any, responseCallback: any): void
  • Parameters

    • options: any
    • responseCallback: any

    Returns void

Render

  • Render(template: string): MethodDecorator

Const RequestMapping

Const Response

Const SerializeOptions

Const SetMetadata

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

    Requires two parameters:

    • key - a value defining the key under which the metadata is stored
    • value - metadata to be associated with key

    This metadata can be reflected using the Reflector class.

    Example: @SetMetadata('roles', ['admin'])

    see

    Reflection

    publicapi

    Type parameters

    • K = string

    • V = any

    Parameters

    • metadataKey: K
    • metadataValue: V

    Returns CustomDecorator<K>

Sse

  • Sse(path?: string): MethodDecorator

Const UseFilters

  • Decorator that binds exception filters to the scope of the controller or method, depending on its context.

    When @UseFilters is used at the controller level, the filter will be applied to every handler (method) in the controller.

    When @UseFilters is used at the individual handler level, the filter will apply only to that specific method.

    see

    Exception filters

    usagenotes

    Exception filters can also be set up globally for all controllers and routes using app.useGlobalFilters(). See here for details

    publicapi

    Parameters

    • Rest ...filters: (ExceptionFilter | Function)[]

      exception filter instance or class, or a list of exception filter instances or classes.

    Returns MethodDecorator & ClassDecorator

UseGuards

  • Decorator that binds guards to the scope of the controller or method, depending on its context.

    When @UseGuards is used at the controller level, the guard will be applied to every handler (method) in the controller.

    When @UseGuards is used at the individual handler level, the guard will apply only to that specific method.

    see

    Guards

    usagenotes

    Guards can also be set up globally for all controllers and routes using app.useGlobalGuards(). See here for details

    publicapi

    Parameters

    • Rest ...guards: (CanActivate | Function)[]

      a single guard instance or class, or a list of guard instances or classes.

    Returns MethodDecorator & ClassDecorator

UseInterceptors

  • Decorator that binds interceptors to the scope of the controller or method, depending on its context.

    When @UseInterceptors is used at the controller level, the interceptor will be applied to every handler (method) in the controller.

    When @UseInterceptors is used at the individual handler level, the interceptor will apply only to that specific method.

    see

    Interceptors

    usagenotes

    Interceptors can also be set up globally for all controllers and routes using app.useGlobalInterceptors(). See here for details

    publicapi

    Parameters

    • Rest ...interceptors: (NestInterceptor | Function)[]

      a single interceptor instance or class, or a list of interceptor instances or classes.

    Returns MethodDecorator & ClassDecorator

UsePipes

  • Decorator that binds pipes to the scope of the controller or method, depending on its context.

    When @UsePipes is used at the controller level, the pipe will be applied to every handler (method) in the controller.

    When @UsePipes is used at the individual handler level, the pipe will apply only to that specific method.

    see

    Pipes

    usagenotes

    Pipes can also be set up globally for all controllers and routes using app.useGlobalPipes(). See here for details

    publicapi

    Parameters

    • Rest ...pipes: (PipeTransform | Function)[]

      a single pipe instance or class, or a list of pipe instances or classes.

    Returns ClassDecorator & MethodDecorator

__assign

  • __assign(): any
  • Returns any

_interopRequireDefault

  • _interopRequireDefault(obj: any): any
  • Parameters

    • obj: any

    Returns any

addExceptionFiltersMetadata

applyDecorators

  • applyDecorators(...decorators: Array<ClassDecorator | MethodDecorator | PropertyDecorator>): (Anonymous function)
  • Function that returns a new decorator that applies all decorators provided by param

    Useful to build new decorators (or a decorator factory) encapsulating multiple decorators related with the same feature

    publicapi

    Parameters

    • Rest ...decorators: Array<ClassDecorator | MethodDecorator | PropertyDecorator>

      one or more decorators (e.g., ApplyGuard(...))

    Returns (Anonymous function)

assignCustomParameterMetadata

assignMetadata

  • assignMetadata<TParamtype, TArgs>(args: TArgs, paramtype: TParamtype, index: number, data?: ParamData, ...pipes: (Type<PipeTransform> | PipeTransform)[]): TArgs & { [`${paramtype}:${index}`]: object }

bitRotateLeft

  • bitRotateLeft(num: any, cnt: any): number
  • Parameters

    • num: any
    • cnt: any

    Returns number

bytesToWords

  • bytesToWords(input: any): any[] | Uint32Array
  • Parameters

    • input: any

    Returns any[] | Uint32Array

clearTimer

  • clearTimer(): void
  • Returns void

Const colorIfAllowed

  • colorIfAllowed(colorFn: ColorTextFn): (Anonymous function)

createCacheManager

createErrorType

  • createErrorType(code: any, defaultMessage: any): CustomError
  • Parameters

    • code: any
    • defaultMessage: any

    Returns CustomError

createInstance

  • createInstance(defaultConfig: any): Axios
  • Create an instance of Axios

    Parameters

    • defaultConfig: any

      The default config for the instance

    Returns Axios

    A new instance of Axios

Const createMappingDecorator

  • createMappingDecorator(method: RequestMethod): (Anonymous function)

createParamDecorator

Const createPipesRouteParamDecorator

  • createPipesRouteParamDecorator(paramtype: RouteParamtypes): (Anonymous function)

createRouteParamDecorator

  • createRouteParamDecorator(paramtype: RouteParamtypes): (Anonymous function)

default

  • default(name: any, version: any, hashfunc: any): generateUUID
  • Parameters

    • name: any
    • version: any
    • hashfunc: any

    Returns generateUUID

encode

  • encode(val: any): string
  • Parameters

    • val: any

    Returns string

extend

  • extend(a: any, b: any, thisArg: any): any
  • Extends object a by mutably adding to it the properties of object b.

    Parameters

    • a: any

      The object to be extended

    • b: any

      The object to copy properties from

    • thisArg: any

      The object to bind function to

    Returns any

    The resulting value of object a

extendArrayMetadata

  • extendArrayMetadata<T>(key: string, metadata: T, target: Function): void

extendStatics

  • extendStatics(d: any, b: any): any
  • Parameters

    • d: any
    • b: any

    Returns any

f

  • f(s: any, x: any, y: any, z: any): number
  • Parameters

    • s: any
    • x: any
    • y: any
    • z: any

    Returns number

flatten

  • flatten<T>(arr: T): T extends Array<infer R> ? R : never

forEach

  • Iterate over an Array or an Object invoking a function for each item.

    If obj is an Array callback will be called passing the value, index, and complete array for each item.

    If 'obj' is an Object callback will be called passing the value, key, and complete object for each property.

    Parameters

    • obj: any

      The object to iterate

    • fn: Function

      The callback to invoke for each item

    Returns void

Const forwardRef

getDefaultAdapter

  • getDefaultAdapter(): xhrAdapter
  • Returns xhrAdapter

getOutputLength

  • getOutputLength(inputLength8: any): number
  • Calculate output length with padding and bit length

    Parameters

    • inputLength8: any

    Returns number

isArray

  • isArray(val: any): boolean
  • Determine if a value is an Array

    Parameters

    • val: any

      The value to test

    Returns boolean

    True if value is an Array, otherwise false

isArrayBuffer

  • isArrayBuffer(val: any): boolean
  • Determine if a value is an ArrayBuffer

    Parameters

    • val: any

      The value to test

    Returns boolean

    True if value is an ArrayBuffer, otherwise false

isArrayBufferView

  • isArrayBufferView(val: any): boolean
  • Determine if a value is a view on an ArrayBuffer

    Parameters

    • val: any

      The value to test

    Returns boolean

    True if value is a view on an ArrayBuffer, otherwise false

isBlob

  • isBlob(val: any): boolean
  • Determine if a value is a Blob

    Parameters

    • val: any

      The value to test

    Returns boolean

    True if value is a Blob, otherwise false

isBuffer

  • isBuffer(val: any): boolean
  • Determine if a value is a Buffer

    Parameters

    • val: any

      The value to test

    Returns boolean

    True if value is a Buffer, otherwise false

Const isColorAllowed

  • isColorAllowed(): boolean

Const isConstructor

  • isConstructor(fn: any): boolean

isDate

  • isDate(val: any): boolean
  • Determine if a value is a Date

    Parameters

    • val: any

      The value to test

    Returns boolean

    True if value is a Date, otherwise false

Const isEmpty

  • isEmpty(array: any): boolean

isFile

  • isFile(val: any): boolean
  • Determine if a value is a File

    Parameters

    • val: any

      The value to test

    Returns boolean

    True if value is a File, otherwise false

isFormData

  • isFormData(val: any): boolean
  • Determine if a value is a FormData

    Parameters

    • val: any

      The value to test

    Returns boolean

    True if value is an FormData, otherwise false

Const isFunction

  • isFunction(fn: any): boolean

isIterable

  • isIterable(candidate: any): boolean
  • Parameters

    • candidate: any

    Returns boolean

isIterator

  • isIterator(candidate: any): boolean
  • Parameters

    • candidate: any

    Returns boolean

Const isNil

  • isNil(obj: any): obj is null | undefined

isNumber

  • isNumber(val: any): boolean
  • Determine if a value is a Number

    Parameters

    • val: any

      The value to test

    Returns boolean

    True if value is a Number, otherwise false

Const isObject

  • isObject(fn: any): fn is object

Const isPlainObject

  • isPlainObject(fn: any): fn is object

isStandardBrowserEnv

  • isStandardBrowserEnv(): boolean
  • Determine if we're running in a standard browser environment

    This allows axios to run in a web worker, and react-native. Both environments support XMLHttpRequest, but not fully standard globals.

    web workers: typeof window -> undefined typeof document -> undefined

    react-native: navigator.product -> 'ReactNative' nativescript navigator.product -> 'NativeScript' or 'NS'

    Returns boolean

isStream

  • isStream(val: any): boolean
  • Determine if a value is a Stream

    Parameters

    • val: any

      The value to test

    Returns boolean

    True if value is a Stream, otherwise false

Const isString

  • isString(fn: any): fn is string

Const isSymbol

  • isSymbol(fn: any): fn is symbol

isURLSearchParams

  • isURLSearchParams(val: any): boolean
  • Determine if a value is a URLSearchParams object

    Parameters

    • val: any

      The value to test

    Returns boolean

    True if value is a URLSearchParams object, otherwise false

isUUID

  • isUUID(str: any, version?: string): any

Const isUndefined

  • isUndefined(obj: any): obj is undefined

iterate

  • Creates an Iterator with advanced chainable operator methods for any Iterable or Iterator

    Parameters

    • collection: any

    Returns IteratorWithOperators

loadPackage

  • loadPackage(packageName: string, context: string, loaderFn?: Function): any

md5

  • md5(bytes: any): number[]
  • Parameters

    • bytes: any

    Returns number[]

md5ToHexEncodedArray

  • md5ToHexEncodedArray(input: any): number[]
  • Parameters

    • input: any

    Returns number[]

md5cmn

  • md5cmn(q: any, a: any, b: any, x: any, s: any, t: any): number
  • Parameters

    • q: any
    • a: any
    • b: any
    • x: any
    • s: any
    • t: any

    Returns number

md5ff

  • md5ff(a: any, b: any, c: any, d: any, x: any, s: any, t: any): number
  • Parameters

    • a: any
    • b: any
    • c: any
    • d: any
    • x: any
    • s: any
    • t: any

    Returns number

md5gg

  • md5gg(a: any, b: any, c: any, d: any, x: any, s: any, t: any): number
  • Parameters

    • a: any
    • b: any
    • c: any
    • d: any
    • x: any
    • s: any
    • t: any

    Returns number

md5hh

  • md5hh(a: any, b: any, c: any, d: any, x: any, s: any, t: any): number
  • Parameters

    • a: any
    • b: any
    • c: any
    • d: any
    • x: any
    • s: any
    • t: any

    Returns number

md5ii

  • md5ii(a: any, b: any, c: any, d: any, x: any, s: any, t: any): number
  • Parameters

    • a: any
    • b: any
    • c: any
    • d: any
    • x: any
    • s: any
    • t: any

    Returns number

merge

  • merge(): any
  • Accepts varargs expecting each argument to be an object, then immutably merges the properties of each object and returns result.

    When multiple objects contain the same key the later object in the arguments list will take precedence.

    Example:

    var result = merge({foo: 123}, {foo: 456});
    console.log(result.foo); // outputs 456

    Returns any

    Result of all merge properties

mixin

  • mixin(mixinClass: Type<any>): Type<any>

noop

  • noop(): void
  • Returns void

parse

  • parse(uuid: any): Uint8Array
  • Parameters

    • uuid: any

    Returns Uint8Array

Const randomStringGenerator

  • randomStringGenerator(): any

removeMatchingHeaders

  • removeMatchingHeaders(regex: any, headers: any): any
  • Parameters

    • regex: any
    • headers: any

    Returns any

rng

  • rng(): any
  • Returns any

safeAdd

  • safeAdd(x: any, y: any): number
  • Parameters

    • x: any
    • y: any

    Returns number

setContentTypeIfUnset

  • setContentTypeIfUnset(headers: any, value: any): void
  • Parameters

    • headers: any
    • value: any

    Returns void

sha1

  • sha1(bytes: any): number[]
  • Parameters

    • bytes: any

    Returns number[]

startTimer

  • startTimer(request: any, msecs: any): void
  • Parameters

    • request: any
    • msecs: any

    Returns void

stringToBytes

  • stringToBytes(str: any): any[]
  • Parameters

    • str: any

    Returns any[]

stringify

  • stringify(arr: any): string
  • Parameters

    • arr: any

    Returns string

stripBOM

  • stripBOM(content: string): string
  • Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)

    Parameters

    • content: string

      with BOM

    Returns string

    content value without BOM

throwIfCancellationRequested

  • throwIfCancellationRequested(config: any): void
  • Throws a Cancel if cancellation has been requested.

    Parameters

    • config: any

    Returns void

toIterator

  • toIterator(collection: any): any
  • Parameters

    • collection: any

    Returns any

trim

  • trim(str: string): string
  • Trim excess whitespace off the beginning and end of a string

    Parameters

    • str: string

      The String to trim

    Returns string

    The String freed of excess whitespace

urlToOptions

  • urlToOptions(urlObject: any): { hash: any; hostname: any; href: any; path: any; pathname: any; protocol: any; search: any }
  • Parameters

    • urlObject: any

    Returns { hash: any; hostname: any; href: any; path: any; pathname: any; protocol: any; search: any }

    • hash: any
    • hostname: any
    • href: any
    • path: any
    • pathname: any
    • protocol: any
    • search: any

usage

  • usage(): void
  • Returns void

v1

  • v1(options: any, buf: any, offset: any): any
  • Parameters

    • options: any
    • buf: any
    • offset: any

    Returns any

v4

  • v4(options: any, buf: any, offset: any): any
  • Parameters

    • options: any
    • buf: any
    • offset: any

    Returns any

validate

  • validate(uuid: any): boolean
  • Parameters

    • uuid: any

    Returns boolean

validateEach

  • validateEach(context: { name: string }, arr: any[], predicate: Function, decorator: string, item: string): boolean

validateModuleKeys

  • validateModuleKeys(keys: string[]): void

Const validatePath

  • validatePath(path?: string): string

Const version

  • version(uuid: any): number
  • Parameters

    • uuid: any

    Returns number

wordsToMd5

  • wordsToMd5(x: any, len: any): number[]
  • Parameters

    • x: any
    • len: any

    Returns number[]

wrap

  • wrap(protocols: any): { maxBodyLength: number; maxRedirects: number }
  • Parameters

    • protocols: any

    Returns { maxBodyLength: number; maxRedirects: number }

    • maxBodyLength: number
    • maxRedirects: number

zip

  • Creates an Iterator that emits pairs of values from the two passed Iterators

    Parameters

    • a: any
    • b: any

    Returns IteratorWithOperators

Object literals

DEFAULT_CONTENT_TYPE

DEFAULT_CONTENT_TYPE: object

Content-Type

Content-Type: string = "application/x-www-form-urlencoded"

Const HttpErrorByCode

HttpErrorByCode: object

[HttpStatus.BAD_GATEWAY]

[HttpStatus.BAD_GATEWAY]: BadGatewayException = BadGatewayException

[HttpStatus.BAD_REQUEST]

[HttpStatus.BAD_REQUEST]: BadRequestException = BadRequestException

[HttpStatus.CONFLICT]

[HttpStatus.CONFLICT]: ConflictException = ConflictException

[HttpStatus.FORBIDDEN]

[HttpStatus.FORBIDDEN]: ForbiddenException = ForbiddenException

[HttpStatus.GATEWAY_TIMEOUT]

[HttpStatus.GATEWAY_TIMEOUT]: GatewayTimeoutException = GatewayTimeoutException

[HttpStatus.GONE]

[HttpStatus.GONE]: GoneException = GoneException

[HttpStatus.INTERNAL_SERVER_ERROR]

[HttpStatus.INTERNAL_SERVER_ERROR]: InternalServerErrorException = InternalServerErrorException

[HttpStatus.I_AM_A_TEAPOT]

[HttpStatus.I_AM_A_TEAPOT]: ImATeapotException = ImATeapotException

[HttpStatus.METHOD_NOT_ALLOWED]

[HttpStatus.METHOD_NOT_ALLOWED]: MethodNotAllowedException = MethodNotAllowedException

[HttpStatus.NOT_ACCEPTABLE]

[HttpStatus.NOT_ACCEPTABLE]: NotAcceptableException = NotAcceptableException

[HttpStatus.NOT_FOUND]

[HttpStatus.NOT_FOUND]: NotFoundException = NotFoundException

[HttpStatus.NOT_IMPLEMENTED]

[HttpStatus.NOT_IMPLEMENTED]: NotImplementedException = NotImplementedException

[HttpStatus.PAYLOAD_TOO_LARGE]

[HttpStatus.PAYLOAD_TOO_LARGE]: PayloadTooLargeException = PayloadTooLargeException

[HttpStatus.PRECONDITION_FAILED]

[HttpStatus.PRECONDITION_FAILED]: PreconditionFailedException = PreconditionFailedException

[HttpStatus.REQUEST_TIMEOUT]

[HttpStatus.REQUEST_TIMEOUT]: RequestTimeoutException = RequestTimeoutException

[HttpStatus.SERVICE_UNAVAILABLE]

[HttpStatus.SERVICE_UNAVAILABLE]: ServiceUnavailableException = ServiceUnavailableException

[HttpStatus.UNAUTHORIZED]

[HttpStatus.UNAUTHORIZED]: UnauthorizedException = UnauthorizedException

[HttpStatus.UNPROCESSABLE_ENTITY]

[HttpStatus.UNPROCESSABLE_ENTITY]: UnprocessableEntityException = UnprocessableEntityException

[HttpStatus.UNSUPPORTED_MEDIA_TYPE]

[HttpStatus.UNSUPPORTED_MEDIA_TYPE]: UnsupportedMediaTypeException = UnsupportedMediaTypeException

Const MODULE_METADATA

MODULE_METADATA: object

CONTROLLERS

CONTROLLERS: string = "controllers"

EXPORTS

EXPORTS: string = "exports"

IMPORTS

IMPORTS: string = "imports"

PROVIDERS

PROVIDERS: string = "providers"

Const clc

clc: object

cyanBright

cyanBright: (Anonymous function) = colorIfAllowed((text: string) => `\x1B[96m${text}\x1B[39m`)

green

green: (Anonymous function) = colorIfAllowed((text: string) => `\x1B[32m${text}\x1B[39m`)

magentaBright

magentaBright: (Anonymous function) = colorIfAllowed((text: string) => `\x1B[95m${text}\x1B[39m`)

red

red: (Anonymous function) = colorIfAllowed((text: string) => `\x1B[31m${text}\x1B[39m`)

yellow

yellow: (Anonymous function) = colorIfAllowed((text: string) => `\x1B[33m${text}\x1B[39m`)

Const defaultCacheOptions

defaultCacheOptions: object

max

max: number = 100

store

store: string = "memory"

ttl

ttl: number = 5

Const defaultMetadata

defaultMetadata: object

[METHOD_METADATA]

[METHOD_METADATA]: RequestMethod = RequestMethod.GET

[PATH_METADATA]

[PATH_METADATA]: string = "/"

defaults

defaults: object = require('../defaults')

adapter

adapter: xhrAdapter = getDefaultAdapter()

maxBodyLength

maxBodyLength: number = -1

maxContentLength

maxContentLength: number = -1

timeout

timeout: number = 0

A timeout in milliseconds to abort a request. If set to 0 (default) a timeout is not created.

transformRequest

transformRequest: transformRequest[] = [function transformRequest(data, headers) {normalizeHeaderName(headers, 'Accept');normalizeHeaderName(headers, 'Content-Type');if (utils.isFormData(data) ||utils.isArrayBuffer(data) ||utils.isBuffer(data) ||utils.isStream(data) ||utils.isFile(data) ||utils.isBlob(data)) {return data;}if (utils.isArrayBufferView(data)) {return data.buffer;}if (utils.isURLSearchParams(data)) {setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');return data.toString();}if (utils.isObject(data)) {setContentTypeIfUnset(headers, 'application/json;charset=utf-8');return JSON.stringify(data);}return data;}]

transformResponse

transformResponse: transformResponse[] = [function transformResponse(data) {/*eslint no-param-reassign:0*/if (typeof data === 'string') {try {data = JSON.parse(data);} catch (e) { /* Ignore */ }}return data;}]

xsrfCookieName

xsrfCookieName: string = "XSRF-TOKEN"

xsrfHeaderName

xsrfHeaderName: string = "X-XSRF-TOKEN"

validateStatus

  • validateStatus(status: any): boolean
  • Parameters

    • status: any

    Returns boolean

Const uuid

uuid: object

3

3: RegExp = /^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i

4

4: RegExp = /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i

5

5: RegExp = /^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i

all

all: RegExp = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i

Generated using TypeDoc