@adonisjs/http-server 8.0.0-next.5 → 8.0.0-next.7
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/build/{chunk-BFGF3A5X.js → chunk-3XEJZ4S4.js} +1105 -566
- package/build/{chunk-ASX56VAK.js → chunk-NQNHMINZ.js} +59 -0
- package/build/factories/http_context.d.ts +2 -1
- package/build/factories/http_server.d.ts +7 -0
- package/build/factories/main.js +31 -5
- package/build/factories/qs_parser_factory.d.ts +3 -2
- package/build/factories/request.d.ts +1 -0
- package/build/factories/response.d.ts +1 -0
- package/build/factories/router.d.ts +1 -0
- package/build/factories/server_factory.d.ts +1 -0
- package/build/factories/url_builder_factory.d.ts +1 -0
- package/build/index.d.ts +3 -1
- package/build/index.js +87 -37
- package/build/src/cookies/client.d.ts +35 -0
- package/build/src/cookies/drivers/encrypted.d.ts +13 -0
- package/build/src/cookies/drivers/plain.d.ts +9 -0
- package/build/src/cookies/drivers/signed.d.ts +13 -0
- package/build/src/cookies/parser.d.ts +18 -0
- package/build/src/cookies/serializer.d.ts +21 -2
- package/build/src/define_config.d.ts +1 -3
- package/build/src/define_middleware.d.ts +1 -1
- package/build/src/exception_handler.d.ts +72 -31
- package/build/src/helpers.d.ts +50 -0
- package/build/src/helpers.js +5 -1
- package/build/src/http_context/local_storage.d.ts +17 -0
- package/build/src/http_context/main.d.ts +8 -0
- package/build/src/qs.d.ts +14 -0
- package/build/src/redirect.d.ts +62 -9
- package/build/src/request.d.ts +109 -10
- package/build/src/response.d.ts +416 -203
- package/build/src/router/brisk.d.ts +13 -0
- package/build/src/router/executor.d.ts +4 -0
- package/build/src/router/factories/use_return_value.d.ts +5 -0
- package/build/src/router/group.d.ts +18 -1
- package/build/src/router/legacy/url_builder.d.ts +14 -14
- package/build/src/router/main.d.ts +73 -4
- package/build/src/router/matchers.d.ts +3 -0
- package/build/src/router/resource.d.ts +34 -1
- package/build/src/router/route.d.ts +9 -1
- package/build/src/router/signed_url_builder.d.ts +4 -8
- package/build/src/router/store.d.ts +9 -0
- package/build/src/router/url_builder.d.ts +4 -9
- package/build/src/server/factories/middleware_handler.d.ts +10 -1
- package/build/src/server/factories/route_finder.d.ts +13 -3
- package/build/src/server/factories/write_response.d.ts +9 -2
- package/build/src/server/main.d.ts +77 -23
- package/build/src/tracing_channels.d.ts +4 -4
- package/build/src/types/middleware.d.ts +34 -9
- package/build/src/types/qs.d.ts +5 -0
- package/build/src/types/request.d.ts +1 -1
- package/build/src/types/response.d.ts +14 -6
- package/build/src/types/route.d.ts +40 -19
- package/build/src/types/server.d.ts +26 -11
- package/build/src/types/tracing_channels.d.ts +21 -3
- package/build/src/types/url_builder.d.ts +24 -11
- package/package.json +17 -15
|
@@ -3,21 +3,25 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type Prettify } from '@poppinss/utils/types';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Configuration options for URL generation helpers
|
|
7
7
|
*/
|
|
8
8
|
export type URLOptions = {
|
|
9
|
+
/** Query string parameters to append to the URL */
|
|
9
10
|
qs?: Record<string, any>;
|
|
11
|
+
/** URL prefix to prepend to the generated URL */
|
|
10
12
|
prefixUrl?: string;
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
15
|
+
* Configuration options for signed URL generation helpers
|
|
14
16
|
*/
|
|
15
17
|
export type SignedURLOptions = URLOptions & {
|
|
18
|
+
/** Expiration time for the signed URL */
|
|
16
19
|
expiresIn?: string | number;
|
|
20
|
+
/** Purpose identifier for the signed URL */
|
|
17
21
|
purpose?: string;
|
|
18
22
|
};
|
|
19
23
|
/**
|
|
20
|
-
*
|
|
24
|
+
* Utility type that constructs function arguments for route URL builders based on route parameters
|
|
21
25
|
*/
|
|
22
26
|
export type RouteBuilderArguments<Identifier, Route, Options extends any = URLOptions> = Route extends LookupListRoute ? Prettify<Route['params'] extends undefined ? [identifier: Identifier, params?: undefined, options?: Options] : [undefined] extends [Route['params']] ? [
|
|
23
27
|
identifier: Identifier,
|
|
@@ -28,21 +32,31 @@ export type RouteBuilderArguments<Identifier, Route, Options extends any = URLOp
|
|
|
28
32
|
params: Route['params'] | Route['paramsTuple'],
|
|
29
33
|
options?: Options
|
|
30
34
|
]> : never;
|
|
35
|
+
/**
|
|
36
|
+
* LookupList type is used by the URLBuilder to provide
|
|
37
|
+
* type-safety when creating URLs.
|
|
38
|
+
*
|
|
39
|
+
* There is no runtime property that matches this type. Its
|
|
40
|
+
* purely for type-inference.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Route definition structure for type-safe URL building
|
|
44
|
+
*/
|
|
31
45
|
export type LookupListRoute = {
|
|
46
|
+
/** Parameters as a tuple for positional arguments */
|
|
32
47
|
paramsTuple?: [...any[]];
|
|
48
|
+
/** Parameters as a named object */
|
|
33
49
|
params?: {
|
|
34
50
|
[name: string]: any;
|
|
35
51
|
};
|
|
36
52
|
};
|
|
37
53
|
/**
|
|
38
|
-
*
|
|
39
|
-
* type-safety when creating URLs.
|
|
40
|
-
*
|
|
41
|
-
* There is no runtime property that matches this type. Its
|
|
42
|
-
* purely for type-inference.
|
|
54
|
+
* Complete route lookup structure organized by HTTP methods and route identifiers
|
|
43
55
|
*/
|
|
44
56
|
export type LookupList = {
|
|
57
|
+
/** HTTP method to route mapping */
|
|
45
58
|
[method: string]: {
|
|
59
|
+
/** Route identifier to route definition mapping */
|
|
46
60
|
[identifier: string]: LookupListRoute;
|
|
47
61
|
};
|
|
48
62
|
};
|
|
@@ -134,14 +148,13 @@ export type UrlFor<Routes extends LookupList, Options extends any = URLOptions>
|
|
|
134
148
|
};
|
|
135
149
|
};
|
|
136
150
|
/**
|
|
137
|
-
*
|
|
151
|
+
* Utility type to extract routes for a specific HTTP method from the routes collection
|
|
138
152
|
*/
|
|
139
153
|
export type GetRoutesForMethod<Routes, Method> = {
|
|
140
154
|
[K in keyof Routes]: Method extends K ? Routes[Method] : never;
|
|
141
155
|
}[keyof Routes];
|
|
142
156
|
/**
|
|
143
|
-
*
|
|
144
|
-
* and the LookupStore
|
|
157
|
+
* Interface to be augmented by the router containing all registered routes for type-safe URL generation
|
|
145
158
|
*/
|
|
146
159
|
export interface RoutesList {
|
|
147
160
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/http-server",
|
|
3
|
-
"version": "8.0.0-next.
|
|
3
|
+
"version": "8.0.0-next.7",
|
|
4
4
|
"description": "AdonisJS HTTP server with support packed with Routing and Cookies",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"format": "prettier --write .",
|
|
33
33
|
"prepublishOnly": "npm run build",
|
|
34
34
|
"lint": "eslint",
|
|
35
|
-
"quick:test": "node --import=@poppinss/ts-exec --enable-source-maps bin/test.ts"
|
|
35
|
+
"quick:test": "node --import=@poppinss/ts-exec --enable-source-maps bin/test.ts",
|
|
36
|
+
"docs": "typedoc"
|
|
36
37
|
},
|
|
37
38
|
"keywords": [
|
|
38
39
|
"http",
|
|
@@ -41,12 +42,12 @@
|
|
|
41
42
|
"author": "virk,adonisjs",
|
|
42
43
|
"license": "MIT",
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"@adonisjs/application": "^9.0.0-next.
|
|
45
|
-
"@adonisjs/encryption": "^7.0.0-next.
|
|
46
|
-
"@adonisjs/eslint-config": "^3.0.0-next.
|
|
47
|
-
"@adonisjs/events": "^10.1.0-next.
|
|
48
|
-
"@adonisjs/fold": "^11.0.0-next.
|
|
49
|
-
"@adonisjs/logger": "^7.
|
|
45
|
+
"@adonisjs/application": "^9.0.0-next.4",
|
|
46
|
+
"@adonisjs/encryption": "^7.0.0-next.1",
|
|
47
|
+
"@adonisjs/eslint-config": "^3.0.0-next.1",
|
|
48
|
+
"@adonisjs/events": "^10.1.0-next.2",
|
|
49
|
+
"@adonisjs/fold": "^11.0.0-next.2",
|
|
50
|
+
"@adonisjs/logger": "^7.1.0-next.0",
|
|
50
51
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
51
52
|
"@adonisjs/tsconfig": "^2.0.0-next.0",
|
|
52
53
|
"@fastify/middie": "^9.0.3",
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
"@types/fresh": "^0.5.3",
|
|
66
67
|
"@types/fs-extra": "^11.0.4",
|
|
67
68
|
"@types/mime-types": "^3.0.1",
|
|
68
|
-
"@types/node": "^24.3.
|
|
69
|
+
"@types/node": "^24.3.1",
|
|
69
70
|
"@types/on-finished": "^2.3.5",
|
|
70
71
|
"@types/pem": "^1.14.4",
|
|
71
72
|
"@types/proxy-addr": "^2.0.3",
|
|
@@ -78,7 +79,7 @@
|
|
|
78
79
|
"c8": "^10.1.3",
|
|
79
80
|
"cross-env": "^10.0.0",
|
|
80
81
|
"eslint": "^9.34.0",
|
|
81
|
-
"fastify": "^5.
|
|
82
|
+
"fastify": "^5.6.0",
|
|
82
83
|
"fs-extra": "^11.3.1",
|
|
83
84
|
"get-port": "^7.1.0",
|
|
84
85
|
"http-status-codes": "^2.3.0",
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
"release-it": "^19.0.4",
|
|
89
90
|
"supertest": "^7.1.4",
|
|
90
91
|
"tsup": "^8.5.0",
|
|
92
|
+
"typedoc": "^0.28.12",
|
|
91
93
|
"typescript": "^5.9.2",
|
|
92
94
|
"youch": "^4.1.0-beta.11"
|
|
93
95
|
},
|
|
@@ -113,11 +115,11 @@
|
|
|
113
115
|
"vary": "^1.1.2"
|
|
114
116
|
},
|
|
115
117
|
"peerDependencies": {
|
|
116
|
-
"@adonisjs/application": "^9.0.0-next.
|
|
117
|
-
"@adonisjs/encryption": "^7.0.0-next.
|
|
118
|
-
"@adonisjs/events": "^10.1.0-next.
|
|
119
|
-
"@adonisjs/fold": "^11.0.0-next.
|
|
120
|
-
"@adonisjs/logger": "^7.
|
|
118
|
+
"@adonisjs/application": "^9.0.0-next.4",
|
|
119
|
+
"@adonisjs/encryption": "^7.0.0-next.1",
|
|
120
|
+
"@adonisjs/events": "^10.1.0-next.2",
|
|
121
|
+
"@adonisjs/fold": "^11.0.0-next.2",
|
|
122
|
+
"@adonisjs/logger": "^7.1.0-next.0",
|
|
121
123
|
"youch": "^4.1.0-beta.11"
|
|
122
124
|
},
|
|
123
125
|
"peerDependenciesMeta": {
|