connectbase-client 5.12.5 → 5.13.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.mts CHANGED
@@ -4146,16 +4146,19 @@ interface MatchResult {
4146
4146
  rating_change: number;
4147
4147
  played_at: string;
4148
4148
  }
4149
+ /**
4150
+ * `joinVoiceChannel()` 응답 — game-server 의 PTT(Push-To-Talk) 방 참가 확인.
4151
+ *
4152
+ * 실시간 오디오는 이 응답이 아니라 별도 WebSocket
4153
+ * (`GET /v1/game/:appID/voice/ws?player_id=&room_id=`)으로 전송된다. `cb.webrtc.connect()`
4154
+ * (webrtc-server 의 SDP/ICE 시그널링)와는 무관한 별개 경로다 — 과거 문서/타입이 `id`/`name`/
4155
+ * `type`/`members`/`webrtc_room_id` 등을 포함하는 것처럼 기술했으나, 실제 서버 응답에는
4156
+ * 존재하지 않아 항상 `undefined`였다(platform-issue 019fe5bb).
4157
+ */
4149
4158
  interface VoiceChannel {
4150
- id: string;
4151
4159
  room_id: string;
4152
- name: string;
4153
- type: "global" | "team" | "proximity" | "private" | "spectator";
4154
- team_id?: string;
4155
- max_members: number;
4156
- members: Record<string, VoiceMember>;
4157
- webrtc_room_id: string;
4158
- created_at: string;
4160
+ player_id: string;
4161
+ status: string;
4159
4162
  }
4160
4163
  interface VoiceMember {
4161
4164
  player_id: string;
@@ -5141,6 +5144,14 @@ interface NativeBridgeInterface {
5141
5144
  rewarded: boolean;
5142
5145
  }>;
5143
5146
  };
