@twin.org/api-server-fastify 0.0.3-next.20 → 0.0.3-next.22

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TWIN API Server Fastify
2
2
 
3
- Use [Fastify](https://fastify.dev/) as the core web server for APIs.
3
+ This package provides Fastify web server integration for exposing API routes with consistent runtime behaviour. It builds on the Fastify framework to offer a predictable hosting layer for API services.
4
4
 
5
5
  ## Installation
6
6
 
package/docs/changelog.md CHANGED
@@ -1,4 +1,36 @@
1
- # @twin.org/api-server-fastify - Changelog
1
+ # Changelog
2
+
3
+ ## [0.0.3-next.22](https://github.com/twinfoundation/api/compare/api-server-fastify-v0.0.3-next.21...api-server-fastify-v0.0.3-next.22) (2026-03-27)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **api-server-fastify:** Synchronize repo versions
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/api-core bumped from 0.0.3-next.21 to 0.0.3-next.22
16
+ * @twin.org/api-models bumped from 0.0.3-next.21 to 0.0.3-next.22
17
+ * @twin.org/api-processors bumped from 0.0.3-next.21 to 0.0.3-next.22
18
+
19
+ ## [0.0.3-next.21](https://github.com/twinfoundation/api/compare/api-server-fastify-v0.0.3-next.20...api-server-fastify-v0.0.3-next.21) (2026-03-11)
20
+
21
+
22
+ ### Miscellaneous Chores
23
+
24
+ * **api-server-fastify:** Synchronize repo versions
25
+
26
+
27
+ ### Dependencies
28
+
29
+ * The following workspace dependencies were updated
30
+ * dependencies
31
+ * @twin.org/api-core bumped from 0.0.3-next.20 to 0.0.3-next.21
32
+ * @twin.org/api-models bumped from 0.0.3-next.20 to 0.0.3-next.21
33
+ * @twin.org/api-processors bumped from 0.0.3-next.20 to 0.0.3-next.21
2
34
 
3
35
  ## [0.0.3-next.20](https://github.com/twinfoundation/api/compare/api-server-fastify-v0.0.3-next.19...api-server-fastify-v0.0.3-next.20) (2026-02-09)
4
36
 
package/docs/examples.md CHANGED
@@ -1 +1,37 @@
1
- # @twin.org/api-server-fastify - Examples
1
+ # Server Fastify Examples
2
+
3
+ Use these snippets to build and run the Fastify server with explicit lifecycle control in scripts and integration tests.
4
+
5
+ ## FastifyWebServer
6
+
7
+ ```typescript
8
+ import { FastifyWebServer } from '@twin.org/api-server-fastify';
9
+
10
+ const webServer = new FastifyWebServer();
11
+
12
+ await webServer.build(undefined, undefined, undefined, undefined, {
13
+ port: 8080,
14
+ host: '0.0.0.0'
15
+ });
16
+
17
+ await webServer.start();
18
+ const instance = webServer.getInstance();
19
+
20
+ console.log(instance.server.address() !== null); // true
21
+
22
+ await webServer.stop();
23
+ ```
24
+
25
+ ```typescript
26
+ import { FastifyWebServer } from '@twin.org/api-server-fastify';
27
+
28
+ const webServer = new FastifyWebServer();
29
+
30
+ await webServer.build(undefined, undefined, undefined, undefined, {
31
+ port: 3000,
32
+ host: '127.0.0.1'
33
+ });
34
+
35
+ await webServer.start();
36
+ await webServer.stop();
37
+ ```
@@ -28,7 +28,7 @@ The options for the server.
28
28
 
29
29
  ## Properties
30
30
 
31
- ### CLASS\_NAME
31
+ ### CLASS\_NAME {#class_name}
32
32
 
33
33
  > `readonly` `static` **CLASS\_NAME**: `string`
34
34
 
@@ -36,7 +36,7 @@ Runtime name for the class.
36
36
 
37
37
  ## Methods
38
38
 
39
- ### getInstance()
39
+ ### getInstance() {#getinstance}
40
40
 
41
41
  > **getInstance**(): `FastifyInstance`
42
42
 
@@ -54,7 +54,7 @@ The web server instance.
54
54
 
55
55
  ***
56
56
 
57
- ### build()
57
+ ### build() {#build}
58
58
 
59
59
  > **build**(`restRouteProcessors?`, `restRoutes?`, `socketRouteProcessors?`, `socketRoutes?`, `options?`): `Promise`\<`void`\>
60
60
 
@@ -104,7 +104,7 @@ Nothing.
104
104
 
105
105
  ***
106
106
 
107
- ### start()
107
+ ### start() {#start}
108
108
 
109
109
  > **start**(): `Promise`\<`void`\>
110
110
 
@@ -122,7 +122,7 @@ Nothing.
122
122
 
123
123
  ***
124
124
 
125
- ### stop()
125
+ ### stop() {#stop}
126
126
 
127
127
  > **stop**(): `Promise`\<`void`\>
128
128
 
@@ -4,24 +4,24 @@ The configuration for the Fastify web server.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### web?
7
+ ### web? {#web}
8
8
 
9
- > `optional` **web**: `Partial`\<`FastifyServerOptions`\>
9
+ > `optional` **web?**: `Partial`\<`FastifyServerOptions`\>
10
10
 
11
11
  The web server options.
12
12
 
13
13
  ***
14
14
 
15
- ### socket?
15
+ ### socket? {#socket}
16
16
 
17
- > `optional` **socket**: `Partial`\<`ServerOptions`\>
17
+ > `optional` **socket?**: `Partial`\<`ServerOptions`\>
18
18
 
19
19
  The socket server options.
20
20
 
21
21
  ***
22
22
 
23
- ### includeErrorStack?
23
+ ### includeErrorStack? {#includeerrorstack}
24
24
 
25
- > `optional` **includeErrorStack**: `boolean`
25
+ > `optional` **includeErrorStack?**: `boolean`
26
26
 
27
27
  Include the stack with errors.
@@ -4,32 +4,32 @@ The options for the Fastify web server constructor.
4
4
 
5
5
  ## Properties
6
6
 
7
- ### loggingComponentType?
7
+ ### loggingComponentType? {#loggingcomponenttype}
8
8
 
9
- > `optional` **loggingComponentType**: `string`
9
+ > `optional` **loggingComponentType?**: `string`
10
10
 
11
11
  The type of the logging component to use, if undefined, no logging will happen.
12
12
 
13
13
  ***
14
14
 
15
- ### hostingComponentType?
15
+ ### hostingComponentType? {#hostingcomponenttype}
16
16
 
17
- > `optional` **hostingComponentType**: `string`
17
+ > `optional` **hostingComponentType?**: `string`
18
18
 
19
19
  The type of the hosting component to use.
20
20
 
21
21
  ***
22
22
 
23
- ### config?
23
+ ### config? {#config}
24
24
 
25
- > `optional` **config**: [`IFastifyWebServerConfig`](IFastifyWebServerConfig.md)
25
+ > `optional` **config?**: [`IFastifyWebServerConfig`](IFastifyWebServerConfig.md)
26
26
 
27
27
  Additional configuration for the server.
28
28
 
29
29
  ***
30
30
 
31
- ### mimeTypeProcessors?
31
+ ### mimeTypeProcessors? {#mimetypeprocessors}
32
32
 
33
- > `optional` **mimeTypeProcessors**: `IMimeTypeProcessor`[]
33
+ > `optional` **mimeTypeProcessors?**: `IMimeTypeProcessor`[]
34
34
 
35
35
  Additional MIME type processors.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@twin.org/api-server-fastify",
3
- "version": "0.0.3-next.20",
4
- "description": "Use Fastify as the core web server for APIs",
3
+ "version": "0.0.3-next.22",
4
+ "description": "Fastify web server integration for exposing API routes with consistent runtime behaviour.",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/twinfoundation/api.git",
@@ -14,18 +14,18 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@fastify/compress": "8.3.0",
18
- "@fastify/cors": "11.1.0",
19
- "@twin.org/api-core": "0.0.3-next.20",
20
- "@twin.org/api-models": "0.0.3-next.20",
21
- "@twin.org/api-processors": "0.0.3-next.20",
17
+ "@fastify/compress": "8.3.1",
18
+ "@fastify/cors": "11.2.0",
19
+ "@twin.org/api-core": "0.0.3-next.22",
20
+ "@twin.org/api-models": "0.0.3-next.22",
21
+ "@twin.org/api-processors": "0.0.3-next.22",
22
22
  "@twin.org/context": "next",
23
23
  "@twin.org/core": "next",
24
24
  "@twin.org/logging-models": "next",
25
25
  "@twin.org/nameof": "next",
26
26
  "@twin.org/web": "next",
27
- "fastify": "5.6.2",
28
- "socket.io": "4.8.1"
27
+ "fastify": "5.8.4",
28
+ "socket.io": "4.8.3"
29
29
  },
30
30
  "main": "./dist/es/index.js",
31
31
  "types": "./dist/types/index.d.ts",