@reopt-ai/brandapp-sdk 4.1.0 → 4.3.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +37 -2
  2. package/dist/ai/index.d.ts +1 -1
  3. package/dist/ai/index.js +1 -1
  4. package/dist/ai-provider/index.js +2 -2
  5. package/dist/analytics/index.d.ts +1 -1
  6. package/dist/analytics/index.js +1 -1
  7. package/dist/auth/index.d.ts +1 -1
  8. package/dist/auth/index.js +1 -1
  9. package/dist/better-auth/index.d.ts +12 -2
  10. package/dist/better-auth/index.js +8 -3
  11. package/dist/{client-Ckm-i_Du.d.ts → client-B4CiEei5.d.ts} +7 -5
  12. package/dist/{client-DHZ484kb.d.ts → client-BBxhqs8l.d.ts} +2 -2
  13. package/dist/{client-CTefnLKY.js → client-BD1-resY.js} +3 -3
  14. package/dist/{client-Dx3sYx7V.js → client-BMgVQ4U-.js} +8 -8
  15. package/dist/{client-A4YrHjDc.d.ts → client-BOEyVc8V.d.ts} +2 -2
  16. package/dist/{client-DE3FvPFs.js → client-BVvAfEXG.js} +2 -2
  17. package/dist/{client-Dnp7_J0-.js → client-BpEWDfSl.js} +2 -2
  18. package/dist/{client-CP9RSAzn.js → client-CIUecAJE.js} +2 -2
  19. package/dist/{client-yBQen4Yi.d.ts → client-CNPfjmT0.d.ts} +2 -2
  20. package/dist/{client-BGLDrf3N.d.ts → client-CRim5LCH.d.ts} +2 -2
  21. package/dist/{client-CHp-oNJB.js → client-CaWHvclV.js} +3 -3
  22. package/dist/{client-D_7G37OB.js → client-D4kUDFwW.js} +2 -2
  23. package/dist/{client-DZu4msTG.d.ts → client-D5F6-YYU.d.ts} +2 -2
  24. package/dist/{client-DPbXH8tr.d.ts → client-DA9ibl3G.d.ts} +10 -10
  25. package/dist/{client-BTS6Ewv_.d.ts → client-DYammrtw.d.ts} +2 -2
  26. package/dist/{client-CAGo56KO.d.ts → client-DjgoTlfv.d.ts} +2 -2
  27. package/dist/{client-2IaU8yUs.js → client-Hc7SfeIf.js} +2 -2
  28. package/dist/{client-DfEeaOsQ.d.ts → client-bXAnGNzC.d.ts} +2 -2
  29. package/dist/{client-SwByFT8p.js → client-p4LmfF27.js} +2 -2
  30. package/dist/{client-mvcEj1Vq.js → client-vjIDamSf.js} +3 -3
  31. package/dist/cms/index.d.ts +1 -1
  32. package/dist/cms/index.js +1 -1
  33. package/dist/{config-C7WQtC3l.d.ts → config-D28P8iwm.d.ts} +42 -4
  34. package/dist/{config-tEsB7QhQ.js → config-D8dSL6OQ.js} +20 -6
  35. package/dist/dev/index.d.ts +1 -1
  36. package/dist/dev/index.js +114 -21
  37. package/dist/eav/index.d.ts +13 -4
  38. package/dist/eav/index.js +46 -3
  39. package/dist/eav/migrate.d.ts +4 -4
  40. package/dist/eav/migrate.js +1 -1
  41. package/dist/eav/schema.d.ts +2 -2
  42. package/dist/{errors-CRCcErNC.d.ts → errors-U3TsyWVq.d.ts} +10 -3
  43. package/dist/feedback/index.d.ts +1 -1
  44. package/dist/feedback/index.js +1 -1
  45. package/dist/files/index.d.ts +1 -1
  46. package/dist/files/index.js +1 -1
  47. package/dist/{http-client-CCFmwnaQ.js → http-client-0Sp8wQGQ.js} +2 -2
  48. package/dist/{index-DV_OWwx5.d.ts → index-C6fyJTud.d.ts} +7 -1
  49. package/dist/{index-DJMr3ixA.d.ts → index-DwIr8W3Y.d.ts} +12 -12
  50. package/dist/index.d.ts +6 -6
  51. package/dist/index.js +13 -13
  52. package/dist/logout/index.d.ts +1 -1
  53. package/dist/logout/index.js +1 -1
  54. package/dist/plans/index.d.ts +1 -1
  55. package/dist/plans/index.js +1 -1
  56. package/dist/push/index.d.ts +1 -1
  57. package/dist/push/index.js +1 -1
  58. package/dist/{query-Bsgb85OE.js → query-C18XolkY.js} +2 -2
  59. package/dist/react/hooks.d.ts +6 -6
  60. package/dist/react/hooks.js +1 -1
  61. package/dist/terms/index.d.ts +1 -1
  62. package/dist/terms/index.js +1 -1
  63. package/dist/testing/index.d.ts +2 -2
  64. package/docs/api-reference.md +38 -1
  65. package/docs/dev-server.md +1 -1
  66. package/docs/errors.md +18 -16
  67. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,41 @@ This project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+
