connectbase-client 3.9.0 → 3.10.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 +35 -0
- package/dist/connect-base.umd.js +4 -3
- package/dist/index.d.mts +239 -3
- package/dist/index.d.ts +239 -3
- package/dist/index.js +245 -6
- package/dist/index.mjs +245 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -18,6 +18,23 @@ interface AbortOptions {
|
|
|
18
18
|
signal?: AbortSignal;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Recent API calls breadcrumb buffer — SDK 디버깅 / platform issue 발행 시 자동 첨부.
|
|
23
|
+
*
|
|
24
|
+
* **저장 정책 (PII 보호):**
|
|
25
|
+
* - method, path (query string strip), status, duration_ms, timestamp 만 저장
|
|
26
|
+
* - body / response body / 인증 토큰 미저장
|
|
27
|
+
* - URL 내 secret-like 패턴 (key=, token=, password=) 자동 redact
|
|
28
|
+
* - `/v1/auth/*`, `/v1/oauth/token` 등 민감 endpoint 는 path 만 (쿼리 strip)
|
|
29
|
+
*/
|
|
30
|
+
interface RecentApiCall {
|
|
31
|
+
method: string;
|
|
32
|
+
path: string;
|
|
33
|
+
status: number;
|
|
34
|
+
duration_ms: number;
|
|
35
|
+
timestamp: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
21
38
|
type TokenPersistence = 'localStorage' | 'sessionStorage' | 'none';
|
|
22
39
|
interface HttpClientConfig {
|
|
23
40
|
baseUrl: string;
|
|
@@ -68,6 +85,13 @@ interface HttpClientConfig {
|
|
|
68
85
|
}) => void;
|
|
69
86
|
onAuthError?: (error: AuthError) => void;
|
|
70
87
|
onTokenExpired?: () => void;
|
|
88
|
+
/**
|
|
89
|
+
* `/v1/auth/re-issue` 의 일시적 실패(5xx, 네트워크 오류, abort) 발생 시 호출.
|
|
90
|
+
* 이 경우 토큰은 폐기되지 않으며 `onTokenExpired` 도 호출되지 않는다 — 다음 호출에서
|
|
91
|
+
* backoff 만료 후 자동 재시도. 사용자에게 "연결이 잠시 불안정합니다" 같은 비파괴적 알림을
|
|
92
|
+
* 표시할 때 사용. `onAuthError` 도 함께 호출되므로 둘을 동시에 wiring 하면 중복 처리에 주의.
|
|
93
|
+
*/
|
|
94
|
+
onTransientRefreshFailure?: (error: AuthError) => void;
|
|
71
95
|
}
|
|
72
96
|
interface RequestConfig extends AbortOptions {
|
|
73
97
|
skipAuth?: boolean;
|
|
@@ -80,7 +104,16 @@ declare class HttpClient {
|
|
|
80
104
|
private storageKey;
|
|
81
105
|
private refreshFailureCount;
|
|
82
106
|
private refreshLockedUntil;
|
|
107
|
+
/**
|
|
108
|
+
* 최근 API 호출 breadcrumb (PII strip 후 저장). platform_issue 발행 시 자동 첨부 가능.
|
|
109
|
+
* `client.support.getRecentCalls()` 로 외부 노출.
|
|
110
|
+
*/
|
|
111
|
+
private recentCalls;
|
|
83
112
|
constructor(config: HttpClientConfig);
|
|
113
|
+
/** 최근 호출 ring buffer 스냅샷 (시간순). */
|
|
114
|
+
getRecentCalls(): RecentApiCall[];
|
|
115
|
+
/** 최근 호출 buffer clear (테스트/프라이버시 처리). */
|
|
116
|
+
clearRecentCalls(): void;
|
|
84
117
|
private warnIfUnsafePersistence;
|
|
85
118
|
updateConfig(config: Partial<HttpClientConfig>): void;
|
|
86
119
|
setTokens(accessToken: string, refreshToken: string): void;
|
|
@@ -7280,7 +7313,7 @@ interface ReportIssueResponse {
|
|
|
7280
7313
|
*
|
|
7281
7314
|
* @example 로그인 사용자가 버그 리포트
|
|
7282
7315
|
* ```typescript
|
|
7283
|
-
*
|
|
7316
|
+
* // (cb.auth.signIn 으로 로그인 완료된 상태)
|
|
7284
7317
|
* await cb.support.reportIssue({
|
|
7285
7318
|
* title: "결제 화면이 멈춰요",
|
|
7286
7319
|
* body: "결제 버튼 클릭 후 로딩이 끝나지 않습니다.",
|
|
@@ -7291,10 +7324,13 @@ interface ReportIssueResponse {
|
|
|
7291
7324
|
*
|
|
7292
7325
|
* @example 익명 + reCAPTCHA v3
|
|
7293
7326
|
* ```typescript
|
|
7327
|
+
* // window.grecaptcha 는 reCAPTCHA v3 site script 로드 후 전역으로 노출됨
|
|
7328
|
+
* const grecaptcha = (globalThis as any).grecaptcha
|
|
7329
|
+
* const SITE_KEY = "your-recaptcha-site-key"
|
|
7294
7330
|
* const token = await grecaptcha.execute(SITE_KEY, { action: 'report_issue' })
|
|
7295
7331
|
* await cb.support.reportIssue({
|
|
7296
|
-
* title: "
|
|
7297
|
-
* body: "
|
|
7332
|
+
* title: "버그 제보",
|
|
7333
|
+
* body: "익명으로 제보합니다",
|
|
7298
7334
|
* category: "question",
|
|
7299
7335
|
* anonymousEmail: "user@example.com",
|
|
7300
7336
|
* recaptchaToken: token,
|
|
@@ -7314,6 +7350,189 @@ declare class SupportAPI {
|
|
|
7314
7350
|
* @throws ApiError — 본문 길이 초과 / 쿼터 초과(429) / reCAPTCHA 거부(403) 등.
|
|
7315
7351
|
*/
|
|
7316
7352
|
reportIssue(req: ReportIssueRequest): Promise<ReportIssueResponse>;
|
|
7353
|
+
/**
|
|
7354
|
+
* ConnectBase 플랫폼 자체 버그/요청/문의를 발행한다.
|
|
7355
|
+
*
|
|
7356
|
+
* `reportIssue` 와 다른 점: target 이 앱 운영자가 아닌 **ConnectBase 운영팀**.
|
|
7357
|
+
* SDK 가 자체 버그를 던지거나, 결제/문서/플랫폼 동작이 이상할 때 사용.
|
|
7358
|
+
*
|
|
7359
|
+
* 자동 첨부 (opt-out 가능):
|
|
7360
|
+
* - SDK 버전 + 플랫폼 (web/node)
|
|
7361
|
+
* - 마지막 N(20)개 API 호출 breadcrumb (PII strip 후)
|
|
7362
|
+
* - error 객체의 stack trace (sanitize)
|
|
7363
|
+
*
|
|
7364
|
+
* @example SDK 가 throw 한 에러를 자동 첨부해서 발행
|
|
7365
|
+
* ```typescript
|
|
7366
|
+
* try {
|
|
7367
|
+
* await cb.functions.invoke('foo', {})
|
|
7368
|
+
* } catch (err) {
|
|
7369
|
+
* await cb.support.reportPlatformBug({
|
|
7370
|
+
* title: 'functions.invoke 가 504 만 반환',
|
|
7371
|
+
* body: '같은 인자로 5분 째 504. 콘솔에선 정상.',
|
|
7372
|
+
* category: 'sdk',
|
|
7373
|
+
* severity: 'high',
|
|
7374
|
+
* error: err as Error,
|
|
7375
|
+
* })
|
|
7376
|
+
* }
|
|
7377
|
+
* ```
|
|
7378
|
+
*/
|
|
7379
|
+
reportPlatformBug(req: ReportPlatformBugRequest): Promise<ReportPlatformBugResponse>;
|
|
7380
|
+
/** 디버깅용: 마지막 N개 API 호출 breadcrumb. PII 제거 후 저장돼있다. */
|
|
7381
|
+
getRecentApiCalls(): RecentApiCall[];
|
|
7382
|
+
/** breadcrumb buffer 비우기 (사용자 명시적 요청 / 프라이버시). */
|
|
7383
|
+
clearRecentApiCalls(): void;
|
|
7384
|
+
/**
|
|
7385
|
+
* Platform issue 의 reply thread 조회.
|
|
7386
|
+
*
|
|
7387
|
+
* 본인이 발행한 issue 만 조회 가능 (server-side ownership guard). admin 의 internal 메모는 응답 제외.
|
|
7388
|
+
*
|
|
7389
|
+
* @param issueId - `reportPlatformBug` 가 반환한 id
|
|
7390
|
+
* @throws ApiError 404 — 본인 issue 가 아니거나 존재하지 않음
|
|
7391
|
+
*/
|
|
7392
|
+
listPlatformIssueReplies(issueId: string): Promise<PlatformIssueReply[]>;
|
|
7393
|
+
/**
|
|
7394
|
+
* Platform issue 에 follow-up reply 작성.
|
|
7395
|
+
*
|
|
7396
|
+
* 단말 상태(resolved/wontfix/duplicate) issue 는 reply 거부 — 새 issue 발행 권장.
|
|
7397
|
+
*/
|
|
7398
|
+
replyToPlatformIssue(issueId: string, body: string): Promise<PlatformIssueReply>;
|
|
7399
|
+
/**
|
|
7400
|
+
* 본인이 발행한 platform issue 의 처리 진행 상황을 단건 조회.
|
|
7401
|
+
*
|
|
7402
|
+
* AI 가 "내가 발행한 이슈 처리됐어?" 를 폴링하는 표준 경로. status / resolution_note /
|
|
7403
|
+
* triage_summary / external_links 로 ConnectBase 운영팀의 처리 상태를 확인.
|
|
7404
|
+
*
|
|
7405
|
+
* @throws ApiError 404 — 본인 issue 가 아니거나 존재하지 않음
|
|
7406
|
+
*/
|
|
7407
|
+
getPlatformIssue(issueId: string): Promise<PlatformIssueDetail>;
|
|
7408
|
+
/**
|
|
7409
|
+
* 본인 app 으로 발행한 platform issue 목록 (cursor 페이지네이션).
|
|
7410
|
+
*
|
|
7411
|
+
* status/severity/category 필터 + `since_updated_at` 으로 미해결만 폴링하는 사용 패턴 권장:
|
|
7412
|
+
*
|
|
7413
|
+
* ```typescript
|
|
7414
|
+
* const { issues } = await cb.support.listMyPlatformIssues({ status: ['open', 'triaged', 'in_progress'] })
|
|
7415
|
+
* ```
|
|
7416
|
+
*/
|
|
7417
|
+
listMyPlatformIssues(opts?: ListMyPlatformIssuesOptions): Promise<PlatformIssueListPage>;
|
|
7418
|
+
}
|
|
7419
|
+
/**
|
|
7420
|
+
* ConnectBase 플랫폼 이슈 카테고리.
|
|
7421
|
+
*/
|
|
7422
|
+
type PlatformIssueCategory = 'bug' | 'feature_request' | 'sdk' | 'billing' | 'security' | 'performance' | 'docs' | 'other';
|
|
7423
|
+
type PlatformIssueSeverity = 'low' | 'medium' | 'high' | 'critical';
|
|
7424
|
+
interface ReportPlatformBugRequest {
|
|
7425
|
+
/** 제목 (≤200) */
|
|
7426
|
+
title: string;
|
|
7427
|
+
/** 본문 (≤16KB, markdown) */
|
|
7428
|
+
body: string;
|
|
7429
|
+
/** 카테고리. 기본 `other`. AI triage 가 보정. */
|
|
7430
|
+
category?: PlatformIssueCategory;
|
|
7431
|
+
/** 긴급도. 기본 `medium`. AI triage 가 보정. */
|
|
7432
|
+
severity?: PlatformIssueSeverity;
|
|
7433
|
+
/** AppMember 가 없는 경우 회신용 이메일. */
|
|
7434
|
+
reporterEmail?: string;
|
|
7435
|
+
/** 익명 발행 시 reCAPTCHA v3 토큰 (운영팀이 RECAPTCHA_SECRET 설정한 경우). */
|
|
7436
|
+
recaptchaToken?: string;
|
|
7437
|
+
/** 자유 컨텍스트 (페이지 URL, request_id 등). PII 직접 포함 금지 — 호출자 책임. */
|
|
7438
|
+
metadata?: Record<string, unknown>;
|
|
7439
|
+
/**
|
|
7440
|
+
* 자동 컨텍스트 첨부 on/off (기본 true).
|
|
7441
|
+
* false 로 설정하면 SDK 버전/플랫폼/breadcrumb/stack 모두 미첨부.
|
|
7442
|
+
*/
|
|
7443
|
+
attachAutomaticContext?: boolean;
|
|
7444
|
+
/**
|
|
7445
|
+
* 에러 객체. .stack 을 sanitize 후 자동 첨부.
|
|
7446
|
+
* stackTrace 와 둘 중 하나만 — error 가 우선.
|
|
7447
|
+
*/
|
|
7448
|
+
error?: Error;
|
|
7449
|
+
/** 직접 작성한 stack trace (≤32KB, SDK 가 sanitize). */
|
|
7450
|
+
stackTrace?: string;
|
|
7451
|
+
/** 호출자가 명시적으로 buffer 를 override (테스트/특수 케이스). */
|
|
7452
|
+
recentApiCalls?: RecentApiCall[];
|
|
7453
|
+
/** SDK 버전 override (자동 감지 실패 시). */
|
|
7454
|
+
sdkVersion?: string;
|
|
7455
|
+
/** SDK 플랫폼 override. */
|
|
7456
|
+
sdkPlatform?: 'web' | 'node' | 'unity' | 'godot' | 'unreal' | 'cli' | 'mcp' | 'other';
|
|
7457
|
+
/** 환경 (production/staging/development). 기본 unknown. */
|
|
7458
|
+
environment?: 'production' | 'staging' | 'development' | 'unknown';
|
|
7459
|
+
}
|
|
7460
|
+
interface ReportPlatformBugResponse {
|
|
7461
|
+
id: string;
|
|
7462
|
+
status: 'open';
|
|
7463
|
+
created_at: string;
|
|
7464
|
+
}
|
|
7465
|
+
/**
|
|
7466
|
+
* Platform issue thread 의 단일 reply.
|
|
7467
|
+
*
|
|
7468
|
+
* - `author_kind=admin`: ConnectBase 운영팀 응답
|
|
7469
|
+
* - `author_kind=user`: 본인이 작성
|
|
7470
|
+
* - `author_kind=system`: 자동 메시지 (상태 변경 알림 등)
|
|
7471
|
+
*/
|
|
7472
|
+
/**
|
|
7473
|
+
* Platform issue 의 처리 진행 상황 (reporter 시점).
|
|
7474
|
+
*
|
|
7475
|
+
* admin-only 필드(`assignee_user_id`, internal triage signal) 는 server 가 redact.
|
|
7476
|
+
*
|
|
7477
|
+
* 주요 필드:
|
|
7478
|
+
* - `status` : `open` → `triaged` → `in_progress` → `resolved` | `wontfix` | `duplicate`
|
|
7479
|
+
* - `resolution_note` : 단말 상태 진입 시 ConnectBase 운영팀이 작성한 처리 결과 (markdown)
|
|
7480
|
+
* - `triage_summary` : AI triage 가 작성한 1줄 요약
|
|
7481
|
+
* - `external_links` : 운영팀이 연결한 GitHub PR / Linear ticket 등
|
|
7482
|
+
* - `resolved_at` : `resolved`/`wontfix` 진입 시각 (해결됐는지 빠른 검사용)
|
|
7483
|
+
*/
|
|
7484
|
+
interface PlatformIssueDetail {
|
|
7485
|
+
id: string;
|
|
7486
|
+
reporter_kind: 'user' | 'app' | 'system';
|
|
7487
|
+
title: string;
|
|
7488
|
+
body: string;
|
|
7489
|
+
category: PlatformIssueCategory;
|
|
7490
|
+
severity: PlatformIssueSeverity;
|
|
7491
|
+
status: 'open' | 'triaged' | 'in_progress' | 'resolved' | 'wontfix' | 'duplicate';
|
|
7492
|
+
resolution_note?: string;
|
|
7493
|
+
sdk_version?: string;
|
|
7494
|
+
sdk_platform?: 'web' | 'node' | 'unity' | 'godot' | 'unreal' | 'cli' | 'mcp' | 'other';
|
|
7495
|
+
environment?: 'production' | 'staging' | 'development' | 'unknown';
|
|
7496
|
+
triage_summary?: string;
|
|
7497
|
+
triaged_at?: string;
|
|
7498
|
+
external_links?: Array<{
|
|
7499
|
+
kind: string;
|
|
7500
|
+
url: string;
|
|
7501
|
+
label?: string;
|
|
7502
|
+
}>;
|
|
7503
|
+
duplicate_of_id?: string;
|
|
7504
|
+
created_at: string;
|
|
7505
|
+
updated_at: string;
|
|
7506
|
+
resolved_at?: string;
|
|
7507
|
+
}
|
|
7508
|
+
/** `listMyPlatformIssues` 응답 페이지. */
|
|
7509
|
+
interface PlatformIssueListPage {
|
|
7510
|
+
issues: PlatformIssueDetail[];
|
|
7511
|
+
/** 다음 페이지 cursor. 빈 문자열/undefined 면 끝. */
|
|
7512
|
+
next_cursor?: string;
|
|
7513
|
+
}
|
|
7514
|
+
/** `listMyPlatformIssues` 옵션. */
|
|
7515
|
+
interface ListMyPlatformIssuesOptions {
|
|
7516
|
+
/** 다중 status 필터. 미지정 시 전체. 처리중만 보려면 `['open','triaged','in_progress']`. */
|
|
7517
|
+
status?: PlatformIssueDetail['status'][];
|
|
7518
|
+
severity?: PlatformIssueSeverity[];
|
|
7519
|
+
category?: PlatformIssueCategory[];
|
|
7520
|
+
/** RFC3339 timestamp — 이후 update 된 issue 만. polling 시 마지막 fetch 시각 전달. */
|
|
7521
|
+
sinceUpdatedAt?: string;
|
|
7522
|
+
/** 이전 페이지 응답의 `next_cursor`. */
|
|
7523
|
+
cursor?: string;
|
|
7524
|
+
/** 페이지 크기. 기본 50, 최대 200. */
|
|
7525
|
+
limit?: number;
|
|
7526
|
+
}
|
|
7527
|
+
interface PlatformIssueReply {
|
|
7528
|
+
id: string;
|
|
7529
|
+
issue_id: string;
|
|
7530
|
+
author_kind: 'admin' | 'user' | 'system';
|
|
7531
|
+
author_user_id?: string;
|
|
7532
|
+
author_member_id?: string;
|
|
7533
|
+
body: string;
|
|
7534
|
+
is_internal: boolean;
|
|
7535
|
+
created_at: string;
|
|
7317
7536
|
}
|
|
7318
7537
|
|
|
7319
7538
|
/**
|
|
@@ -7525,6 +7744,23 @@ interface ConnectBaseConfig {
|
|
|
7525
7744
|
* ```
|
|
7526
7745
|
*/
|
|
7527
7746
|
onTokenExpired?: () => void;
|
|
7747
|
+
/**
|
|
7748
|
+
* `/v1/auth/re-issue` 의 일시적 실패 (5xx, 네트워크 오류, abort, 손상된 200 응답) 시 호출.
|
|
7749
|
+
*
|
|
7750
|
+
* 이 경우 토큰은 폐기되지 않으며 `onTokenExpired` 도 호출되지 않습니다 — 다음 호출에서
|
|
7751
|
+
* backoff 만료 후 자동 재시도. 사용자에게 "연결이 잠시 불안정합니다" 같은 비파괴적
|
|
7752
|
+
* 알림을 띄울 때 사용. permanent (refresh token 자체 무효) 와 분리하기 위함.
|
|
7753
|
+
*
|
|
7754
|
+
* @example
|
|
7755
|
+
* ```typescript
|
|
7756
|
+
* const cb = new ConnectBase({
|
|
7757
|
+
* publicKey: '...',
|
|
7758
|
+
* onTransientRefreshFailure: (err) => toast.warn('연결이 불안정합니다. 잠시 후 자동 복구됩니다.'),
|
|
7759
|
+
* onTokenExpired: () => { window.location.href = '/login' },
|
|
7760
|
+
* })
|
|
7761
|
+
* ```
|
|
7762
|
+
*/
|
|
7763
|
+
onTransientRefreshFailure?: (error: Error) => void;
|
|
7528
7764
|
/**
|
|
7529
7765
|
* 토큰 저장 방식.
|
|
7530
7766
|
* - 'none' (기본·권장): access token 만 메모리. refresh token 은 서버 HttpOnly cookie 로
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,23 @@ interface AbortOptions {
|
|
|
18
18
|
signal?: AbortSignal;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Recent API calls breadcrumb buffer — SDK 디버깅 / platform issue 발행 시 자동 첨부.
|
|
23
|
+
*
|
|
24
|
+
* **저장 정책 (PII 보호):**
|
|
25
|
+
* - method, path (query string strip), status, duration_ms, timestamp 만 저장
|
|
26
|
+
* - body / response body / 인증 토큰 미저장
|
|
27
|
+
* - URL 내 secret-like 패턴 (key=, token=, password=) 자동 redact
|
|
28
|
+
* - `/v1/auth/*`, `/v1/oauth/token` 등 민감 endpoint 는 path 만 (쿼리 strip)
|
|
29
|
+
*/
|
|
30
|
+
interface RecentApiCall {
|
|
31
|
+
method: string;
|
|
32
|
+
path: string;
|
|
33
|
+
status: number;
|
|
34
|
+
duration_ms: number;
|
|
35
|
+
timestamp: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
21
38
|
type TokenPersistence = 'localStorage' | 'sessionStorage' | 'none';
|
|
22
39
|
interface HttpClientConfig {
|
|
23
40
|
baseUrl: string;
|
|
@@ -68,6 +85,13 @@ interface HttpClientConfig {
|
|
|
68
85
|
}) => void;
|
|
69
86
|
onAuthError?: (error: AuthError) => void;
|
|
70
87
|
onTokenExpired?: () => void;
|
|
88
|
+
/**
|
|
89
|
+
* `/v1/auth/re-issue` 의 일시적 실패(5xx, 네트워크 오류, abort) 발생 시 호출.
|
|
90
|
+
* 이 경우 토큰은 폐기되지 않으며 `onTokenExpired` 도 호출되지 않는다 — 다음 호출에서
|
|
91
|
+
* backoff 만료 후 자동 재시도. 사용자에게 "연결이 잠시 불안정합니다" 같은 비파괴적 알림을
|
|
92
|
+
* 표시할 때 사용. `onAuthError` 도 함께 호출되므로 둘을 동시에 wiring 하면 중복 처리에 주의.
|
|
93
|
+
*/
|
|
94
|
+
onTransientRefreshFailure?: (error: AuthError) => void;
|
|
71
95
|
}
|
|
72
96
|
interface RequestConfig extends AbortOptions {
|
|
73
97
|
skipAuth?: boolean;
|
|
@@ -80,7 +104,16 @@ declare class HttpClient {
|
|
|
80
104
|
private storageKey;
|
|
81
105
|
private refreshFailureCount;
|
|
82
106
|
private refreshLockedUntil;
|
|
107
|
+
/**
|
|
108
|
+
* 최근 API 호출 breadcrumb (PII strip 후 저장). platform_issue 발행 시 자동 첨부 가능.
|
|
109
|
+
* `client.support.getRecentCalls()` 로 외부 노출.
|
|
110
|
+
*/
|
|
111
|
+
private recentCalls;
|
|
83
112
|
constructor(config: HttpClientConfig);
|
|
113
|
+
/** 최근 호출 ring buffer 스냅샷 (시간순). */
|
|
114
|
+
getRecentCalls(): RecentApiCall[];
|
|
115
|
+
/** 최근 호출 buffer clear (테스트/프라이버시 처리). */
|
|
116
|
+
clearRecentCalls(): void;
|
|
84
117
|
private warnIfUnsafePersistence;
|
|
85
118
|
updateConfig(config: Partial<HttpClientConfig>): void;
|
|
86
119
|
setTokens(accessToken: string, refreshToken: string): void;
|
|
@@ -7280,7 +7313,7 @@ interface ReportIssueResponse {
|
|
|
7280
7313
|
*
|
|
7281
7314
|
* @example 로그인 사용자가 버그 리포트
|
|
7282
7315
|
* ```typescript
|
|
7283
|
-
*
|
|
7316
|
+
* // (cb.auth.signIn 으로 로그인 완료된 상태)
|
|
7284
7317
|
* await cb.support.reportIssue({
|
|
7285
7318
|
* title: "결제 화면이 멈춰요",
|
|
7286
7319
|
* body: "결제 버튼 클릭 후 로딩이 끝나지 않습니다.",
|
|
@@ -7291,10 +7324,13 @@ interface ReportIssueResponse {
|
|
|
7291
7324
|
*
|
|
7292
7325
|
* @example 익명 + reCAPTCHA v3
|
|
7293
7326
|
* ```typescript
|
|
7327
|
+
* // window.grecaptcha 는 reCAPTCHA v3 site script 로드 후 전역으로 노출됨
|
|
7328
|
+
* const grecaptcha = (globalThis as any).grecaptcha
|
|
7329
|
+
* const SITE_KEY = "your-recaptcha-site-key"
|
|
7294
7330
|
* const token = await grecaptcha.execute(SITE_KEY, { action: 'report_issue' })
|
|
7295
7331
|
* await cb.support.reportIssue({
|
|
7296
|
-
* title: "
|
|
7297
|
-
* body: "
|
|
7332
|
+
* title: "버그 제보",
|
|
7333
|
+
* body: "익명으로 제보합니다",
|
|
7298
7334
|
* category: "question",
|
|
7299
7335
|
* anonymousEmail: "user@example.com",
|
|
7300
7336
|
* recaptchaToken: token,
|
|
@@ -7314,6 +7350,189 @@ declare class SupportAPI {
|
|
|
7314
7350
|
* @throws ApiError — 본문 길이 초과 / 쿼터 초과(429) / reCAPTCHA 거부(403) 등.
|
|
7315
7351
|
*/
|
|
7316
7352
|
reportIssue(req: ReportIssueRequest): Promise<ReportIssueResponse>;
|
|
7353
|
+
/**
|
|
7354
|
+
* ConnectBase 플랫폼 자체 버그/요청/문의를 발행한다.
|
|
7355
|
+
*
|
|
7356
|
+
* `reportIssue` 와 다른 점: target 이 앱 운영자가 아닌 **ConnectBase 운영팀**.
|
|
7357
|
+
* SDK 가 자체 버그를 던지거나, 결제/문서/플랫폼 동작이 이상할 때 사용.
|
|
7358
|
+
*
|
|
7359
|
+
* 자동 첨부 (opt-out 가능):
|
|
7360
|
+
* - SDK 버전 + 플랫폼 (web/node)
|
|
7361
|
+
* - 마지막 N(20)개 API 호출 breadcrumb (PII strip 후)
|
|
7362
|
+
* - error 객체의 stack trace (sanitize)
|
|
7363
|
+
*
|
|
7364
|
+
* @example SDK 가 throw 한 에러를 자동 첨부해서 발행
|
|
7365
|
+
* ```typescript
|
|
7366
|
+
* try {
|
|
7367
|
+
* await cb.functions.invoke('foo', {})
|
|
7368
|
+
* } catch (err) {
|
|
7369
|
+
* await cb.support.reportPlatformBug({
|
|
7370
|
+
* title: 'functions.invoke 가 504 만 반환',
|
|
7371
|
+
* body: '같은 인자로 5분 째 504. 콘솔에선 정상.',
|
|
7372
|
+
* category: 'sdk',
|
|
7373
|
+
* severity: 'high',
|
|
7374
|
+
* error: err as Error,
|
|
7375
|
+
* })
|
|
7376
|
+
* }
|
|
7377
|
+
* ```
|
|
7378
|
+
*/
|
|
7379
|
+
reportPlatformBug(req: ReportPlatformBugRequest): Promise<ReportPlatformBugResponse>;
|
|
7380
|
+
/** 디버깅용: 마지막 N개 API 호출 breadcrumb. PII 제거 후 저장돼있다. */
|
|
7381
|
+
getRecentApiCalls(): RecentApiCall[];
|
|
7382
|
+
/** breadcrumb buffer 비우기 (사용자 명시적 요청 / 프라이버시). */
|
|
7383
|
+
clearRecentApiCalls(): void;
|
|
7384
|
+
/**
|
|
7385
|
+
* Platform issue 의 reply thread 조회.
|
|
7386
|
+
*
|
|
7387
|
+
* 본인이 발행한 issue 만 조회 가능 (server-side ownership guard). admin 의 internal 메모는 응답 제외.
|
|
7388
|
+
*
|
|
7389
|
+
* @param issueId - `reportPlatformBug` 가 반환한 id
|
|
7390
|
+
* @throws ApiError 404 — 본인 issue 가 아니거나 존재하지 않음
|
|
7391
|
+
*/
|
|
7392
|
+
listPlatformIssueReplies(issueId: string): Promise<PlatformIssueReply[]>;
|
|
7393
|
+
/**
|
|
7394
|
+
* Platform issue 에 follow-up reply 작성.
|
|
7395
|
+
*
|
|
7396
|
+
* 단말 상태(resolved/wontfix/duplicate) issue 는 reply 거부 — 새 issue 발행 권장.
|
|
7397
|
+
*/
|
|
7398
|
+
replyToPlatformIssue(issueId: string, body: string): Promise<PlatformIssueReply>;
|
|
7399
|
+
/**
|
|
7400
|
+
* 본인이 발행한 platform issue 의 처리 진행 상황을 단건 조회.
|
|
7401
|
+
*
|
|
7402
|
+
* AI 가 "내가 발행한 이슈 처리됐어?" 를 폴링하는 표준 경로. status / resolution_note /
|
|
7403
|
+
* triage_summary / external_links 로 ConnectBase 운영팀의 처리 상태를 확인.
|
|
7404
|
+
*
|
|
7405
|
+
* @throws ApiError 404 — 본인 issue 가 아니거나 존재하지 않음
|
|
7406
|
+
*/
|
|
7407
|
+
getPlatformIssue(issueId: string): Promise<PlatformIssueDetail>;
|
|
7408
|
+
/**
|
|
7409
|
+
* 본인 app 으로 발행한 platform issue 목록 (cursor 페이지네이션).
|
|
7410
|
+
*
|
|
7411
|
+
* status/severity/category 필터 + `since_updated_at` 으로 미해결만 폴링하는 사용 패턴 권장:
|
|
7412
|
+
*
|
|
7413
|
+
* ```typescript
|
|
7414
|
+
* const { issues } = await cb.support.listMyPlatformIssues({ status: ['open', 'triaged', 'in_progress'] })
|
|
7415
|
+
* ```
|
|
7416
|
+
*/
|
|
7417
|
+
listMyPlatformIssues(opts?: ListMyPlatformIssuesOptions): Promise<PlatformIssueListPage>;
|
|
7418
|
+
}
|
|
7419
|
+
/**
|
|
7420
|
+
* ConnectBase 플랫폼 이슈 카테고리.
|
|
7421
|
+
*/
|
|
7422
|
+
type PlatformIssueCategory = 'bug' | 'feature_request' | 'sdk' | 'billing' | 'security' | 'performance' | 'docs' | 'other';
|
|
7423
|
+
type PlatformIssueSeverity = 'low' | 'medium' | 'high' | 'critical';
|
|
7424
|
+
interface ReportPlatformBugRequest {
|
|
7425
|
+
/** 제목 (≤200) */
|
|
7426
|
+
title: string;
|
|
7427
|
+
/** 본문 (≤16KB, markdown) */
|
|
7428
|
+
body: string;
|
|
7429
|
+
/** 카테고리. 기본 `other`. AI triage 가 보정. */
|
|
7430
|
+
category?: PlatformIssueCategory;
|
|
7431
|
+
/** 긴급도. 기본 `medium`. AI triage 가 보정. */
|
|
7432
|
+
severity?: PlatformIssueSeverity;
|
|
7433
|
+
/** AppMember 가 없는 경우 회신용 이메일. */
|
|
7434
|
+
reporterEmail?: string;
|
|
7435
|
+
/** 익명 발행 시 reCAPTCHA v3 토큰 (운영팀이 RECAPTCHA_SECRET 설정한 경우). */
|
|
7436
|
+
recaptchaToken?: string;
|
|
7437
|
+
/** 자유 컨텍스트 (페이지 URL, request_id 등). PII 직접 포함 금지 — 호출자 책임. */
|
|
7438
|
+
metadata?: Record<string, unknown>;
|
|
7439
|
+
/**
|
|
7440
|
+
* 자동 컨텍스트 첨부 on/off (기본 true).
|
|
7441
|
+
* false 로 설정하면 SDK 버전/플랫폼/breadcrumb/stack 모두 미첨부.
|
|
7442
|
+
*/
|
|
7443
|
+
attachAutomaticContext?: boolean;
|
|
7444
|
+
/**
|
|
7445
|
+
* 에러 객체. .stack 을 sanitize 후 자동 첨부.
|
|
7446
|
+
* stackTrace 와 둘 중 하나만 — error 가 우선.
|
|
7447
|
+
*/
|
|
7448
|
+
error?: Error;
|
|
7449
|
+
/** 직접 작성한 stack trace (≤32KB, SDK 가 sanitize). */
|
|
7450
|
+
stackTrace?: string;
|
|
7451
|
+
/** 호출자가 명시적으로 buffer 를 override (테스트/특수 케이스). */
|
|
7452
|
+
recentApiCalls?: RecentApiCall[];
|
|
7453
|
+
/** SDK 버전 override (자동 감지 실패 시). */
|
|
7454
|
+
sdkVersion?: string;
|
|
7455
|
+
/** SDK 플랫폼 override. */
|
|
7456
|
+
sdkPlatform?: 'web' | 'node' | 'unity' | 'godot' | 'unreal' | 'cli' | 'mcp' | 'other';
|
|
7457
|
+
/** 환경 (production/staging/development). 기본 unknown. */
|
|
7458
|
+
environment?: 'production' | 'staging' | 'development' | 'unknown';
|
|
7459
|
+
}
|
|
7460
|
+
interface ReportPlatformBugResponse {
|
|
7461
|
+
id: string;
|
|
7462
|
+
status: 'open';
|
|
7463
|
+
created_at: string;
|
|
7464
|
+
}
|
|
7465
|
+
/**
|
|
7466
|
+
* Platform issue thread 의 단일 reply.
|
|
7467
|
+
*
|
|
7468
|
+
* - `author_kind=admin`: ConnectBase 운영팀 응답
|
|
7469
|
+
* - `author_kind=user`: 본인이 작성
|
|
7470
|
+
* - `author_kind=system`: 자동 메시지 (상태 변경 알림 등)
|
|
7471
|
+
*/
|
|
7472
|
+
/**
|
|
7473
|
+
* Platform issue 의 처리 진행 상황 (reporter 시점).
|
|
7474
|
+
*
|
|
7475
|
+
* admin-only 필드(`assignee_user_id`, internal triage signal) 는 server 가 redact.
|
|
7476
|
+
*
|
|
7477
|
+
* 주요 필드:
|
|
7478
|
+
* - `status` : `open` → `triaged` → `in_progress` → `resolved` | `wontfix` | `duplicate`
|
|
7479
|
+
* - `resolution_note` : 단말 상태 진입 시 ConnectBase 운영팀이 작성한 처리 결과 (markdown)
|
|
7480
|
+
* - `triage_summary` : AI triage 가 작성한 1줄 요약
|
|
7481
|
+
* - `external_links` : 운영팀이 연결한 GitHub PR / Linear ticket 등
|
|
7482
|
+
* - `resolved_at` : `resolved`/`wontfix` 진입 시각 (해결됐는지 빠른 검사용)
|
|
7483
|
+
*/
|
|
7484
|
+
interface PlatformIssueDetail {
|
|
7485
|
+
id: string;
|
|
7486
|
+
reporter_kind: 'user' | 'app' | 'system';
|
|
7487
|
+
title: string;
|
|
7488
|
+
body: string;
|
|
7489
|
+
category: PlatformIssueCategory;
|
|
7490
|
+
severity: PlatformIssueSeverity;
|
|
7491
|
+
status: 'open' | 'triaged' | 'in_progress' | 'resolved' | 'wontfix' | 'duplicate';
|
|
7492
|
+
resolution_note?: string;
|
|
7493
|
+
sdk_version?: string;
|
|
7494
|
+
sdk_platform?: 'web' | 'node' | 'unity' | 'godot' | 'unreal' | 'cli' | 'mcp' | 'other';
|
|
7495
|
+
environment?: 'production' | 'staging' | 'development' | 'unknown';
|
|
7496
|
+
triage_summary?: string;
|
|
7497
|
+
triaged_at?: string;
|
|
7498
|
+
external_links?: Array<{
|
|
7499
|
+
kind: string;
|
|
7500
|
+
url: string;
|
|
7501
|
+
label?: string;
|
|
7502
|
+
}>;
|
|
7503
|
+
duplicate_of_id?: string;
|
|
7504
|
+
created_at: string;
|
|
7505
|
+
updated_at: string;
|
|
7506
|
+
resolved_at?: string;
|
|
7507
|
+
}
|
|
7508
|
+
/** `listMyPlatformIssues` 응답 페이지. */
|
|
7509
|
+
interface PlatformIssueListPage {
|
|
7510
|
+
issues: PlatformIssueDetail[];
|
|
7511
|
+
/** 다음 페이지 cursor. 빈 문자열/undefined 면 끝. */
|
|
7512
|
+
next_cursor?: string;
|
|
7513
|
+
}
|
|
7514
|
+
/** `listMyPlatformIssues` 옵션. */
|
|
7515
|
+
interface ListMyPlatformIssuesOptions {
|
|
7516
|
+
/** 다중 status 필터. 미지정 시 전체. 처리중만 보려면 `['open','triaged','in_progress']`. */
|
|
7517
|
+
status?: PlatformIssueDetail['status'][];
|
|
7518
|
+
severity?: PlatformIssueSeverity[];
|
|
7519
|
+
category?: PlatformIssueCategory[];
|
|
7520
|
+
/** RFC3339 timestamp — 이후 update 된 issue 만. polling 시 마지막 fetch 시각 전달. */
|
|
7521
|
+
sinceUpdatedAt?: string;
|
|
7522
|
+
/** 이전 페이지 응답의 `next_cursor`. */
|
|
7523
|
+
cursor?: string;
|
|
7524
|
+
/** 페이지 크기. 기본 50, 최대 200. */
|
|
7525
|
+
limit?: number;
|
|
7526
|
+
}
|
|
7527
|
+
interface PlatformIssueReply {
|
|
7528
|
+
id: string;
|
|
7529
|
+
issue_id: string;
|
|
7530
|
+
author_kind: 'admin' | 'user' | 'system';
|
|
7531
|
+
author_user_id?: string;
|
|
7532
|
+
author_member_id?: string;
|
|
7533
|
+
body: string;
|
|
7534
|
+
is_internal: boolean;
|
|
7535
|
+
created_at: string;
|
|
7317
7536
|
}
|
|
7318
7537
|
|
|
7319
7538
|
/**
|
|
@@ -7525,6 +7744,23 @@ interface ConnectBaseConfig {
|
|
|
7525
7744
|
* ```
|
|
7526
7745
|
*/
|
|
7527
7746
|
onTokenExpired?: () => void;
|
|
7747
|
+
/**
|
|
7748
|
+
* `/v1/auth/re-issue` 의 일시적 실패 (5xx, 네트워크 오류, abort, 손상된 200 응답) 시 호출.
|
|
7749
|
+
*
|
|
7750
|
+
* 이 경우 토큰은 폐기되지 않으며 `onTokenExpired` 도 호출되지 않습니다 — 다음 호출에서
|
|
7751
|
+
* backoff 만료 후 자동 재시도. 사용자에게 "연결이 잠시 불안정합니다" 같은 비파괴적
|
|
7752
|
+
* 알림을 띄울 때 사용. permanent (refresh token 자체 무효) 와 분리하기 위함.
|
|
7753
|
+
*
|
|
7754
|
+
* @example
|
|
7755
|
+
* ```typescript
|
|
7756
|
+
* const cb = new ConnectBase({
|
|
7757
|
+
* publicKey: '...',
|
|
7758
|
+
* onTransientRefreshFailure: (err) => toast.warn('연결이 불안정합니다. 잠시 후 자동 복구됩니다.'),
|
|
7759
|
+
* onTokenExpired: () => { window.location.href = '/login' },
|
|
7760
|
+
* })
|
|
7761
|
+
* ```
|
|
7762
|
+
*/
|
|
7763
|
+
onTransientRefreshFailure?: (error: Error) => void;
|
|
7528
7764
|
/**
|
|
7529
7765
|
* 토큰 저장 방식.
|
|
7530
7766
|
* - 'none' (기본·권장): access token 만 메모리. refresh token 은 서버 HttpOnly cookie 로
|