@3sixty/api-server-hono 0.20.0-next.0 → 0.20.0-next.1
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 +201 -0
- package/README.md +20 -2
- package/dist/es/honoWebServer.js +759 -0
- package/dist/es/honoWebServer.js.map +1 -0
- package/dist/es/index.js +6 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IHonoWebServerConfig.js +2 -0
- package/dist/es/models/IHonoWebServerConfig.js.map +1 -0
- package/dist/es/models/IHonoWebServerConstructorOptions.js +2 -0
- package/dist/es/models/IHonoWebServerConstructorOptions.js.map +1 -0
- package/dist/types/honoWebServer.d.ts +74 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/models/IHonoWebServerConfig.d.ts +19 -0
- package/dist/types/models/IHonoWebServerConstructorOptions.d.ts +19 -0
- package/docs/changelog.md +18 -0
- package/docs/examples.md +61 -0
- package/docs/reference/classes/HonoWebServer.md +834 -0
- package/docs/reference/index.md +10 -0
- package/docs/reference/interfaces/IHonoWebServerConfig.md +27 -0
- package/docs/reference/interfaces/IHonoWebServerConstructorOptions.md +27 -0
- package/locales/en.json +25 -0
- package/package.json +54 -6
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Interface: IHonoWebServerConfig
|
|
2
|
+
|
|
3
|
+
The configuration for the Hono web server.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### web? {#web}
|
|
8
|
+
|
|
9
|
+
> `optional` **web?**: `Omit`\<`Options`, `"fetch"` \| `"port"` \| `"hostname"` \| `"websocket"`\>
|
|
10
|
+
|
|
11
|
+
The node server options, such as the server factory and TLS options.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### socket? {#socket}
|
|
16
|
+
|
|
17
|
+
> `optional` **socket?**: `Partial`\<`ServerOptions`\>
|
|
18
|
+
|
|
19
|
+
The socket server options.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### includeErrorStack? {#includeerrorstack}
|
|
24
|
+
|
|
25
|
+
> `optional` **includeErrorStack?**: `boolean`
|
|
26
|
+
|
|
27
|
+
Include the stack with errors.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Interface: IHonoWebServerConstructorOptions
|
|
2
|
+
|
|
3
|
+
The options for the Hono web server constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### loggingComponentType? {#loggingcomponenttype}
|
|
8
|
+
|
|
9
|
+
> `optional` **loggingComponentType?**: `string`
|
|
10
|
+
|
|
11
|
+
The type of the logging component to use, if undefined, no logging will happen.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### config? {#config}
|
|
16
|
+
|
|
17
|
+
> `optional` **config?**: [`IHonoWebServerConfig`](IHonoWebServerConfig.md)
|
|
18
|
+
|
|
19
|
+
Additional configuration for the server.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### mimeTypeProcessors? {#mimetypeprocessors}
|
|
24
|
+
|
|
25
|
+
> `optional` **mimeTypeProcessors?**: `IMimeTypeProcessor`[]
|
|
26
|
+
|
|
27
|
+
Additional MIME type processors.
|
package/locales/en.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"error": {
|
|
3
|
+
"honoWebServer": {
|
|
4
|
+
"badRequest": "The web server could not handle the request",
|
|
5
|
+
"unknownBodyLimit": "The route \"{route}\" uses the body limit named \"{bodyLimit}\", which is not configured",
|
|
6
|
+
"bodyTooLarge": "The request body is larger than the limit of {bodyLimit} bytes",
|
|
7
|
+
"invalidJsonBody": "The request body is not valid JSON",
|
|
8
|
+
"unsupportedMediaType": "The content type \"{contentType}\" is not supported",
|
|
9
|
+
"emptyJsonBody": "The request declares a JSON body but the body is empty",
|
|
10
|
+
"invalidUrl": "The request path \"{path}\" is not a valid URL",
|
|
11
|
+
"paramTooLong": "The path param \"{param}\" is longer than the maximum of {maxParamLength} characters"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"warn": {
|
|
15
|
+
"honoWebServer": {
|
|
16
|
+
"additionalBindingFailed": "The Web Server could not bind to the additional address \"{host}\" on port \"{port}\""
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"info": {
|
|
20
|
+
"honoWebServer": {
|
|
21
|
+
"restRouteAdded": "Added REST route \"{route}\" \"{method}\"",
|
|
22
|
+
"socketRouteAdded": "Added socket route: handshake path \"{handshakePath}\", namespace \"{namespace}\", event name \"{eventName}\""
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@3sixty/api-server-hono",
|
|
3
|
+
"version": "0.20.0-next.1",
|
|
4
|
+
"description": "Hono web server integration for exposing API routes with consistent runtime behaviour.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/3sixtyglobal/api.git",
|
|
8
|
+
"directory": "packages/api-server-hono"
|
|
9
|
+
},
|
|
10
|
+
"author": "martyn.janes@iota.org",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=24.0.0"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@3sixty/api-core-server": "0.20.0-next.1",
|
|
18
|
+
"@3sixty/api-models": "0.20.0-next.1",
|
|
19
|
+
"@3sixty/context": "next",
|
|
20
|
+
"@3sixty/core": "next",
|
|
21
|
+
"@3sixty/nameof": "next",
|
|
22
|
+
"@3sixty/web": "next",
|
|
23
|
+
"@hono/node-server": "2.1.3",
|
|
24
|
+
"hono": "4.13.13",
|
|
25
|
+
"socket.io": "4.8.3"
|
|
26
|
+
},
|
|
27
|
+
"main": "./dist/es/index.js",
|
|
28
|
+
"types": "./dist/types/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/types/index.d.ts",
|
|
32
|
+
"import": "./dist/es/index.js",
|
|
33
|
+
"default": "./dist/es/index.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist/es",
|
|
38
|
+
"dist/types",
|
|
39
|
+
"locales",
|
|
40
|
+
"docs"
|
|
41
|
+
],
|
|
42
|
+
"keywords": [
|
|
43
|
+
"twin",
|
|
44
|
+
"trade",
|
|
45
|
+
"iota",
|
|
46
|
+
"framework",
|
|
47
|
+
"blockchain",
|
|
48
|
+
"api"
|
|
49
|
+
],
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "git+https://github.com/3sixtyglobal/api/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://3sixty.global"
|
|
54
|
+
}
|