12
+ - `FeedbackStatus`에 `resolved`(해결됨)가 추가됐다 — `responded`는 "답변함", `resolved`는 "고쳐졌다/결론이 났다"를 뜻한다. `feedback.list({ status })` 필터와 응답의 `status`에 그대로 나타난다.
13
+
14
+ ### Changed
15
+
16
+ - 로컬 dev EAV 서버의 레코드/엔티티 상한이 production과 같이 `BRANDAPP_EAV_MAX_RECORDS_PER_ENTITY`를 읽는다(기본 10,000).
17
+ - 문서: 필터 연산자 목록에 `in`/`notIn`, `expiresAt`는 클라이언트 계산 절대 시각이라는 주의.
18
+
19
+ ## [4.2.0] — 2026-08-30
20
+
21
+ ### Added
22
+
23
+ - EAV 레코드에 `version`(낙관적 동시성 토큰)·`expiresAt`(TTL)이 응답에 실린다.
24
+ `records.update(entityId, id, { ifVersion })`는 읽은 version과 다르면 412
25
+ `PreconditionFailedError`로 거부한다 — 자체 version 속성 + read-modify-write 우회가
26
+ 필요 없다. `increments: { [attributeId]: delta }`는 number 속성을 서버에서 원자
27
+ 가감한다(동시 호출이 서로를 잃지 않는다). `expiresAt`(create·update, ISO 8601)은
28
+ 지나면 읽기·count·unique 검사에서 사라지고 서버 크론이 매시 물리 삭제한다 —
29
+ claim/lease/큐 엔티티를 unique 키 + TTL 하나로 대체할 수 있다. `update`의 `values`는
30
+ 이제 optional(increments·expiresAt만 보내는 호출 허용). 로컬 dev 서버가 같은 의미를
31
+ 미러한다.
32
+ - 필터 후보가 인메모리 상한(10,000행)을 넘는 요청은 422 `QUERY_TOO_BROAD`로 명시적으로
33
+ 거부된다(조용한 절단 없음) — `eq`/`in`처럼 인덱스로 좁혀지는 필터나 `authUserId`를 앞에
34
+ 둘 것.
35
+
36
+ ### Fixed
37
+
38
+ - `createReoptOAuth()`가 authorize/token/userinfo 엔드포인트를 명시한다. Better Auth 1.7은
39
+ discovery를 init 때 한 번만 가져오고, `accountIssuer`가 고정돼 있으면 실패해도 init은
40
+ 살지만 엔드포인트가 비어 그 인스턴스의 로그인이 전부 죽었다(재시작 전까지). 명시값은
41
+ `??=`라 discovery가 덮지 못한다.
42
+ - 로컬 개발 EAV 서버가 브랜드앱당 엔티티를 50개로 제한하지 않으며, 같은 이름의
43
+ 엔티티 생성 요청은 기존 엔티티를 반환해 멱등하게 처리한다.
44
+
10
45
  ## [4.1.0] — 2026-08-24
11
46
 
12
47
  ### Added
@@ -373,7 +408,7 @@ OIDC **Single Logout** 상호운용 — reopt와 외부 앱 사이 세션 종료
373
408
 
374
409
  - **에러 형태 통일** — HTTP 상태 → typed 에러 매핑을 단일 출처(`mapHttpStatusToError`)로
375
410
  통합. 비스트림 HTTP / SSE 스트리밍 / AI SDK provider가 동일한 코드·진단을 갖는 에러를
376
- 생성한다. **스트리밍 402/크레딧 소진이 이제 `CreditLimitError`(`.diagnostic` 포함)로**
411
+ 생성한다. **스트리밍 402/사용량 소진이 이제 `CreditLimitError`(`.diagnostic` 포함)로**
377
412
  표면화된다(이전엔 `STREAM_ERROR`로 뭉뚱그려짐).
378
413
  - **provider 에러 = `APICallError`** — AI SDK provider는 bare `Error` 대신
379
414
  `APICallError`를 던진다 → AI SDK 내장 재시도(`isRetryable`)가 동작하고, `error.data.code`
@@ -407,7 +442,7 @@ OIDC **Single Logout** 상호운용 — reopt와 외부 앱 사이 세션 종료
407
442
  생성이 스트림 도중 끊기던 문제, provider가 첫 토큰 후 stall 시 무한 hang하던 문제를
408
443
  함께 해소. 공통 로직은 신규 `core/abort.ts`(`createManagedAbort`).
409
444
  - **비멱등 재시도 차단** — POST/PATCH는 5xx·네트워크·timeout 시 기본적으로 **재시도하지
410
- 않음**(중복 레코드 생성·중복 크레딧 차감·중복 동의 방지). 429(rate limit)는 메서드와
445
+ 않음**(중복 레코드 생성·중복 사용량 차감·중복 동의 방지). 429(rate limit)는 메서드와
411
446
  무관하게 항상 재시도. 옵트인 `config.retryNonIdempotent: true`로 복원 가능. 변이
412
447
  요청에는 `Idempotency-Key`(요청 id) 헤더를 부여해 서버측 dedup 연동 가능.
413
448
  - **백오프 jitter + cap** — 지수 백오프에 full jitter(`[base/2, base]`)와 30s 상한 추가
