@readerseye2/cr_type 1.0.111 → 1.0.112
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/book/book-api.type.d.ts +15 -15
- package/dist/book/book-api.type.js +2 -2
- package/dist/book/book-log.type.d.ts +14 -14
- package/dist/book/book-log.type.js +2 -2
- package/dist/book/book.const.d.ts +274 -274
- package/dist/book/book.const.js +119 -119
- package/dist/book/legacy.book.type.d.ts +164 -164
- package/dist/book/legacy.book.type.js +41 -41
- package/dist/socket/index.d.ts +1 -1
- package/dist/socket/index.js +1 -1
- package/dist/socket/reading-section.types.d.ts +1 -127
- package/dist/socket/reading-section.types.js +1 -1
- package/dist/socket/socket-clientToServerEvents.type.d.ts +35 -27
- package/dist/socket/socket-serverToClientEvents.type.d.ts +70 -40
- package/dist/socket/socket-serverToClientEvents.type.js +0 -1
- package/dist/socket/unified-session.types.d.ts +300 -0
- package/dist/socket/unified-session.types.js +22 -0
- package/package.json +27 -27
package/dist/socket/index.js
CHANGED
|
@@ -21,4 +21,4 @@ __exportStar(require("./socket-serverToClientEvents.type"), exports);
|
|
|
21
21
|
__exportStar(require("./socket-message.types"), exports);
|
|
22
22
|
__exportStar(require("./reading-section.types"), exports);
|
|
23
23
|
__exportStar(require("./connected-user.types"), exports);
|
|
24
|
-
__exportStar(require("./
|
|
24
|
+
__exportStar(require("./unified-session.types"), exports);
|
|
@@ -26,19 +26,6 @@ export interface SessionStats {
|
|
|
26
26
|
scrollDistance?: number;
|
|
27
27
|
interactionCount?: number;
|
|
28
28
|
}
|
|
29
|
-
/** 섹션 읽기 시작 페이로드 */
|
|
30
|
-
export interface SessionStartPayload {
|
|
31
|
-
bookIdx: number;
|
|
32
|
-
sectionId: string;
|
|
33
|
-
snapshot: ViewerSnapshot;
|
|
34
|
-
meta?: SessionMeta;
|
|
35
|
-
}
|
|
36
|
-
/** 섹션 읽기 종료 페이로드 */
|
|
37
|
-
export interface SessionEndPayload {
|
|
38
|
-
durationMs?: number;
|
|
39
|
-
finalSnapshot?: ViewerSnapshot;
|
|
40
|
-
stats?: SessionStats;
|
|
41
|
-
}
|
|
42
29
|
/** 진행 상황 업데이트 페이로드 */
|
|
43
30
|
export interface SessionProgressPayload {
|
|
44
31
|
snapshot: ViewerSnapshot;
|
|
@@ -47,120 +34,7 @@ export interface SessionProgressPayload {
|
|
|
47
34
|
export interface SessionEventPayload {
|
|
48
35
|
events: ViewerEvent[];
|
|
49
36
|
}
|
|
50
|
-
/** 세션 구독 페이로드
|
|
37
|
+
/** 세션 구독 페이로드 */
|
|
51
38
|
export interface SessionSubscribePayload {
|
|
52
39
|
sessionId: string;
|
|
53
40
|
}
|
|
54
|
-
/** 읽기 세션 정보 (서버 응답) */
|
|
55
|
-
export interface ReadingSessionInfo {
|
|
56
|
-
sessionId: string;
|
|
57
|
-
userId: number;
|
|
58
|
-
userType: 'parent' | 'child';
|
|
59
|
-
userName?: string;
|
|
60
|
-
bookIdx: number;
|
|
61
|
-
bookTitle?: string;
|
|
62
|
-
sectionId: string;
|
|
63
|
-
sectionTitle?: string;
|
|
64
|
-
sectionOrder?: number;
|
|
65
|
-
totalSections?: number;
|
|
66
|
-
startedAt: string;
|
|
67
|
-
snapshot: ViewerSnapshot;
|
|
68
|
-
lastEventAt?: string;
|
|
69
|
-
}
|
|
70
|
-
/** 세션 시작 응답 */
|
|
71
|
-
export interface SessionStartedResponse {
|
|
72
|
-
session: ReadingSessionInfo;
|
|
73
|
-
}
|
|
74
|
-
/** 세션 종료 응답 */
|
|
75
|
-
export interface SessionEndedResponse {
|
|
76
|
-
sessionId: string;
|
|
77
|
-
durationMs?: number;
|
|
78
|
-
stats?: SessionStats;
|
|
79
|
-
}
|
|
80
|
-
/** 세션 진행 상황 응답 */
|
|
81
|
-
export interface SessionProgressResponse {
|
|
82
|
-
sessionId: string;
|
|
83
|
-
snapshot: ViewerSnapshot;
|
|
84
|
-
}
|
|
85
|
-
/** 세션 이벤트 응답 */
|
|
86
|
-
export interface SessionEventsResponse {
|
|
87
|
-
sessionId: string;
|
|
88
|
-
events: ViewerEvent[];
|
|
89
|
-
}
|
|
90
|
-
/** 세션 목록 응답 */
|
|
91
|
-
export interface SessionListResponse {
|
|
92
|
-
sessions: ReadingSessionInfo[];
|
|
93
|
-
}
|
|
94
|
-
/** 세션 구독 성공 응답 */
|
|
95
|
-
export interface SessionSubscribedResponse {
|
|
96
|
-
sessionId: string;
|
|
97
|
-
snapshot: ViewerSnapshot;
|
|
98
|
-
}
|
|
99
|
-
/** S3에 저장된 읽기 세션 청크 */
|
|
100
|
-
export interface ReadingSessionChunk {
|
|
101
|
-
chunkIndex: number;
|
|
102
|
-
startTimestamp: number;
|
|
103
|
-
endTimestamp: number;
|
|
104
|
-
snapshot: ViewerSnapshot | null;
|
|
105
|
-
events: ViewerEvent[];
|
|
106
|
-
}
|
|
107
|
-
/** S3에 저장된 읽기 세션 기록 */
|
|
108
|
-
export interface ReadingSessionRecord {
|
|
109
|
-
sessionId: string;
|
|
110
|
-
userId: number;
|
|
111
|
-
userType: 'parent' | 'child';
|
|
112
|
-
userName: string;
|
|
113
|
-
familyId: number;
|
|
114
|
-
bookIdx: number;
|
|
115
|
-
bookTitle: string;
|
|
116
|
-
sectionId: string;
|
|
117
|
-
sectionTitle: string;
|
|
118
|
-
startedAt: string;
|
|
119
|
-
endedAt: string;
|
|
120
|
-
durationMs: number;
|
|
121
|
-
initialSnapshot?: ViewerSnapshot;
|
|
122
|
-
finalSnapshot?: ViewerSnapshot;
|
|
123
|
-
stats?: SessionStats;
|
|
124
|
-
/** 세션 동안의 모든 이벤트 (단일파일 저장 - deprecated, 하위 호환용) */
|
|
125
|
-
events?: ViewerEvent[];
|
|
126
|
-
/** 청크 단위 이벤트 (재생용, get 시에만 포함) */
|
|
127
|
-
chunks?: ReadingSessionChunk[];
|
|
128
|
-
/** 총 이벤트 수 */
|
|
129
|
-
totalEvents?: number;
|
|
130
|
-
/** S3 key (목록 조회 시 제공) */
|
|
131
|
-
s3Key?: string;
|
|
132
|
-
}
|
|
133
|
-
/** 읽기 세션 기록 목록 조회 요청 (Admin → Server) */
|
|
134
|
-
export interface ReadingSessionsListPayload {
|
|
135
|
-
familyId?: number;
|
|
136
|
-
userId?: number;
|
|
137
|
-
date?: string;
|
|
138
|
-
limit?: number;
|
|
139
|
-
offset?: number;
|
|
140
|
-
}
|
|
141
|
-
/** 읽기 세션 기록 목록 조회 결과 (Server → Admin) */
|
|
142
|
-
export interface ReadingSessionsListResultPayload {
|
|
143
|
-
sessions: ReadingSessionRecord[];
|
|
144
|
-
total: number;
|
|
145
|
-
hasMore: boolean;
|
|
146
|
-
}
|
|
147
|
-
/** 읽기 세션 기록 상세 조회 요청 (Admin → Server) */
|
|
148
|
-
export interface ReadingSessionGetPayload {
|
|
149
|
-
sessionId: string;
|
|
150
|
-
/** S3 key (목록 조회 시 제공됨) */
|
|
151
|
-
s3Key?: string;
|
|
152
|
-
}
|
|
153
|
-
/** 읽기 세션 기록 상세 조회 결과 (Server → Admin) */
|
|
154
|
-
export interface ReadingSessionGetResultPayload {
|
|
155
|
-
session: ReadingSessionRecord;
|
|
156
|
-
}
|
|
157
|
-
/** 읽기 세션 기록 삭제 요청 (Admin → Server) */
|
|
158
|
-
export interface ReadingSessionDeletePayload {
|
|
159
|
-
sessionId: string;
|
|
160
|
-
s3Key?: string;
|
|
161
|
-
}
|
|
162
|
-
/** 읽기 세션 기록 삭제 결과 (Server → Admin) */
|
|
163
|
-
export interface ReadingSessionDeleteResultPayload {
|
|
164
|
-
sessionId: string;
|
|
165
|
-
success: boolean;
|
|
166
|
-
}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { ChatMessageReadRequest, ChatMessageRefreshRequest, MessageRequest } from "./socket-message.types";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { SessionProgressPayload, SessionEventPayload, SessionSubscribePayload } from "./reading-section.types";
|
|
3
|
+
import { ViewerOpenPayload, ViewerClosePayload, GazeDataPayload, SessionHistoryListPayload, SessionHistoryGetPayload, SessionHistoryDeletePayload, UnifiedChunksGetPayload, UnifiedSegmentGetPayload } from "./unified-session.types";
|
|
4
4
|
export interface ClientToServerEvents {
|
|
5
5
|
'chat-message:send': (msg: MessageRequest) => void;
|
|
6
6
|
'chat-message:refresh': (msg: ChatMessageRefreshRequest) => void;
|
|
7
7
|
'chat-message:read': (payload: ChatMessageReadRequest) => void;
|
|
8
|
-
|
|
9
|
-
'
|
|
10
|
-
|
|
11
|
-
'
|
|
8
|
+
/** 뷰어 열림 (세션 시작 또는 섹션 변경) */
|
|
9
|
+
'session:open': (payload: ViewerOpenPayload) => void;
|
|
10
|
+
/** 뷰어 닫힘 (세션 종료) */
|
|
11
|
+
'session:close': (payload: ViewerClosePayload) => void;
|
|
12
|
+
/** 진행 상황 (스냅샷 업데이트) */
|
|
13
|
+
'session:progress': (payload: SessionProgressPayload) => void;
|
|
14
|
+
/** 이벤트 배치 전송 */
|
|
15
|
+
'session:event': (payload: SessionEventPayload) => void;
|
|
16
|
+
/** 시선 데이터 전송 (~1초 간격) */
|
|
17
|
+
'session:gaze': (payload: GazeDataPayload) => void;
|
|
18
|
+
/** 세션 구독 (Parent가 자녀 세션 모니터링) */
|
|
19
|
+
'session:subscribe': (payload: SessionSubscribePayload) => void;
|
|
20
|
+
/** 세션 구독 해제 */
|
|
21
|
+
'session:unsubscribe': (payload: SessionSubscribePayload) => void;
|
|
12
22
|
}
|
|
13
23
|
export interface NoticeToServerEvents {
|
|
14
24
|
'notice-message:send': (msg: MessageRequest) => void;
|
|
@@ -17,26 +27,24 @@ export interface NoticeToServerEvents {
|
|
|
17
27
|
export interface UserAdminToServerEvents {
|
|
18
28
|
'user:list': () => void;
|
|
19
29
|
}
|
|
20
|
-
/**
|
|
21
|
-
export interface
|
|
22
|
-
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
/** 통합 세션 관리 이벤트 (Admin/Parent용) */
|
|
31
|
+
export interface SessionAdminToServerEvents {
|
|
32
|
+
/** 활성 세션 목록 조회 */
|
|
33
|
+
'session:list': () => void;
|
|
34
|
+
/** 세션 구독 (실시간 모니터링) */
|
|
35
|
+
'session:subscribe': (payload: SessionSubscribePayload) => void;
|
|
36
|
+
/** 세션 구독 해제 */
|
|
37
|
+
'session:unsubscribe': (payload: SessionSubscribePayload) => void;
|
|
38
|
+
/** 세션 이력 목록 조회 (S3) */
|
|
39
|
+
'session:list-history': (payload: SessionHistoryListPayload) => void;
|
|
40
|
+
/** 세션 이력 상세 조회 (S3) */
|
|
41
|
+
'session:get-history': (payload: SessionHistoryGetPayload) => void;
|
|
42
|
+
/** 세션 이력 삭제 (S3) */
|
|
43
|
+
'session:delete-history': (payload: SessionHistoryDeletePayload) => void;
|
|
44
|
+
/** 청크 조회 (seek/재생용) */
|
|
45
|
+
'session:get-chunks': (payload: UnifiedChunksGetPayload) => void;
|
|
46
|
+
/** 세그먼트 상세 조회 */
|
|
47
|
+
'session:get-segment': (payload: UnifiedSegmentGetPayload) => void;
|
|
31
48
|
}
|
|
32
|
-
|
|
33
|
-
export interface RecordingAdminToServerEvents {
|
|
34
|
-
'recording:start': (payload: RecordingStartPayload) => void;
|
|
35
|
-
'recording:stop': (payload: RecordingStopPayload) => void;
|
|
36
|
-
'recording:list': (payload: RecordingListPayload) => void;
|
|
37
|
-
'recording:get': (payload: RecordingGetPayload) => void;
|
|
38
|
-
'recording:get-segment': (payload: SegmentGetPayload) => void;
|
|
39
|
-
'recording:get-chunks': (payload: ChunksGetPayload) => void;
|
|
40
|
-
}
|
|
41
|
-
export interface AdminClientToServerEvents extends ClientToServerEvents, NoticeToServerEvents, UserAdminToServerEvents, ReadingAdminToServerEvents, RecordingAdminToServerEvents {
|
|
49
|
+
export interface AdminClientToServerEvents extends ClientToServerEvents, NoticeToServerEvents, UserAdminToServerEvents, SessionAdminToServerEvents {
|
|
42
50
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MessageReadResponse, MessageResponse, NoticeMessageResult } from "./socket-message.types";
|
|
2
|
-
import {
|
|
2
|
+
import { ViewerSnapshot } from "./reading-section.types";
|
|
3
3
|
import { ViewerEvent } from "./viewer-events.types";
|
|
4
4
|
import { ConnectedUser, ConnectedUsersGrouped } from "./connected-user.types";
|
|
5
|
-
import {
|
|
5
|
+
import { UnifiedSessionInfo, SessionSegmentChangedPayload, UnifiedChunkFile, SessionHistoryListResult, SessionHistoryGetResult, UnifiedChunksResult, UnifiedSegmentResult, SessionHistoryDeleteResult } from "./unified-session.types";
|
|
6
6
|
export interface ServerToClientEvents {
|
|
7
7
|
connect: () => void;
|
|
8
8
|
disconnect: () => void;
|
|
@@ -15,47 +15,93 @@ export interface ServerToClientEvents {
|
|
|
15
15
|
}) => void;
|
|
16
16
|
'chat-message:read-peer': (payload: MessageReadResponse) => void;
|
|
17
17
|
'chat-message:read-self': (payload: MessageReadResponse) => void;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/** 세션 시작됨 (서버 확인) */
|
|
19
|
+
'session:started': (payload: {
|
|
20
|
+
session: UnifiedSessionInfo;
|
|
20
21
|
}) => void;
|
|
21
|
-
|
|
22
|
+
/** 세션 종료됨 (서버 확인) */
|
|
23
|
+
'session:ended': (payload: {
|
|
22
24
|
sessionId: string;
|
|
25
|
+
durationMs?: number;
|
|
26
|
+
}) => void;
|
|
27
|
+
/** 구독 성공 (Parent가 자녀 세션 구독 시) */
|
|
28
|
+
'session:subscribed': (payload: {
|
|
29
|
+
sessionId: string;
|
|
30
|
+
snapshot: ViewerSnapshot | null;
|
|
31
|
+
}) => void;
|
|
32
|
+
/** 구독 중인 세션의 진행 상황 */
|
|
33
|
+
'session:progress': (payload: {
|
|
34
|
+
sessionId: string;
|
|
35
|
+
snapshot: ViewerSnapshot;
|
|
36
|
+
}) => void;
|
|
37
|
+
/** 구독 중인 세션의 이벤트 */
|
|
38
|
+
'session:events': (payload: {
|
|
39
|
+
sessionId: string;
|
|
40
|
+
events: ViewerEvent[];
|
|
41
|
+
}) => void;
|
|
42
|
+
/** 구독 중인 세션의 세그먼트 변경 (섹션 변경) */
|
|
43
|
+
'session:segment-changed': (payload: SessionSegmentChangedPayload) => void;
|
|
44
|
+
/** 구독 중인 세션의 청크 (10초 간격) */
|
|
45
|
+
'session:chunk': (payload: {
|
|
46
|
+
sessionId: string;
|
|
47
|
+
segmentIndex: number;
|
|
48
|
+
chunk: UnifiedChunkFile;
|
|
49
|
+
}) => void;
|
|
50
|
+
/** 세션 에러 */
|
|
51
|
+
'session:error': (payload: {
|
|
52
|
+
message: string;
|
|
23
53
|
}) => void;
|
|
24
54
|
}
|
|
25
55
|
export interface NoticeToClientEvents {
|
|
26
56
|
'notice-message:result': (payload: NoticeMessageResult) => void;
|
|
27
57
|
}
|
|
28
|
-
/**
|
|
29
|
-
export interface
|
|
30
|
-
|
|
31
|
-
|
|
58
|
+
/** 통합 세션 모니터링 이벤트 (Admin/Parent에게 전송) */
|
|
59
|
+
export interface SessionServerToClientEvents {
|
|
60
|
+
/** 활성 세션 목록 */
|
|
61
|
+
'session:list': (payload: {
|
|
62
|
+
sessions: UnifiedSessionInfo[];
|
|
63
|
+
}) => void;
|
|
64
|
+
/** 새 세션 시작됨 */
|
|
65
|
+
'session:started': (payload: {
|
|
66
|
+
session: UnifiedSessionInfo;
|
|
67
|
+
}) => void;
|
|
68
|
+
/** 세션 종료됨 */
|
|
69
|
+
'session:ended': (payload: {
|
|
70
|
+
sessionId: string;
|
|
71
|
+
durationMs?: number;
|
|
32
72
|
}) => void;
|
|
33
|
-
|
|
73
|
+
/** 구독 성공 */
|
|
74
|
+
'session:subscribed': (payload: {
|
|
34
75
|
sessionId: string;
|
|
35
76
|
snapshot: ViewerSnapshot | null;
|
|
36
77
|
}) => void;
|
|
37
|
-
|
|
78
|
+
/** 구독 중인 세션 진행 상황 */
|
|
79
|
+
'session:progress': (payload: {
|
|
38
80
|
sessionId: string;
|
|
39
81
|
snapshot: ViewerSnapshot;
|
|
40
82
|
}) => void;
|
|
41
|
-
|
|
83
|
+
/** 구독 중인 세션 이벤트 */
|
|
84
|
+
'session:events': (payload: {
|
|
42
85
|
sessionId: string;
|
|
43
86
|
events: ViewerEvent[];
|
|
44
87
|
}) => void;
|
|
45
|
-
/**
|
|
46
|
-
'
|
|
47
|
-
|
|
48
|
-
|
|
88
|
+
/** 세그먼트 변경 (섹션 변경) */
|
|
89
|
+
'session:segment-changed': (payload: SessionSegmentChangedPayload) => void;
|
|
90
|
+
/** 실시간 청크 (10초 간격, 구독자에게) */
|
|
91
|
+
'session:chunk': (payload: {
|
|
92
|
+
sessionId: string;
|
|
93
|
+
segmentIndex: number;
|
|
94
|
+
chunk: UnifiedChunkFile;
|
|
49
95
|
}) => void;
|
|
50
|
-
|
|
96
|
+
/** 에러 */
|
|
97
|
+
'session:error': (payload: {
|
|
51
98
|
message: string;
|
|
52
99
|
}) => void;
|
|
53
|
-
|
|
54
|
-
'
|
|
55
|
-
|
|
56
|
-
'
|
|
57
|
-
|
|
58
|
-
'reading-sessions:delete-result': (payload: ReadingSessionDeleteResultPayload) => void;
|
|
100
|
+
'session:list-history-result': (payload: SessionHistoryListResult) => void;
|
|
101
|
+
'session:get-history-result': (payload: SessionHistoryGetResult) => void;
|
|
102
|
+
'session:get-chunks-result': (payload: UnifiedChunksResult) => void;
|
|
103
|
+
'session:get-segment-result': (payload: UnifiedSegmentResult) => void;
|
|
104
|
+
'session:delete-history-result': (payload: SessionHistoryDeleteResult) => void;
|
|
59
105
|
}
|
|
60
106
|
/** 연결된 사용자 모니터링 이벤트 (Admin에게 전송) */
|
|
61
107
|
export interface UserServerToClientEvents {
|
|
@@ -77,21 +123,5 @@ export interface UserServerToClientEvents {
|
|
|
77
123
|
readingSessionId: string | null;
|
|
78
124
|
}) => void;
|
|
79
125
|
}
|
|
80
|
-
|
|
81
|
-
export interface RecordingServerToClientEvents {
|
|
82
|
-
'recording:started': (payload: RecordingStartedPayload) => void;
|
|
83
|
-
'recording:stopped': (payload: RecordingStoppedPayload) => void;
|
|
84
|
-
'recording:chunk': (payload: RecordingChunkPayload) => void;
|
|
85
|
-
'recording:live-events': (payload: RecordingLiveEventsPayload) => void;
|
|
86
|
-
'recording:segment-started': (payload: SegmentStartedPayload) => void;
|
|
87
|
-
'recording:segment-ended': (payload: SegmentEndedPayload) => void;
|
|
88
|
-
'recording:error': (payload: {
|
|
89
|
-
message: string;
|
|
90
|
-
}) => void;
|
|
91
|
-
'recording:list-result': (payload: RecordingListResultPayload) => void;
|
|
92
|
-
'recording:manifest': (payload: RecordingManifestPayload) => void;
|
|
93
|
-
'recording:segment': (payload: SegmentMetaPayload) => void;
|
|
94
|
-
'recording:chunks': (payload: ChunksResultPayload) => void;
|
|
95
|
-
}
|
|
96
|
-
export interface AdminServerToClientEvents extends ServerToClientEvents, NoticeToClientEvents, ReadingServerToClientEvents, UserServerToClientEvents, RecordingServerToClientEvents {
|
|
126
|
+
export interface AdminServerToClientEvents extends ServerToClientEvents, NoticeToClientEvents, SessionServerToClientEvents, UserServerToClientEvents {
|
|
97
127
|
}
|