@twin.org/api-server-fastify 0.0.3-next.5 → 0.0.3-next.50

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.
@@ -1,4 +1,5 @@
1
1
  import { type IRestRoute, type IRestRouteProcessor, type ISocketRoute, type ISocketRouteProcessor, type IWebServer, type IWebServerOptions } from "@twin.org/api-models";
2
+ import { type IHealth } from "@twin.org/core";
2
3
  import { type FastifyInstance } from "fastify";
3
4
  import type { IFastifyWebServerConstructorOptions } from "./models/IFastifyWebServerConstructorOptions.js";
4
5
  /**
@@ -14,6 +15,11 @@ export declare class FastifyWebServer implements IWebServer<FastifyInstance> {
14
15
  * @param options The options for the server.
15
16
  */
16
17
  constructor(options?: IFastifyWebServerConstructorOptions);
18
+ /**
19
+ * Returns the class name of the component.
20
+ * @returns The class name of the component.
21
+ */
22
+ className(): string;
17
23
  /**
18
24
  * Get the web server instance.
19
25
  * @returns The web server instance.
@@ -26,17 +32,22 @@ export declare class FastifyWebServer implements IWebServer<FastifyInstance> {
26
32
  * @param socketRouteProcessors The processors for incoming requests over Sockets.
27
33
  * @param socketRoutes The socket routes.
28
34
  * @param options Options for building the server.
29
- * @returns Nothing.
35
+ * @returns A promise that resolves when the server is fully built and ready to start.
30
36
  */
31
37
  build(restRouteProcessors?: IRestRouteProcessor[], restRoutes?: IRestRoute[], socketRouteProcessors?: ISocketRouteProcessor[], socketRoutes?: ISocketRoute[], options?: IWebServerOptions): Promise<void>;
32
38
  /**
33
39
  * Start the server.
34
- * @returns Nothing.
40
+ * @returns A promise that resolves when the server is listening for connections.
35
41
  */
36
42
  start(): Promise<void>;
37
43
  /**
38
44
  * Stop the server.
39
- * @returns Nothing.
45
+ * @returns A promise that resolves when the server has shut down all connections.
40
46
  */
41
47
  stop(): Promise<void>;
48
+ /**
49
+ * Perform a health check on the server by fetching its own root endpoint.
50
+ * @returns The health status of the server.
51
+ */
52
+ health(): Promise<IHealth[]>;
42
53
  }