@3sixty/api-server-fastify 0.0.0-stage → 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 +24 -2
- package/dist/es/fastifySocketIo.js +16 -0
- package/dist/es/fastifySocketIo.js.map +1 -0
- package/dist/es/fastifyWebServer.js +364 -0
- package/dist/es/fastifyWebServer.js.map +1 -0
- package/dist/es/index.js +6 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IFastifyWebServerConfig.js +2 -0
- package/dist/es/models/IFastifyWebServerConfig.js.map +1 -0
- package/dist/es/models/IFastifyWebServerConstructorOptions.js +2 -0
- package/dist/es/models/IFastifyWebServerConstructorOptions.js.map +1 -0
- package/dist/types/fastifySocketIo.d.ts +8 -0
- package/dist/types/fastifyWebServer.d.ts +74 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/models/IFastifyWebServerConfig.d.ts +22 -0
- package/dist/types/models/IFastifyWebServerConstructorOptions.d.ts +19 -0
- package/docs/changelog.md +21 -0
- package/docs/examples.md +37 -0
- package/docs/reference/classes/FastifyWebServer.md +834 -0
- package/docs/reference/index.md +10 -0
- package/docs/reference/interfaces/IFastifyWebServerConfig.md +33 -0
- package/docs/reference/interfaces/IFastifyWebServerConstructorOptions.md +27 -0
- package/locales/.validate-ignore +3 -0
- package/locales/en.json +14 -0
- package/package.json +56 -5
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# @3sixty/api-server-fastify
|
|
2
|
+
|
|
3
|
+
## Classes
|
|
4
|
+
|
|
5
|
+
- [FastifyWebServer](classes/FastifyWebServer.md)
|
|
6
|
+
|
|
7
|
+
## Interfaces
|
|
8
|
+
|
|
9
|
+
- [IFastifyWebServerConfig](interfaces/IFastifyWebServerConfig.md)
|
|
10
|
+
- [IFastifyWebServerConstructorOptions](interfaces/IFastifyWebServerConstructorOptions.md)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Interface: IFastifyWebServerConfig
|
|
2
|
+
|
|
3
|
+
The configuration for the Fastify web server.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### web? {#web}
|
|
8
|
+
|
|
9
|
+
> `optional` **web?**: `Partial`\<`FastifyServerOptions`\> & `object`
|
|
10
|
+
|
|
11
|
+
The web server options, providing the https options serves over HTTPS.
|
|
12
|
+
|
|
13
|
+
#### Type Declaration
|
|
14
|
+
|
|
15
|
+
##### https?
|
|
16
|
+
|
|
17
|
+
> `optional` **https?**: `ServerOptions`\<*typeof* `IncomingMessage`, *typeof* `ServerResponse`\>
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### socket? {#socket}
|
|
22
|
+
|
|
23
|
+
> `optional` **socket?**: `Partial`\<`ServerOptions`\>
|
|
24
|
+
|
|
25
|
+
The socket server options.
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### includeErrorStack? {#includeerrorstack}
|
|
30
|
+
|
|
31
|
+
> `optional` **includeErrorStack?**: `boolean`
|
|
32
|
+
|
|
33
|
+
Include the stack with errors.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Interface: IFastifyWebServerConstructorOptions
|
|
2
|
+
|
|
3
|
+
The options for the Fastify 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?**: [`IFastifyWebServerConfig`](IFastifyWebServerConfig.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,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"error": {
|
|
3
|
+
"fastifyWebServer": {
|
|
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
|
+
}
|
|
7
|
+
},
|
|
8
|
+
"info": {
|
|
9
|
+
"fastifyWebServer": {
|
|
10
|
+
"restRouteAdded": "Added REST route \"{route}\" \"{method}\"",
|
|
11
|
+
"socketRouteAdded": "Added socket route: handshake path \"{handshakePath}\", namespace \"{namespace}\", event name \"{eventName}\""
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@3sixty/api-server-fastify",
|
|
3
|
+
"version": "0.20.0-next.1",
|
|
4
|
+
"description": "Fastify 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-fastify"
|
|
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": "0.20.0-next.1",
|
|
18
|
+
"@3sixty/api-core-server": "0.20.0-next.1",
|
|
19
|
+
"@3sixty/api-models": "0.20.0-next.1",
|
|
20
|
+
"@3sixty/context": "next",
|
|
21
|
+
"@3sixty/core": "next",
|
|
22
|
+
"@3sixty/nameof": "next",
|
|
23
|
+
"@3sixty/web": "next",
|
|
24
|
+
"@fastify/compress": "9.2.2",
|
|
25
|
+
"@fastify/cors": "11.3.1",
|
|
26
|
+
"fastify": "5.12.7",
|
|
27
|
+
"fastify-plugin": "6.0.1",
|
|
28
|
+
"socket.io": "4.8.4"
|
|
29
|
+
},
|
|
30
|
+
"main": "./dist/es/index.js",
|
|
31
|
+
"types": "./dist/types/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/types/index.d.ts",
|
|
35
|
+
"import": "./dist/es/index.js",
|
|
36
|
+
"default": "./dist/es/index.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist/es",
|
|
41
|
+
"dist/types",
|
|
42
|
+
"locales",
|
|
43
|
+
"docs"
|
|
44
|
+
],
|
|
45
|
+
"keywords": [
|
|
46
|
+
"twin",
|
|
47
|
+
"trade",
|
|
48
|
+
"iota",
|
|
49
|
+
"framework",
|
|
50
|
+
"blockchain",
|
|
51
|
+
"api"
|
|
52
|
+
],
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "git+https://github.com/3sixtyglobal/api/issues"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://3sixty.global"
|
|
57
|
+
}
|