@@ -1,2 +1,2 @@
1
- import { a as CompletionOptions, c as FinishReason, d as MessageRole, f as ModelInfo, i as ChatMessage, l as ImageGenerateOptions, m as StreamEvent, n as createReoptAiClient, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, t as ReoptAiClient, u as ImageGenerateResult } from "../client-DPbXH8tr.js";
1
+ import { a as CompletionOptions, c as FinishReason, d as MessageRole, f as ModelInfo, i as ChatMessage, l as ImageGenerateOptions, m as StreamEvent, n as createReoptAiClient, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, t as ReoptAiClient, u as ImageGenerateResult } from "../client-DA9ibl3G.js";
2
2
  export { type AgentInfo, type ChatMessage, type CompletionOptions, type CompletionResult, type CreditInfo, type FinishReason, type ImageGenerateOptions, type ImageGenerateResult, type MessageRole, type ModelInfo, ReoptAiClient, type StreamDoneData, type StreamEvent, createReoptAiClient };
package/dist/ai/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as createReoptAiClient, t as ReoptAiClient } from "../client-Dx3sYx7V.js";
1
+ import { n as createReoptAiClient, t as ReoptAiClient } from "../client-BMgVQ4U-.js";
2
2
 
3
3
  export { ReoptAiClient, createReoptAiClient };
