@simplysm/service-server 13.0.78 → 13.0.80

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 (2) hide show
  1. package/package.json +12 -11
  2. package/README.md +0 -62
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/service-server",
3
- "version": "13.0.78",
3
+ "version": "13.0.80",
4
4
  "description": "Simplysm package - service module (server)",
5
5
  "author": "simplysm",
6
6
  "license": "Apache-2.0",
@@ -14,6 +14,7 @@
14
14
  "types": "./dist/index.d.ts",
15
15
  "files": [
16
16
  "dist",
17
+ "docs",
17
18
  "src",
18
19
  "tests"
19
20
  ],
@@ -21,25 +22,25 @@
21
22
  "dependencies": {
22
23
  "@fastify/cors": "^11.2.0",
23
24
  "@fastify/helmet": "^13.0.2",
24
- "@fastify/middie": "^9.2.0",
25
+ "@fastify/middie": "^9.3.1",
25
26
  "@fastify/multipart": "^9.4.0",
26
- "@fastify/reply-from": "^12.6.0",
27
+ "@fastify/reply-from": "^12.6.1",
27
28
  "@fastify/static": "^9.0.0",
28
29
  "@fastify/websocket": "^11.2.0",
29
30
  "bufferutil": "^4.1.0",
30
31
  "consola": "^3.4.2",
31
- "fastify": "^5.7.4",
32
- "jose": "^6.1.3",
32
+ "fastify": "^5.8.2",
33
+ "jose": "^6.2.1",
33
34
  "mime": "^4.1.0",
34
- "nodemailer": "^8.0.1",
35
+ "nodemailer": "^8.0.2",
35
36
  "semver": "^7.7.4",
36
37
  "utf-8-validate": "^6.0.6",
37
38
  "ws": "^8.19.0",
38
- "@simplysm/core-node": "13.0.78",
39
- "@simplysm/core-common": "13.0.78",
40
- "@simplysm/orm-node": "13.0.78",
41
- "@simplysm/orm-common": "13.0.78",
42
- "@simplysm/service-common": "13.0.78"
39
+ "@simplysm/core-node": "13.0.80",
40
+ "@simplysm/orm-common": "13.0.80",
41
+ "@simplysm/core-common": "13.0.80",
42
+ "@simplysm/orm-node": "13.0.80",
43
+ "@simplysm/service-common": "13.0.80"
43
44
  },
44
45
  "devDependencies": {
45
46
  "@types/nodemailer": "^6.4.23",
package/README.md DELETED
@@ -1,62 +0,0 @@
1
- # @simplysm/service-server
2
-
3
- Simplysm package - service module (server)
4
-
5
- Provides a full-featured HTTP/WebSocket server built on Fastify for hosting Simplysm services. Includes JWT-based authentication, ORM integration, file upload/static serving, SMTP email, and auto-update capabilities.
6
-
7
- ## Installation
8
-
9
- ```bash
10
- pnpm add @simplysm/service-server
11
- ```
12
-
13
- ## Architecture Overview
14
-
15
- The package is organized into four areas:
16
-
17
- - **Auth** — JWT token signing, verification, and decoding (`signJwt`, `verifyJwt`, `decodeJwt`, `AuthTokenPayload`).
18
- - **Services** — Service definition API (`defineService`, `auth`, `ServiceContext`, `runServiceMethod`) and three ready-to-use built-in services (`OrmService`, `AutoUpdateService`, `SmtpClientService`).
19
- - **Transport** — WebSocket connection management (`WebSocketHandler`, `ServiceSocket`), HTTP route handlers (`handleHttpRequest`, `handleUpload`, `handleStaticFile`), and the binary protocol layer (`ProtocolWrapper`). Also includes the legacy v1 compatibility handler.
20
- - **Server** — The `ServiceServer` class and `createServiceServer` factory that wire everything together, plus the `getConfig` utility for reading `.config.json`.
21
-
22
- ## Quick Start
23
-
24
- ```typescript
25
- import { createServiceServer, defineService, OrmService } from "@simplysm/service-server";
26
-
27
- const GreetService = defineService("Greet", (ctx) => ({
28
- hello: (name: string) => `Hello, ${name}!`,
29
- }));
30
-
31
- const server = createServiceServer({
32
- rootPath: "./dist",
33
- port: 3000,
34
- auth: { jwtSecret: "my-secret" },
35
- services: [GreetService, OrmService],
36
- });
37
-
38
- await server.listen();
39
- ```
40
-
41
- ## Exported Types
42
-
43
- | Type | Description |
44
- |---|---|
45
- | `ServiceServerOptions` | Options object for `ServiceServer` / `createServiceServer` |
46
- | `AuthTokenPayload<TAuthInfo>` | JWT payload with `roles` and typed `data` |
47
- | `ServiceContext<TAuthInfo>` | Context injected into every service factory |
48
- | `ServiceDefinition<TMethods>` | Return type of `defineService` |
49
- | `ServiceMethods<TDefinition>` | Extracts method map type from a `ServiceDefinition` |
50
- | `WebSocketHandler` | Manages all active WebSocket connections |
51
- | `ServiceSocket` | Represents a single active WebSocket connection |
52
- | `ServerProtocolWrapper` | Encode/decode service messages with optional worker offload |
53
- | `OrmServiceType` | Method map type for `OrmService` |
54
- | `AutoUpdateServiceType` | Method map type for `AutoUpdateService` |
55
- | `SmtpClientServiceType` | Method map type for `SmtpClientService` |
56
-
57
- ## Detailed Documentation
58
-
59
- - [docs/auth.md](docs/auth.md) — `AuthTokenPayload`, `signJwt`, `verifyJwt`, `decodeJwt`
60
- - [docs/services.md](docs/services.md) — `defineService`, `auth`, `ServiceContext`, `executeServiceMethod`, `OrmService`, `AutoUpdateService`, `SmtpClientService`
61
- - [docs/transport.md](docs/transport.md) — `WebSocketHandler`, `ServiceSocket`, `handleHttpRequest`, `handleUpload`, `handleStaticFile`, `ServerProtocolWrapper`, legacy handler
62
- - [docs/server.md](docs/server.md) — `ServiceServerOptions`, `ServiceServer`, `createServiceServer`, `getConfig`