@vibexnpm/talkx 5.4.0 → 6.1.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/dist/index.d.ts CHANGED
@@ -725,8 +725,6 @@ export interface ChatMessage {
725
725
  nickName?: string;
726
726
  /** 발신자 프로필 이미지 URL. */
727
727
  profileUrl?: string | null;
728
- /** 발신자의 프로젝트 스코프 사용자 ID. */
729
- projectUserId?: string;
730
728
  content: string | null;
731
729
  chatMessageType: ChatMessageTypeValue;
732
730
  chatType: string;
@@ -962,12 +960,102 @@ export interface DecisionResponse {
962
960
  optionId: string;
963
961
  }
964
962
 
963
+ /** 로그인한 회원. `userId` 는 메시지 발신자 식별과 같은 값이다. */
964
+ export interface LoginMember {
965
+ userId: string;
966
+ email?: string | null;
967
+ nickname?: string | null;
968
+ profileUrl?: string | null;
969
+ /** 회사 역할 — 클라이언트가 파트너 화면 노출을 결정한다. 인가 근거는 아니다(서버가 재확인). */
970
+ companyRole: 'PARTNER' | 'MEMBER';
971
+ preferredLanguage?: string | null;
972
+ /**
973
+ * 초기 비밀번호를 아직 안 바꿨는가 — `true` 면 **비밀번호 변경 화면으로 보내라**.
974
+ *
975
+ * 회원은 파트너가 정한 임시 비밀번호로 처음 들어오고, 파트너가 초기화하면 다시 이 상태가 된다.
976
+ * 로그인은 **성공** 한 것이다 — 실패로 다루면 사용자가 「비밀번호가 틀렸다」로 오해한다.
977
+ */
978
+ mustChangePassword: boolean;
979
+ }
980
+
981
+ /**
982
+ * `TalkFlowClient.loginUser` 응답.
983
+ *
984
+ * 회사 선택 단계가 없다 — 로그인 키가 전역 유일이라 이메일 하나로 회원과 회사가 함께 정해진다.
985
+ */
986
+ export interface LoginResult {
987
+ accessToken: string;
988
+ tokenType: string;
989
+ expiresIn?: number;
990
+ projectId: string;
991
+ /** 회사의 활성 ck- 키. SDK 초기화의 `apiKey` 로 그대로 넣는다. */
992
+ clientKey: string;
993
+ user: LoginMember;
994
+ }
995
+
996
+ /** 회사 조직도의 회원 — 초대 UI 에 필요한 것만. */
997
+ export interface DirectoryMember {
998
+ userId: string;
999
+ name?: string | null;
1000
+ profileUrl?: string | null;
1001
+ }
1002
+
1003
+ /** 조직도 노드. `parentId` 가 null 이면 최상위. */
1004
+ export interface DirectoryNode {
1005
+ orgNodeId: string;
1006
+ name: string;
1007
+ parentId?: string | null;
1008
+ sortOrder: number;
1009
+ /** 자손 포함 누적 인원 — 화면의 「개발팀 (2)」가 이 값. */
1010
+ memberCount: number;
1011
+ /** 이 노드 직속 인원 수. */
1012
+ directMemberCount: number;
1013
+ /** 이 노드 **직속** 회원. 누적 목록은 `children` 을 따라 모은다. */
1014
+ members: DirectoryMember[];
1015
+ children: DirectoryNode[];
1016
+ }
1017
+
1018
+ /** `getCompanyDirectory()` 응답. */
1019
+ export interface CompanyDirectory {
1020
+ tree: DirectoryNode[];
1021
+ /** 부서가 없는 회원 — 빠지면 초대 화면에서 그 사람을 찾을 수 없다. */
1022
+ unassignedMembers: DirectoryMember[];
1023
+ /** 활성 회원 총수(트리 + 미지정). */
1024
+ totalMemberCount: number;
1025
+ /** true 면 인원 **수** 는 정확하지만 **목록** 이 비어 있다 — 검색 기반 선택으로 넘어가야 한다. */
1026
+ membersOmitted: boolean;
1027
+ }
1028
+
1029
+ /** 내 정보. 수정 응답에는 `accessToken` 이 함께 온다(name/profileUrl 이 토큰 claim). */
1030
+ export interface MyProfile {
1031
+ userId: string;
1032
+ email?: string | null;
1033
+ name?: string | null;
1034
+ phone?: string | null;
1035
+ profileUrl?: string | null;
1036
+ /** 회사 역할 — 방 역할(ParticipantResponse.role)과 다른 축이다. */
1037
+ companyRole: 'PARTNER' | 'MEMBER';
1038
+ orgNodeId?: string | null;
1039
+ orgName?: string | null;
1040
+ preferredLanguage?: string | null;
1041
+ projectId: string;
1042
+ joinedAt?: string | null;
1043
+ /**
1044
+ * 초기 비밀번호를 아직 안 바꿨는가 — `true` 면 비밀번호 변경을 요구해야 한다.
1045
+ *
1046
+ * 로그인 응답에도 같은 값이 있다. 여기에도 있는 이유: 새로고침·딥링크로 로그인 응답을 거치지
1047
+ * 않고 들어오는 화면에서 그 요구가 조용히 사라지지 않게 하려는 것이다.
1048
+ */
1049
+ mustChangePassword: boolean;
1050
+ accessToken?: string;
1051
+ expiresIn?: number;
1052
+ }
1053
+
965
1054
  /** 채팅방 참가자. */
966
1055
  export interface ParticipantResponse {
967
1056
  userId: string;
968
1057
  nickName?: string;
969
1058
  profileUrl?: string | null;
970
- projectUserId?: string;
971
1059
  /**
972
1060
  * 참가자 역할 — 서버 {@code ParticipantRole} enum 과 일치.
973
1061
  * <ul>
@@ -2251,6 +2339,30 @@ export default class TalkFlowClient implements SdkEventEmitter<TalkFlowClientEve
2251
2339
  removeAllListeners(event?: keyof TalkFlowClientEvents): void;
2252
2340
  listenerCount(event: keyof TalkFlowClientEvents): number;
2253
2341
 
2342
+ // 회원 인증 · 내 정보
2343
+ /**
2344
+ * 회원 로그인 — 클라이언트 생성 **전에** 호출한다. Server Key 도 고객사 BFF 도 필요 없다.
2345
+ * 응답의 `clientKey`/`projectId`/`accessToken` 이 그대로 SDK 초기화 입력이다.
2346
+ * 회사 선택 단계가 없다 — 로그인 키가 전역 유일이다.
2347
+ */
2348
+ static loginUser(options: {
2349
+ serverUrl: string;
2350
+ email: string;
2351
+ password: string;
2352
+ }): Promise<LoginResult>;
2353
+
2354
+ /** 회원 로그인 (인스턴스) — 재로그인·계정 전환용. 성공 시 토큰을 자동 설정한다. */
2355
+ loginUser(credentials: { email: string; password: string }): Promise<LoginResult>;
2356
+
2357
+ /** 내 정보 조회. */
2358
+ getMyProfile(): Promise<MyProfile>;
2359
+
2360
+ /** 내 정보 수정 — 응답의 새 토큰을 자동 채택한다(name/profileUrl 이 토큰 claim). */
2361
+ updateMyProfile(profile: { name?: string; phone?: string; profileUrl?: string }): Promise<MyProfile>;
2362
+
2363
+ /** 비밀번호 변경 — 현재 비밀번호 재확인. 토큰은 그대로 유효해 재로그인이 필요 없다. */
2364
+ changeMyPassword(params: { currentPassword: string; newPassword: string }): Promise<unknown>;
2365
+
2254
2366
  // Connection lifecycle
2255
2367
  connect(jwt?: string, options?: ConnectOptions): Promise<void>;
2256
2368
  disconnect(): Promise<void>;