@@ -1,4 +1,4 @@
1
- import { A as mapHttpStatusToError, i as resolveBaseUrl, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-tEsB7QhQ.js";
1
+ import { i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-D8dSL6OQ.js";
2
2
  import { t as createManagedAbort } from "../abort--nOBFN4M.js";
3
3
  import { t as createAuthHeader } from "../encoding-Bwfm3iaE.js";
4
4
  import { t as createSSELineProcessor } from "../sse-parser-FMjxM7sY.js";
@@ -637,7 +637,7 @@ var BrandappLanguageModel = class {
637
637
  * Vercel AI SDK와 호환되는 커스텀 프로바이더를 생성합니다.
638
638
  *
639
639
  * **지원**: `generateText()`, `streamText()` (텍스트 생성), `generateImage()`
640
- * (이미지 생성), `providerMetadata.brandapp`(크레딧/사용량), `providerOptions.brandapp`.
640
+ * (이미지 생성), `providerMetadata.brandapp`(사용량/사용량), `providerOptions.brandapp`.
641
641
  *
642
642
  * **미지원** (호출 시 `warnings`로 알리고 해당 부분은 무시됨): tool/function calling,
643
643
  * 구조화 출력(`generateObject`/`responseFormat: json`), 비전·파일 입력, `topP`/`topK`/
@@ -1,4 +1,4 @@
1
- import { n as createReoptAnalyticsClient, r as AnalyticsConfig, t as ReoptAnalyticsClient } from "../client-DZu4msTG.js";
1
+ import { n as createReoptAnalyticsClient, r as AnalyticsConfig, t as ReoptAnalyticsClient } from "../client-D5F6-YYU.js";
2
2
  import { identify, pageView, setConsent, track } from "@reopt-ai/data-sdk";
3
3
  //#region src/analytics/browser.d.ts
4
4
  type BrandappAnalytics = {
@@ -1,4 +1,4 @@
1
- import { n as createReoptAnalyticsClient, t as ReoptAnalyticsClient } from "../client-2IaU8yUs.js";
1
+ import { n as createReoptAnalyticsClient, t as ReoptAnalyticsClient } from "../client-Hc7SfeIf.js";
2
2
  import { getInstance, identify, init, pageView, setConsent, track } from "@reopt-ai/data-sdk";
3
3
 
4
4
  //#region src/analytics/browser.ts
@@ -1,4 +1,4 @@
1
- import { i as UserInfoClaims, n as createReoptAuthClient, r as LinkCurrentUserResult, t as ReoptAuthClient } from "../client-yBQen4Yi.js";
1
+ import { i as UserInfoClaims, n as createReoptAuthClient, r as LinkCurrentUserResult, t as ReoptAuthClient } from "../client-CNPfjmT0.js";
2
2
  //#region src/auth/session.d.ts
3
3
  /**
4
4
  * 세션 쿠키 검증 — apps/id의 Better Auth `/api/auth/get-session`을 호출해
@@ -1,4 +1,4 @@
1
- import { n as createReoptAuthClient, t as ReoptAuthClient } from "../client-CP9RSAzn.js";
1
+ import { n as createReoptAuthClient, t as ReoptAuthClient } from "../client-CIUecAJE.js";
2
2
 
3
3
  //#region src/auth/session.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { n as ReoptSDKConfig, t as REOPT_BASE_URLS } from "../config-C7WQtC3l.js";
1
+ import { n as ReoptSDKConfig, t as REOPT_BASE_URLS } from "../config-D28P8iwm.js";
2
2
  import { i as REOPT_PROVIDER_ID, n as AdapterRequestBody, r as REOPT_DEFAULT_SCOPES, t as AdapterOperation } from "../types-MXLudLBP.js";
3
- import { _ as ReoptSDKError, b as ServerError, g as RateLimitError, t as AuthError, w as isReoptSDKError } from "../errors-CRCcErNC.js";
3
+ import { T as isReoptSDKError, _ as RateLimitError, t as AuthError, v as ReoptSDKError, x as ServerError } from "../errors-U3TsyWVq.js";
4
4
  import { AdapterFactory } from "better-auth/adapters";
5
5
  import { BetterAuthOptions, BetterAuthPlugin } from "better-auth";
6
6
  //#region src/better-auth/adapter.d.ts
@@ -25,6 +25,16 @@ declare function createReoptAdapter(config: ReoptSDKConfig): AdapterFactory<Bett
25
25
  type ReoptOAuthOptions = ReoptSDKConfig & {
26
26
  /** Additional OAuth scopes */
27
27
  additionalScopes?: string[];
28
+ /**
29
+ * Account namespace (`account.issuer`) for users signed in through Reopt.
30
+ * Defaults to the id host (`https://id.reopt.ai`), which is exactly what
31
+ * Reopt's OIDC discovery document reports as `issuer` — so the default
32
+ * changes nothing for existing accounts.
33
+ *
34
+ * Set this only if you point `idBaseUrl` at a proxy whose discovery
35
+ * `issuer` differs from the URL you configured.
36
+ */
37
+ accountIssuer?: string;
28
38
  /**
29
39
  * How this client authenticates at Reopt's token endpoint. Must equal the
30
40
  * `token_endpoint_auth_method` the client was **registered** with — Better
@@ -1,5 +1,5 @@
1
- import { C as ServerError, D as isReoptSDKError, a as resolveIdBaseUrl, b as RateLimitError, s as AuthError, t as REOPT_BASE_URLS, x as ReoptSDKError } from "../config-tEsB7QhQ.js";
2
- import { t as BaseHttpClient } from "../http-client-CCFmwnaQ.js";
1
+ import { O as isReoptSDKError, S as ReoptSDKError, a as resolveIdBaseUrl, s as AuthError, t as REOPT_BASE_URLS, w as ServerError, x as RateLimitError } from "../config-D8dSL6OQ.js";
2
+ import { t as BaseHttpClient } from "../http-client-0Sp8wQGQ.js";
3
3
  import { n as REOPT_PROVIDER_ID, t as REOPT_DEFAULT_SCOPES } from "../types-DjDRszNj.js";
4
4
  import { createAdapterFactory } from "better-auth/adapters";
5
5
  import { genericOAuth } from "better-auth/plugins";
@@ -160,9 +160,14 @@ function createReoptAdapter(config) {
160
160
  function createReoptOAuth(options) {
161
161
  if (typeof window !== "undefined") throw new Error("[@reopt-ai/brandapp-sdk] createReoptOAuth() must be called on the server. It uses clientSecret — exposing it to the browser is a security risk. For client-side OAuth sign-in, use signInWithReopt() from '@reopt-ai/brandapp-sdk/better-auth/client' instead.");
162
162
  if (!options.clientId || !options.clientSecret) throw new Error("[@reopt-ai/brandapp-sdk] createReoptOAuth() requires clientId and clientSecret.");
163
+ const idBaseUrl = resolveIdBaseUrl(options);
163
164
  return genericOAuth({ config: [{
164
165
  providerId: REOPT_PROVIDER_ID,
165
- discoveryUrl: `${resolveIdBaseUrl(options)}/api/auth/.well-known/openid-configuration`,
166
+ discoveryUrl: `${idBaseUrl}/api/auth/.well-known/openid-configuration`,
167
+ accountIssuer: options.accountIssuer ?? idBaseUrl,
168
+ authorizationUrl: `${idBaseUrl}/api/auth/oauth2/authorize`,
169
+ tokenUrl: `${idBaseUrl}/api/auth/oauth2/token`,
170
+ userInfoUrl: `${idBaseUrl}/api/auth/oauth2/userinfo`,
166
171
  clientId: options.clientId,
167
172
  clientSecret: options.clientSecret,
168
173
  tokenEndpointAuth: { method: options.tokenEndpointAuthMethod ?? "client_secret_post" },
@@ -1,10 +1,12 @@
1
- import { n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
1
+ import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
2
2
  //#region src/feedback/types.d.ts
3
3
  /**
4
- * Feedback processing status. `reopened` means the customer replied after the
5
- * staff had answered — the thread is waiting on the workspace again.
4
+ * Feedback processing status. `responded` means staff have answered but the
5
+ * matter may still be open; `resolved` means the workspace declared it fixed or
6
+ * concluded. `reopened` means the customer replied after the staff had answered
7
+ * — the thread is waiting on the workspace again.
6
8
  */
7
- type FeedbackStatus = "new" | "in_progress" | "responded" | "reopened" | "archived";
9
+ type FeedbackStatus = "new" | "in_progress" | "responded" | "resolved" | "reopened" | "archived";
8
10
  /** Who wrote a message in the feedback thread. */
9
11
  type FeedbackReplyAuthor = "staff" | "customer";
10
12
  /**
@@ -144,4 +146,4 @@ declare class ReoptFeedbackClient {
144
146
  declare function createReoptFeedbackClient(config: ReoptSDKConfig): ReoptFeedbackClient;
145
147
  //#endregion
146
148
  export { CreateFeedbackResult as a, FeedbackListMeta as c, FeedbackReplyAuthor as d, FeedbackStatus as f, CreateFeedbackReplyResult as i, FeedbackListResult as l, RateFeedbackReplyResult as m, createReoptFeedbackClient as n, Feedback as o, ListFeedbackQuery as p, CreateFeedbackInput as r, FeedbackDetail as s, ReoptFeedbackClient as t, FeedbackReply as u };
147
- //# sourceMappingURL=client-Ckm-i_Du.d.ts.map
149
+ //# sourceMappingURL=client-B4CiEei5.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
1
+ import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
2
2
  import { a as CreateConsentsResult, f as WithdrawConsentResult, i as CreateConsentsRequest, l as TermsListResponse, n as ConsentRecord, o as ListTermsOptions, s as TermsItem } from "./types-C69OzBn6.js";
3
3
  //#region src/terms/client.d.ts
4
4
  declare class ReoptTermsClient {
@@ -45,4 +45,4 @@ declare class ReoptTermsClient {
45
45
  declare function createReoptTermsClient(config: ReoptSDKConfig): ReoptTermsClient;
46
46
  //#endregion
47
47
  export { createReoptTermsClient as n, ReoptTermsClient as t };
48
- //# sourceMappingURL=client-DHZ484kb.d.ts.map
48
+ //# sourceMappingURL=client-BBxhqs8l.d.ts.map
@@ -1,5 +1,5 @@
1
- import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
2
- import { t as buildQuery } from "./query-Bsgb85OE.js";
1
+ import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
2
+ import { t as buildQuery } from "./query-C18XolkY.js";
3
3
 
4
4
  //#region src/cms/client.ts
5
5
  function createReoptCmsClient(config) {
@@ -52,4 +52,4 @@ async list(query) {
52
52
 
53
53
  //#endregion
54
54
  export { createReoptCmsClient as t };
55
- //# sourceMappingURL=client-CTefnLKY.js.map
55
+ //# sourceMappingURL=client-BD1-resY.js.map
@@ -1,6 +1,6 @@
1
- import { A as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-tEsB7QhQ.js";
1
+ import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-D8dSL6OQ.js";
2
2
  import { t as createManagedAbort } from "./abort--nOBFN4M.js";
3
- import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
3
+ import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
4
4
  import { n as parseSSEStream } from "./sse-parser-FMjxM7sY.js";
5
5
 
6
6
  //#region src/ai/client.ts
@@ -88,7 +88,7 @@ var ReoptAiClient = class {
88
88
  /**
89
89
  * AI 텍스트 생성 (SSE 스트리밍 + 메타데이터)
90
90
  *
91
- * 텍스트 청크와 함께 최종 사용량/크레딧 메타데이터를 반환합니다.
91
+ * 텍스트 청크와 함께 최종 사용량/사용량 메타데이터를 반환합니다.
92
92
  *
93
93
  * @example
94
94
  * ```ts
@@ -102,7 +102,7 @@ var ReoptAiClient = class {
102
102
  * }
103
103
  *
104
104
  * const meta = await metadata;
105
- * console.log(`사용 크레딧: ${meta?.usage.creditCost}`);
105
+ * console.log(`사용 사용량: ${meta?.usage.creditCost}`);
106
106
  * ```
107
107
  */
108
108
  streamWithMetadata(options) {
@@ -160,7 +160,7 @@ var ReoptAiClient = class {
160
160
  /**
161
161
  * 이미지 생성
162
162
  *
163
- * BrandApp의 AI 크레딧으로 이미지를 생성합니다.
163
+ * BrandApp의 AI 사용량으로 이미지를 생성합니다.
164
164
  * 생성된 이미지는 자동으로 Vercel Blob에 저장되고 URL이 반환됩니다.
165
165
  *
166
166
  * @example
@@ -185,7 +185,7 @@ var ReoptAiClient = class {
185
185
  })).data;
186
186
  }
187
187
  /**
188
- * 크레딧 잔액 조회
188
+ * 사용량 잔액 조회
189
189
  *
190
190
  * @example
191
191
  * ```ts
@@ -224,7 +224,7 @@ var ReoptAiClient = class {
224
224
  }
225
225
  async fetchSSE(options) {
226
226
  const url = `${this.http.requestBaseUrl}/chat/completions`;
227
- const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.1.0"}-${url.length}`;
227
+ const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.2.0"}-${url.length}`;
228
228
  const ctx = {
229
229
  method: "POST",
230
230
  url,
@@ -302,4 +302,4 @@ function createReoptAiClient(config) {
302
302
 
303
303
  //#endregion
304
304
  export { createReoptAiClient as n, ReoptAiClient as t };
305
- //# sourceMappingURL=client-Dx3sYx7V.js.map
305
+ //# sourceMappingURL=client-BMgVQ4U-.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
1
+ import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
2
2
  //#region src/files/types.d.ts
3
3
  /** 파일 정보 */
4
4
  type FileInfo = {
@@ -269,4 +269,4 @@ declare class ReoptFileClient {
269
269
  declare function createReoptFileClient(config: ReoptSDKConfig): ReoptFileClient;
270
270
  //#endregion
271
271
  export { FileListQuery as a, FolderInfo as c, UpdateFolderInput as d, UploadOptions as f, FileInfo as i, FolderListQuery as l, createReoptFileClient as n, FileListResponse as o, CreateFolderInput as r, FileUsageInfo as s, ReoptFileClient as t, UpdateFileInput as u };
272
- //# sourceMappingURL=client-A4YrHjDc.d.ts.map
272
+ //# sourceMappingURL=client-BOEyVc8V.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
1
+ import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
2
2
 
3
3
  //#region src/plans/client.ts
4
4
  function unwrap(body) {
@@ -78,4 +78,4 @@ function createReoptPlansClient(config) {
78
78
 
79
79
  //#endregion
80
80
  export { createReoptPlansClient as n, ReoptPlansClient as t };
81
- //# sourceMappingURL=client-DE3FvPFs.js.map
81
+ //# sourceMappingURL=client-BVvAfEXG.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
1
+ import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
2
2
 
3
3
  //#region src/terms/client.ts
4
4
  function unwrap(body) {
@@ -80,4 +80,4 @@ function createReoptTermsClient(config) {
80
80
 
81
81
  //#endregion
82
82
  export { createReoptTermsClient as n, ReoptTermsClient as t };
83
- //# sourceMappingURL=client-Dnp7_J0-.js.map
83
+ //# sourceMappingURL=client-BpEWDfSl.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
1
+ import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
2
2
 
3
3
  //#region src/auth/client.ts
4
4
  function unwrap(body) {
@@ -50,4 +50,4 @@ function createReoptAuthClient(config) {
50
50
 
51
51
  //#endregion
52
52
  export { createReoptAuthClient as n, ReoptAuthClient as t };
53
- //# sourceMappingURL=client-CP9RSAzn.js.map
53
+ //# sourceMappingURL=client-CIUecAJE.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
1
+ import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
2
2
  //#region src/auth/types.d.ts
3
3
  /**
4
4
  * User-scoped auth types.
@@ -68,4 +68,4 @@ declare class ReoptAuthClient {
68
68
  declare function createReoptAuthClient(config: ReoptSDKConfig): ReoptAuthClient;
69
69
  //#endregion
70
70
  export { UserInfoClaims as i, createReoptAuthClient as n, LinkCurrentUserResult as r, ReoptAuthClient as t };
71
- //# sourceMappingURL=client-yBQen4Yi.d.ts.map
71
+ //# sourceMappingURL=client-CNPfjmT0.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
1
+ import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
2
2
  //#region src/plans/types.d.ts
3
3
  /**
4
4
  * Brandapp Plans types.
@@ -208,4 +208,4 @@ declare class ReoptPlansClient {
208
208
  declare function createReoptPlansClient(config: ReoptSDKConfig): ReoptPlansClient;
209
209
  //#endregion
210
210
  export { CheckoutStatus as a, MeterPricingMode as c, PlanInterval as d, PlanMeter as f, CheckoutSession as i, Plan as l, PlanRequiredTerms as m, createReoptPlansClient as n, CreateCheckoutInput as o, PlanMeterTier as p, CancelSubscriptionResult as r, CurrentPlan as s, ReoptPlansClient as t, PlanBillingModel as u };
211
- //# sourceMappingURL=client-BGLDrf3N.d.ts.map
211
+ //# sourceMappingURL=client-CRim5LCH.d.ts.map
@@ -1,5 +1,5 @@
1
- import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
2
- import { t as buildQuery } from "./query-Bsgb85OE.js";
1
+ import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
2
+ import { t as buildQuery } from "./query-C18XolkY.js";
3
3
 
4
4
  //#region src/eav/cache.ts
5
5
  var SchemaCache = class {
@@ -500,4 +500,4 @@ function createReoptEavClient(config) {
500
500
 
501
501
  //#endregion
502
502
  export { createReoptEavClient as t };
503
- //# sourceMappingURL=client-CHp-oNJB.js.map
503
+ //# sourceMappingURL=client-CaWHvclV.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
1
+ import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
2
2
 
3
3
  //#region src/push/client.ts
4
4
  var ReoptPushClient = class {
@@ -25,4 +25,4 @@ function createReoptPushClient(config) {
25
25
 
26
26
  //#endregion
27
27
  export { createReoptPushClient as n, ReoptPushClient as t };
28
- //# sourceMappingURL=client-D_7G37OB.js.map
28
+ //# sourceMappingURL=client-D4kUDFwW.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
1
+ import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
2
2
  //#region src/analytics/types.d.ts
3
3
  /** `GET /brandapp/{id}/analytics/config` — 브랜드의 reopt-data 브라우저 수집 설정. */
4
4
  type AnalyticsConfig = {
@@ -21,4 +21,4 @@ declare class ReoptAnalyticsClient {
21
21
  declare function createReoptAnalyticsClient(config: ReoptSDKConfig): ReoptAnalyticsClient;
22
22
  //#endregion
23
23
  export { createReoptAnalyticsClient as n, AnalyticsConfig as r, ReoptAnalyticsClient as t };
24
- //# sourceMappingURL=client-DZu4msTG.d.ts.map
24
+ //# sourceMappingURL=client-D5F6-YYU.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
1
+ import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
2
2
  //#region src/ai/types.d.ts
3
3
  /** 메시지 역할 */
4
4
  type MessageRole = "system" | "user" | "assistant";
@@ -50,11 +50,11 @@ type CompletionResult = {
50
50
  finishReason?: FinishReason;
51
51
  /**
52
52
  * true면 이 호출은 잔액을 초과해 차감됐다(출력은 이미 생성되어 반환되지만 잔액은
53
- * 0으로 소진). 다음 호출은 사전 크레딧 체크에서 차단된다 — "1회 후 차단" 의도.
53
+ * 0으로 소진). 다음 호출은 사전 사용량 체크에서 차단된다 — "1회 후 차단" 의도.
54
54
  */
55
55
  creditLimited?: boolean;
56
56
  };
57
- /** 크레딧 잔액 정보 */
57
+ /** 사용량 잔액 정보 */
58
58
  type CreditInfo = {
59
59
  balance: number;
60
60
  limit: number;
@@ -82,7 +82,7 @@ type ModelInfo = {
82
82
  inputRate: number;
83
83
  /** credits per 1K output tokens (image-only 모델은 0) */
84
84
  outputRate: number;
85
- /** 이미지 생성당 고정 크레딧 (image 모델 전용) */
85
+ /** 이미지 생성당 고정 사용량 (image 모델 전용) */
86
86
  creditsPerImage?: number;
87
87
  /** 최대 입력 컨텍스트 토큰 */
88
88
  contextWindow?: number;
@@ -124,7 +124,7 @@ type ImageGenerateResult = {
124
124
  usage: {
125
125
  creditCost: number;
126
126
  };
127
- /** 남은 크레딧 */
127
+ /** 남은 사용량 */
128
128
  creditsRemaining: number;
129
129
  /** true면 잔액 초과 차감(이미지는 반환되나 잔액 소진, 다음 호출 차단) */
130
130
  creditLimited?: boolean;
@@ -205,7 +205,7 @@ declare class ReoptAiClient {
205
205
  /**
206
206
  * AI 텍스트 생성 (SSE 스트리밍 + 메타데이터)
207
207
  *
208
- * 텍스트 청크와 함께 최종 사용량/크레딧 메타데이터를 반환합니다.
208
+ * 텍스트 청크와 함께 최종 사용량/사용량 메타데이터를 반환합니다.
209
209
  *
210
210
  * @example
211
211
  * ```ts
@@ -219,7 +219,7 @@ declare class ReoptAiClient {
219
219
  * }
220
220
  *
221
221
  * const meta = await metadata;
222
- * console.log(`사용 크레딧: ${meta?.usage.creditCost}`);
222
+ * console.log(`사용 사용량: ${meta?.usage.creditCost}`);
223
223
  * ```
224
224
  */
225
225
  streamWithMetadata(options: CompletionOptions): {
@@ -229,7 +229,7 @@ declare class ReoptAiClient {
229
229
  /**
230
230
  * 이미지 생성
231
231
  *
232
- * BrandApp의 AI 크레딧으로 이미지를 생성합니다.
232
+ * BrandApp의 AI 사용량으로 이미지를 생성합니다.
233
233
  * 생성된 이미지는 자동으로 Vercel Blob에 저장되고 URL이 반환됩니다.
234
234
  *
235
235
  * @example
@@ -245,7 +245,7 @@ declare class ReoptAiClient {
245
245
  */
246
246
  generateImage(options: ImageGenerateOptions): Promise<ImageGenerateResult>;
247
247
  /**
248
- * 크레딧 잔액 조회
248
+ * 사용량 잔액 조회
249
249
  *
250
250
  * @example
251
251
  * ```ts
@@ -281,4 +281,4 @@ declare class ReoptAiClient {
281
281
  declare function createReoptAiClient(config: ReoptSDKConfig): ReoptAiClient;
282
282
  //#endregion
283
283
  export { CompletionOptions as a, FinishReason as c, MessageRole as d, ModelInfo as f, ChatMessage as i, ImageGenerateOptions as l, StreamEvent as m, createReoptAiClient as n, CompletionResult as o, StreamDoneData as p, AgentInfo as r, CreditInfo as s, ReoptAiClient as t, ImageGenerateResult as u };
284
- //# sourceMappingURL=client-DPbXH8tr.d.ts.map
284
+ //# sourceMappingURL=client-DA9ibl3G.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
1
+ import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
2
2
  import { a as ListTagsQuery, c as PostGroup, d as Tag, i as ListPostsQuery, o as Post, r as ListPostGroupsQuery, s as PostDetail, t as CmsPaginatedResponse } from "./types-BXDcoJHG.js";
3
3
  //#region src/cms/client.d.ts
4
4
  /**
@@ -50,4 +50,4 @@ declare function createReoptCmsClient(config: ReoptSDKConfig): {
50
50
  };
51
51
  //#endregion
52
52
  export { createReoptCmsClient as n, ReoptCmsClient as t };
53
- //# sourceMappingURL=client-BTS6Ewv_.d.ts.map
53
+ //# sourceMappingURL=client-DYammrtw.d.ts.map
@@ -1,4 +1,4 @@
1
- import { A as UpdateEntityInput, C as EavEntity, D as ListRecordsQuery, M as UpsertRecordInput, N as UpsertRecordResult, O as PaginatedResponse, _ as CreateEntityInput, b as EavAttribute, c as InferValues, f as BackfillOptions, g as CreateAttributeInput, h as CountRecordsQuery, j as UpdateRecordInput, k as UpdateAttributeInput, l as SchemaDef, m as BulkUpdateItem, n as ReoptSDKConfig, p as BackfillResult, s as EntityDef, u as AttributeFilter, v as CreateRecordInput, w as EavRecord, y as DeleteWhereInput } from "./config-C7WQtC3l.js";
1
+ import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpsertRecordInput, I as UpsertRecordResult, M as UpdateAttributeInput, N as UpdateEntityInput, P as UpdateRecordInput, S as DeleteWhereInput, _ as BulkUpdateItem, b as CreateEntityInput, c as InferValues, f as AttributeFilter, g as BackfillResult, h as BackfillOptions, j as PaginatedResponse, l as SchemaDef, n as ReoptSDKConfig, s as EntityDef, v as CountRecordsQuery, x as CreateRecordInput, y as CreateAttributeInput } from "./config-D28P8iwm.js";
2
2
  //#region src/eav/typed-client.d.ts
3
3
  /** EavRecord with typed values instead of Record<string, unknown> */
4
4
  type TypedEavRecord<V> = Omit<EavRecord, "values"> & {
@@ -100,4 +100,4 @@ type ReoptEavClient<S extends SchemaDef = SchemaDef> = {
100
100
  declare function createReoptEavClient<S extends SchemaDef = SchemaDef>(config: ReoptSDKConfig<S>): ReoptEavClient<S>;
101
101
  //#endregion
102
102
  export { TypedEavRecord as i, createReoptEavClient as n, EntityClient as r, ReoptEavClient as t };
103
- //# sourceMappingURL=client-CAGo56KO.d.ts.map
103
+ //# sourceMappingURL=client-DjgoTlfv.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
1
+ import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
2
2
 
3
3
  //#region src/analytics/client.ts
4
4
  var ReoptAnalyticsClient = class {
@@ -17,4 +17,4 @@ function createReoptAnalyticsClient(config) {
17
17
 
18
18
  //#endregion
19
19
  export { createReoptAnalyticsClient as n, ReoptAnalyticsClient as t };
20
- //# sourceMappingURL=client-2IaU8yUs.js.map
20
+ //# sourceMappingURL=client-Hc7SfeIf.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-C7WQtC3l.js";
1
+ import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
2
2
  //#region src/push/types.d.ts
3
3
  /** Push provider — native token kind. */
4
4
  type PushProvider = "fcm" | "apns";
@@ -50,4 +50,4 @@ declare class ReoptPushClient {
50
50
  declare function createReoptPushClient(config: ReoptSDKConfig): ReoptPushClient;
51
51
  //#endregion
52
52
  export { RegisterPushTokenInput as a, UnregisterPushTokenInput as c, PushProvider as i, UnregisterPushTokenResult as l, createReoptPushClient as n, RegisterPushTokenResult as o, PushPlatform as r, RegisteredPushDevice as s, ReoptPushClient as t };
53
- //# sourceMappingURL=client-DfEeaOsQ.d.ts.map
53
+ //# sourceMappingURL=client-bXAnGNzC.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
1
+ import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
2
2
 
3
3
  //#region src/feedback/client.ts
4
4
  function buildListQuery(query) {
@@ -83,4 +83,4 @@ function createReoptFeedbackClient(config) {
83
83
 
84
84
  //#endregion
85
85
  export { createReoptFeedbackClient as n, ReoptFeedbackClient as t };
86
- //# sourceMappingURL=client-SwByFT8p.js.map
86
+ //# sourceMappingURL=client-p4LmfF27.js.map
@@ -1,6 +1,6 @@
1
- import { A as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, x as ReoptSDKError } from "./config-tEsB7QhQ.js";
1
+ import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-D8dSL6OQ.js";
2
2
  import { t as createManagedAbort } from "./abort--nOBFN4M.js";
3
- import { n as parseFieldErrors, t as BaseHttpClient } from "./http-client-CCFmwnaQ.js";
3
+ import { n as parseFieldErrors, t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
4
4
 
5
5
  //#region src/files/client.ts
6
6
  var ReoptFileClient = class {
@@ -270,4 +270,4 @@ function createReoptFileClient(config) {
270
270
 
271
271
  //#endregion
272
272
  export { createReoptFileClient as n, ReoptFileClient as t };
273
- //# sourceMappingURL=client-mvcEj1Vq.js.map
273
+ //# sourceMappingURL=client-vjIDamSf.js.map
@@ -1,5 +1,5 @@
1
1
  import { a as ListTagsQuery, c as PostGroup, d as Tag, i as ListPostsQuery, l as PostSeo, n as EditorSpec, o as Post, r as ListPostGroupsQuery, s as PostDetail, t as CmsPaginatedResponse, u as PostStatus } from "../types-BXDcoJHG.js";
2
- import { n as createReoptCmsClient, t as ReoptCmsClient } from "../client-BTS6Ewv_.js";
2
+ import { n as createReoptCmsClient, t as ReoptCmsClient } from "../client-DYammrtw.js";
3
3
  //#region src/cms/helpers.d.ts
4
4
  type SeoMetadata = {
5
5
  title?: string;
package/dist/cms/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createReoptCmsClient } from "../client-CTefnLKY.js";
1
+ import { t as createReoptCmsClient } from "../client-BD1-resY.js";
2
2
 
3
3
  //#region src/cms/helpers.ts
4
4
  function joinUrl(siteUrl, path) {