@vibexnpm/talkx 9.1.0 → 9.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibexnpm/talkx",
3
- "version": "9.1.0",
3
+ "version": "9.2.0",
4
4
  "type": "module",
5
5
  "description": "TalkFlow SDK - Chat & video call (LiveKit SFU) unified client",
6
6
  "main": "dist/talkflow-sdk.umd.js",
@@ -283,11 +283,13 @@ class ChatClient extends EventEmitter {
283
283
  * 'GROUP' 은 "그룹 탭" 시맨틱 — PRIVATE_GROUP/TEAM 을 포함한 그룹 전체를 반환
284
284
  * (PRIVATE_GROUP/TEAM 값을 보내도 동일하게 그룹 전체 — 타입별 정확 필터 아님).
285
285
  * 특정 타입만 필요하면 응답의 {@code roomType} 필드로 클라이언트에서 거른다.
286
+ * @param {'USER'|'SCHEDULED_REPORT'} [params.origin] - 만든 경위 필터. {@code USER} = 사람이 만든 방,
287
+ * {@code SCHEDULED_REPORT} = 예약 보고 전용 방. 생략 시 전부. 커서 페이지라 클라이언트에서 거르면 뒤쪽 방을 놓친다.
286
288
  * @returns {Promise<Object>}
287
289
  */
288
290
  async getRooms(params = {}) {
289
- const { size = 50, lastId, lastSortValue, type } = params;
290
- return this.apiClient.get('/api/v1/rooms/my', { size, lastId, lastSortValue, type });
291
+ const { size = 50, lastId, lastSortValue, type, origin } = params;
292
+ return this.apiClient.get('/api/v1/rooms/my', { size, lastId, lastSortValue, type, origin });
291
293
  }
292
294
 
293
295
  /**
package/src/constants.js CHANGED
@@ -218,6 +218,19 @@ export const ChatRoomType = {
218
218
  TEAM: 'TEAM'
219
219
  };
220
220
 
221
+ /**
222
+ * 방이 생긴 경위 (서버 {@code ChatRoomOrigin} enum 과 일치).
223
+ *
224
+ * <ul>
225
+ * <li>{@code USER} — 사람이 만든 방. 목록 거르기 값이고, 방 응답에는 칸이 오지 않는다</li>
226
+ * <li>{@code SCHEDULED_REPORT} — 예약 보고가 만든 전용 방</li>
227
+ * </ul>
228
+ */
229
+ export const ChatRoomOrigin = {
230
+ USER: 'USER',
231
+ SCHEDULED_REPORT: 'SCHEDULED_REPORT'
232
+ };
233
+
221
234
  /**
222
235
  * 어시스턴트 참여 모드 (서버 {@code AssistantMode} enum 과 일치).
223
236
  *
package/src/index.js CHANGED
@@ -47,6 +47,7 @@ export {
47
47
  ChatMessageType,
48
48
  DecisionCardLimits,
49
49
  ChatRoomType,
50
+ ChatRoomOrigin,
50
51
  AssistantMode,
51
52
  RoomAiType,
52
53
  EngagementIntensity,
@@ -0,0 +1,32 @@
1
+ /**
2
+ * 방 만든 경위 타입 — docs/scheduled-reports.md «예약 방 구분» 예제가 <b>실제로 컴파일되는지</b>.
3
+ *
4
+ * <p>거르기 값은 둘이고, 방 응답의 칸은 예약 방일 때만 있다.</p>
5
+ *
6
+ * <p>실행: {@code npm run typecheck}</p>
7
+ */
8
+ import TalkFlowClient, { ChatRoomOrigin } from '../index';
9
+ import type { ChatRoomOriginValue, ChatRoomResponse, RoomMeta } from '../index';
10
+
11
+ declare const talkflow: TalkFlowClient;
12
+ declare const room: ChatRoomResponse;
13
+ declare const meta: RoomMeta;
14
+
15
+ async function tabs(): Promise<void> {
16
+ await talkflow.getRooms({ origin: 'USER', size: 50 });
17
+ await talkflow.getRooms({ origin: ChatRoomOrigin.SCHEDULED_REPORT, type: 'GROUP' });
18
+ await talkflow.getRooms();
19
+
20
+ // @ts-expect-error — 거르기 값은 USER·SCHEDULED_REPORT 뿐이다.
21
+ await talkflow.getRooms({ origin: 'BOT' });
22
+ }
23
+
24
+ const isReportRoom: boolean = room.origin === 'SCHEDULED_REPORT';
25
+ const fromEvent: boolean = meta.origin === ChatRoomOrigin.SCHEDULED_REPORT;
26
+ const peopleRoomEvent: boolean = meta.origin === null;
27
+ const value: ChatRoomOriginValue = ChatRoomOrigin.USER;
28
+
29
+ // @ts-expect-error — 방 응답에 USER 는 오지 않는다. 칸이 없으면 사람이 만든 방이다.
30
+ const never: boolean = room.origin === 'USER';
31
+
32
+ void [tabs, isReportRoom, fromEvent, peopleRoomEvent, value, never];
package/types/index.d.ts CHANGED
@@ -143,6 +143,15 @@ export const ChatRoomType: {
143
143
  };
144
144
  export type ChatRoomTypeValue = typeof ChatRoomType[keyof typeof ChatRoomType];
145
145
 
146
+ /** 방이 생긴 경위 — 사람이 만든 방({@code USER}) · 예약 보고 전용 방({@code SCHEDULED_REPORT}). */
147
+ export const ChatRoomOrigin: {
148
+ /** 사람이 만든 방 — {@link CursorPageParams.origin} 거르기 값. 방 응답에는 칸이 오지 않는다. */
149
+ readonly USER: 'USER';
150
+ /** 예약 보고가 만든 전용 방. */
151
+ readonly SCHEDULED_REPORT: 'SCHEDULED_REPORT';
152
+ };
153
+ export type ChatRoomOriginValue = typeof ChatRoomOrigin[keyof typeof ChatRoomOrigin];
154
+
146
155
  export const AssistantMode: {
147
156
  readonly GENERAL: 'GENERAL';
148
157
  readonly PEOPLE_ONLY: 'PEOPLE_ONLY';
@@ -1256,6 +1265,8 @@ export interface ChatRoomResponse {
1256
1265
  assistantMode?: AssistantModeValue;
1257
1266
  /** 방 AI 사용 방식 (상위 SSOT). 구버전 서버 응답에서는 없을 수 있음. */
1258
1267
  roomAiType?: RoomAiTypeValue;
1268
+ /** 방이 생긴 경위 — 예약 보고 전용 방만 값이 있다. 없으면 사람이 만든 방이다. */
1269
+ origin?: 'SCHEDULED_REPORT';
1259
1270
  /** PM 개입 강도 (PM_BACKSTAGE 방 전용). 그 외 방 타입/구버전 응답에서는 없을 수 있음. */
1260
1271
  engagementIntensity?: EngagementIntensityValue;
1261
1272
  roomName: string;
@@ -1645,6 +1656,8 @@ export interface RoomMeta {
1645
1656
  roomAiType?: RoomAiTypeValue;
1646
1657
  /** ROOM_UPDATED 메타의 PM 개입 강도 (PM_BACKSTAGE 방 전용). */
1647
1658
  engagementIntensity?: EngagementIntensityValue;
1659
+ /** ROOM_UPDATED 메타의 방 만든 경위 — 예약 보고 전용 방만 값이 있고, 사람이 만든 방은 {@code null} 이다. */
1660
+ origin?: 'SCHEDULED_REPORT' | null;
1648
1661
  }
1649
1662
 
1650
1663
  /** 채팅방 리스트 실시간 업데이트 이벤트. */
@@ -2075,6 +2088,8 @@ export interface CursorPageParams {
2075
2088
  lastSortValue?: number | string;
2076
2089
  /** 방 리스트에서 타입 필터. */
2077
2090
  type?: ChatRoomTypeValue;
2091
+ /** 방 리스트에서 만든 경위 필터. 커서 페이지라 클라이언트에서 거르면 뒤쪽 방을 놓친다. */
2092
+ origin?: ChatRoomOriginValue;
2078
2093
  }
2079
2094
 
2080
2095
  /**