@vibexnpm/talkx 5.4.0 → 5.6.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
@@ -962,6 +962,48 @@ export interface DecisionResponse {
962
962
  optionId: string;
963
963
  }
964
964
 
965
+ /** 로그인한 회원. `userId` 는 메시지 발신자 식별과 같은 값이다. */
966
+ export interface LoginMember {
967
+ userId: string;
968
+ email?: string | null;
969
+ nickname?: string | null;
970
+ profileUrl?: string | null;
971
+ preferredLanguage?: string | null;
972
+ }
973
+
974
+ /**
975
+ * `TalkFlowClient.loginUser` 응답.
976
+ *
977
+ * 회사 선택 단계가 없다 — 로그인 키가 전역 유일이라 이메일 하나로 회원과 회사가 함께 정해진다.
978
+ */
979
+ export interface LoginResult {
980
+ accessToken: string;
981
+ tokenType: string;
982
+ expiresIn?: number;
983
+ projectId: string;
984
+ /** 회사의 활성 ck- 키. SDK 초기화의 `apiKey` 로 그대로 넣는다. */
985
+ clientKey: string;
986
+ user: LoginMember;
987
+ }
988
+
989
+ /** 내 정보. 수정 응답에는 `accessToken` 이 함께 온다(name/profileUrl 이 토큰 claim). */
990
+ export interface MyProfile {
991
+ userId: string;
992
+ email?: string | null;
993
+ name?: string | null;
994
+ phone?: string | null;
995
+ profileUrl?: string | null;
996
+ /** 회사 역할 — 방 역할(ParticipantResponse.role)과 다른 축이다. */
997
+ companyRole: 'PARTNER' | 'MEMBER';
998
+ orgNodeId?: string | null;
999
+ orgName?: string | null;
1000
+ preferredLanguage?: string | null;
1001
+ projectId: string;
1002
+ joinedAt?: string | null;
1003
+ accessToken?: string;
1004
+ expiresIn?: number;
1005
+ }
1006
+
965
1007
  /** 채팅방 참가자. */
966
1008
  export interface ParticipantResponse {
967
1009
  userId: string;
@@ -2251,6 +2293,30 @@ export default class TalkFlowClient implements SdkEventEmitter<TalkFlowClientEve
2251
2293
  removeAllListeners(event?: keyof TalkFlowClientEvents): void;
2252
2294
  listenerCount(event: keyof TalkFlowClientEvents): number;
2253
2295
 
2296
+ // 회원 인증 · 내 정보
2297
+ /**
2298
+ * 회원 로그인 — 클라이언트 생성 **전에** 호출한다. Server Key 도 고객사 BFF 도 필요 없다.
2299
+ * 응답의 `clientKey`/`projectId`/`accessToken` 이 그대로 SDK 초기화 입력이다.
2300
+ * 회사 선택 단계가 없다 — 로그인 키가 전역 유일이다.
2301
+ */
2302
+ static loginUser(options: {
2303
+ serverUrl: string;
2304
+ email: string;
2305
+ password: string;
2306
+ }): Promise<LoginResult>;
2307
+
2308
+ /** 회원 로그인 (인스턴스) — 재로그인·계정 전환용. 성공 시 토큰을 자동 설정한다. */
2309
+ loginUser(credentials: { email: string; password: string }): Promise<LoginResult>;
2310
+
2311
+ /** 내 정보 조회. */
2312
+ getMyProfile(): Promise<MyProfile>;
2313
+
2314
+ /** 내 정보 수정 — 응답의 새 토큰을 자동 채택한다(name/profileUrl 이 토큰 claim). */
2315
+ updateMyProfile(profile: { name?: string; phone?: string; profileUrl?: string }): Promise<MyProfile>;
2316
+
2317
+ /** 비밀번호 변경 — 현재 비밀번호 재확인. 토큰은 그대로 유효해 재로그인이 필요 없다. */
2318
+ changeMyPassword(params: { currentPassword: string; newPassword: string }): Promise<unknown>;
2319
+
2254
2320
  // Connection lifecycle
2255
2321
  connect(jwt?: string, options?: ConnectOptions): Promise<void>;
2256
2322
  disconnect(): Promise<void>;