@adonisjs/http-server
Advanced tools
Comparing version 1.5.1 to 1.5.2
@@ -5,2 +5,3 @@ /// <reference types="node" /> | ||
import { IncomingMessage, ServerResponse } from 'http'; | ||
import { MacroableConstructorContract } from 'macroable'; | ||
import { LoggerContract } from '@ioc:Adonis/Core/Logger'; | ||
@@ -11,2 +12,3 @@ import { RequestContract } from '@ioc:Adonis/Core/Request'; | ||
import { ProfilerRowContract } from '@ioc:Adonis/Core/Profiler'; | ||
import { EncryptionContract } from '@ioc:Adonis/Core/Encryption'; | ||
export interface HttpContextContract { | ||
@@ -21,4 +23,4 @@ request: RequestContract; | ||
} | ||
export interface HttpContextConstructorContract { | ||
create(routePattern: string, routeParams: any, logger: LoggerContract, profiler: ProfilerRowContract, req?: IncomingMessage, res?: ServerResponse, serverConfig?: ServerConfigContract): HttpContextContract; | ||
export interface HttpContextConstructorContract extends MacroableConstructorContract<HttpContextContract> { | ||
create(routePattern: string, routeParams: any, logger: LoggerContract, profiler: ProfilerRowContract, encryption: EncryptionContract, req?: IncomingMessage, res?: ServerResponse, serverConfig?: ServerConfigContract): HttpContextContract; | ||
new (request: RequestContract, response: ResponseContract, logger: LoggerContract, profiler: ProfilerRowContract): HttpContextContract; | ||
@@ -25,0 +27,0 @@ } |
/// <reference path="../../adonis-typings/index.d.ts" /> | ||
/// <reference types="node" /> | ||
import { Macroable } from 'macroable'; | ||
import { RouteNode } from '@ioc:Adonis/Core/Route'; | ||
@@ -12,3 +13,3 @@ import { IncomingMessage, ServerResponse } from 'http'; | ||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'; | ||
export declare class HttpContext implements HttpContextContract { | ||
export declare class HttpContext extends Macroable implements HttpContextContract { | ||
request: RequestContract; | ||
@@ -21,4 +22,6 @@ response: ResponseContract; | ||
route?: RouteNode; | ||
protected _macros: {}; | ||
protected _getters: {}; | ||
constructor(request: RequestContract, response: ResponseContract, logger: LoggerContract, profiler: ProfilerRowContract); | ||
static create(routePattern: string, routeParams: any, logger: LoggerContract, profiler: ProfilerRowContract, encryption: EncryptionContract, req?: IncomingMessage, res?: ServerResponse, serverConfig?: ServerConfigContract): HttpContext; | ||
} |
@@ -8,2 +8,3 @@ "use strict"; | ||
const proxy_addr_1 = __importDefault(require("proxy-addr")); | ||
const macroable_1 = require("macroable"); | ||
const http_1 = require("http"); | ||
@@ -13,4 +14,5 @@ const helpers_1 = require("../helpers"); | ||
const Response_1 = require("../Response"); | ||
class HttpContext { | ||
class HttpContext extends macroable_1.Macroable { | ||
constructor(request, response, logger, profiler) { | ||
super(); | ||
this.request = request; | ||
@@ -22,2 +24,4 @@ this.response = response; | ||
this.subdomains = {}; | ||
this._macros = {}; | ||
this._getters = {}; | ||
} | ||
@@ -24,0 +28,0 @@ static create(routePattern, routeParams, logger, profiler, encryption, req, res, serverConfig) { |
{ | ||
"name": "@adonisjs/http-server", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "Extracted copy of AdonisJs HTTP server along with it's router", | ||
@@ -39,3 +39,3 @@ "files": [ | ||
"@types/lodash": "^4.14.149", | ||
"@types/node": "^12.12.11", | ||
"@types/node": "^12.12.12", | ||
"@types/pluralize": "0.0.29", | ||
@@ -50,3 +50,3 @@ "@types/proxy-addr": "^2.0.0", | ||
"japa": "^3.0.0", | ||
"mrm": "^1.2.2", | ||
"mrm": "^1.2.3", | ||
"np": "^5.1.3", | ||
@@ -59,3 +59,3 @@ "pem": "^1.14.3", | ||
"tslint-eslint-rules": "^5.4.0", | ||
"typedoc": "^0.15.2", | ||
"typedoc": "^0.15.3", | ||
"typedoc-plugin-external-module-name": "^2.1.0", | ||
@@ -62,0 +62,0 @@ "typedoc-plugin-markdown": "^2.2.11", |
103858
2563
10