@adonisjs/http-server 6.8.2-3 → 6.8.2-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/build/factories/http_context.d.ts +1 -0
- package/build/factories/http_context.d.ts.map +1 -0
- package/build/factories/main.d.ts +1 -0
- package/build/factories/main.d.ts.map +1 -0
- package/build/factories/qs_parser_factory.d.ts +1 -0
- package/build/factories/qs_parser_factory.d.ts.map +1 -0
- package/build/factories/request.d.ts +1 -0
- package/build/factories/request.d.ts.map +1 -0
- package/build/factories/response.d.ts +1 -0
- package/build/factories/response.d.ts.map +1 -0
- package/build/factories/router.d.ts +1 -0
- package/build/factories/router.d.ts.map +1 -0
- package/build/factories/server_factory.d.ts +1 -0
- package/build/factories/server_factory.d.ts.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -0
- package/build/src/cookies/client.d.ts +1 -0
- package/build/src/cookies/client.d.ts.map +1 -0
- package/build/src/cookies/drivers/encrypted.d.ts +1 -0
- package/build/src/cookies/drivers/encrypted.d.ts.map +1 -0
- package/build/src/cookies/drivers/plain.d.ts +1 -0
- package/build/src/cookies/drivers/plain.d.ts.map +1 -0
- package/build/src/cookies/drivers/signed.d.ts +1 -0
- package/build/src/cookies/drivers/signed.d.ts.map +1 -0
- package/build/src/cookies/parser.d.ts +1 -0
- package/build/src/cookies/parser.d.ts.map +1 -0
- package/build/src/cookies/serializer.d.ts +1 -0
- package/build/src/cookies/serializer.d.ts.map +1 -0
- package/build/src/debug.d.ts +1 -0
- package/build/src/debug.d.ts.map +1 -0
- package/build/src/define_config.d.ts +1 -0
- package/build/src/define_config.d.ts.map +1 -0
- package/build/src/define_middleware.d.ts +1 -0
- package/build/src/define_middleware.d.ts.map +1 -0
- package/build/src/exception_handler.d.ts +1 -0
- package/build/src/exception_handler.d.ts.map +1 -0
- package/build/src/exceptions.d.ts +1 -0
- package/build/src/exceptions.d.ts.map +1 -0
- package/build/src/helpers.d.ts +1 -0
- package/build/src/helpers.d.ts.map +1 -0
- package/build/src/http_context/local_storage.d.ts +1 -0
- package/build/src/http_context/local_storage.d.ts.map +1 -0
- package/build/src/http_context/main.d.ts +1 -0
- package/build/src/http_context/main.d.ts.map +1 -0
- package/build/src/qs.d.ts +1 -0
- package/build/src/qs.d.ts.map +1 -0
- package/build/src/redirect.d.ts +1 -0
- package/build/src/redirect.d.ts.map +1 -0
- package/build/src/request.d.ts +1 -0
- package/build/src/request.d.ts.map +1 -0
- package/build/src/response.d.ts +1 -0
- package/build/src/response.d.ts.map +1 -0
- package/build/src/router/brisk.d.ts +1 -0
- package/build/src/router/brisk.d.ts.map +1 -0
- package/build/src/router/executor.d.ts +1 -0
- package/build/src/router/executor.d.ts.map +1 -0
- package/build/src/router/factories/use_return_value.d.ts +1 -0
- package/build/src/router/factories/use_return_value.d.ts.map +1 -0
- package/build/src/router/group.d.ts +1 -0
- package/build/src/router/group.d.ts.map +1 -0
- package/build/src/router/lookup_store/main.d.ts +1 -0
- package/build/src/router/lookup_store/main.d.ts.map +1 -0
- package/build/src/router/lookup_store/route_finder.d.ts +1 -0
- package/build/src/router/lookup_store/route_finder.d.ts.map +1 -0
- package/build/src/router/lookup_store/url_builder.d.ts +1 -0
- package/build/src/router/lookup_store/url_builder.d.ts.map +1 -0
- package/build/src/router/lookup_store/url_builder.js +2 -2
- package/build/src/router/main.d.ts +4 -2
- package/build/src/router/main.d.ts.map +1 -0
- package/build/src/router/main.js +4 -0
- package/build/src/router/matchers.d.ts +1 -0
- package/build/src/router/matchers.d.ts.map +1 -0
- package/build/src/router/parser.d.ts +3 -0
- package/build/src/router/parser.d.ts.map +1 -0
- package/build/src/router/parser.js +5 -0
- package/build/src/router/resource.d.ts +1 -0
- package/build/src/router/resource.d.ts.map +1 -0
- package/build/src/router/route.d.ts +1 -0
- package/build/src/router/route.d.ts.map +1 -0
- package/build/src/router/store.d.ts +1 -0
- package/build/src/router/store.d.ts.map +1 -0
- package/build/src/router/store.js +3 -2
- package/build/src/server/factories/final_handler.d.ts +1 -0
- package/build/src/server/factories/final_handler.d.ts.map +1 -0
- package/build/src/server/factories/middleware_handler.d.ts +1 -0
- package/build/src/server/factories/middleware_handler.d.ts.map +1 -0
- package/build/src/server/factories/write_response.d.ts +1 -0
- package/build/src/server/factories/write_response.d.ts.map +1 -0
- package/build/src/server/main.d.ts +1 -0
- package/build/src/server/main.d.ts.map +1 -0
- package/build/src/types/base.d.ts +1 -0
- package/build/src/types/base.d.ts.map +1 -0
- package/build/src/types/main.d.ts +1 -0
- package/build/src/types/main.d.ts.map +1 -0
- package/build/src/types/middleware.d.ts +1 -0
- package/build/src/types/middleware.d.ts.map +1 -0
- package/build/src/types/qs.d.ts +1 -0
- package/build/src/types/qs.d.ts.map +1 -0
- package/build/src/types/request.d.ts +1 -0
- package/build/src/types/request.d.ts.map +1 -0
- package/build/src/types/response.d.ts +1 -0
- package/build/src/types/response.d.ts.map +1 -0
- package/build/src/types/route.d.ts +1 -0
- package/build/src/types/route.d.ts.map +1 -0
- package/build/src/types/server.d.ts +1 -0
- package/build/src/types/server.d.ts.map +1 -0
- package/factories/http_context.ts +73 -0
- package/factories/main.ts +15 -0
- package/factories/qs_parser_factory.ts +54 -0
- package/factories/request.ts +101 -0
- package/factories/response.ts +106 -0
- package/factories/router.ts +61 -0
- package/factories/server_factory.ts +94 -0
- package/index.ts +23 -0
- package/package.json +27 -23
- package/src/cookies/client.ts +98 -0
- package/src/cookies/drivers/encrypted.ts +42 -0
- package/src/cookies/drivers/plain.ts +37 -0
- package/src/cookies/drivers/signed.ts +42 -0
- package/src/cookies/parser.ts +196 -0
- package/src/cookies/serializer.ts +98 -0
- package/src/debug.ts +11 -0
- package/src/define_config.ts +56 -0
- package/src/define_middleware.ts +61 -0
- package/src/exception_handler.ts +290 -0
- package/src/exceptions.ts +55 -0
- package/src/helpers.ts +108 -0
- package/src/http_context/local_storage.ts +50 -0
- package/src/http_context/main.ts +126 -0
- package/src/qs.ts +31 -0
- package/src/redirect.ts +181 -0
- package/src/request.ts +982 -0
- package/src/response.ts +1421 -0
- package/src/router/brisk.ts +113 -0
- package/src/router/executor.ts +36 -0
- package/src/router/factories/use_return_value.ts +26 -0
- package/src/router/group.ts +243 -0
- package/src/router/lookup_store/main.ts +102 -0
- package/src/router/lookup_store/route_finder.ts +60 -0
- package/src/router/lookup_store/url_builder.ts +250 -0
- package/src/router/main.ts +431 -0
- package/src/router/matchers.ts +40 -0
- package/src/router/parser.ts +20 -0
- package/src/router/resource.ts +277 -0
- package/src/router/route.ts +363 -0
- package/src/router/store.ts +239 -0
- package/src/server/factories/final_handler.ts +38 -0
- package/src/server/factories/middleware_handler.ts +23 -0
- package/src/server/factories/write_response.ts +26 -0
- package/src/server/main.ts +356 -0
- package/src/types/base.ts +30 -0
- package/src/types/main.ts +16 -0
- package/src/types/middleware.ts +59 -0
- package/src/types/qs.ts +85 -0
- package/src/types/request.ts +52 -0
- package/src/types/response.ts +57 -0
- package/src/types/route.ts +217 -0
- package/src/types/server.ts +92 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/types/base.ts"],"names":[],"mappings":"AASA,YAAY,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAKxD,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAA;AAKlC,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AAKtD,MAAM,MAAM,UAAU,CAAC,aAAa,IAAI,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC,CAAA;AAKjF,MAAM,MAAM,gBAAgB,CAAC,EAAE,SAAS,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/types/main.ts"],"names":[],"mappings":"AASA,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../src/types/middleware.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAK1D,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC;IAC1C,MAAM,EAAE,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,GAAG,CAAA;CAC5D,CAAC,CAAA;AAKF,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAA;AAK9D,MAAM,MAAM,iBAAiB,CAAC,UAAU,SAAS,iBAAiB,IAAI,UAAU,CAC9E,YAAY,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CACnC,CAAC,CAAC,CAAC,SAAS,SAAS,GAClB,EAAE,GACF,YAAY,CAAC,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAC5E,CAAC,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACnD,CAAC,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAKxD,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,KAAK,GAAG,CAAA;AAKlE,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,CACN,QAAQ,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAChC,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,KACpD,GAAG,CAAA;CACT,CAAA;AAKD,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,GAAG;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,GAAG,CAAA;CACV,CAAA"}
|
package/build/src/types/qs.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qs.d.ts","sourceRoot":"","sources":["../../../src/types/qs.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE;QAML,KAAK,EAAE,MAAM,CAAA;QAOb,cAAc,EAAE,MAAM,CAAA;QAOtB,WAAW,EAAE,OAAO,CAAA;QASpB,UAAU,EAAE,MAAM,CAAA;QAOlB,KAAK,EAAE,OAAO,CAAA;KACf,CAAA;IAED,SAAS,EAAE;QAMT,MAAM,EAAE,OAAO,CAAA;QAOf,gBAAgB,EAAE,OAAO,CAAA;QAYzB,WAAW,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAA;QAQxD,SAAS,EAAE,OAAO,CAAA;KACnB,CAAA;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/types/request.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,aAAa,GAAG;IAK1B,eAAe,EAAE,MAAM,CAAA;IAWvB,iBAAiB,EAAE,OAAO,CAAA;IAS1B,mBAAmB,EAAE,OAAO,CAAA;IAK5B,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,MAAM,CAAA;IAQhC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAA;CAC3D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/types/response.ts"],"names":[],"mappings":";;AAYA,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAA;IAC5B,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA;IAC7C,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA;AAMD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,CAAA;AAKxF,MAAM,MAAM,cAAc,GAAG;IAO3B,IAAI,EAAE,OAAO,CAAA;IAOb,iBAAiB,EAAE,MAAM,CAAA;IAKzB,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;CAC/B,CAAA;AAKD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/types/route.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAA;A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AAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,KAAK,GAAG,CAAA;CAC9C,CAAA;AAKD,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,kBAAkB,CAAC,CAAA;AAKlE,MAAM,MAAM,YAAY,GAAG,aAAa,GACtC,cAAc,GAAG;IAOf,oBAAoB,EAAE,OAAO,CAAA;IAK7B,EAAE,EAAE,cAAc,CAAA;CACnB,CAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/http-server
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Container } from '@adonisjs/fold'
|
|
11
|
+
import type { Logger } from '@adonisjs/logger'
|
|
12
|
+
import { LoggerFactory } from '@adonisjs/logger/factories'
|
|
13
|
+
|
|
14
|
+
import { RequestFactory } from './request.js'
|
|
15
|
+
import { ResponseFactory } from './response.js'
|
|
16
|
+
import type { Request } from '../src/request.js'
|
|
17
|
+
import type { Response } from '../src/response.js'
|
|
18
|
+
import { HttpContext } from '../src/http_context/main.js'
|
|
19
|
+
|
|
20
|
+
type FactoryParameters = {
|
|
21
|
+
request: Request
|
|
22
|
+
response: Response
|
|
23
|
+
logger: Logger
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* HttpContext factory is used to generate Http context class instances for
|
|
28
|
+
* testing
|
|
29
|
+
*/
|
|
30
|
+
export class HttpContextFactory {
|
|
31
|
+
#parameters: Partial<FactoryParameters> = {}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Returns the request class instance
|
|
35
|
+
*/
|
|
36
|
+
#createRequest() {
|
|
37
|
+
return this.#parameters.request || new RequestFactory().create()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Returns the response class instance
|
|
42
|
+
*/
|
|
43
|
+
#createResponse() {
|
|
44
|
+
return this.#parameters.response || new ResponseFactory().create()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Returns an instance of the logger class
|
|
49
|
+
*/
|
|
50
|
+
#createLogger() {
|
|
51
|
+
return this.#parameters.logger || new LoggerFactory().create()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Merge factory params
|
|
56
|
+
*/
|
|
57
|
+
merge(params: Partial<FactoryParameters>) {
|
|
58
|
+
Object.assign(this.#parameters, params)
|
|
59
|
+
return this
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Create request
|
|
64
|
+
*/
|
|
65
|
+
create() {
|
|
66
|
+
return new HttpContext(
|
|
67
|
+
this.#createRequest(),
|
|
68
|
+
this.#createResponse(),
|
|
69
|
+
this.#createLogger(),
|
|
70
|
+
new Container().createResolver()
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/http-server
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export { HttpContextFactory } from './http_context.js'
|
|
11
|
+
export { QsParserFactory } from './qs_parser_factory.js'
|
|
12
|
+
export { RequestFactory } from './request.js'
|
|
13
|
+
export { ResponseFactory } from './response.js'
|
|
14
|
+
export { RouterFactory } from './router.js'
|
|
15
|
+
export { ServerFactory } from './server_factory.js'
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/http-server
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Qs } from '../src/qs.js'
|
|
11
|
+
import type { QSParserConfig } from '../src/types/qs.js'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* QS Parser factory is used to generate the query string
|
|
15
|
+
* parser for testing
|
|
16
|
+
*/
|
|
17
|
+
export class QsParserFactory {
|
|
18
|
+
#options: QSParserConfig = {
|
|
19
|
+
parse: {
|
|
20
|
+
depth: 5,
|
|
21
|
+
parameterLimit: 1000,
|
|
22
|
+
allowSparse: false,
|
|
23
|
+
arrayLimit: 20,
|
|
24
|
+
comma: true,
|
|
25
|
+
},
|
|
26
|
+
stringify: {
|
|
27
|
+
encode: true,
|
|
28
|
+
encodeValuesOnly: false,
|
|
29
|
+
arrayFormat: 'indices',
|
|
30
|
+
skipNulls: false,
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Merge encryption factory options
|
|
36
|
+
*/
|
|
37
|
+
merge(
|
|
38
|
+
options: Partial<{
|
|
39
|
+
parse: Partial<QSParserConfig['parse']>
|
|
40
|
+
stringify: Partial<QSParserConfig['stringify']>
|
|
41
|
+
}>
|
|
42
|
+
) {
|
|
43
|
+
Object.assign(this.#options.parse, options.parse)
|
|
44
|
+
Object.assign(this.#options.stringify, options.stringify)
|
|
45
|
+
return this
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Create instance of the logger class
|
|
50
|
+
*/
|
|
51
|
+
create() {
|
|
52
|
+
return new Qs(this.#options)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/http-server
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Socket } from 'node:net'
|
|
11
|
+
import proxyAddr from 'proxy-addr'
|
|
12
|
+
import type { Encryption } from '@adonisjs/encryption'
|
|
13
|
+
import { IncomingMessage, ServerResponse } from 'node:http'
|
|
14
|
+
import { EncryptionFactory } from '@adonisjs/encryption/factories'
|
|
15
|
+
|
|
16
|
+
import { Request } from '../src/request.js'
|
|
17
|
+
import { RequestConfig } from '../src/types/request.js'
|
|
18
|
+
import { QsParserFactory } from './qs_parser_factory.js'
|
|
19
|
+
|
|
20
|
+
type FactoryParameters = {
|
|
21
|
+
url: string
|
|
22
|
+
method: string
|
|
23
|
+
req: IncomingMessage
|
|
24
|
+
res: ServerResponse
|
|
25
|
+
encryption: Encryption
|
|
26
|
+
config: Partial<RequestConfig>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Request factory is used to generate request class instances for
|
|
31
|
+
* testing
|
|
32
|
+
*/
|
|
33
|
+
export class RequestFactory {
|
|
34
|
+
#parameters: Partial<FactoryParameters> = {}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Returns the config for the request class
|
|
38
|
+
*/
|
|
39
|
+
#getConfig() {
|
|
40
|
+
return {
|
|
41
|
+
allowMethodSpoofing: false,
|
|
42
|
+
trustProxy: proxyAddr.compile('loopback'),
|
|
43
|
+
subdomainOffset: 2,
|
|
44
|
+
generateRequestId: false,
|
|
45
|
+
...this.#parameters.config,
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Returns the HTTP req object
|
|
51
|
+
*/
|
|
52
|
+
#createRequest() {
|
|
53
|
+
const req = this.#parameters.req || new IncomingMessage(new Socket())
|
|
54
|
+
if (this.#parameters.url) {
|
|
55
|
+
req.url = this.#parameters.url
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (this.#parameters.method) {
|
|
59
|
+
req.method = this.#parameters.method
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return req
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Returns the HTTP res object
|
|
67
|
+
*/
|
|
68
|
+
#createResponse(req: IncomingMessage) {
|
|
69
|
+
return this.#parameters.res || new ServerResponse(req)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Returns an instance of the encryptor to encrypt
|
|
74
|
+
* signed URLs
|
|
75
|
+
*/
|
|
76
|
+
#createEncryption() {
|
|
77
|
+
return this.#parameters.encryption || new EncryptionFactory().create()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Merge factory params
|
|
82
|
+
*/
|
|
83
|
+
merge(params: Partial<FactoryParameters>) {
|
|
84
|
+
Object.assign(this.#parameters, params)
|
|
85
|
+
return this
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Create request
|
|
90
|
+
*/
|
|
91
|
+
create() {
|
|
92
|
+
const req = this.#createRequest()
|
|
93
|
+
return new Request(
|
|
94
|
+
req,
|
|
95
|
+
this.#createResponse(req),
|
|
96
|
+
this.#createEncryption(),
|
|
97
|
+
this.#getConfig(),
|
|
98
|
+
new QsParserFactory().create()
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/http-server
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Socket } from 'node:net'
|
|
11
|
+
import type { Encryption } from '@adonisjs/encryption'
|
|
12
|
+
import { IncomingMessage, ServerResponse } from 'node:http'
|
|
13
|
+
import { EncryptionFactory } from '@adonisjs/encryption/factories'
|
|
14
|
+
|
|
15
|
+
import { RouterFactory } from './router.js'
|
|
16
|
+
import { Response } from '../src/response.js'
|
|
17
|
+
import { Router } from '../src/router/main.js'
|
|
18
|
+
import { ResponseConfig } from '../src/types/response.js'
|
|
19
|
+
import { QsParserFactory } from './qs_parser_factory.js'
|
|
20
|
+
|
|
21
|
+
type FactoryParameters = {
|
|
22
|
+
req: IncomingMessage
|
|
23
|
+
res: ServerResponse
|
|
24
|
+
encryption: Encryption
|
|
25
|
+
config: Partial<ResponseConfig>
|
|
26
|
+
router: Router
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Response factory is used to generate response class instances for
|
|
31
|
+
* testing
|
|
32
|
+
*/
|
|
33
|
+
export class ResponseFactory {
|
|
34
|
+
#parameters: Partial<FactoryParameters> = {}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Returns the config for the request class
|
|
38
|
+
*/
|
|
39
|
+
#getConfig() {
|
|
40
|
+
return {
|
|
41
|
+
etag: false,
|
|
42
|
+
jsonpCallbackName: 'callback',
|
|
43
|
+
cookie: {
|
|
44
|
+
maxAge: 90,
|
|
45
|
+
path: '/',
|
|
46
|
+
httpOnly: true,
|
|
47
|
+
sameSite: false,
|
|
48
|
+
secure: false,
|
|
49
|
+
},
|
|
50
|
+
...this.#parameters.config,
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Returns the HTTP req object
|
|
56
|
+
*/
|
|
57
|
+
#createRequest() {
|
|
58
|
+
return this.#parameters.req || new IncomingMessage(new Socket())
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Returns an instance of the router
|
|
63
|
+
*/
|
|
64
|
+
#createRouter() {
|
|
65
|
+
return this.#parameters.router || new RouterFactory().create()
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns the HTTP res object
|
|
70
|
+
*/
|
|
71
|
+
#createResponse(req: IncomingMessage) {
|
|
72
|
+
return this.#parameters.res || new ServerResponse(req)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Returns an instance of the encryptor to encrypt
|
|
77
|
+
* signed URLs
|
|
78
|
+
*/
|
|
79
|
+
#createEncryption() {
|
|
80
|
+
return this.#parameters.encryption || new EncryptionFactory().create()
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Merge factory params
|
|
85
|
+
*/
|
|
86
|
+
merge(params: Partial<FactoryParameters>) {
|
|
87
|
+
Object.assign(this.#parameters, params)
|
|
88
|
+
return this
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Create response class instance
|
|
93
|
+
*/
|
|
94
|
+
create() {
|
|
95
|
+
const req = this.#createRequest()
|
|
96
|
+
|
|
97
|
+
return new Response(
|
|
98
|
+
req,
|
|
99
|
+
this.#createResponse(req),
|
|
100
|
+
this.#createEncryption(),
|
|
101
|
+
this.#getConfig(),
|
|
102
|
+
this.#createRouter(),
|
|
103
|
+
new QsParserFactory().create()
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/http-server
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { Encryption } from '@adonisjs/encryption'
|
|
11
|
+
import type { Application } from '@adonisjs/application'
|
|
12
|
+
import { AppFactory } from '@adonisjs/application/factories'
|
|
13
|
+
import { EncryptionFactory } from '@adonisjs/encryption/factories'
|
|
14
|
+
|
|
15
|
+
import { Router } from '../src/router/main.js'
|
|
16
|
+
import { QsParserFactory } from './qs_parser_factory.js'
|
|
17
|
+
|
|
18
|
+
type FactoryParameters = {
|
|
19
|
+
app: Application<any>
|
|
20
|
+
encryption: Encryption
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Router factory is used to generate router class instances for
|
|
25
|
+
* testing
|
|
26
|
+
*/
|
|
27
|
+
export class RouterFactory {
|
|
28
|
+
#parameters: Partial<FactoryParameters> = {}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Returns an instance of the application class
|
|
32
|
+
*/
|
|
33
|
+
#getApp() {
|
|
34
|
+
return (
|
|
35
|
+
this.#parameters.app || new AppFactory().create(new URL('./app/', import.meta.url), () => {})
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Returns an instance of the encryptor to encrypt
|
|
41
|
+
* signed URLs
|
|
42
|
+
*/
|
|
43
|
+
#createEncryption() {
|
|
44
|
+
return this.#parameters.encryption || new EncryptionFactory().create()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Merge factory params
|
|
49
|
+
*/
|
|
50
|
+
merge(params: Partial<FactoryParameters>) {
|
|
51
|
+
Object.assign(this.#parameters, params)
|
|
52
|
+
return this
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Create router instance
|
|
57
|
+
*/
|
|
58
|
+
create() {
|
|
59
|
+
return new Router(this.#getApp(), this.#createEncryption(), new QsParserFactory().create())
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/http-server
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Logger } from '@adonisjs/logger'
|
|
11
|
+
import { Emitter } from '@adonisjs/events'
|
|
12
|
+
import type { Encryption } from '@adonisjs/encryption'
|
|
13
|
+
import type { Application } from '@adonisjs/application'
|
|
14
|
+
import { AppFactory } from '@adonisjs/application/factories'
|
|
15
|
+
import { EncryptionFactory } from '@adonisjs/encryption/factories'
|
|
16
|
+
|
|
17
|
+
import { Server } from '../src/server/main.js'
|
|
18
|
+
import { defineConfig } from '../src/define_config.js'
|
|
19
|
+
import type { ServerConfig } from '../src/types/server.js'
|
|
20
|
+
|
|
21
|
+
type FactoryParameters = {
|
|
22
|
+
app: Application<any>
|
|
23
|
+
logger: Logger
|
|
24
|
+
encryption: Encryption
|
|
25
|
+
emitter: Emitter<any>
|
|
26
|
+
config: Partial<ServerConfig>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Server factory is used to generate server class instances for
|
|
31
|
+
* testing
|
|
32
|
+
*/
|
|
33
|
+
export class ServerFactory {
|
|
34
|
+
#parameters: Partial<FactoryParameters> = {}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Returns the emitter instance
|
|
38
|
+
*/
|
|
39
|
+
#getEmitter() {
|
|
40
|
+
return this.#parameters.emitter || new Emitter(this.#getApp())
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns the logger instance
|
|
45
|
+
*/
|
|
46
|
+
#getLogger() {
|
|
47
|
+
return this.#parameters.logger || new Logger({ enabled: false })
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Returns the config for the server class
|
|
52
|
+
*/
|
|
53
|
+
#getConfig() {
|
|
54
|
+
return defineConfig(this.#parameters.config || {})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Returns an instance of the application class
|
|
59
|
+
*/
|
|
60
|
+
#getApp() {
|
|
61
|
+
return (
|
|
62
|
+
this.#parameters.app || new AppFactory().create(new URL('./app/', import.meta.url), () => {})
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Returns an instance of the encryptor to encrypt
|
|
68
|
+
* signed URLs
|
|
69
|
+
*/
|
|
70
|
+
#createEncryption() {
|
|
71
|
+
return this.#parameters.encryption || new EncryptionFactory().create()
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Merge factory params
|
|
76
|
+
*/
|
|
77
|
+
merge(params: Partial<FactoryParameters>) {
|
|
78
|
+
Object.assign(this.#parameters, params)
|
|
79
|
+
return this
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Create server instance
|
|
84
|
+
*/
|
|
85
|
+
create() {
|
|
86
|
+
return new Server(
|
|
87
|
+
this.#getApp(),
|
|
88
|
+
this.#createEncryption(),
|
|
89
|
+
this.#getEmitter(),
|
|
90
|
+
this.#getLogger(),
|
|
91
|
+
this.#getConfig()
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
}
|
package/index.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/http-server
|
|
3
|
+
*
|
|
4
|
+
* (c) AdonisJS
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export { Request } from './src/request.js'
|
|
11
|
+
export { Response } from './src/response.js'
|
|
12
|
+
export { Redirect } from './src/redirect.js'
|
|
13
|
+
export { Server } from './src/server/main.js'
|
|
14
|
+
export { Router } from './src/router/main.js'
|
|
15
|
+
export { Route } from './src/router/route.js'
|
|
16
|
+
export * as errors from './src/exceptions.js'
|
|
17
|
+
export { BriskRoute } from './src/router/brisk.js'
|
|
18
|
+
export { RouteGroup } from './src/router/group.js'
|
|
19
|
+
export { defineConfig } from './src/define_config.js'
|
|
20
|
+
export { CookieClient } from './src/cookies/client.js'
|
|
21
|
+
export { HttpContext } from './src/http_context/main.js'
|
|
22
|
+
export { RouteResource } from './src/router/resource.js'
|
|
23
|
+
export { ExceptionHandler } from './src/exception_handler.js'
|