@readerseye2/cr_type 1.0.189 → 1.0.191

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.
@@ -80,12 +80,12 @@ export interface ClientToServerEvents {
80
80
  }) => void;
81
81
  /**
82
82
  * WebRTC 진단 정보 (부모→서버, 단방향)
83
- * - iceCandidateType: 부모 selected candidate pair의 local candidate type
83
+ * - connectTimeMs: offer 전송 connectionState=connected 까지 걸린 시간 (ms). 실패 시 null.
84
84
  * - endReason: 비정상 종료 시에만 동봉 (정상 종료는 'webrtc:hangup' 사용)
85
85
  */
86
86
  'webrtc:diag': (payload: {
87
87
  targetChildIdx: number;
88
- iceCandidateType: 'host' | 'srflx' | 'relay' | null;
88
+ connectTimeMs: number | null;
89
89
  endReason?: 'ice-failed' | 'connection-failed';
90
90
  }) => void;
91
91
  /**
@@ -32,7 +32,6 @@ export interface MessageResponse {
32
32
  receiver_idx: number;
33
33
  createdAt: string;
34
34
  room_key: string;
35
- is_read: boolean;
36
35
  _id: string;
37
36
  temp_id?: string;
38
37
  type: "text" | "image" | "notice";
@@ -44,15 +43,38 @@ export interface ChatMessageRefreshRequest {
44
43
  end?: string;
45
44
  count?: number;
46
45
  }
46
+ /** 메시지 새로고침 응답 — read pointer 포함 */
47
+ export interface ChatMessageRefreshedResponse {
48
+ roomKey: string;
49
+ msgArr: MessageResponse[];
50
+ myLastReadAt: string | null;
51
+ peerLastReadAt: string | null;
52
+ adminReadStates?: AdminReadState[];
53
+ }
54
+ /** admin별 읽음 상태 (help room) */
55
+ export interface AdminReadState {
56
+ admin_idx: number;
57
+ last_read_at: string;
58
+ }
47
59
  export interface ChatMessageReadRequest {
48
60
  room_key: string;
49
61
  last_read_at: string;
50
62
  }
63
+ /** read-peer / read-self 응답: read pointer 기반 */
51
64
  export interface MessageReadResponse {
52
65
  room_key: string;
53
- receiver_type: OauthUserType;
54
- receiver_idx: number;
55
- message_ids: string[];
66
+ reader_type: OauthUserType;
67
+ reader_idx: number;
68
+ last_read_at: string;
69
+ }
70
+ /** chat_room_read_state 컬렉션 문서 타입 */
71
+ export interface ChatRoomReadStateDoc {
72
+ _id: string;
73
+ room_key: string;
74
+ user_type: OauthUserType;
75
+ user_idx: number;
76
+ last_read_at: string;
77
+ updated_at: string;
56
78
  }
57
79
  export interface MessageLogDocument extends MessageResponse {
58
80
  createdAt: string;
@@ -1,4 +1,4 @@
1
- import { MessageReadResponse, MessageResponse, NoticeMessageResult } from "./socket-message.types";
1
+ import { ChatMessageRefreshedResponse, MessageReadResponse, MessageResponse, NoticeMessageResult } from "./socket-message.types";
2
2
  import { ConnectedUser, ConnectedUsersGrouped } from "./connected-user.types";
3
3
  import { UnifiedSessionInfo, SessionSegmentChangedPayload, SessionHistoryListResult, SessionHistoryGetResult, UnifiedChunksResult, UnifiedSegmentResult, SessionHistoryDeleteResult, LiveBatchPayload, LiveInitialPayload, LiveChunkRolledPayload, LiveEmitToggle } from "./unified-session.types";
4
4
  import { LiveReadingState } from "../book/child-reading-progress.type";
@@ -14,10 +14,7 @@ export interface ServerToClientEvents {
14
14
  connect_error: (err: Error) => void;
15
15
  'chat-message:append-self': (msg: MessageResponse) => void;
16
16
  'chat-message:append-peer': (msg: MessageResponse) => void;
17
- 'chat-message:refreshed': (payload: {
18
- roomKey: string;
19
- msgArr: MessageResponse[];
20
- }) => void;
17
+ 'chat-message:refreshed': (payload: ChatMessageRefreshedResponse) => void;
21
18
  'chat-message:read-peer': (payload: MessageReadResponse) => void;
22
19
  'chat-message:read-self': (payload: MessageReadResponse) => void;
23
20
  /** 세션 시작됨 (서버 확인) */
@@ -1,13 +1,13 @@
1
- /** WebRTC 얼굴보기 — 자녀 디바이스 식별용 플랫폼 라벨 */
2
- export type ChildDevicePlatform = 'windows' | 'macos' | 'android' | 'ios' | 'linux' | 'unknown';
3
- /**
4
- * WebRTC 얼굴보기 디바이스 선택 모달용 자녀 디바이스 정보.
5
- * 같은 자녀 계정으로 여러 단말에 로그인 중일 때, 부모가 어느 단말 영상을 볼지 선택.
6
- */
7
- export interface ChildDeviceInfo {
8
- socketId: string;
9
- platform: ChildDevicePlatform;
10
- userAgent: string | null;
11
- /** ISO 시각 — 해당 socket이 connect한 시점 */
12
- connectedAt: string;
13
- }
1
+ /** WebRTC 얼굴보기 — 자녀 디바이스 식별용 플랫폼 라벨 */
2
+ export type ChildDevicePlatform = 'windows' | 'macos' | 'android' | 'ios' | 'linux' | 'unknown';
3
+ /**
4
+ * WebRTC 얼굴보기 디바이스 선택 모달용 자녀 디바이스 정보.
5
+ * 같은 자녀 계정으로 여러 단말에 로그인 중일 때, 부모가 어느 단말 영상을 볼지 선택.
6
+ */
7
+ export interface ChildDeviceInfo {
8
+ socketId: string;
9
+ platform: ChildDevicePlatform;
10
+ userAgent: string | null;
11
+ /** ISO 시각 — 해당 socket이 connect한 시점 */
12
+ connectedAt: string;
13
+ }
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
- {
2
- "name": "@readerseye2/cr_type",
3
- "version": "1.0.189",
4
- "description": "CheckReading shared TypeScript types",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "files": [
8
- "dist"
9
- ],
10
- "scripts": {
11
- "deploy_npm": "npm version patch && npm publish --access public",
12
- "build": "tsc --project tsconfig.json",
13
- "prepare": "npm run build"
14
- },
15
- "repository": {
16
- "type": "git",
17
- "url": "https://github.com/bnri/CR_type.git"
18
- },
19
- "author": "guripong",
20
- "license": "MIT",
21
- "publishConfig": {
22
- "access": "public"
23
- },
24
- "devDependencies": {
25
- "typescript": "^5.8.3"
26
- }
27
- }
1
+ {
2
+ "name": "@readerseye2/cr_type",
3
+ "version": "1.0.191",
4
+ "description": "CheckReading shared TypeScript types",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "deploy_npm": "npm version patch && npm publish --access public",
12
+ "build": "tsc --project tsconfig.json",
13
+ "prepare": "npm run build"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/bnri/CR_type.git"
18
+ },
19
+ "author": "guripong",
20
+ "license": "MIT",
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "devDependencies": {
25
+ "typescript": "^5.8.3"
26
+ }
27
+ }