@twin.org/api-server-fastify 0.0.1-next.25 → 0.0.1-next.26
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/dist/cjs/index.cjs +0 -3
- package/dist/esm/index.mjs +0 -3
- package/dist/types/fastifyWebServer.d.ts +3 -10
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/IFastifyWebServerConstructorOptions.d.ts +19 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/classes/FastifyWebServer.md +20 -20
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IFastifyWebServerConstructorOptions.md +27 -0
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -84,9 +84,6 @@ class FastifyWebServer {
|
|
|
84
84
|
/**
|
|
85
85
|
* Create a new instance of FastifyWebServer.
|
|
86
86
|
* @param options The options for the server.
|
|
87
|
-
* @param options.loggingConnectorType The type of the logging connector to use, if undefined, no logging will happen.
|
|
88
|
-
* @param options.mimeTypeProcessors Additional MIME type processors.
|
|
89
|
-
* @param options.config Additional configuration for the server.
|
|
90
87
|
*/
|
|
91
88
|
constructor(options) {
|
|
92
89
|
this._loggingConnector = core.Is.stringValue(options?.loggingConnectorType)
|
package/dist/esm/index.mjs
CHANGED
|
@@ -82,9 +82,6 @@ class FastifyWebServer {
|
|
|
82
82
|
/**
|
|
83
83
|
* Create a new instance of FastifyWebServer.
|
|
84
84
|
* @param options The options for the server.
|
|
85
|
-
* @param options.loggingConnectorType The type of the logging connector to use, if undefined, no logging will happen.
|
|
86
|
-
* @param options.mimeTypeProcessors Additional MIME type processors.
|
|
87
|
-
* @param options.config Additional configuration for the server.
|
|
88
85
|
*/
|
|
89
86
|
constructor(options) {
|
|
90
87
|
this._loggingConnector = Is.stringValue(options?.loggingConnectorType)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IRestRoute, type IRestRouteProcessor, type ISocketRoute, type ISocketRouteProcessor, type IWebServer, type IWebServerOptions } from "@twin.org/api-models";
|
|
2
2
|
import { type FastifyInstance } from "fastify";
|
|
3
|
-
import type {
|
|
3
|
+
import type { IFastifyWebServerConstructorOptions } from "./models/IFastifyWebServerConstructorOptions";
|
|
4
4
|
/**
|
|
5
5
|
* Implementation of the web server using Fastify.
|
|
6
6
|
*/
|
|
@@ -12,15 +12,8 @@ export declare class FastifyWebServer implements IWebServer<FastifyInstance> {
|
|
|
12
12
|
/**
|
|
13
13
|
* Create a new instance of FastifyWebServer.
|
|
14
14
|
* @param options The options for the server.
|
|
15
|
-
* @param options.loggingConnectorType The type of the logging connector to use, if undefined, no logging will happen.
|
|
16
|
-
* @param options.mimeTypeProcessors Additional MIME type processors.
|
|
17
|
-
* @param options.config Additional configuration for the server.
|
|
18
15
|
*/
|
|
19
|
-
constructor(options?:
|
|
20
|
-
loggingConnectorType?: string;
|
|
21
|
-
config?: IFastifyWebServerConfig;
|
|
22
|
-
mimeTypeProcessors?: IMimeTypeProcessor[];
|
|
23
|
-
});
|
|
16
|
+
constructor(options?: IFastifyWebServerConstructorOptions);
|
|
24
17
|
/**
|
|
25
18
|
* Get the web server instance.
|
|
26
19
|
* @returns The web server instance.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IMimeTypeProcessor } from "@twin.org/api-models";
|
|
2
|
+
import type { IFastifyWebServerConfig } from "./IFastifyWebServerConfig";
|
|
3
|
+
/**
|
|
4
|
+
* The options for the Fastify web server constructor.
|
|
5
|
+
*/
|
|
6
|
+
export interface IFastifyWebServerConstructorOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The type of the logging connector to use, if undefined, no logging will happen.
|
|
9
|
+
*/
|
|
10
|
+
loggingConnectorType?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Additional configuration for the server.
|
|
13
|
+
*/
|
|
14
|
+
config?: IFastifyWebServerConfig;
|
|
15
|
+
/**
|
|
16
|
+
* Additional MIME type processors.
|
|
17
|
+
*/
|
|
18
|
+
mimeTypeProcessors?: IMimeTypeProcessor[];
|
|
19
|
+
}
|
package/docs/changelog.md
CHANGED
|
@@ -16,21 +16,11 @@ Create a new instance of FastifyWebServer.
|
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### options?
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
• **options.loggingConnectorType?**: `string`
|
|
24
|
-
|
|
25
|
-
The type of the logging connector to use, if undefined, no logging will happen.
|
|
26
|
-
|
|
27
|
-
• **options.config?**: [`IFastifyWebServerConfig`](../interfaces/IFastifyWebServerConfig.md)
|
|
28
|
-
|
|
29
|
-
Additional configuration for the server.
|
|
30
|
-
|
|
31
|
-
• **options.mimeTypeProcessors?**: `IMimeTypeProcessor`[]
|
|
21
|
+
[`IFastifyWebServerConstructorOptions`](../interfaces/IFastifyWebServerConstructorOptions.md)
|
|
32
22
|
|
|
33
|
-
|
|
23
|
+
The options for the server.
|
|
34
24
|
|
|
35
25
|
#### Returns
|
|
36
26
|
|
|
@@ -48,13 +38,13 @@ Runtime name for the class.
|
|
|
48
38
|
|
|
49
39
|
### getInstance()
|
|
50
40
|
|
|
51
|
-
> **getInstance**(): `FastifyInstance`\<`
|
|
41
|
+
> **getInstance**(): `FastifyInstance`\<`IncomingMessage`, `ServerResponse`\>
|
|
52
42
|
|
|
53
43
|
Get the web server instance.
|
|
54
44
|
|
|
55
45
|
#### Returns
|
|
56
46
|
|
|
57
|
-
`FastifyInstance`\<`
|
|
47
|
+
`FastifyInstance`\<`IncomingMessage`, `ServerResponse`\>
|
|
58
48
|
|
|
59
49
|
The web server instance.
|
|
60
50
|
|
|
@@ -72,23 +62,33 @@ Build the server.
|
|
|
72
62
|
|
|
73
63
|
#### Parameters
|
|
74
64
|
|
|
75
|
-
|
|
65
|
+
##### restRouteProcessors?
|
|
66
|
+
|
|
67
|
+
`IRestRouteProcessor`[]
|
|
76
68
|
|
|
77
69
|
The processors for incoming requests over REST.
|
|
78
70
|
|
|
79
|
-
|
|
71
|
+
##### restRoutes?
|
|
72
|
+
|
|
73
|
+
`IRestRoute`[]
|
|
80
74
|
|
|
81
75
|
The REST routes.
|
|
82
76
|
|
|
83
|
-
|
|
77
|
+
##### socketRouteProcessors?
|
|
78
|
+
|
|
79
|
+
`ISocketRouteProcessor`[]
|
|
84
80
|
|
|
85
81
|
The processors for incoming requests over Sockets.
|
|
86
82
|
|
|
87
|
-
|
|
83
|
+
##### socketRoutes?
|
|
84
|
+
|
|
85
|
+
`ISocketRoute`[]
|
|
88
86
|
|
|
89
87
|
The socket routes.
|
|
90
88
|
|
|
91
|
-
|
|
89
|
+
##### options?
|
|
90
|
+
|
|
91
|
+
`IWebServerOptions`
|
|
92
92
|
|
|
93
93
|
Options for building the server.
|
|
94
94
|
|
package/docs/reference/index.md
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Interface: IFastifyWebServerConstructorOptions
|
|
2
|
+
|
|
3
|
+
The options for the Fastify web server constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### loggingConnectorType?
|
|
8
|
+
|
|
9
|
+
> `optional` **loggingConnectorType**: `string`
|
|
10
|
+
|
|
11
|
+
The type of the logging connector to use, if undefined, no logging will happen.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### config?
|
|
16
|
+
|
|
17
|
+
> `optional` **config**: [`IFastifyWebServerConfig`](IFastifyWebServerConfig.md)
|
|
18
|
+
|
|
19
|
+
Additional configuration for the server.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### mimeTypeProcessors?
|
|
24
|
+
|
|
25
|
+
> `optional` **mimeTypeProcessors**: `IMimeTypeProcessor`[]
|
|
26
|
+
|
|
27
|
+
Additional MIME type processors.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/api-server-fastify",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.26",
|
|
4
4
|
"description": "Use Fastify as the core web server for APIs",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@fastify/compress": "8.0.1",
|
|
18
|
-
"@fastify/cors": "10.0.
|
|
19
|
-
"@twin.org/api-core": "0.0.1-next.
|
|
20
|
-
"@twin.org/api-models": "0.0.1-next.
|
|
18
|
+
"@fastify/cors": "10.0.2",
|
|
19
|
+
"@twin.org/api-core": "0.0.1-next.26",
|
|
20
|
+
"@twin.org/api-models": "0.0.1-next.26",
|
|
21
21
|
"@twin.org/core": "next",
|
|
22
22
|
"@twin.org/logging-models": "next",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/web": "next",
|
|
25
|
-
"fastify": "5.1
|
|
25
|
+
"fastify": "5.2.1",
|
|
26
26
|
"socket.io": "4.8.1"
|
|
27
27
|
},
|
|
28
28
|
"main": "./dist/cjs/index.cjs",
|