@3sixty/api-server-fastify 0.0.0-stage → 0.20.0-next.0

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.
Files changed (32) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +24 -2
  3. package/dist/es/fastifySocketIo.js +16 -0
  4. package/dist/es/fastifySocketIo.js.map +1 -0
  5. package/dist/es/fastifyWebServer.js +877 -0
  6. package/dist/es/fastifyWebServer.js.map +1 -0
  7. package/dist/es/index.js +6 -0
  8. package/dist/es/index.js.map +1 -0
  9. package/dist/es/models/IFastifyWebServerConfig.js +2 -0
  10. package/dist/es/models/IFastifyWebServerConfig.js.map +1 -0
  11. package/dist/es/models/IFastifyWebServerConstructorOptions.js +2 -0
  12. package/dist/es/models/IFastifyWebServerConstructorOptions.js.map +1 -0
  13. package/dist/es/models/IRestProcessorChains.js +2 -0
  14. package/dist/es/models/IRestProcessorChains.js.map +1 -0
  15. package/dist/es/models/ISocketProcessorChains.js +2 -0
  16. package/dist/es/models/ISocketProcessorChains.js.map +1 -0
  17. package/dist/types/fastifySocketIo.d.ts +8 -0
  18. package/dist/types/fastifyWebServer.d.ts +59 -0
  19. package/dist/types/index.d.ts +3 -0
  20. package/dist/types/models/IFastifyWebServerConfig.d.ts +19 -0
  21. package/dist/types/models/IFastifyWebServerConstructorOptions.d.ts +19 -0
  22. package/dist/types/models/IRestProcessorChains.d.ts +18 -0
  23. package/dist/types/models/ISocketProcessorChains.d.ts +26 -0
  24. package/docs/changelog.md +0 -0
  25. package/docs/examples.md +37 -0
  26. package/docs/reference/classes/FastifyWebServer.md +203 -0
  27. package/docs/reference/index.md +10 -0
  28. package/docs/reference/interfaces/IFastifyWebServerConfig.md +27 -0
  29. package/docs/reference/interfaces/IFastifyWebServerConstructorOptions.md +27 -0
  30. package/locales/.validate-ignore +5 -0
  31. package/locales/en.json +35 -0
  32. package/package.json +57 -5
@@ -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.
@@ -0,0 +1,5 @@
1
+ # Fastify plugin options in fastifySocketIo.ts — not locale keys
2
+ >=5\.x\.x
3
+ socket\.io
4
+ 127.0.0.1
5
+ 0.0.0.0
@@ -0,0 +1,35 @@
1
+ {
2
+ "error": {
3
+ "fastifyWebServer": {
4
+ "startFailed": "The Web Server failed to start",
5
+ "badRequest": "The web server could not handle the request",
6
+ "noRestProcessors": "You must configure at least one REST processor",
7
+ "noSocketProcessors": "You must configure at least one socket processor",
8
+ "postProcessorError": "There was a failure after in a post processor for route \"{route}\"",
9
+ "invalidPublicOrigin": "The public origin \"{publicOrigin}\" is not a valid origin URL, it should be in the format \"protocol://host[:port]\".",
10
+ "unknownBodyLimit": "The route \"{route}\" uses the body limit named \"{bodyLimit}\", which is not configured",
11
+ "invalidBodyLimit": "The body limit named \"{bodyLimit}\" must be an integer greater than zero, but it is \"{value}\""
12
+ }
13
+ },
14
+ "info": {
15
+ "fastifyWebServer": {
16
+ "building": "Building Web Server",
17
+ "starting": "Starting Web Server with binding \"{host}\" on port \"{port}\"",
18
+ "started": "The Web Server started on {addresses}",
19
+ "stopped": "The Web Server was stopped",
20
+ "restRouteAdded": "Added REST route \"{route}\" \"{method}\"",
21
+ "socketRouteAdded": "Added socket route: handshake path \"{handshakePath}\", namespace \"{namespace}\", event name \"{eventName}\""
22
+ }
23
+ },
24
+ "health": {
25
+ "fastifyWebServer": {
26
+ "healthConnectivityDescription": "Checks if the Web Server is reachable",
27
+ "reachable": "The Web Server is reachable",
28
+ "unreachable": "The Web Server is unreachable",
29
+ "healthApplicationDescription": "Checks if the root endpoint is reachable",
30
+ "rootEndpointReachable": "The root endpoint is reachable",
31
+ "rootEndpointError": "The root endpoint returned an unexpected response",
32
+ "serverNotBuilt": "The server has not been built"
33
+ }
34
+ }
35
+ }
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
- "name": "@3sixty/api-server-fastify",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@3sixty/api-server-fastify",
3
+ "version": "0.20.0-next.0",
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
+ "@fastify/compress": "9.2.0",
18
+ "@fastify/cors": "11.3.0",
19
+ "@3sixty/api-core": "0.20.0-next.0",
20
+ "@3sixty/api-models": "0.20.0-next.0",
21
+ "@3sixty/api-processors": "0.20.0-next.0",
22
+ "@3sixty/context": "next",
23
+ "@3sixty/core": "next",
24
+ "@3sixty/logging-models": "next",
25
+ "@3sixty/nameof": "next",
26
+ "@3sixty/web": "next",
27
+ "fastify": "5.12.5",
28
+ "fastify-plugin": "6.0.0",
29
+ "socket.io": "4.8.3"
30
+ },
31
+ "main": "./dist/es/index.js",
32
+ "types": "./dist/types/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/types/index.d.ts",
36
+ "import": "./dist/es/index.js",
37
+ "default": "./dist/es/index.js"
38
+ }
39
+ },
40
+ "files": [
41
+ "dist/es",
42
+ "dist/types",
43
+ "locales",
44
+ "docs"
45
+ ],
46
+ "keywords": [
47
+ "twin",
48
+ "trade",
49
+ "iota",
50
+ "framework",
51
+ "blockchain",
52
+ "api"
53
+ ],
54
+ "bugs": {
55
+ "url": "git+https://github.com/3sixtyglobal/api/issues"
56
+ },
57
+ "homepage": "https://3sixty.global"
58
+ }