Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Context

Hierarchy

  • EventEmitter
    • Context

Properties

_body: any
_buffered: boolean
_cookie: Map<string, Cookie>
_ended: Promise<any> = undefined
_executor: Service<any>
_flushHeaders: boolean
_outputHeaders: Map<string, string>
_pathParams: any
_promises: Promise<any>[]
_route: any
_sanitized: any
_serviceParams: any
_stream: any
_webda: Core
clientInfo: ClientInfo
files: any[]
headers: Map<string, string>
parameters: any = undefined
session: SessionCookie
statusCode: number
__globalContext: Context
defaultMaxListeners: number

Methods

  • addAsyncRequest(promise: any): void
  • addListener(event: string | symbol, listener: function): this
  • cookie(param: any, value: any, options?: any): void
  • For compatibility reason

    todo

    Implement the serialization Not yet handle by the Webda framework

    Parameters

    • param: any
    • value: any
    • Default value options: any = undefined

    Returns void

  • emit(event: string | symbol, ...args: any[]): boolean
  • emitError(err: any): void
  • end(): Promise<any>
  • eventNames(): Array<string | symbol>
  • execute(): Promise<unknown>
  • getCurrentUser<T>(): Promise<T>
  • getCurrentUserId(): string
  • getLocale(): string
  • getMaxListeners(): number
  • getParameters(): any
  • getPathParameters(): any
  • getRequest(): IncomingMessage
  • getRequestBody(sanitizedOptions?: any): any
  • getRequestParameters(): any
  • getResponseBody(): any
  • getResponseCookies(): Map<string, Cookie>
  • getResponseHeaders(): any
  • getRoute(): any
  • getService<T>(name: any): T
  • getServiceParameters(): any
  • getStream(): any
  • init(): Promise<void>
  • isEnded(): Promise<any>
  • isGlobal(): boolean
  • json(obj: any): this
  • listenerCount(type: string | symbol): number
  • listeners(event: string | symbol): Function[]
  • off(event: string | symbol, listener: function): this
  • on(event: string | symbol, listener: function): this
  • once(event: string | symbol, listener: function): this
  • parameter(name: string): any
  • prependListener(event: string | symbol, listener: function): this
  • prependOnceListener(event: string | symbol, listener: function): this
  • rawListeners(event: string | symbol): Function[]
  • redirect(url: string): void
  • reinit(): void
  • removeAllListeners(event?: string | symbol): this
  • removeListener(event: string | symbol, listener: function): this
  • resetResponse(): void
  • setExecutor(executor: any): void
  • setHeader(header: any, value: any): void
  • setMaxListeners(n: number): this
  • setPathParameters(params: any): void
  • setServiceParameters(params: any): void
  • status(code: number): this
  • write(output: any, encoding?: string, cb?: function): boolean
  • writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this
  • Write the http return code and some headers Those headers are not flushed yet so can still be overwritten

    Parameters

    • statusCode: number

      to return to the client

    • Default value headers: OutgoingHttpHeaders = undefined

      to add to the response

    Returns this

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • setGlobalContext(ctx: Context): void

Generated using TypeDoc