connectbase-client 3.35.1 → 3.36.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/CHANGELOG.md +29 -0
- package/README.md +15 -9
- package/dist/connect-base.umd.js +2 -2
- package/dist/index.d.mts +62 -25
- package/dist/index.d.ts +62 -25
- package/dist/index.js +75 -42
- package/dist/index.mjs +75 -42
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -96,10 +96,10 @@ interface AbortOptions {
|
|
|
96
96
|
* Recent API calls breadcrumb buffer — SDK 디버깅 / platform issue 발행 시 자동 첨부.
|
|
97
97
|
*
|
|
98
98
|
* **저장 정책 (PII 보호):**
|
|
99
|
-
* - method, path (query string strip), status, duration_ms, timestamp 만 저장
|
|
99
|
+
* - method, path (query string 전체 strip), status, duration_ms, timestamp 만 저장
|
|
100
100
|
* - body / response body / 인증 토큰 미저장
|
|
101
|
-
* -
|
|
102
|
-
* - `/v1/auth/*`, `/v1/oauth/token` 등 민감 endpoint
|
|
101
|
+
* - 쿼리스트링은 키 단위 redact 가 아니라 통째로 제거 (토큰/PII 누출 가능성 0)
|
|
102
|
+
* - 따라서 `/v1/auth/*`, `/v1/oauth/token` 등 민감 endpoint 도 path 만 보존
|
|
103
103
|
*/
|
|
104
104
|
interface RecentApiCall {
|
|
105
105
|
method: string;
|
|
@@ -187,7 +187,7 @@ declare class HttpClient {
|
|
|
187
187
|
private refreshLockedUntil;
|
|
188
188
|
/**
|
|
189
189
|
* 최근 API 호출 breadcrumb (PII strip 후 저장). platform_issue 발행 시 자동 첨부 가능.
|
|
190
|
-
* `client.support.
|
|
190
|
+
* `client.support.getRecentApiCalls()` 로 외부 노출.
|
|
191
191
|
*/
|
|
192
192
|
private recentCalls;
|
|
193
193
|
/**
|
|
@@ -1324,7 +1324,8 @@ interface BulkError {
|
|
|
1324
1324
|
error: string;
|
|
1325
1325
|
}
|
|
1326
1326
|
interface DeleteWhereResponse {
|
|
1327
|
-
|
|
1327
|
+
deleted_count: number;
|
|
1328
|
+
failed_count?: number;
|
|
1328
1329
|
}
|
|
1329
1330
|
interface SecurityRule {
|
|
1330
1331
|
id: string;
|
|
@@ -4111,8 +4112,8 @@ declare class OAuthAPI {
|
|
|
4111
4112
|
} | null>;
|
|
4112
4113
|
}
|
|
4113
4114
|
|
|
4114
|
-
type PaymentProvider =
|
|
4115
|
-
type PaymentStatus =
|
|
4115
|
+
type PaymentProvider = "toss" | "stripe" | "payapp";
|
|
4116
|
+
type PaymentStatus = "pending" | "ready" | "in_progress" | "done" | "canceled" | "partial_canceled" | "aborted" | "expired" | "failed";
|
|
4116
4117
|
interface PreparePaymentRequest {
|
|
4117
4118
|
amount: number;
|
|
4118
4119
|
order_name: string;
|
|
@@ -4134,6 +4135,8 @@ interface PreparePaymentResponse {
|
|
|
4134
4135
|
fail_url: string;
|
|
4135
4136
|
stripe_client_secret?: string;
|
|
4136
4137
|
stripe_publishable_key?: string;
|
|
4138
|
+
payapp_pay_url?: string;
|
|
4139
|
+
payapp_mul_no?: string;
|
|
4137
4140
|
}
|
|
4138
4141
|
interface CreateCheckoutSessionRequest {
|
|
4139
4142
|
amount: number;
|
|
@@ -4249,7 +4252,16 @@ declare class PaymentAPI {
|
|
|
4249
4252
|
* // Mount PaymentElement, then:
|
|
4250
4253
|
* // stripe.confirmPayment({ elements, redirect: 'if_required' })
|
|
4251
4254
|
* }
|
|
4255
|
+
*
|
|
4256
|
+
* // PayApp 결제 플로우 (위젯 불필요 — 호스팅 결제창으로 redirect)
|
|
4257
|
+
* // 결제 결과는 서버의 feedbackurl webhook 으로 확정되며, 사용자는 success_url 로 복귀한다.
|
|
4258
|
+
* if (result.payment_provider === 'payapp' && result.payapp_pay_url) {
|
|
4259
|
+
* window.location.href = result.payapp_pay_url
|
|
4260
|
+
* }
|
|
4252
4261
|
* ```
|
|
4262
|
+
*
|
|
4263
|
+
* @remarks
|
|
4264
|
+
* PayApp 은 `customer_phone` 이 필수입니다(결제요청 수신 번호). 미지정 시 서버가 거부합니다.
|
|
4253
4265
|
*/
|
|
4254
4266
|
prepare(data: PreparePaymentRequest): Promise<PreparePaymentResponse>;
|
|
4255
4267
|
/**
|
|
@@ -4410,8 +4422,8 @@ interface ListBillingKeysResponse {
|
|
|
4410
4422
|
type BillingCycle = 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
4411
4423
|
type SubscriptionStatus = 'active' | 'paused' | 'canceled' | 'past_due' | 'expired' | 'trial';
|
|
4412
4424
|
interface CreateSubscriptionRequest {
|
|
4413
|
-
/** 빌링키 ID */
|
|
4414
|
-
billing_key_id
|
|
4425
|
+
/** 빌링키 ID (toss/stripe 필수, payapp 미사용 — payurl 모델) */
|
|
4426
|
+
billing_key_id?: string;
|
|
4415
4427
|
/** 플랜 이름 */
|
|
4416
4428
|
plan_name: string;
|
|
4417
4429
|
/** 플랜 설명 */
|
|
@@ -4430,6 +4442,10 @@ interface CreateSubscriptionRequest {
|
|
|
4430
4442
|
customer_email?: string;
|
|
4431
4443
|
/** 고객 이름 */
|
|
4432
4444
|
customer_name?: string;
|
|
4445
|
+
/** 고객 전화번호 (payapp 정기결제 필수 — rebillRegist recvphone) */
|
|
4446
|
+
customer_phone?: string;
|
|
4447
|
+
/** payapp 정기결제 만료일 yyyy-mm-dd (미입력시 +10년) */
|
|
4448
|
+
expire_date?: string;
|
|
4433
4449
|
/** 메타데이터 */
|
|
4434
4450
|
metadata?: Record<string, unknown>;
|
|
4435
4451
|
}
|
|
@@ -4438,6 +4454,10 @@ interface SubscriptionResponse {
|
|
|
4438
4454
|
id: string;
|
|
4439
4455
|
/** 구독 ID (문자열) */
|
|
4440
4456
|
subscription_id: string;
|
|
4457
|
+
/** 결제 프로바이더 */
|
|
4458
|
+
provider?: 'toss' | 'stripe' | 'payapp';
|
|
4459
|
+
/** payapp: 카드등록+1회차 결제창 URL. 이 URL로 사용자를 redirect 시킨다 (위젯 불필요) */
|
|
4460
|
+
payapp_pay_url?: string;
|
|
4441
4461
|
/** 플랜 이름 */
|
|
4442
4462
|
plan_name: string;
|
|
4443
4463
|
/** 플랜 설명 */
|
|
@@ -5062,20 +5082,22 @@ declare class PushAPI {
|
|
|
5062
5082
|
*/
|
|
5063
5083
|
unregisterWebPush(deviceToken: string): Promise<void>;
|
|
5064
5084
|
/**
|
|
5065
|
-
* 회원 ID 목록으로 푸시 발송 — Functions /
|
|
5085
|
+
* 회원 ID 목록으로 푸시 발송 — Functions / 서버사이드 인증 환경 전용.
|
|
5066
5086
|
*
|
|
5067
|
-
* 백엔드 라우트 `POST /v1/apps/:appID/push/send` 는 콘솔 JWT
|
|
5068
|
-
* (`
|
|
5069
|
-
* 자체가
|
|
5087
|
+
* 백엔드 라우트 `POST /v1/apps/:appID/push/send` 는 콘솔 JWT, User Secret Key(`cb_sk_`),
|
|
5088
|
+
* 또는 service_role 토큰(`ctx.cbAdmin`)을 받는다. 브라우저 SDK 의 Public Key(`cb_pk_`)
|
|
5089
|
+
* **단독** 인스턴스에서는 호출 자체가 차단되며(권한 누설 방지), 명확한 에러를 던진다.
|
|
5090
|
+
* 위임 Bearer 토큰을 가진 인스턴스(`ctx.cbAdmin`/`ctx.cb`)는 cb_pk_ 가 앱 식별용으로만
|
|
5091
|
+
* 실리므로 허용된다.
|
|
5070
5092
|
*
|
|
5071
|
-
* @param appId 발송 대상 앱 ID
|
|
5093
|
+
* @param appId 발송 대상 앱 ID.
|
|
5072
5094
|
* @param memberIds 받는 회원 ID 배열 (UUID).
|
|
5073
5095
|
* @param payload 푸시 내용/옵션.
|
|
5074
5096
|
*
|
|
5075
5097
|
* @example
|
|
5076
5098
|
* ```ts
|
|
5077
|
-
* // ConnectBase Function (
|
|
5078
|
-
* const result = await
|
|
5099
|
+
* // ConnectBase Function (service_role=true) — 시크릿 키 없이 ctx.cbAdmin 으로 발송
|
|
5100
|
+
* const result = await ctx.cbAdmin.push.sendToMembers(ctx.appId, [memberId], {
|
|
5079
5101
|
* title: '새 알림',
|
|
5080
5102
|
* body: '확인해보세요',
|
|
5081
5103
|
* data: { route: '/notifications' },
|
|
@@ -5165,9 +5187,11 @@ interface UpdateVideoRequest {
|
|
|
5165
5187
|
thumbnail_url?: string;
|
|
5166
5188
|
}
|
|
5167
5189
|
interface StreamURLResponse {
|
|
5168
|
-
|
|
5190
|
+
/** 마스터 HLS 플레이리스트 URL (적응형 비트레이트) */
|
|
5191
|
+
master_playlist: string;
|
|
5192
|
+
/** 화질 키 → 화질별 플레이리스트 URL 맵 (예: { "720p": "https://..." }) */
|
|
5193
|
+
qualities: Record<string, string>;
|
|
5169
5194
|
expires_at: string;
|
|
5170
|
-
quality?: string;
|
|
5171
5195
|
}
|
|
5172
5196
|
interface InitUploadResponse {
|
|
5173
5197
|
upload_id: string;
|
|
@@ -5470,8 +5494,9 @@ declare class VideoAPI {
|
|
|
5470
5494
|
*
|
|
5471
5495
|
* @example
|
|
5472
5496
|
* ```ts
|
|
5473
|
-
* const {
|
|
5474
|
-
* videoElement.src =
|
|
5497
|
+
* const { master_playlist, qualities, expires_at } = await cb.video.getStreamUrl(videoId)
|
|
5498
|
+
* videoElement.src = master_playlist // 적응형 비트레이트(HLS.js 등으로 재생)
|
|
5499
|
+
* // 특정 화질 고정이 필요하면 qualities['720p'] 사용
|
|
5475
5500
|
* ```
|
|
5476
5501
|
*/
|
|
5477
5502
|
getStreamUrl(videoId: string, quality?: string): Promise<StreamURLResponse>;
|
|
@@ -5597,12 +5622,18 @@ declare class VideoAPI {
|
|
|
5597
5622
|
getMembershipTiers(channelId: string): Promise<MembershipTier[]>;
|
|
5598
5623
|
/**
|
|
5599
5624
|
* Join a membership tier
|
|
5625
|
+
*
|
|
5626
|
+
* @param _channelId 현재 서버에서 무시됩니다 (tier 가 채널을 함의). API 안정성을 위해 시그니처만 유지.
|
|
5627
|
+
* @param tierId 가입할 멤버십 티어 ID
|
|
5600
5628
|
*/
|
|
5601
|
-
joinMembership(
|
|
5629
|
+
joinMembership(_channelId: string, tierId: string): Promise<ChannelMembership>;
|
|
5602
5630
|
/**
|
|
5603
5631
|
* Cancel membership
|
|
5632
|
+
*
|
|
5633
|
+
* @param _channelId 현재 서버에서 무시됩니다. API 안정성을 위해 시그니처만 유지.
|
|
5634
|
+
* @param membershipId 취소할 멤버십 ID
|
|
5604
5635
|
*/
|
|
5605
|
-
cancelMembership(
|
|
5636
|
+
cancelMembership(_channelId: string, membershipId: string): Promise<void>;
|
|
5606
5637
|
/**
|
|
5607
5638
|
* Send a super chat
|
|
5608
5639
|
*/
|
|
@@ -5613,6 +5644,8 @@ declare class VideoAPI {
|
|
|
5613
5644
|
getSuperChats(videoId: string): Promise<SuperChat[]>;
|
|
5614
5645
|
/**
|
|
5615
5646
|
* Get recommended videos
|
|
5647
|
+
*
|
|
5648
|
+
* @deprecated Use getHomeFeed() — 동일한 개인화 피드(`/recommendations/feed`)를 반환합니다.
|
|
5616
5649
|
*/
|
|
5617
5650
|
getRecommendations(limit?: number): Promise<Video[]>;
|
|
5618
5651
|
/**
|
|
@@ -5742,7 +5775,7 @@ declare class GameConfigAPI {
|
|
|
5742
5775
|
/**
|
|
5743
5776
|
* 단일 기능 활성화 — set() 의 편의 wrapper.
|
|
5744
5777
|
*
|
|
5745
|
-
* @example await cb.game.config.enable(appId, "
|
|
5778
|
+
* @example await cb.game.config.enable(appId, "matchqueue_enabled")
|
|
5746
5779
|
*/
|
|
5747
5780
|
enable(appId: string, feature: keyof GameConfig): Promise<GameConfig>;
|
|
5748
5781
|
/**
|
|
@@ -7981,6 +8014,9 @@ declare class EndpointAPI {
|
|
|
7981
8014
|
* predicate 는 같은 Response 를 한 번만 읽을 수 있으므로, 헬퍼 내부에서
|
|
7982
8015
|
* `res.clone().json()` 형태로 안전하게 파싱한 뒤 호출자에게 전달.
|
|
7983
8016
|
*
|
|
8017
|
+
* predicate 의 `body` 는 `unknown` 으로 전달되므로, 호출자가 자신의 응답
|
|
8018
|
+
* 스키마로 narrowing 한 뒤 사용한다 (런타임 검증 책임은 호출자에게 있음).
|
|
8019
|
+
*
|
|
7984
8020
|
* @example ComfyUI 결과 폴링
|
|
7985
8021
|
* ```typescript
|
|
7986
8022
|
* type Hist = Record<string, { outputs: Record<string, { images?: { filename: string }[] }> }>
|
|
@@ -7988,7 +8024,8 @@ declare class EndpointAPI {
|
|
|
7988
8024
|
* const filename = await cb.endpoint.pollUntil<string>(
|
|
7989
8025
|
* "comfyui-main",
|
|
7990
8026
|
* { path: `/history/${promptId}` },
|
|
7991
|
-
* (
|
|
8027
|
+
* (body) => {
|
|
8028
|
+
* const data = body as Hist
|
|
7992
8029
|
* const entry = data[promptId]
|
|
7993
8030
|
* if (!entry) return undefined // 아직 큐에 있음
|
|
7994
8031
|
* for (const out of Object.values(entry.outputs)) {
|
|
@@ -8031,7 +8068,7 @@ declare class EndpointAPI {
|
|
|
8031
8068
|
* ```
|
|
8032
8069
|
*/
|
|
8033
8070
|
connectWebSocket(label: string, opts?: ConnectWebSocketOptions): Promise<WebSocket>;
|
|
8034
|
-
pollUntil<T>(label: string, init: EndpointCallInit, predicate: (body:
|
|
8071
|
+
pollUntil<T>(label: string, init: EndpointCallInit, predicate: (body: unknown, res: Response) => T | undefined | Promise<T | undefined>, opts?: PollUntilOptions): Promise<T>;
|
|
8035
8072
|
}
|
|
8036
8073
|
/**
|
|
8037
8074
|
* EndpointAPI.call 의 init 인자.
|
package/dist/index.d.ts
CHANGED
|
@@ -96,10 +96,10 @@ interface AbortOptions {
|
|
|
96
96
|
* Recent API calls breadcrumb buffer — SDK 디버깅 / platform issue 발행 시 자동 첨부.
|
|
97
97
|
*
|
|
98
98
|
* **저장 정책 (PII 보호):**
|
|
99
|
-
* - method, path (query string strip), status, duration_ms, timestamp 만 저장
|
|
99
|
+
* - method, path (query string 전체 strip), status, duration_ms, timestamp 만 저장
|
|
100
100
|
* - body / response body / 인증 토큰 미저장
|
|
101
|
-
* -
|
|
102
|
-
* - `/v1/auth/*`, `/v1/oauth/token` 등 민감 endpoint
|
|
101
|
+
* - 쿼리스트링은 키 단위 redact 가 아니라 통째로 제거 (토큰/PII 누출 가능성 0)
|
|
102
|
+
* - 따라서 `/v1/auth/*`, `/v1/oauth/token` 등 민감 endpoint 도 path 만 보존
|
|
103
103
|
*/
|
|
104
104
|
interface RecentApiCall {
|
|
105
105
|
method: string;
|
|
@@ -187,7 +187,7 @@ declare class HttpClient {
|
|
|
187
187
|
private refreshLockedUntil;
|
|
188
188
|
/**
|
|
189
189
|
* 최근 API 호출 breadcrumb (PII strip 후 저장). platform_issue 발행 시 자동 첨부 가능.
|
|
190
|
-
* `client.support.
|
|
190
|
+
* `client.support.getRecentApiCalls()` 로 외부 노출.
|
|
191
191
|
*/
|
|
192
192
|
private recentCalls;
|
|
193
193
|
/**
|
|
@@ -1324,7 +1324,8 @@ interface BulkError {
|
|
|
1324
1324
|
error: string;
|
|
1325
1325
|
}
|
|
1326
1326
|
interface DeleteWhereResponse {
|
|
1327
|
-
|
|
1327
|
+
deleted_count: number;
|
|
1328
|
+
failed_count?: number;
|
|
1328
1329
|
}
|
|
1329
1330
|
interface SecurityRule {
|
|
1330
1331
|
id: string;
|
|
@@ -4111,8 +4112,8 @@ declare class OAuthAPI {
|
|
|
4111
4112
|
} | null>;
|
|
4112
4113
|
}
|
|
4113
4114
|
|
|
4114
|
-
type PaymentProvider =
|
|
4115
|
-
type PaymentStatus =
|
|
4115
|
+
type PaymentProvider = "toss" | "stripe" | "payapp";
|
|
4116
|
+
type PaymentStatus = "pending" | "ready" | "in_progress" | "done" | "canceled" | "partial_canceled" | "aborted" | "expired" | "failed";
|
|
4116
4117
|
interface PreparePaymentRequest {
|
|
4117
4118
|
amount: number;
|
|
4118
4119
|
order_name: string;
|
|
@@ -4134,6 +4135,8 @@ interface PreparePaymentResponse {
|
|
|
4134
4135
|
fail_url: string;
|
|
4135
4136
|
stripe_client_secret?: string;
|
|
4136
4137
|
stripe_publishable_key?: string;
|
|
4138
|
+
payapp_pay_url?: string;
|
|
4139
|
+
payapp_mul_no?: string;
|
|
4137
4140
|
}
|
|
4138
4141
|
interface CreateCheckoutSessionRequest {
|
|
4139
4142
|
amount: number;
|
|
@@ -4249,7 +4252,16 @@ declare class PaymentAPI {
|
|
|
4249
4252
|
* // Mount PaymentElement, then:
|
|
4250
4253
|
* // stripe.confirmPayment({ elements, redirect: 'if_required' })
|
|
4251
4254
|
* }
|
|
4255
|
+
*
|
|
4256
|
+
* // PayApp 결제 플로우 (위젯 불필요 — 호스팅 결제창으로 redirect)
|
|
4257
|
+
* // 결제 결과는 서버의 feedbackurl webhook 으로 확정되며, 사용자는 success_url 로 복귀한다.
|
|
4258
|
+
* if (result.payment_provider === 'payapp' && result.payapp_pay_url) {
|
|
4259
|
+
* window.location.href = result.payapp_pay_url
|
|
4260
|
+
* }
|
|
4252
4261
|
* ```
|
|
4262
|
+
*
|
|
4263
|
+
* @remarks
|
|
4264
|
+
* PayApp 은 `customer_phone` 이 필수입니다(결제요청 수신 번호). 미지정 시 서버가 거부합니다.
|
|
4253
4265
|
*/
|
|
4254
4266
|
prepare(data: PreparePaymentRequest): Promise<PreparePaymentResponse>;
|
|
4255
4267
|
/**
|
|
@@ -4410,8 +4422,8 @@ interface ListBillingKeysResponse {
|
|
|
4410
4422
|
type BillingCycle = 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
4411
4423
|
type SubscriptionStatus = 'active' | 'paused' | 'canceled' | 'past_due' | 'expired' | 'trial';
|
|
4412
4424
|
interface CreateSubscriptionRequest {
|
|
4413
|
-
/** 빌링키 ID */
|
|
4414
|
-
billing_key_id
|
|
4425
|
+
/** 빌링키 ID (toss/stripe 필수, payapp 미사용 — payurl 모델) */
|
|
4426
|
+
billing_key_id?: string;
|
|
4415
4427
|
/** 플랜 이름 */
|
|
4416
4428
|
plan_name: string;
|
|
4417
4429
|
/** 플랜 설명 */
|
|
@@ -4430,6 +4442,10 @@ interface CreateSubscriptionRequest {
|
|
|
4430
4442
|
customer_email?: string;
|
|
4431
4443
|
/** 고객 이름 */
|
|
4432
4444
|
customer_name?: string;
|
|
4445
|
+
/** 고객 전화번호 (payapp 정기결제 필수 — rebillRegist recvphone) */
|
|
4446
|
+
customer_phone?: string;
|
|
4447
|
+
/** payapp 정기결제 만료일 yyyy-mm-dd (미입력시 +10년) */
|
|
4448
|
+
expire_date?: string;
|
|
4433
4449
|
/** 메타데이터 */
|
|
4434
4450
|
metadata?: Record<string, unknown>;
|
|
4435
4451
|
}
|
|
@@ -4438,6 +4454,10 @@ interface SubscriptionResponse {
|
|
|
4438
4454
|
id: string;
|
|
4439
4455
|
/** 구독 ID (문자열) */
|
|
4440
4456
|
subscription_id: string;
|
|
4457
|
+
/** 결제 프로바이더 */
|
|
4458
|
+
provider?: 'toss' | 'stripe' | 'payapp';
|
|
4459
|
+
/** payapp: 카드등록+1회차 결제창 URL. 이 URL로 사용자를 redirect 시킨다 (위젯 불필요) */
|
|
4460
|
+
payapp_pay_url?: string;
|
|
4441
4461
|
/** 플랜 이름 */
|
|
4442
4462
|
plan_name: string;
|
|
4443
4463
|
/** 플랜 설명 */
|
|
@@ -5062,20 +5082,22 @@ declare class PushAPI {
|
|
|
5062
5082
|
*/
|
|
5063
5083
|
unregisterWebPush(deviceToken: string): Promise<void>;
|
|
5064
5084
|
/**
|
|
5065
|
-
* 회원 ID 목록으로 푸시 발송 — Functions /
|
|
5085
|
+
* 회원 ID 목록으로 푸시 발송 — Functions / 서버사이드 인증 환경 전용.
|
|
5066
5086
|
*
|
|
5067
|
-
* 백엔드 라우트 `POST /v1/apps/:appID/push/send` 는 콘솔 JWT
|
|
5068
|
-
* (`
|
|
5069
|
-
* 자체가
|
|
5087
|
+
* 백엔드 라우트 `POST /v1/apps/:appID/push/send` 는 콘솔 JWT, User Secret Key(`cb_sk_`),
|
|
5088
|
+
* 또는 service_role 토큰(`ctx.cbAdmin`)을 받는다. 브라우저 SDK 의 Public Key(`cb_pk_`)
|
|
5089
|
+
* **단독** 인스턴스에서는 호출 자체가 차단되며(권한 누설 방지), 명확한 에러를 던진다.
|
|
5090
|
+
* 위임 Bearer 토큰을 가진 인스턴스(`ctx.cbAdmin`/`ctx.cb`)는 cb_pk_ 가 앱 식별용으로만
|
|
5091
|
+
* 실리므로 허용된다.
|
|
5070
5092
|
*
|
|
5071
|
-
* @param appId 발송 대상 앱 ID
|
|
5093
|
+
* @param appId 발송 대상 앱 ID.
|
|
5072
5094
|
* @param memberIds 받는 회원 ID 배열 (UUID).
|
|
5073
5095
|
* @param payload 푸시 내용/옵션.
|
|
5074
5096
|
*
|
|
5075
5097
|
* @example
|
|
5076
5098
|
* ```ts
|
|
5077
|
-
* // ConnectBase Function (
|
|
5078
|
-
* const result = await
|
|
5099
|
+
* // ConnectBase Function (service_role=true) — 시크릿 키 없이 ctx.cbAdmin 으로 발송
|
|
5100
|
+
* const result = await ctx.cbAdmin.push.sendToMembers(ctx.appId, [memberId], {
|
|
5079
5101
|
* title: '새 알림',
|
|
5080
5102
|
* body: '확인해보세요',
|
|
5081
5103
|
* data: { route: '/notifications' },
|
|
@@ -5165,9 +5187,11 @@ interface UpdateVideoRequest {
|
|
|
5165
5187
|
thumbnail_url?: string;
|
|
5166
5188
|
}
|
|
5167
5189
|
interface StreamURLResponse {
|
|
5168
|
-
|
|
5190
|
+
/** 마스터 HLS 플레이리스트 URL (적응형 비트레이트) */
|
|
5191
|
+
master_playlist: string;
|
|
5192
|
+
/** 화질 키 → 화질별 플레이리스트 URL 맵 (예: { "720p": "https://..." }) */
|
|
5193
|
+
qualities: Record<string, string>;
|
|
5169
5194
|
expires_at: string;
|
|
5170
|
-
quality?: string;
|
|
5171
5195
|
}
|
|
5172
5196
|
interface InitUploadResponse {
|
|
5173
5197
|
upload_id: string;
|
|
@@ -5470,8 +5494,9 @@ declare class VideoAPI {
|
|
|
5470
5494
|
*
|
|
5471
5495
|
* @example
|
|
5472
5496
|
* ```ts
|
|
5473
|
-
* const {
|
|
5474
|
-
* videoElement.src =
|
|
5497
|
+
* const { master_playlist, qualities, expires_at } = await cb.video.getStreamUrl(videoId)
|
|
5498
|
+
* videoElement.src = master_playlist // 적응형 비트레이트(HLS.js 등으로 재생)
|
|
5499
|
+
* // 특정 화질 고정이 필요하면 qualities['720p'] 사용
|
|
5475
5500
|
* ```
|
|
5476
5501
|
*/
|
|
5477
5502
|
getStreamUrl(videoId: string, quality?: string): Promise<StreamURLResponse>;
|
|
@@ -5597,12 +5622,18 @@ declare class VideoAPI {
|
|
|
5597
5622
|
getMembershipTiers(channelId: string): Promise<MembershipTier[]>;
|
|
5598
5623
|
/**
|
|
5599
5624
|
* Join a membership tier
|
|
5625
|
+
*
|
|
5626
|
+
* @param _channelId 현재 서버에서 무시됩니다 (tier 가 채널을 함의). API 안정성을 위해 시그니처만 유지.
|
|
5627
|
+
* @param tierId 가입할 멤버십 티어 ID
|
|
5600
5628
|
*/
|
|
5601
|
-
joinMembership(
|
|
5629
|
+
joinMembership(_channelId: string, tierId: string): Promise<ChannelMembership>;
|
|
5602
5630
|
/**
|
|
5603
5631
|
* Cancel membership
|
|
5632
|
+
*
|
|
5633
|
+
* @param _channelId 현재 서버에서 무시됩니다. API 안정성을 위해 시그니처만 유지.
|
|
5634
|
+
* @param membershipId 취소할 멤버십 ID
|
|
5604
5635
|
*/
|
|
5605
|
-
cancelMembership(
|
|
5636
|
+
cancelMembership(_channelId: string, membershipId: string): Promise<void>;
|
|
5606
5637
|
/**
|
|
5607
5638
|
* Send a super chat
|
|
5608
5639
|
*/
|
|
@@ -5613,6 +5644,8 @@ declare class VideoAPI {
|
|
|
5613
5644
|
getSuperChats(videoId: string): Promise<SuperChat[]>;
|
|
5614
5645
|
/**
|
|
5615
5646
|
* Get recommended videos
|
|
5647
|
+
*
|
|
5648
|
+
* @deprecated Use getHomeFeed() — 동일한 개인화 피드(`/recommendations/feed`)를 반환합니다.
|
|
5616
5649
|
*/
|
|
5617
5650
|
getRecommendations(limit?: number): Promise<Video[]>;
|
|
5618
5651
|
/**
|
|
@@ -5742,7 +5775,7 @@ declare class GameConfigAPI {
|
|
|
5742
5775
|
/**
|
|
5743
5776
|
* 단일 기능 활성화 — set() 의 편의 wrapper.
|
|
5744
5777
|
*
|
|
5745
|
-
* @example await cb.game.config.enable(appId, "
|
|
5778
|
+
* @example await cb.game.config.enable(appId, "matchqueue_enabled")
|
|
5746
5779
|
*/
|
|
5747
5780
|
enable(appId: string, feature: keyof GameConfig): Promise<GameConfig>;
|
|
5748
5781
|
/**
|
|
@@ -7981,6 +8014,9 @@ declare class EndpointAPI {
|
|
|
7981
8014
|
* predicate 는 같은 Response 를 한 번만 읽을 수 있으므로, 헬퍼 내부에서
|
|
7982
8015
|
* `res.clone().json()` 형태로 안전하게 파싱한 뒤 호출자에게 전달.
|
|
7983
8016
|
*
|
|
8017
|
+
* predicate 의 `body` 는 `unknown` 으로 전달되므로, 호출자가 자신의 응답
|
|
8018
|
+
* 스키마로 narrowing 한 뒤 사용한다 (런타임 검증 책임은 호출자에게 있음).
|
|
8019
|
+
*
|
|
7984
8020
|
* @example ComfyUI 결과 폴링
|
|
7985
8021
|
* ```typescript
|
|
7986
8022
|
* type Hist = Record<string, { outputs: Record<string, { images?: { filename: string }[] }> }>
|
|
@@ -7988,7 +8024,8 @@ declare class EndpointAPI {
|
|
|
7988
8024
|
* const filename = await cb.endpoint.pollUntil<string>(
|
|
7989
8025
|
* "comfyui-main",
|
|
7990
8026
|
* { path: `/history/${promptId}` },
|
|
7991
|
-
* (
|
|
8027
|
+
* (body) => {
|
|
8028
|
+
* const data = body as Hist
|
|
7992
8029
|
* const entry = data[promptId]
|
|
7993
8030
|
* if (!entry) return undefined // 아직 큐에 있음
|
|
7994
8031
|
* for (const out of Object.values(entry.outputs)) {
|
|
@@ -8031,7 +8068,7 @@ declare class EndpointAPI {
|
|
|
8031
8068
|
* ```
|
|
8032
8069
|
*/
|
|
8033
8070
|
connectWebSocket(label: string, opts?: ConnectWebSocketOptions): Promise<WebSocket>;
|
|
8034
|
-
pollUntil<T>(label: string, init: EndpointCallInit, predicate: (body:
|
|
8071
|
+
pollUntil<T>(label: string, init: EndpointCallInit, predicate: (body: unknown, res: Response) => T | undefined | Promise<T | undefined>, opts?: PollUntilOptions): Promise<T>;
|
|
8035
8072
|
}
|
|
8036
8073
|
/**
|
|
8037
8074
|
* EndpointAPI.call 의 init 인자.
|