@readerseye2/cr_type 1.0.171 → 1.0.173
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/socket/index.d.ts +1 -0
- package/dist/socket/index.js +1 -0
- package/dist/socket/reading-section.types.d.ts +0 -4
- package/dist/socket/result-socket.types.d.ts +64 -0
- package/dist/socket/result-socket.types.js +9 -0
- package/dist/socket/socket-clientToServerEvents.type.d.ts +9 -9
- package/dist/socket/socket-serverToClientEvents.type.d.ts +13 -50
- package/dist/socket/unified-session.types.d.ts +11 -8
- package/package.json +1 -1
package/dist/socket/index.d.ts
CHANGED
package/dist/socket/index.js
CHANGED
|
@@ -22,3 +22,4 @@ __exportStar(require("./socket-message.types"), exports);
|
|
|
22
22
|
__exportStar(require("./reading-section.types"), exports);
|
|
23
23
|
__exportStar(require("./connected-user.types"), exports);
|
|
24
24
|
__exportStar(require("./unified-session.types"), exports);
|
|
25
|
+
__exportStar(require("./result-socket.types"), exports);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ViewerSnapshot } from './reading-section.types';
|
|
2
|
+
import type { ChunkRef, ChunkReadingScanSummary, UnifiedSessionManifest, UnifiedSegmentMeta, UnifiedChunkFile } from './unified-session.types';
|
|
3
|
+
/** /result 토큰 인증 세션 데이터 */
|
|
4
|
+
export interface ResultSessionData {
|
|
5
|
+
tokenType: 'live' | 'replay';
|
|
6
|
+
sessionId: string;
|
|
7
|
+
permissions: {
|
|
8
|
+
showGaze: boolean;
|
|
9
|
+
showChildName: boolean;
|
|
10
|
+
};
|
|
11
|
+
expiresAt: number;
|
|
12
|
+
}
|
|
13
|
+
/** CR_result → CR_ws */
|
|
14
|
+
export interface ResultToServerEvents {
|
|
15
|
+
'session:subscribe': (data: {
|
|
16
|
+
sessionToken: string;
|
|
17
|
+
}) => void;
|
|
18
|
+
'session:unsubscribe': () => void;
|
|
19
|
+
'history:get-manifest': (data: {
|
|
20
|
+
shareToken: string;
|
|
21
|
+
}) => void;
|
|
22
|
+
'history:get-segment-meta': (data: {
|
|
23
|
+
shareToken: string;
|
|
24
|
+
segIdx: number;
|
|
25
|
+
}) => void;
|
|
26
|
+
'history:get-chunks': (data: {
|
|
27
|
+
shareToken: string;
|
|
28
|
+
segIdx: number;
|
|
29
|
+
from: number;
|
|
30
|
+
to: number;
|
|
31
|
+
}) => void;
|
|
32
|
+
}
|
|
33
|
+
/** CR_ws → CR_result */
|
|
34
|
+
export interface ResultServerToClientEvents {
|
|
35
|
+
'session:subscribed': (data: {
|
|
36
|
+
sessionId: string;
|
|
37
|
+
snapshot: ViewerSnapshot | null;
|
|
38
|
+
segmentRanges: Array<{
|
|
39
|
+
start: number;
|
|
40
|
+
end: number;
|
|
41
|
+
}>;
|
|
42
|
+
chunkRefs: ChunkRef[];
|
|
43
|
+
readingScan?: ChunkReadingScanSummary;
|
|
44
|
+
}) => void;
|
|
45
|
+
'chunk:notify': (data: {
|
|
46
|
+
segmentIndex: number;
|
|
47
|
+
chunkKey: string;
|
|
48
|
+
startTs: number;
|
|
49
|
+
endTs: number;
|
|
50
|
+
readingScan?: ChunkReadingScanSummary;
|
|
51
|
+
}) => void;
|
|
52
|
+
'session:ended': (data: {
|
|
53
|
+
durationMs: number;
|
|
54
|
+
}) => void;
|
|
55
|
+
'session:error': (data: {
|
|
56
|
+
message: string;
|
|
57
|
+
}) => void;
|
|
58
|
+
'history:manifest': (data: UnifiedSessionManifest) => void;
|
|
59
|
+
'history:segment-meta': (data: UnifiedSegmentMeta) => void;
|
|
60
|
+
'history:chunks': (data: UnifiedChunkFile[]) => void;
|
|
61
|
+
'viewer:count': (data: {
|
|
62
|
+
count: number;
|
|
63
|
+
}) => void;
|
|
64
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
3
|
+
// /result 네임스페이스 이벤트 타입 (추후 확장용)
|
|
4
|
+
//
|
|
5
|
+
// Phase 5~6에서 CR_result 독립 프로젝트 + CR_ws /result 게이트웨이 구현 시 활성화
|
|
6
|
+
// 관련 plan: CR_docs/plan/cr-result/05-cr-ws-socket-result.md
|
|
7
|
+
// CR_docs/plan/cr-result/06-cr-result-project.md
|
|
8
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatMessageReadRequest, ChatMessageRefreshRequest, MessageRequest } from "./socket-message.types";
|
|
2
|
-
import { SessionProgressPayload, SessionEventPayload
|
|
2
|
+
import { SessionProgressPayload, SessionEventPayload } from "./reading-section.types";
|
|
3
3
|
import { ViewerOpenPayload, ViewerClosePayload, GazeDataPayload, SessionHistoryListPayload, SessionHistoryGetPayload, SessionHistoryDeletePayload, UnifiedChunksGetPayload, UnifiedSegmentGetPayload } from "./unified-session.types";
|
|
4
4
|
import { ReadingProgressReport } from "../book/child-reading-progress.type";
|
|
5
5
|
export interface ClientToServerEvents {
|
|
@@ -16,10 +16,14 @@ export interface ClientToServerEvents {
|
|
|
16
16
|
'session:event': (payload: SessionEventPayload) => void;
|
|
17
17
|
/** 시선 데이터 전송 (~1초 간격) */
|
|
18
18
|
'session:gaze': (payload: GazeDataPayload) => void;
|
|
19
|
-
/** 세션 구독 (
|
|
20
|
-
'
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/** 자녀 세션 live 구독 (부모) */
|
|
20
|
+
'live:subscribe': (payload: {
|
|
21
|
+
readingSessionId: string;
|
|
22
|
+
}) => void;
|
|
23
|
+
/** 자녀 세션 live 구독 해제 */
|
|
24
|
+
'live:unsubscribe': (payload: {
|
|
25
|
+
readingSessionId: string;
|
|
26
|
+
}) => void;
|
|
23
27
|
/** 읽기 진행 보고 (5초 주기 자동저장) */
|
|
24
28
|
'progress:reading-save': (payload: ReadingProgressReport) => void;
|
|
25
29
|
/** 자녀 읽기 상태 구독 시작 */
|
|
@@ -45,10 +49,6 @@ export interface ReadingWatchAdminToServerEvents {
|
|
|
45
49
|
export interface SessionAdminToServerEvents {
|
|
46
50
|
/** 활성 세션 목록 조회 */
|
|
47
51
|
'session:list': () => void;
|
|
48
|
-
/** 세션 구독 (실시간 모니터링) */
|
|
49
|
-
'session:subscribe': (payload: SessionSubscribePayload) => void;
|
|
50
|
-
/** 세션 구독 해제 */
|
|
51
|
-
'session:unsubscribe': (payload: SessionSubscribePayload) => void;
|
|
52
52
|
/** 세션 이력 목록 조회 (S3) */
|
|
53
53
|
'session:list-history': (payload: SessionHistoryListPayload) => void;
|
|
54
54
|
/** 세션 이력 상세 조회 (S3) */
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { MessageReadResponse, MessageResponse, NoticeMessageResult } from "./socket-message.types";
|
|
2
|
-
import { ViewerSnapshot } from "./reading-section.types";
|
|
3
|
-
import { ViewerEvent } from "./viewer-events.types";
|
|
4
2
|
import { ConnectedUser, ConnectedUsersGrouped } from "./connected-user.types";
|
|
5
|
-
import { UnifiedSessionInfo, SessionSegmentChangedPayload,
|
|
3
|
+
import { UnifiedSessionInfo, SessionSegmentChangedPayload, SessionHistoryListResult, SessionHistoryGetResult, UnifiedChunksResult, UnifiedSegmentResult, SessionHistoryDeleteResult } from "./unified-session.types";
|
|
6
4
|
import { LiveReadingState } from "../book/child-reading-progress.type";
|
|
7
5
|
export interface ServerToClientEvents {
|
|
8
6
|
connect: () => void;
|
|
@@ -25,34 +23,22 @@ export interface ServerToClientEvents {
|
|
|
25
23
|
readingSessionId: string;
|
|
26
24
|
durationMs?: number;
|
|
27
25
|
}) => void;
|
|
28
|
-
/**
|
|
29
|
-
'session:
|
|
30
|
-
|
|
31
|
-
'session:progress': (payload: {
|
|
32
|
-
readingSessionId: string;
|
|
33
|
-
snapshot: ViewerSnapshot;
|
|
34
|
-
}) => void;
|
|
35
|
-
/** 구독 중인 세션의 이벤트 */
|
|
36
|
-
'session:events': (payload: {
|
|
37
|
-
readingSessionId: string;
|
|
38
|
-
events: ViewerEvent[];
|
|
39
|
-
}) => void;
|
|
40
|
-
/** 구독 중인 세션의 실시간 시선 데이터 (~1초 간격) */
|
|
41
|
-
'session:gaze': (payload: {
|
|
42
|
-
readingSessionId: string;
|
|
43
|
-
gazeData: GazeDataPayload;
|
|
26
|
+
/** 세션 에러 */
|
|
27
|
+
'session:error': (payload: {
|
|
28
|
+
message: string;
|
|
44
29
|
}) => void;
|
|
45
|
-
/**
|
|
46
|
-
'
|
|
47
|
-
/** 구독 중인 세션의 청크 (10초 간격) */
|
|
48
|
-
'session:chunk': (payload: {
|
|
30
|
+
/** 새 chunk 저장 알림 (5초마다) — 데이터는 기존 API로 fetch */
|
|
31
|
+
'live:chunk-notify': (payload: {
|
|
49
32
|
readingSessionId: string;
|
|
50
33
|
segmentIndex: number;
|
|
51
|
-
|
|
34
|
+
chunkKey: string;
|
|
35
|
+
startTs: number;
|
|
36
|
+
endTs: number;
|
|
52
37
|
}) => void;
|
|
53
|
-
/** 세션
|
|
54
|
-
'session
|
|
55
|
-
|
|
38
|
+
/** live 구독 중인 세션 종료 */
|
|
39
|
+
'live:session-ended': (payload: {
|
|
40
|
+
readingSessionId: string;
|
|
41
|
+
durationMs: number;
|
|
56
42
|
}) => void;
|
|
57
43
|
/** 자녀 읽기 실시간 상태 (5초 주기) */
|
|
58
44
|
'reading:child-live': (payload: LiveReadingState) => void;
|
|
@@ -79,31 +65,8 @@ export interface SessionServerToClientEvents {
|
|
|
79
65
|
readingSessionId: string;
|
|
80
66
|
durationMs?: number;
|
|
81
67
|
}) => void;
|
|
82
|
-
/** 구독 성공 */
|
|
83
|
-
'session:subscribed': (payload: SessionSubscribedPayload) => void;
|
|
84
|
-
/** 구독 중인 세션 진행 상황 */
|
|
85
|
-
'session:progress': (payload: {
|
|
86
|
-
readingSessionId: string;
|
|
87
|
-
snapshot: ViewerSnapshot;
|
|
88
|
-
}) => void;
|
|
89
|
-
/** 구독 중인 세션 이벤트 */
|
|
90
|
-
'session:events': (payload: {
|
|
91
|
-
readingSessionId: string;
|
|
92
|
-
events: ViewerEvent[];
|
|
93
|
-
}) => void;
|
|
94
|
-
/** 구독 중인 세션 실시간 시선 데이터 (~1초 간격) */
|
|
95
|
-
'session:gaze': (payload: {
|
|
96
|
-
readingSessionId: string;
|
|
97
|
-
gazeData: GazeDataPayload;
|
|
98
|
-
}) => void;
|
|
99
68
|
/** 세그먼트 변경 (섹션 변경) */
|
|
100
69
|
'session:segment-changed': (payload: SessionSegmentChangedPayload) => void;
|
|
101
|
-
/** 실시간 청크 (10초 간격, 구독자에게) */
|
|
102
|
-
'session:chunk': (payload: {
|
|
103
|
-
readingSessionId: string;
|
|
104
|
-
segmentIndex: number;
|
|
105
|
-
chunk: UnifiedChunkFile;
|
|
106
|
-
}) => void;
|
|
107
70
|
/** 에러 */
|
|
108
71
|
'session:error': (payload: {
|
|
109
72
|
message: string;
|
|
@@ -8,13 +8,6 @@ export interface ChunkRef {
|
|
|
8
8
|
key: string;
|
|
9
9
|
eventCount: number;
|
|
10
10
|
}
|
|
11
|
-
/** session:subscribed 응답 페이로드 */
|
|
12
|
-
export interface SessionSubscribedPayload {
|
|
13
|
-
readingSessionId: string;
|
|
14
|
-
snapshot: ViewerSnapshot | null;
|
|
15
|
-
/** 과거 chunk 참조 목록 (seek용 — 시간범위 + S3 키) */
|
|
16
|
-
chunkRefs?: ChunkRef[];
|
|
17
|
-
}
|
|
18
11
|
/** 통합 세션 상태 */
|
|
19
12
|
export type UnifiedSessionStatus = 'active' | 'ended';
|
|
20
13
|
/** 통합 세그먼트 상태 */
|
|
@@ -38,6 +31,15 @@ export interface GazeBatch {
|
|
|
38
31
|
* - snapshot: 청크 시작 시점의 뷰어 상태 (Seek 시 초기화용)
|
|
39
32
|
* - gazeData: 시선 추적 배치 데이터 (활성 시에만)
|
|
40
33
|
*/
|
|
34
|
+
/** 5초 chunk 종료 시점의 읽기 분석 요약 */
|
|
35
|
+
export interface ChunkReadingScanSummary {
|
|
36
|
+
readRatio: number;
|
|
37
|
+
validReadGIs: number;
|
|
38
|
+
totalReadMs: number;
|
|
39
|
+
totalAwayMs: number;
|
|
40
|
+
avgFixationMs: number;
|
|
41
|
+
metrics?: Record<string, number>;
|
|
42
|
+
}
|
|
41
43
|
export interface UnifiedChunkFile {
|
|
42
44
|
startTimestamp: number;
|
|
43
45
|
endTimestamp: number;
|
|
@@ -46,6 +48,8 @@ export interface UnifiedChunkFile {
|
|
|
46
48
|
snapshot?: ViewerSnapshot;
|
|
47
49
|
/** 시선 추적 데이터 배치 (~30FPS, 활성 시에만 포함) */
|
|
48
50
|
gazeData?: GazeBatch[];
|
|
51
|
+
/** chunk 시점 읽기 분석 요약 (Phase 4) */
|
|
52
|
+
readingScanSummary?: ChunkReadingScanSummary;
|
|
49
53
|
}
|
|
50
54
|
/**
|
|
51
55
|
* 통합 세그먼트 메타데이터
|
|
@@ -284,7 +288,6 @@ export interface ActiveUnifiedSession {
|
|
|
284
288
|
currentSegment: ActiveUnifiedSegment | null;
|
|
285
289
|
completedSegments: UnifiedSegmentSummary[];
|
|
286
290
|
totalEvents: number;
|
|
287
|
-
subscribers: Set<string>;
|
|
288
291
|
chunkIntervalHandle: ReturnType<typeof setInterval> | null;
|
|
289
292
|
}
|
|
290
293
|
/**
|