@simplysm/service-common 13.0.100 → 14.0.4
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 +214 -92
- package/dist/define-event.d.ts +7 -7
- package/dist/define-event.d.ts.map +1 -1
- package/dist/define-event.js +21 -10
- package/dist/define-event.js.map +1 -6
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -6
- package/dist/protocol/create-service-protocol.d.ts +20 -20
- package/dist/protocol/create-service-protocol.d.ts.map +1 -1
- package/dist/protocol/create-service-protocol.js +150 -112
- package/dist/protocol/create-service-protocol.js.map +1 -6
- package/dist/protocol/protocol.types.d.ts +18 -26
- package/dist/protocol/protocol.types.d.ts.map +1 -1
- package/dist/protocol/protocol.types.js +16 -15
- package/dist/protocol/protocol.types.js.map +1 -6
- package/dist/service-types/auto-update-service.types.d.ts +5 -5
- package/dist/service-types/auto-update-service.types.js +2 -1
- package/dist/service-types/auto-update-service.types.js.map +1 -6
- package/dist/service-types/orm-service.types.d.ts +7 -5
- package/dist/service-types/orm-service.types.d.ts.map +1 -1
- package/dist/service-types/orm-service.types.js +2 -1
- package/dist/service-types/orm-service.types.js.map +1 -6
- package/dist/types.d.ts +5 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -1
- package/dist/types.js.map +1 -6
- package/package.json +9 -8
- package/src/define-event.ts +7 -7
- package/src/index.ts +4 -6
- package/src/protocol/create-service-protocol.ts +48 -40
- package/src/protocol/protocol.types.ts +35 -46
- package/src/service-types/auto-update-service.types.ts +5 -5
- package/src/service-types/orm-service.types.ts +5 -5
- package/src/types.ts +5 -5
- package/dist/service-types/smtp-client-service.types.d.ts +0 -38
- package/dist/service-types/smtp-client-service.types.d.ts.map +0 -1
- package/dist/service-types/smtp-client-service.types.js +0 -1
- package/dist/service-types/smtp-client-service.types.js.map +0 -6
- package/docs/events.md +0 -51
- package/docs/protocol.md +0 -252
- package/docs/service-types.md +0 -162
- package/src/service-types/smtp-client-service.types.ts +0 -41
- package/tests/define-event.spec.ts +0 -11
- package/tests/protocol/service-protocol.spec.ts +0 -251
|
@@ -1,116 +1,154 @@
|
|
|
1
1
|
import "@simplysm/core-common";
|
|
2
|
-
import {
|
|
3
|
-
ArgumentError,
|
|
4
|
-
bytes as bytesU,
|
|
5
|
-
json,
|
|
6
|
-
LazyGcMap,
|
|
7
|
-
Uuid
|
|
8
|
-
} from "@simplysm/core-common";
|
|
2
|
+
import { ArgumentError, bytes as bytesU, json, LazyGcMap, Uuid, } from "@simplysm/core-common";
|
|
9
3
|
import { PROTOCOL_CONFIG } from "./protocol.types.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
decode(bytes) {
|
|
55
|
-
if (bytes.length < 28) {
|
|
56
|
-
throw new ArgumentError("Buffer size is smaller than header size.", {
|
|
57
|
-
bufferSize: bytes.length,
|
|
58
|
-
minimumSize: 28
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
const uuidBytes = bytes.subarray(0, 16);
|
|
62
|
-
const uuid = Uuid.fromBytes(uuidBytes).toString();
|
|
63
|
-
const headerView = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
64
|
-
const totalSize = Number(headerView.getBigUint64(16, false));
|
|
65
|
-
const index = headerView.getUint32(24, false);
|
|
66
|
-
if (totalSize > PROTOCOL_CONFIG.MAX_TOTAL_SIZE) {
|
|
67
|
-
throw new ArgumentError("Message size exceeds the limit.", {
|
|
68
|
-
totalSize,
|
|
69
|
-
maxSize: PROTOCOL_CONFIG.MAX_TOTAL_SIZE
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
const bodyBytes = bytes.subarray(28);
|
|
73
|
-
const accItem = accumulator.getOrCreate(uuid, () => ({
|
|
74
|
-
totalSize,
|
|
75
|
-
completedSize: 0,
|
|
76
|
-
chunks: []
|
|
77
|
-
}));
|
|
78
|
-
if (accItem.chunks[index] == null) {
|
|
79
|
-
accItem.chunks[index] = bodyBytes;
|
|
80
|
-
accItem.completedSize += bodyBytes.length;
|
|
81
|
-
}
|
|
82
|
-
if (accItem.completedSize < accItem.totalSize) {
|
|
83
|
-
return {
|
|
84
|
-
type: "progress",
|
|
85
|
-
uuid,
|
|
86
|
-
totalSize,
|
|
87
|
-
completedSize: accItem.completedSize
|
|
88
|
-
};
|
|
89
|
-
} else {
|
|
90
|
-
accumulator.delete(uuid);
|
|
91
|
-
const resultBytes = bytesU.concat(accItem.chunks.filterExists());
|
|
92
|
-
let messageArr;
|
|
93
|
-
try {
|
|
94
|
-
messageArr = json.parse(new TextDecoder().decode(resultBytes));
|
|
95
|
-
} catch (err) {
|
|
96
|
-
throw new ArgumentError("Failed to decode message.", { uuid, cause: err });
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
type: "complete",
|
|
100
|
-
uuid,
|
|
101
|
-
message: {
|
|
102
|
-
name: messageArr[0],
|
|
103
|
-
body: messageArr[1]
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
dispose() {
|
|
109
|
-
accumulator.dispose();
|
|
4
|
+
/**
|
|
5
|
+
* 서비스 프로토콜 인코더/디코더를 생성한다
|
|
6
|
+
*
|
|
7
|
+
* 바이너리 프로토콜 V2:
|
|
8
|
+
* - 헤더: 28바이트 (UUID 16 + TotalSize 8 + Index 4)
|
|
9
|
+
* - 본문: JSON
|
|
10
|
+
* - 자동 청킹: 3MB 초과 시 300KB 청크로 분할
|
|
11
|
+
* - 최대 메시지 크기: 100MB
|
|
12
|
+
*/
|
|
13
|
+
export function createServiceProtocol() {
|
|
14
|
+
// -------------------------------------------------------------------
|
|
15
|
+
// 상태
|
|
16
|
+
// -------------------------------------------------------------------
|
|
17
|
+
const accumulator = new LazyGcMap({
|
|
18
|
+
gcInterval: PROTOCOL_CONFIG.GC_INTERVAL,
|
|
19
|
+
expireTime: PROTOCOL_CONFIG.EXPIRE_TIME,
|
|
20
|
+
});
|
|
21
|
+
// -------------------------------------------------------------------
|
|
22
|
+
// 인코딩 헬퍼
|
|
23
|
+
// -------------------------------------------------------------------
|
|
24
|
+
/**
|
|
25
|
+
* 메시지 청크를 인코딩한다 (헤더 + 본문)
|
|
26
|
+
*
|
|
27
|
+
* 헤더 구조 (28바이트, Big Endian):
|
|
28
|
+
* ```
|
|
29
|
+
* Offset Size Field
|
|
30
|
+
* ------ ---- -----
|
|
31
|
+
* 0 16 UUID (바이너리)
|
|
32
|
+
* 16 8 TotalSize (uint64)
|
|
33
|
+
* 24 4 Index (uint32)
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
function encodeChunk(header, bodyBytes) {
|
|
37
|
+
const headerBytes = new Uint8Array(28);
|
|
38
|
+
// UUID (0-15)
|
|
39
|
+
const uuidBytes = new Uuid(header.uuid).toBytes();
|
|
40
|
+
headerBytes.set(uuidBytes, 0);
|
|
41
|
+
// TotalSize (16-23), Index (24-27)
|
|
42
|
+
const headerView = new DataView(headerBytes.buffer, headerBytes.byteOffset, headerBytes.byteLength);
|
|
43
|
+
headerView.setUint32(16, 0, false); // 상위 4바이트 = 0 (MAX_TOTAL_SIZE < 2^32)
|
|
44
|
+
headerView.setUint32(20, header.totalSize, false); // 하위 4바이트 = totalSize
|
|
45
|
+
headerView.setUint32(24, header.index, false);
|
|
46
|
+
return bytesU.concat([headerBytes, ...(bodyBytes ? [bodyBytes] : [])]);
|
|
110
47
|
}
|
|
111
|
-
|
|
48
|
+
// -------------------------------------------------------------------
|
|
49
|
+
// 공개 API
|
|
50
|
+
// -------------------------------------------------------------------
|
|
51
|
+
return {
|
|
52
|
+
encode(uuid, message) {
|
|
53
|
+
const msgJson = json.stringify([message.name, ...("body" in message ? [message.body] : [])]);
|
|
54
|
+
const msgBytes = new TextEncoder().encode(msgJson);
|
|
55
|
+
const totalSize = msgBytes.length;
|
|
56
|
+
// 전체 크기 제한 확인 (우선 수행)
|
|
57
|
+
if (totalSize > PROTOCOL_CONFIG.MAX_TOTAL_SIZE) {
|
|
58
|
+
throw new ArgumentError("메시지 크기가 제한을 초과했습니다.", {
|
|
59
|
+
totalSize,
|
|
60
|
+
maxSize: PROTOCOL_CONFIG.MAX_TOTAL_SIZE,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// 충분히 작으면 그대로 반환
|
|
64
|
+
if (totalSize <= PROTOCOL_CONFIG.SPLIT_MESSAGE_SIZE) {
|
|
65
|
+
return { chunks: [encodeChunk({ uuid, totalSize, index: 0 }, msgBytes)], totalSize };
|
|
66
|
+
}
|
|
67
|
+
// 청크로 분할
|
|
68
|
+
const chunks = [];
|
|
69
|
+
let offset = 0;
|
|
70
|
+
let index = 0;
|
|
71
|
+
while (offset < totalSize) {
|
|
72
|
+
const chunkBodyBytes = msgBytes.subarray(offset, offset + PROTOCOL_CONFIG.CHUNK_SIZE);
|
|
73
|
+
const chunk = encodeChunk({ uuid, totalSize, index }, chunkBodyBytes);
|
|
74
|
+
chunks.push(chunk);
|
|
75
|
+
offset += PROTOCOL_CONFIG.CHUNK_SIZE;
|
|
76
|
+
index++;
|
|
77
|
+
}
|
|
78
|
+
return { chunks, totalSize };
|
|
79
|
+
},
|
|
80
|
+
decode(bytes) {
|
|
81
|
+
if (bytes.length < 28) {
|
|
82
|
+
throw new ArgumentError("버퍼 크기가 헤더 크기보다 작습니다.", {
|
|
83
|
+
bufferSize: bytes.length,
|
|
84
|
+
minimumSize: 28,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
// 1. 헤더 읽기
|
|
88
|
+
// UUID
|
|
89
|
+
const uuidBytes = bytes.subarray(0, 16);
|
|
90
|
+
const uuid = Uuid.fromBytes(uuidBytes).toString();
|
|
91
|
+
// TOTAL_SIZE, INDEX
|
|
92
|
+
const headerView = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
93
|
+
const totalSize = headerView.getUint32(20, false); // 하위 4바이트만 읽기
|
|
94
|
+
const index = headerView.getUint32(24, false);
|
|
95
|
+
// 전체 크기 제한 확인 (우선 수행)
|
|
96
|
+
if (totalSize > PROTOCOL_CONFIG.MAX_TOTAL_SIZE) {
|
|
97
|
+
throw new ArgumentError("메시지 크기가 제한을 초과했습니다.", {
|
|
98
|
+
totalSize,
|
|
99
|
+
maxSize: PROTOCOL_CONFIG.MAX_TOTAL_SIZE,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
const bodyBytes = bytes.subarray(28);
|
|
103
|
+
const accItem = accumulator.getOrCreate(uuid, () => ({
|
|
104
|
+
totalSize,
|
|
105
|
+
completedSize: 0,
|
|
106
|
+
chunks: [],
|
|
107
|
+
}));
|
|
108
|
+
if (accItem.chunks[index] == null) {
|
|
109
|
+
// 중복 패킷 방어
|
|
110
|
+
accItem.chunks[index] = bodyBytes;
|
|
111
|
+
accItem.completedSize += bodyBytes.length;
|
|
112
|
+
}
|
|
113
|
+
if (accItem.completedSize < accItem.totalSize) {
|
|
114
|
+
return {
|
|
115
|
+
type: "progress",
|
|
116
|
+
uuid: uuid,
|
|
117
|
+
totalSize: totalSize,
|
|
118
|
+
completedSize: accItem.completedSize,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
else if (accItem.completedSize === accItem.totalSize) {
|
|
122
|
+
accumulator.delete(uuid); // 메모리 해제
|
|
123
|
+
const resultBytes = bytesU.concat(accItem.chunks.filterExists());
|
|
124
|
+
let messageArr;
|
|
125
|
+
try {
|
|
126
|
+
messageArr = json.parse(new TextDecoder().decode(resultBytes));
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
throw new ArgumentError("메시지 디코딩에 실패했습니다.", { uuid, cause: err });
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
type: "complete",
|
|
133
|
+
uuid: uuid,
|
|
134
|
+
message: {
|
|
135
|
+
name: messageArr[0],
|
|
136
|
+
body: messageArr[1],
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
accumulator.delete(uuid);
|
|
142
|
+
throw new ArgumentError("프로토콜 무결성 위반: completedSize가 totalSize를 초과했습니다.", {
|
|
143
|
+
uuid,
|
|
144
|
+
completedSize: accItem.completedSize,
|
|
145
|
+
totalSize: accItem.totalSize,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
dispose() {
|
|
150
|
+
accumulator.dispose();
|
|
151
|
+
},
|
|
152
|
+
};
|
|
112
153
|
}
|
|
113
|
-
|
|
114
|
-
createServiceProtocol
|
|
115
|
-
};
|
|
116
|
-
//# sourceMappingURL=create-service-protocol.js.map
|
|
154
|
+
//# sourceMappingURL=create-service-protocol.js.map
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/protocol/create-service-protocol.ts"],
|
|
4
|
-
"mappings": "AACA,OAAO;AACP;AAAA,EACE;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAA4C;AAkD9C,SAAS,wBAAyC;AAKvD,QAAM,cAAc,IAAI,UAOtB;AAA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C;AAAA,QAClF,SAAS,KAAK;AACZ,gBAAM,IAAI,cAAc,6BAA6B,EAAE,MAAM,OAAO,IAAI,CAAC;AAAA,QAC3E;AACA,eAAO;AAAA,UACL,MAAM;AAAA,UACN;AAAA,UACA,SAAS;AAAA,YACP,MAAM,WAAW,CAAC;AAAA,YAClB,MAAM,WAAW,CAAC;AAAA,UACpB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IAEA,UAAgB;AACd,kBAAY,QAAQ;AAAA,IACtB;AAAA,EACF;AACF;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"file":"create-service-protocol.js","sourceRoot":"","sources":["..\\..\\src\\protocol\\create-service-protocol.ts"],"names":[],"mappings":"AACA,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,KAAK,IAAI,MAAM,EACf,IAAI,EACJ,SAAS,EACT,IAAI,GACL,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAuB,MAAM,kBAAkB,CAAC;AAyCxE;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB;IACnC,sEAAsE;IACtE,KAAK;IACL,sEAAsE;IAEtE,MAAM,WAAW,GAAG,IAAI,SAAS,CAO/B;QACA,UAAU,EAAE,eAAe,CAAC,WAAW;QACvC,UAAU,EAAE,eAAe,CAAC,WAAW;KACxC,CAAC,CAAC;IAEH,sEAAsE;IACtE,SAAS;IACT,sEAAsE;IAEtE;;;;;;;;;;;OAWG;IACH,SAAS,WAAW,CAClB,MAIC,EACD,SAAiB;QAEjB,MAAM,WAAW,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;QAEvC,cAAc;QACd,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAClD,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QAE9B,mCAAmC;QACnC,MAAM,UAAU,GAA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,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;gBACjE,IAAI,UAA6B,CAAC;gBAClC,IAAI,CAAC;oBACH,UAAU,GAAG,IAAI,CAAC,KAAK,CAAoB,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;gBACpF,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,MAAM,IAAI,aAAa,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;gBACpE,CAAC;gBACD,OAAO;oBACL,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,IAAI;oBACV,OAAO,EAAE;wBACP,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;wBACnB,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;qBACf;iBACP,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACzB,MAAM,IAAI,aAAa,CAAC,gDAAgD,EAAE;oBACxE,IAAI;oBACJ,aAAa,EAAE,OAAO,CAAC,aAAa;oBACpC,SAAS,EAAE,OAAO,CAAC,SAAS;iBAC7B,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO;YACL,WAAW,CAAC,OAAO,EAAE,CAAC;QACxB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,29 +1,21 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** 서비스 프로토콜 설정 */
|
|
2
2
|
export declare const PROTOCOL_CONFIG: {
|
|
3
|
-
/**
|
|
3
|
+
/** 최대 메시지 크기 (100MB) */
|
|
4
4
|
readonly MAX_TOTAL_SIZE: number;
|
|
5
|
-
/**
|
|
5
|
+
/** 청킹 임계값 (3MB) */
|
|
6
6
|
readonly SPLIT_MESSAGE_SIZE: number;
|
|
7
|
-
/**
|
|
7
|
+
/** 청크 크기 (300KB) */
|
|
8
8
|
readonly CHUNK_SIZE: number;
|
|
9
|
-
/** GC
|
|
9
|
+
/** GC 주기 (10초) */
|
|
10
10
|
readonly GC_INTERVAL: number;
|
|
11
|
-
/**
|
|
11
|
+
/** 미완성 메시지 만료 시간 (60초) */
|
|
12
12
|
readonly EXPIRE_TIME: number;
|
|
13
13
|
};
|
|
14
|
-
export type ServiceMessage =
|
|
15
|
-
export type ServiceServerMessage =
|
|
14
|
+
export type ServiceMessage = ServiceRequestMessage | ServiceAuthMessage | ServiceProgressMessage | ServiceResponseMessage | ServiceErrorMessage | ServiceAddEventListenerMessage | ServiceRemoveEventListenerMessage | ServiceGetEventListenerInfosMessage | ServiceEmitEventMessage | ServiceEventMessage;
|
|
15
|
+
export type ServiceServerMessage = ServiceResponseMessage | ServiceErrorMessage | ServiceEventMessage;
|
|
16
16
|
export type ServiceServerRawMessage = ServiceProgressMessage | ServiceServerMessage;
|
|
17
17
|
export type ServiceClientMessage = ServiceRequestMessage | ServiceAuthMessage | ServiceAddEventListenerMessage | ServiceRemoveEventListenerMessage | ServiceGetEventListenerInfosMessage | ServiceEmitEventMessage;
|
|
18
|
-
/**
|
|
19
|
-
export interface ServiceReloadMessage {
|
|
20
|
-
name: "reload";
|
|
21
|
-
body: {
|
|
22
|
-
clientName: string | undefined;
|
|
23
|
-
changedFileSet: Set<string>;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/** Server: progress notification for received chunked message */
|
|
18
|
+
/** 서버: 수신된 청크 메시지의 진행 상태 알림 */
|
|
27
19
|
export interface ServiceProgressMessage {
|
|
28
20
|
name: "progress";
|
|
29
21
|
body: {
|
|
@@ -31,7 +23,7 @@ export interface ServiceProgressMessage {
|
|
|
31
23
|
completedSize: number;
|
|
32
24
|
};
|
|
33
25
|
}
|
|
34
|
-
/**
|
|
26
|
+
/** 서버: 에러 알림 */
|
|
35
27
|
export interface ServiceErrorMessage {
|
|
36
28
|
name: "error";
|
|
37
29
|
body: {
|
|
@@ -43,22 +35,22 @@ export interface ServiceErrorMessage {
|
|
|
43
35
|
cause?: unknown;
|
|
44
36
|
};
|
|
45
37
|
}
|
|
46
|
-
/**
|
|
38
|
+
/** 클라이언트: 인증 메시지 */
|
|
47
39
|
export interface ServiceAuthMessage {
|
|
48
40
|
name: "auth";
|
|
49
41
|
body: string;
|
|
50
42
|
}
|
|
51
|
-
/**
|
|
43
|
+
/** 클라이언트: 서비스 메서드 요청 */
|
|
52
44
|
export interface ServiceRequestMessage {
|
|
53
45
|
name: `${string}.${string}`;
|
|
54
46
|
body: unknown[];
|
|
55
47
|
}
|
|
56
|
-
/**
|
|
48
|
+
/** 서버: 서비스 메서드 응답 */
|
|
57
49
|
export interface ServiceResponseMessage {
|
|
58
50
|
name: "response";
|
|
59
51
|
body?: unknown;
|
|
60
52
|
}
|
|
61
|
-
/**
|
|
53
|
+
/** 클라이언트: 이벤트 리스너 추가 */
|
|
62
54
|
export interface ServiceAddEventListenerMessage {
|
|
63
55
|
name: "evt:add";
|
|
64
56
|
body: {
|
|
@@ -67,21 +59,21 @@ export interface ServiceAddEventListenerMessage {
|
|
|
67
59
|
info: unknown;
|
|
68
60
|
};
|
|
69
61
|
}
|
|
70
|
-
/**
|
|
62
|
+
/** 클라이언트: 이벤트 리스너 제거 */
|
|
71
63
|
export interface ServiceRemoveEventListenerMessage {
|
|
72
64
|
name: "evt:remove";
|
|
73
65
|
body: {
|
|
74
66
|
key: string;
|
|
75
67
|
};
|
|
76
68
|
}
|
|
77
|
-
/**
|
|
69
|
+
/** 클라이언트: 이벤트 리스너 정보 목록 요청 */
|
|
78
70
|
export interface ServiceGetEventListenerInfosMessage {
|
|
79
71
|
name: "evt:gets";
|
|
80
72
|
body: {
|
|
81
73
|
name: string;
|
|
82
74
|
};
|
|
83
75
|
}
|
|
84
|
-
/**
|
|
76
|
+
/** 클라이언트: 이벤트 발생 */
|
|
85
77
|
export interface ServiceEmitEventMessage {
|
|
86
78
|
name: "evt:emit";
|
|
87
79
|
body: {
|
|
@@ -89,7 +81,7 @@ export interface ServiceEmitEventMessage {
|
|
|
89
81
|
data: unknown;
|
|
90
82
|
};
|
|
91
83
|
}
|
|
92
|
-
/**
|
|
84
|
+
/** 서버: 이벤트 알림 */
|
|
93
85
|
export interface ServiceEventMessage {
|
|
94
86
|
name: "evt:on";
|
|
95
87
|
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,kBAAkB;AAClB,eAAO,MAAM,eAAe;IAC1B,wBAAwB;;IAExB,mBAAmB;;IAEnB,oBAAoB;;IAEpB,kBAAkB;;IAElB,0BAA0B;;CAElB,CAAC;AAMX,MAAM,MAAM,cAAc,GACtB,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,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,+BAA+B;AAC/B,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,gBAAgB;AAChB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,IAA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AAW,mBAAmB;IAClC,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;CACH"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
// ----------------------------------------------------------------------
|
|
2
|
+
// 프로토콜 상수
|
|
3
|
+
// ----------------------------------------------------------------------
|
|
4
|
+
/** 서비스 프로토콜 설정 */
|
|
5
|
+
export const PROTOCOL_CONFIG = {
|
|
6
|
+
/** 최대 메시지 크기 (100MB) */
|
|
7
|
+
MAX_TOTAL_SIZE: 100 * 1024 * 1024,
|
|
8
|
+
/** 청킹 임계값 (3MB) */
|
|
9
|
+
SPLIT_MESSAGE_SIZE: 3 * 1024 * 1024,
|
|
10
|
+
/** 청크 크기 (300KB) */
|
|
11
|
+
CHUNK_SIZE: 300 * 1024,
|
|
12
|
+
/** GC 주기 (10초) */
|
|
13
|
+
GC_INTERVAL: 10 * 1000,
|
|
14
|
+
/** 미완성 메시지 만료 시간 (60초) */
|
|
15
|
+
EXPIRE_TIME: 60 * 1000,
|
|
12
16
|
};
|
|
13
|
-
|
|
14
|
-
PROTOCOL_CONFIG
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=protocol.types.js.map
|
|
17
|
+
//# sourceMappingURL=protocol.types.js.map
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/protocol/protocol.types.ts"],
|
|
4
|
-
"mappings": "AAKO,MAAM,kBAAkB;AAAA;AAAA,EAE7B,gBAAgB,MAAM,OAAO;AAAA;AAAA,EAE7B,oBAAoB,IAAI,OAAO;AAAA;AAAA,EAE/B,YAAY,MAAM;AAAA;AAAA,EAElB,aAAa,KAAK;AAAA;AAAA,EAElB,aAAa,KAAK;AACpB;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"file":"protocol.types.js","sourceRoot":"","sources":["..\\..\\src\\protocol\\protocol.types.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE,kBAAkB;AAClB,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,wBAAwB;IACxB,cAAc,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;IACjC,mBAAmB;IACnB,kBAAkB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACnC,oBAAoB;IACpB,UAAU,EAAE,GAAG,GAAG,IAAI;IACtB,kBAAkB;IAClB,WAAW,EAAE,EAAE,GAAG,IAAI;IACtB,0BAA0B;IAC1B,WAAW,EAAE,EAAE,GAAG,IAAI;CACd,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 자동 업데이트 서비스 인터페이스
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* 클라이언트 애플리케이션의 최신 버전 정보를 조회한다.
|
|
5
5
|
*/
|
|
6
6
|
export interface AutoUpdateService {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @param platform
|
|
10
|
-
* @returns
|
|
8
|
+
* 지정된 플랫폼의 최신 버전 정보를 조회한다.
|
|
9
|
+
* @param platform 대상 플랫폼 (예: "win32", "darwin", "linux")
|
|
10
|
+
* @returns 최신 버전 정보, 버전이 없으면 undefined
|
|
11
11
|
*/
|
|
12
12
|
getLastVersion(platform: string): Promise<{
|
|
13
13
|
version: string;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=auto-update-service.types.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Dialect, IsolationLevel, QueryDef, ColumnMeta, ResultMeta } from "@simplysm/orm-common";
|
|
2
2
|
/**
|
|
3
|
-
* ORM
|
|
3
|
+
* ORM 서비스 인터페이스
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* 데이터베이스 연결, 트랜잭션 관리, 쿼리 실행을 제공한다.
|
|
6
|
+
* MySQL, MSSQL, PostgreSQL을 지원한다.
|
|
7
7
|
*/
|
|
8
8
|
export interface OrmService {
|
|
9
9
|
getInfo(opt: DbConnOptions & {
|
|
@@ -13,7 +13,9 @@ export interface OrmService {
|
|
|
13
13
|
database?: string;
|
|
14
14
|
schema?: string;
|
|
15
15
|
}>;
|
|
16
|
-
connect(opt:
|
|
16
|
+
connect(opt: DbConnOptions & {
|
|
17
|
+
configName: string;
|
|
18
|
+
}): Promise<number>;
|
|
17
19
|
close(connId: number): Promise<void>;
|
|
18
20
|
beginTransaction(connId: number, isolationLevel?: IsolationLevel): Promise<void>;
|
|
19
21
|
commitTransaction(connId: number): Promise<void>;
|
|
@@ -22,7 +24,7 @@ export interface OrmService {
|
|
|
22
24
|
executeDefs(connId: number, defs: QueryDef[], options?: (ResultMeta | undefined)[]): Promise<unknown[][]>;
|
|
23
25
|
bulkInsert(connId: number, tableName: string, columnDefs: Record<string, ColumnMeta>, records: Record<string, unknown>[]): Promise<void>;
|
|
24
26
|
}
|
|
25
|
-
/**
|
|
27
|
+
/** 데이터베이스 연결 옵션 */
|
|
26
28
|
export type DbConnOptions = {
|
|
27
29
|
configName?: string;
|
|
28
30
|
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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,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAE7F,WAAW,CACT,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,EAAE,EAChB,OAAO,CAAC,EAAE,CAAC,UAAU,GAAG,SAAS,CAAC,EAAE,GACnC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAExB,UAAU,CACR,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AAED,mBAAmB;AACnB,MAAM,MAAM,aAAa,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=orm-service.types.js.map
|
package/dist/types.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 파일 업로드 결과
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* 서버에 업로드된 파일의 정보를 포함한다.
|
|
5
5
|
*/
|
|
6
6
|
export interface ServiceUploadResult {
|
|
7
|
-
/**
|
|
7
|
+
/** 서버 내 저장 경로 */
|
|
8
8
|
path: string;
|
|
9
|
-
/**
|
|
9
|
+
/** 원본 파일명 */
|
|
10
10
|
filename: string;
|
|
11
|
-
/**
|
|
11
|
+
/** 파일 크기 (바이트) */
|
|
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,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/dist/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/service-common",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"author": "
|
|
3
|
+
"version": "14.0.4",
|
|
4
|
+
"description": "심플리즘 패키지 - 서비스 (common)",
|
|
5
|
+
"author": "심플리즘",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -14,13 +14,14 @@
|
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
|
-
"
|
|
18
|
-
"src",
|
|
19
|
-
"tests"
|
|
17
|
+
"src"
|
|
20
18
|
],
|
|
21
19
|
"sideEffects": false,
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "^20.19.37"
|
|
22
|
+
},
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"@simplysm/core-common": "
|
|
24
|
-
"@simplysm/orm-common": "
|
|
24
|
+
"@simplysm/core-common": "14.0.4",
|
|
25
|
+
"@simplysm/orm-common": "14.0.4"
|
|
25
26
|
}
|
|
26
27
|
}
|