connectbase-client 0.8.0 → 0.9.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/connect-base.umd.js +3 -2
- package/dist/index.d.mts +339 -29
- package/dist/index.d.ts +339 -29
- package/dist/index.js +452 -40
- package/dist/index.mjs +452 -40
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -55,6 +55,11 @@ declare class HttpClient {
|
|
|
55
55
|
put<T>(url: string, data: unknown, config?: RequestConfig): Promise<T>;
|
|
56
56
|
patch<T>(url: string, data: unknown, config?: RequestConfig): Promise<T>;
|
|
57
57
|
delete<T>(url: string, config?: RequestConfig): Promise<T>;
|
|
58
|
+
/**
|
|
59
|
+
* Raw fetch 요청 (SSE 스트리밍 등에 사용)
|
|
60
|
+
* 인증 헤더가 자동으로 추가됩니다.
|
|
61
|
+
*/
|
|
62
|
+
fetchRaw(url: string, init?: RequestInit): Promise<Response>;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
/** 앱 멤버 게스트 가입 응답 */
|
|
@@ -1826,9 +1831,9 @@ interface StreamMessage {
|
|
|
1826
1831
|
}
|
|
1827
1832
|
/** AI 스트리밍 요청 옵션 */
|
|
1828
1833
|
interface StreamOptions {
|
|
1829
|
-
/** AI 프로바이더 (
|
|
1834
|
+
/** AI 프로바이더 (앱 설정의 프로바이더 사용. override 시 지정) */
|
|
1830
1835
|
provider?: 'gemini' | 'openai' | 'claude';
|
|
1831
|
-
/** 모델명 (
|
|
1836
|
+
/** 모델명 (앱 설정의 모델을 override (선택적)) */
|
|
1832
1837
|
model?: string;
|
|
1833
1838
|
/** 시스템 프롬프트 */
|
|
1834
1839
|
system?: string;
|
|
@@ -3390,7 +3395,7 @@ declare class SubscriptionAPI {
|
|
|
3390
3395
|
* order_name: '추가 결제'
|
|
3391
3396
|
* })
|
|
3392
3397
|
*
|
|
3393
|
-
* if (result.status === '
|
|
3398
|
+
* if (result.status === 'done') {
|
|
3394
3399
|
* console.log('결제 완료!')
|
|
3395
3400
|
* }
|
|
3396
3401
|
* ```
|
|
@@ -3515,52 +3520,38 @@ declare class PushAPI {
|
|
|
3515
3520
|
/**
|
|
3516
3521
|
* 디바이스 등록 해제
|
|
3517
3522
|
*
|
|
3518
|
-
* @param
|
|
3523
|
+
* @param deviceToken 디바이스 토큰
|
|
3519
3524
|
*
|
|
3520
3525
|
* @example
|
|
3521
3526
|
* ```typescript
|
|
3522
|
-
* await cb.push.unregisterDevice('
|
|
3527
|
+
* await cb.push.unregisterDevice('fcm-token-here')
|
|
3523
3528
|
* ```
|
|
3524
3529
|
*/
|
|
3525
|
-
unregisterDevice(
|
|
3526
|
-
/**
|
|
3527
|
-
* 현재 등록된 디바이스 목록 조회
|
|
3528
|
-
*
|
|
3529
|
-
* @returns 디바이스 목록
|
|
3530
|
-
*/
|
|
3531
|
-
getDevices(): Promise<DeviceInfo[]>;
|
|
3530
|
+
unregisterDevice(deviceToken: string): Promise<void>;
|
|
3532
3531
|
/**
|
|
3533
3532
|
* 토픽 구독
|
|
3534
3533
|
*
|
|
3534
|
+
* @param deviceToken 디바이스 토큰
|
|
3535
3535
|
* @param topicName 토픽 이름
|
|
3536
3536
|
*
|
|
3537
3537
|
* @example
|
|
3538
3538
|
* ```typescript
|
|
3539
|
-
*
|
|
3540
|
-
* await cb.push.subscribeTopic('announcements')
|
|
3541
|
-
*
|
|
3542
|
-
* // 마케팅 토픽 구독
|
|
3543
|
-
* await cb.push.subscribeTopic('marketing')
|
|
3539
|
+
* await cb.push.subscribeTopic('fcm-token-here', 'announcements')
|
|
3544
3540
|
* ```
|
|
3545
3541
|
*/
|
|
3546
|
-
subscribeTopic(topicName: string): Promise<void>;
|
|
3542
|
+
subscribeTopic(deviceToken: string, topicName: string): Promise<void>;
|
|
3547
3543
|
/**
|
|
3548
3544
|
* 토픽 구독 해제
|
|
3549
3545
|
*
|
|
3546
|
+
* @param deviceToken 디바이스 토큰
|
|
3550
3547
|
* @param topicName 토픽 이름
|
|
3551
3548
|
*
|
|
3552
3549
|
* @example
|
|
3553
3550
|
* ```typescript
|
|
3554
|
-
* await cb.push.unsubscribeTopic('marketing')
|
|
3551
|
+
* await cb.push.unsubscribeTopic('fcm-token-here', 'marketing')
|
|
3555
3552
|
* ```
|
|
3556
3553
|
*/
|
|
3557
|
-
unsubscribeTopic(topicName: string): Promise<void>;
|
|
3558
|
-
/**
|
|
3559
|
-
* 구독 중인 토픽 목록 조회
|
|
3560
|
-
*
|
|
3561
|
-
* @returns 구독 중인 토픽 이름 목록
|
|
3562
|
-
*/
|
|
3563
|
-
getSubscribedTopics(): Promise<string[]>;
|
|
3554
|
+
unsubscribeTopic(deviceToken: string, topicName: string): Promise<void>;
|
|
3564
3555
|
/**
|
|
3565
3556
|
* VAPID Public Key 조회 (Web Push용)
|
|
3566
3557
|
*
|
|
@@ -3602,8 +3593,10 @@ declare class PushAPI {
|
|
|
3602
3593
|
registerWebPush(subscription: PushSubscription | WebPushSubscription): Promise<DeviceInfo>;
|
|
3603
3594
|
/**
|
|
3604
3595
|
* Web Push 구독 해제
|
|
3596
|
+
*
|
|
3597
|
+
* @param deviceToken Web Push endpoint URL (등록 시 사용한 endpoint)
|
|
3605
3598
|
*/
|
|
3606
|
-
unregisterWebPush(): Promise<void>;
|
|
3599
|
+
unregisterWebPush(deviceToken: string): Promise<void>;
|
|
3607
3600
|
/**
|
|
3608
3601
|
* 브라우저 고유 ID 생성 (localStorage에 저장)
|
|
3609
3602
|
*/
|
|
@@ -3840,6 +3833,62 @@ interface ChannelMembership {
|
|
|
3840
3833
|
started_at: string;
|
|
3841
3834
|
expires_at?: string;
|
|
3842
3835
|
}
|
|
3836
|
+
interface VideoStorage {
|
|
3837
|
+
id: string;
|
|
3838
|
+
app_id: string;
|
|
3839
|
+
name: string;
|
|
3840
|
+
description: string;
|
|
3841
|
+
current_size: number;
|
|
3842
|
+
video_count: number;
|
|
3843
|
+
is_public: boolean;
|
|
3844
|
+
allow_server_to_server: boolean;
|
|
3845
|
+
allowed_origins: string[];
|
|
3846
|
+
strict_referer_check: boolean;
|
|
3847
|
+
cdn_provider: string;
|
|
3848
|
+
cdn_config: Record<string, unknown>;
|
|
3849
|
+
default_qualities: string[];
|
|
3850
|
+
hls_encryption_enabled: boolean;
|
|
3851
|
+
token_expiry_hours: number;
|
|
3852
|
+
created_at: string;
|
|
3853
|
+
updated_at: string;
|
|
3854
|
+
}
|
|
3855
|
+
interface CreateVideoStorageRequest {
|
|
3856
|
+
name: string;
|
|
3857
|
+
description?: string;
|
|
3858
|
+
is_public?: boolean;
|
|
3859
|
+
allow_server_to_server?: boolean;
|
|
3860
|
+
allowed_origins?: string[];
|
|
3861
|
+
strict_referer_check?: boolean;
|
|
3862
|
+
cdn_provider?: string;
|
|
3863
|
+
cdn_config?: Record<string, unknown>;
|
|
3864
|
+
default_qualities?: string[];
|
|
3865
|
+
hls_encryption_enabled?: boolean;
|
|
3866
|
+
token_expiry_hours?: number;
|
|
3867
|
+
}
|
|
3868
|
+
interface UpdateVideoStorageRequest {
|
|
3869
|
+
name?: string;
|
|
3870
|
+
description?: string;
|
|
3871
|
+
is_public?: boolean;
|
|
3872
|
+
allow_server_to_server?: boolean;
|
|
3873
|
+
allowed_origins?: string[];
|
|
3874
|
+
strict_referer_check?: boolean;
|
|
3875
|
+
cdn_provider?: string;
|
|
3876
|
+
cdn_config?: Record<string, unknown>;
|
|
3877
|
+
default_qualities?: string[];
|
|
3878
|
+
hls_encryption_enabled?: boolean;
|
|
3879
|
+
token_expiry_hours?: number;
|
|
3880
|
+
}
|
|
3881
|
+
interface VideoStorageListResponse {
|
|
3882
|
+
storage_videos: VideoStorage[];
|
|
3883
|
+
total_count: number;
|
|
3884
|
+
}
|
|
3885
|
+
interface StorageUploadOptions {
|
|
3886
|
+
title: string;
|
|
3887
|
+
description?: string;
|
|
3888
|
+
visibility?: VideoVisibility;
|
|
3889
|
+
tags?: string[];
|
|
3890
|
+
onProgress?: (progress: UploadProgress) => void;
|
|
3891
|
+
}
|
|
3843
3892
|
interface SuperChat {
|
|
3844
3893
|
id: string;
|
|
3845
3894
|
video_id: string;
|
|
@@ -4053,6 +4102,55 @@ declare class VideoAPI {
|
|
|
4053
4102
|
* Submit recommendation feedback
|
|
4054
4103
|
*/
|
|
4055
4104
|
submitFeedback(videoId: string, feedback: 'interested' | 'not_interested'): Promise<void>;
|
|
4105
|
+
/**
|
|
4106
|
+
* Storage sub-namespace for video storage container operations
|
|
4107
|
+
*/
|
|
4108
|
+
readonly storage: {
|
|
4109
|
+
/**
|
|
4110
|
+
* Create a video storage container
|
|
4111
|
+
*/
|
|
4112
|
+
create: (data: CreateVideoStorageRequest) => Promise<VideoStorage>;
|
|
4113
|
+
/**
|
|
4114
|
+
* List video storage containers
|
|
4115
|
+
*/
|
|
4116
|
+
list: () => Promise<VideoStorageListResponse>;
|
|
4117
|
+
/**
|
|
4118
|
+
* Get a video storage container
|
|
4119
|
+
*/
|
|
4120
|
+
get: (storageId: string) => Promise<VideoStorage>;
|
|
4121
|
+
/**
|
|
4122
|
+
* Update a video storage container
|
|
4123
|
+
*/
|
|
4124
|
+
update: (storageId: string, data: UpdateVideoStorageRequest) => Promise<VideoStorage>;
|
|
4125
|
+
/**
|
|
4126
|
+
* Delete a video storage container
|
|
4127
|
+
*/
|
|
4128
|
+
delete: (storageId: string) => Promise<void>;
|
|
4129
|
+
/**
|
|
4130
|
+
* Upload a video to a specific storage via core-server proxy (chunked)
|
|
4131
|
+
*/
|
|
4132
|
+
upload: (storageId: string, file: File, options: StorageUploadOptions) => Promise<Video>;
|
|
4133
|
+
/**
|
|
4134
|
+
* List videos in a specific storage
|
|
4135
|
+
*/
|
|
4136
|
+
listVideos: (storageId: string, options?: VideoListOptions) => Promise<VideoListResponse>;
|
|
4137
|
+
/**
|
|
4138
|
+
* Get a video in a specific storage
|
|
4139
|
+
*/
|
|
4140
|
+
getVideo: (storageId: string, videoId: string) => Promise<Video>;
|
|
4141
|
+
/**
|
|
4142
|
+
* Delete a video from a specific storage
|
|
4143
|
+
*/
|
|
4144
|
+
deleteVideo: (storageId: string, videoId: string) => Promise<void>;
|
|
4145
|
+
/**
|
|
4146
|
+
* Get streaming URL for a video in a specific storage
|
|
4147
|
+
*/
|
|
4148
|
+
getStreamUrl: (storageId: string, videoId: string) => Promise<StreamURLResponse>;
|
|
4149
|
+
/**
|
|
4150
|
+
* Get transcode status for a video in a specific storage
|
|
4151
|
+
*/
|
|
4152
|
+
getTranscodeStatus: (storageId: string, videoId: string) => Promise<TranscodeStatus>;
|
|
4153
|
+
};
|
|
4056
4154
|
}
|
|
4057
4155
|
|
|
4058
4156
|
/**
|
|
@@ -4367,6 +4465,133 @@ interface LobbyInvite {
|
|
|
4367
4465
|
createdAt: string;
|
|
4368
4466
|
expiresAt: string;
|
|
4369
4467
|
}
|
|
4468
|
+
interface PartyInfo {
|
|
4469
|
+
id: string;
|
|
4470
|
+
app_id: string;
|
|
4471
|
+
leader_id: string;
|
|
4472
|
+
members: PartyMember[];
|
|
4473
|
+
max_size: number;
|
|
4474
|
+
settings?: Record<string, string>;
|
|
4475
|
+
state: string;
|
|
4476
|
+
created_at: string;
|
|
4477
|
+
updated_at: string;
|
|
4478
|
+
}
|
|
4479
|
+
interface PartyMember {
|
|
4480
|
+
player_id: string;
|
|
4481
|
+
display_name?: string;
|
|
4482
|
+
ready: boolean;
|
|
4483
|
+
role: string;
|
|
4484
|
+
joined_at: string;
|
|
4485
|
+
metadata?: Record<string, string>;
|
|
4486
|
+
}
|
|
4487
|
+
interface PartyInvite {
|
|
4488
|
+
invite_id: string;
|
|
4489
|
+
party_id: string;
|
|
4490
|
+
inviter_id: string;
|
|
4491
|
+
status: string;
|
|
4492
|
+
expires_at: string;
|
|
4493
|
+
}
|
|
4494
|
+
interface SpectatorInfo {
|
|
4495
|
+
id: string;
|
|
4496
|
+
user_id?: string;
|
|
4497
|
+
room_id: string;
|
|
4498
|
+
mode: "free" | "follow" | "director";
|
|
4499
|
+
target_id?: string;
|
|
4500
|
+
joined_at: string;
|
|
4501
|
+
delay_seconds?: number;
|
|
4502
|
+
}
|
|
4503
|
+
interface SpectatorState {
|
|
4504
|
+
room_id: string;
|
|
4505
|
+
tick: number;
|
|
4506
|
+
timestamp: number;
|
|
4507
|
+
players: SpectatorPlayerState[];
|
|
4508
|
+
game_state?: Record<string, unknown>;
|
|
4509
|
+
events?: Record<string, unknown>[];
|
|
4510
|
+
}
|
|
4511
|
+
interface SpectatorPlayerState {
|
|
4512
|
+
id: string;
|
|
4513
|
+
display_name: string;
|
|
4514
|
+
position: {
|
|
4515
|
+
x: number;
|
|
4516
|
+
y: number;
|
|
4517
|
+
z: number;
|
|
4518
|
+
};
|
|
4519
|
+
health?: number;
|
|
4520
|
+
score?: number;
|
|
4521
|
+
is_alive: boolean;
|
|
4522
|
+
}
|
|
4523
|
+
interface LeaderboardEntry {
|
|
4524
|
+
rank: number;
|
|
4525
|
+
player_id: string;
|
|
4526
|
+
display_name: string;
|
|
4527
|
+
rating: number;
|
|
4528
|
+
wins: number;
|
|
4529
|
+
losses: number;
|
|
4530
|
+
games_played: number;
|
|
4531
|
+
win_rate: number;
|
|
4532
|
+
tier: string;
|
|
4533
|
+
division: number;
|
|
4534
|
+
updated_at: string;
|
|
4535
|
+
}
|
|
4536
|
+
interface PlayerStats {
|
|
4537
|
+
player_id: string;
|
|
4538
|
+
rating: number;
|
|
4539
|
+
wins: number;
|
|
4540
|
+
losses: number;
|
|
4541
|
+
games_played: number;
|
|
4542
|
+
win_rate: number;
|
|
4543
|
+
tier: string;
|
|
4544
|
+
division: number;
|
|
4545
|
+
match_history: MatchResult[];
|
|
4546
|
+
}
|
|
4547
|
+
interface MatchResult {
|
|
4548
|
+
match_id: string;
|
|
4549
|
+
result: "win" | "loss" | "draw";
|
|
4550
|
+
rating_change: number;
|
|
4551
|
+
played_at: string;
|
|
4552
|
+
}
|
|
4553
|
+
interface VoiceChannel {
|
|
4554
|
+
id: string;
|
|
4555
|
+
room_id: string;
|
|
4556
|
+
name: string;
|
|
4557
|
+
type: "global" | "team" | "proximity" | "private" | "spectator";
|
|
4558
|
+
team_id?: string;
|
|
4559
|
+
max_members: number;
|
|
4560
|
+
members: Record<string, VoiceMember>;
|
|
4561
|
+
webrtc_room_id: string;
|
|
4562
|
+
created_at: string;
|
|
4563
|
+
}
|
|
4564
|
+
interface VoiceMember {
|
|
4565
|
+
player_id: string;
|
|
4566
|
+
display_name: string;
|
|
4567
|
+
joined_at: string;
|
|
4568
|
+
webrtc_url?: string;
|
|
4569
|
+
}
|
|
4570
|
+
interface ReplayInfo {
|
|
4571
|
+
id: string;
|
|
4572
|
+
room_id: string;
|
|
4573
|
+
game_type: string;
|
|
4574
|
+
map_name?: string;
|
|
4575
|
+
duration: number;
|
|
4576
|
+
tick_rate: number;
|
|
4577
|
+
start_tick: number;
|
|
4578
|
+
end_tick: number;
|
|
4579
|
+
players: ReplayPlayerInfo[];
|
|
4580
|
+
file_size: number;
|
|
4581
|
+
created_at: string;
|
|
4582
|
+
schema_version?: string;
|
|
4583
|
+
}
|
|
4584
|
+
interface ReplayPlayerInfo {
|
|
4585
|
+
player_id: string;
|
|
4586
|
+
display_name: string;
|
|
4587
|
+
team_id?: string;
|
|
4588
|
+
}
|
|
4589
|
+
interface ReplayHighlight {
|
|
4590
|
+
tick: number;
|
|
4591
|
+
type: string;
|
|
4592
|
+
actor_id: string;
|
|
4593
|
+
score: number;
|
|
4594
|
+
}
|
|
4370
4595
|
|
|
4371
4596
|
/**
|
|
4372
4597
|
* 게임 룸 클라이언트
|
|
@@ -4558,6 +4783,25 @@ declare class GameAPI {
|
|
|
4558
4783
|
* 플레이어의 받은 초대 목록
|
|
4559
4784
|
*/
|
|
4560
4785
|
getPlayerInvites(playerId: string): Promise<LobbyInvite[]>;
|
|
4786
|
+
createParty(playerId: string, maxSize?: number): Promise<PartyInfo>;
|
|
4787
|
+
joinParty(partyId: string, playerId: string): Promise<PartyInfo>;
|
|
4788
|
+
leaveParty(partyId: string, playerId: string): Promise<void>;
|
|
4789
|
+
kickFromParty(partyId: string, playerId: string): Promise<void>;
|
|
4790
|
+
inviteToParty(partyId: string, inviterId: string, inviteeId: string): Promise<PartyInvite>;
|
|
4791
|
+
sendPartyChat(partyId: string, playerId: string, message: string): Promise<void>;
|
|
4792
|
+
joinSpectator(roomId: string, playerId: string): Promise<SpectatorInfo>;
|
|
4793
|
+
leaveSpectator(roomId: string, spectatorId: string): Promise<void>;
|
|
4794
|
+
getSpectators(roomId: string): Promise<SpectatorInfo[]>;
|
|
4795
|
+
getLeaderboard(top?: number): Promise<LeaderboardEntry[]>;
|
|
4796
|
+
getPlayerStats(playerId: string): Promise<PlayerStats>;
|
|
4797
|
+
getPlayerRank(playerId: string): Promise<LeaderboardEntry>;
|
|
4798
|
+
joinVoiceChannel(roomId: string, playerId: string): Promise<VoiceChannel>;
|
|
4799
|
+
leaveVoiceChannel(roomId: string, playerId: string): Promise<void>;
|
|
4800
|
+
setMute(playerId: string, muted: boolean): Promise<void>;
|
|
4801
|
+
listReplays(roomId?: string): Promise<ReplayInfo[]>;
|
|
4802
|
+
getReplay(replayId: string): Promise<ReplayInfo>;
|
|
4803
|
+
downloadReplay(replayId: string): Promise<ArrayBuffer>;
|
|
4804
|
+
getReplayHighlights(replayId: string): Promise<ReplayHighlight[]>;
|
|
4561
4805
|
private getHeaders;
|
|
4562
4806
|
}
|
|
4563
4807
|
|
|
@@ -5200,18 +5444,37 @@ interface KnowledgeSearchResponse {
|
|
|
5200
5444
|
results: KnowledgeSearchResult[];
|
|
5201
5445
|
total: number;
|
|
5202
5446
|
}
|
|
5447
|
+
interface KnowledgeChatMessage {
|
|
5448
|
+
role: 'user' | 'assistant';
|
|
5449
|
+
content: string;
|
|
5450
|
+
}
|
|
5203
5451
|
interface ChatRequest {
|
|
5204
5452
|
message: string;
|
|
5453
|
+
messages?: KnowledgeChatMessage[];
|
|
5205
5454
|
top_k?: number;
|
|
5455
|
+
provider?: string;
|
|
5206
5456
|
model?: string;
|
|
5207
|
-
stream?: boolean;
|
|
5208
5457
|
}
|
|
5209
5458
|
interface ChatResponse {
|
|
5210
5459
|
answer: string;
|
|
5211
5460
|
sources: KnowledgeSearchResult[];
|
|
5212
5461
|
model: string;
|
|
5462
|
+
provider: string;
|
|
5213
5463
|
token_used?: number;
|
|
5214
5464
|
}
|
|
5465
|
+
interface ChatStreamEvent {
|
|
5466
|
+
type: 'sources' | 'token' | 'error';
|
|
5467
|
+
sources?: KnowledgeSearchResult[];
|
|
5468
|
+
model?: string;
|
|
5469
|
+
content?: string;
|
|
5470
|
+
done?: boolean;
|
|
5471
|
+
usage?: {
|
|
5472
|
+
prompt_tokens: number;
|
|
5473
|
+
completion_tokens: number;
|
|
5474
|
+
total_tokens: number;
|
|
5475
|
+
};
|
|
5476
|
+
error?: string;
|
|
5477
|
+
}
|
|
5215
5478
|
|
|
5216
5479
|
/**
|
|
5217
5480
|
* Knowledge Base API
|
|
@@ -5317,6 +5580,53 @@ declare class KnowledgeAPI {
|
|
|
5317
5580
|
* @param topK - 반환할 결과 수 (기본값: 지식 베이스 설정)
|
|
5318
5581
|
*/
|
|
5319
5582
|
searchGet(kbID: string, query: string, topK?: number): Promise<KnowledgeSearchResponse>;
|
|
5583
|
+
/**
|
|
5584
|
+
* RAG 챗 (동기)
|
|
5585
|
+
*
|
|
5586
|
+
* 지식 베이스의 문서를 검색하고 AI가 답변을 생성합니다.
|
|
5587
|
+
*
|
|
5588
|
+
* @param kbID - 지식 베이스 ID
|
|
5589
|
+
* @param request - 챗 요청
|
|
5590
|
+
* @returns AI 답변 + 참조 소스
|
|
5591
|
+
*
|
|
5592
|
+
* @example
|
|
5593
|
+
* ```typescript
|
|
5594
|
+
* const response = await cb.knowledge.chat('kb-id', {
|
|
5595
|
+
* message: '환불 정책이 어떻게 되나요?',
|
|
5596
|
+
* top_k: 5
|
|
5597
|
+
* })
|
|
5598
|
+
* console.log(response.answer)
|
|
5599
|
+
* console.log('참조:', response.sources)
|
|
5600
|
+
* ```
|
|
5601
|
+
*/
|
|
5602
|
+
chat(kbID: string, request: ChatRequest): Promise<ChatResponse>;
|
|
5603
|
+
/**
|
|
5604
|
+
* RAG 챗 스트리밍 (SSE)
|
|
5605
|
+
*
|
|
5606
|
+
* AI 답변을 실시간으로 토큰 단위로 수신합니다.
|
|
5607
|
+
*
|
|
5608
|
+
* @param kbID - 지식 베이스 ID
|
|
5609
|
+
* @param request - 챗 요청
|
|
5610
|
+
* @param callbacks - 스트리밍 콜백
|
|
5611
|
+
*
|
|
5612
|
+
* @example
|
|
5613
|
+
* ```typescript
|
|
5614
|
+
* await cb.knowledge.chatStream('kb-id', {
|
|
5615
|
+
* message: '환불 정책이 어떻게 되나요?'
|
|
5616
|
+
* }, {
|
|
5617
|
+
* onSources: (sources, model) => console.log('참조:', sources),
|
|
5618
|
+
* onToken: (content) => process.stdout.write(content),
|
|
5619
|
+
* onDone: (usage) => console.log('\\n완료:', usage),
|
|
5620
|
+
* onError: (error) => console.error('에러:', error)
|
|
5621
|
+
* })
|
|
5622
|
+
* ```
|
|
5623
|
+
*/
|
|
5624
|
+
chatStream(kbID: string, request: ChatRequest, callbacks: {
|
|
5625
|
+
onSources?: (sources: ChatStreamEvent['sources'], model?: string) => void;
|
|
5626
|
+
onToken?: (content: string) => void;
|
|
5627
|
+
onDone?: (usage?: ChatStreamEvent['usage']) => void;
|
|
5628
|
+
onError?: (error: string) => void;
|
|
5629
|
+
}): Promise<void>;
|
|
5320
5630
|
}
|
|
5321
5631
|
|
|
5322
5632
|
interface PublishMessageRequest {
|
|
@@ -5759,4 +6069,4 @@ declare class ConnectBase {
|
|
|
5759
6069
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
5760
6070
|
}
|
|
5761
6071
|
|
|
5762
|
-
export { type AckMessagesRequest, type AdReportResponse, type AdReportSummary, AdsAPI, type AggregateResult, type AggregateStage, ApiError, type ApiKeyItem, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchSetPageMetaRequest, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ChatRequest, type ChatResponse, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreateRelationRequest, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabasePresenceState, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchApiKeysResponse, type FetchDataResponse, type FetchFilesResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConnectionState, type GameConnectionStatus, type GameDelta, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchmakingTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type Playlist, type PlaylistItem, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type StateChange, type StateChangeHandler, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamMessage, type StreamOptions, type StreamSession, type StreamTokenCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableIndex, type TableRelation, type TableSchema, type TransactionRead, type TransactionWrite, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateApiKeyRequest, type UpdateApiKeyResponse, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateLobbyRequest, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoVisibility, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported };
|
|
6072
|
+
export { type AckMessagesRequest, type AdReportResponse, type AdReportSummary, AdsAPI, type AggregateResult, type AggregateStage, ApiError, type ApiKeyItem, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchSetPageMetaRequest, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ChatRequest, type ChatResponse, type ChatStreamEvent, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreateRelationRequest, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabasePresenceState, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchApiKeysResponse, type FetchDataResponse, type FetchFilesResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConnectionState, type GameConnectionStatus, type GameDelta, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeChatMessage, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamMessage, type StreamOptions, type StreamSession, type StreamTokenCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableIndex, type TableRelation, type TableSchema, type TransactionRead, type TransactionWrite, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateApiKeyRequest, type UpdateApiKeyResponse, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateLobbyRequest, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported };
|