5147
+ /** 모바일 전용: 네이티브 인앱 브라우저 세션으로 여는 OAuth (ASWebAuthenticationSession/Custom Tabs) */
5148
+ oauth?: {
5149
+ signIn: (authUrl: string, callbackScheme: string) => Promise<{
5150
+ url: string;
5151
+ }>;
5152
+ /** 이 패키징 앱의 OAuth 콜백 URL 스킴 (`<scheme>://oauth/callback`). 동기 함수 */
5153
+ getCallbackScheme: () => string;
5154
+ };
5144
5155
  system?: {
5145
5156
  getInfo: () => Promise<SystemInfo>;
5146
5157
  getMemory: () => Promise<MemoryInfo>;
@@ -5170,6 +5181,7 @@ interface NativeBridgeInterface {
5170
5181
  readImage: () => Promise<string | null>;
5171
5182
  writeImage: (dataURL: string) => Promise<void>;
5172
5183
  clear: () => Promise<void>;
5184
+ has: (format: string) => Promise<boolean>;
5173
5185
  };
5174
5186
  shell?: {
5175
5187
  openExternal: (url: string) => Promise<{
@@ -5239,6 +5251,22 @@ interface NativeBridgeInterface {
5239
5251
  getAppDir?: () => Promise<string>;
5240
5252
  };
5241
5253
  onDeepLink?: (callback: (url: string) => void) => () => void;
5254
+ /** 모바일 전용: 앱에 연결된 Connect Base Storage 로 파일 업로드 (file_storage.type=connectbase 일 때만 존재) */
5255
+ connectbase?: {
5256
+ uploadFile: (uri: string, filename?: string, mimeType?: string) => Promise<{
5257
+ id: string;
5258
+ name: string;
5259
+ url: string;
5260
+ path: string;
5261
+ storageId: string;
5262
+ }>;
5263
+ };
5264
+ /**
5265
+ * 데스크톱 전용: 저수준 이벤트 구독 (`off` 는 해당 채널의 모든 리스너를 제거한다 — 콜백
5266
+ * 단위 해제가 아니다). `deep-link` 는 `onDeepLink` 로도 동일하게 구독할 수 있다.
5267
+ */
5268
+ on?: (channel: "deep-link" | "window-focus" | "window-blur" | "update-available" | "update-downloaded", callback: (...args: unknown[]) => void) => void;
5269
+ off?: (channel: "deep-link" | "window-focus" | "window-blur" | "update-available" | "update-downloaded") => void;
5242
5270
  }
5243
5271
  type Platform = "web" | "mobile" | "desktop";
5244
5272
  /** 패키징 앱 정보 (`cb.native.getAppInfo()`) */
@@ -5456,6 +5484,10 @@ declare class NativeAPI {
5456
5484
  * 이미지 읽기 (데스크톱 전용, Data URL 반환)
5457
5485
  */
5458
5486
  readImage: () => Promise<string | null>;
5487
+ /**
5488
+ * 클립보드에 특정 형식(MIME 타입, 예: 'text/plain', 'image/png')의 데이터가 있는지 확인 (데스크톱 전용)
5489
+ */
5490
+ has: (format: string) => Promise<boolean>;
5459
5491
  };
5460
5492
  /**
5461
5493
  * 크로스 플랫폼 파일 시스템 API
@@ -5570,6 +5602,47 @@ declare class NativeAPI {
5570
5602
  */
5571
5603
  openExternal: (url: string) => Promise<boolean>;
5572
5604
  };
5605
+ /**
5606
+ * 모바일 전용: 네이티브 인앱 브라우저 세션으로 여는 OAuth
5607
+ *
5608
+ * WebView 안에서 소셜 로그인 팝업을 열면 세션/쿠키가 격리돼 실패하는 경우가 많다.
5609
+ * 패키징 앱(RN)에서는 시스템 브라우저 세션(iOS ASWebAuthenticationSession /
5610
+ * Android Custom Tabs)으로 열고 앱 URL 스킴 콜백으로 결과를 받는다.
5611
+ * 웹/데스크톱에서는 지원하지 않는다 — 일반 팝업/리다이렉트 OAuth 플로우를 쓸 것.
5612
+ *
5613
+ * @example
5614
+ * ```typescript
5615
+ * if (cb.native.getPlatform() === 'mobile') {
5616
+ * const result = await cb.native.oauth.signIn(authorizeUrl)
5617
+ * if (result) window.location.href = result.url // 콜백 URL 로 계속 진행
5618
+ * }
5619
+ * ```
5620
+ */
5621
+ oauth: {
5622
+ /**
5623
+ * OAuth 인가 URL 을 네이티브 인앱 브라우저 세션으로 열고 콜백 URL 을 기다린다.
5624
+ * callbackScheme 을 생략하면 이 패키징 앱의 스킴(getCallbackScheme())을 사용한다.
5625
+ * 사용자가 취소했거나 미지원 플랫폼이면 null.
5626
+ */
5627
+ signIn: (authUrl: string, callbackScheme?: string) => Promise<{
5628
+ url: string;
5629
+ } | null>;
5630
+ /** 이 패키징 앱의 OAuth 콜백 URL 스킴(`<scheme>://oauth/callback`). 미지원 플랫폼은 null (동기) */
5631
+ getCallbackScheme: () => string | null;
5632
+ };
5633
+ /**
5634
+ * 모바일 전용: 패키징 앱에 연결된 Connect Base Storage 로 파일 업로드.
5635
+ * 콘솔 패키징 설정에서 "파일 저장 위치" 를 Connect Base Storage 로 선택한 경우에만 지원한다.
5636
+ */
5637
+ connectbase: {
5638
+ uploadFile: (uri: string, filename?: string, mimeType?: string) => Promise<{
5639
+ id: string;
5640
+ name: string;
5641
+ url: string;
5642
+ path: string;
5643
+ storageId: string;
5644
+ } | null>;
5645
+ };
5573
5646
  /**
5574
5647
  * 데스크톱 전용 창 제어 API
5575
5648
  */
@@ -5581,6 +5654,19 @@ declare class NativeAPI {
5581
5654
  isMaximized: () => Promise<boolean>;
5582
5655
  setTitle: (title: string) => Promise<void>;
5583
5656
  setFullScreen: (flag: boolean) => Promise<void>;
5657
+ isFullScreen: () => Promise<boolean>;
5658
+ /** 창 크기 설정 (데스크톱 전용) */
5659
+ setSize: (width: number, height: number) => Promise<void>;
5660
+ /** 창 크기 조회 (데스크톱 전용, 미지원 플랫폼은 null) */
5661
+ getSize: () => Promise<[number, number] | null>;
5662
+ /** 창 위치 설정 (데스크톱 전용) */
5663
+ setPosition: (x: number, y: number) => Promise<void>;
5664
+ /** 창 위치 조회 (데스크톱 전용, 미지원 플랫폼은 null) */
5665
+ getPosition: () => Promise<[number, number] | null>;
5666
+ /** 화면 중앙으로 이동 (데스크톱 전용) */
5667
+ center: () => Promise<void>;
5668
+ /** 항상 위에 표시 설정 (데스크톱 전용) */
5669
+ setAlwaysOnTop: (flag: boolean) => Promise<void>;
5584
5670
  };
5585
5671
  /**
5586
5672
  * 데스크톱 전용 시스템 정보 API
@@ -5588,6 +5674,7 @@ declare class NativeAPI {
5588
5674
  system: {
5589
5675
  getInfo: () => Promise<SystemInfo | null>;
5590
5676
  getMemory: () => Promise<MemoryInfo | null>;
5677
+ getCPU: () => Promise<CPUInfo | null>;
5591
5678
  };
5592
5679
  /**
5593
5680
  * 모바일 전용 생체인증 API
package/dist/index.d.ts CHANGED
@@ -4146,16 +4146,19 @@ interface MatchResult {
4146
4146
  rating_change: number;
4147
4147
  played_at: string;
4148
4148
  }
4149
+ /**
4150
+ * `joinVoiceChannel()` 응답 — game-server 의 PTT(Push-To-Talk) 방 참가 확인.
4151
+ *
4152
+ * 실시간 오디오는 이 응답이 아니라 별도 WebSocket
4153
+ * (`GET /v1/game/:appID/voice/ws?player_id=&room_id=`)으로 전송된다. `cb.webrtc.connect()`
4154
+ * (webrtc-server 의 SDP/ICE 시그널링)와는 무관한 별개 경로다 — 과거 문서/타입이 `id`/`name`/
4155
+ * `type`/`members`/`webrtc_room_id` 등을 포함하는 것처럼 기술했으나, 실제 서버 응답에는
4156
+ * 존재하지 않아 항상 `undefined`였다(platform-issue 019fe5bb).
4157
+ */
4149
4158
  interface VoiceChannel {
4150
- id: string;
4151
4159
  room_id: string;
4152
- name: string;
4153
- type: "global" | "team" | "proximity" | "private" | "spectator";
4154
- team_id?: string;
4155
- max_members: number;
4156
- members: Record<string, VoiceMember>;
4157
- webrtc_room_id: string;
4158
- created_at: string;
4160
+ player_id: string;
4161
+ status: string;
4159
4162
  }
4160
4163
  interface VoiceMember {
4161
4164
  player_id: string;
@@ -5141,6 +5144,14 @@ interface NativeBridgeInterface {
5141
5144
  rewarded: boolean;
5142
5145
  }>;
5143
5146
  };
5147
+ /** 모바일 전용: 네이티브 인앱 브라우저 세션으로 여는 OAuth (ASWebAuthenticationSession/Custom Tabs) */
5148
+ oauth?: {
5149
+ signIn: (authUrl: string, callbackScheme: string) => Promise<{
5150
+ url: string;
5151
+ }>;
5152
+ /** 이 패키징 앱의 OAuth 콜백 URL 스킴 (`<scheme>://oauth/callback`). 동기 함수 */
5153
+ getCallbackScheme: () => string;
5154
+ };
5144
5155
  system?: {
5145
5156
  getInfo: () => Promise<SystemInfo>;
5146
5157
  getMemory: () => Promise<MemoryInfo>;
@@ -5170,6 +5181,7 @@ interface NativeBridgeInterface {
5170
5181
  readImage: () => Promise<string | null>;
5171
5182
  writeImage: (dataURL: string) => Promise<void>;
5172
5183
  clear: () => Promise<void>;
5184
+ has: (format: string) => Promise<boolean>;
5173
5185
  };
5174
5186
  shell?: {
5175
5187
  openExternal: (url: string) => Promise<{
@@ -5239,6 +5251,22 @@ interface NativeBridgeInterface {
5239
5251
  getAppDir?: () => Promise<string>;
5240
5252
  };
5241
5253
  onDeepLink?: (callback: (url: string) => void) => () => void;
5254
+ /** 모바일 전용: 앱에 연결된 Connect Base Storage 로 파일 업로드 (file_storage.type=connectbase 일 때만 존재) */
5255
+ connectbase?: {
5256
+ uploadFile: (uri: string, filename?: string, mimeType?: string) => Promise<{
5257
+ id: string;
5258
+ name: string;
5259
+ url: string;
5260
+ path: string;
5261
+ storageId: string;
5262
+ }>;
5263
+ };
5264
+ /**
5265
+ * 데스크톱 전용: 저수준 이벤트 구독 (`off` 는 해당 채널의 모든 리스너를 제거한다 — 콜백
5266
+ * 단위 해제가 아니다). `deep-link` 는 `onDeepLink` 로도 동일하게 구독할 수 있다.
5267
+ */
5268
+ on?: (channel: "deep-link" | "window-focus" | "window-blur" | "update-available" | "update-downloaded", callback: (...args: unknown[]) => void) => void;
5269
+ off?: (channel: "deep-link" | "window-focus" | "window-blur" | "update-available" | "update-downloaded") => void;
5242
5270
  }
5243
5271
  type Platform = "web" | "mobile" | "desktop";
5244
5272
  /** 패키징 앱 정보 (`cb.native.getAppInfo()`) */
@@ -5456,6 +5484,10 @@ declare class NativeAPI {
5456
5484
  * 이미지 읽기 (데스크톱 전용, Data URL 반환)
5457
5485
  */
5458
5486
  readImage: () => Promise<string | null>;
5487
+ /**
5488
+ * 클립보드에 특정 형식(MIME 타입, 예: 'text/plain', 'image/png')의 데이터가 있는지 확인 (데스크톱 전용)
5489
+ */
5490
+ has: (format: string) => Promise<boolean>;
5459
5491
  };
5460
5492
  /**
5461
5493
  * 크로스 플랫폼 파일 시스템 API
@@ -5570,6 +5602,47 @@ declare class NativeAPI {
5570
5602
  */
5571
5603
  openExternal: (url: string) => Promise<boolean>;
5572
5604
  };
5605
+ /**
5606
+ * 모바일 전용: 네이티브 인앱 브라우저 세션으로 여는 OAuth
5607
+ *
5608
+ * WebView 안에서 소셜 로그인 팝업을 열면 세션/쿠키가 격리돼 실패하는 경우가 많다.
5609
+ * 패키징 앱(RN)에서는 시스템 브라우저 세션(iOS ASWebAuthenticationSession /
5610
+ * Android Custom Tabs)으로 열고 앱 URL 스킴 콜백으로 결과를 받는다.
5611
+ * 웹/데스크톱에서는 지원하지 않는다 — 일반 팝업/리다이렉트 OAuth 플로우를 쓸 것.
5612
+ *
5613
+ * @example
5614
+ * ```typescript
5615
+ * if (cb.native.getPlatform() === 'mobile') {
5616
+ * const result = await cb.native.oauth.signIn(authorizeUrl)
5617
+ * if (result) window.location.href = result.url // 콜백 URL 로 계속 진행
5618
+ * }
5619
+ * ```
5620
+ */
5621
+ oauth: {
5622
+ /**
5623
+ * OAuth 인가 URL 을 네이티브 인앱 브라우저 세션으로 열고 콜백 URL 을 기다린다.
5624
+ * callbackScheme 을 생략하면 이 패키징 앱의 스킴(getCallbackScheme())을 사용한다.
5625
+ * 사용자가 취소했거나 미지원 플랫폼이면 null.
5626
+ */
5627
+ signIn: (authUrl: string, callbackScheme?: string) => Promise<{
5628
+ url: string;
5629
+ } | null>;
5630
+ /** 이 패키징 앱의 OAuth 콜백 URL 스킴(`<scheme>://oauth/callback`). 미지원 플랫폼은 null (동기) */
5631
+ getCallbackScheme: () => string | null;
5632
+ };
5633
+ /**
5634
+ * 모바일 전용: 패키징 앱에 연결된 Connect Base Storage 로 파일 업로드.
5635
+ * 콘솔 패키징 설정에서 "파일 저장 위치" 를 Connect Base Storage 로 선택한 경우에만 지원한다.
5636
+ */
5637
+ connectbase: {
5638
+ uploadFile: (uri: string, filename?: string, mimeType?: string) => Promise<{
5639
+ id: string;
5640
+ name: string;
5641
+ url: string;
5642
+ path: string;
5643
+ storageId: string;
5644
+ } | null>;
5645
+ };
5573
5646
  /**
5574
5647
  * 데스크톱 전용 창 제어 API
5575
5648
  */
@@ -5581,6 +5654,19 @@ declare class NativeAPI {
5581
5654
  isMaximized: () => Promise<boolean>;
5582
5655
  setTitle: (title: string) => Promise<void>;
5583
5656
  setFullScreen: (flag: boolean) => Promise<void>;
5657
+ isFullScreen: () => Promise<boolean>;
5658
+ /** 창 크기 설정 (데스크톱 전용) */
5659
+ setSize: (width: number, height: number) => Promise<void>;
5660
+ /** 창 크기 조회 (데스크톱 전용, 미지원 플랫폼은 null) */
5661
+ getSize: () => Promise<[number, number] | null>;
5662
+ /** 창 위치 설정 (데스크톱 전용) */
5663
+ setPosition: (x: number, y: number) => Promise<void>;
5664
+ /** 창 위치 조회 (데스크톱 전용, 미지원 플랫폼은 null) */
5665
+ getPosition: () => Promise<[number, number] | null>;
5666
+ /** 화면 중앙으로 이동 (데스크톱 전용) */
5667
+ center: () => Promise<void>;
5668
+ /** 항상 위에 표시 설정 (데스크톱 전용) */
5669
+ setAlwaysOnTop: (flag: boolean) => Promise<void>;
5584
5670
  };
5585
5671
  /**
5586
5672
  * 데스크톱 전용 시스템 정보 API
@@ -5588,6 +5674,7 @@ declare class NativeAPI {
5588
5674
  system: {
5589
5675
  getInfo: () => Promise<SystemInfo | null>;
5590
5676
  getMemory: () => Promise<MemoryInfo | null>;
5677
+ getCPU: () => Promise<CPUInfo | null>;
5591
5678
  };
5592
5679
  /**
5593
5680
  * 모바일 전용 생체인증 API