@simplysm/service-common 13.0.68 → 13.0.70
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 +20 -251
- package/dist/protocol/create-service-protocol.d.ts +14 -14
- package/dist/protocol/create-service-protocol.js +4 -4
- package/dist/protocol/create-service-protocol.js.map +1 -1
- package/dist/protocol/protocol.types.d.ts +17 -17
- package/dist/protocol/protocol.types.d.ts.map +1 -1
- package/dist/protocol/protocol.types.js +5 -5
- package/dist/service-types/auto-update-service.types.d.ts +5 -5
- package/dist/service-types/orm-service.types.d.ts +4 -4
- package/dist/service-types/orm-service.types.d.ts.map +1 -1
- package/dist/types.d.ts +5 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -6
- package/src/protocol/create-service-protocol.ts +27 -27
- package/src/protocol/protocol.types.ts +35 -35
- package/src/service-types/auto-update-service.types.ts +5 -5
- package/src/service-types/orm-service.types.ts +4 -4
- package/src/types.ts +5 -5
- package/tests/define-event.spec.ts +21 -0
- package/tests/protocol/service-protocol.spec.ts +336 -0
package/README.md
CHANGED
|
@@ -1,269 +1,38 @@
|
|
|
1
1
|
# @simplysm/service-common
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Simplysm package - Service module (common)
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
```bash
|
|
8
|
-
npm install @simplysm/service-common
|
|
9
|
-
# or
|
|
10
7
|
pnpm add @simplysm/service-common
|
|
11
|
-
```
|
|
12
8
|
|
|
13
|
-
##
|
|
9
|
+
## Source Index
|
|
14
10
|
|
|
15
|
-
###
|
|
11
|
+
### Protocol
|
|
16
12
|
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
| `protocol/protocol.types` | Protocol constants
|
|
20
|
-
| `protocol/service-protocol` | `ServiceProtocol
|
|
21
|
-
| `service-types/orm-service.types` | `OrmService` interface and `DbConnOptions` type |
|
|
22
|
-
| `service-types/auto-update-service.types` | `AutoUpdateService` interface |
|
|
23
|
-
| `types` | `ServiceUploadResult` interface |
|
|
24
|
-
| `define-event` | `defineEvent()` function, `ServiceEventDef` interface |
|
|
13
|
+
| Source | Exports | Description | Test |
|
|
14
|
+
|--------|---------|-------------|------|
|
|
15
|
+
| `src/protocol/protocol.types.ts` | `PROTOCOL_CONFIG`, `ServiceMessage`, `ServiceServerMessage`, `ServiceServerRawMessage`, `ServiceClientMessage`, `ServiceReloadMessage`, `ServiceProgressMessage`, `ServiceErrorMessage`, `ServiceAuthMessage`, `ServiceRequestMessage`, `ServiceResponseMessage`, `ServiceAddEventListenerMessage`, `ServiceRemoveEventListenerMessage`, `ServiceGetEventListenerInfosMessage`, `ServiceEmitEventMessage`, `ServiceEventMessage` | Protocol constants and all WebSocket message type definitions | - |
|
|
16
|
+
| `src/protocol/service-protocol.ts` | `ServiceProtocol`, `ServiceMessageDecodeResult`, `createServiceProtocol` | Factory and types for encoding/decoding chunked service messages | `service-protocol.spec.ts` |
|
|
25
17
|
|
|
26
|
-
|
|
18
|
+
### Service Types
|
|
27
19
|
|
|
28
|
-
|
|
20
|
+
| Source | Exports | Description | Test |
|
|
21
|
+
|--------|---------|-------------|------|
|
|
22
|
+
| `src/service-types/orm-service.types.ts` | `OrmService`, `DbConnOptions` | Service interface for ORM database connection and query execution | - |
|
|
23
|
+
| `src/service-types/auto-update-service.types.ts` | `AutoUpdateService` | Service interface for retrieving the latest client application version | - |
|
|
29
24
|
|
|
30
|
-
|
|
25
|
+
### Types
|
|
31
26
|
|
|
32
|
-
|
|
27
|
+
| Source | Exports | Description | Test |
|
|
28
|
+
|--------|---------|-------------|------|
|
|
29
|
+
| `src/types.ts` | `ServiceUploadResult` | Result type describing a file uploaded to the server | - |
|
|
33
30
|
|
|
34
|
-
|
|
31
|
+
### Define
|
|
35
32
|
|
|
36
|
-
|
|
|
37
|
-
|
|
38
|
-
|
|
|
39
|
-
| 16 | 8 bytes | TotalSize | Total message size (uint64) |
|
|
40
|
-
| 24 | 4 bytes | Index | Chunk index (uint32) |
|
|
41
|
-
|
|
42
|
-
#### API
|
|
43
|
-
|
|
44
|
-
| Method | Return Type | Description |
|
|
45
|
-
|--------|-------------|-------------|
|
|
46
|
-
| `encode(uuid, message)` | `{ chunks: Bytes[]; totalSize: number }` | Encodes the message and automatically splits into chunks if it exceeds `SPLIT_MESSAGE_SIZE` |
|
|
47
|
-
| `decode<TMessage extends ServiceMessage>(bytes)` | `ServiceMessageDecodeResult<TMessage>` | Decodes binary chunks and automatically assembles split messages |
|
|
48
|
-
| `dispose()` | `void` | Releases the GC timer of the internal chunk accumulator. Must be called when the instance is no longer used |
|
|
49
|
-
|
|
50
|
-
#### ServiceMessageDecodeResult
|
|
51
|
-
|
|
52
|
-
`ServiceMessageDecodeResult<TMessage extends ServiceMessage>` is a union type with two states.
|
|
53
|
-
|
|
54
|
-
| `type` | Fields | Description |
|
|
55
|
-
|--------|--------|-------------|
|
|
56
|
-
| `"complete"` | `uuid: string`, `message: TMessage` | All chunks received and message assembly complete |
|
|
57
|
-
| `"progress"` | `uuid: string`, `totalSize: number`, `completedSize: number` | Split message in progress (only some chunks have arrived) |
|
|
58
|
-
|
|
59
|
-
#### Usage Example
|
|
60
|
-
|
|
61
|
-
```typescript
|
|
62
|
-
import { createServiceProtocol } from "@simplysm/service-common";
|
|
63
|
-
import { Uuid } from "@simplysm/core-common";
|
|
64
|
-
|
|
65
|
-
const protocol = createServiceProtocol();
|
|
66
|
-
|
|
67
|
-
// Encoding: Convert message to binary chunks
|
|
68
|
-
const uuid = Uuid.new().toString();
|
|
69
|
-
const { chunks, totalSize } = protocol.encode(uuid, {
|
|
70
|
-
name: "TestService.echo",
|
|
71
|
-
body: ["Hello, world!"],
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// Decoding: Process received chunks one by one
|
|
75
|
-
for (const chunk of chunks) {
|
|
76
|
-
const result = protocol.decode(chunk);
|
|
77
|
-
if (result.type === "complete") {
|
|
78
|
-
console.log(result.message);
|
|
79
|
-
// { name: "TestService.echo", body: ["Hello, world!"] }
|
|
80
|
-
} else {
|
|
81
|
-
// Split message in progress
|
|
82
|
-
const progress = (result.completedSize / result.totalSize) * 100;
|
|
83
|
-
console.log(`Reception progress: ${progress.toFixed(1)}%`);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Clean up instance (release GC timer)
|
|
88
|
-
protocol.dispose();
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### PROTOCOL_CONFIG
|
|
92
|
-
|
|
93
|
-
A constant object that controls protocol behavior.
|
|
94
|
-
|
|
95
|
-
```typescript
|
|
96
|
-
import { PROTOCOL_CONFIG } from "@simplysm/service-common";
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
| Constant | Value | Description |
|
|
100
|
-
|----------|-------|-------------|
|
|
101
|
-
| `MAX_TOTAL_SIZE` | 100MB (104,857,600 bytes) | Maximum size for a single message. `ArgumentError` thrown if exceeded |
|
|
102
|
-
| `SPLIT_MESSAGE_SIZE` | 3MB (3,145,728 bytes) | Chunking threshold. Messages larger than this are automatically split |
|
|
103
|
-
| `CHUNK_SIZE` | 300KB (307,200 bytes) | Body size of each chunk when split |
|
|
104
|
-
| `GC_INTERVAL` | 10s (10,000ms) | Garbage collection cycle for incomplete messages |
|
|
105
|
-
| `EXPIRE_TIME` | 60s (60,000ms) | Expiration time for incomplete messages. Removed from memory if exceeded |
|
|
106
|
-
|
|
107
|
-
### Message Types
|
|
108
|
-
|
|
109
|
-
Type definitions for messages exchanged between client and server. `ServiceMessage` is a union of all message types.
|
|
110
|
-
|
|
111
|
-
#### Classification by Message Direction
|
|
112
|
-
|
|
113
|
-
| Union Type | Direction | Included Messages |
|
|
114
|
-
|------------|-----------|-------------------|
|
|
115
|
-
| `ServiceClientMessage` | Client -> Server | Request, Auth, event-related messages |
|
|
116
|
-
| `ServiceServerMessage` | Server -> Client | Reload, Response, Error, Event |
|
|
117
|
-
| `ServiceServerRawMessage` | Server -> Client (raw) | Progress + `ServiceServerMessage` |
|
|
118
|
-
| `ServiceMessage` | Bidirectional (all) | Union of all message types |
|
|
119
|
-
|
|
120
|
-
#### Individual Message Types
|
|
121
|
-
|
|
122
|
-
##### System Messages
|
|
123
|
-
|
|
124
|
-
| Type | `name` | Direction | `body` Type | Description |
|
|
125
|
-
|------|--------|-----------|-------------|-------------|
|
|
126
|
-
| `ServiceReloadMessage` | `"reload"` | Server -> Client | `{ clientName: string \| undefined; changedFileSet: Set<string> }` | Client reload command |
|
|
127
|
-
| `ServiceProgressMessage` | `"progress"` | Server -> Client | `{ totalSize: number; completedSize: number }` | Split message reception progress |
|
|
128
|
-
| `ServiceErrorMessage` | `"error"` | Server -> Client | `{ name: string; message: string; code: string; stack?: string; detail?: unknown; cause?: unknown }` | Error notification |
|
|
129
|
-
| `ServiceAuthMessage` | `"auth"` | Client -> Server | `string` (token) | Authentication token transmission |
|
|
130
|
-
|
|
131
|
-
##### Service Method Call Messages
|
|
132
|
-
|
|
133
|
-
| Type | `name` | Direction | `body` Type | Description |
|
|
134
|
-
|------|--------|-----------|-------------|-------------|
|
|
135
|
-
| `ServiceRequestMessage` | `` `${string}.${string}` `` | Client -> Server | `unknown[]` (parameter array) | RPC method call request |
|
|
136
|
-
| `ServiceResponseMessage` | `"response"` | Server -> Client | `unknown \| undefined` (optional return value) | Method call response |
|
|
137
|
-
|
|
138
|
-
##### Event Messages
|
|
139
|
-
|
|
140
|
-
| Type | `name` | Direction | `body` Type | Description |
|
|
141
|
-
|------|--------|-----------|-------------|-------------|
|
|
142
|
-
| `ServiceAddEventListenerMessage` | `"evt:add"` | Client -> Server | `{ key: string; name: string; info: unknown }` | Event listener registration |
|
|
143
|
-
| `ServiceRemoveEventListenerMessage` | `"evt:remove"` | Client -> Server | `{ key: string }` | Event listener removal |
|
|
144
|
-
| `ServiceGetEventListenerInfosMessage` | `"evt:gets"` | Client -> Server | `{ name: string }` | Event listener info list query |
|
|
145
|
-
| `ServiceEmitEventMessage` | `"evt:emit"` | Client -> Server | `{ keys: string[]; data: unknown }` | Event emission |
|
|
146
|
-
| `ServiceEventMessage` | `"evt:on"` | Server -> Client | `{ keys: string[]; data: unknown }` | Event notification |
|
|
147
|
-
|
|
148
|
-
## defineEvent / ServiceEventDef
|
|
149
|
-
|
|
150
|
-
A function for defining type-safe service events. Events are used to publish real-time notifications from server to client.
|
|
151
|
-
|
|
152
|
-
### API
|
|
153
|
-
|
|
154
|
-
```typescript
|
|
155
|
-
function defineEvent<TInfo = unknown, TData = unknown>(
|
|
156
|
-
eventName: string,
|
|
157
|
-
): ServiceEventDef<TInfo, TData>
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Type Parameters
|
|
161
|
-
|
|
162
|
-
| Parameter | Description |
|
|
163
|
-
|-----------|-------------|
|
|
164
|
-
| `TInfo` | Additional information type for listener filtering |
|
|
165
|
-
| `TData` | Data type passed when the event is emitted |
|
|
166
|
-
|
|
167
|
-
### ServiceEventDef Properties
|
|
168
|
-
|
|
169
|
-
| Property | Type | Description |
|
|
170
|
-
|----------|------|-------------|
|
|
171
|
-
| `eventName` | `string` | Unique event identifier |
|
|
172
|
-
| `$info` | `readonly TInfo` | For TypeScript type extraction only. Not used at runtime |
|
|
173
|
-
| `$data` | `readonly TData` | For TypeScript type extraction only. Not used at runtime |
|
|
174
|
-
|
|
175
|
-
### Usage Example
|
|
176
|
-
|
|
177
|
-
```typescript
|
|
178
|
-
import { defineEvent } from "@simplysm/service-common";
|
|
179
|
-
|
|
180
|
-
// Custom event definition
|
|
181
|
-
export const DataChangeEvent = defineEvent<
|
|
182
|
-
{ tableName: string; filter: unknown },
|
|
183
|
-
(string | number)[] | undefined
|
|
184
|
-
>("DataChangeEvent");
|
|
185
|
-
|
|
186
|
-
// Register listener on client (using service-client)
|
|
187
|
-
await client.addEventListener(
|
|
188
|
-
DataChangeEvent,
|
|
189
|
-
{ tableName: "User", filter: null },
|
|
190
|
-
(data) => {
|
|
191
|
-
console.log("Changed records:", data);
|
|
192
|
-
},
|
|
193
|
-
);
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## ServiceUploadResult
|
|
197
|
-
|
|
198
|
-
An interface representing file upload results.
|
|
199
|
-
|
|
200
|
-
```typescript
|
|
201
|
-
import { ServiceUploadResult } from "@simplysm/service-common";
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
| Field | Type | Description |
|
|
205
|
-
|-------|------|-------------|
|
|
206
|
-
| `path` | `string` | Storage path on the server |
|
|
207
|
-
| `filename` | `string` | Original filename |
|
|
208
|
-
| `size` | `number` | File size (bytes) |
|
|
209
|
-
|
|
210
|
-
## Service Interfaces
|
|
211
|
-
|
|
212
|
-
Service interface definitions that are implemented on the server side and called by the client via RPC.
|
|
213
|
-
|
|
214
|
-
### OrmService
|
|
215
|
-
|
|
216
|
-
Defines database connection, transaction management, and query execution capabilities. Supports MySQL, MSSQL, and PostgreSQL.
|
|
217
|
-
|
|
218
|
-
```typescript
|
|
219
|
-
import type { OrmService } from "@simplysm/service-common";
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
| Method | Parameters | Return Type | Description |
|
|
223
|
-
|--------|------------|-------------|-------------|
|
|
224
|
-
| `getInfo` | `opt: DbConnOptions & { configName: string }` | `Promise<{ dialect: Dialect; database?: string; schema?: string }>` | Query DB connection info |
|
|
225
|
-
| `connect` | `opt: Record<string, unknown>` | `Promise<number>` | Create DB connection, return connection ID |
|
|
226
|
-
| `close` | `connId: number` | `Promise<void>` | Close DB connection |
|
|
227
|
-
| `beginTransaction` | `connId: number, isolationLevel?: IsolationLevel` | `Promise<void>` | Begin transaction |
|
|
228
|
-
| `commitTransaction` | `connId: number` | `Promise<void>` | Commit transaction |
|
|
229
|
-
| `rollbackTransaction` | `connId: number` | `Promise<void>` | Rollback transaction |
|
|
230
|
-
| `executeParametrized` | `connId: number, query: string, params?: unknown[]` | `Promise<unknown[][]>` | Execute a parameterized query |
|
|
231
|
-
| `executeDefs` | `connId: number, defs: QueryDef[], options?: (ResultMeta \| undefined)[]` | `Promise<unknown[][]>` | Execute queries defined as `QueryDef` array |
|
|
232
|
-
| `bulkInsert` | `connId: number, tableName: string, columnDefs: Record<string, ColumnMeta>, records: Record<string, unknown>[]` | `Promise<void>` | Bulk data insertion |
|
|
233
|
-
|
|
234
|
-
#### DbConnOptions
|
|
235
|
-
|
|
236
|
-
```typescript
|
|
237
|
-
import type { DbConnOptions } from "@simplysm/service-common";
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
| Field | Type | Description |
|
|
241
|
-
|-------|------|-------------|
|
|
242
|
-
| `configName?` | `string` | Config name to reference in server settings |
|
|
243
|
-
| `config?` | `Record<string, unknown>` | Directly passed connection config |
|
|
244
|
-
|
|
245
|
-
### AutoUpdateService
|
|
246
|
-
|
|
247
|
-
Defines a service for querying the latest version information of a client application.
|
|
248
|
-
|
|
249
|
-
```typescript
|
|
250
|
-
import type { AutoUpdateService } from "@simplysm/service-common";
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
| Method | Parameters | Return Type | Description |
|
|
254
|
-
|--------|------------|-------------|-------------|
|
|
255
|
-
| `getLastVersion` | `platform: string` | `Promise<{ version: string; downloadPath: string } \| undefined>` | Query latest version info for the specified platform. Returns `undefined` if none exists |
|
|
256
|
-
|
|
257
|
-
Pass values like `"win32"`, `"darwin"`, or `"linux"` to `platform`.
|
|
258
|
-
|
|
259
|
-
## Caveats
|
|
260
|
-
|
|
261
|
-
- `ServiceProtocol` instances are created via the `createServiceProtocol()` factory function and internally use `LazyGcMap` to manage incomplete split messages. After use, you must call `dispose()` to release the GC timer.
|
|
262
|
-
- Encoding or decoding messages exceeding `PROTOCOL_CONFIG.MAX_TOTAL_SIZE` (100MB) will throw an `ArgumentError`.
|
|
263
|
-
- Passing binary data less than 28 bytes to `decode()` will throw an `ArgumentError`.
|
|
264
|
-
- `ServiceResponseMessage.body` is optional (`body?: unknown`) — the server may return `undefined` for void methods.
|
|
265
|
-
- Service interfaces (`OrmService`, `AutoUpdateService`) only provide type definitions. Actual implementations are handled by the `@simplysm/service-server` package.
|
|
266
|
-
- The `$info` and `$data` properties of `ServiceEventDef` are typed as `readonly` and are set to `undefined as unknown as TInfo/TData` at runtime. They exist only for TypeScript type extraction and must not be used at runtime.
|
|
33
|
+
| Source | Exports | Description | Test |
|
|
34
|
+
|--------|---------|-------------|------|
|
|
35
|
+
| `src/define-event.ts` | `ServiceEventDef`, `defineEvent` | Helper to define typed service events with info and data shapes | `define-event.spec.ts` |
|
|
267
36
|
|
|
268
37
|
## License
|
|
269
38
|
|
|
@@ -2,39 +2,39 @@ import type { Bytes } from "@simplysm/core-common";
|
|
|
2
2
|
import "@simplysm/core-common";
|
|
3
3
|
import { type ServiceMessage } from "./protocol.types";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Service protocol interface
|
|
6
6
|
*
|
|
7
7
|
* Binary Protocol V2:
|
|
8
8
|
* - Header: 28 bytes (UUID 16 + TotalSize 8 + Index 4)
|
|
9
9
|
* - Body: JSON
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
10
|
+
* - Auto chunking: splits into 300KB chunks when exceeding 3MB
|
|
11
|
+
* - Max message size: 100MB
|
|
12
12
|
*/
|
|
13
13
|
export interface ServiceProtocol {
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Encode a message (auto-split if needed)
|
|
16
16
|
*/
|
|
17
17
|
encode(uuid: string, message: ServiceMessage): {
|
|
18
18
|
chunks: Bytes[];
|
|
19
19
|
totalSize: number;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Decode a message (auto-reassemble chunked packets)
|
|
23
23
|
*/
|
|
24
24
|
decode<T extends ServiceMessage>(bytes: Bytes): ServiceMessageDecodeResult<T>;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Dispose the protocol instance.
|
|
27
27
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* Releases the internal chunk accumulator's GC timer and frees memory.
|
|
29
|
+
* Must be called when the protocol instance is no longer needed.
|
|
30
30
|
*/
|
|
31
31
|
dispose(): void;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Message decode result type (union)
|
|
35
35
|
*
|
|
36
|
-
* - `type: "complete"`:
|
|
37
|
-
* - `type: "progress"`:
|
|
36
|
+
* - `type: "complete"`: all chunks received and message reassembly is complete
|
|
37
|
+
* - `type: "progress"`: chunked message in progress (only some chunks arrived)
|
|
38
38
|
*/
|
|
39
39
|
export type ServiceMessageDecodeResult<TMessage extends ServiceMessage> = {
|
|
40
40
|
type: "complete";
|
|
@@ -47,13 +47,13 @@ export type ServiceMessageDecodeResult<TMessage extends ServiceMessage> = {
|
|
|
47
47
|
completedSize: number;
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* Create a service protocol encoder/decoder
|
|
51
51
|
*
|
|
52
52
|
* Binary Protocol V2:
|
|
53
53
|
* - Header: 28 bytes (UUID 16 + TotalSize 8 + Index 4)
|
|
54
54
|
* - Body: JSON
|
|
55
|
-
* -
|
|
56
|
-
* -
|
|
55
|
+
* - Auto chunking: splits into 300KB chunks when exceeding 3MB
|
|
56
|
+
* - Max message size: 100MB
|
|
57
57
|
*/
|
|
58
58
|
export declare function createServiceProtocol(): ServiceProtocol;
|
|
59
59
|
//# sourceMappingURL=create-service-protocol.d.ts.map
|
|
@@ -32,7 +32,7 @@ function createServiceProtocol() {
|
|
|
32
32
|
const msgBytes = new TextEncoder().encode(msgJson);
|
|
33
33
|
const totalSize = msgBytes.length;
|
|
34
34
|
if (totalSize > PROTOCOL_CONFIG.MAX_TOTAL_SIZE) {
|
|
35
|
-
throw new ArgumentError("
|
|
35
|
+
throw new ArgumentError("Message size exceeds the limit.", {
|
|
36
36
|
totalSize,
|
|
37
37
|
maxSize: PROTOCOL_CONFIG.MAX_TOTAL_SIZE
|
|
38
38
|
});
|
|
@@ -54,7 +54,7 @@ function createServiceProtocol() {
|
|
|
54
54
|
},
|
|
55
55
|
decode(bytes) {
|
|
56
56
|
if (bytes.length < 28) {
|
|
57
|
-
throw new ArgumentError("
|
|
57
|
+
throw new ArgumentError("Buffer size is smaller than header size.", {
|
|
58
58
|
bufferSize: bytes.length,
|
|
59
59
|
minimumSize: 28
|
|
60
60
|
});
|
|
@@ -65,7 +65,7 @@ function createServiceProtocol() {
|
|
|
65
65
|
const totalSize = Number(headerView.getBigUint64(16, false));
|
|
66
66
|
const index = headerView.getUint32(24, false);
|
|
67
67
|
if (totalSize > PROTOCOL_CONFIG.MAX_TOTAL_SIZE) {
|
|
68
|
-
throw new ArgumentError("
|
|
68
|
+
throw new ArgumentError("Message size exceeds the limit.", {
|
|
69
69
|
totalSize,
|
|
70
70
|
maxSize: PROTOCOL_CONFIG.MAX_TOTAL_SIZE
|
|
71
71
|
});
|
|
@@ -94,7 +94,7 @@ function createServiceProtocol() {
|
|
|
94
94
|
try {
|
|
95
95
|
messageArr = jsonParse(new TextDecoder().decode(resultBytes));
|
|
96
96
|
} catch (err) {
|
|
97
|
-
throw new ArgumentError("
|
|
97
|
+
throw new ArgumentError("Failed to decode message.", { uuid, cause: err });
|
|
98
98
|
}
|
|
99
99
|
return {
|
|
100
100
|
type: "complete",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/protocol/create-service-protocol.ts"],
|
|
4
|
-
"mappings": "AACA,OAAO;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAA4C;AAkD9C,SAAS,wBAAyC;AAKvD,QAAM,cAAc,IAAI,UAOtB;AAAA,IACA,YAAY,gBAAgB;AAAA,IAC5B,YAAY,gBAAgB;AAAA,EAC9B,CAAC;AAkBD,WAAS,YACP,QAKA,WACO;AACP,UAAM,cAAc,IAAI,WAAW,EAAE;AAGrC,UAAM,YAA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|
2
2
|
export declare const PROTOCOL_CONFIG: {
|
|
3
|
-
/**
|
|
3
|
+
/** Max message size (100MB) */
|
|
4
4
|
readonly MAX_TOTAL_SIZE: number;
|
|
5
|
-
/**
|
|
5
|
+
/** Chunking threshold (3MB) */
|
|
6
6
|
readonly SPLIT_MESSAGE_SIZE: number;
|
|
7
|
-
/**
|
|
7
|
+
/** Chunk size (300KB) */
|
|
8
8
|
readonly CHUNK_SIZE: number;
|
|
9
|
-
/** GC
|
|
9
|
+
/** GC interval (10s) */
|
|
10
10
|
readonly GC_INTERVAL: number;
|
|
11
|
-
/**
|
|
11
|
+
/** Incomplete message expiry time (60s) */
|
|
12
12
|
readonly EXPIRE_TIME: number;
|
|
13
13
|
};
|
|
14
14
|
export type ServiceMessage = ServiceReloadMessage | ServiceRequestMessage | ServiceAuthMessage | ServiceProgressMessage | ServiceResponseMessage | ServiceErrorMessage | ServiceAddEventListenerMessage | ServiceRemoveEventListenerMessage | ServiceGetEventListenerInfosMessage | ServiceEmitEventMessage | ServiceEventMessage;
|
|
15
15
|
export type ServiceServerMessage = ServiceReloadMessage | ServiceResponseMessage | ServiceErrorMessage | ServiceEventMessage;
|
|
16
16
|
export type ServiceServerRawMessage = ServiceProgressMessage | ServiceServerMessage;
|
|
17
17
|
export type ServiceClientMessage = ServiceRequestMessage | ServiceAuthMessage | ServiceAddEventListenerMessage | ServiceRemoveEventListenerMessage | ServiceGetEventListenerInfosMessage | ServiceEmitEventMessage;
|
|
18
|
-
/**
|
|
18
|
+
/** Server: reload command to client */
|
|
19
19
|
export interface ServiceReloadMessage {
|
|
20
20
|
name: "reload";
|
|
21
21
|
body: {
|
|
@@ -23,7 +23,7 @@ export interface ServiceReloadMessage {
|
|
|
23
23
|
changedFileSet: Set<string>;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
26
|
+
/** Server: progress notification for received chunked message */
|
|
27
27
|
export interface ServiceProgressMessage {
|
|
28
28
|
name: "progress";
|
|
29
29
|
body: {
|
|
@@ -31,7 +31,7 @@ export interface ServiceProgressMessage {
|
|
|
31
31
|
completedSize: number;
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
/**
|
|
34
|
+
/** Server: error notification */
|
|
35
35
|
export interface ServiceErrorMessage {
|
|
36
36
|
name: "error";
|
|
37
37
|
body: {
|
|
@@ -43,22 +43,22 @@ export interface ServiceErrorMessage {
|
|
|
43
43
|
cause?: unknown;
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
/**
|
|
46
|
+
/** Client: authentication message */
|
|
47
47
|
export interface ServiceAuthMessage {
|
|
48
48
|
name: "auth";
|
|
49
49
|
body: string;
|
|
50
50
|
}
|
|
51
|
-
/**
|
|
51
|
+
/** Client: service method request */
|
|
52
52
|
export interface ServiceRequestMessage {
|
|
53
53
|
name: `${string}.${string}`;
|
|
54
54
|
body: unknown[];
|
|
55
55
|
}
|
|
56
|
-
/**
|
|
56
|
+
/** Server: service method response */
|
|
57
57
|
export interface ServiceResponseMessage {
|
|
58
58
|
name: "response";
|
|
59
59
|
body?: unknown;
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
61
|
+
/** Client: add event listener */
|
|
62
62
|
export interface ServiceAddEventListenerMessage {
|
|
63
63
|
name: "evt:add";
|
|
64
64
|
body: {
|
|
@@ -67,21 +67,21 @@ export interface ServiceAddEventListenerMessage {
|
|
|
67
67
|
info: unknown;
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
/**
|
|
70
|
+
/** Client: remove event listener */
|
|
71
71
|
export interface ServiceRemoveEventListenerMessage {
|
|
72
72
|
name: "evt:remove";
|
|
73
73
|
body: {
|
|
74
74
|
key: string;
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
/**
|
|
77
|
+
/** Client: request event listener info list */
|
|
78
78
|
export interface ServiceGetEventListenerInfosMessage {
|
|
79
79
|
name: "evt:gets";
|
|
80
80
|
body: {
|
|
81
81
|
name: string;
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
/**
|
|
84
|
+
/** Client: emit event */
|
|
85
85
|
export interface ServiceEmitEventMessage {
|
|
86
86
|
name: "evt:emit";
|
|
87
87
|
body: {
|
|
@@ -89,7 +89,7 @@ export interface ServiceEmitEventMessage {
|
|
|
89
89
|
data: unknown;
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
/**
|
|
92
|
+
/** Server: event notification */
|
|
93
93
|
export interface ServiceEventMessage {
|
|
94
94
|
name: "evt:on";
|
|
95
95
|
body: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.types.d.ts","sourceRoot":"","sources":["..\\..\\src\\protocol\\protocol.types.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"protocol.types.d.ts","sourceRoot":"","sources":["..\\..\\src\\protocol\\protocol.types.ts"],"names":[],"mappings":"AAIA,qCAAqC;AACrC,eAAO,MAAM,eAAe;IAC1B,+BAA+B;;IAE/B,+BAA+B;;IAE/B,yBAAyB;;IAEzB,wBAAwB;;IAExB,2CAA2C;;CAEnC,CAAC;AAMX,MAAM,MAAM,cAAc,GACtB,oBAAoB,GACpB,qBAAqB,GACrB,kBAAkB,GAClB,sBAAsB,GACtB,sBAAsB,GACtB,mBAAmB,GACnB,8BAA8B,GAC9B,iCAAiC,GACjC,mCAAmC,GACnC,uBAAuB,GACvB,mBAAmB,CAAC;AAExB,MAAM,MAAM,oBAAoB,GAC5B,oBAAoB,GACpB,sBAAsB,GACtB,mBAAmB,GACnB,mBAAmB,CAAC;AAExB,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AAEpF,MAAM,MAAM,oBAAoB,GAC5B,qBAAqB,GACrB,kBAAkB,GAClB,8BAA8B,GAC9B,iCAAiC,GACjC,mCAAmC,GACnC,uBAAuB,CAAC;AAM5B,uCAAuC;AACvC,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE;QAC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AAC;KACb,CAAC;CACH;AAED,+CAA+C;AAC/C,MAAM,WAAW,mCAAmC;IAClD,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,yBAAyB;AACzB,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;CACH;AAED,iCAAiC;AACjC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;CACH"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const PROTOCOL_CONFIG = {
|
|
2
|
-
/**
|
|
2
|
+
/** Max message size (100MB) */
|
|
3
3
|
MAX_TOTAL_SIZE: 100 * 1024 * 1024,
|
|
4
|
-
/**
|
|
4
|
+
/** Chunking threshold (3MB) */
|
|
5
5
|
SPLIT_MESSAGE_SIZE: 3 * 1024 * 1024,
|
|
6
|
-
/**
|
|
6
|
+
/** Chunk size (300KB) */
|
|
7
7
|
CHUNK_SIZE: 300 * 1024,
|
|
8
|
-
/** GC
|
|
8
|
+
/** GC interval (10s) */
|
|
9
9
|
GC_INTERVAL: 10 * 1e3,
|
|
10
|
-
/**
|
|
10
|
+
/** Incomplete message expiry time (60s) */
|
|
11
11
|
EXPIRE_TIME: 60 * 1e3
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Auto-update service interface
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Retrieves the latest version info for client applications.
|
|
5
5
|
*/
|
|
6
6
|
export interface AutoUpdateService {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @param platform
|
|
10
|
-
* @returns
|
|
8
|
+
* Retrieve the latest version info for the specified platform.
|
|
9
|
+
* @param platform Target platform (e.g., "win32", "darwin", "linux")
|
|
10
|
+
* @returns Latest version info, or undefined if no version exists
|
|
11
11
|
*/
|
|
12
12
|
getLastVersion(platform: string): Promise<{
|
|
13
13
|
version: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Dialect, IsolationLevel, QueryDef, ColumnMeta, ResultMeta } from "@simplysm/orm-common";
|
|
2
2
|
/**
|
|
3
|
-
* ORM
|
|
3
|
+
* ORM service interface
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* MySQL, MSSQL, PostgreSQL
|
|
5
|
+
* Provides database connection, transaction management, and query execution.
|
|
6
|
+
* Supports MySQL, MSSQL, and PostgreSQL.
|
|
7
7
|
*/
|
|
8
8
|
export interface OrmService {
|
|
9
9
|
getInfo(opt: DbConnOptions & {
|
|
@@ -22,7 +22,7 @@ export interface OrmService {
|
|
|
22
22
|
executeDefs(connId: number, defs: QueryDef[], options?: (ResultMeta | undefined)[]): Promise<unknown[][]>;
|
|
23
23
|
bulkInsert(connId: number, tableName: string, columnDefs: Record<string, ColumnMeta>, records: Record<string, unknown>[]): Promise<void>;
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
25
|
+
/** Database connection options */
|
|
26
26
|
export type DbConnOptions = {
|
|
27
27
|
configName?: string;
|
|
28
28
|
config?: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orm-service.types.d.ts","sourceRoot":"","sources":["..\\..\\src\\service-types\\orm-service.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,QAAQ,EACR,UAAU,EACV,UAAU,EACX,MAAM,sBAAsB,CAAC;AAE9B;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,GAAG,EAAE,aAAa,GAAG;QAAE,UAAU,EA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,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AAED,kCAAkC;AAClC,MAAM,MAAM,aAAa,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* File upload result
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Contains information about a file uploaded to the server.
|
|
5
5
|
*/
|
|
6
6
|
export interface ServiceUploadResult {
|
|
7
|
-
/**
|
|
7
|
+
/** Storage path on the server */
|
|
8
8
|
path: string;
|
|
9
|
-
/**
|
|
9
|
+
/** Original filename */
|
|
10
10
|
filename: string;
|
|
11
|
-
/**
|
|
11
|
+
/** File size (bytes) */
|
|
12
12
|
size: number;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["..\\src\\types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["..\\src\\types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;CACd"}
|